@infinite-table/infinite-react 6.2.10 → 6.2.12

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
@@ -73,7 +73,7 @@ function debounce(fn, { wait }) {
73
73
  }
74
74
 
75
75
  // src/components/InfiniteTable/index.tsx
76
- import * as React71 from "react";
76
+ import * as React70 from "react";
77
77
 
78
78
  // src/utils/join.ts
79
79
  var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
@@ -82,6 +82,49 @@ var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
82
82
  import * as React2 from "react";
83
83
  import { useRef as useRef2 } from "react";
84
84
 
85
+ // src/components/utils/buildSubscriptionCallback.tsx
86
+ function buildSubscriptionCallback(withRaf = false) {
87
+ let lastCallValue = null;
88
+ let fns = [];
89
+ let rafId = null;
90
+ const updater = (items, callback) => {
91
+ const results = [];
92
+ if (withRaf) {
93
+ if (rafId != null) {
94
+ cancelAnimationFrame(rafId);
95
+ rafId = null;
96
+ }
97
+ requestAnimationFrame(() => {
98
+ lastCallValue = items;
99
+ rafId = null;
100
+ for (let i = 0, len = fns.length; i < len; i++) {
101
+ results.push(fns[i](items));
102
+ }
103
+ callback?.(results);
104
+ });
105
+ } else {
106
+ lastCallValue = items;
107
+ for (let i = 0, len = fns.length; i < len; i++) {
108
+ results.push(fns[i](items));
109
+ }
110
+ callback?.(results);
111
+ }
112
+ };
113
+ updater.get = () => lastCallValue;
114
+ updater.onChange = (fn) => {
115
+ fns.push(fn);
116
+ return () => {
117
+ fns = fns.filter((f) => f !== fn);
118
+ };
119
+ };
120
+ updater.destroy = () => {
121
+ updater(null);
122
+ fns.length = 0;
123
+ };
124
+ updater.getListenersCount = () => fns.length;
125
+ return updater;
126
+ }
127
+
85
128
  // src/utils/DeepMap/once.ts
86
129
  function once(fn) {
87
130
  let called = false;
@@ -712,6 +755,7 @@ var COLORS = [
712
755
  ];
713
756
  var COLOR_SYMBOL = Symbol("color");
714
757
  var USED_COLORS_MAP = /* @__PURE__ */ new WeakMap();
758
+ var GLOBAL_LOG_INTENT = buildSubscriptionCallback();
715
759
  function initUsedColors(colors = COLORS) {
716
760
  USED_COLORS_MAP.set(
717
761
  colors,
@@ -762,7 +806,7 @@ function isChannelTargeted(channel, permissionToken) {
762
806
  }
763
807
  return void 0;
764
808
  }
765
- function isLoggingEnabled(channel, permissions) {
809
+ function isChannelEnabled(channel, permissions) {
766
810
  const cacheKey = `channel=${channel}_permissions=${permissions}`;
767
811
  if (enabledChannelsCache.has(cacheKey)) {
768
812
  return enabledChannelsCache.get(cacheKey);
@@ -823,20 +867,32 @@ function debugPackage(channelName) {
823
867
  function debugFactory(channelName2, parentChannel) {
824
868
  const channel = parentChannel ? `${parentChannel}${CHANNEL_SEPARATOR}${channelName2}` : channelName2;
825
869
  const channelParts = channel.split(CHANNEL_SEPARATOR);
826
- if (loggers.has(channelParts)) {
827
- return loggers.get(channelParts);
870
+ const foundLogger = loggers.get(channelParts);
871
+ if (foundLogger) {
872
+ return foundLogger;
828
873
  }
829
874
  const parentLogger = loggers.get(channelParts.slice(0, -1));
830
875
  const defaultLogFn = (parentLogger ? parentLogger.logFn : debug.logFn) ?? defaultLogger;
831
876
  let logFn = defaultLogFn;
832
877
  let enabled;
833
878
  let lastMessageTimestamp = 0;
834
- const isEnabled = () => enabled ?? isLoggingEnabled(channel, storageKeyValue);
879
+ const isEnabled = () => enabled ?? isChannelEnabled(channel, storageKeyValue);
835
880
  const color = getNextColor(debug.colors);
836
- const logger3 = Object.defineProperties(
881
+ const logger2 = Object.defineProperties(
837
882
  (...args) => {
838
- if (isLoggingEnabled(channel, storageKeyValue)) {
839
- const now = Date.now();
883
+ const intentListenersCount = GLOBAL_LOG_INTENT.getListenersCount();
884
+ let now;
885
+ if (intentListenersCount > 0) {
886
+ now = now ?? Date.now();
887
+ GLOBAL_LOG_INTENT({
888
+ color,
889
+ channel,
890
+ args,
891
+ timestamp: now
892
+ });
893
+ }
894
+ if (isEnabled()) {
895
+ now = now ?? Date.now();
840
896
  if (lastMessageTimestamp && logDiffs) {
841
897
  const diff = now - lastMessageTimestamp;
842
898
  logFn(`%c[${channel}]`, `color: ${color}`, `+${diff}ms:`);
@@ -894,7 +950,10 @@ function debugPackage(channelName) {
894
950
  }
895
951
  },
896
952
  enabled: {
897
- get: () => isEnabled()
953
+ get: () => isEnabled(),
954
+ set: (value) => {
955
+ enabled = value;
956
+ }
898
957
  },
899
958
  logFn: {
900
959
  configurable: false,
@@ -910,8 +969,8 @@ function debugPackage(channelName) {
910
969
  }
911
970
  }
912
971
  );
913
- loggers.set(channelParts, logger3);
914
- return logger3;
972
+ loggers.set(channelParts, logger2);
973
+ return logger2;
915
974
  }
916
975
  return debugFactory(channelName);
917
976
  }
@@ -927,22 +986,45 @@ Object.defineProperty(debugPackage, "enable", {
927
986
  var debug = debugPackage;
928
987
  debug.colors = COLORS;
929
988
  debug.logFn = defaultLogger;
989
+ var onLogIntentGlobal = (intentChannel, fn) => {
990
+ return GLOBAL_LOG_INTENT.onChange((options) => {
991
+ if (!options) {
992
+ return;
993
+ }
994
+ const { channel, args, color, timestamp } = options;
995
+ if (isChannelTargeted(channel, intentChannel)) {
996
+ fn({
997
+ channel,
998
+ color,
999
+ args,
1000
+ timestamp
1001
+ });
1002
+ }
1003
+ });
1004
+ };
1005
+ debug.onLogIntent = onLogIntentGlobal;
930
1006
  debug.destroyAll = () => {
931
1007
  initUsedColors();
932
1008
  initUsedColors(debug.colors);
933
1009
  loggers.clear();
934
1010
  enabledChannelsCache.clear();
935
1011
  };
1012
+ if (false) {
1013
+ globalThis.debugPackage = debug;
1014
+ }
936
1015
 
937
- // src/utils/debug.ts
938
- var debugTable = debug(`InfiniteTable`);
1016
+ // src/utils/debugLoggers.ts
939
1017
  var dbg = (channelName) => {
940
- const result = debugTable.extend(channelName);
1018
+ const result = debug(
1019
+ channelName ? `${channelName}:TYPE=debug` : "TYPE=debug"
1020
+ );
941
1021
  result.logFn = console.log.bind(console);
942
1022
  return result;
943
1023
  };
944
1024
  var err = (channelName) => {
945
- const result = debugTable.extend(`${channelName}:error`);
1025
+ const result = debug(
1026
+ channelName ? `${channelName}:TYPE=error` : "TYPE=error"
1027
+ );
946
1028
  result.logFn = console.error.bind(console);
947
1029
  return result;
948
1030
  };
@@ -1304,49 +1386,6 @@ function AvoidReactDiffFn(props) {
1304
1386
  }
1305
1387
  var AvoidReactDiff = React8.memo(AvoidReactDiffFn);
1306
1388
 
1307
- // src/components/utils/buildSubscriptionCallback.tsx
1308
- function buildSubscriptionCallback(withRaf = false) {
1309
- let lastCallValue = null;
1310
- let fns = [];
1311
- let rafId = null;
1312
- const updater = (items, callback) => {
1313
- const results = [];
1314
- if (withRaf) {
1315
- if (rafId != null) {
1316
- cancelAnimationFrame(rafId);
1317
- rafId = null;
1318
- }
1319
- requestAnimationFrame(() => {
1320
- lastCallValue = items;
1321
- rafId = null;
1322
- for (let i = 0, len = fns.length; i < len; i++) {
1323
- results.push(fns[i](items));
1324
- }
1325
- callback?.(results);
1326
- });
1327
- } else {
1328
- lastCallValue = items;
1329
- for (let i = 0, len = fns.length; i < len; i++) {
1330
- results.push(fns[i](items));
1331
- }
1332
- callback?.(results);
1333
- }
1334
- };
1335
- updater.get = () => lastCallValue;
1336
- updater.onChange = (fn) => {
1337
- fns.push(fn);
1338
- return () => {
1339
- fns = fns.filter((f) => f !== fn);
1340
- };
1341
- };
1342
- updater.destroy = () => {
1343
- updater(null);
1344
- fns.length = 0;
1345
- };
1346
- updater.getListenersCount = () => fns.length;
1347
- return updater;
1348
- }
1349
-
1350
1389
  // src/utils/selectParent.ts
1351
1390
  function selectParent(el, selector2) {
1352
1391
  let node = el;
@@ -1394,7 +1433,7 @@ var internalProps = {
1394
1433
  };
1395
1434
 
1396
1435
  // src/components/InfiniteTable/internalVars.css.ts
1397
- var InternalVars = { currentColumnTransformX: "var(--_16hkbkc0)", y: "var(--_16hkbkc1)", currentFlashingBackground: "var(--_16hkbkc2)", currentFlashingDuration: "var(--_16hkbkc3)", activeCellRowOffset: "var(--_16hkbkc4)", activeCellRowOffsetX: "var(--_16hkbkc5)", activeCellRowHeight: "var(--_16hkbkc6)", activeCellOffsetX: "var(--_16hkbkc7)", activeCellOffsetY: "var(--_16hkbkc8)", scrollTopForActiveRow: "var(--_16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--_16hkbkca)", activeCellColWidth: "var(--_16hkbkcb)", activeCellColOffset: "var(--_16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--_16hkbkcd)", columnWidthAtIndex: "var(--_16hkbkce)", columnOffsetAtIndex: "var(--_16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--_16hkbkcg)", columnZIndexAtIndex: "var(--_16hkbkch)", pinnedStartWidth: "var(--_16hkbkci)", pinnedEndWidth: "var(--_16hkbkcj)", pinnedEndOffset: "var(--_16hkbkck)", computedVisibleColumnsCount: "var(--_16hkbkcl)", baseZIndexForCells: "var(--_16hkbkcm)", bodyWidth: "var(--_16hkbkcn)", bodyHeight: "var(--_16hkbkco)", scrollbarWidthHorizontal: "var(--_16hkbkcp)", scrollbarWidthVertical: "var(--_16hkbkcq)", scrollLeft: "var(--_16hkbkcr)", scrollTop: "var(--_16hkbkcs)", virtualScrollLeftOffset: "var(--_16hkbkct)", virtualScrollTopOffset: "var(--_16hkbkcu)" };
1436
+ var InternalVars = { currentColumnTransformX: "var(--_16hkbkc0)", y: "var(--_16hkbkc1)", currentFlashingBackground: "var(--_16hkbkc2)", currentFlashingDuration: "var(--_16hkbkc3)", activeCellRowOffset: "var(--_16hkbkc4)", activeCellRowOffsetX: "var(--_16hkbkc5)", activeCellRowHeight: "var(--_16hkbkc6)", activeCellOffsetX: "var(--_16hkbkc7)", activeCellOffsetY: "var(--_16hkbkc8)", scrollTopForActiveRow: "var(--_16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--_16hkbkca)", activeCellColWidth: "var(--_16hkbkcb)", activeCellColOffset: "var(--_16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--_16hkbkcd)", columnWidthAtIndex: "var(--_16hkbkce)", columnOffsetAtIndex: "var(--_16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--_16hkbkcg)", columnZIndexAtIndex: "var(--_16hkbkch)", pinnedStartWidth: "var(--_16hkbkci)", pinnedEndWidth: "var(--_16hkbkcj)", pinnedEndOffset: "var(--_16hkbkck)", computedVisibleColumnsCount: "var(--_16hkbkcl)", baseZIndexForCells: "var(--_16hkbkcm)", bodyWidth: "var(--_16hkbkcn)", bodyHeight: "var(--_16hkbkco)", scrollbarWidthHorizontal: "var(--_16hkbkcp)", scrollbarWidthVertical: "var(--_16hkbkcq)", scrollLeft: "var(--_16hkbkcr)", scrollTop: "var(--_16hkbkcs)" };
1398
1437
 
1399
1438
  // src/components/InfiniteTable/vars.css.ts
1400
1439
  var CSS_LOADED_VALUE = "true";
@@ -1564,6 +1603,15 @@ function getGreatestCountVisibleInSize(availableSize, itemSizes) {
1564
1603
  return maxCount < 0 ? len : Math.min(maxCount, len);
1565
1604
  }
1566
1605
 
1606
+ // src/utils/debugChannel.ts
1607
+ var PREFIX = "DebugID=";
1608
+ function getDebugChannel(debugId, channel) {
1609
+ if (channel && channel.startsWith(PREFIX)) {
1610
+ return channel;
1611
+ }
1612
+ return channel ? `${PREFIX}${debugId}:${channel}` : `${PREFIX}${debugId}`;
1613
+ }
1614
+
1567
1615
  // src/components/VirtualBrain/MatrixBrain.ts
1568
1616
  var DEFAULT_EXTEND_BY = {
1569
1617
  start: 0,
@@ -1593,7 +1641,7 @@ function defaultShouldUpdateRenderCount(options) {
1593
1641
  }
1594
1642
  var MatrixBrain = class extends Logger {
1595
1643
  constructor(name) {
1596
- const logName = `MatrixBrain${name ? `:${name}` : ""}`;
1644
+ const logName = getDebugChannel(name, `${name}:MatrixBrain`);
1597
1645
  super(logName);
1598
1646
  this.scrolling = false;
1599
1647
  this.RENDER_COUNT_SAFETY_MARGIN_START = 1;
@@ -2383,7 +2431,7 @@ var MatrixBrain = class extends Logger {
2383
2431
  height: this.availableRenderHeight ?? this.availableHeight
2384
2432
  };
2385
2433
  };
2386
- this.name = name || "MatrixBrain";
2434
+ this.name = logName;
2387
2435
  this.update = this.update.bind(this);
2388
2436
  this.destroy = this.destroy.bind(this);
2389
2437
  this.getCellOffset = this.getCellOffset.bind(this);
@@ -4985,9 +5033,9 @@ var HorizontalLayoutTableRenderer = class extends GridRenderer {
4985
5033
 
4986
5034
  // src/components/HeadlessTable/createRenderer.ts
4987
5035
  function createRenderer(brain) {
4988
- const renderer = !brain.isHorizontalLayoutBrain ? new GridRenderer(brain, `ReactHeadlessTableRenderer:${brain.name}`) : new HorizontalLayoutTableRenderer(
5036
+ const renderer = !brain.isHorizontalLayoutBrain ? new GridRenderer(brain, `${brain.name}:ReactHeadlessTableRenderer`) : new HorizontalLayoutTableRenderer(
4989
5037
  brain,
4990
- `HorizontalLayoutTableRenderer:${brain.name}`
5038
+ `${brain.name}:HorizontalLayoutTableRenderer`
4991
5039
  );
4992
5040
  const onRenderUpdater = buildSubscriptionCallback();
4993
5041
  brain.onDestroy(() => {
@@ -5348,8 +5396,6 @@ var CELL_DETACHED_CLASSNAMES = [
5348
5396
  ];
5349
5397
 
5350
5398
  // src/components/HeadlessTable/index.tsx
5351
- var virtualScrollLeftOffset = stripVar(InternalVars.virtualScrollLeftOffset);
5352
- var virtualScrollTopOffset = stripVar(InternalVars.virtualScrollTopOffset);
5353
5399
  function useMatrixBrain(brain, brainOptions, fixedCellsInfo) {
5354
5400
  if (fixedCellsInfo && (fixedCellsInfo.fixedColsStart || fixedCellsInfo.fixedColsEnd || fixedCellsInfo.fixedRowsStart || fixedCellsInfo.fixedRowsEnd)) {
5355
5401
  brain.updateFixedCells({
@@ -5423,25 +5469,14 @@ function HeadlessTable(props) {
5423
5469
  }, [wrapRowsHorizontally, brain]);
5424
5470
  const updateDOMTransform = useCallback4((scrollPos) => {
5425
5471
  requestAnimationFrame(() => {
5426
- const scrollVarHost = scrollVarHostRef?.current;
5427
- if (!scrollVarHost) {
5428
- if (!domRef.current) {
5429
- return;
5430
- }
5431
- domRef.current.style.setProperty(
5432
- "transform",
5433
- `translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
5434
- );
5472
+ if (!domRef.current) {
5435
5473
  return;
5436
5474
  }
5437
- scrollVarHost.style.setProperty(
5438
- virtualScrollLeftOffset,
5439
- `-${scrollPos.scrollLeft}px`
5440
- );
5441
- scrollVarHost.style.setProperty(
5442
- virtualScrollTopOffset,
5443
- `-${scrollPos.scrollTop}px`
5475
+ domRef.current.style.setProperty(
5476
+ "transform",
5477
+ `translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
5444
5478
  );
5479
+ return;
5445
5480
  });
5446
5481
  }, []);
5447
5482
  const onContainerScroll = useCallback4(
@@ -5867,8 +5902,10 @@ function buildManagedComponent(config) {
5867
5902
  }
5868
5903
  });
5869
5904
  if (updatedPropsToStateCount > 0 || newMappedStateCount > 0) {
5870
- const logger3 = config.debugName ? dbg(`${config.debugName}:rerender`) : dbg("rerender");
5871
- logger3(
5905
+ const logger2 = config.debugName ? dbg(
5906
+ typeof config.debugName === "function" ? `${config.debugName(currentProps)}:rerender` : `${config.debugName}:rerender`
5907
+ ) : dbg("rerender");
5908
+ logger2(
5872
5909
  "Triggered by new values for the following props",
5873
5910
  ...[
5874
5911
  ...Object.keys(newMappedState ?? {}),
@@ -9667,6 +9704,8 @@ function InfiniteTableColumnCellFn(props) {
9667
9704
  column,
9668
9705
  onMouseLeave,
9669
9706
  onMouseEnter,
9707
+ onRowMouseEnter,
9708
+ onRowMouseLeave,
9670
9709
  // toggleGroupRow,
9671
9710
  rowIndex,
9672
9711
  rowHeight,
@@ -9738,6 +9777,24 @@ function InfiniteTableColumnCellFn(props) {
9738
9777
  const { align: align2, verticalAlign } = renderParams;
9739
9778
  const renderParam = renderParams;
9740
9779
  const renderParamRef = React37.useRef(renderParam);
9780
+ const handleMouseEnter = onRowMouseEnter && onMouseEnter ? (event) => {
9781
+ const rowInfoDiscriminator = formattedValueContext;
9782
+ const rowContext = {
9783
+ ...rowInfoDiscriminator,
9784
+ rowIndex
9785
+ };
9786
+ onRowMouseEnter(rowContext, event);
9787
+ onMouseEnter(event);
9788
+ } : onMouseEnter;
9789
+ const handleMouseLeave = onRowMouseLeave && onMouseLeave ? (event) => {
9790
+ const rowContext = {
9791
+ ...formattedValueContext,
9792
+ rowIndex,
9793
+ rowInfo
9794
+ };
9795
+ onRowMouseLeave(rowContext, event);
9796
+ onMouseLeave(event);
9797
+ } : onMouseLeave;
9741
9798
  const onClick = useCallback12(
9742
9799
  (event) => {
9743
9800
  const colIndex = column.computedVisibleIndex;
@@ -10091,8 +10148,8 @@ function InfiniteTableColumnCellFn(props) {
10091
10148
  rowId: rowInfo.id,
10092
10149
  horizontalLayoutPageIndex,
10093
10150
  style: memoizedStyle,
10094
- onMouseLeave,
10095
- onMouseEnter,
10151
+ onMouseLeave: handleMouseLeave,
10152
+ onMouseEnter: handleMouseEnter,
10096
10153
  onClick,
10097
10154
  afterChildren,
10098
10155
  onMouseDown,
@@ -11228,7 +11285,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
11228
11285
 
11229
11286
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
11230
11287
  import * as React47 from "react";
11231
- import { useCallback as useCallback16, useRef as useRef18 } from "react";
11288
+ import { useCallback as useCallback16, useEffect as useEffect16, useRef as useRef18 } from "react";
11232
11289
 
11233
11290
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
11234
11291
  import * as React46 from "react";
@@ -11492,6 +11549,18 @@ function InfiniteTableHeaderFn(props) {
11492
11549
  } = useInfiniteTable();
11493
11550
  const { computedColumnsMap } = computed;
11494
11551
  const domRef = useRef18(null);
11552
+ const updateDOMTransform = useCallback16((scrollPosition) => {
11553
+ if (domRef.current) {
11554
+ domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
11555
+ }
11556
+ }, []);
11557
+ useEffect16(() => {
11558
+ const removeOnScroll = headerBrain.onScroll(updateDOMTransform);
11559
+ updateDOMTransform(
11560
+ headerBrain.getScrollPosition() || { scrollLeft: 0, scrollTop: 0 }
11561
+ );
11562
+ return removeOnScroll;
11563
+ }, [headerBrain]);
11495
11564
  const domProps = {
11496
11565
  ref: domRef,
11497
11566
  className: join(
@@ -11722,7 +11791,7 @@ function TableHeaderWrapper(props) {
11722
11791
 
11723
11792
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
11724
11793
  import * as React49 from "react";
11725
- import { useEffect as useEffect16 } from "react";
11794
+ import { useEffect as useEffect17 } from "react";
11726
11795
 
11727
11796
  // src/components/utils/decamelize.ts
11728
11797
  function decamelize(str, options) {
@@ -11779,7 +11848,7 @@ var InfiniteTableLicenseFooter = React49.forwardRef(
11779
11848
  ref.current = node;
11780
11849
  }
11781
11850
  }, []);
11782
- useEffect16(() => {
11851
+ useEffect17(() => {
11783
11852
  const forceStyle = () => {
11784
11853
  setTimeout(() => {
11785
11854
  enforceStyle(domRef.current, defaultStyle);
@@ -13784,7 +13853,6 @@ var RowSelectionState = class {
13784
13853
  };
13785
13854
 
13786
13855
  // src/components/DataSource/CellSelectionState.ts
13787
- var debug3 = dbg("CellSelectionState");
13788
13856
  var WILDCARD = "*";
13789
13857
  var CellSelectionState = class {
13790
13858
  constructor(clone) {
@@ -13795,6 +13863,7 @@ var CellSelectionState = class {
13795
13863
  this.deselectedRowsToColumns = /* @__PURE__ */ new Map();
13796
13864
  this.deselectedColumnsToRows = /* @__PURE__ */ new Map();
13797
13865
  this.defaultSelection = false;
13866
+ this.debugId = "";
13798
13867
  this.deselectAll = () => {
13799
13868
  this.update({
13800
13869
  defaultSelection: false,
@@ -14040,12 +14109,17 @@ var CellSelectionState = class {
14040
14109
  }
14041
14110
  return false;
14042
14111
  }
14112
+ // private debug(message: string) {
14113
+ // const debug = dbg(`${this.debugId}:CellSelectionState`);
14114
+ // debug(message);
14115
+ // }
14116
+ error(message) {
14117
+ const error4 = err(`${this.debugId}:CellSelectionState`);
14118
+ error4(message);
14119
+ }
14043
14120
  isCellSelected(rowId, colId) {
14044
14121
  if (rowId === this.wildcard || colId === this.wildcard) {
14045
- console.error(
14046
- `CellSelectionState.isCellSelected should not be called with wildcard`
14047
- );
14048
- debug3(
14122
+ this.error(
14049
14123
  `CellSelectionState.isCellSelected should not be called with wildcard`
14050
14124
  );
14051
14125
  return false;
@@ -14128,6 +14202,7 @@ var CellSelectionState = class {
14128
14202
 
14129
14203
  // src/utils/logger.ts
14130
14204
  var log = debug("InfiniteTable");
14205
+ var COLOR_ERROR_VALUE = `#dc3545`;
14131
14206
  var COLOR_WARN_VALUE = `#eb9316`;
14132
14207
  var warnChannel = "Warn";
14133
14208
  var errorChannel = "Error";
@@ -14140,9 +14215,18 @@ var warnLogger = logger.extend(warnChannel);
14140
14215
  var errorLogger = logger.extend(errorChannel);
14141
14216
  var successLogger = logger.extend(successChannel);
14142
14217
  var logColorWarn = COLOR_WARN_VALUE;
14143
- var warn = (message, logger3) => {
14144
- logger3 = logger3 ? logger3.extend(warnChannel) : warnLogger;
14145
- logger3(log.color(logColorWarn, message));
14218
+ var logColorError = COLOR_ERROR_VALUE;
14219
+ var warn = (message, logger2) => {
14220
+ logger2 = logger2 ? logger2.extend ? logger2.extend(warnChannel) : logger2 : warnLogger;
14221
+ logger2(
14222
+ typeof logger2.color === "function" ? logger2.color(logColorWarn, message) : message
14223
+ );
14224
+ };
14225
+ var error2 = (message, logger2) => {
14226
+ logger2 = logger2 ? logger2.extend ? logger2.extend(errorChannel) : logger2 : errorLogger;
14227
+ logger2(
14228
+ typeof logger2.color === "function" ? logger2.color(logColorError, message) : message
14229
+ );
14146
14230
  };
14147
14231
  var doOnceFlags = new DeepMap();
14148
14232
  var doOnce = (func, ...keys) => {
@@ -14152,8 +14236,11 @@ var doOnce = (func, ...keys) => {
14152
14236
  doOnceFlags.set(keys, true);
14153
14237
  func();
14154
14238
  };
14155
- var warnOnce = (message, key = message, logger3) => {
14156
- doOnce(() => warn(message, logger3), key, "warn");
14239
+ var warnOnce = (message, key = message, logger2) => {
14240
+ doOnce(() => warn(message, logger2), key, "warn");
14241
+ };
14242
+ var errorOnce = (message, key = message, logger2) => {
14243
+ doOnce(() => error2(message, logger2), key, "error");
14157
14244
  };
14158
14245
 
14159
14246
  // src/components/InfiniteTable/api/getRowSelectionApi.ts
@@ -14610,10 +14697,10 @@ var Indexer = class {
14610
14697
  };
14611
14698
 
14612
14699
  // src/components/DataSource/privateHooks/useLoadData.ts
14613
- import { useEffect as useEffect18, useMemo as useMemo7, useRef as useRef21, useState as useState13 } from "react";
14700
+ import { useEffect as useEffect19, useMemo as useMemo7, useRef as useRef21, useState as useState13 } from "react";
14614
14701
 
14615
14702
  // src/components/hooks/useEffectWithChanges.ts
14616
- import { useEffect as useEffect17, useRef as useRef20 } from "react";
14703
+ import { useEffect as useEffect18, useRef as useRef20 } from "react";
14617
14704
  function useEffectWithChanges(fn, deps) {
14618
14705
  const prevRef = useRef20({});
14619
14706
  const oldValuesRef = useRef20({});
@@ -14631,7 +14718,7 @@ function useEffectWithChanges(fn, deps) {
14631
14718
  }
14632
14719
  }
14633
14720
  prevRef.current = deps;
14634
- useEffect17(() => {
14721
+ useEffect18(() => {
14635
14722
  const changes2 = changesRef.current;
14636
14723
  let result = void 0;
14637
14724
  if (Object.keys(changes2).length !== 0) {
@@ -14649,7 +14736,7 @@ function useEffectWithObject(fn, deps) {
14649
14736
  useEffectDeps.push(deps[k]);
14650
14737
  }
14651
14738
  }
14652
- useEffect17(fn, useEffectDeps);
14739
+ useEffect18(fn, useEffectDeps);
14653
14740
  }
14654
14741
 
14655
14742
  // src/utils/composeFunctions.ts
@@ -16057,12 +16144,12 @@ var DataSourceApiImpl = class {
16057
16144
  }
16058
16145
  return this.waitForNodePath(nodePath, { timeout }).then((okay) => {
16059
16146
  if (!okay) {
16060
- const error2 = `Cannot find node path "${nodePath.join(
16147
+ const error4 = `Cannot find node path "${nodePath.join(
16061
16148
  "/"
16062
16149
  )}" (we waited for it ${timeout}ms)`;
16063
- console.error(error2);
16150
+ console.error(error4);
16064
16151
  return fn({
16065
- error: error2,
16152
+ error: error4,
16066
16153
  resolved: false
16067
16154
  });
16068
16155
  }
@@ -16079,8 +16166,8 @@ var DataSourceApiImpl = class {
16079
16166
  this.updateChildrenByNodePath = (childrenOrFn, nodePath, options) => {
16080
16167
  return this.withWaitForNode(
16081
16168
  nodePath,
16082
- ({ error: error2 }) => {
16083
- if (error2) {
16169
+ ({ error: error4 }) => {
16170
+ if (error4) {
16084
16171
  return false;
16085
16172
  }
16086
16173
  return this.updateChildrenByNodePath_Internal(
@@ -16108,8 +16195,8 @@ var DataSourceApiImpl = class {
16108
16195
  if (!this.isNodePathAvailable(nodePath)) {
16109
16196
  return this.withWaitForNode(
16110
16197
  nodePath,
16111
- ({ error: error2 }) => {
16112
- if (error2) {
16198
+ ({ error: error4 }) => {
16199
+ if (error4) {
16113
16200
  return false;
16114
16201
  }
16115
16202
  return this.updateDataArrayByNodePath_Internal(
@@ -16142,7 +16229,7 @@ var DataSourceApiImpl = class {
16142
16229
  const allNodePaths = updateInfo.map((info) => info.nodePath);
16143
16230
  const promiseWithAll = Promise.allSettled(
16144
16231
  allNodePaths.map((nodePath) => {
16145
- return this.withWaitForNode(nodePath, ({ error: error2 }) => !error2, options);
16232
+ return this.withWaitForNode(nodePath, ({ error: error4 }) => !error4, options);
16146
16233
  })
16147
16234
  );
16148
16235
  return promiseWithAll.then((allGood) => {
@@ -16261,8 +16348,8 @@ var DataSourceApiImpl = class {
16261
16348
  if (isTree && nodePath?.length) {
16262
16349
  return this.withWaitForNode(
16263
16350
  nodePath,
16264
- ({ error: error2 }) => {
16265
- if (error2) {
16351
+ ({ error: error4 }) => {
16352
+ if (error4) {
16266
16353
  return false;
16267
16354
  }
16268
16355
  if (options.position === "before" || options.position === "after") {
@@ -16325,8 +16412,8 @@ var DataSourceApiImpl = class {
16325
16412
  if (nodePath.length && !this.isNodePathAvailable(nodePath)) {
16326
16413
  return this.withWaitForNode(
16327
16414
  nodePath,
16328
- ({ error: error2 }) => {
16329
- if (error2) {
16415
+ ({ error: error4 }) => {
16416
+ if (error4) {
16330
16417
  return false;
16331
16418
  }
16332
16419
  const result2 = this.batchOperation({
@@ -16365,6 +16452,9 @@ var DataSourceApiImpl = class {
16365
16452
  this.actions.sortInfo = sortInfo;
16366
16453
  return;
16367
16454
  };
16455
+ this.setGroupBy = (groupBy) => {
16456
+ this.actions.groupBy = groupBy;
16457
+ };
16368
16458
  this.isRowDisabledAt = (rowIndex) => {
16369
16459
  const rowInfo = this.getRowInfoByIndex(rowIndex);
16370
16460
  return rowInfo?.rowDisabled ?? false;
@@ -17111,20 +17201,31 @@ function concludeReducer(params) {
17111
17201
  }
17112
17202
  if (shouldFilterClientSide) {
17113
17203
  state.unfilteredCount = dataArray.length;
17114
- dataArray = shouldFilterAgain ? filterDataSource({
17115
- // tree-related stuff
17116
- getNodeChildren,
17117
- isLeafNode,
17118
- nodesKey,
17119
- treeFilterFunction,
17120
- // ---
17121
- dataArray,
17122
- toPrimaryKey,
17123
- filterTypes,
17124
- operatorsByFilterType,
17125
- filterFunction,
17126
- filterValue
17127
- }) : state.lastFilterDataArray;
17204
+ let filterTimestamp = now;
17205
+ if (shouldFilterAgain) {
17206
+ if (state.devToolsDetected) {
17207
+ filterTimestamp = Date.now();
17208
+ }
17209
+ dataArray = filterDataSource({
17210
+ // tree-related stuff
17211
+ getNodeChildren,
17212
+ isLeafNode,
17213
+ nodesKey,
17214
+ treeFilterFunction,
17215
+ // ---
17216
+ dataArray,
17217
+ toPrimaryKey,
17218
+ filterTypes,
17219
+ operatorsByFilterType,
17220
+ filterFunction,
17221
+ filterValue
17222
+ });
17223
+ if (state.devToolsDetected) {
17224
+ state.debugTimings.set("filter", Date.now() - filterTimestamp);
17225
+ }
17226
+ } else {
17227
+ dataArray = state.lastFilterDataArray;
17228
+ }
17128
17229
  state.lastFilterDataArray = dataArray;
17129
17230
  state.filteredAt = now;
17130
17231
  }
@@ -17134,6 +17235,10 @@ function concludeReducer(params) {
17134
17235
  const prevKnownTypes = multisort.knownTypes;
17135
17236
  multisort.knownTypes = { ...prevKnownTypes, ...state.sortTypes };
17136
17237
  if (shouldSortAgain) {
17238
+ let sortTimestamp = now;
17239
+ if (state.devToolsDetected) {
17240
+ sortTimestamp = Date.now();
17241
+ }
17137
17242
  if (state.sortFunction) {
17138
17243
  dataArray = state.sortFunction(sortInfo, [...dataArray]);
17139
17244
  } else {
@@ -17149,6 +17254,10 @@ function concludeReducer(params) {
17149
17254
  dataArray = multisort(sortInfo, [...dataArray]);
17150
17255
  }
17151
17256
  }
17257
+ if (state.devToolsDetected) {
17258
+ const sortDuration = Date.now() - sortTimestamp;
17259
+ state.debugTimings.set("sort", sortDuration);
17260
+ }
17152
17261
  } else {
17153
17262
  dataArray = state.lastSortDataArray;
17154
17263
  }
@@ -17195,6 +17304,10 @@ function concludeReducer(params) {
17195
17304
  const rowInfoReducers = state.rowInfoReducers;
17196
17305
  if (shouldGroup) {
17197
17306
  if (shouldGroupAgain) {
17307
+ let groupTimestamp = now;
17308
+ if (state.devToolsDetected) {
17309
+ groupTimestamp = Date.now();
17310
+ }
17198
17311
  let aggregationReducers = state.aggregationReducers;
17199
17312
  const groupResult = state.lazyLoad ? lazyGroup(
17200
17313
  {
@@ -17277,6 +17390,9 @@ function concludeReducer(params) {
17277
17390
  }) : void 0;
17278
17391
  state.pivotColumns = pivotGroupsAndCols?.columns;
17279
17392
  state.pivotColumnGroups = pivotGroupsAndCols?.columnGroups;
17393
+ if (state.devToolsDetected) {
17394
+ state.debugTimings.set("group-and-pivot", Date.now() - groupTimestamp);
17395
+ }
17280
17396
  } else {
17281
17397
  rowInfoDataArray = state.lastGroupDataArray;
17282
17398
  }
@@ -17284,6 +17400,10 @@ function concludeReducer(params) {
17284
17400
  state.groupedAt = now;
17285
17401
  } else if (shouldTree) {
17286
17402
  if (shouldTreeAgain) {
17403
+ let treeTimestamp = now;
17404
+ if (state.devToolsDetected) {
17405
+ treeTimestamp = Date.now();
17406
+ }
17287
17407
  let aggregationReducers = state.aggregationReducers;
17288
17408
  const treeParams = {
17289
17409
  isLeafNode,
@@ -17353,6 +17473,9 @@ function concludeReducer(params) {
17353
17473
  state.reducerResults = treeResult.reducerResults;
17354
17474
  state.totalLeafNodesCount = treeResult.deepMap.get([])?.totalLeafNodesCount ?? 0;
17355
17475
  state.treeAt = now;
17476
+ if (state.devToolsDetected) {
17477
+ state.debugTimings.set("tree", Date.now() - treeTimestamp);
17478
+ }
17356
17479
  } else {
17357
17480
  rowInfoDataArray = state.lastTreeDataArray;
17358
17481
  }
@@ -17450,6 +17573,155 @@ function getChangeDetect() {
17450
17573
  return `${Date.now()}:${perfNow}`;
17451
17574
  }
17452
17575
 
17576
+ // src/components/InfiniteTable/errorCodes.ts
17577
+ function buildErrorPayload(code, message, type) {
17578
+ message = message.replaceAll("$ERR_CODE", code);
17579
+ message = `${message}
17580
+
17581
+ ERROR_CODE = ${code}
17582
+
17583
+ See http://infinite-table.com/docs/reference/error-codes#${code} for more info.`;
17584
+ return {
17585
+ code,
17586
+ message,
17587
+ type: type ?? "error"
17588
+ };
17589
+ }
17590
+ function buildErrors(errors) {
17591
+ return Object.entries(errors).reduce((acc, [key, message]) => {
17592
+ const code = key;
17593
+ const payload = buildErrorPayload(
17594
+ code,
17595
+ typeof message === "string" ? message : message.message,
17596
+ typeof message === "string" ? void 0 : message.type
17597
+ );
17598
+ acc[code] = payload;
17599
+ return acc;
17600
+ }, {});
17601
+ }
17602
+ function warn2(strings) {
17603
+ return {
17604
+ message: strings.join(""),
17605
+ type: "warning"
17606
+ };
17607
+ }
17608
+ function error3(strings) {
17609
+ return {
17610
+ message: strings.join(""),
17611
+ type: "error"
17612
+ };
17613
+ }
17614
+ var DS_ERROR_CODES = buildErrors({
17615
+ DS001: warn2`The "data" prop of your DataSource seems to be updating too frequently.
17616
+ Make sure you don't pass a new reference on every render.`
17617
+ });
17618
+ var INFINITE_ERROR_CODES = buildErrors({
17619
+ CSS001_CSS: error3`It appears you have not loaded the CSS file for InfiniteTable.
17620
+ In most environments, you should be able to fix this by adding the following line:
17621
+
17622
+ import '@infinite-table/infinite-react/index.css'
17623
+ `
17624
+ });
17625
+ var ERROR_CODES = {
17626
+ ...DS_ERROR_CODES,
17627
+ ...INFINITE_ERROR_CODES
17628
+ };
17629
+
17630
+ // src/DEV_TOOLS_OVERRIDES.ts
17631
+ var DEV_TOOLS_INFINITE_OVERRIDES = /* @__PURE__ */ new Map();
17632
+ var DEV_TOOLS_DATASOURCE_OVERRIDES = /* @__PURE__ */ new Map();
17633
+ var DEV_TOOLS_INFINITE_INITIALS = /* @__PURE__ */ new Map();
17634
+ var DEV_TOOLS_DATASOURCE_INITIALS = /* @__PURE__ */ new Map();
17635
+
17636
+ // src/utils/debugModeUtils.ts
17637
+ var INSTANCES = /* @__PURE__ */ new Map();
17638
+ var deleteInstanceFromDevTools = (debugId) => {
17639
+ INSTANCES.delete(debugId);
17640
+ DEV_TOOLS_INFINITE_INITIALS.delete(debugId);
17641
+ DEV_TOOLS_INFINITE_OVERRIDES.delete(debugId);
17642
+ DEV_TOOLS_DATASOURCE_INITIALS.delete(debugId);
17643
+ DEV_TOOLS_DATASOURCE_OVERRIDES.delete(debugId);
17644
+ };
17645
+ function setDevToolInfinitePropertyOverride(debugId, property, value) {
17646
+ const instance = INSTANCES.get(debugId);
17647
+ if (!instance) {
17648
+ return;
17649
+ }
17650
+ const initial = DEV_TOOLS_INFINITE_INITIALS.get(debugId);
17651
+ if (!initial || !Object.hasOwn(initial, property)) {
17652
+ DEV_TOOLS_INFINITE_INITIALS.set(debugId, {
17653
+ ...initial || {},
17654
+ [property]: instance.getState()[property]
17655
+ });
17656
+ }
17657
+ DEV_TOOLS_INFINITE_OVERRIDES.set(debugId, {
17658
+ ...DEV_TOOLS_INFINITE_OVERRIDES.get(debugId) || {},
17659
+ [property]: value
17660
+ });
17661
+ instance.actions[property] = value;
17662
+ }
17663
+ function setDevToolDataSourcePropertyOverride(debugId, property, value) {
17664
+ const instance = INSTANCES.get(debugId);
17665
+ if (!instance) {
17666
+ return;
17667
+ }
17668
+ const initial = DEV_TOOLS_DATASOURCE_INITIALS.get(debugId);
17669
+ if (!initial || !Object.hasOwn(initial, property)) {
17670
+ DEV_TOOLS_DATASOURCE_INITIALS.set(debugId, {
17671
+ ...initial || {},
17672
+ [property]: instance.getDataSourceState()[property]
17673
+ });
17674
+ }
17675
+ DEV_TOOLS_DATASOURCE_OVERRIDES.set(debugId, {
17676
+ ...DEV_TOOLS_DATASOURCE_OVERRIDES.get(debugId) || {},
17677
+ [property]: value
17678
+ });
17679
+ instance.dataSourceActions[property] = value;
17680
+ }
17681
+ var warnKnownErrorOnce = (error4) => {
17682
+ const logger2 = error4.type === "error" ? err(error4.debugId) : dbg(error4.debugId);
17683
+ const onceLogger = error4.type === "error" ? errorOnce : warnOnce;
17684
+ const onceKey = error4.debugId ? `${error4.code}-${error4.debugId}` : error4.code;
17685
+ let message = error4.message;
17686
+ if (error4.debugId) {
17687
+ message = `${message}
17688
+
17689
+ Component DEBUG_ID = "${error4.debugId}"`;
17690
+ }
17691
+ onceLogger(message, onceKey, logger2);
17692
+ };
17693
+ var logDevToolsWarning = (options) => {
17694
+ const { debugId, key } = options;
17695
+ const knownError = ERROR_CODES[key];
17696
+ if (!knownError) {
17697
+ return;
17698
+ }
17699
+ warnKnownErrorOnce({ ...knownError, debugId });
17700
+ if (debugId && key) {
17701
+ const instance = INSTANCES.get(debugId);
17702
+ if (instance && instance.getState().devToolsDetected && knownError) {
17703
+ instance.getState().debugWarnings.set(key, {
17704
+ ...knownError,
17705
+ debugId,
17706
+ status: "new"
17707
+ });
17708
+ updateDevToolsForInstance(debugId);
17709
+ }
17710
+ }
17711
+ };
17712
+ globalThis.logDevToolsWarning = logDevToolsWarning;
17713
+ var updateDevToolsForInstance = (debugId) => {
17714
+ const hookFn = window.__INFINITE_TABLE_DEVTOOLS_HOOK__;
17715
+ if (!hookFn) {
17716
+ return;
17717
+ }
17718
+ const instance = INSTANCES.get(debugId);
17719
+ if (!instance) {
17720
+ return;
17721
+ }
17722
+ hookFn(debugId, instance);
17723
+ };
17724
+
17453
17725
  // src/components/DataSource/privateHooks/useLoadData.ts
17454
17726
  var CACHE_DEFAULT = true;
17455
17727
  var getRafPromise = () => new Promise((resolve) => {
@@ -17607,7 +17879,7 @@ function loadData(data, componentState, actions, overrides, masterContext) {
17607
17879
  const theKey = [LAZY_ROOT_KEY_FOR_GROUPS, ...keys];
17608
17880
  const dataArray2 = remoteData2.data;
17609
17881
  const newGroupRowInfo = {
17610
- cache: !!remoteData2.cache,
17882
+ cache: remoteData2.cache ?? CACHE_DEFAULT,
17611
17883
  childrenLoading: false,
17612
17884
  childrenAvailable: true,
17613
17885
  totalCount: remoteData2.totalCount ?? dataArray2.length,
@@ -17748,7 +18020,7 @@ function useLoadData(options) {
17748
18020
  horizontal: false
17749
18021
  });
17750
18022
  const scrollbarsRef = useRef21(scrollbars);
17751
- useEffect18(() => {
18023
+ useEffect19(() => {
17752
18024
  notifyScrollbarsChange.onChange((scrollbars2) => {
17753
18025
  if (!scrollbars2) {
17754
18026
  return;
@@ -17758,7 +18030,7 @@ function useLoadData(options) {
17758
18030
  });
17759
18031
  return () => notifyScrollbarsChange.destroy();
17760
18032
  }, [notifyScrollbarsChange]);
17761
- useEffect18(() => {
18033
+ useEffect19(() => {
17762
18034
  if (!livePagination) {
17763
18035
  return;
17764
18036
  }
@@ -17771,7 +18043,7 @@ function useLoadData(options) {
17771
18043
  });
17772
18044
  return () => cancelAnimationFrame(frameId);
17773
18045
  }, [livePaginationCursor]);
17774
- useEffect18(() => {
18046
+ useEffect19(() => {
17775
18047
  if (!livePagination || livePaginationCursor !== void 0) {
17776
18048
  return;
17777
18049
  }
@@ -17784,7 +18056,7 @@ function useLoadData(options) {
17784
18056
  });
17785
18057
  return () => cancelAnimationFrame(frameId);
17786
18058
  }, [dataArray.length, livePaginationCursor]);
17787
- useEffect18(() => {
18059
+ useEffect19(() => {
17788
18060
  const state = getComponentState();
17789
18061
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
17790
18062
  if (!scrollbars.vertical && livePagination2) {
@@ -17840,11 +18112,10 @@ function useLoadData(options) {
17840
18112
  timestamps.push(now);
17841
18113
  const timeDiff = now - timestamps[0];
17842
18114
  if (timeDiff < 200 && timestamps.length >= 10) {
17843
- console.warn(
17844
- `The "data" prop of your DataSource seems to be updating too frequently.
17845
- Make sure you don't pass a new reference on every render. ERROR_CODE = DS001
17846
- See http://infinite-table.com/docs/reference/error-codes#DS001 for more info.`
17847
- );
18115
+ logDevToolsWarning({
18116
+ debugId: componentState2.debugId,
18117
+ key: "DS001"
18118
+ });
17848
18119
  }
17849
18120
  if (typeof componentState2.data !== "function") {
17850
18121
  loadData(
@@ -17915,7 +18186,7 @@ function useLazyLoadRange(options, dependencies) {
17915
18186
  componentActions: actions,
17916
18187
  componentState
17917
18188
  } = options;
17918
- useEffect18(() => {
18189
+ useEffect19(() => {
17919
18190
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
17920
18191
  }, [componentState.data, componentState.dataParams]);
17921
18192
  const {
@@ -17996,7 +18267,7 @@ function useLazyLoadRange(options, dependencies) {
17996
18267
  groupRowsState
17997
18268
  }
17998
18269
  );
17999
- useEffect18(() => {
18270
+ useEffect19(() => {
18000
18271
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
18001
18272
  debouncedLoadRange();
18002
18273
  }
@@ -18113,7 +18384,6 @@ var normalizeSortInfo = (initialSortInfo, weakMap3) => {
18113
18384
  };
18114
18385
 
18115
18386
  // src/components/DataSource/state/getInitialState.ts
18116
- var DataSourceLogger = dbg("DataSource");
18117
18387
  var defaultCursorId = Symbol("cursorId");
18118
18388
  var isNodeReadOnly = (rowInfo) => {
18119
18389
  return rowInfo.totalLeafNodesCount === 0;
@@ -18121,12 +18391,17 @@ var isNodeReadOnly = (rowInfo) => {
18121
18391
  var isNodeSelectable = (rowInfo) => {
18122
18392
  return rowInfo.isParentNode ? !isNodeReadOnly(rowInfo) : true;
18123
18393
  };
18124
- function initSetupState() {
18394
+ function initSetupState(props) {
18125
18395
  const now = Date.now();
18126
18396
  const originalDataArray = [];
18127
18397
  const dataArray = [];
18128
18398
  const originalLazyGroupData = new DeepMap();
18399
+ const DataSourceLogger = dbg(`${props.debugId}:DataSource`);
18129
18400
  return {
18401
+ logger: DataSourceLogger,
18402
+ debugTimings: /* @__PURE__ */ new Map(),
18403
+ debugWarnings: /* @__PURE__ */ new Map(),
18404
+ devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
18130
18405
  // TODO cleanup indexer on unmount
18131
18406
  indexer: new Indexer(),
18132
18407
  totalLeafNodesCount: 0,
@@ -18197,7 +18472,8 @@ function initSetupState() {
18197
18472
  postSortDataArray: void 0,
18198
18473
  postGroupDataArray: void 0,
18199
18474
  lastSortDataArray: void 0,
18200
- lastGroupDataArray: void 0
18475
+ lastGroupDataArray: void 0,
18476
+ forceRerenderTimestamp: 0
18201
18477
  };
18202
18478
  }
18203
18479
  function getCompareObjectForDataParams(dataParams) {
@@ -18233,13 +18509,11 @@ var forwardProps3 = (setupState, props) => {
18233
18509
  isNodeReadOnly: (isReadOnly) => isReadOnly ?? isNodeReadOnly,
18234
18510
  isNodeSelectable: (isSelectable) => isSelectable ?? isNodeSelectable,
18235
18511
  data: 1,
18236
- debugId: 1,
18237
18512
  nodesKey: 1,
18238
18513
  isNodeExpanded: 1,
18239
18514
  isNodeCollapsed: 1,
18240
18515
  pivotBy: 1,
18241
18516
  primaryKey: 1,
18242
- debugMode: 1,
18243
18517
  livePagination: 1,
18244
18518
  treeSelection: 1,
18245
18519
  refetchKey: (refetchKey) => refetchKey ?? "",
@@ -18262,7 +18536,7 @@ var forwardProps3 = (setupState, props) => {
18262
18536
  state.idToIndexMap.clear();
18263
18537
  },
18264
18538
  reducer: (_, rowInfo) => {
18265
- if (props.debugMode && !props.nodesKey && state.idToIndexMap.has(rowInfo.id)) {
18539
+ if (props.debugId && !props.nodesKey && state.idToIndexMap.has(rowInfo.id)) {
18266
18540
  console.warn(`Duplicate id found in data source: ${rowInfo.id}`);
18267
18541
  }
18268
18542
  state.idToIndexMap.set(rowInfo.id, rowInfo.indexInAll);
@@ -18283,7 +18557,7 @@ var forwardProps3 = (setupState, props) => {
18283
18557
  reducer: (_, rowInfo) => {
18284
18558
  if (rowInfo.isTreeNode) {
18285
18559
  state.idToPathMap.set(rowInfo.id, rowInfo.nodePath);
18286
- if (props.debugMode && state.pathToIndexMap.has(rowInfo.nodePath)) {
18560
+ if (props.debugId && state.pathToIndexMap.has(rowInfo.nodePath)) {
18287
18561
  console.warn(
18288
18562
  `Duplicate node path found in data source (debugId: ${props.debugId || "none"}): ${rowInfo.nodePath}`
18289
18563
  );
@@ -18513,21 +18787,21 @@ function deriveStateFromProps(params) {
18513
18787
  warnOnce(
18514
18788
  `"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead`,
18515
18789
  "groupMode deprecated",
18516
- DataSourceLogger
18790
+ state.logger
18517
18791
  );
18518
18792
  }
18519
18793
  if (props.sortMode) {
18520
18794
  warnOnce(
18521
18795
  `"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead`,
18522
18796
  "sortMode deprecated",
18523
- DataSourceLogger
18797
+ state.logger
18524
18798
  );
18525
18799
  }
18526
18800
  if (props.filterMode) {
18527
18801
  warnOnce(
18528
18802
  `"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead`,
18529
18803
  "filterMode deprecated",
18530
- DataSourceLogger
18804
+ state.logger
18531
18805
  );
18532
18806
  }
18533
18807
  const groupMode = typeof props.data === "function" ? propsGroupMode ?? "local" : "local";
@@ -18547,7 +18821,8 @@ function deriveStateFromProps(params) {
18547
18821
  weakMap.set(rowDisabledState, isRowDisabled);
18548
18822
  }
18549
18823
  }
18550
- const result = {
18824
+ let result = {
18825
+ debugId: state.debugId ?? props.debugId,
18551
18826
  isTree,
18552
18827
  selectionMode,
18553
18828
  groupRowsState,
@@ -18587,6 +18862,17 @@ function deriveStateFromProps(params) {
18587
18862
  const livePaginationCursor = typeof props.livePaginationCursor === "function" ? dataArrayChanged ? getLivePaginationCursorValue(props.livePaginationCursor, state) : state.livePaginationCursor : props.livePaginationCursor;
18588
18863
  result.livePaginationCursor = livePaginationCursor;
18589
18864
  }
18865
+ if (state.devToolsDetected && state.debugId) {
18866
+ const devToolsDataSourceOverrides = DEV_TOOLS_DATASOURCE_OVERRIDES.get(
18867
+ state.debugId
18868
+ );
18869
+ if (devToolsDataSourceOverrides) {
18870
+ result = {
18871
+ ...result,
18872
+ ...devToolsDataSourceOverrides
18873
+ };
18874
+ }
18875
+ }
18590
18876
  return result;
18591
18877
  }
18592
18878
  var debugFullLazyLoad = dbg("DataSource:fullLazyLoad");
@@ -18604,7 +18890,6 @@ function onPropChange(params, props, actions) {
18604
18890
  }
18605
18891
  }
18606
18892
  }
18607
- var debugDataParams = dbg("DataSource:dataParams");
18608
18893
  function getMappedCallbacks() {
18609
18894
  return {
18610
18895
  rowSelection: (rowSelection, state) => {
@@ -18780,6 +19065,9 @@ function getInterceptActions() {
18780
19065
  )) {
18781
19066
  return false;
18782
19067
  }
19068
+ const debugDataParams = dbg(
19069
+ getDebugChannel(state.debugId, "DataSource:dataParams")
19070
+ );
18783
19071
  debugDataParams(
18784
19072
  "onDataParamsChange triggered because the following values have changed",
18785
19073
  dataParams?.changes
@@ -18803,7 +19091,7 @@ function getDataSourceStateRestoreForDetails(state) {
18803
19091
  // src/components/DataSource/privateHooks/useDataSource.tsx
18804
19092
  import React51, {
18805
19093
  useCallback as useCallback19,
18806
- useEffect as useEffect19,
19094
+ useEffect as useEffect20,
18807
19095
  useLayoutEffect as useLayoutEffect10,
18808
19096
  useState as useState14
18809
19097
  } from "react";
@@ -18875,7 +19163,7 @@ function useDataSourceInternal(props) {
18875
19163
  componentActions,
18876
19164
  getComponentState: getState
18877
19165
  });
18878
- useEffect19(() => {
19166
+ useEffect20(() => {
18879
19167
  componentState.onDataArrayChange?.(
18880
19168
  componentState.originalDataArray,
18881
19169
  componentState.originalDataArrayChangedInfo
@@ -18897,7 +19185,7 @@ function useDataSourceInternal(props) {
18897
19185
  });
18898
19186
  }
18899
19187
  }, [componentState.originalDataArrayChangedInfo]);
18900
- useEffect19(() => {
19188
+ useEffect20(() => {
18901
19189
  componentState.onReady?.(api);
18902
19190
  }, []);
18903
19191
  return {
@@ -19266,6 +19554,7 @@ var InfiniteTableCellSelectionApiImpl = class {
19266
19554
  return;
19267
19555
  }
19268
19556
  const newCellSelection = new CellSelectionState(cellSelection);
19557
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19269
19558
  const [startRowId, startColId] = this.getCellSelectionPosition(startOptions);
19270
19559
  const [endRowId, endColId] = this.getCellSelectionPosition(endOptions);
19271
19560
  const startCol = this.getComputed().computedVisibleColumnsMap.get(startColId);
@@ -19357,6 +19646,7 @@ var InfiniteTableCellSelectionApiImpl = class {
19357
19646
  return;
19358
19647
  }
19359
19648
  const newCellSelection = new CellSelectionState(cellSelection);
19649
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19360
19650
  newCellSelection.deselectAll();
19361
19651
  this.dataSourceActions.cellSelection = newCellSelection;
19362
19652
  };
@@ -19370,6 +19660,7 @@ var InfiniteTableCellSelectionApiImpl = class {
19370
19660
  return;
19371
19661
  }
19372
19662
  const newCellSelection = new CellSelectionState(cellSelection);
19663
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19373
19664
  newCellSelection.selectAll();
19374
19665
  this.dataSourceActions.cellSelection = newCellSelection;
19375
19666
  };
@@ -19384,22 +19675,26 @@ var InfiniteTableCellSelectionApiImpl = class {
19384
19675
  return this.getDataSourceState().cellSelection?.isCellSelected(pk, colId) ?? false;
19385
19676
  };
19386
19677
  this.selectCell = (options) => {
19387
- const cellSelection = this.getDataSourceState().cellSelection;
19678
+ const dataSourceState = this.getDataSourceState();
19679
+ const cellSelection = dataSourceState.cellSelection;
19388
19680
  if (!cellSelection) {
19389
19681
  return;
19390
19682
  }
19391
19683
  const [pk, colId] = this.getCellSelectionPosition(options);
19392
19684
  const newCellSelection = options.clear ? new CellSelectionState() : new CellSelectionState(cellSelection);
19685
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19393
19686
  newCellSelection.selectCell(pk, colId);
19394
19687
  this.dataSourceActions.cellSelection = newCellSelection;
19395
19688
  };
19396
19689
  this.deselectCell = (options) => {
19397
- const cellSelection = this.getDataSourceState().cellSelection;
19690
+ const dataSourceState = this.getDataSourceState();
19691
+ const cellSelection = dataSourceState.cellSelection;
19398
19692
  if (!cellSelection) {
19399
19693
  return;
19400
19694
  }
19401
19695
  const [pk, colId] = this.getCellSelectionPosition(options);
19402
19696
  const newCellSelection = new CellSelectionState(cellSelection);
19697
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19403
19698
  newCellSelection.deselectCell(pk, colId);
19404
19699
  this.dataSourceActions.cellSelection = newCellSelection;
19405
19700
  };
@@ -19407,20 +19702,24 @@ var InfiniteTableCellSelectionApiImpl = class {
19407
19702
  if (options?.clear) {
19408
19703
  this.deselectAll();
19409
19704
  }
19410
- const cellSelection = this.getDataSourceState().cellSelection;
19705
+ const dataSourceState = this.getDataSourceState();
19706
+ const cellSelection = dataSourceState.cellSelection;
19411
19707
  if (!cellSelection) {
19412
19708
  return;
19413
19709
  }
19414
19710
  const newCellSelection = new CellSelectionState(cellSelection);
19711
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19415
19712
  newCellSelection.selectColumn(colId);
19416
19713
  this.dataSourceActions.cellSelection = newCellSelection;
19417
19714
  };
19418
19715
  this.deselectColumn = (colId) => {
19419
- const cellSelection = this.getDataSourceState().cellSelection;
19716
+ const dataSourceState = this.getDataSourceState();
19717
+ const cellSelection = dataSourceState.cellSelection;
19420
19718
  if (!cellSelection) {
19421
19719
  return;
19422
19720
  }
19423
19721
  const newCellSelection = new CellSelectionState(cellSelection);
19722
+ newCellSelection.debugId = dataSourceState.debugId ?? "";
19424
19723
  newCellSelection.deselectColumn(colId);
19425
19724
  this.dataSourceActions.cellSelection = newCellSelection;
19426
19725
  };
@@ -19918,6 +20217,9 @@ var InfiniteTableApiImpl = class {
19918
20217
  this.hideFilterOperatorMenu = () => {
19919
20218
  this.actions.filterOperatorMenuVisibleForColumnId = null;
19920
20219
  };
20220
+ this.setGroupRenderStrategy = (groupRenderStrategy) => {
20221
+ this.actions.groupRenderStrategy = groupRenderStrategy;
20222
+ };
19921
20223
  this.getColumnOrder = () => {
19922
20224
  return this.getComputed().computedColumnOrder;
19923
20225
  };
@@ -20832,7 +21134,7 @@ function getImperativeApi(context) {
20832
21134
 
20833
21135
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
20834
21136
  import {
20835
- useEffect as useEffect20,
21137
+ useEffect as useEffect21,
20836
21138
  useRef as useRef22,
20837
21139
  useState as useState15
20838
21140
  } from "react";
@@ -20910,7 +21212,7 @@ function useAutoSizeColumns() {
20910
21212
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
20911
21213
  const getTheKey = useLatest(theKey);
20912
21214
  const lastExecutedIdentifierRef = useRef22(null);
20913
- useEffect20(() => {
21215
+ useEffect21(() => {
20914
21216
  const key = getTheKey();
20915
21217
  if (key == null) {
20916
21218
  return;
@@ -20923,7 +21225,7 @@ function useAutoSizeColumns() {
20923
21225
  };
20924
21226
  return brain.onRenderRangeChange(onChange);
20925
21227
  }, [brain]);
20926
- useEffect20(() => {
21228
+ useEffect21(() => {
20927
21229
  if (theKey == null) {
20928
21230
  return;
20929
21231
  }
@@ -20969,7 +21271,7 @@ function useAutoSizeColumns() {
20969
21271
 
20970
21272
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
20971
21273
  import { useMemo as useMemo9 } from "react";
20972
- import { useCallback as useCallback20, useEffect as useEffect21, useRef as useRef24 } from "react";
21274
+ import { useCallback as useCallback20, useEffect as useEffect22, useRef as useRef24 } from "react";
20973
21275
  import * as React54 from "react";
20974
21276
 
20975
21277
  // src/components/InfiniteTable/hooks/useYourBrain.ts
@@ -21193,6 +21495,8 @@ function useCellRendering(param) {
21193
21495
  const {
21194
21496
  rowHeight,
21195
21497
  rowDetailHeight,
21498
+ onRowMouseEnter,
21499
+ onRowMouseLeave,
21196
21500
  groupRenderStrategy,
21197
21501
  brain,
21198
21502
  showZebraRows,
@@ -21224,17 +21528,17 @@ function useCellRendering(param) {
21224
21528
  rowspan
21225
21529
  });
21226
21530
  const scrollTopMaxRef = useRef24(0);
21227
- useEffect21(() => {
21531
+ useEffect22(() => {
21228
21532
  return brain.onRenderCountChange(() => {
21229
21533
  scrollTopMaxRef.current = brain.scrollTopMax;
21230
21534
  });
21231
21535
  }, [brain]);
21232
- useEffect21(() => {
21536
+ useEffect22(() => {
21233
21537
  return brain.onRenderRangeChange((range) => {
21234
21538
  getState().onRenderRangeChange?.(range);
21235
21539
  });
21236
21540
  }, [brain]);
21237
- useEffect21(() => {
21541
+ useEffect22(() => {
21238
21542
  return brain.onScrollStop((scrollPosition) => {
21239
21543
  const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = scrollPosition;
21240
21544
  if (scrollTop2 === 0) {
@@ -21274,13 +21578,13 @@ function useCellRendering(param) {
21274
21578
  }
21275
21579
  });
21276
21580
  }, [brain, onScrollToTop, onScrollToBottom, onScrollStop]);
21277
- useEffect21(() => {
21581
+ useEffect22(() => {
21278
21582
  if (!bodySize.height) {
21279
21583
  return;
21280
21584
  }
21281
21585
  actions.ready = true;
21282
21586
  }, [!!bodySize.height]);
21283
- useEffect21(() => {
21587
+ useEffect22(() => {
21284
21588
  if (!ready) {
21285
21589
  }
21286
21590
  const { onReady } = getState();
@@ -21289,7 +21593,7 @@ function useCellRendering(param) {
21289
21593
  }
21290
21594
  }, [ready]);
21291
21595
  const [, rerender] = useRerender();
21292
- useEffect21(() => {
21596
+ useEffect22(() => {
21293
21597
  rerender();
21294
21598
  }, [dataSourceState]);
21295
21599
  const renderCell = useCallback20(
@@ -21334,6 +21638,8 @@ function useCellRendering(param) {
21334
21638
  rowDetailState,
21335
21639
  onMouseEnter,
21336
21640
  onMouseLeave,
21641
+ onRowMouseEnter,
21642
+ onRowMouseLeave,
21337
21643
  domRef,
21338
21644
  width,
21339
21645
  column,
@@ -21349,6 +21655,8 @@ function useCellRendering(param) {
21349
21655
  [
21350
21656
  rowHeight,
21351
21657
  rowDetailHeight,
21658
+ onRowMouseEnter,
21659
+ onRowMouseLeave,
21352
21660
  computedRowSizeCacheForDetails,
21353
21661
  computedRowHeight,
21354
21662
  isRowDetailsExpanded,
@@ -21410,7 +21718,7 @@ function useCellRendering(param) {
21410
21718
  }
21411
21719
 
21412
21720
  // src/components/InfiniteTable/hooks/useComputed.ts
21413
- import { useEffect as useEffect24, useState as useState17 } from "react";
21721
+ import { useEffect as useEffect25, useState as useState17 } from "react";
21414
21722
 
21415
21723
  // src/components/InfiniteTable/utils/MultiCellSelector.ts
21416
21724
  var MultiCellSelector = class {
@@ -21667,13 +21975,13 @@ function useColumnRowspan(computedVisibleColumns) {
21667
21975
 
21668
21976
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
21669
21977
  import { useCallback as useCallback21 } from "react";
21670
- var debug4 = dbg("useColumnSizeFn");
21978
+ var debug3 = dbg("useColumnSizeFn");
21671
21979
  function useColumnSizeFn(columns) {
21672
21980
  const columnSize = useCallback21(
21673
21981
  (index) => {
21674
21982
  const column = columns[index];
21675
21983
  if (false) {
21676
- debug4("cannot find column at index", index, columns);
21984
+ debug3("cannot find column at index", index, columns);
21677
21985
  }
21678
21986
  return column ? column.computedWidth : 0;
21679
21987
  },
@@ -21683,7 +21991,7 @@ function useColumnSizeFn(columns) {
21683
21991
  }
21684
21992
 
21685
21993
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
21686
- import { useEffect as useEffect22, useLayoutEffect as useLayoutEffect11, useMemo as useMemo11 } from "react";
21994
+ import { useEffect as useEffect23, useLayoutEffect as useLayoutEffect11, useMemo as useMemo11 } from "react";
21687
21995
 
21688
21996
  // src/components/InfiniteTable/state/getInitialState.ts
21689
21997
  import { createRef } from "react";
@@ -21765,7 +22073,7 @@ function getRowDetailRendererFromComponent(RowDetail) {
21765
22073
  // src/components/VirtualBrain/HorizontalLayoutMatrixBrain.ts
21766
22074
  var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
21767
22075
  constructor(name, opts) {
21768
- super(`HorizontalLayout${name ? `:${name}` : ""}`);
22076
+ super(`${name}:HorizontalLayout`);
21769
22077
  this.visiblePageCount = 0;
21770
22078
  this.isHorizontalLayoutBrain = true;
21771
22079
  this._totalPageCount = 0;
@@ -22044,10 +22352,11 @@ function getCellSelector(cellPosition) {
22044
22352
  return selector2;
22045
22353
  }
22046
22354
  function createBrains(debugId, wrapRowsHorizontally) {
22047
- const brain = !wrapRowsHorizontally ? new MatrixBrain(debugId) : new HorizontalLayoutMatrixBrain(debugId, {
22355
+ const debugChannel = getDebugChannel(debugId);
22356
+ const brain = !wrapRowsHorizontally ? new MatrixBrain(debugChannel) : new HorizontalLayoutMatrixBrain(debugChannel, {
22048
22357
  isHeader: false
22049
22358
  });
22050
- const headerBrain = !wrapRowsHorizontally ? new MatrixBrain("header") : new HorizontalLayoutMatrixBrain("header", {
22359
+ const headerBrain = !wrapRowsHorizontally ? new MatrixBrain(debugChannel) : new HorizontalLayoutMatrixBrain(debugChannel, {
22051
22360
  isHeader: true,
22052
22361
  masterBrain: brain
22053
22362
  });
@@ -22078,8 +22387,10 @@ function initSetupState2({
22078
22387
  );
22079
22388
  const domRef = createRef();
22080
22389
  return {
22390
+ debugWarnings: /* @__PURE__ */ new Map(),
22081
22391
  renderer,
22082
22392
  onRenderUpdater,
22393
+ devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
22083
22394
  propsCache: /* @__PURE__ */ new Map([]),
22084
22395
  lastRowToCollapseRef: { current: null },
22085
22396
  lastRowToExpandRef: { current: null },
@@ -22149,7 +22460,6 @@ var forwardProps4 = (_setupState) => {
22149
22460
  groupColumn: 1,
22150
22461
  onReady: 1,
22151
22462
  domProps: 1,
22152
- debugMode: 1,
22153
22463
  onKeyDown: 1,
22154
22464
  onCellClick: 1,
22155
22465
  onCellDoubleClick: 1,
@@ -22164,6 +22474,8 @@ var forwardProps4 = (_setupState) => {
22164
22474
  onContextMenu: 1,
22165
22475
  onCellContextMenu: 1,
22166
22476
  onRenderRangeChange: 1,
22477
+ onRowMouseEnter: 1,
22478
+ onRowMouseLeave: 1,
22167
22479
  onScrollToTop: 1,
22168
22480
  onScrollToBottom: 1,
22169
22481
  onScrollStop: 1,
@@ -22359,7 +22671,7 @@ var mapPropsToState = (params) => {
22359
22671
  }
22360
22672
  }
22361
22673
  const isRowDetailEnabled = !rowDetailRenderer ? false : props.isRowDetailEnabled || true;
22362
- return {
22674
+ let result = {
22363
22675
  isTree: parentState.isTree,
22364
22676
  rowDetailRenderer,
22365
22677
  rowDetailState,
@@ -22384,6 +22696,16 @@ var mapPropsToState = (params) => {
22384
22696
  rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
22385
22697
  columnHeaderHeightCSSVar: typeof props.columnHeaderHeight === "string" ? props.columnHeaderHeight || ThemeVars.components.Header.columnHeaderHeight : ""
22386
22698
  };
22699
+ if (state.devToolsDetected && state.debugId) {
22700
+ const devToolsOverrides = DEV_TOOLS_INFINITE_OVERRIDES.get(state.debugId);
22701
+ if (devToolsOverrides) {
22702
+ result = {
22703
+ ...result,
22704
+ ...devToolsOverrides
22705
+ };
22706
+ }
22707
+ }
22708
+ return result;
22387
22709
  };
22388
22710
 
22389
22711
  // src/components/InfiniteTable/state/getColumnVisibilityForHideEmptyGroupColumns.ts
@@ -22534,13 +22856,13 @@ function useColumnsWhen() {
22534
22856
  pivotGrandTotalColumnPosition
22535
22857
  }
22536
22858
  } = useManagedComponentState();
22537
- useEffect22(() => {
22859
+ useEffect23(() => {
22538
22860
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
22539
22861
  }, [groupRenderStrategy]);
22540
- useEffect22(() => {
22862
+ useEffect23(() => {
22541
22863
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
22542
22864
  }, [pivotTotalColumnPosition]);
22543
- useEffect22(() => {
22865
+ useEffect23(() => {
22544
22866
  if (pivotGrandTotalColumnPosition != void 0) {
22545
22867
  dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
22546
22868
  }
@@ -22623,7 +22945,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
22623
22945
  });
22624
22946
  return Object.keys(computedColumns).length === 0 ? void 0 : computedColumns;
22625
22947
  }
22626
- useEffect22(() => {
22948
+ useEffect23(() => {
22627
22949
  const update = () => {
22628
22950
  componentActions.columnsWhenInlineGroupRenderStrategy = isTree ? void 0 : computeColumnsWhenInlineGroupRenderStrategy(
22629
22951
  columns,
@@ -22654,7 +22976,7 @@ function useColumnsWhenGrouping() {
22654
22976
  getComponentState
22655
22977
  } = useManagedComponentState();
22656
22978
  const toggleGroupRow = useToggleGroupRow();
22657
- useEffect22(() => {
22979
+ useEffect23(() => {
22658
22980
  const update = () => {
22659
22981
  const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
22660
22982
  columns,
@@ -22758,7 +23080,7 @@ function useHideColumns(groupByMap) {
22758
23080
  hideEmptyGroupColumns ? groupRowsIndexesInDataArray : null,
22759
23081
  hideEmptyGroupColumns
22760
23082
  ]);
22761
- useEffect22(() => {
23083
+ useEffect23(() => {
22762
23084
  const isGrouped = groupBy.length > 0;
22763
23085
  const currentState = getComponentState();
22764
23086
  const {
@@ -23169,7 +23491,7 @@ function useComputedRowHeight(param) {
23169
23491
  }
23170
23492
 
23171
23493
  // src/components/InfiniteTable/hooks/useScrollbars.ts
23172
- import { useState as useState16, useEffect as useEffect23, useLayoutEffect as useLayoutEffect12 } from "react";
23494
+ import { useState as useState16, useEffect as useEffect24, useLayoutEffect as useLayoutEffect12 } from "react";
23173
23495
  var INITIAL_SCROLLBARS = {
23174
23496
  vertical: false,
23175
23497
  horizontal: false
@@ -23178,7 +23500,7 @@ function useScrollbars(brain) {
23178
23500
  const { getComponentState: getInfiniteTableState } = useManagedComponentState();
23179
23501
  const { getState: getDataSourceState } = useDataSourceContextValue();
23180
23502
  const [scrollbars, setScrollbars] = useState16(INITIAL_SCROLLBARS);
23181
- useEffect23(() => {
23503
+ useEffect24(() => {
23182
23504
  return brain.onRenderCountChange(() => {
23183
23505
  const { scrollTopMax, scrollLeftMax } = brain;
23184
23506
  setScrollbars({
@@ -23253,7 +23575,7 @@ function useComputed() {
23253
23575
  }
23254
23576
  );
23255
23577
  });
23256
- useEffect24(() => {
23578
+ useEffect25(() => {
23257
23579
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
23258
23580
  }, [showSeparatePivotColumnForSingleAggregation]);
23259
23581
  const { multiSort, filterValue, filterTypes } = dataSourceState;
@@ -23561,7 +23883,7 @@ var useLicense = (licenseKey = "") => {
23561
23883
  }
23562
23884
  let valid2 = isValidLicense(licenseKey, {
23563
23885
  publishedAt: 1624970570587,
23564
- version: "6.2.10"
23886
+ version: "6.2.12"
23565
23887
  });
23566
23888
  if (!licenseKey && !valid2 && isInsidePlayground) {
23567
23889
  return true;
@@ -23572,18 +23894,18 @@ var useLicense = (licenseKey = "") => {
23572
23894
  };
23573
23895
 
23574
23896
  // src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
23575
- import { useRef as useRef25, useEffect as useEffect25 } from "react";
23897
+ import { useRef as useRef25, useEffect as useEffect26 } from "react";
23576
23898
  var RETRIES = 10;
23577
23899
  function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
23578
23900
  const didScrollRef = useRef25(false);
23579
23901
  const rafId = useRef25(null);
23580
- useEffect25(() => {
23902
+ useEffect26(() => {
23581
23903
  if (activeCellIndex != null) {
23582
23904
  didScrollRef.current = false;
23583
23905
  cancelRaf(rafId.current);
23584
23906
  }
23585
23907
  }, [activeCellIndex]);
23586
- useEffect25(() => {
23908
+ useEffect26(() => {
23587
23909
  if (activeCellIndex != null && !didScrollRef.current) {
23588
23910
  let tryScroll2 = function(times = 0) {
23589
23911
  times++;
@@ -23611,18 +23933,18 @@ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
23611
23933
  }
23612
23934
 
23613
23935
  // src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
23614
- import { useRef as useRef26, useEffect as useEffect26 } from "react";
23936
+ import { useRef as useRef26, useEffect as useEffect27 } from "react";
23615
23937
  var RETRIES2 = 10;
23616
23938
  function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
23617
23939
  const didScrollRef = useRef26(false);
23618
23940
  const rafId = useRef26(null);
23619
- useEffect26(() => {
23941
+ useEffect27(() => {
23620
23942
  if (activeRowIndex != null) {
23621
23943
  didScrollRef.current = false;
23622
23944
  cancelAnimationFrame(rafId.current);
23623
23945
  }
23624
23946
  }, [activeRowIndex]);
23625
- useEffect26(() => {
23947
+ useEffect27(() => {
23626
23948
  if (activeRowIndex != null && !didScrollRef.current) {
23627
23949
  let tryScroll2 = function(times = 0) {
23628
23950
  times++;
@@ -23651,7 +23973,7 @@ function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
23651
23973
  var toCSSVarName = (value) => `--infinite-${value}`;
23652
23974
 
23653
23975
  // src/components/InfiniteTable/eventHandlers/index.ts
23654
- import { useCallback as useCallback23, useMemo as useMemo15, useEffect as useEffect27 } from "react";
23976
+ import { useCallback as useCallback23, useMemo as useMemo15, useEffect as useEffect28 } from "react";
23655
23977
 
23656
23978
  // src/components/InfiniteTable/eventHandlers/onCellClick.ts
23657
23979
  function onCellClick(context, event) {
@@ -23701,10 +24023,11 @@ function updateCellSelectionOnCellClick(context, event) {
23701
24023
  return;
23702
24024
  }
23703
24025
  const { multiCellSelector, computedVisibleColumns } = getComputed();
23704
- const { brain } = getState();
24026
+ const { brain, debugId } = getState();
23705
24027
  const { rowsPerPage } = brain;
23706
24028
  const columnsPerSet = computedVisibleColumns.length;
23707
24029
  const cellSelection = new CellSelectionState(existingCellSelection);
24030
+ cellSelection.debugId = debugId ?? "";
23708
24031
  multiCellSelector.cellSelectionState = cellSelection;
23709
24032
  const position2 = {
23710
24033
  rowIndex,
@@ -24362,7 +24685,7 @@ function useEventHandlersContext() {
24362
24685
  }
24363
24686
  function handleDOMEvents() {
24364
24687
  const context = useEventHandlersContext();
24365
- useEffect27(() => {
24688
+ useEffect28(() => {
24366
24689
  const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
24367
24690
  onKeyDown(context, event);
24368
24691
  });
@@ -24418,13 +24741,13 @@ function useDOMEventHandlers() {
24418
24741
  }
24419
24742
 
24420
24743
  // src/components/InfiniteTable/hooks/useColumnMenu.ts
24421
- import { useEffect as useEffect31 } from "react";
24744
+ import { useEffect as useEffect32 } from "react";
24422
24745
 
24423
24746
  // src/components/hooks/useOverlay/index.tsx
24424
24747
  import * as React56 from "react";
24425
24748
  import {
24426
24749
  useCallback as useCallback24,
24427
- useEffect as useEffect29,
24750
+ useEffect as useEffect30,
24428
24751
  useLayoutEffect as useLayoutEffect13,
24429
24752
  useState as useState18
24430
24753
  } from "react";
@@ -24815,7 +25138,7 @@ function DefaultOverlayPortal(props) {
24815
25138
  }
24816
25139
  function OverlayContent(props) {
24817
25140
  const nodeRef = React56.useRef(null);
24818
- useEffect29(() => {
25141
+ useEffect30(() => {
24819
25142
  return props.realign.onChange((handle) => {
24820
25143
  if (nodeRef.current && handle) {
24821
25144
  alignNode(nodeRef.current, handle);
@@ -25412,10 +25735,10 @@ function useMenuContext() {
25412
25735
  }
25413
25736
 
25414
25737
  // src/components/hooks/useMounted.ts
25415
- import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef28 } from "react";
25738
+ import { useCallback as useCallback25, useEffect as useEffect31, useRef as useRef28 } from "react";
25416
25739
  function useMounted() {
25417
25740
  let mountedRef = useRef28(true);
25418
- useEffect30(() => {
25741
+ useEffect31(() => {
25419
25742
  mountedRef.current = true;
25420
25743
  return () => {
25421
25744
  mountedRef.current = false;
@@ -26227,7 +26550,7 @@ function useColumnMenu() {
26227
26550
  } = useOverlay({
26228
26551
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26229
26552
  });
26230
- useEffect31(() => {
26553
+ useEffect32(() => {
26231
26554
  const { actions: actions2, getState: getState2 } = context;
26232
26555
  const state = getState2();
26233
26556
  return state.onColumnMenuClick.onChange((info) => {
@@ -26242,7 +26565,7 @@ function useColumnMenu() {
26242
26565
  });
26243
26566
  }, []);
26244
26567
  const { columnMenuVisibleForColumnId, columnMenuVisibleKey } = getState();
26245
- useEffect31(() => {
26568
+ useEffect32(() => {
26246
26569
  const { columnMenuVisibleForColumnId: columnMenuVisibleForColumnId2, columnMenuTargetRef } = getState();
26247
26570
  if (columnMenuVisibleForColumnId2) {
26248
26571
  let handleMouseDown2 = function(event) {
@@ -26322,13 +26645,13 @@ function FocusDetect() {
26322
26645
  }
26323
26646
 
26324
26647
  // src/components/InfiniteTable/hooks/useEditingCallbackProps.ts
26325
- import { useEffect as useEffect32 } from "react";
26648
+ import { useEffect as useEffect33 } from "react";
26326
26649
  function useOnEditCancelled() {
26327
26650
  const context = useInfiniteTable();
26328
26651
  const { getState } = context;
26329
26652
  const { editingCell } = getState();
26330
26653
  const cancelled = editingCell && !editingCell.active ? editingCell.cancelled : void 0;
26331
- useEffect32(() => {
26654
+ useEffect33(() => {
26332
26655
  if (cancelled) {
26333
26656
  const { rowIndex, columnId, initialValue } = getState().editingCell;
26334
26657
  const { onEditCancelled } = getState();
@@ -26350,7 +26673,7 @@ function useOnEditRejected() {
26350
26673
  state: { editingCell }
26351
26674
  } = context;
26352
26675
  const rejected = editingCell && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0;
26353
- useEffect32(() => {
26676
+ useEffect33(() => {
26354
26677
  if (rejected) {
26355
26678
  const { rowIndex, columnId, value, initialValue } = getState().editingCell;
26356
26679
  const { onEditRejected } = getState();
@@ -26374,7 +26697,7 @@ function useFocusOnEditStop() {
26374
26697
  } = context;
26375
26698
  const active = editingCell?.active;
26376
26699
  const prevActive = usePrevious(active);
26377
- useEffect32(() => {
26700
+ useEffect33(() => {
26378
26701
  if (!active && prevActive) {
26379
26702
  context.api.focus();
26380
26703
  }
@@ -26387,7 +26710,7 @@ function useOnEditAccepted() {
26387
26710
  getState
26388
26711
  } = context;
26389
26712
  const accepted = editingCell && !editingCell.active && !editingCell.cancelled && editingCell.accepted === true;
26390
- useEffect32(() => {
26713
+ useEffect33(() => {
26391
26714
  if (accepted) {
26392
26715
  const { editingCell: editingCell2 } = getState();
26393
26716
  const { value, rowIndex, columnId, initialValue } = editingCell2;
@@ -26412,7 +26735,7 @@ function useOnEditPersisted() {
26412
26735
  getState
26413
26736
  } = context;
26414
26737
  const persisted = editingCell ? editingCell.persisted : void 0;
26415
- useEffect32(() => {
26738
+ useEffect33(() => {
26416
26739
  if (persisted) {
26417
26740
  const { editingCell: editingCell2, onEditPersistError, onEditPersistSuccess } = getState();
26418
26741
  if (!editingCell2) {
@@ -26445,7 +26768,7 @@ function useEditingCallbackProps() {
26445
26768
  }
26446
26769
 
26447
26770
  // src/components/InfiniteTable/hooks/useColumnFilterOperatorMenu.ts
26448
- import { useEffect as useEffect33 } from "react";
26771
+ import { useEffect as useEffect34 } from "react";
26449
26772
 
26450
26773
  // src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
26451
26774
  import * as React66 from "react";
@@ -26584,7 +26907,7 @@ function useColumnFilterOperatorMenu() {
26584
26907
  } = useOverlay({
26585
26908
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26586
26909
  });
26587
- useEffect33(() => {
26910
+ useEffect34(() => {
26588
26911
  const { actions: actions2, getState: getState2 } = context;
26589
26912
  const state = getState2();
26590
26913
  return state.onFilterOperatorMenuClick.onChange((info) => {
@@ -26620,7 +26943,7 @@ function useColumnFilterOperatorMenu() {
26620
26943
  actions2.filterOperatorMenuVisibleForColumnId = column.id;
26621
26944
  });
26622
26945
  }, []);
26623
- useEffect33(() => {
26946
+ useEffect34(() => {
26624
26947
  const { filterOperatorMenuVisibleForColumnId } = getState();
26625
26948
  if (filterOperatorMenuVisibleForColumnId) {
26626
26949
  let handleMouseDown2 = function(event) {
@@ -26647,7 +26970,7 @@ function useColumnFilterOperatorMenu() {
26647
26970
  }
26648
26971
 
26649
26972
  // src/components/InfiniteTable/hooks/useContextMenu.ts
26650
- import { useEffect as useEffect34 } from "react";
26973
+ import { useEffect as useEffect35 } from "react";
26651
26974
 
26652
26975
  // src/components/InfiniteTable/utils/getCellContextMenu.tsx
26653
26976
  import * as React68 from "react";
@@ -26814,7 +27137,7 @@ function useCellContextMenu() {
26814
27137
  } = useOverlay({
26815
27138
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26816
27139
  });
26817
- useEffect34(() => {
27140
+ useEffect35(() => {
26818
27141
  const { actions: actions2, getState: getState2, getDataSourceState } = context;
26819
27142
  const state = getState2();
26820
27143
  return state.cellContextMenu.onChange((info) => {
@@ -26865,7 +27188,7 @@ function useCellContextMenu() {
26865
27188
  }
26866
27189
  });
26867
27190
  }, []);
26868
- useEffect34(() => {
27191
+ useEffect35(() => {
26869
27192
  const { cellContextMenuVisibleFor } = getState();
26870
27193
  if (cellContextMenuVisibleFor) {
26871
27194
  let handleMouseDown2 = function(event) {
@@ -26901,7 +27224,7 @@ function useTableContextMenu() {
26901
27224
  } = useOverlay({
26902
27225
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26903
27226
  });
26904
- useEffect34(() => {
27227
+ useEffect35(() => {
26905
27228
  const { actions: actions2, getState: getState2 } = context;
26906
27229
  const state = getState2();
26907
27230
  return state.contextMenu.onChange((info) => {
@@ -26950,7 +27273,7 @@ function useTableContextMenu() {
26950
27273
  }
26951
27274
  });
26952
27275
  }, []);
26953
- useEffect34(() => {
27276
+ useEffect35(() => {
26954
27277
  const { contextMenuVisibleFor } = getState();
26955
27278
  if (contextMenuVisibleFor) {
26956
27279
  let handleMouseDown2 = function(event) {
@@ -26981,13 +27304,13 @@ import { useRef as useRef30 } from "react";
26981
27304
  import * as React69 from "react";
26982
27305
 
26983
27306
  // src/components/InfiniteTable/hooks/useGridScroll.ts
26984
- import { useCallback as useCallback28, useEffect as useEffect35 } from "react";
27307
+ import { useCallback as useCallback28, useEffect as useEffect36 } from "react";
26985
27308
  function useGridScroll(onScroll, deps) {
26986
27309
  const {
26987
27310
  state: { brain }
26988
27311
  } = useInfiniteTable();
26989
27312
  const memoizedOnScroll = useCallback28(onScroll, deps);
26990
- useEffect35(() => {
27313
+ useEffect36(() => {
26991
27314
  const removeOnScroll = brain.onScroll(memoizedOnScroll);
26992
27315
  return removeOnScroll;
26993
27316
  }, [brain, memoizedOnScroll]);
@@ -27057,12 +27380,12 @@ function useVisibleColumnSizes() {
27057
27380
  var DEBUG_NAME = "InfiniteTable";
27058
27381
 
27059
27382
  // src/components/InfiniteTable/hooks/useToggleWrapRowsHorizontally.ts
27060
- import { useEffect as useEffect36 } from "react";
27383
+ import { useEffect as useEffect37 } from "react";
27061
27384
  function useToggleWrapRowsHorizontally() {
27062
27385
  const { state, getState, actions } = useInfiniteTable();
27063
27386
  const { wrapRowsHorizontally } = state;
27064
27387
  const oldWrapRowsHorizontally = usePrevious(wrapRowsHorizontally);
27065
- useEffect36(() => {
27388
+ useEffect37(() => {
27066
27389
  if (oldWrapRowsHorizontally !== wrapRowsHorizontally) {
27067
27390
  const { brain, headerBrain, renderer, onRenderUpdater } = getState();
27068
27391
  brain.destroy();
@@ -27079,7 +27402,7 @@ function useToggleWrapRowsHorizontally() {
27079
27402
  }
27080
27403
 
27081
27404
  // src/components/InfiniteTable/hooks/useHorizontalLayout.ts
27082
- import { useEffect as useEffect37 } from "react";
27405
+ import { useEffect as useEffect38 } from "react";
27083
27406
  function useHorizontalLayout() {
27084
27407
  const { getState, actions, dataSourceActions, getDataSourceState } = useInfiniteTable();
27085
27408
  const { groupBy, isTree } = getDataSourceState();
@@ -27089,7 +27412,7 @@ function useHorizontalLayout() {
27089
27412
  if (!wrapRowsHorizontally) {
27090
27413
  repeatWrappedGroupRows = false;
27091
27414
  }
27092
- useEffect37(() => {
27415
+ useEffect38(() => {
27093
27416
  if (!wrapRowsHorizontally) {
27094
27417
  if (getDataSourceState().repeatWrappedGroupRows) {
27095
27418
  dataSourceActions.repeatWrappedGroupRows = false;
@@ -27133,37 +27456,414 @@ function useHorizontalLayout() {
27133
27456
  }
27134
27457
 
27135
27458
  // src/components/InfiniteTable/hooks/useDebugMode.ts
27136
- import * as React70 from "react";
27137
- var logWarning = once(() => {
27138
- console.warn(
27139
- `It appears you have not loaded the CSS file for InfiniteTable.
27140
- In most environments, you should be able to fix this by adding the following line:
27459
+ import { useEffect as useEffect39, useRef as useRef31 } from "react";
27141
27460
 
27142
- import '@infinite-table/infinite-react/index.css'
27461
+ // src/components/InfiniteTable/hooks/debugModeDevToolsOverlay.css.ts
27462
+ var DevToolsOverlay = createRuntimeFn({ defaultClassName: "_143ofgf0", variantClassNames: { active: { true: "_143ofgf1", false: "_143ofgf2" } }, defaultVariants: {}, compoundVariants: [] });
27463
+ var DevToolsOverlayBg = "_143ofgf5";
27464
+ var DevToolsOverlayText = "_143ofgf3";
27143
27465
 
27144
- `
27145
- );
27146
- });
27466
+ // src/components/InfiniteTable/hooks/useDebugMode.ts
27147
27467
  var cssFileLoadedVarName = stripVar(ThemeVars.loaded);
27148
- function useDebugMode() {
27149
- const { getState } = useInfiniteTable();
27150
- React70.useEffect(() => {
27151
- runDebugMode(getState);
27152
- }, []);
27468
+ var messageBase = {
27469
+ source: "infinite-table-page",
27470
+ target: "infinite-table-devtools-background"
27471
+ };
27472
+ function buildMessageForExtension(params, options) {
27473
+ const { type, debugId } = params;
27474
+ if (type === "unmount") {
27475
+ return {
27476
+ ...messageBase,
27477
+ url: getPageUrlOfWindow(),
27478
+ type,
27479
+ payload: {
27480
+ debugId
27481
+ }
27482
+ };
27483
+ }
27484
+ const opts = options;
27485
+ const computedValues = opts.getComputed();
27486
+ const dataSourceState = opts.getDataSourceState();
27487
+ const state = opts.getState();
27488
+ const message = {
27489
+ ...messageBase,
27490
+ url: getPageUrlOfWindow(),
27491
+ type,
27492
+ payload: {
27493
+ debugId,
27494
+ columnVisibility: state.columnVisibility,
27495
+ columnOrder: computedValues.computedColumnOrder,
27496
+ visibleColumnIds: computedValues.computedVisibleColumns.map((c) => c.id),
27497
+ selectionMode: dataSourceState.selectionMode,
27498
+ columns: Object.fromEntries(
27499
+ computedValues.computedVisibleColumns.map((c) => [
27500
+ c.id,
27501
+ {
27502
+ field: c.field,
27503
+ dataType: c.computedDataType,
27504
+ sortType: c.computedSortType,
27505
+ filtered: c.computedFiltered,
27506
+ sorted: c.computedSorted,
27507
+ width: c.computedWidth
27508
+ }
27509
+ ])
27510
+ ),
27511
+ groupRenderStrategy: state.groupRenderStrategy,
27512
+ groupBy: dataSourceState.groupBy.map(
27513
+ (g) => g.field ? `${g.field}` : "<fn>"
27514
+ ),
27515
+ sortInfo: (dataSourceState.sortInfo || []).filter((sortInfo) => typeof sortInfo.field === "string").map((s) => {
27516
+ return {
27517
+ field: `${s.field}`,
27518
+ dir: s.dir,
27519
+ type: Array.isArray(s.type) ? s.type[0] : s.type ?? "string"
27520
+ };
27521
+ }),
27522
+ multiSort: dataSourceState.multiSort,
27523
+ devToolsDetected: state.devToolsDetected,
27524
+ debugTimings: Object.fromEntries(dataSourceState.debugTimings),
27525
+ debugWarnings: {
27526
+ ...Object.fromEntries(dataSourceState.debugWarnings),
27527
+ ...Object.fromEntries(state.debugWarnings)
27528
+ }
27529
+ }
27530
+ };
27531
+ return message;
27153
27532
  }
27154
- function runDebugMode(getState) {
27533
+ var getPageUrlOfWindow = once(function() {
27534
+ const url = new URL(window.location.href);
27535
+ return url.origin + url.pathname;
27536
+ });
27537
+ function postMessage(message) {
27538
+ window.postMessage(message);
27539
+ }
27540
+ var setupHook = once(() => {
27541
+ console.log("Infinite Table DevTools detected!");
27542
+ const hookFn = (debugId, options) => {
27543
+ if (options) {
27544
+ INSTANCES.set(debugId, options);
27545
+ const { devToolsDetected } = options.getState();
27546
+ if (!devToolsDetected) {
27547
+ options.actions.devToolsDetected = true;
27548
+ }
27549
+ const dataSourceState = options.getDataSourceState();
27550
+ if (dataSourceState.debugId !== debugId) {
27551
+ options.dataSourceActions.debugId = debugId;
27552
+ }
27553
+ if (!dataSourceState.devToolsDetected) {
27554
+ options.dataSourceActions.devToolsDetected = true;
27555
+ }
27556
+ window.postMessage(
27557
+ buildMessageForExtension({ type: "update", debugId }, options)
27558
+ );
27559
+ } else {
27560
+ deleteInstanceFromDevTools(debugId);
27561
+ window.postMessage(
27562
+ buildMessageForExtension({ type: "unmount", debugId }, null)
27563
+ );
27564
+ }
27565
+ };
27566
+ window.__INFINITE_TABLE_DEVTOOLS_HOOK__ = hookFn;
27567
+ debug.onLogIntent("*", (options) => {
27568
+ postMessage({
27569
+ ...messageBase,
27570
+ url: getPageUrlOfWindow(),
27571
+ type: "log",
27572
+ payload: {
27573
+ debugId: void 0,
27574
+ channel: options.channel,
27575
+ color: options.color,
27576
+ args: options.args.map((arg) => {
27577
+ if (typeof arg === "object" && arg !== null) {
27578
+ return JSON.stringify(arg);
27579
+ }
27580
+ return String(arg);
27581
+ }),
27582
+ timestamp: options.timestamp
27583
+ }
27584
+ });
27585
+ });
27586
+ return hookFn;
27587
+ });
27588
+ function useDebugMode() {
27589
+ const { getState, getDataSourceState, dataSourceActions } = useInfiniteTable();
27155
27590
  const state = getState();
27156
- const { debugMode, domRef } = state;
27157
- if (debugMode) {
27591
+ const { domRef, debugId } = state;
27592
+ if (debugId) {
27158
27593
  if (domRef.current) {
27159
27594
  const value = getComputedStyle(domRef.current).getPropertyValue(
27160
27595
  cssFileLoadedVarName
27161
27596
  );
27162
27597
  if (value !== `${CSS_LOADED_VALUE}`) {
27163
- logWarning();
27598
+ logDevToolsWarning({
27599
+ debugId,
27600
+ key: "CSS001_CSS"
27601
+ });
27602
+ }
27603
+ }
27604
+ }
27605
+ useEffect39(() => {
27606
+ const dataSourceState = getDataSourceState();
27607
+ if (dataSourceState.debugId !== debugId) {
27608
+ dataSourceActions.debugId = debugId;
27609
+ }
27610
+ }, [debugId]);
27611
+ return useDevTools();
27612
+ }
27613
+ var HOOK_FN_SETUP_CALLBACK = buildSubscriptionCallback();
27614
+ var DEVTOOLS_MESSAGES = {
27615
+ revertAll: (payload) => {
27616
+ const instance = INSTANCES.get(payload.debugId);
27617
+ if (instance) {
27618
+ const infiniteInitials = DEV_TOOLS_INFINITE_INITIALS.get(payload.debugId);
27619
+ DEV_TOOLS_INFINITE_INITIALS.delete(payload.debugId);
27620
+ DEV_TOOLS_INFINITE_OVERRIDES.delete(payload.debugId);
27621
+ if (infiniteInitials) {
27622
+ Object.keys(infiniteInitials).forEach((key) => {
27623
+ instance.actions[key] = infiniteInitials[key];
27624
+ delete infiniteInitials[key];
27625
+ });
27626
+ }
27627
+ const dataSourceInitials = DEV_TOOLS_DATASOURCE_INITIALS.get(
27628
+ payload.debugId
27629
+ );
27630
+ DEV_TOOLS_DATASOURCE_INITIALS.delete(payload.debugId);
27631
+ DEV_TOOLS_DATASOURCE_OVERRIDES.delete(payload.debugId);
27632
+ if (dataSourceInitials) {
27633
+ Object.keys(dataSourceInitials).forEach((key) => {
27634
+ instance.dataSourceActions[key] = dataSourceInitials[key];
27635
+ delete dataSourceInitials[key];
27636
+ });
27637
+ }
27638
+ }
27639
+ },
27640
+ revertProperty: (payload) => {
27641
+ const instance = INSTANCES.get(payload.debugId);
27642
+ if (instance) {
27643
+ const property = payload.property;
27644
+ const infiniteOverrides = DEV_TOOLS_INFINITE_OVERRIDES.get(
27645
+ payload.debugId
27646
+ );
27647
+ const infiniteInitials = DEV_TOOLS_INFINITE_INITIALS.get(payload.debugId);
27648
+ const dataSourceOverrides = DEV_TOOLS_DATASOURCE_OVERRIDES.get(
27649
+ payload.debugId
27650
+ );
27651
+ const dataSourceInitials = DEV_TOOLS_DATASOURCE_INITIALS.get(
27652
+ payload.debugId
27653
+ );
27654
+ const infiniteStateProp = property;
27655
+ if (infiniteInitials && infiniteOverrides && infiniteOverrides[infiniteStateProp] !== void 0) {
27656
+ delete infiniteOverrides[infiniteStateProp];
27657
+ instance.actions[infiniteStateProp] = infiniteInitials[infiniteStateProp];
27658
+ delete infiniteInitials[infiniteStateProp];
27659
+ }
27660
+ const dataSourceStateProp = property;
27661
+ if (dataSourceInitials && dataSourceOverrides && dataSourceOverrides[dataSourceStateProp] !== void 0) {
27662
+ const dataSourceInitials2 = DEV_TOOLS_DATASOURCE_INITIALS.get(payload.debugId) || {};
27663
+ delete dataSourceOverrides[dataSourceStateProp];
27664
+ instance.dataSourceActions[dataSourceStateProp] = dataSourceInitials2[dataSourceStateProp];
27665
+ delete dataSourceInitials2[dataSourceStateProp];
27666
+ }
27667
+ }
27668
+ },
27669
+ discardWarning: (payload) => {
27670
+ const instance = INSTANCES.get(payload.debugId);
27671
+ if (instance) {
27672
+ const dsWarningKey = payload.warning;
27673
+ const dsWarnings = instance.getDataSourceState().debugWarnings;
27674
+ const obj = dsWarnings.get(dsWarningKey);
27675
+ if (obj) {
27676
+ dsWarnings.delete(dsWarningKey);
27677
+ updateDevToolsForInstance(payload.debugId);
27678
+ } else {
27679
+ const itWarningKey = payload.warning;
27680
+ const infiniteWarnings = instance.getState().debugWarnings;
27681
+ const obj2 = infiniteWarnings.get(itWarningKey);
27682
+ if (obj2) {
27683
+ infiniteWarnings.delete(itWarningKey);
27684
+ updateDevToolsForInstance(payload.debugId);
27685
+ }
27686
+ }
27687
+ }
27688
+ },
27689
+ discardAllWarnings: (payload) => {
27690
+ const instance = INSTANCES.get(payload.debugId);
27691
+ if (instance) {
27692
+ instance.getDataSourceState().debugWarnings.clear();
27693
+ instance.getState().debugWarnings.clear();
27694
+ updateDevToolsForInstance(payload.debugId);
27695
+ }
27696
+ },
27697
+ setColumnVisibility: (payload) => {
27698
+ setDevToolInfinitePropertyOverride(
27699
+ payload.debugId,
27700
+ "columnVisibility",
27701
+ payload.columnVisibility
27702
+ );
27703
+ },
27704
+ setGroupBy: (payload) => {
27705
+ setDevToolDataSourcePropertyOverride(
27706
+ payload.debugId,
27707
+ "groupBy",
27708
+ payload.groupBy
27709
+ );
27710
+ },
27711
+ setGroupRenderStrategy: (payload) => {
27712
+ setDevToolInfinitePropertyOverride(
27713
+ payload.debugId,
27714
+ "groupRenderStrategy",
27715
+ payload.groupRenderStrategy
27716
+ );
27717
+ },
27718
+ setSortInfo: (payload) => {
27719
+ setDevToolDataSourcePropertyOverride(
27720
+ payload.debugId,
27721
+ "sortInfo",
27722
+ payload.sortInfo
27723
+ );
27724
+ },
27725
+ setMultiSort: (payload) => {
27726
+ setDevToolDataSourcePropertyOverride(
27727
+ payload.debugId,
27728
+ "multiSort",
27729
+ payload.multiSort
27730
+ );
27731
+ },
27732
+ highlight: (payload) => {
27733
+ const instance = INSTANCES.get(payload.debugId);
27734
+ if (instance) {
27735
+ const domNode = instance.getState().domRef.current;
27736
+ if (domNode) {
27737
+ const rect = domNode.getBoundingClientRect();
27738
+ let overlay = document.querySelector(
27739
+ `.${DevToolsOverlay.classNames.base}`
27740
+ );
27741
+ if (!overlay) {
27742
+ overlay = document.createElement("div");
27743
+ overlay.classList.add(DevToolsOverlay.classNames.base);
27744
+ overlay.innerHTML = [
27745
+ `<div class="${DevToolsOverlayText}"></div>`,
27746
+ `<div class="${DevToolsOverlayBg}"></div>`
27747
+ ].join("");
27748
+ document.body.appendChild(overlay);
27749
+ }
27750
+ let textDiv = overlay.firstElementChild;
27751
+ if (overlay) {
27752
+ overlay.style.left = `${rect.left}px`;
27753
+ overlay.style.top = `${rect.top}px`;
27754
+ overlay.style.width = `${rect.width}px`;
27755
+ overlay.style.height = `${rect.height}px`;
27756
+ textDiv.innerHTML = payload.debugId;
27757
+ const overlayBg = overlay.lastElementChild;
27758
+ const handleAnimationEnd = () => {
27759
+ overlay.classList.remove(
27760
+ DevToolsOverlay.classNames.variants.active.true
27761
+ );
27762
+ overlayBg.removeEventListener("animationend", handleAnimationEnd);
27763
+ };
27764
+ overlayBg.addEventListener("animationend", handleAnimationEnd);
27765
+ overlay.classList.add(
27766
+ DevToolsOverlay.classNames.variants.active.true
27767
+ );
27768
+ }
27164
27769
  }
27165
27770
  }
27166
27771
  }
27772
+ };
27773
+ function listenForDevTools() {
27774
+ if (typeof window !== "undefined") {
27775
+ window.addEventListener("message", (event) => {
27776
+ if (event && event.data && typeof event.data.source === "string" && event.data.source.startsWith("infinite-table-devtools-contentscript") && event.data.target === "infinite-table-page") {
27777
+ if (!window.__INFINITE_TABLE_DEVTOOLS_HOOK__) {
27778
+ setupHook();
27779
+ HOOK_FN_SETUP_CALLBACK(
27780
+ window.__INFINITE_TABLE_DEVTOOLS_HOOK__
27781
+ );
27782
+ }
27783
+ if (typeof event.data.type === "string") {
27784
+ const eventType = event.data.type;
27785
+ const fn = DEVTOOLS_MESSAGES[eventType];
27786
+ if (fn) {
27787
+ fn(event.data.payload);
27788
+ }
27789
+ }
27790
+ }
27791
+ });
27792
+ }
27793
+ }
27794
+ listenForDevTools();
27795
+ function useDevTools() {
27796
+ const {
27797
+ getState,
27798
+ getComputed,
27799
+ getDataSourceState,
27800
+ dataSourceActions,
27801
+ actions,
27802
+ dataSourceApi,
27803
+ api
27804
+ } = useInfiniteTable();
27805
+ const state = getState();
27806
+ const debugId = state.debugId;
27807
+ const debugIdRef = useRef31(debugId);
27808
+ debugIdRef.current = debugId;
27809
+ useEffect39(() => {
27810
+ const debugId2 = debugIdRef.current;
27811
+ if (!debugId2) {
27812
+ return;
27813
+ }
27814
+ const withHookFn = (hookFn2) => {
27815
+ hookFn2(debugId2, {
27816
+ getState,
27817
+ getDataSourceState,
27818
+ getComputed,
27819
+ dataSourceActions,
27820
+ actions,
27821
+ api,
27822
+ dataSourceApi
27823
+ });
27824
+ };
27825
+ const hookFn = HOOK_FN_SETUP_CALLBACK.get();
27826
+ if (hookFn) {
27827
+ withHookFn(hookFn);
27828
+ return;
27829
+ }
27830
+ return HOOK_FN_SETUP_CALLBACK.onChange((hookFn2) => {
27831
+ if (!hookFn2) {
27832
+ return;
27833
+ }
27834
+ withHookFn(hookFn2);
27835
+ });
27836
+ }, []);
27837
+ useEffect39(() => {
27838
+ const debugId2 = debugIdRef.current;
27839
+ if (!debugId2) {
27840
+ return;
27841
+ }
27842
+ const hookFn = HOOK_FN_SETUP_CALLBACK.get();
27843
+ if (hookFn) {
27844
+ hookFn(debugId2, {
27845
+ getState,
27846
+ getDataSourceState,
27847
+ getComputed,
27848
+ dataSourceActions,
27849
+ actions,
27850
+ api,
27851
+ dataSourceApi
27852
+ });
27853
+ }
27854
+ });
27855
+ useEffect39(() => {
27856
+ if (!debugId) {
27857
+ return;
27858
+ }
27859
+ return () => {
27860
+ const devtoolsHookFn = globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;
27861
+ if (devtoolsHookFn) {
27862
+ devtoolsHookFn(debugId, null);
27863
+ }
27864
+ };
27865
+ }, [debugId]);
27866
+ return debugId;
27167
27867
  }
27168
27868
 
27169
27869
  // src/components/InfiniteTable/hooks/useInfinitePortalContainer.ts
@@ -27196,14 +27896,16 @@ var { ManagedComponentContextProvider: InfiniteTableRoot } = buildManagedCompone
27196
27896
  mappedCallbacks: getMappedCallbacks2(),
27197
27897
  // @ts-ignore
27198
27898
  getParentState: () => useDataSourceState(),
27199
- debugName: DEBUG_NAME
27899
+ debugName: (props) => {
27900
+ return getDebugChannel(props.debugId, DEBUG_NAME);
27901
+ }
27200
27902
  });
27201
27903
  function InfiniteTableHeader2() {
27202
27904
  const context = useInfiniteTable();
27203
27905
  const { state: componentState, getComputed } = context;
27204
27906
  const { header, brain, headerBrain, wrapRowsHorizontally } = componentState;
27205
27907
  const { scrollbars } = getComputed();
27206
- return header ? /* @__PURE__ */ React71.createElement(
27908
+ return header ? /* @__PURE__ */ React70.createElement(
27207
27909
  TableHeaderWrapper,
27208
27910
  {
27209
27911
  wrapRowsHorizontally: !!wrapRowsHorizontally,
@@ -27220,7 +27922,7 @@ var InfiniteTableBodyCls = join(
27220
27922
  transformTranslateZero
27221
27923
  );
27222
27924
  function InfiniteTableBodyContainer(props) {
27223
- return /* @__PURE__ */ React71.createElement(
27925
+ return /* @__PURE__ */ React70.createElement(
27224
27926
  "div",
27225
27927
  {
27226
27928
  ...props,
@@ -27258,7 +27960,7 @@ function InfiniteTableBody() {
27258
27960
  const {
27259
27961
  componentState: { loading }
27260
27962
  } = useDataSourceContextValue();
27261
- const onContextMenu = React71.useCallback((event) => {
27963
+ const onContextMenu = React70.useCallback((event) => {
27262
27964
  const state = context.getState();
27263
27965
  const target = event.target;
27264
27966
  if (!masterContext && event._from_row_detail) {
@@ -27304,7 +28006,7 @@ function InfiniteTableBody() {
27304
28006
  });
27305
28007
  const { autoFocus, tabIndex } = domProps ?? {};
27306
28008
  useToggleWrapRowsHorizontally();
27307
- return /* @__PURE__ */ React71.createElement(InfiniteTableBodyContainer, { onContextMenu }, /* @__PURE__ */ React71.createElement(
28009
+ return /* @__PURE__ */ React70.createElement(InfiniteTableBodyContainer, { onContextMenu }, /* @__PURE__ */ React70.createElement(
27308
28010
  HeadlessTable,
27309
28011
  {
27310
28012
  forceRerenderTimestamp: componentState.forceBodyRerenderTimestamp,
@@ -27326,9 +28028,9 @@ function InfiniteTableBody() {
27326
28028
  scrollerDOMRef,
27327
28029
  scrollVarHostRef: domRef
27328
28030
  }
27329
- ), /* @__PURE__ */ React71.createElement(LoadMaskCmp, { visible: loading }, loadingText));
28031
+ ), /* @__PURE__ */ React70.createElement(LoadMaskCmp, { visible: loading }, loadingText));
27330
28032
  }
27331
- var InfiniteTableComponent = React71.memo(
28033
+ var InfiniteTableComponent = React70.memo(
27332
28034
  function InfiniteTableComponent2() {
27333
28035
  const context = useInfiniteTable();
27334
28036
  const masterContext = useMasterDetailContext();
@@ -27360,7 +28062,7 @@ var InfiniteTableComponent = React71.memo(
27360
28062
  useScrollToActiveRow(activeRowIndex, dataArray.length, api);
27361
28063
  useScrollToActiveCell(activeCellIndex, dataArray.length, api);
27362
28064
  const { onKeyDown: onKeyDown2 } = useDOMEventHandlers();
27363
- React71.useEffect(() => {
28065
+ React70.useEffect(() => {
27364
28066
  const dataSourceState = getDataSourceState();
27365
28067
  const onChange = debounce(
27366
28068
  (renderRange) => {
@@ -27383,7 +28085,7 @@ var InfiniteTableComponent = React71.memo(
27383
28085
  ...initialDOMProps
27384
28086
  } = componentState.domProps ?? {};
27385
28087
  const domProps = useDOMProps(initialDOMProps);
27386
- React71.useEffect(() => {
28088
+ React70.useEffect(() => {
27387
28089
  brain.setScrollStopDelay(scrollStopDelay);
27388
28090
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
27389
28091
  }, [scrollStopDelay]);
@@ -27394,7 +28096,7 @@ var InfiniteTableComponent = React71.memo(
27394
28096
  const { menuPortal: cellContextMenuPortal } = useCellContextMenu();
27395
28097
  const { menuPortal: tableContextMenuPortal } = useTableContextMenu();
27396
28098
  const { menuPortal: filterOperatorMenuPortal } = useColumnFilterOperatorMenu();
27397
- React71.useEffect(() => {
28099
+ React70.useEffect(() => {
27398
28100
  if (typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY === "function") {
27399
28101
  globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(
27400
28102
  componentState.id,
@@ -27407,59 +28109,75 @@ var InfiniteTableComponent = React71.memo(
27407
28109
  globalThis.infiniteApi = context.api;
27408
28110
  }
27409
28111
  }, [componentState.ready]);
27410
- useDebugMode();
27411
- React71.useEffect(() => {
28112
+ const debugId = useDebugMode();
28113
+ React70.useEffect(() => {
27412
28114
  if (masterContext) {
27413
28115
  portalDOMRef.current = masterContext.getMasterState().portalDOMRef.current;
27414
28116
  }
27415
28117
  }, []);
27416
- const children = initialChildren ?? /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement(InfiniteTableHeader2, null), /* @__PURE__ */ React71.createElement(InfiniteTableBody, null));
27417
- return /* @__PURE__ */ React71.createElement("div", { onKeyDown: onKeyDown2, ref: domRef, ...domProps }, children, /* @__PURE__ */ React71.createElement(
28118
+ const children = initialChildren ?? /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(InfiniteTableHeader2, null), /* @__PURE__ */ React70.createElement(InfiniteTableBody, null));
28119
+ return /* @__PURE__ */ React70.createElement(
27418
28120
  "div",
27419
28121
  {
27420
- ref: portalDOMRef,
27421
- className: join(
27422
- `${rootClassName2}Portal`,
27423
- zIndex[1e7],
27424
- position.absolute,
27425
- top[0],
27426
- left[0]
27427
- )
28122
+ "data-debug-id": debugId,
28123
+ onKeyDown: onKeyDown2,
28124
+ ref: domRef,
28125
+ ...domProps
27428
28126
  },
27429
- menuPortal,
27430
- cellContextMenuPortal,
27431
- tableContextMenuPortal,
27432
- filterOperatorMenuPortal
27433
- ), rowHeightCSSVar ? /* @__PURE__ */ React71.createElement(
27434
- CSSNumericVariableWatch,
27435
- {
27436
- key: "row-height",
27437
- varName: rowHeightCSSVar,
27438
- onChange: onRowHeightCSSVarChange
27439
- }
27440
- ) : null, /* @__PURE__ */ React71.createElement(
27441
- CSSNumericVariableWatch,
27442
- {
27443
- key: "flashing-duration",
27444
- allowInts: true,
27445
- varName: ThemeVars.components.Cell.flashingDuration,
27446
- onChange: onFlashingDurationCSSVarChange
27447
- }
27448
- ), rowDetailHeightCSSVar ? /* @__PURE__ */ React71.createElement(
27449
- CSSNumericVariableWatch,
27450
- {
27451
- key: "row-detail-height",
27452
- varName: rowDetailHeightCSSVar,
27453
- onChange: onRowDetailHeightCSSVarChange
27454
- }
27455
- ) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ React71.createElement(
27456
- CSSNumericVariableWatch,
27457
- {
27458
- key: "column-header-height",
27459
- varName: columnHeaderHeightCSSVar,
27460
- onChange: onColumnHeaderHeightCSSVarChange
27461
- }
27462
- ) : null, licenseValid ? null : /* @__PURE__ */ React71.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React71.createElement(FocusDetect, null));
28127
+ children,
28128
+ /* @__PURE__ */ React70.createElement(
28129
+ "div",
28130
+ {
28131
+ ref: portalDOMRef,
28132
+ className: join(
28133
+ `${rootClassName2}Portal`,
28134
+ zIndex[1e7],
28135
+ position.absolute,
28136
+ top[0],
28137
+ left[0]
28138
+ )
28139
+ },
28140
+ menuPortal,
28141
+ cellContextMenuPortal,
28142
+ tableContextMenuPortal,
28143
+ filterOperatorMenuPortal
28144
+ ),
28145
+ rowHeightCSSVar ? /* @__PURE__ */ React70.createElement(
28146
+ CSSNumericVariableWatch,
28147
+ {
28148
+ key: "row-height",
28149
+ varName: rowHeightCSSVar,
28150
+ onChange: onRowHeightCSSVarChange
28151
+ }
28152
+ ) : null,
28153
+ /* @__PURE__ */ React70.createElement(
28154
+ CSSNumericVariableWatch,
28155
+ {
28156
+ key: "flashing-duration",
28157
+ allowInts: true,
28158
+ varName: ThemeVars.components.Cell.flashingDuration,
28159
+ onChange: onFlashingDurationCSSVarChange
28160
+ }
28161
+ ),
28162
+ rowDetailHeightCSSVar ? /* @__PURE__ */ React70.createElement(
28163
+ CSSNumericVariableWatch,
28164
+ {
28165
+ key: "row-detail-height",
28166
+ varName: rowDetailHeightCSSVar,
28167
+ onChange: onRowDetailHeightCSSVarChange
28168
+ }
28169
+ ) : null,
28170
+ columnHeaderHeightCSSVar ? /* @__PURE__ */ React70.createElement(
28171
+ CSSNumericVariableWatch,
28172
+ {
28173
+ key: "column-header-height",
28174
+ varName: columnHeaderHeightCSSVar,
28175
+ onChange: onColumnHeaderHeightCSSVarChange
28176
+ }
28177
+ ) : null,
28178
+ licenseValid ? null : /* @__PURE__ */ React70.createElement(InfiniteTableLicenseFooter, null),
28179
+ /* @__PURE__ */ React70.createElement(FocusDetect, null)
28180
+ );
27463
28181
  }
27464
28182
  );
27465
28183
  function InfiniteTableContextProvider({
@@ -27476,6 +28194,16 @@ function InfiniteTableContextProvider({
27476
28194
  globalThis.getComputed = getComputed;
27477
28195
  globalThis.componentActions = componentActions;
27478
28196
  globalThis.masterBrain = componentState.brain;
28197
+ globalThis.INFINITE = globalThis.INFINITE || {};
28198
+ if (getState().debugId) {
28199
+ const debugId = getState().debugId;
28200
+ globalThis.INFINITE[debugId] = {
28201
+ // @ts-ignore
28202
+ ...globalThis.INFINITE[debugId] || {},
28203
+ getState,
28204
+ actions: componentActions
28205
+ };
28206
+ }
27479
28207
  }
27480
28208
  const {
27481
28209
  getState: getDataSourceState,
@@ -27483,7 +28211,7 @@ function InfiniteTableContextProvider({
27483
28211
  getDataSourceMasterContext,
27484
28212
  api: dataSourceApi
27485
28213
  } = useDataSourceContextValue();
27486
- const [imperativeApi] = React71.useState(() => {
28214
+ const [imperativeApi] = React70.useState(() => {
27487
28215
  return getImperativeApi({
27488
28216
  getComputed,
27489
28217
  getState,
@@ -27519,20 +28247,20 @@ function InfiniteTableContextProvider({
27519
28247
  },
27520
28248
  { earlyAttach: true, debounce: 50 }
27521
28249
  );
27522
- React71.useEffect(() => {
28250
+ React70.useEffect(() => {
27523
28251
  if (scrollerDOMRef.current) {
27524
28252
  scrollerDOMRef.current.scrollTop = 0;
27525
28253
  }
27526
28254
  }, [scrollTopKey, scrollerDOMRef]);
27527
28255
  const TableContext2 = getInfiniteTableContext();
27528
- return /* @__PURE__ */ React71.createElement(TableContext2.Provider, { value: contextValue }, /* @__PURE__ */ React71.createElement(InfiniteTableComponent, null));
28256
+ return /* @__PURE__ */ React70.createElement(TableContext2.Provider, { value: contextValue }, /* @__PURE__ */ React70.createElement(InfiniteTableComponent, null));
27529
28257
  }
27530
28258
  var DEFAULT_ROW_HEIGHT = 40;
27531
28259
  var DEFAULT_COLUMN_HEADER_HEIGHT = toCSSVarName(columnHeaderHeightName);
27532
28260
  var InfiniteTable = function(props) {
27533
28261
  const table = (
27534
28262
  //@ts-ignore
27535
- /* @__PURE__ */ React71.createElement(
28263
+ /* @__PURE__ */ React70.createElement(
27536
28264
  InfiniteTableRoot,
27537
28265
  {
27538
28266
  repeatWrappedGroupRows: !!props.wrapRowsHorizontally,
@@ -27540,34 +28268,33 @@ var InfiniteTable = function(props) {
27540
28268
  columnHeaderHeight: DEFAULT_COLUMN_HEADER_HEIGHT,
27541
28269
  ...props
27542
28270
  },
27543
- /* @__PURE__ */ React71.createElement(InfiniteTableContextProvider, { children: props.children })
28271
+ /* @__PURE__ */ React70.createElement(InfiniteTableContextProvider, { children: props.children })
27544
28272
  )
27545
28273
  );
27546
28274
  if (false) {
27547
- return /* @__PURE__ */ React71.createElement(React71.StrictMode, null, table);
28275
+ return /* @__PURE__ */ React70.createElement(React70.StrictMode, null, table);
27548
28276
  }
27549
28277
  return table;
27550
28278
  };
27551
28279
  InfiniteTable.Header = InfiniteTableHeader2;
27552
28280
  InfiniteTable.Body = InfiniteTableBody;
27553
28281
  InfiniteTable.HScrollSyncContent = HScrollSyncContent;
27554
- InfiniteTable.Footer = () => /* @__PURE__ */ React71.createElement(InfiniteTableFooter, null);
28282
+ InfiniteTable.Footer = () => /* @__PURE__ */ React70.createElement(InfiniteTableFooter, null);
27555
28283
 
27556
28284
  // src/components/TreeGrid/TreeDataSource.tsx
27557
- import * as React72 from "react";
28285
+ import * as React71 from "react";
27558
28286
  function TreeDataSource(props) {
27559
28287
  const { DataSource: DataSourceComponent } = useDataSourceInternal({ nodesKey: "children", ...props });
27560
- return /* @__PURE__ */ React72.createElement(DataSourceComponent, null, props.children ?? null);
28288
+ return /* @__PURE__ */ React71.createElement(DataSourceComponent, null, props.children ?? null);
27561
28289
  }
27562
28290
 
27563
28291
  // src/components/TreeGrid/TreeGrid.tsx
27564
- import * as React73 from "react";
28292
+ import * as React72 from "react";
27565
28293
  function TreeGrid(props) {
27566
- return /* @__PURE__ */ React73.createElement(InfiniteTable, { ...props });
28294
+ return /* @__PURE__ */ React72.createElement(InfiniteTable, { ...props });
27567
28295
  }
27568
28296
 
27569
28297
  // src/components/DataSource/DataLoader/DataQuery.ts
27570
- var logger2 = debug("InfiniteTable:DataQuery");
27571
28298
  var DataQuery = class {
27572
28299
  constructor(debugName) {
27573
28300
  this.state = "idle";
@@ -27581,21 +28308,21 @@ var DataQuery = class {
27581
28308
  let resolvePending = () => {
27582
28309
  };
27583
28310
  try {
27584
- logger2(`Fetching query ${this.debugName}...`);
28311
+ this.logger(`Fetching query ${this.debugName}...`);
27585
28312
  this.pendingPromise = new Promise((resolve) => {
27586
28313
  resolvePending = resolve;
27587
28314
  });
27588
28315
  this.result = await loadFn(...key);
27589
28316
  this.state = "success";
27590
- } catch (error2) {
28317
+ } catch (error4) {
27591
28318
  this.result = void 0;
27592
- this.error = error2;
28319
+ this.error = error4;
27593
28320
  this.state = "error";
27594
28321
  }
27595
28322
  this.doneAt = Date.now();
27596
28323
  this.pendingPromise = void 0;
27597
28324
  resolvePending(this);
27598
- logger2(`Fetched query ${this.debugName}. State: ${this.state}.`);
28325
+ this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`);
27599
28326
  return this.getDoneSnapshot();
27600
28327
  };
27601
28328
  this.getCurrentSnapshot = () => {
@@ -27635,6 +28362,7 @@ var DataQuery = class {
27635
28362
  this.isDone = () => this.state === "success" || this.state === "error";
27636
28363
  this.isSuccess = () => this.state === "success";
27637
28364
  this.debugName = debugName || "";
28365
+ this.logger = debug(`${debugName}:DataQuery`);
27638
28366
  }
27639
28367
  };
27640
28368
 
@@ -27693,7 +28421,7 @@ var _DataClient = class {
27693
28421
  this.removeQueryIfErrored(cachedQuery, stringifiedCacheKey);
27694
28422
  }
27695
28423
  }
27696
- const dataQuery = new DataQuery(options.name || "");
28424
+ const dataQuery = new DataQuery(`${this.name}:${options.name}`);
27697
28425
  this.queryCache.set(stringifiedCacheKey, dataQuery);
27698
28426
  dataQuery.fetch(options.fn, options.key);
27699
28427
  dataQuery.getCurrentSnapshot().promise?.then(() => {
@@ -27805,7 +28533,7 @@ var keyboardShortcuts = {
27805
28533
  };
27806
28534
 
27807
28535
  // src/components/hooks/useInterceptedMap.ts
27808
- import { useEffect as useEffect40 } from "react";
28536
+ import { useEffect as useEffect41 } from "react";
27809
28537
  function interceptMap(map2, fns) {
27810
28538
  const { set, delete: deleteKey, clear } = map2;
27811
28539
  if (fns.set) {
@@ -27967,21 +28695,21 @@ var WeakFixedSizeSet = _WeakFixedSizeSet;
27967
28695
  WeakFixedSizeSet.DEFAULT_SIZE = 10;
27968
28696
 
27969
28697
  // src/components/hooks/useEffectWhenSameDeps.ts
27970
- import { useEffect as useEffect41, useRef as useRef31 } from "react";
28698
+ import { useEffect as useEffect42, useRef as useRef32 } from "react";
27971
28699
  var isSameDeps = (deps, prevDeps) => {
27972
28700
  return deps.every((dep, index) => dep === prevDeps[index]);
27973
28701
  };
27974
28702
  var useEffectWhenSameDeps = (callback, deps) => {
27975
- const depsRef = useRef31(deps);
28703
+ const depsRef = useRef32(deps);
27976
28704
  const sameDeps = isSameDeps(deps, depsRef.current);
27977
- const isInitialRef = useRef31(true);
28705
+ const isInitialRef = useRef32(true);
27978
28706
  depsRef.current = deps;
27979
- const effectDepsRef = useRef31(["same"]);
28707
+ const effectDepsRef = useRef32(["same"]);
27980
28708
  const effectDeps = sameDeps ? [Date.now()] : effectDepsRef.current;
27981
28709
  effectDepsRef.current = effectDeps;
27982
- const callbackRef = useRef31(callback);
28710
+ const callbackRef = useRef32(callback);
27983
28711
  callbackRef.current = callback;
27984
- useEffect41(() => {
28712
+ useEffect42(() => {
27985
28713
  if (isInitialRef.current) {
27986
28714
  isInitialRef.current = false;
27987
28715
  return;
@@ -27991,7 +28719,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
27991
28719
  };
27992
28720
 
27993
28721
  // src/components/hooks/useEffectWhen.ts
27994
- import { useEffect as useEffect42, useRef as useRef32 } from "react";
28722
+ import { useEffect as useEffect43, useRef as useRef33 } from "react";
27995
28723
  var isSameDeps2 = (deps, prevDeps, compare) => {
27996
28724
  return deps.every((dep, index) => {
27997
28725
  if (compare) {
@@ -28002,26 +28730,26 @@ var isSameDeps2 = (deps, prevDeps, compare) => {
28002
28730
  };
28003
28731
  var useEffectWhen = (callback, options) => {
28004
28732
  const { same: depsForSame, different: depsForDifferent, compare } = options;
28005
- const sameDepsRef = useRef32(depsForSame);
28006
- const differentDepsRef = useRef32(depsForDifferent);
28733
+ const sameDepsRef = useRef33(depsForSame);
28734
+ const differentDepsRef = useRef33(depsForDifferent);
28007
28735
  const sameRespected = isSameDeps2(depsForSame, sameDepsRef.current, compare);
28008
28736
  const differentRespected = !isSameDeps2(
28009
28737
  depsForDifferent,
28010
28738
  differentDepsRef.current,
28011
28739
  compare
28012
28740
  );
28013
- const isInitialRef = useRef32(true);
28741
+ const isInitialRef = useRef33(true);
28014
28742
  sameDepsRef.current = depsForSame;
28015
28743
  differentDepsRef.current = depsForDifferent;
28016
- const effectDepsRef = useRef32(["same"]);
28744
+ const effectDepsRef = useRef33(["same"]);
28017
28745
  const effectDeps = sameRespected && differentRespected ? [Date.now()] : effectDepsRef.current;
28018
28746
  effectDepsRef.current = effectDeps;
28019
- const callbackRef = useRef32(callback);
28747
+ const callbackRef = useRef33(callback);
28020
28748
  callbackRef.current = callback;
28021
28749
  if (sameRespected && differentRespected) {
28022
28750
  isInitialRef.current = false;
28023
28751
  }
28024
- useEffect42(() => {
28752
+ useEffect43(() => {
28025
28753
  if (isInitialRef.current) {
28026
28754
  return;
28027
28755
  }
@@ -28030,12 +28758,12 @@ var useEffectWhen = (callback, options) => {
28030
28758
  };
28031
28759
 
28032
28760
  // src/components/InfiniteTable/components/InfiniteTableRow/FlashingColumnCell.tsx
28033
- import * as React74 from "react";
28761
+ import * as React73 from "react";
28034
28762
  var currentFlashingDurationVar = stripVar(
28035
28763
  InternalVars.currentFlashingDuration
28036
28764
  );
28037
28765
  var defaultRender = ({ children }) => {
28038
- return /* @__PURE__ */ React74.createElement(React74.Fragment, null, children);
28766
+ return /* @__PURE__ */ React73.createElement(React73.Fragment, null, children);
28039
28767
  };
28040
28768
  var DEFAULT_FLASH_DURATION = 1e3;
28041
28769
  var INTERNAL_FLASH_CLS_FOR_DIRECTION = {
@@ -28057,7 +28785,7 @@ var createFlashingColumnCellComponent = (options = {}) => {
28057
28785
  // fadeClassName,
28058
28786
  render = defaultRender
28059
28787
  } = options;
28060
- const FlashingColumnCell2 = React74.forwardRef(
28788
+ const FlashingColumnCell2 = React73.forwardRef(
28061
28789
  (props, _ref) => {
28062
28790
  const cellContext = useInfiniteColumnCell();
28063
28791
  const {
@@ -28067,13 +28795,13 @@ var createFlashingColumnCellComponent = (options = {}) => {
28067
28795
  const { domRef, value, column, rowInfo, htmlElementRef } = cellContext;
28068
28796
  const rowId = rowInfo.id;
28069
28797
  const columnId = column.id;
28070
- const initialRef = React74.useRef(true);
28071
- const oldValueRef = React74.useRef(value);
28798
+ const initialRef = React73.useRef(true);
28799
+ const oldValueRef = React73.useRef(value);
28072
28800
  const oldValue = initialRef.current ? null : oldValueRef.current;
28073
28801
  initialRef.current = false;
28074
- const flashTimeoutIdRef = React74.useRef();
28075
- const flashDirectionRef = React74.useRef();
28076
- const fadeTimeoutIdRef = React74.useRef();
28802
+ const flashTimeoutIdRef = React73.useRef();
28803
+ const flashDirectionRef = React73.useRef();
28804
+ const fadeTimeoutIdRef = React73.useRef();
28077
28805
  useEffectWhen(
28078
28806
  () => {
28079
28807
  if (value === oldValueRef.current) {
@@ -28120,7 +28848,7 @@ var createFlashingColumnCellComponent = (options = {}) => {
28120
28848
  different: [value]
28121
28849
  }
28122
28850
  );
28123
- return /* @__PURE__ */ React74.createElement("div", { ref: domRef, ...props, className: join(props.className) }, render({ children: props.children, oldValue }));
28851
+ return /* @__PURE__ */ React73.createElement("div", { ref: domRef, ...props, className: join(props.className) }, render({ children: props.children, oldValue }));
28124
28852
  }
28125
28853
  );
28126
28854
  return FlashingColumnCell2;