@infinite-table/infinite-react 7.0.0 → 7.1.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
@@ -27,6 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  // ../node_modules/binary-search/index.js
28
28
  var require_binary_search = __commonJS({
29
29
  "../node_modules/binary-search/index.js"(exports, module) {
30
+ "use strict";
30
31
  module.exports = function(haystack, needle, comparator, low, high) {
31
32
  var mid, cmp;
32
33
  if (low === void 0)
@@ -145,7 +146,7 @@ var sortAscending = (a, b) => a - b;
145
146
 
146
147
  // src/utils/DeepMap/index.ts
147
148
  var SORT_ASC_REVISION = (p1, p2) => sortAscending(p1.revision, p2.revision);
148
- var DeepMap = class {
149
+ var DeepMap = class _DeepMap {
149
150
  constructor(initial) {
150
151
  this.map = /* @__PURE__ */ new Map();
151
152
  this.length = 0;
@@ -218,7 +219,7 @@ var DeepMap = class {
218
219
  this.fill(initial);
219
220
  }
220
221
  static clone(map2) {
221
- const clone = new DeepMap();
222
+ const clone = new _DeepMap();
222
223
  map2.visit((pair, keys) => {
223
224
  clone.set(keys, pair.value);
224
225
  });
@@ -1235,12 +1236,7 @@ function useMasterDetailContext() {
1235
1236
 
1236
1237
  // src/components/HeadlessTable/index.tsx
1237
1238
  import * as React14 from "react";
1238
- import {
1239
- useCallback as useCallback4,
1240
- useEffect as useEffect7,
1241
- useRef as useRef7,
1242
- useState as useState3
1243
- } from "react";
1239
+ import { useCallback as useCallback4, useEffect as useEffect5, useRef as useRef7, useState as useState3 } from "react";
1244
1240
 
1245
1241
  // src/components/VirtualList/SpacePlaceholder.tsx
1246
1242
  import * as React6 from "react";
@@ -1353,15 +1349,15 @@ var VirtualScrollContainer = React7.forwardRef(
1353
1349
 
1354
1350
  // src/components/HeadlessTable/RawTable.tsx
1355
1351
  import * as React11 from "react";
1356
- import { useEffect as useEffect4, useLayoutEffect as useLayoutEffect3, useMemo as useMemo2 } from "react";
1352
+ import { useLayoutEffect as useLayoutEffect4, useMemo as useMemo2 } from "react";
1357
1353
 
1358
1354
  // src/components/RawList/AvoidReactDiff.tsx
1359
1355
  import * as React8 from "react";
1360
- import { useEffect as useEffect3, useRef as useRef4, useState } from "react";
1356
+ import { useLayoutEffect as useLayoutEffect3, useRef as useRef4, useState } from "react";
1361
1357
  function AvoidReactDiffFn(props) {
1362
1358
  const [children, setChildren] = useState(props.updater.get);
1363
1359
  const rafId = useRef4(null);
1364
- useEffect3(() => {
1360
+ useLayoutEffect3(() => {
1365
1361
  function onChange(children2) {
1366
1362
  if (props.useraf) {
1367
1363
  if (rafId.current != null) {
@@ -2465,6 +2461,10 @@ var MatrixBrain = class extends Logger {
2465
2461
  this.rowOffsetCache = [0];
2466
2462
  this.verticalRenderCount = void 0;
2467
2463
  this.verticalTotalSize = 0;
2464
+ this.verticalRenderRange = {
2465
+ startIndex: 0,
2466
+ endIndex: 0
2467
+ };
2468
2468
  }
2469
2469
  resetHorizontal() {
2470
2470
  this.colspanParent = /* @__PURE__ */ new Map();
@@ -2473,6 +2473,10 @@ var MatrixBrain = class extends Logger {
2473
2473
  this.colOffsetCache = [0];
2474
2474
  this.horizontalRenderCount = void 0;
2475
2475
  this.horizontalTotalSize = 0;
2476
+ this.horizontalRenderRange = {
2477
+ startIndex: 0,
2478
+ endIndex: 0
2479
+ };
2476
2480
  }
2477
2481
  getVirtualColIndex(colIndex, _opts) {
2478
2482
  return colIndex;
@@ -2932,7 +2936,7 @@ var GridCellForReact = class {
2932
2936
  return this.element;
2933
2937
  }
2934
2938
  };
2935
- var _GridCellPoolForReact = class extends Logger {
2939
+ var _GridCellPoolForReact = class _GridCellPoolForReact extends Logger {
2936
2940
  // for now, making this larger will create the cells, but on fast scrolling, those extra cells can tend to lag behind the scroll position as they are not updated
2937
2941
  constructor(debugId) {
2938
2942
  super(`${debugId}:GridCellPoolForReact`);
@@ -3049,8 +3053,8 @@ var _GridCellPoolForReact = class extends Logger {
3049
3053
  let cell = detachedCells.values().next().value;
3050
3054
  if (!cell) {
3051
3055
  this.poolSize += _GridCellPoolForReact.POOL_SIZE_INCREMENT;
3056
+ cell = detachedCells.values().next().value;
3052
3057
  }
3053
- cell = detachedCells.values().next().value;
3054
3058
  if (!cell) {
3055
3059
  this.error("No cells available in the pool!");
3056
3060
  }
@@ -3093,9 +3097,9 @@ var _GridCellPoolForReact = class extends Logger {
3093
3097
  }
3094
3098
  }
3095
3099
  };
3096
- var GridCellPoolForReact = _GridCellPoolForReact;
3097
3100
  // we'll grow the pool by this amount at a time
3098
- GridCellPoolForReact.POOL_SIZE_INCREMENT = 1;
3101
+ _GridCellPoolForReact.POOL_SIZE_INCREMENT = 1;
3102
+ var GridCellPoolForReact = _GridCellPoolForReact;
3099
3103
 
3100
3104
  // src/components/HeadlessTable/GridCellManager.ts
3101
3105
  var ASC_SORT = (a, b) => a - b;
@@ -3368,7 +3372,10 @@ var GridCellManager = class extends Logger {
3368
3372
  const [rowIndex, colIndex] = cellPos;
3369
3373
  this.matrix.visit((_, cellPos2) => {
3370
3374
  const [row, col] = cellPos2;
3371
- if (row >= rowIndex || col >= colIndex) {
3375
+ if (row > rowIndex) {
3376
+ this.detachCellAt(cellPos2);
3377
+ }
3378
+ if (row === rowIndex && col >= colIndex) {
3372
3379
  this.detachCellAt(cellPos2);
3373
3380
  }
3374
3381
  });
@@ -3482,7 +3489,7 @@ var ListRowForReact = class {
3482
3489
  return this.element;
3483
3490
  }
3484
3491
  };
3485
- var _ListRowPoolForReact = class extends Logger {
3492
+ var _ListRowPoolForReact = class _ListRowPoolForReact extends Logger {
3486
3493
  constructor(debugId) {
3487
3494
  super(`${debugId}:ListRowPoolForReact`);
3488
3495
  this.debugId = debugId;
@@ -3642,9 +3649,9 @@ var _ListRowPoolForReact = class extends Logger {
3642
3649
  }
3643
3650
  }
3644
3651
  };
3645
- var ListRowPoolForReact = _ListRowPoolForReact;
3646
3652
  // we'll grow the pool by this amount at a time
3647
- ListRowPoolForReact.POOL_SIZE_INCREMENT = 1;
3653
+ _ListRowPoolForReact.POOL_SIZE_INCREMENT = 1;
3654
+ var ListRowPoolForReact = _ListRowPoolForReact;
3648
3655
 
3649
3656
  // src/components/HeadlessTable/ListRowManager.ts
3650
3657
  var ListRowManager = class extends Logger {
@@ -5060,13 +5067,13 @@ function RawTableFn(props) {
5060
5067
  onRenderUpdater: props.onRenderUpdater
5061
5068
  } : createRenderer(brain);
5062
5069
  }, [brain, props.onRenderUpdater, props.renderer]);
5063
- useEffect4(() => {
5070
+ useLayoutEffect4(() => {
5064
5071
  renderer.cellHoverClassNames = props.cellHoverClassNames || [];
5065
5072
  }, [renderer, props.cellHoverClassNames]);
5066
- useEffect4(() => {
5073
+ useLayoutEffect4(() => {
5067
5074
  renderer.cellDetachedClassNames = props.cellDetachedClassNames || [];
5068
5075
  }, [renderer, props.cellDetachedClassNames]);
5069
- useLayoutEffect3(() => {
5076
+ useLayoutEffect4(() => {
5070
5077
  const renderRange = brain.getRenderRange();
5071
5078
  renderer.renderRange(renderRange, {
5072
5079
  onRender: onRenderUpdater,
@@ -5074,17 +5081,8 @@ function RawTableFn(props) {
5074
5081
  renderCell,
5075
5082
  renderDetailRow
5076
5083
  });
5077
- }, [
5078
- renderer,
5079
- brain,
5080
- renderCell,
5081
- renderDetailRow,
5082
- onRenderUpdater,
5083
- forceRerenderTimestamp
5084
- ]);
5085
- useEffect4(() => {
5086
- const remove = brain.onRenderRangeChange((renderRange) => {
5087
- renderer.renderRange(renderRange, {
5084
+ const remove = brain.onRenderRangeChange((renderRange2) => {
5085
+ renderer.renderRange(renderRange2, {
5088
5086
  force: false,
5089
5087
  // TODO should be false
5090
5088
  onRender: (items) => {
@@ -5099,14 +5097,21 @@ function RawTableFn(props) {
5099
5097
  });
5100
5098
  });
5101
5099
  return remove;
5102
- }, [renderCell, renderDetailRow, brain, onRenderUpdater]);
5100
+ }, [
5101
+ renderer,
5102
+ brain,
5103
+ renderCell,
5104
+ renderDetailRow,
5105
+ onRenderUpdater,
5106
+ forceRerenderTimestamp
5107
+ ]);
5103
5108
  return /* @__PURE__ */ React11.createElement(AvoidReactDiff, { updater: onRenderUpdater });
5104
5109
  }
5105
5110
  var RawTable = React11.memo(RawTableFn);
5106
5111
 
5107
5112
  // src/components/InfiniteTable/components/ActiveRowIndicator.tsx
5108
5113
  import * as React12 from "react";
5109
- import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect4, useRef as useRef5 } from "react";
5114
+ import { useEffect as useEffect3, useLayoutEffect as useLayoutEffect5, useRef as useRef5 } from "react";
5110
5115
 
5111
5116
  // src/components/hooks/useRerender.ts
5112
5117
  import { useCallback as useCallback3, useState as useState2 } from "react";
@@ -5122,13 +5127,11 @@ var useRerender = () => {
5122
5127
 
5123
5128
  // ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
5124
5129
  function toPrimitive(t, r) {
5125
- if ("object" != typeof t || !t)
5126
- return t;
5130
+ if ("object" != typeof t || !t) return t;
5127
5131
  var e = t[Symbol.toPrimitive];
5128
5132
  if (void 0 !== e) {
5129
5133
  var i = e.call(t, r || "default");
5130
- if ("object" != typeof i)
5131
- return i;
5134
+ if ("object" != typeof i) return i;
5132
5135
  throw new TypeError("@@toPrimitive must return a primitive value.");
5133
5136
  }
5134
5137
  return ("string" === r ? String : Number)(t);
@@ -5252,7 +5255,7 @@ var ActiveRowIndicatorFn = (props) => {
5252
5255
  const domRef = useRef5(null);
5253
5256
  const active = props.activeRowIndex != null && brain.getInitialRows() > props.activeRowIndex;
5254
5257
  const [_rerenderId, rerender] = useRerender();
5255
- useLayoutEffect4(() => {
5258
+ useLayoutEffect5(() => {
5256
5259
  if (props.activeRowIndex == null) {
5257
5260
  return;
5258
5261
  }
@@ -5275,7 +5278,7 @@ var ActiveRowIndicatorFn = (props) => {
5275
5278
  };
5276
5279
  setInfiniteVarsOnNode(vars, node);
5277
5280
  }, [props.activeRowIndex, brain]);
5278
- useEffect5(() => {
5281
+ useEffect3(() => {
5279
5282
  const updateVars = (scrollPosition) => {
5280
5283
  setInfiniteVarsOnNode(
5281
5284
  {
@@ -5314,7 +5317,7 @@ var ActiveRowIndicator = React12.memo(
5314
5317
 
5315
5318
  // src/components/InfiniteTable/components/ActiveCellIndicator.tsx
5316
5319
  import * as React13 from "react";
5317
- import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect5, useRef as useRef6 } from "react";
5320
+ import { useEffect as useEffect4, useLayoutEffect as useLayoutEffect6, useRef as useRef6 } from "react";
5318
5321
  var { rootClassName: rootClassName4 } = internalProps;
5319
5322
  var baseCls2 = `${rootClassName4}-ActiveCellIndicator`;
5320
5323
  var columnZIndexAtIndex2 = stripVar(InternalVars.columnZIndexAtIndex);
@@ -5342,10 +5345,10 @@ var ActiveCellIndicatorFn = (props) => {
5342
5345
  const [_rerenderId, rerender] = useRerender();
5343
5346
  const domRef = useRef6(null);
5344
5347
  const active = props.activeCellIndex != null && brain.getInitialRows() > props.activeCellIndex[0];
5345
- useLayoutEffect5(() => {
5348
+ useLayoutEffect6(() => {
5346
5349
  reposition(brain, props.activeCellIndex, props.rowHeight, domRef);
5347
5350
  }, [props.activeCellIndex, props.rowHeight, brain]);
5348
- useEffect6(() => {
5351
+ useEffect4(() => {
5349
5352
  const removeOnRenderCountChange = brain.onRenderCountChange(() => {
5350
5353
  rerender();
5351
5354
  });
@@ -5444,12 +5447,12 @@ function HeadlessTable(props) {
5444
5447
  width: 0,
5445
5448
  height: 0
5446
5449
  });
5447
- useEffect7(() => {
5450
+ useEffect5(() => {
5448
5451
  if (scrollStopDelay != null) {
5449
5452
  brain.setScrollStopDelay(scrollStopDelay);
5450
5453
  }
5451
5454
  }, [scrollStopDelay, brain]);
5452
- useEffect7(() => {
5455
+ useEffect5(() => {
5453
5456
  const node = domRef.current?.parentNode;
5454
5457
  if (!node) {
5455
5458
  return;
@@ -5485,7 +5488,7 @@ function HeadlessTable(props) {
5485
5488
  },
5486
5489
  [brain, updateDOMTransform]
5487
5490
  );
5488
- useEffect7(() => {
5491
+ useEffect5(() => {
5489
5492
  const removeOnRenderCount = brain.onRenderCountChange(() => {
5490
5493
  setTotalScrollSize(brain.getVirtualizedContentSize());
5491
5494
  });
@@ -5548,10 +5551,10 @@ import {
5548
5551
  useReducer,
5549
5552
  createContext as createContext3,
5550
5553
  useMemo as useMemo3,
5551
- useEffect as useEffect9,
5554
+ useEffect as useEffect7,
5552
5555
  useState as useState4,
5553
5556
  useRef as useRef11,
5554
- useLayoutEffect as useLayoutEffect7
5557
+ useLayoutEffect as useLayoutEffect8
5555
5558
  } from "react";
5556
5559
 
5557
5560
  // src/utils/proxyFnCall.ts
@@ -5598,17 +5601,17 @@ function isControlled(propName, props) {
5598
5601
  }
5599
5602
 
5600
5603
  // src/components/hooks/useEffectOnceWithProperUnmount.ts
5601
- import { useCallback as useCallback5, useEffect as useEffect8, useRef as useRef8 } from "react";
5604
+ import { useCallback as useCallback5, useEffect as useEffect6, useRef as useRef8 } from "react";
5602
5605
  var useEffectOnce = (effectCallback) => {
5603
5606
  const effectFunction = useCallback5(effectCallback, []);
5604
5607
  const effectCalled = useRef8(false);
5605
5608
  const componentRendered = useRef8(false);
5606
- const destroyFn = useRef8();
5609
+ const destroyFn = useRef8(void 0);
5607
5610
  const [_, rerender] = useRerender();
5608
5611
  if (effectCalled.current) {
5609
5612
  componentRendered.current = true;
5610
5613
  }
5611
- useEffect8(() => {
5614
+ useEffect6(() => {
5612
5615
  if (!effectCalled.current) {
5613
5616
  destroyFn.current = effectFunction;
5614
5617
  effectCalled.current = true;
@@ -5634,10 +5637,10 @@ function useLatest(value) {
5634
5637
  }
5635
5638
 
5636
5639
  // src/components/hooks/usePrevious.ts
5637
- import { useRef as useRef10, useLayoutEffect as useLayoutEffect6 } from "react";
5640
+ import { useRef as useRef10, useLayoutEffect as useLayoutEffect7 } from "react";
5638
5641
  var usePrevious = (value, initialValue) => {
5639
5642
  const ref = useRef10(initialValue === void 0 ? value : initialValue);
5640
- useLayoutEffect6(() => {
5643
+ useLayoutEffect7(() => {
5641
5644
  ref.current = value;
5642
5645
  });
5643
5646
  return ref.current;
@@ -5813,10 +5816,7 @@ function buildManagedComponent(config) {
5813
5816
  }) : newState;
5814
5817
  return result;
5815
5818
  };
5816
- const [state, dispatch] = useReducer(
5817
- theReducer,
5818
- wholeState
5819
- );
5819
+ const [state, dispatch] = useReducer(theReducer, wholeState);
5820
5820
  const getComponentState = useLatest(state);
5821
5821
  const { allowedControlledPropOverrides } = config;
5822
5822
  const actions = useMemo3(() => {
@@ -5859,7 +5859,7 @@ function buildManagedComponent(config) {
5859
5859
  const prevProps = usePrevious(props);
5860
5860
  const skipTriggerParentStateChangeRef = useRef11(false);
5861
5861
  skipTriggerParentStateChangeRef.current = false;
5862
- const effectFn = config.layoutEffect ? useLayoutEffect7 : useEffect9;
5862
+ const effectFn = config.layoutEffect ? useLayoutEffect8 : useEffect7;
5863
5863
  effectFn(() => {
5864
5864
  const currentProps = props;
5865
5865
  const newMappedState = {};
@@ -6014,7 +6014,7 @@ function InfiniteTableFooter(props) {
6014
6014
 
6015
6015
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
6016
6016
  import * as React43 from "react";
6017
- import { useCallback as useCallback14, useContext as useContext7, useEffect as useEffect15, useRef as useRef16 } from "react";
6017
+ import { useCallback as useCallback14, useContext as useContext7, useEffect as useEffect13, useRef as useRef16 } from "react";
6018
6018
  import { createPortal } from "react-dom";
6019
6019
 
6020
6020
  // src/utils/keyMirror.ts
@@ -6102,7 +6102,7 @@ import * as React30 from "react";
6102
6102
 
6103
6103
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
6104
6104
  import * as React29 from "react";
6105
- import { useEffect as useEffect11, useState as useState6 } from "react";
6105
+ import { useEffect as useEffect9, useState as useState6 } from "react";
6106
6106
 
6107
6107
  // src/components/InfiniteTable/hooks/useInfiniteTable.ts
6108
6108
  import { useContext as useContext3 } from "react";
@@ -6135,7 +6135,7 @@ var useInfiniteTableState = () => {
6135
6135
 
6136
6136
  // src/components/InfiniteTable/components/icons/FilterIcon.tsx
6137
6137
  import * as React27 from "react";
6138
- import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect8, useState as useState5 } from "react";
6138
+ import { useEffect as useEffect8, useLayoutEffect as useLayoutEffect9, useState as useState5 } from "react";
6139
6139
 
6140
6140
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
6141
6141
  var CellCls = "_1eexc2a6";
@@ -6182,7 +6182,7 @@ function FilterIcon(props) {
6182
6182
  ...props.lineStyle,
6183
6183
  opacity
6184
6184
  };
6185
- useEffect10(() => {
6185
+ useEffect8(() => {
6186
6186
  if (!rendered) {
6187
6187
  return;
6188
6188
  }
@@ -6193,7 +6193,7 @@ function FilterIcon(props) {
6193
6193
  cancelAnimationFrame(rafId);
6194
6194
  };
6195
6195
  }, [rendered]);
6196
- useLayoutEffect8(() => {
6196
+ useLayoutEffect9(() => {
6197
6197
  setRendered(true);
6198
6198
  }, []);
6199
6199
  if (!rendered) {
@@ -7377,7 +7377,7 @@ function useInfiniteColumnFilterEditor() {
7377
7377
  const removeColumnFilter = React29.useCallback(() => {
7378
7378
  context.api.removeColumnFilter(column.id);
7379
7379
  }, [column.id]);
7380
- useEffect11(() => {
7380
+ useEffect9(() => {
7381
7381
  if (columnFilterValue) {
7382
7382
  if (theValue !== columnFilterValue.filter.value) {
7383
7383
  setTheValue(columnFilterValue.filter.value);
@@ -7925,7 +7925,7 @@ function mapToContinuation(args) {
7925
7925
  (arg) => arg instanceof CssContinuation ? arg : new CssContinuation(null, [arg])
7926
7926
  );
7927
7927
  }
7928
- var CssContinuation = class {
7928
+ var CssContinuation = class _CssContinuation {
7929
7929
  constructor(operation, operands = []) {
7930
7930
  this.__operands = [];
7931
7931
  this.__operation = null;
@@ -7933,19 +7933,19 @@ var CssContinuation = class {
7933
7933
  this.__operation = operation;
7934
7934
  }
7935
7935
  add(...args) {
7936
- return new CssContinuation("+", [this, ...args]);
7936
+ return new _CssContinuation("+", [this, ...args]);
7937
7937
  }
7938
7938
  subtract(...args) {
7939
- return new CssContinuation("-", [this, ...args]);
7939
+ return new _CssContinuation("-", [this, ...args]);
7940
7940
  }
7941
7941
  minus(...args) {
7942
7942
  return this.subtract(...args);
7943
7943
  }
7944
7944
  multiply(...args) {
7945
- return new CssContinuation("*", [this, ...args]);
7945
+ return new _CssContinuation("*", [this, ...args]);
7946
7946
  }
7947
7947
  divide(...args) {
7948
- return new CssContinuation("/", [this, ...args]);
7948
+ return new _CssContinuation("/", [this, ...args]);
7949
7949
  }
7950
7950
  __get(parent) {
7951
7951
  const { __operation, __operands } = this;
@@ -9000,7 +9000,7 @@ function objectValuesExcept(obj, exceptList) {
9000
9000
 
9001
9001
  // src/components/InfiniteTable/components/CheckBox.tsx
9002
9002
  import * as React34 from "react";
9003
- import { useEffect as useEffect13, useRef as useRef12 } from "react";
9003
+ import { useEffect as useEffect11, useRef as useRef12 } from "react";
9004
9004
 
9005
9005
  // src/components/InfiniteTable/components/CheckBox.css.ts
9006
9006
  var CheckBoxCls = "qz8ht90 _16lm1iwi";
@@ -9035,7 +9035,7 @@ function InfiniteCheckBoxComponent() {
9035
9035
  const { componentState, componentActions } = useManagedComponentState();
9036
9036
  const { checked, domProps, disabled } = componentState;
9037
9037
  const inputRef = useRef12(null);
9038
- useEffect13(() => {
9038
+ useEffect11(() => {
9039
9039
  inputRef.current.indeterminate = checked == null;
9040
9040
  }, [checked]);
9041
9041
  return /* @__PURE__ */ React34.createElement(
@@ -9562,7 +9562,7 @@ import * as React36 from "react";
9562
9562
  import { useCallback as useCallback10, useRef as useRef13 } from "react";
9563
9563
  function InfiniteTableColumnEditor() {
9564
9564
  const { initialValue, setValue, confirmEdit, cancelEdit, readOnly } = useInfiniteColumnEditor();
9565
- const domRef = useRef13();
9565
+ const domRef = useRef13(null);
9566
9566
  const refCallback = React36.useCallback((node) => {
9567
9567
  domRef.current = node;
9568
9568
  if (node) {
@@ -10319,7 +10319,7 @@ function MenuIcon(props) {
10319
10319
 
10320
10320
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
10321
10321
  import * as React40 from "react";
10322
- import { useEffect as useEffect14, useState as useState10 } from "react";
10322
+ import { useEffect as useEffect12, useState as useState10 } from "react";
10323
10323
 
10324
10324
  // src/components/InfiniteTable/components/icons/SortIcon.css.ts
10325
10325
  var SortIconCls = "_1ek6mqy0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v";
@@ -10347,7 +10347,7 @@ function SortIcon(props) {
10347
10347
  ...props.lineStyle,
10348
10348
  opacity
10349
10349
  };
10350
- useEffect14(() => {
10350
+ useEffect12(() => {
10351
10351
  const newOpacity = direction != 0 ? 1 : 0;
10352
10352
  if (!rendered && newOpacity) {
10353
10353
  setRendered(true);
@@ -11026,7 +11026,7 @@ function InfiniteTableHeaderCell(props) {
11026
11026
  }
11027
11027
  return all;
11028
11028
  };
11029
- useEffect15(() => {
11029
+ useEffect13(() => {
11030
11030
  let clearOnResize = null;
11031
11031
  const node = domRef.current;
11032
11032
  if (onResize && node) {
@@ -11285,7 +11285,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
11285
11285
 
11286
11286
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
11287
11287
  import * as React47 from "react";
11288
- import { useCallback as useCallback16, useEffect as useEffect16, useRef as useRef18 } from "react";
11288
+ import { useCallback as useCallback16, useEffect as useEffect14, useRef as useRef18 } from "react";
11289
11289
 
11290
11290
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
11291
11291
  import * as React46 from "react";
@@ -11545,7 +11545,13 @@ function InfiniteTableHeaderFn(props) {
11545
11545
  const {
11546
11546
  computed,
11547
11547
  getState,
11548
- state: { headerBrain, headerOptions, showColumnFilters }
11548
+ state: {
11549
+ headerBrain,
11550
+ headerOptions,
11551
+ showColumnFilters,
11552
+ headerRenderer,
11553
+ headerOnRenderUpdater
11554
+ }
11549
11555
  } = useInfiniteTable();
11550
11556
  const { computedColumnsMap } = computed;
11551
11557
  const domRef = useRef18(null);
@@ -11554,7 +11560,7 @@ function InfiniteTableHeaderFn(props) {
11554
11560
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
11555
11561
  }
11556
11562
  }, []);
11557
- useEffect16(() => {
11563
+ useEffect14(() => {
11558
11564
  const removeOnScroll = headerBrain.onScroll(updateDOMTransform);
11559
11565
  updateDOMTransform(
11560
11566
  headerBrain.getScrollPosition() || { scrollLeft: 0, scrollTop: 0 }
@@ -11646,6 +11652,8 @@ function InfiniteTableHeaderFn(props) {
11646
11652
  name: "header",
11647
11653
  renderCell,
11648
11654
  brain: headerBrain,
11655
+ renderer: headerRenderer,
11656
+ onRenderUpdater: headerOnRenderUpdater,
11649
11657
  cellHoverClassNames: EMPTY_ARR,
11650
11658
  cellDetachedClassNames: CELL_DETACHED_CLASSNAMES
11651
11659
  }
@@ -11791,7 +11799,7 @@ function TableHeaderWrapper(props) {
11791
11799
 
11792
11800
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
11793
11801
  import * as React49 from "react";
11794
- import { useEffect as useEffect17 } from "react";
11802
+ import { useEffect as useEffect15 } from "react";
11795
11803
 
11796
11804
  // src/components/utils/decamelize.ts
11797
11805
  function decamelize(str, options) {
@@ -11848,7 +11856,7 @@ var InfiniteTableLicenseFooter = React49.forwardRef(
11848
11856
  ref.current = node;
11849
11857
  }
11850
11858
  }, []);
11851
- useEffect17(() => {
11859
+ useEffect15(() => {
11852
11860
  const forceStyle = () => {
11853
11861
  setTimeout(() => {
11854
11862
  enforceStyle(domRef.current, defaultStyle);
@@ -13368,7 +13376,7 @@ function getGroupKeysForDataItem(data, groupBy) {
13368
13376
  }
13369
13377
 
13370
13378
  // src/components/DataSource/RowSelectionState.ts
13371
- var RowSelectionState = class {
13379
+ var RowSelectionState = class _RowSelectionState {
13372
13380
  constructor(state, getConfig, _forTestingOnly) {
13373
13381
  this.selectedRows = null;
13374
13382
  this.deselectedRows = null;
@@ -13447,7 +13455,7 @@ var RowSelectionState = class {
13447
13455
  return this.getConfig().groupBy.length;
13448
13456
  }
13449
13457
  static from(rowSeleStateObject, getConfig, overrides) {
13450
- return new RowSelectionState(rowSeleStateObject, getConfig, overrides);
13458
+ return new _RowSelectionState(rowSeleStateObject, getConfig, overrides);
13451
13459
  }
13452
13460
  update(stateObject) {
13453
13461
  this.selectedRows = stateObject.selectedRows || null;
@@ -14697,10 +14705,10 @@ var Indexer = class {
14697
14705
  };
14698
14706
 
14699
14707
  // src/components/DataSource/privateHooks/useLoadData.ts
14700
- import { useEffect as useEffect19, useMemo as useMemo7, useRef as useRef21, useState as useState13 } from "react";
14708
+ import { useEffect as useEffect17, useMemo as useMemo7, useRef as useRef21, useState as useState13 } from "react";
14701
14709
 
14702
14710
  // src/components/hooks/useEffectWithChanges.ts
14703
- import { useEffect as useEffect18, useRef as useRef20 } from "react";
14711
+ import { useEffect as useEffect16, useLayoutEffect as useLayoutEffect11, useRef as useRef20 } from "react";
14704
14712
  function useEffectWithChanges(fn, deps) {
14705
14713
  const prevRef = useRef20({});
14706
14714
  const oldValuesRef = useRef20({});
@@ -14718,7 +14726,35 @@ function useEffectWithChanges(fn, deps) {
14718
14726
  }
14719
14727
  }
14720
14728
  prevRef.current = deps;
14721
- useEffect18(() => {
14729
+ useEffect16(() => {
14730
+ const changes2 = changesRef.current;
14731
+ let result = void 0;
14732
+ if (Object.keys(changes2).length !== 0) {
14733
+ result = fn(changes2, oldValues);
14734
+ }
14735
+ changesRef.current = {};
14736
+ oldValuesRef.current = {};
14737
+ return result;
14738
+ }, useEffectDeps);
14739
+ }
14740
+ function useLayoutEffectWithChanges(fn, deps) {
14741
+ const prevRef = useRef20({});
14742
+ const oldValuesRef = useRef20({});
14743
+ const oldValues = oldValuesRef.current;
14744
+ const changesRef = useRef20({});
14745
+ const changes = changesRef.current;
14746
+ const useEffectDeps = [];
14747
+ for (const k in deps) {
14748
+ if (deps.hasOwnProperty(k)) {
14749
+ if (deps[k] !== prevRef.current[k]) {
14750
+ changes[k] = deps[k];
14751
+ oldValues[k] = prevRef.current[k];
14752
+ }
14753
+ useEffectDeps.push(deps[k]);
14754
+ }
14755
+ }
14756
+ prevRef.current = deps;
14757
+ useLayoutEffect11(() => {
14722
14758
  const changes2 = changesRef.current;
14723
14759
  let result = void 0;
14724
14760
  if (Object.keys(changes2).length !== 0) {
@@ -14736,7 +14772,7 @@ function useEffectWithObject(fn, deps) {
14736
14772
  useEffectDeps.push(deps[k]);
14737
14773
  }
14738
14774
  }
14739
- useEffect18(fn, useEffectDeps);
14775
+ useEffect16(fn, useEffectDeps);
14740
14776
  }
14741
14777
 
14742
14778
  // src/utils/composeFunctions.ts
@@ -14952,7 +14988,7 @@ function getPivotColumnsAndColumnGroups({
14952
14988
 
14953
14989
  // src/components/DataSource/DataSourceCache.ts
14954
14990
  var CLEAR_SYMBOL = Symbol("CLEAR");
14955
- var DataSourceCache = class {
14991
+ var DataSourceCache = class _DataSourceCache {
14956
14992
  constructor(options) {
14957
14993
  this.affectedFields = /* @__PURE__ */ new Set();
14958
14994
  this.allFieldsAffected = false;
@@ -15120,7 +15156,7 @@ var DataSourceCache = class {
15120
15156
  this.nodesKey = options.nodesKey;
15121
15157
  }
15122
15158
  static clone(cache, { light = false } = {}) {
15123
- const clone = new DataSourceCache({
15159
+ const clone = new _DataSourceCache({
15124
15160
  nodesKey: cache.nodesKey
15125
15161
  });
15126
15162
  clone.allFieldsAffected = cache.allFieldsAffected;
@@ -15318,7 +15354,7 @@ var TreeExpandState = class {
15318
15354
 
15319
15355
  // src/components/DataSource/TreeSelectionState.ts
15320
15356
  var shortestToLongest = (a, b) => a.length - b.length;
15321
- var TreeSelectionState = class {
15357
+ var TreeSelectionState = class _TreeSelectionState {
15322
15358
  constructor(state, getConfig) {
15323
15359
  this.selectedPaths = null;
15324
15360
  this.deselectedPaths = null;
@@ -15347,7 +15383,7 @@ var TreeSelectionState = class {
15347
15383
  return deepMapValue.items.length;
15348
15384
  }
15349
15385
  static from(treeSelectionState, getConfig) {
15350
- return new TreeSelectionState(treeSelectionState, getConfig);
15386
+ return new _TreeSelectionState(treeSelectionState, getConfig);
15351
15387
  }
15352
15388
  setConfigFn(getConfig) {
15353
15389
  this.getConfig = getConfig;
@@ -16980,7 +17016,7 @@ function filterTreeDataSource(params) {
16980
17016
  }
16981
17017
  return treeDataArray;
16982
17018
  }
16983
- function filterDataSource(params) {
17019
+ function filterDataArray(params) {
16984
17020
  const {
16985
17021
  filterTypes,
16986
17022
  operatorsByFilterType,
@@ -17206,7 +17242,7 @@ function concludeReducer(params) {
17206
17242
  if (state.devToolsDetected) {
17207
17243
  filterTimestamp = Date.now();
17208
17244
  }
17209
- dataArray = filterDataSource({
17245
+ dataArray = filterDataArray({
17210
17246
  // tree-related stuff
17211
17247
  getNodeChildren,
17212
17248
  isLeafNode,
@@ -18020,7 +18056,7 @@ function useLoadData(options) {
18020
18056
  horizontal: false
18021
18057
  });
18022
18058
  const scrollbarsRef = useRef21(scrollbars);
18023
- useEffect19(() => {
18059
+ useEffect17(() => {
18024
18060
  notifyScrollbarsChange.onChange((scrollbars2) => {
18025
18061
  if (!scrollbars2) {
18026
18062
  return;
@@ -18030,7 +18066,7 @@ function useLoadData(options) {
18030
18066
  });
18031
18067
  return () => notifyScrollbarsChange.destroy();
18032
18068
  }, [notifyScrollbarsChange]);
18033
- useEffect19(() => {
18069
+ useEffect17(() => {
18034
18070
  if (!livePagination) {
18035
18071
  return;
18036
18072
  }
@@ -18043,7 +18079,7 @@ function useLoadData(options) {
18043
18079
  });
18044
18080
  return () => cancelAnimationFrame(frameId);
18045
18081
  }, [livePaginationCursor]);
18046
- useEffect19(() => {
18082
+ useEffect17(() => {
18047
18083
  if (!livePagination || livePaginationCursor !== void 0) {
18048
18084
  return;
18049
18085
  }
@@ -18056,7 +18092,7 @@ function useLoadData(options) {
18056
18092
  });
18057
18093
  return () => cancelAnimationFrame(frameId);
18058
18094
  }, [dataArray.length, livePaginationCursor]);
18059
- useEffect19(() => {
18095
+ useEffect17(() => {
18060
18096
  const state = getComponentState();
18061
18097
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
18062
18098
  if (!scrollbars.vertical && livePagination2) {
@@ -18186,7 +18222,7 @@ function useLazyLoadRange(options, dependencies) {
18186
18222
  componentActions: actions,
18187
18223
  componentState
18188
18224
  } = options;
18189
- useEffect19(() => {
18225
+ useEffect17(() => {
18190
18226
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
18191
18227
  }, [componentState.data, componentState.dataParams]);
18192
18228
  const {
@@ -18267,7 +18303,7 @@ function useLazyLoadRange(options, dependencies) {
18267
18303
  groupRowsState
18268
18304
  }
18269
18305
  );
18270
- useEffect19(() => {
18306
+ useEffect17(() => {
18271
18307
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
18272
18308
  debouncedLoadRange();
18273
18309
  }
@@ -19091,8 +19127,8 @@ function getDataSourceStateRestoreForDetails(state) {
19091
19127
  // src/components/DataSource/privateHooks/useDataSource.tsx
19092
19128
  import React51, {
19093
19129
  useCallback as useCallback19,
19094
- useEffect as useEffect20,
19095
- useLayoutEffect as useLayoutEffect10,
19130
+ useEffect as useEffect18,
19131
+ useLayoutEffect as useLayoutEffect12,
19096
19132
  useState as useState14
19097
19133
  } from "react";
19098
19134
  function useDataSourceInternal(props) {
@@ -19134,12 +19170,12 @@ function useDataSourceInternal(props) {
19134
19170
  },
19135
19171
  [ContextComponent, isDetail, key]
19136
19172
  );
19137
- useLayoutEffect10(() => {
19173
+ useLayoutEffect12(() => {
19138
19174
  if (masterContext) {
19139
19175
  masterContext.registerDetail(contextValue);
19140
19176
  }
19141
19177
  }, []);
19142
- useLayoutEffect10(() => {
19178
+ useLayoutEffect12(() => {
19143
19179
  return () => {
19144
19180
  const state = getState();
19145
19181
  state.onCleanup(state);
@@ -19163,7 +19199,7 @@ function useDataSourceInternal(props) {
19163
19199
  componentActions,
19164
19200
  getComponentState: getState
19165
19201
  });
19166
- useEffect20(() => {
19202
+ useEffect18(() => {
19167
19203
  componentState.onDataArrayChange?.(
19168
19204
  componentState.originalDataArray,
19169
19205
  componentState.originalDataArrayChangedInfo
@@ -19185,7 +19221,7 @@ function useDataSourceInternal(props) {
19185
19221
  });
19186
19222
  }
19187
19223
  }, [componentState.originalDataArrayChangedInfo]);
19188
- useEffect20(() => {
19224
+ useEffect18(() => {
19189
19225
  componentState.onReady?.(api);
19190
19226
  }, []);
19191
19227
  return {
@@ -19246,7 +19282,7 @@ var RowDetailState = class extends BooleanCollectionState {
19246
19282
  };
19247
19283
 
19248
19284
  // src/utils/FixedSizeMap.ts
19249
- var _FixedSizeMap = class {
19285
+ var _FixedSizeMap = class _FixedSizeMap {
19250
19286
  constructor(clone, size) {
19251
19287
  this.keysInOrder = [];
19252
19288
  if (typeof clone === "number") {
@@ -19304,8 +19340,8 @@ var _FixedSizeMap = class {
19304
19340
  return this;
19305
19341
  }
19306
19342
  };
19343
+ _FixedSizeMap.DEFAULT_SIZE = 10;
19307
19344
  var FixedSizeMap = _FixedSizeMap;
19308
- FixedSizeMap.DEFAULT_SIZE = 10;
19309
19345
 
19310
19346
  // src/components/DataSource/RowDetailCache.ts
19311
19347
  var RowDetailNoCacheStorage = class {
@@ -19465,8 +19501,7 @@ function realignColumnContextMenu(param) {
19465
19501
 
19466
19502
  // src/components/InfiniteTable/types/Utility.ts
19467
19503
  function notNullable(value) {
19468
- if (value === null || value === void 0)
19469
- return false;
19504
+ if (value === null || value === void 0) return false;
19470
19505
  const testDummyForCompileError = value;
19471
19506
  return true;
19472
19507
  }
@@ -21134,7 +21169,7 @@ function getImperativeApi(context) {
21134
21169
 
21135
21170
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
21136
21171
  import {
21137
- useEffect as useEffect21,
21172
+ useEffect as useEffect19,
21138
21173
  useRef as useRef22,
21139
21174
  useState as useState15
21140
21175
  } from "react";
@@ -21212,7 +21247,7 @@ function useAutoSizeColumns() {
21212
21247
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
21213
21248
  const getTheKey = useLatest(theKey);
21214
21249
  const lastExecutedIdentifierRef = useRef22(null);
21215
- useEffect21(() => {
21250
+ useEffect19(() => {
21216
21251
  const key = getTheKey();
21217
21252
  if (key == null) {
21218
21253
  return;
@@ -21225,7 +21260,7 @@ function useAutoSizeColumns() {
21225
21260
  };
21226
21261
  return brain.onRenderRangeChange(onChange);
21227
21262
  }, [brain]);
21228
- useEffect21(() => {
21263
+ useEffect19(() => {
21229
21264
  if (theKey == null) {
21230
21265
  return;
21231
21266
  }
@@ -21271,7 +21306,7 @@ function useAutoSizeColumns() {
21271
21306
 
21272
21307
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
21273
21308
  import { useMemo as useMemo9 } from "react";
21274
- import { useCallback as useCallback20, useEffect as useEffect22, useRef as useRef24 } from "react";
21309
+ import { useCallback as useCallback20, useEffect as useEffect20, useRef as useRef24 } from "react";
21275
21310
  import * as React54 from "react";
21276
21311
 
21277
21312
  // src/components/InfiniteTable/hooks/useYourBrain.ts
@@ -21528,17 +21563,17 @@ function useCellRendering(param) {
21528
21563
  rowspan
21529
21564
  });
21530
21565
  const scrollTopMaxRef = useRef24(0);
21531
- useEffect22(() => {
21566
+ useEffect20(() => {
21532
21567
  return brain.onRenderCountChange(() => {
21533
21568
  scrollTopMaxRef.current = brain.scrollTopMax;
21534
21569
  });
21535
21570
  }, [brain]);
21536
- useEffect22(() => {
21571
+ useEffect20(() => {
21537
21572
  return brain.onRenderRangeChange((range) => {
21538
21573
  getState().onRenderRangeChange?.(range);
21539
21574
  });
21540
21575
  }, [brain]);
21541
- useEffect22(() => {
21576
+ useEffect20(() => {
21542
21577
  return brain.onScrollStop((scrollPosition) => {
21543
21578
  const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = scrollPosition;
21544
21579
  if (scrollTop2 === 0) {
@@ -21578,13 +21613,13 @@ function useCellRendering(param) {
21578
21613
  }
21579
21614
  });
21580
21615
  }, [brain, onScrollToTop, onScrollToBottom, onScrollStop]);
21581
- useEffect22(() => {
21616
+ useEffect20(() => {
21582
21617
  if (!bodySize.height) {
21583
21618
  return;
21584
21619
  }
21585
21620
  actions.ready = true;
21586
21621
  }, [!!bodySize.height]);
21587
- useEffect22(() => {
21622
+ useEffect20(() => {
21588
21623
  if (!ready) {
21589
21624
  }
21590
21625
  const { onReady } = getState();
@@ -21593,7 +21628,7 @@ function useCellRendering(param) {
21593
21628
  }
21594
21629
  }, [ready]);
21595
21630
  const [, rerender] = useRerender();
21596
- useEffect22(() => {
21631
+ useEffect20(() => {
21597
21632
  rerender();
21598
21633
  }, [dataSourceState]);
21599
21634
  const renderCell = useCallback20(
@@ -21718,7 +21753,7 @@ function useCellRendering(param) {
21718
21753
  }
21719
21754
 
21720
21755
  // src/components/InfiniteTable/hooks/useComputed.ts
21721
- import { useEffect as useEffect25, useState as useState17 } from "react";
21756
+ import { useEffect as useEffect23, useState as useState17 } from "react";
21722
21757
 
21723
21758
  // src/components/InfiniteTable/utils/MultiCellSelector.ts
21724
21759
  var MultiCellSelector = class {
@@ -21991,7 +22026,7 @@ function useColumnSizeFn(columns) {
21991
22026
  }
21992
22027
 
21993
22028
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
21994
- import { useEffect as useEffect23, useLayoutEffect as useLayoutEffect11, useMemo as useMemo11 } from "react";
22029
+ import { useEffect as useEffect21, useLayoutEffect as useLayoutEffect13, useMemo as useMemo11 } from "react";
21995
22030
 
21996
22031
  // src/components/InfiniteTable/state/getInitialState.ts
21997
22032
  import { createRef } from "react";
@@ -22356,7 +22391,8 @@ function createBrains(debugId, wrapRowsHorizontally) {
22356
22391
  const brain = !wrapRowsHorizontally ? new MatrixBrain(debugChannel) : new HorizontalLayoutMatrixBrain(debugChannel, {
22357
22392
  isHeader: false
22358
22393
  });
22359
- const headerBrain = !wrapRowsHorizontally ? new MatrixBrain(debugChannel) : new HorizontalLayoutMatrixBrain(debugChannel, {
22394
+ const headerBrainChannel = `${debugChannel}:header`;
22395
+ const headerBrain = !wrapRowsHorizontally ? new MatrixBrain(headerBrainChannel) : new HorizontalLayoutMatrixBrain(headerBrainChannel, {
22360
22396
  isHeader: true,
22361
22397
  masterBrain: brain
22362
22398
  });
@@ -22366,30 +22402,40 @@ function createBrains(debugId, wrapRowsHorizontally) {
22366
22402
  scrollTop: 0
22367
22403
  });
22368
22404
  });
22369
- if (false) {
22370
- globalThis.brain = brain;
22371
- globalThis.headerBrain = headerBrain;
22372
- }
22373
22405
  const { renderer, onRenderUpdater } = createRenderer(brain);
22406
+ const { renderer: headerRenderer, onRenderUpdater: headerOnRenderUpdater } = createRenderer(headerBrain);
22374
22407
  brain.onAvailableSizeChange((size) => {
22375
22408
  headerBrain.update({ width: size.width });
22376
22409
  });
22377
- return { brain, headerBrain, renderer, onRenderUpdater };
22410
+ return {
22411
+ brain,
22412
+ headerBrain,
22413
+ renderer,
22414
+ onRenderUpdater,
22415
+ headerRenderer,
22416
+ headerOnRenderUpdater
22417
+ };
22378
22418
  }
22379
22419
  function initSetupState2({
22380
22420
  debugId,
22381
22421
  wrapRowsHorizontally
22382
22422
  }) {
22383
22423
  const columnsGeneratedForGrouping = {};
22384
- const { brain, headerBrain, renderer, onRenderUpdater } = createBrains(
22385
- debugId,
22386
- !!wrapRowsHorizontally
22387
- );
22424
+ const {
22425
+ brain,
22426
+ headerBrain,
22427
+ renderer,
22428
+ onRenderUpdater,
22429
+ headerRenderer,
22430
+ headerOnRenderUpdater
22431
+ } = createBrains(debugId, !!wrapRowsHorizontally);
22388
22432
  const domRef = createRef();
22389
22433
  return {
22390
22434
  debugWarnings: /* @__PURE__ */ new Map(),
22391
22435
  renderer,
22392
22436
  onRenderUpdater,
22437
+ headerRenderer,
22438
+ headerOnRenderUpdater,
22393
22439
  devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
22394
22440
  propsCache: /* @__PURE__ */ new Map([]),
22395
22441
  lastRowToCollapseRef: { current: null },
@@ -22580,7 +22626,9 @@ var cleanupState = (state) => {
22580
22626
  state.brain.destroy();
22581
22627
  state.headerBrain.destroy();
22582
22628
  state.renderer.destroy();
22629
+ state.headerRenderer.destroy();
22583
22630
  state.onRenderUpdater.destroy();
22631
+ state.headerOnRenderUpdater.destroy();
22584
22632
  state.onFlashingDurationCSSVarChange.destroy();
22585
22633
  state.onRowHeightCSSVarChange.destroy();
22586
22634
  state.onColumnHeaderHeightCSSVarChange.destroy();
@@ -22856,13 +22904,13 @@ function useColumnsWhen() {
22856
22904
  pivotGrandTotalColumnPosition
22857
22905
  }
22858
22906
  } = useManagedComponentState();
22859
- useEffect23(() => {
22907
+ useEffect21(() => {
22860
22908
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
22861
22909
  }, [groupRenderStrategy]);
22862
- useEffect23(() => {
22910
+ useEffect21(() => {
22863
22911
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
22864
22912
  }, [pivotTotalColumnPosition]);
22865
- useEffect23(() => {
22913
+ useEffect21(() => {
22866
22914
  if (pivotGrandTotalColumnPosition != void 0) {
22867
22915
  dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
22868
22916
  }
@@ -22945,7 +22993,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
22945
22993
  });
22946
22994
  return Object.keys(computedColumns).length === 0 ? void 0 : computedColumns;
22947
22995
  }
22948
- useEffect23(() => {
22996
+ useEffect21(() => {
22949
22997
  const update = () => {
22950
22998
  componentActions.columnsWhenInlineGroupRenderStrategy = isTree ? void 0 : computeColumnsWhenInlineGroupRenderStrategy(
22951
22999
  columns,
@@ -22976,7 +23024,7 @@ function useColumnsWhenGrouping() {
22976
23024
  getComponentState
22977
23025
  } = useManagedComponentState();
22978
23026
  const toggleGroupRow = useToggleGroupRow();
22979
- useEffect23(() => {
23027
+ useEffect21(() => {
22980
23028
  const update = () => {
22981
23029
  const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
22982
23030
  columns,
@@ -23047,7 +23095,7 @@ function useHideColumns(groupByMap) {
23047
23095
  groupRenderStrategy
23048
23096
  }
23049
23097
  } = useManagedComponentState();
23050
- useLayoutEffect11(() => {
23098
+ useLayoutEffect13(() => {
23051
23099
  if (groupRenderStrategy !== "multi-column") {
23052
23100
  return;
23053
23101
  }
@@ -23080,7 +23128,7 @@ function useHideColumns(groupByMap) {
23080
23128
  hideEmptyGroupColumns ? groupRowsIndexesInDataArray : null,
23081
23129
  hideEmptyGroupColumns
23082
23130
  ]);
23083
- useEffect23(() => {
23131
+ useEffect21(() => {
23084
23132
  const isGrouped = groupBy.length > 0;
23085
23133
  const currentState = getComponentState();
23086
23134
  const {
@@ -23491,7 +23539,7 @@ function useComputedRowHeight(param) {
23491
23539
  }
23492
23540
 
23493
23541
  // src/components/InfiniteTable/hooks/useScrollbars.ts
23494
- import { useState as useState16, useEffect as useEffect24, useLayoutEffect as useLayoutEffect12 } from "react";
23542
+ import { useState as useState16, useEffect as useEffect22, useLayoutEffect as useLayoutEffect14 } from "react";
23495
23543
  var INITIAL_SCROLLBARS = {
23496
23544
  vertical: false,
23497
23545
  horizontal: false
@@ -23500,7 +23548,7 @@ function useScrollbars(brain) {
23500
23548
  const { getComponentState: getInfiniteTableState } = useManagedComponentState();
23501
23549
  const { getState: getDataSourceState } = useDataSourceContextValue();
23502
23550
  const [scrollbars, setScrollbars] = useState16(INITIAL_SCROLLBARS);
23503
- useEffect24(() => {
23551
+ useEffect22(() => {
23504
23552
  return brain.onRenderCountChange(() => {
23505
23553
  const { scrollTopMax, scrollLeftMax } = brain;
23506
23554
  setScrollbars({
@@ -23509,7 +23557,7 @@ function useScrollbars(brain) {
23509
23557
  });
23510
23558
  });
23511
23559
  }, [brain]);
23512
- useLayoutEffect12(() => {
23560
+ useLayoutEffect14(() => {
23513
23561
  const dataSourceState = getDataSourceState();
23514
23562
  const { onScrollbarsChange } = getInfiniteTableState();
23515
23563
  const { notifyScrollbarsChange } = dataSourceState;
@@ -23575,7 +23623,7 @@ function useComputed() {
23575
23623
  }
23576
23624
  );
23577
23625
  });
23578
- useEffect25(() => {
23626
+ useEffect23(() => {
23579
23627
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
23580
23628
  }, [showSeparatePivotColumnForSingleAggregation]);
23581
23629
  const { multiSort, filterValue, filterTypes } = dataSourceState;
@@ -23883,7 +23931,7 @@ var useLicense = (licenseKey = "") => {
23883
23931
  }
23884
23932
  let valid2 = isValidLicense(licenseKey, {
23885
23933
  publishedAt: 1624970570587,
23886
- version: "7.0.0"
23934
+ version: "7.1.0"
23887
23935
  });
23888
23936
  if (!licenseKey && !valid2 && isInsidePlayground) {
23889
23937
  return true;
@@ -23894,18 +23942,18 @@ var useLicense = (licenseKey = "") => {
23894
23942
  };
23895
23943
 
23896
23944
  // src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
23897
- import { useRef as useRef25, useEffect as useEffect26 } from "react";
23945
+ import { useRef as useRef25, useEffect as useEffect24 } from "react";
23898
23946
  var RETRIES = 10;
23899
23947
  function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
23900
23948
  const didScrollRef = useRef25(false);
23901
23949
  const rafId = useRef25(null);
23902
- useEffect26(() => {
23950
+ useEffect24(() => {
23903
23951
  if (activeCellIndex != null) {
23904
23952
  didScrollRef.current = false;
23905
23953
  cancelRaf(rafId.current);
23906
23954
  }
23907
23955
  }, [activeCellIndex]);
23908
- useEffect26(() => {
23956
+ useEffect24(() => {
23909
23957
  if (activeCellIndex != null && !didScrollRef.current) {
23910
23958
  let tryScroll2 = function(times = 0) {
23911
23959
  times++;
@@ -23933,18 +23981,18 @@ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
23933
23981
  }
23934
23982
 
23935
23983
  // src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
23936
- import { useRef as useRef26, useEffect as useEffect27 } from "react";
23984
+ import { useRef as useRef26, useEffect as useEffect25 } from "react";
23937
23985
  var RETRIES2 = 10;
23938
23986
  function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
23939
23987
  const didScrollRef = useRef26(false);
23940
23988
  const rafId = useRef26(null);
23941
- useEffect27(() => {
23989
+ useEffect25(() => {
23942
23990
  if (activeRowIndex != null) {
23943
23991
  didScrollRef.current = false;
23944
23992
  cancelAnimationFrame(rafId.current);
23945
23993
  }
23946
23994
  }, [activeRowIndex]);
23947
- useEffect27(() => {
23995
+ useEffect25(() => {
23948
23996
  if (activeRowIndex != null && !didScrollRef.current) {
23949
23997
  let tryScroll2 = function(times = 0) {
23950
23998
  times++;
@@ -23973,7 +24021,7 @@ function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
23973
24021
  var toCSSVarName = (value) => `--infinite-${value}`;
23974
24022
 
23975
24023
  // src/components/InfiniteTable/eventHandlers/index.ts
23976
- import { useCallback as useCallback23, useMemo as useMemo15, useEffect as useEffect28 } from "react";
24024
+ import { useCallback as useCallback23, useMemo as useMemo15, useEffect as useEffect26 } from "react";
23977
24025
 
23978
24026
  // src/components/InfiniteTable/eventHandlers/onCellClick.ts
23979
24027
  function onCellClick(context, event) {
@@ -24685,7 +24733,7 @@ function useEventHandlersContext() {
24685
24733
  }
24686
24734
  function handleDOMEvents() {
24687
24735
  const context = useEventHandlersContext();
24688
- useEffect28(() => {
24736
+ useEffect26(() => {
24689
24737
  const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
24690
24738
  onKeyDown(context, event);
24691
24739
  });
@@ -24741,20 +24789,20 @@ function useDOMEventHandlers() {
24741
24789
  }
24742
24790
 
24743
24791
  // src/components/InfiniteTable/hooks/useColumnMenu.ts
24744
- import { useEffect as useEffect32 } from "react";
24792
+ import { useEffect as useEffect30 } from "react";
24745
24793
 
24746
24794
  // src/components/hooks/useOverlay/index.tsx
24747
24795
  import * as React56 from "react";
24748
24796
  import {
24749
24797
  useCallback as useCallback24,
24750
- useEffect as useEffect30,
24751
- useLayoutEffect as useLayoutEffect13,
24798
+ useEffect as useEffect28,
24799
+ useLayoutEffect as useLayoutEffect15,
24752
24800
  useState as useState18
24753
24801
  } from "react";
24754
24802
  import { createPortal as createPortal2 } from "react-dom";
24755
24803
 
24756
24804
  // src/utils/pageGeometry/Point.ts
24757
- var Point = class {
24805
+ var Point = class _Point {
24758
24806
  constructor(point) {
24759
24807
  this.top = 0;
24760
24808
  this.left = 0;
@@ -24762,10 +24810,10 @@ var Point = class {
24762
24810
  this.top = point.top;
24763
24811
  }
24764
24812
  static clone(point) {
24765
- return new Point(point);
24813
+ return new _Point(point);
24766
24814
  }
24767
24815
  static from(point) {
24768
- return new Point(point);
24816
+ return new _Point(point);
24769
24817
  }
24770
24818
  shift(shiftOptions) {
24771
24819
  if (shiftOptions.top != null) {
@@ -24871,14 +24919,14 @@ var PolyWithPoints = class {
24871
24919
  };
24872
24920
 
24873
24921
  // src/utils/pageGeometry/ConvexPoly.ts
24874
- var ConvexPoly = class extends PolyWithPoints {
24922
+ var ConvexPoly = class _ConvexPoly extends PolyWithPoints {
24923
+ static clone(points) {
24924
+ return new _ConvexPoly(points);
24925
+ }
24875
24926
  constructor(points) {
24876
24927
  super();
24877
24928
  this.points = points.map(Point.clone);
24878
24929
  }
24879
- static clone(points) {
24880
- return new ConvexPoly(points);
24881
- }
24882
24930
  getPoints() {
24883
24931
  return this.points;
24884
24932
  }
@@ -24891,7 +24939,7 @@ var ConvexPoly = class extends PolyWithPoints {
24891
24939
  };
24892
24940
 
24893
24941
  // src/utils/pageGeometry/Rectangle.ts
24894
- var Rectangle = class extends PolyWithPoints {
24942
+ var Rectangle = class _Rectangle extends PolyWithPoints {
24895
24943
  constructor(coordsAndSize) {
24896
24944
  super();
24897
24945
  this.top = 0;
@@ -24911,16 +24959,16 @@ var Rectangle = class extends PolyWithPoints {
24911
24959
  }
24912
24960
  }
24913
24961
  static fromDOMRect(rect) {
24914
- return new Rectangle(rect);
24962
+ return new _Rectangle(rect);
24915
24963
  }
24916
24964
  static clone(rect) {
24917
- return new Rectangle(rect);
24965
+ return new _Rectangle(rect);
24918
24966
  }
24919
24967
  static from(rect) {
24920
- return Rectangle.clone(rect);
24968
+ return _Rectangle.clone(rect);
24921
24969
  }
24922
24970
  static fromPoint(point) {
24923
- return Rectangle.from({
24971
+ return _Rectangle.from({
24924
24972
  top: point.top,
24925
24973
  left: point.left,
24926
24974
  width: 0,
@@ -25138,7 +25186,7 @@ function DefaultOverlayPortal(props) {
25138
25186
  }
25139
25187
  function OverlayContent(props) {
25140
25188
  const nodeRef = React56.useRef(null);
25141
- useEffect30(() => {
25189
+ useEffect28(() => {
25142
25190
  return props.realign.onChange((handle) => {
25143
25191
  if (nodeRef.current && handle) {
25144
25192
  alignNode(nodeRef.current, handle);
@@ -25199,7 +25247,7 @@ async function alignNode(node, params) {
25199
25247
  }
25200
25248
  function useOverlayPortal(content, portalContainer) {
25201
25249
  const [container, setContainer] = useState18(null);
25202
- useLayoutEffect13(() => {
25250
+ useLayoutEffect15(() => {
25203
25251
  async function getContainer() {
25204
25252
  const container2 = portalContainer ? await retrieveElement(portalContainer) : null;
25205
25253
  if (container2 != null) {
@@ -25505,7 +25553,7 @@ var deriveStateFromProps2 = (params) => {
25505
25553
  import * as React59 from "react";
25506
25554
  import {
25507
25555
  useCallback as useCallback26,
25508
- useLayoutEffect as useLayoutEffect14,
25556
+ useLayoutEffect as useLayoutEffect16,
25509
25557
  useRef as useRef29,
25510
25558
  useState as useState20
25511
25559
  } from "react";
@@ -25735,10 +25783,10 @@ function useMenuContext() {
25735
25783
  }
25736
25784
 
25737
25785
  // src/components/hooks/useMounted.ts
25738
- import { useCallback as useCallback25, useEffect as useEffect31, useRef as useRef28 } from "react";
25786
+ import { useCallback as useCallback25, useEffect as useEffect29, useRef as useRef28 } from "react";
25739
25787
  function useMounted() {
25740
25788
  let mountedRef = useRef28(true);
25741
- useEffect31(() => {
25789
+ useEffect29(() => {
25742
25790
  mountedRef.current = true;
25743
25791
  return () => {
25744
25792
  mountedRef.current = false;
@@ -25903,7 +25951,7 @@ function MenuComponent(props) {
25903
25951
  const isMounted = useMounted();
25904
25952
  const [submenuApi, setSubmenuApi] = useState20(null);
25905
25953
  let renderedChildren = null;
25906
- useLayoutEffect14(() => {
25954
+ useLayoutEffect16(() => {
25907
25955
  const { runtimeItems: runtimeItems2 } = getState();
25908
25956
  const activeItem = runtimeItems2.filter(
25909
25957
  (item) => item.type === "item" && activeItemKey === item.key
@@ -26550,7 +26598,7 @@ function useColumnMenu() {
26550
26598
  } = useOverlay({
26551
26599
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26552
26600
  });
26553
- useEffect32(() => {
26601
+ useEffect30(() => {
26554
26602
  const { actions: actions2, getState: getState2 } = context;
26555
26603
  const state = getState2();
26556
26604
  return state.onColumnMenuClick.onChange((info) => {
@@ -26565,7 +26613,7 @@ function useColumnMenu() {
26565
26613
  });
26566
26614
  }, []);
26567
26615
  const { columnMenuVisibleForColumnId, columnMenuVisibleKey } = getState();
26568
- useEffect32(() => {
26616
+ useEffect30(() => {
26569
26617
  const { columnMenuVisibleForColumnId: columnMenuVisibleForColumnId2, columnMenuTargetRef } = getState();
26570
26618
  if (columnMenuVisibleForColumnId2) {
26571
26619
  let handleMouseDown2 = function(event) {
@@ -26645,13 +26693,13 @@ function FocusDetect() {
26645
26693
  }
26646
26694
 
26647
26695
  // src/components/InfiniteTable/hooks/useEditingCallbackProps.ts
26648
- import { useEffect as useEffect33 } from "react";
26696
+ import { useEffect as useEffect31 } from "react";
26649
26697
  function useOnEditCancelled() {
26650
26698
  const context = useInfiniteTable();
26651
26699
  const { getState } = context;
26652
26700
  const { editingCell } = getState();
26653
26701
  const cancelled = editingCell && !editingCell.active ? editingCell.cancelled : void 0;
26654
- useEffect33(() => {
26702
+ useEffect31(() => {
26655
26703
  if (cancelled) {
26656
26704
  const { rowIndex, columnId, initialValue } = getState().editingCell;
26657
26705
  const { onEditCancelled } = getState();
@@ -26673,7 +26721,7 @@ function useOnEditRejected() {
26673
26721
  state: { editingCell }
26674
26722
  } = context;
26675
26723
  const rejected = editingCell && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0;
26676
- useEffect33(() => {
26724
+ useEffect31(() => {
26677
26725
  if (rejected) {
26678
26726
  const { rowIndex, columnId, value, initialValue } = getState().editingCell;
26679
26727
  const { onEditRejected } = getState();
@@ -26697,7 +26745,7 @@ function useFocusOnEditStop() {
26697
26745
  } = context;
26698
26746
  const active = editingCell?.active;
26699
26747
  const prevActive = usePrevious(active);
26700
- useEffect33(() => {
26748
+ useEffect31(() => {
26701
26749
  if (!active && prevActive) {
26702
26750
  context.api.focus();
26703
26751
  }
@@ -26710,7 +26758,7 @@ function useOnEditAccepted() {
26710
26758
  getState
26711
26759
  } = context;
26712
26760
  const accepted = editingCell && !editingCell.active && !editingCell.cancelled && editingCell.accepted === true;
26713
- useEffect33(() => {
26761
+ useEffect31(() => {
26714
26762
  if (accepted) {
26715
26763
  const { editingCell: editingCell2 } = getState();
26716
26764
  const { value, rowIndex, columnId, initialValue } = editingCell2;
@@ -26735,7 +26783,7 @@ function useOnEditPersisted() {
26735
26783
  getState
26736
26784
  } = context;
26737
26785
  const persisted = editingCell ? editingCell.persisted : void 0;
26738
- useEffect33(() => {
26786
+ useEffect31(() => {
26739
26787
  if (persisted) {
26740
26788
  const { editingCell: editingCell2, onEditPersistError, onEditPersistSuccess } = getState();
26741
26789
  if (!editingCell2) {
@@ -26768,7 +26816,7 @@ function useEditingCallbackProps() {
26768
26816
  }
26769
26817
 
26770
26818
  // src/components/InfiniteTable/hooks/useColumnFilterOperatorMenu.ts
26771
- import { useEffect as useEffect34 } from "react";
26819
+ import { useEffect as useEffect32 } from "react";
26772
26820
 
26773
26821
  // src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
26774
26822
  import * as React66 from "react";
@@ -26907,7 +26955,7 @@ function useColumnFilterOperatorMenu() {
26907
26955
  } = useOverlay({
26908
26956
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26909
26957
  });
26910
- useEffect34(() => {
26958
+ useEffect32(() => {
26911
26959
  const { actions: actions2, getState: getState2 } = context;
26912
26960
  const state = getState2();
26913
26961
  return state.onFilterOperatorMenuClick.onChange((info) => {
@@ -26943,7 +26991,7 @@ function useColumnFilterOperatorMenu() {
26943
26991
  actions2.filterOperatorMenuVisibleForColumnId = column.id;
26944
26992
  });
26945
26993
  }, []);
26946
- useEffect34(() => {
26994
+ useEffect32(() => {
26947
26995
  const { filterOperatorMenuVisibleForColumnId } = getState();
26948
26996
  if (filterOperatorMenuVisibleForColumnId) {
26949
26997
  let handleMouseDown2 = function(event) {
@@ -26970,7 +27018,7 @@ function useColumnFilterOperatorMenu() {
26970
27018
  }
26971
27019
 
26972
27020
  // src/components/InfiniteTable/hooks/useContextMenu.ts
26973
- import { useEffect as useEffect35 } from "react";
27021
+ import { useEffect as useEffect33 } from "react";
26974
27022
 
26975
27023
  // src/components/InfiniteTable/utils/getCellContextMenu.tsx
26976
27024
  import * as React68 from "react";
@@ -27137,7 +27185,7 @@ function useCellContextMenu() {
27137
27185
  } = useOverlay({
27138
27186
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
27139
27187
  });
27140
- useEffect35(() => {
27188
+ useEffect33(() => {
27141
27189
  const { actions: actions2, getState: getState2, getDataSourceState } = context;
27142
27190
  const state = getState2();
27143
27191
  return state.cellContextMenu.onChange((info) => {
@@ -27188,7 +27236,7 @@ function useCellContextMenu() {
27188
27236
  }
27189
27237
  });
27190
27238
  }, []);
27191
- useEffect35(() => {
27239
+ useEffect33(() => {
27192
27240
  const { cellContextMenuVisibleFor } = getState();
27193
27241
  if (cellContextMenuVisibleFor) {
27194
27242
  let handleMouseDown2 = function(event) {
@@ -27224,7 +27272,7 @@ function useTableContextMenu() {
27224
27272
  } = useOverlay({
27225
27273
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
27226
27274
  });
27227
- useEffect35(() => {
27275
+ useEffect33(() => {
27228
27276
  const { actions: actions2, getState: getState2 } = context;
27229
27277
  const state = getState2();
27230
27278
  return state.contextMenu.onChange((info) => {
@@ -27273,7 +27321,7 @@ function useTableContextMenu() {
27273
27321
  }
27274
27322
  });
27275
27323
  }, []);
27276
- useEffect35(() => {
27324
+ useEffect33(() => {
27277
27325
  const { contextMenuVisibleFor } = getState();
27278
27326
  if (contextMenuVisibleFor) {
27279
27327
  let handleMouseDown2 = function(event) {
@@ -27304,13 +27352,13 @@ import { useRef as useRef30 } from "react";
27304
27352
  import * as React69 from "react";
27305
27353
 
27306
27354
  // src/components/InfiniteTable/hooks/useGridScroll.ts
27307
- import { useCallback as useCallback28, useEffect as useEffect36 } from "react";
27355
+ import { useCallback as useCallback28, useEffect as useEffect34 } from "react";
27308
27356
  function useGridScroll(onScroll, deps) {
27309
27357
  const {
27310
27358
  state: { brain }
27311
27359
  } = useInfiniteTable();
27312
27360
  const memoizedOnScroll = useCallback28(onScroll, deps);
27313
- useEffect36(() => {
27361
+ useEffect34(() => {
27314
27362
  const removeOnScroll = brain.onScroll(memoizedOnScroll);
27315
27363
  return removeOnScroll;
27316
27364
  }, [brain, memoizedOnScroll]);
@@ -27380,12 +27428,12 @@ function useVisibleColumnSizes() {
27380
27428
  var DEBUG_NAME = "InfiniteTable";
27381
27429
 
27382
27430
  // src/components/InfiniteTable/hooks/useToggleWrapRowsHorizontally.ts
27383
- import { useEffect as useEffect37 } from "react";
27431
+ import { useEffect as useEffect35 } from "react";
27384
27432
  function useToggleWrapRowsHorizontally() {
27385
27433
  const { state, getState, actions } = useInfiniteTable();
27386
27434
  const { wrapRowsHorizontally } = state;
27387
27435
  const oldWrapRowsHorizontally = usePrevious(wrapRowsHorizontally);
27388
- useEffect37(() => {
27436
+ useEffect35(() => {
27389
27437
  if (oldWrapRowsHorizontally !== wrapRowsHorizontally) {
27390
27438
  const { brain, headerBrain, renderer, onRenderUpdater } = getState();
27391
27439
  brain.destroy();
@@ -27397,12 +27445,14 @@ function useToggleWrapRowsHorizontally() {
27397
27445
  actions.headerBrain = newBrains.headerBrain;
27398
27446
  actions.renderer = newBrains.renderer;
27399
27447
  actions.onRenderUpdater = newBrains.onRenderUpdater;
27448
+ actions.headerRenderer = newBrains.headerRenderer;
27449
+ actions.headerOnRenderUpdater = newBrains.headerOnRenderUpdater;
27400
27450
  }
27401
27451
  }, [oldWrapRowsHorizontally, wrapRowsHorizontally]);
27402
27452
  }
27403
27453
 
27404
27454
  // src/components/InfiniteTable/hooks/useHorizontalLayout.ts
27405
- import { useEffect as useEffect38 } from "react";
27455
+ import { useEffect as useEffect36 } from "react";
27406
27456
  function useHorizontalLayout() {
27407
27457
  const { getState, actions, dataSourceActions, getDataSourceState } = useInfiniteTable();
27408
27458
  const { groupBy, isTree } = getDataSourceState();
@@ -27412,7 +27462,7 @@ function useHorizontalLayout() {
27412
27462
  if (!wrapRowsHorizontally) {
27413
27463
  repeatWrappedGroupRows = false;
27414
27464
  }
27415
- useEffect38(() => {
27465
+ useEffect36(() => {
27416
27466
  if (!wrapRowsHorizontally) {
27417
27467
  if (getDataSourceState().repeatWrappedGroupRows) {
27418
27468
  dataSourceActions.repeatWrappedGroupRows = false;
@@ -27456,7 +27506,7 @@ function useHorizontalLayout() {
27456
27506
  }
27457
27507
 
27458
27508
  // src/components/InfiniteTable/hooks/useDebugMode.ts
27459
- import { useEffect as useEffect39, useRef as useRef31 } from "react";
27509
+ import { useEffect as useEffect37, useRef as useRef31 } from "react";
27460
27510
 
27461
27511
  // src/components/InfiniteTable/hooks/debugModeDevToolsOverlay.css.ts
27462
27512
  var DevToolsOverlay = createRuntimeFn({ defaultClassName: "_143ofgf0", variantClassNames: { active: { true: "_143ofgf1", false: "_143ofgf2" } }, defaultVariants: {}, compoundVariants: [] });
@@ -27602,7 +27652,7 @@ function useDebugMode() {
27602
27652
  }
27603
27653
  }
27604
27654
  }
27605
- useEffect39(() => {
27655
+ useEffect37(() => {
27606
27656
  const dataSourceState = getDataSourceState();
27607
27657
  if (dataSourceState.debugId !== debugId) {
27608
27658
  dataSourceActions.debugId = debugId;
@@ -27773,7 +27823,7 @@ var DEVTOOLS_MESSAGES = {
27773
27823
  function listenForDevTools() {
27774
27824
  if (typeof window !== "undefined") {
27775
27825
  window.addEventListener("message", (event) => {
27776
- if (event.data.source.startsWith("infinite-table-devtools-contentscript") && event.data.target === "infinite-table-page") {
27826
+ if (event && event.data && typeof event.data.source === "string" && typeof event.data.target === "string" && event.data.target === "infinite-table-page" && event.data.source.startsWith("infinite-table-devtools-contentscript")) {
27777
27827
  if (!window.__INFINITE_TABLE_DEVTOOLS_HOOK__) {
27778
27828
  setupHook();
27779
27829
  HOOK_FN_SETUP_CALLBACK(
@@ -27806,7 +27856,7 @@ function useDevTools() {
27806
27856
  const debugId = state.debugId;
27807
27857
  const debugIdRef = useRef31(debugId);
27808
27858
  debugIdRef.current = debugId;
27809
- useEffect39(() => {
27859
+ useEffect37(() => {
27810
27860
  const debugId2 = debugIdRef.current;
27811
27861
  if (!debugId2) {
27812
27862
  return;
@@ -27834,7 +27884,7 @@ function useDevTools() {
27834
27884
  withHookFn(hookFn2);
27835
27885
  });
27836
27886
  }, []);
27837
- useEffect39(() => {
27887
+ useEffect37(() => {
27838
27888
  const debugId2 = debugIdRef.current;
27839
27889
  if (!debugId2) {
27840
27890
  return;
@@ -27852,7 +27902,7 @@ function useDevTools() {
27852
27902
  });
27853
27903
  }
27854
27904
  });
27855
- useEffect39(() => {
27905
+ useEffect37(() => {
27856
27906
  if (!debugId) {
27857
27907
  return;
27858
27908
  }
@@ -28391,7 +28441,7 @@ function queryKeyToCacheKey(key) {
28391
28441
  }
28392
28442
  return key;
28393
28443
  }
28394
- var _DataClient = class {
28444
+ var _DataClient = class _DataClient {
28395
28445
  constructor(options) {
28396
28446
  this.queryCache = new DeepMap();
28397
28447
  this.removeQueryIfErrored = (query, stringifiedQueryKey) => {
@@ -28485,8 +28535,8 @@ var _DataClient = class {
28485
28535
  _DataClient.clients.delete(this.options.name);
28486
28536
  }
28487
28537
  };
28538
+ _DataClient.clients = /* @__PURE__ */ new Map();
28488
28539
  var DataClient = _DataClient;
28489
- DataClient.clients = /* @__PURE__ */ new Map();
28490
28540
 
28491
28541
  // src/components/InfiniteTable/eventHandlers/keyboardShortcuts.ts
28492
28542
  var instantEdit = {
@@ -28533,7 +28583,7 @@ var keyboardShortcuts = {
28533
28583
  };
28534
28584
 
28535
28585
  // src/components/hooks/useInterceptedMap.ts
28536
- import { useEffect as useEffect41 } from "react";
28586
+ import { useEffect as useEffect39 } from "react";
28537
28587
  function interceptMap(map2, fns) {
28538
28588
  const { set, delete: deleteKey, clear } = map2;
28539
28589
  if (fns.set) {
@@ -28576,7 +28626,7 @@ function interceptMap(map2, fns) {
28576
28626
  }
28577
28627
 
28578
28628
  // src/utils/FixedSizeSet.ts
28579
- var _FixedSizeSet = class {
28629
+ var _FixedSizeSet = class _FixedSizeSet {
28580
28630
  constructor(clone, size) {
28581
28631
  this.orderRefs = [];
28582
28632
  if (typeof clone === "number") {
@@ -28631,11 +28681,11 @@ var _FixedSizeSet = class {
28631
28681
  return this;
28632
28682
  }
28633
28683
  };
28684
+ _FixedSizeSet.DEFAULT_SIZE = 10;
28634
28685
  var FixedSizeSet = _FixedSizeSet;
28635
- FixedSizeSet.DEFAULT_SIZE = 10;
28636
28686
 
28637
28687
  // src/utils/WeakFixedSizeSet.ts
28638
- var _WeakFixedSizeSet = class {
28688
+ var _WeakFixedSizeSet = class _WeakFixedSizeSet {
28639
28689
  constructor(clone, size) {
28640
28690
  this.orderRefs = [];
28641
28691
  if (typeof clone === "number") {
@@ -28691,11 +28741,11 @@ var _WeakFixedSizeSet = class {
28691
28741
  return this;
28692
28742
  }
28693
28743
  };
28744
+ _WeakFixedSizeSet.DEFAULT_SIZE = 10;
28694
28745
  var WeakFixedSizeSet = _WeakFixedSizeSet;
28695
- WeakFixedSizeSet.DEFAULT_SIZE = 10;
28696
28746
 
28697
28747
  // src/components/hooks/useEffectWhenSameDeps.ts
28698
- import { useEffect as useEffect42, useRef as useRef32 } from "react";
28748
+ import { useEffect as useEffect40, useRef as useRef32 } from "react";
28699
28749
  var isSameDeps = (deps, prevDeps) => {
28700
28750
  return deps.every((dep, index) => dep === prevDeps[index]);
28701
28751
  };
@@ -28709,7 +28759,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
28709
28759
  effectDepsRef.current = effectDeps;
28710
28760
  const callbackRef = useRef32(callback);
28711
28761
  callbackRef.current = callback;
28712
- useEffect42(() => {
28762
+ useEffect40(() => {
28713
28763
  if (isInitialRef.current) {
28714
28764
  isInitialRef.current = false;
28715
28765
  return;
@@ -28719,7 +28769,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
28719
28769
  };
28720
28770
 
28721
28771
  // src/components/hooks/useEffectWhen.ts
28722
- import { useEffect as useEffect43, useRef as useRef33 } from "react";
28772
+ import { useEffect as useEffect41, useRef as useRef33 } from "react";
28723
28773
  var isSameDeps2 = (deps, prevDeps, compare) => {
28724
28774
  return deps.every((dep, index) => {
28725
28775
  if (compare) {
@@ -28749,7 +28799,7 @@ var useEffectWhen = (callback, options) => {
28749
28799
  if (sameRespected && differentRespected) {
28750
28800
  isInitialRef.current = false;
28751
28801
  }
28752
- useEffect43(() => {
28802
+ useEffect41(() => {
28753
28803
  if (isInitialRef.current) {
28754
28804
  return;
28755
28805
  }
@@ -28799,9 +28849,11 @@ var createFlashingColumnCellComponent = (options = {}) => {
28799
28849
  const oldValueRef = React73.useRef(value);
28800
28850
  const oldValue = initialRef.current ? null : oldValueRef.current;
28801
28851
  initialRef.current = false;
28802
- const flashTimeoutIdRef = React73.useRef();
28803
- const flashDirectionRef = React73.useRef();
28804
- const fadeTimeoutIdRef = React73.useRef();
28852
+ const flashTimeoutIdRef = React73.useRef(void 0);
28853
+ const flashDirectionRef = React73.useRef(
28854
+ void 0
28855
+ );
28856
+ const fadeTimeoutIdRef = React73.useRef(void 0);
28805
28857
  useEffectWhen(
28806
28858
  () => {
28807
28859
  if (value === oldValueRef.current) {
@@ -28892,6 +28944,7 @@ export {
28892
28944
  debug,
28893
28945
  defaultFilterTypes2 as defaultFilterTypes,
28894
28946
  eventMatchesKeyboardShortcut,
28947
+ filterDataArray,
28895
28948
  defaultFilterTypes2 as filterTypes,
28896
28949
  flatten,
28897
28950
  buildManagedComponent as getComponentStateRoot,
@@ -28915,6 +28968,7 @@ export {
28915
28968
  useInfiniteColumnFilterEditor,
28916
28969
  useInfiniteHeaderCell,
28917
28970
  useInfinitePortalContainer,
28971
+ useLayoutEffectWithChanges,
28918
28972
  useManagedDataSource,
28919
28973
  useMasterRowInfo,
28920
28974
  useOverlay,