@infinite-table/infinite-react 7.4.1 → 7.5.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.dev.mjs CHANGED
@@ -1328,6 +1328,13 @@ var toUpperFirst = (s) => {
1328
1328
  return s ? s.substr(0, 1).toUpperCase() + s.substr(1) : s;
1329
1329
  };
1330
1330
 
1331
+ // src/components/InfiniteTable/types/Utility.ts
1332
+ function notNullable(value) {
1333
+ if (value === null || value === void 0) return false;
1334
+ const testDummyForCompileError = value;
1335
+ return true;
1336
+ }
1337
+
1331
1338
  // src/components/utils/isControlledValue.ts
1332
1339
  function isControlledValue(value) {
1333
1340
  const controlled = value !== void 0;
@@ -1401,6 +1408,165 @@ var usePrevious = (value, initialValue) => {
1401
1408
  return ref.current;
1402
1409
  };
1403
1410
 
1411
+ // src/utils/devTools/devToolsTracks.ts
1412
+ var DevToolsTracks = {
1413
+ DataSource: {
1414
+ track: "DataSource",
1415
+ labels: {
1416
+ RemoteDataLoad: "Remote data load",
1417
+ TreeUnfilteredTreePaths: "Computing unfiltered tree paths",
1418
+ Filter: "Filter",
1419
+ Sort: "Sort",
1420
+ Group: "Group",
1421
+ LazyGroup: "Lazy group",
1422
+ Tree: "Tree",
1423
+ FlattenTree: "Flatten tree",
1424
+ Flatten: "Flatten groups",
1425
+ PrepareData: "Preparing data",
1426
+ ComputeSelectionCount: "Computing selection count",
1427
+ ComputeSelectionCountLazy: "Computing selection count (lazy)",
1428
+ PrepareRowInfo: "Preparing row info array",
1429
+ DiffRowInfoInStore: "setDataArray diffing in RowInfoStore"
1430
+ }
1431
+ },
1432
+ InfiniteTable: {
1433
+ track: "InfiniteTable",
1434
+ labels: {
1435
+ Render: "Rendering"
1436
+ }
1437
+ },
1438
+ MatrixBrain: {
1439
+ track: "Layout Computations",
1440
+ labels: {
1441
+ ComputeRenderRange: "Computing render range"
1442
+ }
1443
+ },
1444
+ ComponentState: {
1445
+ track: "ComponentState",
1446
+ labels: {
1447
+ PropUpdate: "Prop update"
1448
+ }
1449
+ }
1450
+ };
1451
+
1452
+ // src/utils/devTools/index.ts
1453
+ var DevToolsMarker = class _DevToolsMarker {
1454
+ constructor(debugId) {
1455
+ this.debugId = debugId;
1456
+ this.markerDetails = {
1457
+ label: "",
1458
+ track: "",
1459
+ trackGroup: void 0,
1460
+ color: void 0,
1461
+ details: [],
1462
+ tooltip: void 0
1463
+ };
1464
+ this.stopped = false;
1465
+ this.start = (startDetails) => {
1466
+ if (this.markerDetails.startTs) {
1467
+ return this;
1468
+ }
1469
+ const start = performance.now();
1470
+ this.markerDetails.details = startDetails?.details ?? [];
1471
+ this.markerDetails.startTs = start;
1472
+ return this;
1473
+ };
1474
+ this.end = (markerDetails = {}) => {
1475
+ if (this.stopped) {
1476
+ return this;
1477
+ }
1478
+ this.stopped = true;
1479
+ const start = markerDetails.startTs ?? this.markerDetails.startTs;
1480
+ const end = markerDetails.endTs ?? this.markerDetails.endTs ?? performance.now();
1481
+ const color = markerDetails.color || this.markerDetails.color || "primary";
1482
+ const trackGroup = markerDetails.trackGroup || this.markerDetails.trackGroup || `Infinite Table (${this.debugId})`;
1483
+ const details = [
1484
+ ...this.markerDetails.details || [],
1485
+ ...markerDetails.details || []
1486
+ ];
1487
+ const tooltip = markerDetails.tooltip || this.markerDetails.tooltip;
1488
+ const label = markerDetails.label || this.markerDetails.label || "Unknown";
1489
+ const track = markerDetails.track || this.markerDetails.track || "Unknown";
1490
+ performance.measure(label, {
1491
+ start,
1492
+ end,
1493
+ detail: {
1494
+ devtools: {
1495
+ dataType: "track-entry",
1496
+ trackGroup,
1497
+ track,
1498
+ color,
1499
+ properties: details.length > 0 ? details.map((detail) => [detail.name, detail.value]) : void 0,
1500
+ tooltipText: tooltip
1501
+ }
1502
+ }
1503
+ });
1504
+ return this;
1505
+ };
1506
+ this.debugId = debugId;
1507
+ }
1508
+ static create(debugId) {
1509
+ return new _DevToolsMarker(debugId);
1510
+ }
1511
+ get startTimestamp() {
1512
+ return this.markerDetails.startTs;
1513
+ }
1514
+ get track() {
1515
+ const self = this;
1516
+ return Object.keys(DevToolsTracks).reduce(
1517
+ (acc, track) => {
1518
+ const trackObj = {
1519
+ start: self.start,
1520
+ end: (markerDetails) => {
1521
+ return self.end({
1522
+ ...markerDetails,
1523
+ track: DevToolsTracks[track].track,
1524
+ label: markerDetails.label
1525
+ });
1526
+ },
1527
+ get label() {
1528
+ const currentTrack = DevToolsTracks[track];
1529
+ return Object.keys(currentTrack.labels).reduce(
1530
+ (labelAcc, label) => {
1531
+ const labelObj = {
1532
+ start: self.start,
1533
+ end: (markerDetails) => {
1534
+ return self.end({
1535
+ ...markerDetails,
1536
+ track: currentTrack.track,
1537
+ label: currentTrack.labels[label]
1538
+ });
1539
+ }
1540
+ };
1541
+ Object.defineProperty(labelAcc, label, {
1542
+ get: () => {
1543
+ self.markerDetails.label = currentTrack.labels[label];
1544
+ return labelObj;
1545
+ }
1546
+ });
1547
+ return labelAcc;
1548
+ },
1549
+ {}
1550
+ );
1551
+ }
1552
+ };
1553
+ Object.defineProperty(acc, track, {
1554
+ get: () => {
1555
+ const currentTrack = DevToolsTracks[track];
1556
+ self.markerDetails.track = currentTrack.track;
1557
+ return trackObj;
1558
+ }
1559
+ });
1560
+ return acc;
1561
+ },
1562
+ {}
1563
+ );
1564
+ }
1565
+ };
1566
+ function getMarker(debugId) {
1567
+ return DevToolsMarker.create(debugId);
1568
+ }
1569
+
1404
1570
  // src/components/hooks/useComponentState/index.tsx
1405
1571
  var notifyChange = (props, callbackPropName, values) => {
1406
1572
  const callbackProp = props[callbackPropName];
@@ -1657,9 +1823,10 @@ function buildManagedComponent(config) {
1657
1823
  }
1658
1824
  });
