mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33: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;
|
let refSelectAll = null;
|
||||||
|
|
||||||
$: batchSelectedIds.set(selectedRowIds);
|
$: batchSelectedIds.set(selectedRowIds);
|
||||||
$: expandableRowIds = rows
|
$: rowIds = rows.map((row) => row.id);
|
||||||
.map((row) => row.id)
|
$: expandableRowIds = rowIds.filter(
|
||||||
.filter((id) => !nonExpandableRowIds.includes(id));
|
(id) => !nonExpandableRowIds.includes(id)
|
||||||
$: selectableRowIds = rows
|
);
|
||||||
.map((row) => row.id)
|
$: selectableRowIds = rowIds.filter(
|
||||||
.filter((id) => !nonSelectableRowIds.includes(id));
|
(id) => !nonSelectableRowIds.includes(id)
|
||||||
|
);
|
||||||
$: indeterminate =
|
$: indeterminate =
|
||||||
selectedRowIds.length > 0 && selectedRowIds.length < rows.length;
|
selectedRowIds.length > 0 && selectedRowIds.length < rows.length;
|
||||||
$: if (batchExpansion) {
|
$: if (batchExpansion) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue