@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.mjs CHANGED
@@ -1094,7 +1094,7 @@ var useDataTable = ({
1094
1094
  isIndeterminate: table2.getIsSomeRowsSelected(),
1095
1095
  onChange: () => {
1096
1096
  if (table2.getIsAllRowsSelected()) {
1097
- table2.getToggleAllRowsSelectedHandler();
1097
+ table2.toggleAllRowsSelected();
1098
1098
  } else if (disabledRow) {
1099
1099
  const prevSelected = table2.getFilteredSelectedRowModel().rows.length;
1100
1100
  const rows = table2.getPaginationRowModel().rows.filter((row) => !disabledRow(row.original));
@@ -1104,7 +1104,7 @@ var useDataTable = ({
1104
1104
  table2.setRowSelection(Object.fromEntries(rows.map((row) => [row.id, true])));
1105
1105
  }
1106
1106
  } else {
1107
- table2.getToggleAllRowsSelectedHandler();
1107
+ table2.toggleAllRowsSelected();
1108
1108
  }
1109
1109
  }
1110
1110
  }
@@ -1122,7 +1122,7 @@ var useDataTable = ({
1122
1122
  ) })
1123
1123
  }
1124
1124
  ],
1125
- []
1125
+ [disabledRow]
1126
1126
  );
1127
1127
  const generateColumn = () => {
1128
1128
  if (withSelectedRow) {
@@ -1152,6 +1152,9 @@ var useDataTable = ({
1152
1152
  });
1153
1153
  const { getSelectedRowModel, toggleAllRowsSelected } = table;
1154
1154
  const { flatRows } = getSelectedRowModel();
1155
+ React5.useEffect(() => {
1156
+ table.setRowSelection(selectedRow != null ? selectedRow : {});
1157
+ }, [selectedRow]);
1155
1158
  React5.useEffect(() => {
1156
1159
  const rowData = flatRows.map((row) => row.original);
1157
1160
  if (onSelectedRow) {