mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
refactor(data-table): reuse rowIds
This commit is contained in:
parent
5c48fe76d1
commit
70c622f9eb
1 changed files with 7 additions and 6 deletions
|
@ -174,12 +174,13 @@
|
|||
let refSelectAll = null;
|
||||
|
||||
$: batchSelectedIds.set(selectedRowIds);
|
||||
$: expandableRowIds = rows
|
||||
.map((row) => row.id)
|
||||
.filter((id) => !nonExpandableRowIds.includes(id));
|
||||
$: selectableRowIds = rows
|
||||
.map((row) => row.id)
|
||||
.filter((id) => !nonSelectableRowIds.includes(id));
|
||||
$: rowIds = rows.map((row) => row.id);
|
||||
$: expandableRowIds = rowIds.filter(
|
||||
(id) => !nonExpandableRowIds.includes(id)
|
||||
);
|
||||
$: selectableRowIds = rowIds.filter(
|
||||
(id) => !nonSelectableRowIds.includes(id)
|
||||
);
|
||||
$: indeterminate =
|
||||
selectedRowIds.length > 0 && selectedRowIds.length < rows.length;
|
||||
$: if (batchExpansion) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue