@infinite-table/infinite-react 7.3.0 → 7.3.2-canary.0

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/index.dev.mjs CHANGED
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
- // ../node_modules/binary-search/index.js
27
+ // node_modules/binary-search/index.js
28
28
  var require_binary_search = __commonJS({
29
- "../node_modules/binary-search/index.js"(exports, module) {
29
+ "node_modules/binary-search/index.js"(exports, module) {
30
30
  "use strict";
31
31
  module.exports = function(haystack, needle, comparator, low, high) {
32
32
  var mid, cmp;
@@ -1199,7 +1199,7 @@ var useCSSVariableWatch = (params) => {
1199
1199
  useResizeObserver(params.ref, onResize, { earlyAttach: true });
1200
1200
  React2.useLayoutEffect(() => {
1201
1201
  const value = params.ref.current.getBoundingClientRect().height;
1202
- if (value) {
1202
+ if (value != null) {
1203
1203
  lastValueRef.current = value;
1204
1204
  debug2(`Variable ${params.varName} found and equals ${value}.`);
1205
1205
  return params.onChange(value);
@@ -5196,7 +5196,7 @@ var useRerender = () => {
5196
5196
  ];
5197
5197
  };
5198
5198
 
5199
- // ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
5199
+ // node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
5200
5200
  function toPrimitive(t, r) {
5201
5201
  if ("object" != typeof t || !t) return t;
5202
5202
  var e = t[Symbol.toPrimitive];
@@ -7023,6 +7023,9 @@ var getComputedColumns = ({
7023
7023
  const field = c.field ?? colType.field;
7024
7024
  const valueGetter = c.valueGetter ?? colType.valueGetter;
7025
7025
  let computedGroupable = c.defaultGroupable ?? colType.defaultGroupable ?? columnDefaultGroupable ?? !!field;
7026
+ if (!field) {
7027
+ computedGroupable = false;
7028
+ }
7026
7029
  if (c.groupByForColumn) {
7027
7030
  computedGroupable = false;
7028
7031
  }
@@ -9669,13 +9672,17 @@ var useColumnPointerEvents = ({
9669
9672
  col.computedVisibleIndex,
9670
9673
  rootRef.current
9671
9674
  );
9675
+ setInfiniteColumnVisibility(
9676
+ col.computedVisibleIndex,
9677
+ "",
9678
+ rootRef.current
9679
+ );
9672
9680
  setInfiniteColumnOffsetWhileReordering(
9673
9681
  col.computedVisibleIndex,
9674
9682
  "",
9675
9683
  rootRef.current
9676
9684
  );
9677
9685
  });
9678
- setInfiniteColumnVisibility(dragColumnIndex, "", rootRef.current);
9679
9686
  setInfiniteColumnZIndex(
9680
9687
  dragColumnIndex,
9681
9688
  getColumnZIndex(dragColumn, {
@@ -12046,14 +12053,14 @@ var DragList = (props) => {
12046
12053
  return;
12047
12054
  }
12048
12055
  const dragItems = getDragItems();
12049
- const updatePosition2 = getUpdatePosition();
12056
+ const updatePosition = getUpdatePosition();
12050
12057
  items.forEach((item, index) => {
12051
12058
  const offset = offsetsForItems[index];
12052
12059
  const node = dragItems[index];
12053
12060
  if (!node) {
12054
12061
  return;
12055
12062
  }
12056
- updatePosition2({
12063
+ updatePosition({
12057
12064
  id: item.id,
12058
12065
  node,
12059
12066
  offset
@@ -12078,13 +12085,13 @@ var DragList = (props) => {
12078
12085
  const onAcceptDrop = getOnAcceptDrop();
12079
12086
  const onRemove = getOnRemove();
12080
12087
  const onDrop = getOnDrop();
12081
- const updatePosition2 = getUpdatePosition();
12088
+ const updatePosition = getUpdatePosition();
12082
12089
  items.forEach((item, index) => {
12083
12090
  const node = dragItems[index];
12084
12091
  if (!node) {
12085
12092
  return;
12086
12093
  }
12087
- updatePosition2({
12094
+ updatePosition({
12088
12095
  id: item.id,
12089
12096
  node,
12090
12097
  offset: null
@@ -12682,7 +12689,7 @@ var TableHeaderClassName = `${rootClassName9}Header`;
12682
12689
  var headerCls = HeaderClsRecipe({
12683
12690
  overflow: false
12684
12691
  });
12685
- var updatePosition = (_options) => {
12692
+ var emptyFn3 = () => {
12686
12693
  };
12687
12694
  function InfiniteTableInternalHeaderFn(props) {
12688
12695
  const {
@@ -12798,15 +12805,13 @@ function InfiniteTableInternalHeaderFn(props) {
12798
12805
  headerBrain
12799
12806
  ]
12800
12807
  );
12801
- const onDrop = useCallback17((_sortedIndexes) => {
12802
- }, []);
12803
12808
  return /* @__PURE__ */ React49.createElement(
12804
12809
  DragList,
12805
12810
  {
12806
12811
  orientation: "horizontal",
12807
12812
  dragListId: "header",
12808
- onDrop,
12809
- updatePosition
12813
+ onDrop: emptyFn3,
12814
+ updatePosition: emptyFn3
12810
12815
  },
12811
12816
  (dragListDomProps) => {
12812
12817
  return /* @__PURE__ */ React49.createElement(
@@ -14594,7 +14599,7 @@ function enhancedFlatten(param) {
14594
14599
  import * as React56 from "react";
14595
14600
 
14596
14601
  // src/utils/groupAndPivot/treeUtils.ts
14597
- var emptyFn3 = () => {
14602
+ var emptyFn4 = () => {
14598
14603
  };
14599
14604
  function toTreeDataArray(data, options) {
14600
14605
  const treeMap = new DeepMap();
@@ -14651,7 +14656,7 @@ function traverseTreeNode(traverseParams, treeTraverseOptions, parentPath, item)
14651
14656
  });
14652
14657
  if (isLeaf) {
14653
14658
  onLeafNode?.(item);
14654
- onNode?.(item, emptyFn3);
14659
+ onNode?.(item, emptyFn4);
14655
14660
  } else {
14656
14661
  onParentNode?.(item, next, getNodeChildren(item));
14657
14662
  onNode?.(item, next);
@@ -17023,7 +17028,7 @@ var TreeSelectionState = class _TreeSelectionState {
17023
17028
  this.defaultSelection = false;
17024
17029
  this.selectionMap = new DeepMap();
17025
17030
  this.cache = new DeepMap();
17026
- this.correctnessChecks = false;
17031
+ this.strictMode = false;
17027
17032
  const isTreeSelectionStateInstance = state instanceof Object.getPrototypeOf(this).constructor;
17028
17033
  const stateObject = isTreeSelectionStateInstance ? (
17029
17034
  //@ts-ignore
@@ -17034,9 +17039,11 @@ var TreeSelectionState = class _TreeSelectionState {
17034
17039
  treePaths: new DeepMap()
17035
17040
  })
17036
17041
  );
17037
- this.disableCorrectnessChecks();
17042
+ this.disableStrictMode();
17038
17043
  this.update(stateObject);
17039
- this.enableCorrectnessChecks();
17044
+ if (this.config.strictCheckPaths) {
17045
+ this.enableStrictMode();
17046
+ }
17040
17047
  }
17041
17048
  getTreePaths(treePaths) {
17042
17049
  if (treePaths) {
@@ -17118,7 +17125,8 @@ var TreeSelectionState = class _TreeSelectionState {
17118
17125
  setConfig(getConfig) {
17119
17126
  const config = typeof getConfig === "function" ? getConfig() : getConfig;
17120
17127
  this.config = {
17121
- treePaths: Array.isArray(config.treePaths) ? new DeepMap(config.treePaths.map((path) => [path, true])) : config.treePaths
17128
+ treePaths: Array.isArray(config.treePaths) ? new DeepMap(config.treePaths.map((path) => [path, true])) : config.treePaths,
17129
+ strictCheckPaths: config.strictCheckPaths ?? true
17122
17130
  };
17123
17131
  this.xcache();
17124
17132
  }
@@ -17175,14 +17183,14 @@ var TreeSelectionState = class _TreeSelectionState {
17175
17183
  selectedPaths: []
17176
17184
  });
17177
17185
  }
17178
- enableCorrectnessChecks() {
17179
- this.correctnessChecks = true;
17186
+ enableStrictMode() {
17187
+ this.strictMode = true;
17180
17188
  }
17181
- disableCorrectnessChecks() {
17182
- this.correctnessChecks = false;
17189
+ disableStrictMode() {
17190
+ this.strictMode = false;
17183
17191
  }
17184
17192
  isPathAvailable(nodePath) {
17185
- if (!this.correctnessChecks) {
17193
+ if (!this.strictMode) {
17186
17194
  return true;
17187
17195
  }
17188
17196
  const { treePaths } = this.config;
@@ -17220,7 +17228,7 @@ var TreeSelectionState = class _TreeSelectionState {
17220
17228
  let childPaths = selectionMap.getKeysOfFirstChildOnEachBranchStartingWith(nodePath, {
17221
17229
  excludeSelf: true
17222
17230
  }).sort(shortestToLongest);
17223
- if (this.correctnessChecks) {
17231
+ if (this.strictMode) {
17224
17232
  childPaths = childPaths.filter((path) => this.isPathAvailable(path));
17225
17233
  }
17226
17234
  if (!childPaths.length) {
@@ -25774,7 +25782,7 @@ var useLicense = (licenseKey = "") => {
25774
25782
  }
25775
25783
  let valid2 = isValidLicense(licenseKey, {
25776
25784
  publishedAt: 1624970570587,
25777
- version: "7.3.0"
25785
+ version: "7.3.2-canary.0"
25778
25786
  });
25779
25787
  if (!licenseKey && !valid2 && isInsidePlayground) {
25780
25788
  return true;
@@ -26927,8 +26935,6 @@ function injectPortalContainerAndConstrainInMenuChild(children, portalContainer,
26927
26935
  }
26928
26936
  return children;
26929
26937
  }
26930
- globalThis.allhandles = {};
26931
- globalThis.thehandles = {};
26932
26938
  function useOverlay(params) {
26933
26939
  const rootParams = params;
26934
26940
  const [handles] = useState20(() => /* @__PURE__ */ new Map());