{"version":3,"file":"ListItem.mjs","names":[],"sources":["../../../../../../../../components-base/src/list/item/ListItem.ts"],"sourcesContent":["import type { ListItemCollection } from \"./ListItemCollection\";\nimport type { Row } from \"@tanstack/table-core\";\n\n/** One row of the list, as the views see it: an id and the data behind it. */\nexport class ListItem<T> {\n  public readonly id: string;\n  public readonly data: T;\n  public readonly collection: ListItemCollection<T>;\n\n  public constructor(collection: ListItemCollection<T>, id: string, data: T) {\n    this.collection = collection;\n    this.id = id;\n    this.data = data;\n  }\n\n  public static fromRow<T>(\n    collection: ListItemCollection<T>,\n    row: Row<T>,\n  ): ListItem<T> {\n    return new ListItem(collection, row.id, row.original);\n  }\n}\n"],"mappings":";;;;AAIA,IAAa,WAAb,MAAa,SAAY;CACvB;CACA;CACA;CAEA,YAAmB,YAAmC,IAAY,MAAS;EACzE,KAAK,aAAa;EAClB,KAAK,KAAK;EACV,KAAK,OAAO;CACd;CAEA,OAAc,QACZ,YACA,KACa;EACb,OAAO,IAAI,SAAS,YAAY,IAAI,IAAI,IAAI,QAAQ;CACtD;AACF"}