@ctlyst.id/internal-ui 5.0.2 → 5.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1442,7 +1442,7 @@ var useDataTable = ({
|
|
1442
1442
|
isIndeterminate: table2.getIsSomeRowsSelected(),
|
1443
1443
|
onChange: () => {
|
1444
1444
|
if (table2.getIsAllRowsSelected()) {
|
1445
|
-
table2.
|
1445
|
+
table2.toggleAllRowsSelected();
|
1446
1446
|
} else if (disabledRow) {
|
1447
1447
|
const prevSelected = table2.getFilteredSelectedRowModel().rows.length;
|
1448
1448
|
const rows = table2.getPaginationRowModel().rows.filter((row) => !disabledRow(row.original));
|
@@ -1452,7 +1452,7 @@ var useDataTable = ({
|
|
1452
1452
|
table2.setRowSelection(Object.fromEntries(rows.map((row) => [row.id, true])));
|
1453
1453
|
}
|
1454
1454
|
} else {
|
1455
|
-
table2.
|
1455
|
+
table2.toggleAllRowsSelected();
|
1456
1456
|
}
|
1457
1457
|
}
|
1458
1458
|
}
|
@@ -1470,7 +1470,7 @@ var useDataTable = ({
|
|
1470
1470
|
) })
|
1471
1471
|
}
|
1472
1472
|
],
|
1473
|
-
[]
|
1473
|
+
[disabledRow]
|
1474
1474
|
);
|
1475
1475
|
const generateColumn = () => {
|
1476
1476
|
if (withSelectedRow) {
|
@@ -1500,6 +1500,9 @@ var useDataTable = ({
|
|
1500
1500
|
});
|
1501
1501
|
const { getSelectedRowModel, toggleAllRowsSelected } = table;
|
1502
1502
|
const { flatRows } = getSelectedRowModel();
|
1503
|
+
React5.useEffect(() => {
|
1504
|
+
table.setRowSelection(selectedRow != null ? selectedRow : {});
|
1505
|
+
}, [selectedRow]);
|
1503
1506
|
React5.useEffect(() => {
|
1504
1507
|
const rowData = flatRows.map((row) => row.original);
|
1505
1508
|
if (onSelectedRow) {
|