1659
1825
  if (updatedPropsToStateCount > 0 || newMappedStateCount > 0) {
1660
- const logger2 = config.debugName ? dbg(
1661
- typeof config.debugName === "function" ? `${config.debugName(currentProps)}:rerender` : `${config.debugName}:rerender`
1662
- ) : dbg("rerender");
1826
+ const debugId = state.debugId;
1827
+ const marker = debugId ? getMarker(debugId).track.ComponentState.label.PropUpdate.start() : void 0;
1828
+ const debugChannelName = config.debugName ? typeof config.debugName === "function" ? `${config.debugName(currentProps)}:rerender` : `${config.debugName}:rerender` : "rerender";
1829
+ const logger2 = dbg(debugChannelName);
1663
1830
  logger2(
1664
1831
  "Triggered by new values for the following props",
1665
1832
  ...[
@@ -1667,6 +1834,25 @@ function buildManagedComponent(config) {
1667
1834
  ...Object.keys(updatedPropsToState ?? {})
1668
1835
  ]
1669
1836
  );
1837
+ if (marker) {
1838
+ marker.end({
1839
+ label: debugChannelName,
1840
+ details: [
1841
+ newMappedStateCount > 0 ? {
1842
+ name: "Updated properties",
1843
+ value: Object.keys(newMappedState).join(", ")
1844
+ } : void 0,
1845
+ updatedPropsToStateCount > 0 ? {
1846
+ name: "Updated props",
1847
+ value: Object.keys(updatedPropsToState).join(", ")
1848
+ } : void 0,
1849
+ updatedPropsToStateCount > 0 || updatedPropsToState ? {
1850
+ name: "Details",
1851
+ value: "The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."
1852
+ } : void 0
1853
+ ].filter(notNullable)
1854
+ });
1855
+ }
1670
1856
  const action = {
1671
1857
  payload: {
1672
1858
  mappedState: newMappedStateCount ? newMappedState : null,
@@ -5713,7 +5899,7 @@ import * as React30 from "react";
5713
5899
 
5714
5900
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5715
5901
  import * as React29 from "react";
5716
- import { useCallback as useCallback12, useContext as useContext7, useMemo as useMemo4 } from "react";
5902
+ import { useCallback as useCallback12, useContext as useContext7, useMemo as useMemo4, useSyncExternalStore } from "react";
5717
5903
 
5718
5904
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
5719
5905
  import * as React25 from "react";
@@ -6009,16 +6195,6 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6009
6195
  return generatedGroupColumn;
6010
6196
  }
6011
6197
 
6012
- // src/components/InfiniteTable/utils/objectValuesExcept.ts
6013
- function objectValuesExcept(obj, exceptList) {
6014
- const result = [];
6015
- for (const k in obj)
6016
- if (obj.hasOwnProperty(k) && !exceptList.hasOwnProperty(k)) {
6017
- result.push(obj[k]);
6018
- }
6019
- return result;
6020
- }
6021
-
6022
6198
  // src/components/InfiniteTable/components/cell.css.ts
6023
6199
  var ColumnCellCls = "_1eexc2a7 _1eexc2a6";
6024
6200
  var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_1eexc2an", variantClassNames: { dragging: { false: "_1eexc2ao", true: "_1eexc2ap" }, insideDisabledDraggingPage: { true: "_1eexc2aq", false: "_1eexc2ar" }, cellSelected: { false: "_1eexc2as", true: "_1eexc2at" }, treeNode: { parent: "_1eexc2au", leaf: "_1eexc2av", false: "_1eexc2aw" }, align: { start: "_1eexc2ax", end: "_1eexc2ay", center: "_1eexc2az" }, verticalAlign: { start: "_1eexc2a10", end: "_1eexc2a11", center: "_1eexc2a12" }, rowActive: { false: "_1eexc2a13", true: "_1eexc2a14" }, groupRow: { false: "_1eexc2a15", true: "_1eexc2a16" }, groupCell: { false: "_1eexc2a17", true: "_1eexc2a18" }, rowDisabled: { false: "_1eexc2a19", true: "_1eexc2a1a" }, zebra: { false: "_1eexc2a1b", even: "_1eexc2a1c", odd: "_1eexc2a1d" }, rowSelected: { true: "_1eexc2a1e", false: "_1eexc2a1f", null: "_1eexc2a1g" }, first: { true: "_1eexc2a1h", false: "_1eexc2a1i" }, last: { true: "_1eexc2a1j", false: "_1eexc2a1k" }, groupByField: { true: "_1eexc2a1l", false: "_1eexc2a1m" }, firstInCategory: { true: "_1eexc2a1n", false: "_1eexc2a1o" }, firstRow: { true: "_1eexc2a1p", false: "_1eexc2a1q" }, firstRowInHorizontalLayoutPage: { true: "_1eexc2a1r", false: "_1eexc2a1s" }, lastInCategory: { true: "_1eexc2a1t", false: "_1eexc2a1u" }, pinned: { start: "_1eexc2a1v", end: "_1eexc2a1w", false: "_1eexc2a1x" }, filtered: { true: "_1eexc2a1y", false: "_1eexc2a1z" } }, defaultVariants: {}, compoundVariants: [[{ firstRowInHorizontalLayoutPage: true, firstRow: false }, "_1eexc2a20"], [{ pinned: "start", lastInCategory: true }, "_1eexc2a21"], [{ pinned: "start", firstInCategory: true }, "_1eexc2a22"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a23"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a24"], [{ align: "center", groupCell: false }, "_1eexc2a25"], [{ rowDisabled: true, zebra: "odd" }, "_1eexc2a26"]] });
@@ -6592,6 +6768,7 @@ import { useCallback as useCallback10, useRef as useRef9 } from "react";
6592
6768
  function InfiniteTableColumnEditor() {
6593
6769
  const { initialValue, setValue, confirmEdit, cancelEdit, readOnly } = useInfiniteColumnEditor();
6594
6770
  const domRef = useRef9(null);
6771
+ const cancelledRef = useRef9(false);
6595
6772
  const refCallback = React28.useCallback((node) => {
6596
6773
  domRef.current = node;
6597
6774
  if (node) {
@@ -6603,18 +6780,24 @@ function InfiniteTableColumnEditor() {
6603
6780
  if (key === "Enter" || key === "Tab") {
6604
6781
  confirmEdit();
6605
6782
  } else if (key === "Escape") {
6783
+ cancelledRef.current = true;
6606
6784
  cancelEdit();
6607
6785
  } else {
6608
6786
  event.stopPropagation();
6609
6787
  }
6610
6788
  }, []);
6789
+ const onBlur = useCallback10(() => {
6790
+ if (!cancelledRef.current) {
6791
+ confirmEdit();
6792
+ }
6793
+ }, []);
6611
6794
  return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
6612
6795
  "input",
6613
6796
  {
6614
6797
  readOnly,
6615
6798
  ref: refCallback,
6616
6799
  onKeyDown: onKeyDown2,
6617
- onBlur: () => confirmEdit(),
6800
+ onBlur,
6618
6801
  className: join(absoluteCover, outline.none),
6619
6802
  type: "text",
6620
6803
  defaultValue: initialValue,
@@ -6625,6 +6808,16 @@ function InfiniteTableColumnEditor() {
6625
6808
  ));
6626
6809
  }
6627
6810
 
6811
+ // src/components/InfiniteTable/utils/objectValuesExcept.ts
6812
+ function objectValuesExcept(obj, exceptList) {
6813
+ const result = [];
6814
+ for (const k in obj)
6815
+ if (obj.hasOwnProperty(k) && !exceptList.hasOwnProperty(k)) {
6816
+ result.push(obj[k]);
6817
+ }
6818
+ return result;
6819
+ }
6820
+
6628
6821
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
6629
6822
  var columnZIndexAtIndex3 = stripVar(InternalVars.columnZIndexAtIndex);
6630
6823
  var columnVisibilityAtIndex2 = stripVar(InternalVars.columnVisibilityAtIndex);
@@ -6719,7 +6912,8 @@ function applyColumnStyle(existingStyle, columnStyle, param) {
6719
6912
  }
6720
6913
  function InfiniteTableColumnCellFn(props) {
6721
6914
  const {
6722
- rowInfo,
6915
+ dataSourceStatePartialForCell,
6916
+ rowInfoStore,
6723
6917
  rowStyle,
6724
6918
  rowClassName,
6725
6919
  rowIndexInHorizontalLayoutPage,
@@ -6741,8 +6935,30 @@ function InfiniteTableColumnCellFn(props) {
6741
6935
  fieldsToColumn,
6742
6936
  domRef: initialDomRef,
6743
6937
  hidden,
6744
- showZebraRows
6938
+ showZebraRows,
6939
+ // DataSource context values passed as props
6940
+ getDataSourceState,
6941
+ dataSourceApi,
6942
+ dataSourceActions,
6943
+ // InfiniteTable context values passed as props
6944
+ getState,
6945
+ imperativeApi,
6946
+ componentActions,
6947
+ getComputed,
6948
+ getDataSourceMasterContext
6745
6949
  } = props;
6950
+ const rowInfoFromStore = useSyncExternalStore(
6951
+ useCallback12(
6952
+ (callback) => rowInfoStore.subscribeToRowIndex(rowIndex, callback),
6953
+ [rowInfoStore, rowIndex]
6954
+ ),
6955
+ useCallback12(
6956
+ () => rowInfoStore.getRowInfoAtIndex(rowIndex),
6957
+ [rowInfoStore, rowIndex]
6958
+ )
6959
+ );
6960
+ const isEmptyRowInfo = !rowInfoFromStore;
6961
+ const isEmptyColumn = !column;
6746
6962
  const htmlElementRef = React29.useRef(null);
6747
6963
  const domRef = useCallback12(
6748
6964
  (node) => {
@@ -6753,23 +6969,25 @@ function InfiniteTableColumnCellFn(props) {
6753
6969
  },
6754
6970
  [initialDomRef]
6755
6971
  );
6756
- if (!column) {
6757
- return /* @__PURE__ */ React29.createElement("div", { ref: domRef }, "no column");
6758
- }
6972
+ const rowInfo = rowInfoFromStore ?? {
6973
+ id: "",
6974
+ indexInAll: rowIndex,
6975
+ rowSelected: false,
6976
+ rowDisabled: false,
6977
+ isCellSelected: () => false,
6978
+ hasSelectedCells: () => false,
6979
+ isGroupRow: false,
6980
+ isTreeNode: false,
6981
+ isParentNode: false,
6982
+ treeNesting: 0,
6983
+ nodePath: [],
6984
+ collapsed: false,
6985
+ dataSourceHasGrouping: false,
6986
+ selfLoaded: true,
6987
+ data: {}
6988
+ };
6759
6989
  const { rowSelected } = rowInfo;
6760
- const {
6761
- getState,
6762
- actions: componentActions,
6763
- computed,
6764
- api: imperativeApi,
6765
- getDataSourceMasterContext
6766
- } = useInfiniteTable();
6767
- const {
6768
- componentState: dataSourceState,
6769
- getState: getDataSourceState,
6770
- api: dataSourceApi,
6771
- componentActions: dataSourceActions
6772
- } = useDataSourceContextValue();
6990
+ const computed = getComputed();
6773
6991
  const { activeRowIndex, keyboardNavigation, columnReorderInPageIndex } = getState();
6774
6992
  const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
6775
6993
  const renderingContext = {
@@ -6854,7 +7072,7 @@ function InfiniteTableColumnCellFn(props) {
6854
7072
  },
6855
7073
  [rowIndex, rowDisabled, column.computedVisibleIndex, keyboardNavigation]
6856
7074
  );
6857
- const { selectionMode, cellSelection, isNodeReadOnly: isNodeReadOnly2 } = dataSourceState;
7075
+ const { selectionMode, cellSelection, isNodeReadOnly: isNodeReadOnly2 } = dataSourceStatePartialForCell;
6858
7076
  const cellSelected = renderParam.cellSelected;
6859
7077
  renderParam.domRef = domRef;
6860
7078
  renderParam.htmlElementRef = htmlElementRef;
@@ -7213,6 +7431,9 @@ function InfiniteTableColumnCellFn(props) {
7213
7431
  renderChildren: useCallback12(() => theChildren, [renderChildren])
7214
7432
  };
7215
7433
  const ContextProvider = InfiniteTableColumnCellContext.Provider;
7434
+ if (isEmptyColumn || isEmptyRowInfo) {
7435
+ return /* @__PURE__ */ React29.createElement("div", { ref: domRef, style: { display: "none" } });
7436
+ }
7216
7437
  return (
7217
7438
  // this context is here for supporting useInfiniteColumnCell to be used
7218
7439
  // with a custom column component, specified via column.components.ColumnCell
@@ -8450,28 +8671,39 @@ import { useLayoutEffect as useLayoutEffect8, useMemo as useMemo6 } from "react"
8450
8671
  import * as React39 from "react";
8451
8672
  import { flushSync } from "react-dom";
8452
8673
  import { useLayoutEffect as useLayoutEffect7, useRef as useRef14, useState as useState12 } from "react";
8674
+ var SHOULD_FLUSH_SYNC = () => false;
8453
8675
  function AvoidReactDiffFn(props) {
8454
8676
  const [children, setChildren] = useState12(props.updater.get);
8455
8677
  const rafId = useRef14(null);
8678
+ const shouldFlushSync = props.shouldFlushSync ?? SHOULD_FLUSH_SYNC;
8456
8679
  useLayoutEffect7(() => {
8457
8680
  function onChange(children2) {
8681
+ let FLUSH_SYNC = shouldFlushSync();
8458
8682
  if (props.useraf) {
8459
8683
  if (rafId.current != null) {
8460
8684
  cancelAnimationFrame(rafId.current);
8461
8685
  }
8462
8686
  rafId.current = requestAnimationFrame(() => {
8687
+ if (FLUSH_SYNC) {
8688
+ queueMicrotask(() => {
8689
+ flushSync(() => {
8690
+ setChildren(children2);
8691
+ });
8692
+ });
8693
+ } else {
8694
+ setChildren(children2);
8695
+ }
8696
+ });
8697
+ } else {
8698
+ if (FLUSH_SYNC) {
8463
8699
  queueMicrotask(() => {
8464
8700
  flushSync(() => {
8465
8701
  setChildren(children2);
8466
8702
  });
8467
8703
  });
8468
- });
8469
- } else {
8470
- queueMicrotask(() => {
8471
- flushSync(() => {
8472
- setChildren(children2);
8473
- });
8474
- });
8704
+ } else {
8705
+ setChildren(children2);
8706
+ }
8475
8707
  }
8476
8708
  }
8477
8709
  const remove = props.updater.onChange(onChange);
@@ -8481,7 +8713,7 @@ function AvoidReactDiffFn(props) {
8481
8713
  }
8482
8714
  remove();
8483
8715
  };
8484
- }, [props.updater, props.useraf]);
8716
+ }, [props.updater, props.useraf, shouldFlushSync]);
8485
8717
  return children ?? null;
8486
8718
  }
8487
8719
  var AvoidReactDiff = React39.memo(AvoidReactDiffFn);
@@ -9810,14 +10042,26 @@ var GridCellForReact = class {
9810
10042
  constructor(debugId, cellInfo) {
9811
10043
  this.element = null;
9812
10044
  this.mounted = false;
10045
+ this.IS_UPDATED_WHILE_SCROLLING = false;
9813
10046
  this.mountSubscription = buildSubscriptionCallback();
10047
+ this.isUpdatedWhileScrolling = () => {
10048
+ return this.IS_UPDATED_WHILE_SCROLLING;
10049
+ };
9814
10050
  const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
9815
10051
  const key = `${debugId}:GridCellReact:${count}`;
9816
10052
  CELL_COUNT_BY_DEBUG_ID.set(debugId, count + 1);
9817
10053
  this.debugId = key;
9818
10054
  this.cellInfo = cellInfo;
9819
10055
  this.updater = buildSubscriptionCallback();
9820
- this.node = /* @__PURE__ */ React40.createElement(AvoidReactDiff, { key, name: key, updater: this.updater });
10056
+ this.node = /* @__PURE__ */ React40.createElement(
10057
+ AvoidReactDiff,
10058
+ {
10059
+ key,
10060
+ name: key,
10061
+ updater: this.updater,
10062
+ shouldFlushSync: this.isUpdatedWhileScrolling
10063
+ }
10064
+ );
9821
10065
  this.ref = (htmlElement) => {
9822
10066
  this.element = htmlElement;
9823
10067
  if (htmlElement) {
@@ -9849,7 +10093,8 @@ var GridCellForReact = class {
9849
10093
  getNode() {
9850
10094
  return this.node;
9851
10095
  }
9852
- update(content, additionalInfo) {
10096
+ update(content, additionalInfo, scrollingObjectParam) {
10097
+ this.IS_UPDATED_WHILE_SCROLLING = scrollingObjectParam ? scrollingObjectParam.scrolling : false;
9853
10098
  this.updater(content);
9854
10099
  this.cellInfo = additionalInfo;
9855
10100
  }
@@ -10141,14 +10386,14 @@ var GridCellManager = class extends Logger {
10141
10386
  }
10142
10387
  this.addCellToMatrix(cell, cellPos);
10143
10388
  }
10144
- renderNodeAtCell(node, cell, cellPos, additionalInfo) {
10389
+ renderNodeAtCell(node, cell, cellPos, additionalInfo, scrollingObjectParam) {
10145
10390
  const currentCellAtPos = this.getCellAt(cellPos);
10146
10391
  if (currentCellAtPos && currentCellAtPos !== cell) {
10147
10392
  this.detachCellAt(cellPos);
10148
10393
  }
10149
10394
  this.pool.attachCell(cell);
10150
10395
  this.setCellPositionInMatrix(cell, cellPos);
10151
- cell.update(node, additionalInfo);
10396
+ cell.update(node, additionalInfo, scrollingObjectParam);
10152
10397
  return cell;
10153
10398
  }
10154
10399
  getCellPosition(cell) {
@@ -10731,6 +10976,9 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
10731
10976
  var columnOffsetAtIndexWhileReordering2 = stripVar(
10732
10977
  InternalVars.columnOffsetAtIndexWhileReordering
10733
10978
  );
10979
+ var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
10980
+ scrolling: false
10981
+ };
10734
10982
  var GridRenderer = class extends Logger {
10735
10983
  constructor(brain, debugId) {
10736
10984
  debugId = debugId || "ReactHeadlessTableRenderer";
@@ -11169,6 +11417,14 @@ var GridRenderer = class extends Logger {
11169
11417
  const covered = coveredByAnotherRow || coveredByAnotherCol;
11170
11418
  return covered ? [rowspanParent, colspanParent] : false;
11171
11419
  };
11420
+ this.onMouseEnterNotBound = (event) => {
11421
+ const rowIndex = Number(event.target.dataset.rowIndex);
11422
+ this.onMouseEnter(rowIndex);
11423
+ };
11424
+ this.onMouseLeaveNotBound = (event) => {
11425
+ const rowIndex = Number(event.target.dataset.rowIndex);
11426
+ this.onMouseLeave(rowIndex);
11427
+ };
11172
11428
  this.onMouseEnter = (rowIndex) => {
11173
11429
  this.lastEnteredRow = rowIndex;
11174
11430
  this.lastExitedRow = -1;
@@ -11858,8 +12114,12 @@ var GridRenderer = class extends Logger {
11858
12114
  hidden,
11859
12115
  heightWithRowspan,
11860
12116
  widthWithColspan,
11861
- onMouseEnter: this.onMouseEnter.bind(null, rowIndex),
11862
- onMouseLeave: this.onMouseLeave.bind(null, rowIndex),
12117
+ // onMouseEnter: this.onMouseEnter.bind(null, rowIndex),
12118
+ onMouseEnter: this.onMouseEnterNotBound,
12119
+ //.bind(null, rowIndex),
12120
+ // onMouseLeave: this.onMouseLeave.bind(null, rowIndex),
12121
+ onMouseLeave: this.onMouseLeaveNotBound,
12122
+ //.bind(null, rowIndex),
11863
12123
  domRef: cell.ref
11864
12124
  });
11865
12125
  if (!cell.isMounted()) {
@@ -11885,11 +12145,13 @@ var GridRenderer = class extends Logger {
11885
12145
  }
11886
12146
  return;
11887
12147
  }
12148
+ SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
11888
12149
  this.cellManager.renderNodeAtCell(
11889
12150
  renderedNode,
11890
12151
  cell,
11891
12152
  [rowIndex, colIndex],
11892
- cellAdditionalInfo
12153
+ cellAdditionalInfo,
12154
+ SCROLLING_OBJECT_PARAM_FLYWEIGHT
11893
12155
  );
11894
12156
  this.updateElementPosition(cell, { hidden, rowspan, colspan });
11895
12157
  return;
@@ -18772,165 +19034,6 @@ function finishRowInfoReducersFor(params) {
18772
19034
  return results;
18773
19035
  }
18774
19036
 
18775
- // src/utils/devTools/devToolsTracks.ts
18776
- var DevToolsTracks = {
18777
- DataSource: {
18778
- track: "DataSource",
18779
- labels: {
18780
- RemoteDataLoad: "Remote data load",
18781
- TreeUnfilteredTreePaths: "Computing unfiltered tree paths",
18782
- Filter: "Filter",
18783
- Sort: "Sort",
18784
- Group: "Group",
18785
- LazyGroup: "Lazy group",
18786
- Tree: "Tree",
18787
- FlattenTree: "Flatten tree",
18788
- Flatten: "Flatten groups",
18789
- PrepareData: "Preparing data",
18790
- ComputeSelectionCount: "Computing selection count",
18791
- ComputeSelectionCountLazy: "Computing selection count (lazy)",
18792
- PrepareRowInfo: "Preparing row info array"
18793
- }
18794
- },
18795
- InfiniteTable: {
18796
- track: "InfiniteTable",
18797
- labels: {
18798
- Render: "Rendering"
18799
- }
18800
- },
18801
- MatrixBrain: {
18802
- track: "Layout Computations",
18803
- labels: {
18804
- ComputeRenderRange: "Computing render range"
18805
- }
18806
- }
18807
- };
18808
-
18809
- // src/utils/devTools/index.ts
18810
- var DevToolsMarker = class _DevToolsMarker {
18811
- constructor(debugId) {
18812
- this.debugId = debugId;
18813
- this.markerDetails = {
18814
- label: "",
18815
- track: "",
18816
- trackGroup: void 0,
18817
- color: void 0,
18818
- details: [],
18819
- tooltip: void 0
18820
- };
18821
- this.stopped = false;
18822
- this.start = (startDetails) => {
18823
- if (this.markerDetails.startTs) {
18824
- return this;
18825
- }
18826
- const start = performance.now();
18827
- this.markerDetails.details = startDetails?.details ?? [];
18828
- this.markerDetails.startTs = start;
18829
- return this;
18830
- };
18831
- this.end = (markerDetails = {}) => {
18832
- if (this.stopped) {
18833
- return this;
18834
- }
18835
- this.stopped = true;
18836
- const start = markerDetails.startTs ?? this.markerDetails.startTs;
18837
- const end = markerDetails.endTs ?? this.markerDetails.endTs ?? performance.now();
18838
- const color = markerDetails.color || this.markerDetails.color || "primary";
18839
- const trackGroup = markerDetails.trackGroup || this.markerDetails.trackGroup || `Infinite Table (${this.debugId})`;
18840
- const details = [
18841
- ...this.markerDetails.details || [],
18842
- ...markerDetails.details || []
18843
- ];
18844
- const tooltip = markerDetails.tooltip || this.markerDetails.tooltip;
18845
- const label = markerDetails.label || this.markerDetails.label || "Unknown";
18846
- const track = markerDetails.track || this.markerDetails.track || "Unknown";
18847
- performance.measure(label, {
18848
- start,
18849
- end,
18850
- detail: {
18851
- devtools: {
18852
- dataType: "track-entry",
18853
- trackGroup,
18854
- track,
18855
- color,
18856
- properties: details.length > 0 ? details.map((detail) => [detail.name, detail.value]) : void 0,
18857
- tooltipText: tooltip
18858
- }
18859
- }
18860
- });
18861
- return this;
18862
- };
18863
- this.debugId = debugId;
18864
- }
18865
- static create(debugId) {
18866
- return new _DevToolsMarker(debugId);
18867
- }
18868
- get startTimestamp() {
18869
- return this.markerDetails.startTs;
18870
- }
18871
- get track() {
18872
- const self = this;
18873
- return Object.keys(DevToolsTracks).reduce(
18874
- (acc, track) => {
18875
- const trackObj = {
18876
- start: self.start,
18877
- end: (markerDetails) => {
18878
- return self.end({
18879
- ...markerDetails,
18880
- track: DevToolsTracks[track].track,
18881
- label: markerDetails.label
18882
- });
18883
- },
18884
- get label() {
18885
- const currentTrack = DevToolsTracks[track];
18886
- return Object.keys(currentTrack.labels).reduce(
18887
- (labelAcc, label) => {
18888
- const labelObj = {
18889
- start: self.start,
18890
- end: (markerDetails) => {
18891
- return self.end({
18892
- ...markerDetails,
18893
- track: currentTrack.track,
18894
- label: currentTrack.labels[label]
18895
- });
18896
- }
18897
- };
18898
- Object.defineProperty(labelAcc, label, {
18899
- get: () => {
18900
- self.markerDetails.label = currentTrack.labels[label];
18901
- return labelObj;
18902
- }
18903
- });
18904
- return labelAcc;
18905
- },
18906
- {}
18907
- );
18908
- }
18909
- };
18910
- Object.defineProperty(acc, track, {
18911
- get: () => {
18912
- const currentTrack = DevToolsTracks[track];
18913
- self.markerDetails.track = currentTrack.track;
18914
- return trackObj;
18915
- }
18916
- });
18917
- return acc;
18918
- },
18919
- {}
18920
- );
18921
- }
18922
- };
18923
- function getMarker(debugId) {
18924
- return DevToolsMarker.create(debugId);
18925
- }
18926
-
18927
- // src/components/InfiniteTable/types/Utility.ts
18928
- function notNullable(value) {
18929
- if (value === null || value === void 0) return false;
18930
- const testDummyForCompileError = value;
18931
- return true;
18932
- }
18933
-
18934
19037
  // src/components/DataSource/state/reducer.ts
18935
19038
  function cleanupEmptyFilterValues(filterValue, filterTypes) {
18936
19039
  if (!filterValue) {
@@ -19708,6 +19811,9 @@ function concludeReducer(params) {
19708
19811
  treeMutations: treeMutations?.size ? treeMutations : void 0
19709
19812
  };
19710
19813
  }
19814
+ state.rowInfoStore.notifyDataArray(rowInfoDataArray, {
19815
+ marker: debugId ? getMarker(debugId).track.DataSource.label.DiffRowInfoInStore : void 0
19816
+ });
19711
19817
  if (rootMarker) {
19712
19818
  rootMarker?.track.DataSource.label.PrepareData.end({
19713
19819
  details: [
@@ -20562,6 +20668,279 @@ var normalizeSortInfo = (initialSortInfo, weakMap3) => {
20562
20668
  return result;
20563
20669
  };
20564
20670
 
20671
+ // src/components/DataSource/RowInfoStore.ts
20672
+ function deepEqual(a, b) {
20673
+ if (a === b) return true;
20674
+ if (a == null || b == null) return a === b;
20675
+ if (typeof a !== typeof b) return false;
20676
+ if (Array.isArray(a) && Array.isArray(b)) {
20677
+ if (a.length !== b.length) return false;
20678
+ for (let i = 0, len = a.length; i < len; i++) {
20679
+ if (!deepEqual(a[i], b[i])) return false;
20680
+ }
20681
+ return true;
20682
+ }
20683
+ if (typeof a === "object") {
20684
+ const keysA = Object.keys(a);
20685
+ const keysB = Object.keys(b);
20686
+ if (keysA.length !== keysB.length) return false;
20687
+ for (const key of keysA) {
20688
+ if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
20689
+ if (!deepEqual(a[key], b[key])) return false;
20690
+ }
20691
+ return true;
20692
+ }
20693
+ return false;
20694
+ }
20695
+ function isSameRowInfoType(one, two) {
20696
+ if (one === void 0 || two === void 0) return false;
20697
+ if (one.isGroupRow !== two.isGroupRow) return false;
20698
+ if (one.dataSourceHasGrouping !== two.dataSourceHasGrouping) return false;
20699
+ if (one.isTreeNode !== two.isTreeNode) return false;
20700
+ if (one.isTreeNode) {
20701
+ if (one.isParentNode !== two.isParentNode)
20702
+ return false;
20703
+ }
20704
+ return true;
20705
+ }
20706
+ var rowInfoBase_KeysRecord = {
20707
+ id: true,
20708
+ value: true,
20709
+ indexInAll: true,
20710
+ rowSelected: true,
20711
+ rowDisabled: true,
20712
+ isCellSelected: false,
20713
+ hasSelectedCells: false
20714
+ };
20715
+ var rowInfo_NoGrouping_RowInfoNormal_KeysRecord = {
20716
+ ...rowInfoBase_KeysRecord,
20717
+ dataSourceHasGrouping: true,
20718
+ isTreeNode: true,
20719
+ data: false,
20720
+ isGroupRow: true,
20721
+ selfLoaded: true
20722
+ };
20723
+ var rowInfo_HasGrouping_RowInfoBase_KeysRecord = {
20724
+ indexInGroup: true,
20725
+ groupKeys: true,
20726
+ groupBy: true,
20727
+ rootGroupBy: true,
20728
+ parents: false,
20729
+ indexInParentGroups: true,
20730
+ groupCount: true,
20731
+ groupNesting: true,
20732
+ collapsed: true,
20733
+ selfLoaded: true
20734
+ };
20735
+ var rowInfo_HasGrouping_RowInfoGroup_KeysRecord = {
20736
+ ...rowInfoBase_KeysRecord,
20737
+ ...rowInfo_HasGrouping_RowInfoBase_KeysRecord,
20738
+ dataSourceHasGrouping: true,
20739
+ isTreeNode: true,
20740
+ data: false,
20741
+ reducerData: true,
20742
+ isGroupRow: true,
20743
+ duplicateOf: false,
20744
+ deepRowInfoArray: false,
20745
+ error: true,
20746
+ reducerResults: true,
20747
+ groupCount: true,
20748
+ groupData: true,
20749
+ selectedChildredCount: true,
20750
+ deselectedChildredCount: true,
20751
+ totalChildrenCount: true,
20752
+ collapsedChildrenCount: true,
20753
+ collapsedGroupsCount: true,
20754
+ directChildrenCount: true,
20755
+ directChildrenLoadedCount: true,
20756
+ pivotValuesMap: true,
20757
+ childrenAvailable: true,
20758
+ childrenLoading: true
20759
+ };
20760
+ var rowInfo_Tree_RowInfoBase_KeysRecord = {
20761
+ isTreeNode: true,
20762
+ isParentNode: true,
20763
+ indexInParent: true,
20764
+ nodePath: true,
20765
+ parentNodes: false,
20766
+ indexInParentNodes: true,
20767
+ totalLeafNodesCount: true,
20768
+ collapsedLeafNodesCount: true,
20769
+ treeNesting: true,
20770
+ selfLoaded: true
20771
+ };
20772
+ var rowInfo_Tree_RowInfoLeafNode_KeysRecord = {
20773
+ ...rowInfoBase_KeysRecord,
20774
+ ...rowInfo_Tree_RowInfoBase_KeysRecord,
20775
+ dataSourceHasGrouping: true,
20776
+ isTreeNode: true,
20777
+ isGroupRow: true,
20778
+ isParentNode: true,
20779
+ data: false
20780
+ };
20781
+ var rowInfo_Tree_RowInfoParentNode_KeysRecord = {
20782
+ ...rowInfoBase_KeysRecord,
20783
+ ...rowInfo_Tree_RowInfoBase_KeysRecord,
20784
+ dataSourceHasGrouping: true,
20785
+ isParentNode: true,
20786
+ isGroupRow: true,
20787
+ nodeExpanded: true,
20788
+ selfExpanded: true,
20789
+ data: false,
20790
+ selectedLeafNodesCount: true,
20791
+ deepRowInfoArray: false,
20792
+ deselectedLeafNodesCount: true,
20793
+ duplicateOf: false
20794
+ };
20795
+ var rowInfoKeys_noGrouping = Object.entries(
20796
+ rowInfo_NoGrouping_RowInfoNormal_KeysRecord
20797
+ ).map(([key, value]) => value ? key : void 0).filter(Boolean);
20798
+ var rowInfoKeys_hasGrouping_normalRow = Object.entries(
20799
+ rowInfo_NoGrouping_RowInfoNormal_KeysRecord
20800
+ ).map(
20801
+ ([key, value]) => value ? key : void 0
20802
+ );
20803
+ var rowInfoKeys_hasGrouping_groupRow = Object.entries(
20804
+ rowInfo_HasGrouping_RowInfoGroup_KeysRecord
20805
+ ).map(
20806
+ ([key, value]) => value ? key : void 0
20807
+ );
20808
+ var rowInfoKeys_tree_leafNode = Object.entries(
20809
+ rowInfo_Tree_RowInfoLeafNode_KeysRecord
20810
+ ).map(
20811
+ ([key, value]) => value ? key : void 0
20812
+ );
20813
+ var rowInfoKeys_tree_parentNode = Object.entries(
20814
+ rowInfo_Tree_RowInfoParentNode_KeysRecord
20815
+ ).map(
20816
+ ([key, value]) => value ? key : void 0
20817
+ );
20818
+ function deepEqualRowInfo(oldRowInfo, newRowInfo) {
20819
+ if (oldRowInfo === newRowInfo) return true;
20820
+ if (!oldRowInfo || !newRowInfo) {
20821
+ return false;
20822
+ }
20823
+ if (!isSameRowInfoType(oldRowInfo, newRowInfo)) {
20824
+ return false;
20825
+ }
20826
+ if (oldRowInfo.id !== newRowInfo.id) return false;
20827
+ if (oldRowInfo.data !== newRowInfo.data) {
20828
+ if (!deepEqual(oldRowInfo.data, newRowInfo.data)) {
20829
+ return false;
20830
+ }
20831
+ }
20832
+ let allKeys = [];
20833
+ if (!oldRowInfo.dataSourceHasGrouping) {
20834
+ if (oldRowInfo.isTreeNode) {
20835
+ allKeys = oldRowInfo.isTreeNode && oldRowInfo.isParentNode ? rowInfoKeys_tree_parentNode : rowInfoKeys_tree_leafNode;
20836
+ } else {
20837
+ allKeys = rowInfoKeys_noGrouping;
20838
+ }
20839
+ } else {
20840
+ allKeys = oldRowInfo.isGroupRow ? rowInfoKeys_hasGrouping_groupRow : rowInfoKeys_hasGrouping_normalRow;
20841
+ }
20842
+ for (const key of allKeys) {
20843
+ const oldValue = oldRowInfo[key];
20844
+ const newValue = newRowInfo[key];
20845
+ if (typeof oldValue === "function" || typeof newValue === "function") {
20846
+ continue;
20847
+ }
20848
+ if (!deepEqual(oldValue, newValue)) {
20849
+ return false;
20850
+ }
20851
+ }
20852
+ return true;
20853
+ }
20854
+ function createRowInfoStore() {
20855
+ let dataArray = [];
20856
+ const subscribers = /* @__PURE__ */ new Map();
20857
+ const notifyDataArray = (newDataArray, params) => {
20858
+ const oldDataArray = dataArray;
20859
+ const marker = params?.marker;
20860
+ if (marker) {
20861
+ marker.start({
20862
+ details: [
20863
+ { name: "new dataArray length", value: newDataArray.length },
20864
+ {
20865
+ name: "old dataArray length",
20866
+ value: oldDataArray.length
20867
+ }
20868
+ ]
20869
+ });
20870
+ }
20871
+ const changedIndices = [];
20872
+ const subscribedRowIndexes = getSubscribedRowIndexes();
20873
+ for (const index of subscribedRowIndexes) {
20874
+ const oldRowInfo = oldDataArray[index];
20875
+ const newRowInfo = newDataArray[index];
20876
+ if (newRowInfo === void 0) {
20877
+ changedIndices.push(index);
20878
+ continue;
20879
+ }
20880
+ if (!deepEqualRowInfo(oldRowInfo, newRowInfo)) {
20881
+ changedIndices.push(index);
20882
+ }
20883
+ }
20884
+ dataArray = newDataArray;
20885
+ if (changedIndices.length > 0) {
20886
+ queueMicrotask(() => {
20887
+ console.log("notify", changedIndices);
20888
+ for (let i = 0, len = changedIndices.length; i < len; i++) {
20889
+ const index = changedIndices[i];
20890
+ const indexSubscribers = subscribers.get(index);
20891
+ if (indexSubscribers) {
20892
+ for (const callback of indexSubscribers) {
20893
+ callback();
20894
+ }
20895
+ }
20896
+ }
20897
+ });
20898
+ }
20899
+ if (marker) {
20900
+ marker.end({
20901
+ details: [{ name: "updated row infos", value: changedIndices.length }]
20902
+ });
20903
+ }
20904
+ };
20905
+ const getRowInfoAtIndex = (index) => {
20906
+ return dataArray[index];
20907
+ };
20908
+ const subscribeToRowIndex = (rowIndex, callback) => {
20909
+ let indexSubscribers = subscribers.get(rowIndex);
20910
+ if (!indexSubscribers) {
20911
+ indexSubscribers = /* @__PURE__ */ new Set();
20912
+ subscribers.set(rowIndex, indexSubscribers);
20913
+ }
20914
+ indexSubscribers.add(callback);
20915
+ return () => {
20916
+ const subs = subscribers.get(rowIndex);
20917
+ if (subs) {
20918
+ subs.delete(callback);
20919
+ if (subs.size === 0) {
20920
+ subscribers.delete(rowIndex);
20921
+ }
20922
+ }
20923
+ };
20924
+ };
20925
+ const getSubscribedRowIndexes = () => {
20926
+ return Array.from(subscribers.keys());
20927
+ };
20928
+ const getDataArray = () => {
20929
+ return dataArray;
20930
+ };
20931
+ const clear = () => {
20932
+ dataArray = [];
20933
+ subscribers.clear();
20934
+ };
20935
+ return {
20936
+ notifyDataArray,
20937
+ getRowInfoAtIndex,
20938
+ subscribeToRowIndex,
20939
+ getDataArray,
20940
+ clear
20941
+ };
20942
+ }
20943
+
20565
20944
  // src/components/DataSource/state/getInitialState.ts
20566
20945
  var defaultCursorId = Symbol("cursorId");
20567
20946
  var isNodeReadOnly = (rowInfo) => {
@@ -20581,6 +20960,7 @@ function initSetupState(props) {
20581
20960
  debugTimings: /* @__PURE__ */ new Map(),
20582
20961
  debugWarnings: /* @__PURE__ */ new Map(),
20583
20962
  devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
20963
+ rowInfoStore: createRowInfoStore(),
20584
20964
  // TODO cleanup indexer on unmount
20585
20965
  indexer: new Indexer(),
20586
20966
  totalLeafNodesCount: 0,
@@ -20681,6 +21061,7 @@ var cleanupDataSource = (state) => {
20681
21061
  state.treeSelectionState?.destroy();
20682
21062
  state.idToPathMap.clear();
20683
21063
  state.idToIndexMap.clear();
21064
+ state.rowInfoStore.clear();
20684
21065
  };
20685
21066
  var forwardProps3 = (setupState, props) => {
20686
21067
  return {
@@ -22392,6 +22773,9 @@ function isSortInfoForColumn(sortInfo, col) {
22392
22773
  }
22393
22774
  var InfiniteTableApiImpl = class {
22394
22775
  constructor(context) {
22776
+ this.getVisibleRenderRange = () => {
22777
+ return this.getState().brain.getRenderRange();
22778
+ };
22395
22779
  this.hideFilterOperatorMenu = () => {
22396
22780
  this.actions.filterOperatorMenuVisibleForColumnId = null;
22397
22781
  };
@@ -23238,7 +23622,9 @@ var InfiniteTableApiImpl = class {
23238
23622
  }
23239
23623
  set scrollLeft(scrollLeft2) {
23240
23624
  const state = this.getState();
23241
- state.scrollerDOMRef.current.scrollLeft = Math.max(scrollLeft2, 0);
23625
+ if (state.scrollerDOMRef.current) {
23626
+ state.scrollerDOMRef.current.scrollLeft = Math.max(scrollLeft2, 0);
23627
+ }
23242
23628
  }
23243
23629
  get scrollTop() {
23244
23630
  const state = this.getState();
@@ -23246,7 +23632,9 @@ var InfiniteTableApiImpl = class {
23246
23632
  }
23247
23633
  set scrollTop(scrollTop2) {
23248
23634
  const state = this.getState();
23249
- state.scrollerDOMRef.current.scrollTop = Math.max(scrollTop2, 0);
23635
+ if (state.scrollerDOMRef.current) {
23636
+ state.scrollerDOMRef.current.scrollTop = Math.max(scrollTop2, 0);
23637
+ }
23250
23638
  }
23251
23639
  scrollRowIntoView(rowIndex, config = { offset: 0 }) {
23252
23640
  const state = this.getState();
@@ -24125,12 +24513,14 @@ function initSetupState2({
24125
24513
  headerOnRenderUpdater
24126
24514
  } = createBrains(debugId, !!wrapRowsHorizontally);
24127
24515
  const domRef = createRef();
24516
+ const now = Date.now();
24128
24517
  return {
24129
24518
  debugWarnings: /* @__PURE__ */ new Map(),
24130
24519
  renderer,
24131
24520
  onRenderUpdater,
24132
24521
  headerRenderer,
24133
24522
  headerOnRenderUpdater,
24523
+ updatedAt: now,
24134
24524
  devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
24135
24525
  propsCache: /* @__PURE__ */ new Map([]),
24136
24526
  lastRowToCollapseRef: { current: null },
@@ -24417,6 +24807,7 @@ var mapPropsToState = (params) => {
24417
24807
  }
24418
24808
  const isRowDetailEnabled = !rowDetailRenderer ? false : props.isRowDetailEnabled || true;
24419
24809
  let result = {
24810
+ updatedAt: Date.now(),
24420
24811
  isTree: parentState.isTree,
24421
24812
  rowDetailRenderer,
24422
24813
  rowDetailState,
@@ -25637,7 +26028,7 @@ var useLicense = (licenseKey = "") => {
25637
26028
  }
25638
26029
  let valid2 = isValidLicense(licenseKey, {
25639
26030
  publishedAt: 1624970570587,
25640
- version: "7.4.1"
26031
+ version: "7.5.0-canary.0"
25641
26032
  });
25642
26033
  if (!licenseKey && !valid2 && isInsidePlayground) {
25643
26034
  return true;
@@ -29886,7 +30277,7 @@ var InfiniteTableDetailRow = React73.memo(
29886
30277
  var SCROLL_BOTTOM_OFFSET = 1;
29887
30278
  function useCellRendering(param) {
29888
30279
  const { computed, bodySize, imperativeApi } = param;
29889
- const { actions, state, getState } = useInfiniteTable();
30280
+ const { actions, state, getState, getComputed, getDataSourceMasterContext } = useInfiniteTable();
29890
30281
  const {
29891
30282
  computedPinnedStartColumns,
29892
30283
  computedPinnedEndColumns,
@@ -29905,7 +30296,13 @@ function useCellRendering(param) {
29905
30296
  componentActions: dataSourceActions,
29906
30297
  api: dataSourceApi
29907
30298
  } = useDataSourceContextValue();
29908
- const { dataArray, isNodeReadOnly: isNodeReadOnly2 } = dataSourceState;
30299
+ const {
30300
+ dataArray,
30301
+ rowInfoStore,
30302
+ selectionMode,
30303
+ cellSelection,
30304
+ isNodeReadOnly: isNodeReadOnly2
30305
+ } = dataSourceState;
29909
30306
  const getData = useLatest(dataArray);
29910
30307
  const {
29911
30308
  rowHeight,
@@ -29928,7 +30325,9 @@ function useCellRendering(param) {
29928
30325
  onScrollStop,
29929
30326
  scrollToBottomOffset,
29930
30327
  wrapRowsHorizontally,
29931
- ready
30328
+ updatedAt: componentStateUpdatedAt,
30329
+ ready,
30330
+ editingCell
29932
30331
  } = state;
29933
30332
  const repaintId = dataSourceState.updatedAt;
29934
30333
  useYourBrain({
@@ -30011,6 +30410,13 @@ function useCellRendering(param) {
30011
30410
  useEffect38(() => {
30012
30411
  rerender();
30013
30412
  }, [dataSourceState]);
30413
+ const dataSourceStatePartialForCell = useMemo17(() => {
30414
+ return {
30415
+ isNodeReadOnly: isNodeReadOnly2,
30416
+ selectionMode,
30417
+ cellSelection
30418
+ };
30419
+ }, [isNodeReadOnly2, selectionMode, cellSelection]);
30014
30420
  const renderCell = useCallback31(
30015
30421
  (params) => {
30016
30422
  const {
@@ -30041,6 +30447,10 @@ function useCellRendering(param) {
30041
30447
  }
30042
30448
  const rowIndexInHorizontalLayoutPage = wrapRowsHorizontally ? brain.getRowIndexInPage(rowIndex) : null;
30043
30449
  const horizontalLayoutPageIndex = wrapRowsHorizontally ? brain.getPageIndexForRow(rowIndex) : null;
30450
+ const inEditMode = imperativeApi.isEditorVisibleForCell({
30451
+ rowIndex,
30452
+ columnId: column.id
30453
+ });
30044
30454
  const cellProps = {
30045
30455
  getData,
30046
30456
  virtualized: true,
@@ -30049,7 +30459,7 @@ function useCellRendering(param) {
30049
30459
  rowIndexInHorizontalLayoutPage,
30050
30460
  horizontalLayoutPageIndex,
30051
30461
  rowIndex,
30052
- rowInfo,
30462
+ rowInfoStore,
30053
30463
  hidden,
30054
30464
  toggleGroupRow,
30055
30465
  rowHeight: rowHeight2,
@@ -30066,7 +30476,21 @@ function useCellRendering(param) {
30066
30476
  rowStyle,
30067
30477
  rowClassName,
30068
30478
  cellStyle,
30069
- cellClassName
30479
+ cellClassName,
30480
+ // Whether this specific cell is in edit mode
30481
+ // Passed as prop to trigger re-render when editing state changes
30482
+ inEditMode,
30483
+ // DataSource context values passed as props to avoid context re-renders
30484
+ getDataSourceState,
30485
+ dataSourceApi,
30486
+ dataSourceActions,
30487
+ // InfiniteTable context values passed as props to avoid context re-renders
30488
+ getState,
30489
+ imperativeApi,
30490
+ componentActions: actions,
30491
+ getComputed,
30492
+ getDataSourceMasterContext,
30493
+ dataSourceStatePartialForCell
30070
30494
  };
30071
30495
  return /* @__PURE__ */ React74.createElement(InfiniteTableColumnCell, { ...cellProps });
30072
30496
  },
@@ -30088,11 +30512,22 @@ function useCellRendering(param) {
30088
30512
  showZebraRows,
30089
30513
  brain,
30090
30514
  repaintId,
30091
- isNodeReadOnly2,
30515
+ rowInfoStore,
30092
30516
  rowStyle,
30093
30517
  rowClassName,
30094
30518
  cellClassName,
30095
- cellStyle
30519
+ cellStyle,
30520
+ getDataSourceState,
30521
+ dataSourceApi,
30522
+ dataSourceActions,
30523
+ getState,
30524
+ imperativeApi,
30525
+ actions,
30526
+ getComputed,
30527
+ getDataSourceMasterContext,
30528
+ componentStateUpdatedAt,
30529
+ editingCell,
30530
+ dataSourceStatePartialForCell
30096
30531
  ]
30097
30532
  );
30098
30533
  const renderDetailRow = useMemo17(() => {
@@ -30439,7 +30874,7 @@ var InfiniteTableComponent = React78.memo(
30439
30874
  if (false) {
30440
30875
  globalThis.infiniteApi = context.api;
30441
30876
  }
30442
- }, [componentState.ready]);
30877
+ }, [componentState.ready, context.api]);
30443
30878
  const debugId = useDebugMode();
30444
30879
  React78.useEffect(() => {
30445
30880
  if (masterContext) {