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/es/index.js CHANGED
@@ -933,7 +933,7 @@ function cleanupState(state) {
933
933
  draft.sort = newSort;
934
934
  setTimeout(() => {
935
935
  var _a, _b;
936
- (_b = (_a = draft.props).onSortChange) == null ? void 0 : _b.call(_a, newSort);
936
+ (_b = (_a = state.getState().props).onSortChange) == null ? void 0 : _b.call(_a, newSort);
937
937
  });
938
938
  }
939
939
  for (const id of draft.filters.keys()) {
@@ -962,7 +962,7 @@ function cleanupState(state) {
962
962
  draft.selection = newSelection;
963
963
  setTimeout(() => {
964
964
  var _a, _b;
965
- (_b = (_a = draft.props).onSelectionChange) == null ? void 0 : _b.call(_a, newSelection);
965
+ (_b = (_a = state.getState().props).onSelectionChange) == null ? void 0 : _b.call(_a, newSelection);
966
966
  });
967
967
  }
968
968
  const newExpanded = intersect(draft.expanded, itemsById);
@@ -970,7 +970,7 @@ function cleanupState(state) {
970
970
  draft.expanded = newExpanded;
971
971
  setTimeout(() => {
972
972
  var _a, _b;
973
- (_b = (_a = draft.props).onExpandedChange) == null ? void 0 : _b.call(_a, newExpanded);
973
+ (_b = (_a = state.getState().props).onExpandedChange) == null ? void 0 : _b.call(_a, newExpanded);
974
974
  });
975
975
  }
976
976
  }
@@ -981,8 +981,8 @@ function filterColumns(state) {
981
981
  draft.activeColumns = orderBy(columns.filter((column) => !hiddenColumns.has(column.id)), [(column) => columnOrder.indexOf(column.id)]);
982
982
  }, { runNow: true }), [state]);
983
983
  }
984
- function syncSelections(state) {
985
- useEffect(() => state.addReaction((state2) => [state2.props.selectSyncChildren, state2.selection, state2.activeItems], ([selectSyncChildren, selection, activeItems], state2) => {
984
+ function syncSelections(table) {
985
+ useEffect(() => table.addReaction((state) => [state.props.selectSyncChildren, state.selection, state.activeItems], ([selectSyncChildren, selection, activeItems], state) => {
986
986
  if (!selectSyncChildren)
987
987
  return;
988
988
  const newSelection = new Set(selection);
@@ -992,13 +992,13 @@ function syncSelections(state) {
992
992
  }
993
993
  }
994
994
  if (newSelection.size !== selection.size) {
995
- state2.selection = newSelection;
995
+ state.selection = newSelection;
996
996
  setTimeout(() => {
997
997
  var _a, _b;
998
- (_b = (_a = state2.props).onSelectionChange) == null ? void 0 : _b.call(_a, newSelection);
998
+ (_b = (_a = table.getState().props).onSelectionChange) == null ? void 0 : _b.call(_a, newSelection);
999
999
  });
1000
1000
  }
1001
- }, { runNow: true }), [state]);
1001
+ }, { runNow: true }), [table]);
1002
1002
  }
1003
1003
  function useTableState(_props) {
1004
1004
  const props = calcProps(_props);