schummar-table 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -935,7 +935,7 @@ function cleanupState(state) {
|
|
|
935
935
|
draft.sort = newSort;
|
|
936
936
|
setTimeout(() => {
|
|
937
937
|
var _a, _b;
|
|
938
|
-
(_b = (_a =
|
|
938
|
+
(_b = (_a = state.getState().props).onSortChange) == null ? void 0 : _b.call(_a, newSort);
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
941
|
for (const id of draft.filters.keys()) {
|
|
@@ -964,7 +964,7 @@ function cleanupState(state) {
|
|
|
964
964
|
draft.selection = newSelection;
|
|
965
965
|
setTimeout(() => {
|
|
966
966
|
var _a, _b;
|
|
967
|
-
(_b = (_a =
|
|
967
|
+
(_b = (_a = state.getState().props).onSelectionChange) == null ? void 0 : _b.call(_a, newSelection);
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
970
|
const newExpanded = intersect(draft.expanded, itemsById);
|
|
@@ -972,7 +972,7 @@ function cleanupState(state) {
|
|
|
972
972
|
draft.expanded = newExpanded;
|
|
973
973
|
setTimeout(() => {
|
|
974
974
|
var _a, _b;
|
|
975
|
-
(_b = (_a =
|
|
975
|
+
(_b = (_a = state.getState().props).onExpandedChange) == null ? void 0 : _b.call(_a, newExpanded);
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
}
|
|
@@ -983,8 +983,8 @@ function filterColumns(state) {
|
|
|
983
983
|
draft.activeColumns = orderBy(columns.filter((column) => !hiddenColumns.has(column.id)), [(column) => columnOrder.indexOf(column.id)]);
|
|
984
984
|
}, { runNow: true }), [state]);
|
|
985
985
|
}
|
|
986
|
-
function syncSelections(
|
|
987
|
-
react.useEffect(() =>
|
|
986
|
+
function syncSelections(table) {
|
|
987
|
+
react.useEffect(() => table.addReaction((state) => [state.props.selectSyncChildren, state.selection, state.activeItems], ([selectSyncChildren, selection, activeItems], state) => {
|
|
988
988
|
if (!selectSyncChildren)
|
|
989
989
|
return;
|
|
990
990
|
const newSelection = new Set(selection);
|
|
@@ -994,13 +994,13 @@ function syncSelections(state) {
|
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
if (newSelection.size !== selection.size) {
|
|
997
|
-
|
|
997
|
+
state.selection = newSelection;
|
|
998
998
|
setTimeout(() => {
|
|
999
999
|
var _a, _b;
|
|
1000
|
-
(_b = (_a =
|
|
1000
|
+
(_b = (_a = table.getState().props).onSelectionChange) == null ? void 0 : _b.call(_a, newSelection);
|
|
1001
1001
|
});
|
|
1002
1002
|
}
|
|
1003
|
-
}, { runNow: true }), [
|
|
1003
|
+
}, { runNow: true }), [table]);
|
|
1004
1004
|
}
|
|
1005
1005
|
function useTableState(_props) {
|
|
1006
1006
|
const props = calcProps(_props);
|