@infinite-table/infinite-react 0.3.15 → 0.3.16

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.js CHANGED
@@ -666,7 +666,7 @@ function debounce(fn, { wait }) {
666
666
 
667
667
  // src/components/InfiniteTable/index.tsx
668
668
  var React36 = __toModule(require("react"));
669
- var import_react49 = __toModule(require("react"));
669
+ var import_react50 = __toModule(require("react"));
670
670
 
671
671
  // src/utils/join.ts
672
672
  var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
@@ -1092,8 +1092,8 @@ function stripVar(cssVariableWithVarString) {
1092
1092
  }
1093
1093
 
1094
1094
  // src/components/InfiniteTable/theme.css.ts
1095
- var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)", scrollLeftForActiveCell: "var(--_1slvgu97)", scrollTopForActiveCell: "var(--_1slvgu98)", activeCellColWidth: "var(--_1slvgu99)", activeCellColOffset: "var(--_1slvgu9a)", columnWidthAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndex: "var(--_1slvgu9c)" };
1096
- var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { draggingBackground: "var(--infinite-header-cell-dragging-background)", background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
1095
+ var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)", scrollTopForActiveRow: "var(--_1slvgu97)", activeCellColWidth: "var(--_1slvgu98)", activeCellColOffset: "var(--_1slvgu99)", columnWidthAtIndex: "var(--_1slvgu9a)", columnOffsetAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndexWhileReordering: "var(--_1slvgu9c)", columnZIndexAtIndex: "var(--_1slvgu9d)", computedVisibleColumnsCount: "var(--_1slvgu9e)", baseZIndexForCells: "var(--_1slvgu9f)" };
1096
+ var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
1097
1097
  var columnHeaderHeightName = "column-header-height";
1098
1098
 
1099
1099
  // src/utils/selectParent.ts
@@ -1123,6 +1123,8 @@ function getParentInfiniteNode(node) {
1123
1123
  }
1124
1124
  var columnWidthAtIndex = stripVar(InternalVars.columnWidthAtIndex);
1125
1125
  var columnOffsetAtIndex = stripVar(InternalVars.columnOffsetAtIndex);
1126
+ var columnOffsetAtIndexWhileReordering = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
1127
+ var columnZIndexAtIndex = stripVar(InternalVars.columnZIndexAtIndex);
1126
1128
  function setInfiniteVarOnRoot(varName, varValue, node) {
1127
1129
  const infinite = node ? getParentInfiniteNode(node) : document.querySelector(InfiniteSelector);
1128
1130
  setInfiniteVarOnNode(varName, varValue, infinite);
@@ -1146,6 +1148,12 @@ function setInfiniteColumnWidth(colIndex, colWidth, node) {
1146
1148
  function setInfiniteColumnOffset(colIndex, colOffset, node) {
1147
1149
  setInfiniteVarOnRoot(`${columnOffsetAtIndex}-${colIndex}`, typeof colOffset === "number" ? colOffset + "px" : colOffset, node);
1148
1150
  }
1151
+ function setInfiniteColumnZIndex(colIndex, colZIndex, node) {
1152
+ setInfiniteVarOnRoot(`${columnZIndexAtIndex}-${colIndex}`, `${colZIndex}`, node);
1153
+ }
1154
+ function setInfiniteColumnOffsetWhileReordering(colIndex, offset, node) {
1155
+ setInfiniteVarOnRoot(`${columnOffsetAtIndexWhileReordering}-${colIndex}`, typeof offset === "number" ? `calc( var(${columnOffsetAtIndex}-${colIndex}) + ${offset}px )` : offset, node);
1156
+ }
1149
1157
  function getCSSVarNameForColWidth(colIndex) {
1150
1158
  return `${columnWidthAtIndex}-${colIndex}`;
1151
1159
  }
@@ -1445,6 +1453,36 @@ var MatrixBrain = class extends Logger {
1445
1453
  renderCount = Math.min(count, renderCount);
1446
1454
  return renderCount;
1447
1455
  };
1456
+ this.isColFixedEnd = (colIndex) => {
1457
+ if (!this.fixedColsEnd) {
1458
+ return false;
1459
+ }
1460
+ return colIndex >= this.cols - this.fixedColsEnd;
1461
+ };
1462
+ this.isColFixedStart = (colIndex) => {
1463
+ if (!this.fixedColsStart) {
1464
+ return false;
1465
+ }
1466
+ return colIndex < this.fixedColsStart;
1467
+ };
1468
+ this.isRowFixedEnd = (rowIndex) => {
1469
+ if (!this.fixedRowsEnd) {
1470
+ return false;
1471
+ }
1472
+ return rowIndex >= this.rows - this.fixedRowsEnd;
1473
+ };
1474
+ this.isRowFixedStart = (rowIndex) => {
1475
+ if (!this.fixedRowsStart) {
1476
+ return false;
1477
+ }
1478
+ return rowIndex < this.fixedRowsStart;
1479
+ };
1480
+ this.isColFixed = (colIndex) => {
1481
+ return this.isColFixedStart(colIndex) || this.isColFixedEnd(colIndex);
1482
+ };
1483
+ this.isRowFixed = (rowIndex) => {
1484
+ return this.isRowFixedStart(rowIndex) || this.isRowFixedEnd(rowIndex);
1485
+ };
1448
1486
  this.getFixedEndColsWidth = () => {
1449
1487
  if (!this.fixedColsEnd) {
1450
1488
  return 0;
@@ -2624,7 +2662,8 @@ var MappedCells = class extends Logger {
2624
2662
  // src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx
2625
2663
  var ITEM_POSITION_WITH_TRANSFORM = true;
2626
2664
  var currentColumnTransformY = stripVar(InternalVars.currentColumnTransformY);
2627
- var columnTransformX = stripVar(InternalVars.columnOffsetAtIndex);
2665
+ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
2666
+ var columnOffsetAtIndexWhileReordering2 = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
2628
2667
  var ReactHeadlessTableRenderer = class extends Logger {
2629
2668
  constructor(brain) {
2630
2669
  super("ReactHeadlessTableRenderer");
@@ -2639,14 +2678,17 @@ var ReactHeadlessTableRenderer = class extends Logger {
2639
2678
  this.currentHoveredRow = -1;
2640
2679
  this.hoverRowUpdatesInProgress = new Map();
2641
2680
  this.infiniteNode = null;
2642
- this.setTransform = (element, _rowIndex, colIndex, x, y) => {
2643
- const transformXVar = `${columnTransformX}-${colIndex}`;
2681
+ this.setTransform = (element, _rowIndex, colIndex, x, y, zIndex2) => {
2682
+ const columnOffsetX = `${columnOffsetAtIndex2}-${colIndex}`;
2683
+ const columnOffsetXWhileReordering = `${columnOffsetAtIndexWhileReordering2}-${colIndex}`;
2644
2684
  if (!this.infiniteNode) {
2645
2685
  this.infiniteNode = getParentInfiniteNode(element);
2646
2686
  }
2647
- this.infiniteNode.style.setProperty(transformXVar, `${x}px`);
2687
+ this.infiniteNode.style.setProperty(columnOffsetX, `${x}px`);
2648
2688
  element.style.setProperty(currentColumnTransformY, `${y}px`);
2649
- element.style.transform = `translate3d(var(${transformXVar}), ${InternalVars.currentColumnTransformY}, 0)`;
2689
+ element.style.transform = `translate3d(var(${columnOffsetXWhileReordering}, var(${columnOffsetX})), ${InternalVars.currentColumnTransformY}, 0)`;
2690
+ if (zIndex2 != null) {
2691
+ }
2650
2692
  };
2651
2693
  this.getFullyVisibleRowsRange = () => {
2652
2694
  let {
@@ -2676,21 +2718,26 @@ var ReactHeadlessTableRenderer = class extends Logger {
2676
2718
  }
2677
2719
  const rowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
2678
2720
  const rowHeight = brain.getItemSize(rowIndex, "vertical");
2721
+ const fixedStartRowsHeight = brain.getFixedStartRowsHeight();
2722
+ const fixedEndRowsHeight = brain.getFixedEndRowsHeight();
2679
2723
  const top2 = scrollPosition.scrollTop;
2680
2724
  const availableSize = brain.getAvailableSize();
2725
+ if (!availableSize.height) {
2726
+ return null;
2727
+ }
2681
2728
  const bottom = top2 + availableSize.height;
2682
2729
  if (!scrollAdjustPosition) {
2683
- scrollAdjustPosition = rowOffset > bottom ? "end" : rowOffset < top2 ? "start" : "end";
2730
+ scrollAdjustPosition = rowOffset > bottom - fixedEndRowsHeight ? "end" : rowOffset < top2 + fixedStartRowsHeight ? "start" : "end";
2684
2731
  }
2685
2732
  let scrollTop = scrollPosition.scrollTop;
2686
2733
  if (scrollAdjustPosition === "center") {
2687
- scrollTop = rowOffset - Math.floor(brain.getAvailableSize().height / 2);
2734
+ scrollTop = rowOffset - Math.floor((brain.getAvailableSize().height - fixedStartRowsHeight - fixedEndRowsHeight) / 2);
2688
2735
  } else if (scrollAdjustPosition === "start") {
2689
2736
  offset = -offset;
2690
- scrollTop += rowOffset - top2 + offset;
2737
+ scrollTop += rowOffset - top2 + offset - fixedStartRowsHeight;
2691
2738
  } else {
2692
2739
  offset += rowHeight;
2693
- scrollTop += rowOffset - bottom + offset;
2740
+ scrollTop += rowOffset - bottom + offset + fixedEndRowsHeight;
2694
2741
  }
2695
2742
  return __spreadProps(__spreadValues({}, scrollPosition), {
2696
2743
  scrollTop
@@ -2703,37 +2750,47 @@ var ReactHeadlessTableRenderer = class extends Logger {
2703
2750
  if (this.isColumnFullyVisible(colIndex) && !scrollAdjustPosition) {
2704
2751
  return scrollPosition;
2705
2752
  }
2706
- const rowOffset = brain.getItemOffsetFor(colIndex, "horizontal");
2753
+ const colOffset = brain.getItemOffsetFor(colIndex, "horizontal");
2707
2754
  const colWidth = brain.getItemSize(colIndex, "horizontal");
2755
+ const fixedStartColsWidth = brain.getFixedStartColsWidth();
2756
+ const fixedEndColsWidth = brain.getFixedStartColsWidth();
2708
2757
  const left2 = scrollPosition.scrollLeft;
2709
2758
  const availableSize = brain.getAvailableSize();
2759
+ if (!availableSize.width) {
2760
+ return null;
2761
+ }
2710
2762
  const right = left2 + availableSize.width;
2711
2763
  if (!scrollAdjustPosition) {
2712
- scrollAdjustPosition = rowOffset > right ? "end" : rowOffset < left2 ? "start" : "end";
2764
+ scrollAdjustPosition = colOffset > right - fixedEndColsWidth ? "end" : colOffset < left2 + fixedStartColsWidth ? "start" : "end";
2713
2765
  }
2714
2766
  let scrollLeft = scrollPosition.scrollLeft;
2715
2767
  if (scrollAdjustPosition === "center") {
2716
- scrollLeft = rowOffset - Math.floor(brain.getAvailableSize().width / 2);
2768
+ scrollLeft = colOffset - Math.floor((brain.getAvailableSize().width - fixedStartColsWidth - fixedEndColsWidth) / 2);
2717
2769
  } else if (scrollAdjustPosition === "start") {
2718
2770
  offset = -offset;
2719
- scrollLeft += rowOffset - left2 + offset;
2771
+ scrollLeft += colOffset - left2 + offset - fixedStartColsWidth;
2720
2772
  } else {
2721
2773
  offset += colWidth;
2722
- scrollLeft += rowOffset - right + offset;
2774
+ scrollLeft += colOffset - right + offset + fixedEndColsWidth;
2723
2775
  }
2724
2776
  return __spreadProps(__spreadValues({}, scrollPosition), {
2725
2777
  scrollLeft
2726
2778
  });
2727
2779
  };
2728
2780
  this.getScrollPositionForScrollCellIntoView = (rowIndex, colIndex, config = { offsetLeft: 0, offsetTop: 0 }) => {
2729
- const { scrollLeft } = this.getScrollPositionForScrollColumnIntoView(colIndex, {
2781
+ const scrollPosForCol = this.getScrollPositionForScrollColumnIntoView(colIndex, {
2730
2782
  scrollAdjustPosition: config.colScrollAdjustPosition || config.scrollAdjustPosition,
2731
2783
  offset: config.offsetLeft
2732
2784
  });
2733
- const { scrollTop } = this.getScrollPositionForScrollRowIntoView(rowIndex, {
2785
+ const scrollPosForRow = this.getScrollPositionForScrollRowIntoView(rowIndex, {
2734
2786
  scrollAdjustPosition: config.rowScrollAdjustPosition || config.scrollAdjustPosition,
2735
2787
  offset: config.offsetTop
2736
2788
  });
2789
+ if (!scrollPosForCol || !scrollPosForRow) {
2790
+ return null;
2791
+ }
2792
+ const { scrollLeft } = scrollPosForCol;
2793
+ const { scrollTop } = scrollPosForRow;
2737
2794
  return { scrollLeft, scrollTop };
2738
2795
  };
2739
2796
  this.isRowFullyVisible = (rowIndex, offsetMargin = 2) => {
@@ -2744,6 +2801,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
2744
2801
  return false;
2745
2802
  }
2746
2803
  const { brain } = this;
2804
+ if (brain.isRowFixed(rowIndex)) {
2805
+ return true;
2806
+ }
2747
2807
  const {
2748
2808
  start: [startRow],
2749
2809
  end: [endRow]
@@ -2783,23 +2843,26 @@ var ReactHeadlessTableRenderer = class extends Logger {
2783
2843
  return false;
2784
2844
  }
2785
2845
  const { brain } = this;
2846
+ if (brain.isColFixed(colIndex)) {
2847
+ return true;
2848
+ }
2786
2849
  const {
2787
2850
  start: [_, startCol],
2788
2851
  end: [__, endCol]
2789
2852
  } = brain.getRenderRange();
2790
- const midCol = Math.floor((startCol + endCol) / 2);
2791
2853
  if (colIndex < startCol) {
2792
2854
  return false;
2793
2855
  }
2794
2856
  if (colIndex >= endCol) {
2795
2857
  return false;
2796
2858
  }
2859
+ const midCol = Math.floor((startCol + endCol) / 2);
2797
2860
  if (colIndex >= midCol) {
2798
- const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin, "horizontal");
2861
+ const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin - brain.getFixedEndColsWidth(), "horizontal");
2799
2862
  return colIndex <= lastVisibleCol;
2800
2863
  }
2801
2864
  if (colIndex < midCol) {
2802
- const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin, "horizontal");
2865
+ const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin + brain.getFixedStartColsWidth(), "horizontal");
2803
2866
  return colIndex >= firstVisibleCol;
2804
2867
  }
2805
2868
  return true;
@@ -3142,7 +3205,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3142
3205
  itemElement.dataset.rowIndex = rowIndex;
3143
3206
  itemElement.dataset.colIndex = colIndex;
3144
3207
  if (ITEM_POSITION_WITH_TRANSFORM) {
3145
- this.setTransform(itemElement, rowIndex, colIndex, x, y);
3208
+ this.setTransform(itemElement, rowIndex, colIndex, x, y, null);
3146
3209
  itemElement.style.willChange = "transform";
3147
3210
  itemElement.style.backfaceVisibility = "hidden";
3148
3211
  const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
@@ -3188,37 +3251,29 @@ var ReactHeadlessTableRenderer = class extends Logger {
3188
3251
  }
3189
3252
  }
3190
3253
  const adjustColStart = (_rowIndex, colIndex, node, { x, y }, { scrollLeft }) => {
3191
- node.style.zIndex = `${fixedColsStart - colIndex}`;
3192
- this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y);
3254
+ this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y, fixedColsStart - colIndex);
3193
3255
  };
3194
3256
  const adjustRowStart = (rowIndex, _colIndex, node, coords, scrollPosition2) => {
3195
- node.style.zIndex = `${fixedRowsStart - rowIndex}`;
3196
- this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop);
3257
+ this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop, fixedRowsStart - rowIndex);
3197
3258
  };
3198
3259
  const adjustColEnd = (_rowIndex, colIndex, node, { y }) => {
3199
- node.style.zIndex = `${cols - colIndex}`;
3200
3260
  const val = fixedEndColsOffsets[colIndex];
3201
- this.setTransform(node, _rowIndex, colIndex, val, y);
3261
+ this.setTransform(node, _rowIndex, colIndex, val, y, cols - colIndex);
3202
3262
  };
3203
3263
  const adjustRowEnd = (rowIndex, _colIndex, node, coords) => {
3204
- node.style.zIndex = `${rows - rowIndex}`;
3205
- this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex]);
3264
+ this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex], rows - rowIndex);
3206
3265
  };
3207
3266
  const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }, scrollPosition2) => {
3208
- node.style.zIndex = `1000000`;
3209
- this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop);
3267
+ this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop, 1e5);
3210
3268
  };
3211
3269
  const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }, scrollPosition2) => {
3212
- node.style.zIndex = `2000000`;
3213
- this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex]);
3270
+ this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex], 2e5);
3214
3271
  };
3215
3272
  const adjustColEndRowStart = (_rowIndex, colIndex, node, coords) => {
3216
- node.style.zIndex = `3000000`;
3217
- this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop);
3273
+ this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop, 3e5);
3218
3274
  };
3219
3275
  const adjustColEndRowEnd = (rowIndex, colIndex, node) => {
3220
- node.style.zIndex = `4000000`;
3221
- this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex]);
3276
+ this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex], 4e5);
3222
3277
  };
3223
3278
  if (fixedColsStart || fixedColsEnd) {
3224
3279
  for (let rowIndex = startRow; rowIndex < endRow; rowIndex++) {
@@ -3451,39 +3506,43 @@ var useRerender = () => {
3451
3506
  };
3452
3507
 
3453
3508
  // src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
3454
- var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwx _16lm1iwv", hidden: "nxbq1c3 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwx _16lm1iwv" };
3455
- var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwx _16lm1iwv _16lm1iwr";
3509
+ var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx", hidden: "nxbq1c3 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx" };
3510
+ var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx _16lm1iwt _16lm1iwn";
3456
3511
 
3457
3512
  // src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
3458
- var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iwu _16lm1iwv _16lm1iwx", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iwu _16lm1iwv _16lm1iwx" };
3513
+ var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz" };
3459
3514
 
3460
3515
  // src/components/InfiniteTable/components/ActiveRowIndicator.tsx
3461
3516
  var { rootClassName: rootClassName3 } = internalProps;
3462
3517
  var baseCls = `${rootClassName3}-ActiveRowIndicator`;
3518
+ var ActiveStyle = {
3519
+ [stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
3520
+ transform: `translate3d(0px, calc( ${InternalVars.activeCellOffsetY} + ${InternalVars.scrollTopForActiveRow}), 0px)`,
3521
+ height: InternalVars.activeCellRowHeight
3522
+ };
3463
3523
  var ActiveRowIndicatorFn = (props) => {
3464
3524
  const { brain } = props;
3465
- const [state, setState] = (0, import_react9.useState)({
3466
- top: 0,
3467
- rowHeight: 0
3468
- });
3469
3525
  const domRef = (0, import_react9.useRef)(null);
3470
- const stateRef = (0, import_react9.useRef)(state);
3471
3526
  const active = props.activeRowIndex != null && brain.getRowCount() > props.activeRowIndex;
3472
- const [rerenderId, rerender] = useRerender();
3527
+ const [_rerenderId, rerender] = useRerender();
3473
3528
  (0, import_react9.useLayoutEffect)(() => {
3474
3529
  if (props.activeRowIndex == null) {
3475
3530
  return;
3476
3531
  }
3477
- setState(stateRef.current = {
3478
- top: brain.getItemOffsetFor(props.activeRowIndex, "vertical"),
3479
- rowHeight: brain.getRowHeight(props.activeRowIndex)
3480
- });
3481
- }, [props.activeRowIndex, rerenderId]);
3532
+ const rowIndex = props.activeRowIndex;
3533
+ const activeCellRowHeight = brain.getRowHeight(rowIndex);
3534
+ const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
3535
+ const node = domRef.current;
3536
+ setInfiniteVarsOnNode({
3537
+ activeCellRowHeight: `${activeCellRowHeight}px`,
3538
+ activeCellRowOffset: `${activeCellRowOffset}px`
3539
+ }, node);
3540
+ }, [props.activeRowIndex]);
3482
3541
  (0, import_react9.useEffect)(() => {
3483
- const removeOnScroll = brain.onScroll((scrollPos) => {
3484
- const node = domRef.current;
3485
- const topOffset = stateRef.current.top;
3486
- node.style.transform = `translate3d(0px, ${-scrollPos.scrollTop + topOffset}px, 0px)`;
3542
+ const removeOnScroll = brain.onScroll((scrollPosition) => {
3543
+ setInfiniteVarsOnNode({
3544
+ scrollTopForActiveRow: `${-scrollPosition.scrollTop}px`
3545
+ }, domRef.current);
3487
3546
  });
3488
3547
  const removeOnRenderCountChange = brain.onRenderCountChange(rerender);
3489
3548
  return () => {
@@ -3498,10 +3557,7 @@ var ActiveRowIndicatorFn = (props) => {
3498
3557
  ref: domRef,
3499
3558
  "data-name": "active-row-indicator",
3500
3559
  className: `${baseCls} ${active ? ActiveRowIndicatorCls.visible : ActiveRowIndicatorCls.hidden}`,
3501
- style: active ? {
3502
- transform: `translate3d(0px, ${-brain.getScrollPosition().scrollTop + state.top}px,0)`,
3503
- height: state.rowHeight
3504
- } : void 0
3560
+ style: active ? ActiveStyle : void 0
3505
3561
  }));
3506
3562
  };
3507
3563
  var ActiveRowIndicator = React10.memo(ActiveRowIndicatorFn);
@@ -3511,9 +3567,10 @@ var React11 = __toModule(require("react"));
3511
3567
  var import_react10 = __toModule(require("react"));
3512
3568
  var { rootClassName: rootClassName4 } = internalProps;
3513
3569
  var baseCls2 = `${rootClassName4}-ActiveCellIndicator`;
3514
- var ActiveStyle = {
3515
- [stripVar(InternalVars.activeCellOffsetX)]: `calc( ${InternalVars.scrollLeftForActiveCell} + ${InternalVars.activeCellColOffset} )`,
3516
- [stripVar(InternalVars.activeCellOffsetY)]: `calc( ${InternalVars.scrollTopForActiveCell} + ${InternalVars.activeCellRowOffset} )`,
3570
+ var columnZIndexAtIndex2 = stripVar(InternalVars.columnZIndexAtIndex);
3571
+ var ActiveStyle2 = {
3572
+ [stripVar(InternalVars.activeCellOffsetX)]: InternalVars.activeCellColOffset,
3573
+ [stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
3517
3574
  transform: `translate3d(${InternalVars.activeCellOffsetX}, ${InternalVars.activeCellOffsetY}, 0px)`,
3518
3575
  width: InternalVars.activeCellColWidth,
3519
3576
  height: InternalVars.activeCellRowHeight
@@ -3531,37 +3588,30 @@ var ActiveCellIndicatorFn = (props) => {
3531
3588
  const activeCellRowHeight = brain.getRowHeight(rowIndex);
3532
3589
  const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
3533
3590
  const node = domRef.current;
3534
- const scrollPosition = brain.getScrollPosition();
3535
3591
  setInfiniteVarsOnNode({
3536
- scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
3537
- scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`,
3538
3592
  activeCellRowHeight: `${activeCellRowHeight}px`,
3539
3593
  activeCellRowOffset: `${activeCellRowOffset}px`
3540
3594
  }, node);
3541
3595
  }, [props.activeCellIndex]);
3542
3596
  (0, import_react10.useEffect)(() => {
3543
- const removeOnSCroll = brain.onScroll((scrollPosition) => {
3544
- setInfiniteVarsOnNode({
3545
- scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
3546
- scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`
3547
- }, domRef.current);
3548
- });
3549
3597
  const removeOnRenderCountChange = brain.onRenderCountChange(() => {
3550
3598
  rerender();
3551
3599
  });
3552
3600
  return () => {
3553
3601
  removeOnRenderCountChange();
3554
- removeOnSCroll();
3555
3602
  };
3556
3603
  }, [brain]);
3557
3604
  return /* @__PURE__ */ React11.createElement("div", {
3558
3605
  className: ActiveIndicatorWrapperCls,
3559
- "data-name": "active-cell"
3606
+ "data-name": "active-cell",
3607
+ style: active ? {
3608
+ zIndex: `var(${columnZIndexAtIndex2}-${props.activeCellIndex[1]})`
3609
+ } : void 0
3560
3610
  }, /* @__PURE__ */ React11.createElement("div", {
3561
3611
  ref: domRef,
3562
3612
  "data-name": "active-cell-indicator",
3563
3613
  className: `${baseCls2} ${active ? ActiveCellIndicatorCls.visible : ActiveCellIndicatorCls.hidden}`,
3564
- style: active ? ActiveStyle : void 0
3614
+ style: active ? ActiveStyle2 : void 0
3565
3615
  }));
3566
3616
  };
3567
3617
  var ActiveCellIndicator = React11.memo(ActiveCellIndicatorFn);
@@ -3661,12 +3711,12 @@ function HeadlessTable(props) {
3661
3711
  renderCell,
3662
3712
  brain,
3663
3713
  cellHoverClassNames
3664
- })), /* @__PURE__ */ React12.createElement(ActiveRowIndicator, {
3665
- brain,
3666
- activeRowIndex
3667
3714
  }), /* @__PURE__ */ React12.createElement(ActiveCellIndicator, {
3668
3715
  brain,
3669
3716
  activeCellIndex
3717
+ })), /* @__PURE__ */ React12.createElement(ActiveRowIndicator, {
3718
+ brain,
3719
+ activeRowIndex
3670
3720
  }), /* @__PURE__ */ React12.createElement(SpacePlaceholder, {
3671
3721
  width: scrollSize.width,
3672
3722
  height: scrollSize.height
@@ -3984,20 +4034,20 @@ var useInternalProps = () => {
3984
4034
  };
3985
4035
 
3986
4036
  // src/components/InfiniteTable/utilities.css.ts
3987
- var alignItems = { center: "_16lm1iw15", stretch: "_16lm1iw16" };
3988
- var cssEllipsisClassName = "_16lm1iw1e _16lm1iw1f _16lm1iw1a";
4037
+ var alignItems = { center: "_16lm1iw17", stretch: "_16lm1iw18" };
4038
+ var cssEllipsisClassName = "_16lm1iw1g _16lm1iw1h _16lm1iw1c";
3989
4039
  var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
3990
- var display = { flex: "_16lm1iwn", block: "_16lm1iwo", inlineBlock: "_16lm1iwp" };
4040
+ var display = { flex: "_16lm1iwp", block: "_16lm1iwq", inlineBlock: "_16lm1iwr" };
3991
4041
  var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
3992
- var flexFlow = { column: "_16lm1iw13", row: "_16lm1iw14" };
3993
- var justifyContent = { center: "_16lm1iw17", start: "_16lm1iw18", end: "_16lm1iw19" };
3994
- var left = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
3995
- var overflow = { hidden: "_16lm1iw1a", auto: "_16lm1iw1b", visible: "_16lm1iw1c" };
4042
+ var flexFlow = { column: "_16lm1iw15", row: "_16lm1iw16" };
4043
+ var justifyContent = { center: "_16lm1iw19", start: "_16lm1iw1a", end: "_16lm1iw1b" };
4044
+ var left = { "0": "_16lm1iwz", "100%": "_16lm1iw10" };
4045
+ var overflow = { hidden: "_16lm1iw1c", auto: "_16lm1iw1d", visible: "_16lm1iw1e" };
3996
4046
  var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
3997
- var top = { "0": "_16lm1iwv", "100%": "_16lm1iww" };
4047
+ var top = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
3998
4048
  var transformTranslateZero = "_16lm1iwa";
3999
- var userSelect = { none: "_16lm1iwq" };
4000
- var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm" };
4049
+ var userSelect = { none: "_16lm1iws" };
4050
+ var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm", "1000000": "_16lm1iwn", "10000000": "_16lm1iwo" };
4001
4051
 
4002
4052
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
4003
4053
  var InfiniteTableBody = React14.forwardRef(function InfiniteTableBody2(props, ref) {
@@ -4022,7 +4072,7 @@ var InfiniteTableFooter = React15.forwardRef(function InfiniteTableFooter2(props
4022
4072
 
4023
4073
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
4024
4074
  var React22 = __toModule(require("react"));
4025
- var import_react24 = __toModule(require("react"));
4075
+ var import_react23 = __toModule(require("react"));
4026
4076
  var import_react_dom = __toModule(require("react-dom"));
4027
4077
 
4028
4078
  // src/components/DataSource/defaultFilterTypes.ts
@@ -4164,120 +4214,297 @@ var moveXatY = (arr, dragIndex, dropIndex) => {
4164
4214
  return arr;
4165
4215
  };
4166
4216
 
4217
+ // src/components/InfiniteTable/InfiniteCls.css.ts
4218
+ var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4219
+ var FooterCls = "_16lm1iw1";
4220
+ var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwp _16lm1iw15 _16lm1iw0";
4221
+ var InfiniteClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
4222
+ var InfiniteClsShiftingColumns = "_1yeub2vl";
4223
+ var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
4224
+
4225
+ // src/components/InfiniteTable/utils/rafFn.ts
4226
+ var rafFn = (fn) => {
4227
+ let rafId = 0;
4228
+ return (...args) => {
4229
+ if (rafId) {
4230
+ cancelAnimationFrame(rafId);
4231
+ }
4232
+ rafId = requestAnimationFrame(() => {
4233
+ rafId = 0;
4234
+ fn(...args);
4235
+ });
4236
+ };
4237
+ };
4238
+
4239
+ // src/components/InfiniteTable/hooks/useDOMProps.ts
4240
+ var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
4241
+ var columnOffsetAtIndex3 = stripVar(InternalVars.columnOffsetAtIndex);
4242
+ var columnZIndexAtIndex3 = stripVar(InternalVars.columnZIndexAtIndex);
4243
+ var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
4244
+ var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
4245
+ var baseZIndexForCells = stripVar(InternalVars.baseZIndexForCells);
4246
+ var computedVisibleColumnsCountCSSVar = stripVar(InternalVars.computedVisibleColumnsCount);
4247
+ function getColumnZIndex(col, params) {
4248
+ let computedZIndex = "auto";
4249
+ const index = col.computedVisibleIndex;
4250
+ if (col.computedPinned) {
4251
+ if (col.computedPinned === "start") {
4252
+ computedZIndex = params.pinnedStartColsCount - col.computedVisibleIndexInCategory;
4253
+ } else if (col.computedPinned === "end") {
4254
+ computedZIndex = params.visibleColsCount - col.computedVisibleIndexInCategory;
4255
+ }
4256
+ } else {
4257
+ computedZIndex = -index * 10;
4258
+ }
4259
+ const zIndexValue = typeof computedZIndex === "number" ? `calc( var(${baseZIndexForCells}) ` + (computedZIndex < 0 ? "-" : "+") + ` ${Math.abs(computedZIndex)} )` : "auto";
4260
+ return zIndexValue;
4261
+ }
4262
+ function useDOMProps(initialDOMProps) {
4263
+ const { computed, componentState, componentActions } = useInfiniteTable();
4264
+ const {
4265
+ focused,
4266
+ focusedWithin,
4267
+ domRef,
4268
+ onBlurWithin,
4269
+ onFocusWithin,
4270
+ onSelfFocus,
4271
+ onSelfBlur,
4272
+ activeCellIndex
4273
+ } = componentState;
4274
+ const {
4275
+ computedPinnedStartColumnsWidth,
4276
+ computedPinnedEndColumnsWidth,
4277
+ computedPinnedStartColumns,
4278
+ computedVisibleColumns
4279
+ } = computed;
4280
+ const cssVars = computedVisibleColumns.reduce((vars, col) => {
4281
+ const index = col.computedVisibleIndex;
4282
+ vars[`${columnWidthAtIndex2}-${index}`] = col.computedWidth + "px";
4283
+ vars[`${columnOffsetAtIndex3}-${index}`] = col.computedOffset + "px";
4284
+ const zIndexValue = getColumnZIndex(col, {
4285
+ pinnedStartColsCount: computedPinnedStartColumns.length,
4286
+ visibleColsCount: computedVisibleColumns.length
4287
+ });
4288
+ vars[`${columnZIndexAtIndex3}-${index}`] = `${zIndexValue}`;
4289
+ return vars;
4290
+ }, {});
4291
+ if (activeCellIndex != null) {
4292
+ cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
4293
+ cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
4294
+ }
4295
+ cssVars[computedVisibleColumnsCountCSSVar] = computedVisibleColumns.length;
4296
+ cssVars[baseZIndexForCells] = computedVisibleColumns.length * 10;
4297
+ const setFocused = rafFn((focused2) => {
4298
+ componentActions.focused = focused2;
4299
+ });
4300
+ const setFocusedWithin = rafFn((focused2) => {
4301
+ componentActions.focusedWithin = focused2;
4302
+ });
4303
+ const onFocus = (event) => {
4304
+ var _a;
4305
+ (_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
4306
+ if (event.target === domRef.current) {
4307
+ setFocused(true);
4308
+ onSelfFocus == null ? void 0 : onSelfFocus(event);
4309
+ if (focusedWithin) {
4310
+ setFocusedWithin(false);
4311
+ onBlurWithin == null ? void 0 : onBlurWithin(event);
4312
+ }
4313
+ } else {
4314
+ if (!focusedWithin) {
4315
+ setFocusedWithin(true);
4316
+ onFocusWithin == null ? void 0 : onFocusWithin(event);
4317
+ }
4318
+ }
4319
+ };
4320
+ const onBlur = (event) => {
4321
+ var _a, _b;
4322
+ (_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
4323
+ if (event.target === domRef.current) {
4324
+ setFocused(false);
4325
+ onSelfBlur == null ? void 0 : onSelfBlur(event);
4326
+ if (focusedWithin) {
4327
+ setFocusedWithin(false);
4328
+ onBlurWithin == null ? void 0 : onBlurWithin(event);
4329
+ }
4330
+ } else {
4331
+ const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
4332
+ if (!contained) {
4333
+ setFocusedWithin(false);
4334
+ onBlurWithin == null ? void 0 : onBlurWithin(event);
4335
+ }
4336
+ }
4337
+ };
4338
+ const domProps = __spreadProps(__spreadValues({
4339
+ tabIndex: 0
4340
+ }, initialDOMProps), {
4341
+ onFocus,
4342
+ onBlur
4343
+ });
4344
+ const className = join(InfiniteTableClassName, InfiniteCls, domProps == null ? void 0 : domProps.className, computedPinnedStartColumnsWidth ? `${InfiniteTableClassName}--has-pinned-start` : null, computedPinnedEndColumnsWidth ? `${InfiniteTableClassName}--has-pinned-end` : null, focused ? `${InfiniteTableClassName}--focused` : null, focusedWithin ? `${InfiniteTableClassName}--focused-within` : null, focused && componentState.focusedClassName ? componentState.focusedClassName : null, focusedWithin && componentState.focusedWithinClassName ? componentState.focusedWithinClassName : null, computed.computedPinnedStartOverflow ? `${InfiniteTableClassName}--has-pinned-start-overflow` : null, computed.computedPinnedEndOverflow ? `${InfiniteTableClassName}--has-pinned-end-overflow` : null, InfiniteClsRecipe({
4345
+ hasPinnedStart: !!computedPinnedStartColumnsWidth,
4346
+ hasPinnedEnd: !!computedPinnedEndColumnsWidth,
4347
+ focused,
4348
+ focusedWithin
4349
+ }));
4350
+ domProps.className = className;
4351
+ domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
4352
+ if (focused) {
4353
+ if (componentState.focusedStyle) {
4354
+ Object.assign(domProps.style, componentState.focusedStyle);
4355
+ }
4356
+ }
4357
+ if (focusedWithin) {
4358
+ if (componentState.focusedWithinStyle) {
4359
+ Object.assign(domProps.style, componentState.focusedWithinStyle);
4360
+ }
4361
+ }
4362
+ return domProps;
4363
+ }
4364
+
4167
4365
  // src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
4366
+ var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
4367
+ var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
4368
+ var PROXY_OFFSET = 10;
4168
4369
  var getBreakPoints = (columns) => {
4169
4370
  return Array.from(columns.values()).map((c) => {
4170
4371
  return {
4171
4372
  columnId: c.id,
4172
4373
  breakpoint: c.computedAbsoluteOffset + Math.round(c.computedWidth / 2)
4173
4374
  };
4174
- });
4375
+ }).filter(Boolean);
4175
4376
  };
4176
4377
  var useColumnPointerEvents = ({
4177
4378
  columnId,
4178
4379
  domRef,
4179
4380
  columns,
4180
- computedRemainingSpace
4381
+ computedRemainingSpace,
4382
+ pinnedStartColsCount,
4383
+ visibleColsCount
4181
4384
  }) => {
4182
- const [draggingDiff, setDraggingDiff] = (0, import_react17.useState)(null);
4183
- const [proxyOffset, setProxyOffset] = (0, import_react17.useState)(null);
4184
- const breakpointsRef = (0, import_react17.useRef)([]);
4185
- const didDragRef = (0, import_react17.useRef)(false);
4186
- const initialClientPos = (0, import_react17.useRef)(null);
4187
- const currentDropIndexRef = (0, import_react17.useRef)(null);
4188
- const dragging = draggingDiff != null;
4189
- const { componentActions, computed } = useInfiniteTable();
4385
+ const [proxyPosition, setProxyPosition] = (0, import_react17.useState)(null);
4386
+ const dragging = proxyPosition != null;
4387
+ const {
4388
+ componentActions,
4389
+ computed,
4390
+ componentState: { domRef: rootRef, brain }
4391
+ } = useInfiniteTable();
4190
4392
  const { computedColumnOrder } = computed;
4191
4393
  const column = (0, import_react17.useMemo)(() => columns.get(columnId), [columnId, columns]);
4192
- const { columnIndex, columnWidth, columnsArray } = (0, import_react17.useMemo)(() => {
4394
+ const { dragColumnIndex, columnsArray } = (0, import_react17.useMemo)(() => {
4193
4395
  const columnsArray2 = Array.from(columns.values());
4396
+ const columnIndex = columnsArray2.findIndex((c) => c.id === columnId);
4194
4397
  return {
4195
4398
  columnsArray: columnsArray2,
4196
- columnIndex: columnsArray2.findIndex((c) => c.id === columnId),
4197
- columnWidth: column.computedWidth
4399
+ dragColumnIndex: columnIndex,
4400
+ columnWidth: column.computedWidth,
4401
+ columnOffsetVar: `var(${columnOffsetAtIndex4}-${column.computedVisibleIndex})`
4198
4402
  };
4199
4403
  }, [columns, columnId, column]);
4200
- let cursorRef = (0, import_react17.useRef)("auto");
4201
4404
  const onPointerDown = (0, import_react17.useCallback)((e) => {
4405
+ var _a;
4406
+ let breakpoints = [];
4202
4407
  const target = domRef.current;
4203
- cursorRef.current = target.style.cursor;
4204
- didDragRef.current = false;
4205
- initialClientPos.current = {
4206
- clientX: e.clientX,
4207
- clientY: e.clientY
4208
- };
4408
+ const initialClientPos = {
4409
+ clientX: Math.round(e.clientX),
4410
+ clientY: Math.round(e.clientY)
4411
+ };
4412
+ const initialScrollPosition2 = brain.getScrollPosition();
4413
+ const initialProxyPosition = {
4414
+ left: PROXY_OFFSET - initialScrollPosition2.scrollLeft,
4415
+ top: PROXY_OFFSET
4416
+ };
4417
+ let currentClientPos = initialClientPos;
4418
+ let currentDiff = {
4419
+ x: 0,
4420
+ y: 0
4421
+ };
4422
+ function updateColumnOffsets(pos) {
4423
+ const clientX = Math.round(pos.clientX);
4424
+ const clientY = Math.round(pos.clientY);
4425
+ if (clientX === currentClientPos.clientX && clientY === currentClientPos.clientY) {
4426
+ return;
4427
+ }
4428
+ currentClientPos = { clientX, clientY };
4429
+ currentDiff.x = currentClientPos.clientX - initialClientPos.clientX;
4430
+ currentDiff.y = currentClientPos.clientY - initialClientPos.clientY;
4431
+ setProxyPosition({
4432
+ left: initialProxyPosition.left + currentDiff.x,
4433
+ top: initialProxyPosition.top + currentDiff.y
4434
+ });
4435
+ }
4436
+ updateColumnOffsets(initialClientPos);
4437
+ let initialCursor = (_a = target.style.cursor) != null ? _a : "auto";
4438
+ let didDragAtLeastOnce = false;
4439
+ let currentDropIndex = dragColumnIndex;
4209
4440
  const onPointerMove = (e2) => {
4210
- if (!didDragRef.current) {
4211
- didDragRef.current = true;
4212
- breakpointsRef.current = getBreakPoints(columns);
4213
- setDraggingDiff({ top: 0, left: 0 });
4214
- const rect = target.getBoundingClientRect();
4215
- setProxyOffset({
4216
- left: e2.clientX - rect.x - 10,
4217
- top: e2.clientY - rect.y - 10
4218
- });
4441
+ var _a2;
4442
+ if (!didDragAtLeastOnce) {
4443
+ didDragAtLeastOnce = true;
4444
+ componentActions.columnReorderInProgress = true;
4445
+ breakpoints = getBreakPoints(columns);
4446
+ setInfiniteColumnZIndex(dragColumnIndex, 1e6, rootRef.current);
4447
+ (_a2 = rootRef.current) == null ? void 0 : _a2.classList.add(InfiniteClsShiftingColumns);
4219
4448
  target.style.cursor = "grabbing";
4220
4449
  }
4221
- const diffX = e2.clientX - initialClientPos.current.clientX;
4222
- const diffY = e2.clientY - initialClientPos.current.clientY;
4450
+ updateColumnOffsets(e2);
4451
+ const diffX = currentDiff.x;
4223
4452
  const dir = diffX < 0 ? -1 : 1;
4224
- const columnPinned = column.computedPinned;
4225
4453
  let currentPos = dir === -1 ? column.computedAbsoluteOffset + diffX : column.computedAbsoluteOffset + column.computedWidth + diffX;
4226
- const breakpoints = breakpointsRef.current;
4227
- let index = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
4454
+ let idx = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
4228
4455
  return breakpoint < value ? -1 : breakpoint > value ? 1 : 0;
4229
4456
  });
4230
- if (index < 0) {
4231
- index = ~index;
4232
- }
4233
- if (index !== currentDropIndexRef.current) {
4234
- currentDropIndexRef.current = index;
4235
- const shifts = columnsArray.map(() => 0);
4236
- let total = 0;
4237
- if (dir === -1) {
4238
- for (let i = index; i < columnIndex; i++) {
4239
- let shiftBy = columnWidth;
4240
- if (columnPinned === "end" && columnsArray[i].computedPinned === false && columnsArray[i].computedLastInCategory && computedRemainingSpace > 0) {
4241
- shiftBy += computedRemainingSpace;
4242
- }
4243
- shifts[i] = shiftBy;
4244
- total -= shiftBy;
4457
+ if (idx < 0) {
4458
+ idx = ~idx;
4459
+ }
4460
+ if (idx !== currentDropIndex) {
4461
+ currentDropIndex = idx;
4462
+ if (dir === 1 && currentDropIndex === dragColumnIndex + 1) {
4463
+ currentDropIndex = dragColumnIndex;
4464
+ }
4465
+ columnsArray.forEach((col) => {
4466
+ const colIndex = col.computedVisibleIndex;
4467
+ if (dir === -1) {
4468
+ let newPosition = colIndex === dragColumnIndex ? `var(${columnOffsetAtIndex4}-${currentDropIndex})` : colIndex < currentDropIndex || colIndex > dragColumnIndex ? `var(${columnOffsetAtIndex4}-${colIndex})` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) + var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
4469
+ setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
4470
+ return;
4245
4471
  }
4246
- } else {
4247
- for (let i = columnIndex + 1; i < index; i++) {
4248
- shifts[i] = -columnWidth;
4249
- total += columnWidth;
4472
+ if (dir === 1) {
4473
+ let newPosition = colIndex < dragColumnIndex || colIndex >= currentDropIndex ? `var(${columnOffsetAtIndex4}-${colIndex})` : colIndex === dragColumnIndex ? `calc( var(${columnOffsetAtIndex4}-${currentDropIndex - 1}) + var(${columnWidthAtIndex3}-${currentDropIndex - 1}) - var(${columnWidthAtIndex3}-${dragColumnIndex}) )` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) - var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
4474
+ setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
4475
+ return;
4250
4476
  }
4251
- }
4252
- if (index !== columnIndex) {
4253
- shifts[columnIndex] = total;
4254
- }
4255
- componentActions.columnShifts = shifts;
4256
- componentActions.draggingColumnId = column.id;
4477
+ });
4257
4478
  }
4258
- setDraggingDiff({ left: diffX, top: diffY });
4259
4479
  };
4260
4480
  const onPointerUp = (e2) => {
4481
+ var _a2;
4261
4482
  const target2 = domRef.current;
4262
- target2.style.cursor = cursorRef.current;
4483
+ (_a2 = rootRef.current) == null ? void 0 : _a2.classList.remove(InfiniteClsShiftingColumns);
4484
+ columnsArray.forEach((col) => {
4485
+ setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
4486
+ });
4487
+ setInfiniteColumnZIndex(dragColumnIndex, getColumnZIndex(column, {
4488
+ pinnedStartColsCount,
4489
+ visibleColsCount
4490
+ }), rootRef.current);
4491
+ target2.style.cursor = initialCursor;
4263
4492
  target2.releasePointerCapture(e2.pointerId);
4264
4493
  target2.removeEventListener("pointermove", onPointerMove);
4265
4494
  target2.removeEventListener("pointerup", onPointerUp);
4266
- setDraggingDiff(null);
4267
- componentActions.columnShifts = null;
4268
- componentActions.draggingColumnId = null;
4269
- if (!didDragRef.current && column.computedSortable) {
4495
+ setProxyPosition(null);
4496
+ if (!didDragAtLeastOnce && column.computedSortable) {
4270
4497
  column.toggleSort();
4271
4498
  }
4272
- const dropIndex = currentDropIndexRef.current;
4273
- if (dropIndex != null && dropIndex !== columnIndex) {
4274
- const newOrder = moveXatY(computedColumnOrder, columnIndex, dropIndex > columnIndex ? dropIndex - 1 : dropIndex);
4499
+ if (currentDropIndex != null && currentDropIndex !== dragColumnIndex) {
4500
+ const newOrder = moveXatY(computedColumnOrder, dragColumnIndex, currentDropIndex > dragColumnIndex ? currentDropIndex - 1 : currentDropIndex);
4501
+ columnsArray.forEach((col) => {
4502
+ setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
4503
+ });
4275
4504
  componentActions.columnOrder = newOrder;
4276
4505
  }
4277
- breakpointsRef.current = [];
4278
- didDragRef.current = false;
4279
- initialClientPos.current = null;
4280
- currentDropIndexRef.current = null;
4506
+ componentActions.columnReorderInProgress = false;
4507
+ breakpoints = [];
4281
4508
  };
4282
4509
  target.addEventListener("pointermove", onPointerMove);
4283
4510
  target.addEventListener("pointerup", onPointerUp);
@@ -4285,7 +4512,9 @@ var useColumnPointerEvents = ({
4285
4512
  }, [
4286
4513
  columns,
4287
4514
  column,
4288
- columnIndex,
4515
+ dragColumnIndex,
4516
+ visibleColsCount,
4517
+ pinnedStartColsCount,
4289
4518
  columnsArray,
4290
4519
  computedRemainingSpace,
4291
4520
  computedColumnOrder
@@ -4294,8 +4523,7 @@ var useColumnPointerEvents = ({
4294
4523
  onPointerDown: column.computedDraggable ? onPointerDown : () => {
4295
4524
  },
4296
4525
  dragging,
4297
- proxyOffset,
4298
- draggingDiff: draggingDiff != null ? draggingDiff : { top: 0, left: 0 }
4526
+ proxyPosition
4299
4527
  };
4300
4528
  };
4301
4529
 
@@ -4346,20 +4574,20 @@ var React17 = __toModule(require("react"));
4346
4574
  var import_react19 = __toModule(require("react"));
4347
4575
 
4348
4576
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
4349
- var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4350
- var CellCls = "_1eexc2a5 _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw2 _16lm1iw1d _16lm1iw1e";
4351
- var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iws _16lm1iwu _16lm1iwn _16lm1iw14 _16lm1iw15", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
4352
- var HeaderCellProxy = "_12zfob10";
4353
- var HeaderCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwo", variantClassNames: { rowActive: { false: "_12zfob1i", true: "_12zfob1j" }, zebra: { false: "_12zfob1k", even: "_12zfob1l", odd: "_12zfob1m" }, dragging: { true: "_12zfob1n", false: "_12zfob1o" }, first: { true: "_12zfob1p", false: "_12zfob1q" }, last: { true: "_12zfob1r", false: "_12zfob1s" }, groupByField: { true: "_12zfob1t", false: "_12zfob1u" }, firstInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, lastInCategory: { true: "_12zfob1x", false: "_12zfob1y" }, pinned: { start: "_12zfob1z", end: "_12zfob110", false: "_12zfob111" }, filtered: { true: "_12zfob112", false: "_12zfob113" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob114"], [{ pinned: "end", firstInCategory: true }, "_12zfob115"], [{ pinned: false, lastInCategory: true }, "_12zfob116"]] });
4354
- var HeaderClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob17 _16lm1iwo _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob18", end: "_12zfob19", false: "_12zfob1a" }, virtualized: { true: "_12zfob1b", false: "_12zfob1c" }, overflow: { true: "_12zfob1d", false: "_12zfob1e" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1f"], [{ overflow: true, pinned: "end" }, "_12zfob1g"]] });
4355
- var HeaderFilterCls = "_12zfob11c _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw1";
4356
- var HeaderFilterEditorCls = "_16lm1iwu _16lm1iws";
4357
- var HeaderGroupCls = "_12zfob11b _16lm1iwn _16lm1iw14 _16lm1iw15";
4358
- var HeaderScrollbarPlaceholderCls = "_12zfob16 _16lm1iw2";
4577
+ var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4578
+ var CellCls = "_1eexc2a5 _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw2 _16lm1iw1f _16lm1iw1g";
4579
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iwu _16lm1iww _16lm1iwp _16lm1iw16 _16lm1iw17", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
4580
+ var HeaderCellProxy = "_12zfob1g _16lm1iw1g _16lm1iw1h _16lm1iw1c";
4581
+ var HeaderCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwq", variantClassNames: { rowActive: { false: "_12zfob1i", true: "_12zfob1j" }, zebra: { false: "_12zfob1k", even: "_12zfob1l", odd: "_12zfob1m" }, dragging: { true: "_12zfob1n", false: "_12zfob1o" }, first: { true: "_12zfob1p", false: "_12zfob1q" }, last: { true: "_12zfob1r", false: "_12zfob1s" }, groupByField: { true: "_12zfob1t", false: "_12zfob1u" }, firstInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, lastInCategory: { true: "_12zfob1x", false: "_12zfob1y" }, pinned: { start: "_12zfob1z", end: "_12zfob110", false: "_12zfob111" }, filtered: { true: "_12zfob112", false: "_12zfob113" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob114"], [{ pinned: "end", firstInCategory: true }, "_12zfob115"], [{ pinned: false, lastInCategory: true }, "_12zfob116"]] });
4582
+ var HeaderClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iwq _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, virtualized: { true: "_12zfob1a", false: "_12zfob1b" }, overflow: { true: "_12zfob1c", false: "_12zfob1d" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1e"], [{ overflow: true, pinned: "end" }, "_12zfob1f"]] });
4583
+ var HeaderFilterCls = "_12zfob11c _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw1";
4584
+ var HeaderFilterEditorCls = "_16lm1iww _16lm1iwu";
4585
+ var HeaderGroupCls = "_12zfob11b _16lm1iwp _16lm1iw16 _16lm1iw17";
4586
+ var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
4359
4587
  var HeaderSortIconCls = "_16lm1iw1";
4360
- var HeaderSortIconIndexCls = "_12zfob15";
4361
- var HeaderSortIconRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob12", center: "_12zfob13", end: "_12zfob14" } }, defaultVariants: {}, compoundVariants: [] });
4362
- var HeaderWrapperCls = "_12zfob11a _16lm1iw1a _16lm1iw1 _16lm1iwn _16lm1iw14";
4588
+ var HeaderSortIconIndexCls = "_12zfob14";
4589
+ var HeaderSortIconRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
4590
+ var HeaderWrapperCls = "_12zfob11a _16lm1iw1c _16lm1iw1 _16lm1iwp _16lm1iw16";
4363
4591
 
4364
4592
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
4365
4593
  var defaultLineStyle = {
@@ -4435,25 +4663,16 @@ function SortIcon(props) {
4435
4663
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
4436
4664
  var React18 = __toModule(require("react"));
4437
4665
 
4438
- // src/components/InfiniteTable/hooks/useInfiniteTableState.ts
4439
- var import_react20 = __toModule(require("react"));
4440
- var useInfiniteTableState = () => {
4441
- const TableContext2 = getInfiniteTableContext();
4442
- const { componentState } = (0, import_react20.useContext)(TableContext2);
4443
- return componentState;
4444
- };
4445
-
4446
4666
  // src/components/InfiniteTable/components/cell.css.ts
4447
- var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4448
- var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
4449
- var ColumnCellCls = "_1eexc2a5 _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw2 _16lm1iw1d _16lm1iw1e";
4450
- var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
4667
+ var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4668
+ var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw2 _16lm1iw1f _16lm1iw1g";
4669
+ var ColumnCellRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
4451
4670
 
4452
4671
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
4453
4672
  var { rootClassName: rootClassName5 } = internalProps;
4454
4673
  var InfiniteTableCellClassName = `${rootClassName5}Cell`;
4455
4674
  var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
4456
- var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
4675
+ var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
4457
4676
  function InfiniteTableCellFn(props) {
4458
4677
  var _b, _c, _d;
4459
4678
  const _a = props, {
@@ -4486,23 +4705,14 @@ function InfiniteTableCellFn(props) {
4486
4705
  "renderChildren"
4487
4706
  ]);
4488
4707
  const children = renderChildren();
4489
- const { columnShifts } = useInfiniteTableState();
4490
- const shifting = !!columnShifts;
4491
4708
  const style = __spreadValues({
4492
- width: `var(${columnWidthAtIndex2}-${column.computedVisibleIndex})`
4709
+ width: `var(${columnWidthAtIndex4}-${column.computedVisibleIndex})`
4493
4710
  }, domProps.style);
4494
- if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
4495
- const shiftLeft = columnShifts[column.computedVisibleIndex];
4496
- if (virtualized) {
4497
- style.left = shiftLeft;
4498
- } else {
4499
- style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
4500
- }
4501
- }
4502
4711
  const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
4503
4712
  style,
4504
4713
  "data-column-id": column.id,
4505
- className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
4714
+ "data-z-index": style.zIndex,
4715
+ className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
4506
4716
  children: /* @__PURE__ */ React18.createElement(React18.Fragment, null, beforeChildren, /* @__PURE__ */ React18.createElement("div", {
4507
4717
  className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
4508
4718
  style: contentStyle
@@ -4520,18 +4730,18 @@ var InfiniteTableCell = React18.memo(InfiniteTableCellFn);
4520
4730
 
4521
4731
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
4522
4732
  var React19 = __toModule(require("react"));
4523
- var import_react21 = __toModule(require("react"));
4733
+ var import_react20 = __toModule(require("react"));
4524
4734
  var { rootClassName: rootClassName6 } = internalProps;
4525
4735
  var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
4526
4736
  var stopPropagation = (e) => e.stopPropagation();
4527
4737
  function InfiniteTableColumnHeaderFilter(props) {
4528
4738
  var _a, _b, _c, _d;
4529
- const [theValue, setTheValue] = (0, import_react21.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4739
+ const [theValue, setTheValue] = (0, import_react20.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4530
4740
  const onInputChange = (filterValue) => {
4531
4741
  setTheValue(filterValue);
4532
4742
  props.onChange(filterValue);
4533
4743
  };
4534
- (0, import_react21.useEffect)(() => {
4744
+ (0, import_react20.useEffect)(() => {
4535
4745
  var _a2;
4536
4746
  if (props.columnFilterValue) {
4537
4747
  if (theValue !== props.columnFilterValue.filterValue) {
@@ -4576,7 +4786,7 @@ function InfiniteTableColumnHeaderFilterEmpty() {
4576
4786
 
4577
4787
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
4578
4788
  var React21 = __toModule(require("react"));
4579
- var import_react23 = __toModule(require("react"));
4789
+ var import_react22 = __toModule(require("react"));
4580
4790
 
4581
4791
  // src/components/flexbox/index.ts
4582
4792
  var computeFlex = (params) => {
@@ -4915,7 +5125,7 @@ var computeGroupResize = (params) => {
4915
5125
  };
4916
5126
 
4917
5127
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
4918
- var import_react22 = __toModule(require("react"));
5128
+ var import_react21 = __toModule(require("react"));
4919
5129
 
4920
5130
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
4921
5131
  function getColumnResizer(colIndex, {
@@ -4970,17 +5180,17 @@ function getColumnGroupResizer(colIndexes, config) {
4970
5180
  }
4971
5181
 
4972
5182
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
4973
- var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4974
- var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iwv _16lm1iw11 _16lm1iwz _16lm1iwe";
4975
- var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "zneyzh1 _16lm1iw2 _16lm1iwv _16lm1iwz", variantClassNames: { constrained: { false: "zneyzh2", true: "zneyzh3" } }, defaultVariants: {}, compoundVariants: [] });
5183
+ var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5184
+ var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iwx _16lm1iw13 _16lm1iw11 _16lm1iwe";
5185
+ var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "zneyzh1 _16lm1iw2 _16lm1iwx _16lm1iw11", variantClassNames: { constrained: { false: "zneyzh2", true: "zneyzh3" } }, defaultVariants: {}, compoundVariants: [] });
4976
5186
 
4977
5187
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
4978
5188
  var { rootClassName: rootClassName7 } = internalProps;
4979
5189
  var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
4980
5190
  function ResizeHandleFn(props) {
4981
- const domRef = (0, import_react22.useRef)(null);
4982
- const [constrained, setConstrained] = (0, import_react22.useState)(false);
4983
- const constrainedRef = (0, import_react22.useRef)(constrained);
5191
+ const domRef = (0, import_react21.useRef)(null);
5192
+ const [constrained, setConstrained] = (0, import_react21.useState)(false);
5193
+ const constrainedRef = (0, import_react21.useRef)(constrained);
4984
5194
  constrainedRef.current = constrained;
4985
5195
  const onPointerDown = (e) => {
4986
5196
  e.stopPropagation();
@@ -5019,33 +5229,32 @@ function ResizeHandleFn(props) {
5019
5229
  target.addEventListener("pointermove", onPointerMove);
5020
5230
  target.addEventListener("pointerup", onPointerUp);
5021
5231
  };
5022
- return /* @__PURE__ */ import_react22.default.createElement("div", {
5232
+ return /* @__PURE__ */ import_react21.default.createElement("div", {
5023
5233
  ref: domRef,
5024
5234
  className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls}`,
5025
5235
  onPointerDown
5026
- }, /* @__PURE__ */ import_react22.default.createElement("div", {
5236
+ }, /* @__PURE__ */ import_react21.default.createElement("div", {
5027
5237
  className: ResizeHandleDraggerClsRecipe({
5028
5238
  constrained
5029
5239
  })
5030
5240
  }));
5031
5241
  }
5032
- var ResizeHandle = import_react22.default.memo(ResizeHandleFn);
5242
+ var ResizeHandle = import_react21.default.memo(ResizeHandleFn);
5033
5243
 
5034
5244
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
5035
5245
  function useColumnResizeHandle(column) {
5036
5246
  const {
5037
5247
  computed: { computedVisibleColumns },
5038
- componentState: { domRef },
5039
5248
  getState,
5040
5249
  getComputed,
5041
5250
  componentActions
5042
5251
  } = useInfiniteTable();
5043
- const computeResizeForDiff = (0, import_react23.useCallback)(({
5252
+ const computeResizeForDiff = (0, import_react22.useCallback)(({
5044
5253
  diff,
5045
5254
  shareSpaceOnResize
5046
5255
  }) => {
5047
5256
  const state = getState();
5048
- const { columnSizing, viewportReservedWidth, bodySize, activeCellIndex } = state;
5257
+ const { columnSizing, viewportReservedWidth, bodySize } = state;
5049
5258
  const columns = getComputed().computedVisibleColumns;
5050
5259
  let atLeastOneFlex = false;
5051
5260
  const columnSizingWithFlex = columns.reduce((acc, col) => {
@@ -5073,21 +5282,9 @@ function useColumnResizeHandle(column) {
5073
5282
  };
5074
5283
  })
5075
5284
  });
5076
- if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
5077
- const activeColumn = columns[activeCellIndex[1]];
5078
- const currentColumn = columns[column.computedVisibleIndex];
5079
- if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
5080
- setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
5081
- } else if (activeColumn) {
5082
- setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
5083
- }
5084
- if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
5085
- setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
5086
- }
5087
- }
5088
5285
  return result;
5089
- }, []);
5090
- const onColumnResize = (0, import_react23.useCallback)(({
5286
+ }, [column]);
5287
+ const onColumnResize = (0, import_react22.useCallback)(({
5091
5288
  diff,
5092
5289
  shareSpaceOnResize
5093
5290
  }) => {
@@ -5099,7 +5296,7 @@ function useColumnResizeHandle(column) {
5099
5296
  componentActions.viewportReservedWidth = reservedWidth;
5100
5297
  }
5101
5298
  componentActions.columnSizing = columnSizing;
5102
- }, []);
5299
+ }, [computeResizeForDiff]);
5103
5300
  const resizeHandle = column.computedResizable ? /* @__PURE__ */ React21.createElement(ResizeHandle, {
5104
5301
  columns: computedVisibleColumns,
5105
5302
  columnIndex: column.computedVisibleIndex,
@@ -5113,6 +5310,8 @@ function useColumnResizeHandle(column) {
5113
5310
  var InfiniteTableHeaderCellContext = React22.createContext(null);
5114
5311
  var { rootClassName: rootClassName8 } = internalProps;
5115
5312
  var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
5313
+ var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
5314
+ var columnOffsetAtIndex5 = stripVar(InternalVars.columnOffsetAtIndex);
5116
5315
  function InfiniteTableHeaderCell(props) {
5117
5316
  var _a, _b, _c, _d, _e;
5118
5317
  const column = props.column;
@@ -5120,7 +5319,7 @@ function InfiniteTableHeaderCell(props) {
5120
5319
  const { onResize, height, width, headerOptions } = props;
5121
5320
  const sortInfo = column.computedSortInfo;
5122
5321
  let header = column.header;
5123
- const ref = (0, import_react24.useCallback)((node) => {
5322
+ const ref = (0, import_react23.useCallback)((node) => {
5124
5323
  var _a2;
5125
5324
  domRef.current = node;
5126
5325
  (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
@@ -5151,12 +5350,13 @@ function InfiniteTableHeaderCell(props) {
5151
5350
  header = header != null ? header : column.name;
5152
5351
  return /* @__PURE__ */ React22.createElement(React22.Fragment, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
5153
5352
  };
5154
- const domRef = (0, import_react24.useRef)(null);
5353
+ const domRef = (0, import_react23.useRef)(null);
5155
5354
  const {
5156
5355
  computed: {
5157
5356
  computedRemainingSpace,
5158
5357
  showColumnFilters,
5159
- computedVisibleColumns
5358
+ computedVisibleColumns,
5359
+ computedPinnedStartColumns
5160
5360
  },
5161
5361
  componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
5162
5362
  } = useInfiniteTable();
@@ -5165,7 +5365,7 @@ function InfiniteTableHeaderCell(props) {
5165
5365
  getState: getDataSourceState,
5166
5366
  componentState: { filterDelay, filterTypes }
5167
5367
  } = useDataSourceContextValue();
5168
- (0, import_react24.useEffect)(() => {
5368
+ (0, import_react23.useEffect)(() => {
5169
5369
  let clearOnResize = null;
5170
5370
  const node = domRef.current;
5171
5371
  if (onResize && node) {
@@ -5178,7 +5378,9 @@ function InfiniteTableHeaderCell(props) {
5178
5378
  const style = {
5179
5379
  height
5180
5380
  };
5181
- const { onPointerDown, dragging, draggingDiff, proxyOffset } = useColumnPointerEvents({
5381
+ const { onPointerDown, dragging, proxyPosition } = useColumnPointerEvents({
5382
+ pinnedStartColsCount: computedPinnedStartColumns.length,
5383
+ visibleColsCount: computedVisibleColumns.length,
5182
5384
  computedRemainingSpace,
5183
5385
  columnId: column.id,
5184
5386
  domRef,
@@ -5192,9 +5394,9 @@ function InfiniteTableHeaderCell(props) {
5192
5394
  position: "absolute",
5193
5395
  height,
5194
5396
  width,
5195
- left: column.computedAbsoluteOffset + draggingDiff.left + ((_a = proxyOffset == null ? void 0 : proxyOffset.left) != null ? _a : 0),
5196
- top: (draggingDiff == null ? void 0 : draggingDiff.top) + ((_b = proxyOffset == null ? void 0 : proxyOffset.top) != null ? _b : 0),
5197
- zIndex: 1
5397
+ left: `calc( var(${columnOffsetAtIndex5}-${column.computedVisibleIndex}) + ${(_a = proxyPosition.left) != null ? _a : 0}px)`,
5398
+ top: (_b = proxyPosition.top) != null ? _b : 0,
5399
+ zIndex: 1e9
5198
5400
  }
5199
5401
  }, header);
5200
5402
  draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
@@ -5203,7 +5405,7 @@ function InfiniteTableHeaderCell(props) {
5203
5405
  const contentRecipeVariants = {
5204
5406
  filtered: column.computedFiltered
5205
5407
  };
5206
- const setFilterValue = (0, import_react24.useCallback)((filterValue) => {
5408
+ const setFilterValue = (0, import_react23.useCallback)((filterValue) => {
5207
5409
  var _a2;
5208
5410
  const state = getDataSourceState();
5209
5411
  let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
@@ -5265,6 +5467,8 @@ function InfiniteTableHeaderCell(props) {
5265
5467
  const filterType = column.computedFilterType;
5266
5468
  const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
5267
5469
  const resizeHandle = useColumnResizeHandle(column);
5470
+ const zIndex2 = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
5471
+ style.zIndex = zIndex2;
5268
5472
  return /* @__PURE__ */ React22.createElement(ContextProvider, {
5269
5473
  value: renderParam
5270
5474
  }, /* @__PURE__ */ React22.createElement(InfiniteTableCell, {
@@ -5273,7 +5477,7 @@ function InfiniteTableHeaderCell(props) {
5273
5477
  column,
5274
5478
  "data-name": `HeaderCell`,
5275
5479
  "data-column-id": column.id,
5276
- "data-z-index": computedVisibleColumns.length * 10 - column.computedVisibleIndex * 10,
5480
+ "data-z-index": zIndex2,
5277
5481
  style,
5278
5482
  width,
5279
5483
  onPointerDown,
@@ -5294,7 +5498,7 @@ function InfiniteTableHeaderCell(props) {
5294
5498
  }), draggingProxy);
5295
5499
  }
5296
5500
  function useInfiniteHeaderCell() {
5297
- const result = (0, import_react24.useContext)(InfiniteTableHeaderCellContext);
5501
+ const result = (0, import_react23.useContext)(InfiniteTableHeaderCellContext);
5298
5502
  return result;
5299
5503
  }
5300
5504
 
@@ -5422,23 +5626,23 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
5422
5626
 
5423
5627
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
5424
5628
  var React26 = __toModule(require("react"));
5425
- var import_react27 = __toModule(require("react"));
5629
+ var import_react26 = __toModule(require("react"));
5426
5630
 
5427
5631
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
5428
5632
  var React25 = __toModule(require("react"));
5429
5633
 
5430
5634
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
5431
5635
  var React24 = __toModule(require("react"));
5432
- var import_react26 = __toModule(require("react"));
5636
+ var import_react25 = __toModule(require("react"));
5433
5637
 
5434
5638
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
5435
- var import_react25 = __toModule(require("react"));
5639
+ var import_react24 = __toModule(require("react"));
5436
5640
  var { rootClassName: rootClassName9 } = internalProps;
5437
5641
  var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
5438
5642
  function GroupResizeHandleFn(props) {
5439
- const domRef = (0, import_react25.useRef)(null);
5440
- const [constrained, setConstrained] = (0, import_react25.useState)(false);
5441
- const constrainedRef = (0, import_react25.useRef)(constrained);
5643
+ const domRef = (0, import_react24.useRef)(null);
5644
+ const [constrained, setConstrained] = (0, import_react24.useState)(false);
5645
+ const constrainedRef = (0, import_react24.useRef)(constrained);
5442
5646
  constrainedRef.current = constrained;
5443
5647
  const onPointerDown = (e) => {
5444
5648
  e.stopPropagation();
@@ -5485,18 +5689,18 @@ function GroupResizeHandleFn(props) {
5485
5689
  target.addEventListener("pointermove", onPointerMove);
5486
5690
  target.addEventListener("pointerup", onPointerUp);
5487
5691
  };
5488
- return /* @__PURE__ */ import_react25.default.createElement("div", {
5692
+ return /* @__PURE__ */ import_react24.default.createElement("div", {
5489
5693
  ref: domRef,
5490
5694
  className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls}`,
5491
5695
  onPointerDown
5492
- }, /* @__PURE__ */ import_react25.default.createElement("div", {
5696
+ }, /* @__PURE__ */ import_react24.default.createElement("div", {
5493
5697
  style: props.style,
5494
5698
  className: ResizeHandleDraggerClsRecipe({
5495
5699
  constrained
5496
5700
  })
5497
5701
  }));
5498
5702
  }
5499
- var GroupResizeHandle = import_react25.default.memo(GroupResizeHandleFn);
5703
+ var GroupResizeHandle = import_react24.default.memo(GroupResizeHandleFn);
5500
5704
 
5501
5705
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
5502
5706
  function useColumnGroupResizeHandle(groupColumns, config) {
@@ -5508,7 +5712,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
5508
5712
  componentActions
5509
5713
  } = useInfiniteTable();
5510
5714
  const lastColumnInGroup = groupColumns[groupColumns.length - 1];
5511
- const computeResizeForDiff = (0, import_react26.useCallback)((diff) => {
5715
+ const computeResizeForDiff = (0, import_react25.useCallback)((diff) => {
5512
5716
  const state = getState();
5513
5717
  const { columnSizing, viewportReservedWidth, bodySize } = state;
5514
5718
  const columns = getComputed().computedVisibleColumns;
@@ -5541,7 +5745,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
5541
5745
  });
5542
5746
  return result;
5543
5747
  }, []);
5544
- const onColumnResize = (0, import_react26.useCallback)((diff) => {
5748
+ const onColumnResize = (0, import_react25.useCallback)((diff) => {
5545
5749
  const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
5546
5750
  componentActions.viewportReservedWidth = reservedWidth;
5547
5751
  componentActions.columnSizing = columnSizing;
@@ -5562,7 +5766,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
5562
5766
 
5563
5767
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
5564
5768
  var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
5565
- var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
5769
+ var columnWidthAtIndex5 = stripVar(InternalVars.columnWidthAtIndex);
5566
5770
  function InfiniteTableHeaderGroup(props) {
5567
5771
  const {
5568
5772
  computed: { computedVisibleColumns }
@@ -5581,7 +5785,7 @@ function InfiniteTableHeaderGroup(props) {
5581
5785
  columnGroupsMaxDepth
5582
5786
  });
5583
5787
  const firstColumn = columns[0];
5584
- const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex3}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex3}-${firstColumn.computedVisibleIndex})`;
5788
+ const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
5585
5789
  const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
5586
5790
  return /* @__PURE__ */ React25.createElement("div", {
5587
5791
  ref: props.domRef,
@@ -5613,7 +5817,7 @@ function InfiniteTableHeaderFn(props) {
5613
5817
  componentState: { headerBrain, headerOptions }
5614
5818
  } = useInfiniteTable();
5615
5819
  const { computedVisibleColumnsMap, showColumnFilters } = computed;
5616
- (0, import_react27.useEffect)(() => {
5820
+ (0, import_react26.useEffect)(() => {
5617
5821
  const onScroll = (scrollPosition) => {
5618
5822
  if (domRef.current) {
5619
5823
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
@@ -5622,7 +5826,7 @@ function InfiniteTableHeaderFn(props) {
5622
5826
  const removeOnScroll = brain.onScroll(onScroll);
5623
5827
  return removeOnScroll;
5624
5828
  }, [brain]);
5625
- const domRef = (0, import_react27.useRef)(null);
5829
+ const domRef = (0, import_react26.useRef)(null);
5626
5830
  const headerCls = HeaderClsRecipe({
5627
5831
  overflow: false,
5628
5832
  virtualized: true
@@ -5632,7 +5836,7 @@ function InfiniteTableHeaderFn(props) {
5632
5836
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
5633
5837
  style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
5634
5838
  };
5635
- const renderCell = (0, import_react27.useCallback)((params) => {
5839
+ const renderCell = (0, import_react26.useCallback)((params) => {
5636
5840
  const {
5637
5841
  rowIndex,
5638
5842
  colIndex,
@@ -5794,7 +5998,7 @@ function TableHeaderWrapper(props) {
5794
5998
 
5795
5999
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5796
6000
  var React28 = __toModule(require("react"));
5797
- var import_react28 = __toModule(require("react"));
6001
+ var import_react27 = __toModule(require("react"));
5798
6002
 
5799
6003
  // src/components/utils/decamelize.ts
5800
6004
  function decamelize(str, options) {
@@ -5802,14 +6006,6 @@ function decamelize(str, options) {
5802
6006
  return str.replace(/([a-z\d])([A-Z])/g, "$1" + separator + "$2").replace(new RegExp("(" + separator + "[A-Z])([A-Z])", "g"), "$1" + separator + "$2").toLowerCase();
5803
6007
  }
5804
6008
 
5805
- // src/components/InfiniteTable/InfiniteCls.css.ts
5806
- var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5807
- var FooterCls = "_16lm1iw1";
5808
- var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
5809
- var InfiniteClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
5810
- var InfiniteClsShiftingColumns = "_16lm1iwq";
5811
- var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
5812
-
5813
6009
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5814
6010
  var defaultStyle = {
5815
6011
  padding: ThemeVars.spacing[2],
@@ -5851,7 +6047,7 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
5851
6047
  ref.current = node;
5852
6048
  }
5853
6049
  }, []);
5854
- (0, import_react28.useEffect)(() => {
6050
+ (0, import_react27.useEffect)(() => {
5855
6051
  const forceStyle = () => {
5856
6052
  requestAnimationFrame(() => {
5857
6053
  var _a;
@@ -5880,8 +6076,9 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
5880
6076
 
5881
6077
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5882
6078
  var React29 = __toModule(require("react"));
5883
- var import_react29 = __toModule(require("react"));
6079
+ var import_react28 = __toModule(require("react"));
5884
6080
  var { rootClassName: rootClassName11 } = internalProps;
6081
+ var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
5885
6082
  var InfiniteTableColumnCellContext = React29.createContext(null);
5886
6083
  var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
5887
6084
  function isColumnWithField(c) {
@@ -5938,7 +6135,7 @@ function InfiniteTableColumnCellFn(props) {
5938
6135
  value
5939
6136
  });
5940
6137
  }
5941
- const onClick = (0, import_react29.useCallback)(() => {
6138
+ const onClick = (0, import_react28.useCallback)(() => {
5942
6139
  if (keyboardNavigation === "row") {
5943
6140
  componentActions.activeRowIndex = rowIndex;
5944
6141
  return;
@@ -5978,7 +6175,7 @@ function InfiniteTableColumnCellFn(props) {
5978
6175
  isGroupRow,
5979
6176
  rowIndex,
5980
6177
  toggleGroupRow,
5981
- toggleCurrentGroupRow: (0, import_react29.useCallback)(() => {
6178
+ toggleCurrentGroupRow: (0, import_react28.useCallback)(() => {
5982
6179
  if (!rowInfo.isGroupRow) {
5983
6180
  return;
5984
6181
  }
@@ -5987,7 +6184,7 @@ function InfiniteTableColumnCellFn(props) {
5987
6184
  groupBy: computedDataSource.groupBy,
5988
6185
  pivotBy: computedDataSource.pivotBy
5989
6186
  });
5990
- const renderChildren = (0, import_react29.useCallback)(() => {
6187
+ const renderChildren = (0, import_react28.useCallback)(() => {
5991
6188
  if (hidden) {
5992
6189
  return null;
5993
6190
  }
@@ -6011,7 +6208,8 @@ function InfiniteTableColumnCellFn(props) {
6011
6208
  }
6012
6209
  style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
6013
6210
  style.height = rowHeight;
6014
- const memoizedStyle = (0, import_react29.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
6211
+ style.zIndex = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
6212
+ const memoizedStyle = (0, import_react28.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
6015
6213
  const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
6016
6214
  const zebra = showZebraRows ? odd ? "odd" : "even" : false;
6017
6215
  const cellProps = {
@@ -6034,7 +6232,7 @@ function InfiniteTableColumnCellFn(props) {
6034
6232
  }
6035
6233
  var InfiniteTableColumnCell = React29.memo(InfiniteTableColumnCellFn);
6036
6234
  function useInfiniteColumnCell() {
6037
- const result = (0, import_react29.useContext)(InfiniteTableColumnCellContext);
6235
+ const result = (0, import_react28.useContext)(InfiniteTableColumnCellContext);
6038
6236
  return result;
6039
6237
  }
6040
6238
 
@@ -6048,8 +6246,8 @@ var RowHoverCls = "_7pupv01";
6048
6246
  var React30 = __toModule(require("react"));
6049
6247
 
6050
6248
  // src/components/InfiniteTable/components/LoadMask.css.ts
6051
- var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz" };
6052
- var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz";
6249
+ var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11" };
6250
+ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11";
6053
6251
  var LoadMaskTextCls = "qy58ya4";
6054
6252
 
6055
6253
  // src/components/InfiniteTable/components/LoadMask.tsx
@@ -6081,24 +6279,40 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
6081
6279
  scrollRowIntoView(rowIndex, config = { offset: 0 }) {
6082
6280
  const state = getState();
6083
6281
  const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
6282
+ if (!scrollPosition) {
6283
+ return false;
6284
+ }
6084
6285
  const currentScrollPosition = state.brain.getScrollPosition();
6286
+ const scrollTopMax = state.brain.scrollTopMax;
6287
+ if (scrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
6288
+ return false;
6289
+ }
6085
6290
  if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
6086
6291
  state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
6087
6292
  }
6293
+ return true;
6088
6294
  },
6089
6295
  scrollColumnIntoView(colId, config = { offset: 0 }) {
6090
6296
  const state = getState();
6091
6297
  const computed = getComputed();
6092
6298
  const computedColumn = computed.computedVisibleColumnsMap.get(colId);
6093
6299
  if (!computedColumn) {
6094
- return;
6300
+ return false;
6095
6301
  }
6096
6302
  const colIndex = computedColumn.computedVisibleIndex;
6097
6303
  const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
6304
+ if (!scrollPosition) {
6305
+ return false;
6306
+ }
6098
6307
  const currentScrollPosition = state.brain.getScrollPosition();
6308
+ const scrollLeftMax = state.brain.scrollLeftMax;
6309
+ if (scrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
6310
+ return false;
6311
+ }
6099
6312
  if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
6100
6313
  state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
6101
6314
  }
6315
+ return true;
6102
6316
  },
6103
6317
  scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
6104
6318
  const state = getState();
@@ -6107,30 +6321,45 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
6107
6321
  if (typeof colIdOrIndex === "string") {
6108
6322
  const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
6109
6323
  if (!computedColumn) {
6110
- return;
6324
+ return false;
6111
6325
  }
6112
6326
  colIndex = computedColumn.computedVisibleIndex;
6113
6327
  }
6114
6328
  const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
6115
6329
  const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
6330
+ if (!scrollPositionForCol || !scrollPositionForRow) {
6331
+ return false;
6332
+ }
6116
6333
  const newScrollPosition = {
6117
6334
  scrollLeft: scrollPositionForCol.scrollLeft,
6118
6335
  scrollTop: scrollPositionForRow.scrollTop
6119
6336
  };
6120
6337
  const currentScrollPosition = state.brain.getScrollPosition();
6338
+ const scrollLeftMax = state.brain.scrollLeftMax;
6339
+ const scrollTopMax = state.brain.scrollTopMax;
6340
+ if (newScrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
6341
+ return false;
6342
+ }
6343
+ if (newScrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
6344
+ return false;
6345
+ }
6121
6346
  if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
6122
6347
  state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
6123
6348
  }
6124
6349
  if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
6125
6350
  state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
6126
6351
  }
6352
+ return true;
6127
6353
  }
6128
6354
  };
6355
+ if (false) {
6356
+ globalThis.imperativeApi = imperativeApi;
6357
+ }
6129
6358
  return imperativeApi;
6130
6359
  }
6131
6360
 
6132
6361
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
6133
- var import_react30 = __toModule(require("react"));
6362
+ var import_react29 = __toModule(require("react"));
6134
6363
  var OFFSET = 10;
6135
6364
  function getColumnContentMaxWidths(domRef, options) {
6136
6365
  var _a;
@@ -6196,11 +6425,11 @@ function useAutoSizeColumns() {
6196
6425
  componentActions,
6197
6426
  componentState: { domRef, ready, autoSizeColumnsKey, brain }
6198
6427
  } = useComponentState();
6199
- const [refreshId, setRefreshId] = (0, import_react30.useState)(0);
6428
+ const [refreshId, setRefreshId] = (0, import_react29.useState)(0);
6200
6429
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
6201
6430
  const getTheKey = useLatest(theKey);
6202
- const lastExecutedIdentifierRef = (0, import_react30.useRef)(null);
6203
- (0, import_react30.useEffect)(() => {
6431
+ const lastExecutedIdentifierRef = (0, import_react29.useRef)(null);
6432
+ (0, import_react29.useEffect)(() => {
6204
6433
  const key = getTheKey();
6205
6434
  if (key == null) {
6206
6435
  return;
@@ -6213,7 +6442,7 @@ function useAutoSizeColumns() {
6213
6442
  };
6214
6443
  return brain.onRenderRangeChange(onChange);
6215
6444
  }, [brain]);
6216
- (0, import_react30.useEffect)(() => {
6445
+ (0, import_react29.useEffect)(() => {
6217
6446
  var _a;
6218
6447
  if (theKey == null) {
6219
6448
  return;
@@ -6258,8 +6487,8 @@ function useAutoSizeColumns() {
6258
6487
  }
6259
6488
 
6260
6489
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
6490
+ var import_react30 = __toModule(require("react"));
6261
6491
  var import_react31 = __toModule(require("react"));
6262
- var import_react32 = __toModule(require("react"));
6263
6492
 
6264
6493
  // src/components/InfiniteTable/hooks/useYourBrain.ts
6265
6494
  function useYourBrain(param) {
@@ -6329,13 +6558,13 @@ function useCellRendering(param) {
6329
6558
  bodySize,
6330
6559
  rowspan
6331
6560
  });
6332
- const scrollTopMaxRef = (0, import_react31.useRef)(0);
6333
- (0, import_react31.useEffect)(() => {
6561
+ const scrollTopMaxRef = (0, import_react30.useRef)(0);
6562
+ (0, import_react30.useEffect)(() => {
6334
6563
  return brain.onRenderCountChange(() => {
6335
6564
  scrollTopMaxRef.current = brain.scrollTopMax;
6336
6565
  });
6337
6566
  }, [brain]);
6338
- (0, import_react31.useEffect)(() => {
6567
+ (0, import_react30.useEffect)(() => {
6339
6568
  return brain.onScrollStop((scrollPosition) => {
6340
6569
  const { scrollTop } = scrollPosition;
6341
6570
  if (scrollTop === 0) {
@@ -6352,7 +6581,7 @@ function useCellRendering(param) {
6352
6581
  }
6353
6582
  });
6354
6583
  }, [brain, onScrollToTop, onScrollToBottom]);
6355
- (0, import_react31.useEffect)(() => {
6584
+ (0, import_react30.useEffect)(() => {
6356
6585
  if (!bodySize.height) {
6357
6586
  return;
6358
6587
  }
@@ -6363,10 +6592,10 @@ function useCellRendering(param) {
6363
6592
  }
6364
6593
  }, [!!bodySize.height]);
6365
6594
  const [, rerender] = useRerender();
6366
- (0, import_react31.useEffect)(() => {
6595
+ (0, import_react30.useEffect)(() => {
6367
6596
  rerender();
6368
6597
  }, [dataSourceState]);
6369
- const renderCell = (0, import_react31.useCallback)((params) => {
6598
+ const renderCell = (0, import_react30.useCallback)((params) => {
6370
6599
  const {
6371
6600
  rowIndex,
6372
6601
  colIndex,
@@ -6401,7 +6630,7 @@ function useCellRendering(param) {
6401
6630
  rowStyle,
6402
6631
  rowClassName
6403
6632
  };
6404
- return /* @__PURE__ */ import_react32.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
6633
+ return /* @__PURE__ */ import_react31.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
6405
6634
  }, [
6406
6635
  rowHeight,
6407
6636
  getData,
@@ -6419,13 +6648,13 @@ function useCellRendering(param) {
6419
6648
  }
6420
6649
 
6421
6650
  // src/components/InfiniteTable/hooks/useComputed.ts
6422
- var import_react46 = __toModule(require("react"));
6651
+ var import_react45 = __toModule(require("react"));
6423
6652
 
6424
6653
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
6425
- var import_react34 = __toModule(require("react"));
6654
+ var import_react33 = __toModule(require("react"));
6426
6655
 
6427
6656
  // src/components/hooks/useInterceptedMap.ts
6428
- var import_react33 = __toModule(require("react"));
6657
+ var import_react32 = __toModule(require("react"));
6429
6658
  function interceptMap(map2, fns) {
6430
6659
  const { set, delete: deleteKey, clear } = map2;
6431
6660
  if (fns.set) {
@@ -6489,20 +6718,6 @@ function computeColumnGroupsDepths(columnGroups) {
6489
6718
  return map2;
6490
6719
  }
6491
6720
 
6492
- // src/components/InfiniteTable/utils/rafFn.ts
6493
- var rafFn = (fn) => {
6494
- let rafId = 0;
6495
- return (...args) => {
6496
- if (rafId) {
6497
- cancelAnimationFrame(rafId);
6498
- }
6499
- rafId = requestAnimationFrame(() => {
6500
- rafId = 0;
6501
- fn(...args);
6502
- });
6503
- };
6504
- };
6505
-
6506
6721
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
6507
6722
  function useColumnGroups() {
6508
6723
  const {
@@ -6513,7 +6728,7 @@ function useColumnGroups() {
6513
6728
  componentActions,
6514
6729
  getComponentState
6515
6730
  } = useComponentState();
6516
- (0, import_react34.useEffect)(() => {
6731
+ (0, import_react33.useEffect)(() => {
6517
6732
  const recompute = () => {
6518
6733
  componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
6519
6734
  };
@@ -6524,7 +6739,7 @@ function useColumnGroups() {
6524
6739
  set: update
6525
6740
  });
6526
6741
  }, [computedColumnGroups]);
6527
- (0, import_react34.useEffect)(() => {
6742
+ (0, import_react33.useEffect)(() => {
6528
6743
  return interceptMap(collapsedColumnGroups, {
6529
6744
  set: (key, visibleCol) => {
6530
6745
  const colIds = key.slice(1);
@@ -6559,10 +6774,10 @@ function useColumnGroups() {
6559
6774
  }
6560
6775
 
6561
6776
  // src/components/InfiniteTable/hooks/useColumnRowspan.ts
6562
- var import_react35 = __toModule(require("react"));
6777
+ var import_react34 = __toModule(require("react"));
6563
6778
  function useColumnRowspan(computedVisibleColumns) {
6564
6779
  const { getState: getDataSourceState } = useDataSourceContextValue();
6565
- const rowspan = (0, import_react35.useMemo)(() => {
6780
+ const rowspan = (0, import_react34.useMemo)(() => {
6566
6781
  const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
6567
6782
  return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
6568
6783
  const dataArray = getDataSourceState().dataArray;
@@ -6588,10 +6803,10 @@ function useColumnRowspan(computedVisibleColumns) {
6588
6803
  }
6589
6804
 
6590
6805
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
6591
- var import_react36 = __toModule(require("react"));
6806
+ var import_react35 = __toModule(require("react"));
6592
6807
  var debug4 = dbg("useColumnSizeFn");
6593
6808
  function useColumnSizeFn(columns) {
6594
- const columnSize = (0, import_react36.useCallback)((index) => {
6809
+ const columnSize = (0, import_react35.useCallback)((index) => {
6595
6810
  const column = columns[index];
6596
6811
  if (false) {
6597
6812
  debug4("cannot find column at index", index, columns);
@@ -6602,7 +6817,7 @@ function useColumnSizeFn(columns) {
6602
6817
  }
6603
6818
 
6604
6819
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
6605
- var import_react42 = __toModule(require("react"));
6820
+ var import_react41 = __toModule(require("react"));
6606
6821
 
6607
6822
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
6608
6823
  var React34 = __toModule(require("react"));
@@ -6617,7 +6832,7 @@ var showLoadingIcon = (rowInfo) => {
6617
6832
 
6618
6833
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
6619
6834
  var React32 = __toModule(require("react"));
6620
- var import_react37 = __toModule(require("react"));
6835
+ var import_react36 = __toModule(require("react"));
6621
6836
 
6622
6837
  // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
6623
6838
  var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -6628,7 +6843,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ def
6628
6843
  function ExpanderIcon(props) {
6629
6844
  var _a;
6630
6845
  const { size = 24 } = props;
6631
- const [expanded, setExpanded] = (0, import_react37.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
6846
+ const [expanded, setExpanded] = (0, import_react36.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
6632
6847
  const onClick = () => {
6633
6848
  var _a2;
6634
6849
  (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
@@ -6829,11 +7044,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6829
7044
  }
6830
7045
 
6831
7046
  // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
6832
- var import_react38 = __toModule(require("react"));
7047
+ var import_react37 = __toModule(require("react"));
6833
7048
  function useEffectWithRaf(fn, deps) {
6834
- const rafId = (0, import_react38.useRef)(0);
6835
- const removeFnRaf = (0, import_react38.useRef)();
6836
- (0, import_react38.useEffect)(() => {
7049
+ const rafId = (0, import_react37.useRef)(0);
7050
+ const removeFnRaf = (0, import_react37.useRef)();
7051
+ (0, import_react37.useEffect)(() => {
6837
7052
  rafId.current = requestAnimationFrame(() => {
6838
7053
  removeFnRaf.current = fn();
6839
7054
  });
@@ -6850,7 +7065,7 @@ function useEffectWithRaf(fn, deps) {
6850
7065
  }
6851
7066
 
6852
7067
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
6853
- var import_react41 = __toModule(require("react"));
7068
+ var import_react40 = __toModule(require("react"));
6854
7069
 
6855
7070
  // src/utils/groupAndPivot/index.ts
6856
7071
  var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
@@ -7491,15 +7706,15 @@ var GroupRowsState = class {
7491
7706
  };
7492
7707
 
7493
7708
  // src/components/DataSource/privateHooks/useLoadData.ts
7494
- var import_react40 = __toModule(require("react"));
7709
+ var import_react39 = __toModule(require("react"));
7495
7710
 
7496
7711
  // src/components/hooks/useEffectWithChanges.ts
7497
- var import_react39 = __toModule(require("react"));
7712
+ var import_react38 = __toModule(require("react"));
7498
7713
  function useEffectWithChanges(fn, deps) {
7499
- const prevRef = (0, import_react39.useRef)({});
7500
- const oldValuesRef = (0, import_react39.useRef)({});
7714
+ const prevRef = (0, import_react38.useRef)({});
7715
+ const oldValuesRef = (0, import_react38.useRef)({});
7501
7716
  const oldValues = oldValuesRef.current;
7502
- const changesRef = (0, import_react39.useRef)({});
7717
+ const changesRef = (0, import_react38.useRef)({});
7503
7718
  const changes = changesRef.current;
7504
7719
  const useEffectDeps = [];
7505
7720
  for (const k in deps) {
@@ -7512,7 +7727,7 @@ function useEffectWithChanges(fn, deps) {
7512
7727
  }
7513
7728
  }
7514
7729
  prevRef.current = deps;
7515
- (0, import_react39.useEffect)(() => {
7730
+ (0, import_react38.useEffect)(() => {
7516
7731
  const changes2 = changesRef.current;
7517
7732
  const result = fn(changes2, oldValues);
7518
7733
  changesRef.current = {};
@@ -7780,12 +7995,12 @@ function useLoadData() {
7780
7995
  livePaginationCursor,
7781
7996
  cursorId: stateCursorId
7782
7997
  } = componentState;
7783
- const [scrollbars, setScrollbars] = (0, import_react40.useState)({
7998
+ const [scrollbars, setScrollbars] = (0, import_react39.useState)({
7784
7999
  vertical: false,
7785
8000
  horizontal: false
7786
8001
  });
7787
- const scrollbarsRef = (0, import_react40.useRef)(scrollbars);
7788
- (0, import_react40.useEffect)(() => {
8002
+ const scrollbarsRef = (0, import_react39.useRef)(scrollbars);
8003
+ (0, import_react39.useEffect)(() => {
7789
8004
  notifyScrollbarsChange.onChange((scrollbars2) => {
7790
8005
  if (!scrollbars2) {
7791
8006
  return;
@@ -7795,7 +8010,7 @@ function useLoadData() {
7795
8010
  });
7796
8011
  return () => notifyScrollbarsChange.destroy();
7797
8012
  }, [notifyScrollbarsChange]);
7798
- (0, import_react40.useEffect)(() => {
8013
+ (0, import_react39.useEffect)(() => {
7799
8014
  if (!livePagination) {
7800
8015
  return;
7801
8016
  }
@@ -7809,7 +8024,7 @@ function useLoadData() {
7809
8024
  });
7810
8025
  return () => cancelAnimationFrame(frameId);
7811
8026
  }, [livePaginationCursor]);
7812
- (0, import_react40.useEffect)(() => {
8027
+ (0, import_react39.useEffect)(() => {
7813
8028
  if (!livePagination || livePaginationCursor !== void 0) {
7814
8029
  return;
7815
8030
  }
@@ -7823,7 +8038,7 @@ function useLoadData() {
7823
8038
  });
7824
8039
  return () => cancelAnimationFrame(frameId);
7825
8040
  }, [dataArray.length, livePaginationCursor]);
7826
- (0, import_react40.useEffect)(() => {
8041
+ (0, import_react39.useEffect)(() => {
7827
8042
  const state = getComponentState();
7828
8043
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
7829
8044
  if (!scrollbars.vertical && livePagination2) {
@@ -7841,7 +8056,7 @@ function useLoadData() {
7841
8056
  filterValue,
7842
8057
  cursorId: livePagination ? stateCursorId : null
7843
8058
  };
7844
- const initialRef = (0, import_react40.useRef)(true);
8059
+ const initialRef = (0, import_react39.useRef)(true);
7845
8060
  useLazyLoadRange();
7846
8061
  useEffectWithChanges(() => {
7847
8062
  const componentState2 = getComponentState();
@@ -7873,7 +8088,7 @@ function useLazyLoadRange() {
7873
8088
  componentActions: actions,
7874
8089
  componentState
7875
8090
  } = useComponentState();
7876
- (0, import_react40.useEffect)(() => {
8091
+ (0, import_react39.useEffect)(() => {
7877
8092
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
7878
8093
  }, [componentState.data, componentState.dataParams]);
7879
8094
  const {
@@ -7882,7 +8097,7 @@ function useLazyLoadRange() {
7882
8097
  dataArray,
7883
8098
  scrollStopDelayUpdatedByTable
7884
8099
  } = componentState;
7885
- const latestRenderRangeRef = (0, import_react40.useRef)(null);
8100
+ const latestRenderRangeRef = (0, import_react39.useRef)(null);
7886
8101
  const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
7887
8102
  const componentState2 = getComponentState();
7888
8103
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -7901,8 +8116,8 @@ function useLazyLoadRange() {
7901
8116
  componentActions: actions
7902
8117
  }, cache);
7903
8118
  };
7904
- const debouncedLoadRange = (0, import_react40.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
7905
- (0, import_react40.useEffect)(() => {
8119
+ const debouncedLoadRange = (0, import_react39.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
8120
+ (0, import_react39.useEffect)(() => {
7906
8121
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
7907
8122
  return notifyRenderRangeChange.onChange((renderRange) => {
7908
8123
  latestRenderRangeRef.current = renderRange;
@@ -7911,7 +8126,7 @@ function useLazyLoadRange() {
7911
8126
  }
7912
8127
  return;
7913
8128
  }, [lazyLoadBatchSize]);
7914
- (0, import_react40.useEffect)(() => {
8129
+ (0, import_react39.useEffect)(() => {
7915
8130
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
7916
8131
  debouncedLoadRange();
7917
8132
  }
@@ -8752,7 +8967,7 @@ function DataSource(props) {
8752
8967
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
8753
8968
  function useToggleGroupRow() {
8754
8969
  const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
8755
- const toggleGroupRow = (0, import_react41.useCallback)((groupKeys) => {
8970
+ const toggleGroupRow = (0, import_react40.useCallback)((groupKeys) => {
8756
8971
  const state = getDataSourceState();
8757
8972
  const newState = new GroupRowsState(state.groupRowsState);
8758
8973
  newState.toggleGroupRow(groupKeys);
@@ -8784,7 +8999,7 @@ function useToggleGroupRow() {
8784
8999
 
8785
9000
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
8786
9001
  function useGroupByMap(groupBy) {
8787
- const groupByMap = (0, import_react42.useMemo)(() => {
9002
+ const groupByMap = (0, import_react41.useMemo)(() => {
8788
9003
  return groupBy.reduce((acc, groupBy2, index) => {
8789
9004
  acc.set(groupBy2.field, {
8790
9005
  groupBy: groupBy2,
@@ -8808,13 +9023,13 @@ function useColumnsWhen() {
8808
9023
  }
8809
9024
  } = useComponentState();
8810
9025
  const groupByMap = useGroupByMap(groupBy);
8811
- (0, import_react42.useEffect)(() => {
9026
+ (0, import_react41.useEffect)(() => {
8812
9027
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
8813
9028
  }, [groupRenderStrategy]);
8814
- (0, import_react42.useEffect)(() => {
9029
+ (0, import_react41.useEffect)(() => {
8815
9030
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
8816
9031
  }, [pivotTotalColumnPosition]);
8817
- (0, import_react42.useEffect)(() => {
9032
+ (0, import_react41.useEffect)(() => {
8818
9033
  if (pivotGrandTotalColumnPosition != void 0) {
8819
9034
  dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
8820
9035
  }
@@ -8888,7 +9103,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
8888
9103
  });
8889
9104
  return computedColumns.size === 0 ? void 0 : computedColumns;
8890
9105
  }
8891
- (0, import_react42.useEffect)(() => {
9106
+ (0, import_react41.useEffect)(() => {
8892
9107
  const update = () => {
8893
9108
  componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
8894
9109
  };
@@ -8917,7 +9132,7 @@ function useColumnsWhenGrouping() {
8917
9132
  }
8918
9133
  } = useComponentState();
8919
9134
  const toggleGroupRow = useToggleGroupRow();
8920
- (0, import_react42.useEffect)(() => {
9135
+ (0, import_react41.useEffect)(() => {
8921
9136
  const update = () => {
8922
9137
  const columnsWhenGrouping = getColumnsWhenGrouping({
8923
9138
  columns,
@@ -9053,7 +9268,7 @@ function useHideColumns(groupByMap) {
9053
9268
  hideEmptyGroupColumns ? groupRowsState : null,
9054
9269
  hideEmptyGroupColumns
9055
9270
  ]);
9056
- (0, import_react42.useEffect)(() => {
9271
+ (0, import_react41.useEffect)(() => {
9057
9272
  const isGrouped = groupBy.length > 0;
9058
9273
  const currentState = getComponentState();
9059
9274
  const { controlledColumnVisibility, columnVisibility } = currentState;
@@ -9168,7 +9383,7 @@ function getColumnsWhenGrouping(params) {
9168
9383
  }
9169
9384
 
9170
9385
  // src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
9171
- var import_react44 = __toModule(require("react"));
9386
+ var import_react43 = __toModule(require("react"));
9172
9387
 
9173
9388
  // src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
9174
9389
  var order = ["start", void 0, "end"];
@@ -9218,7 +9433,7 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
9218
9433
  };
9219
9434
  var getComputedPinned = (colId, columnPinning) => {
9220
9435
  const pinned = columnPinning.get(colId);
9221
- const computedPinned = pinned === "start" ? "start" : pinned === "end" ? "end" : false;
9436
+ const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
9222
9437
  return computedPinned;
9223
9438
  };
9224
9439
  var getComputedVisibleColumns = ({
@@ -9354,6 +9569,7 @@ var getComputedVisibleColumns = ({
9354
9569
  const id = visibleColumnOrder[i];
9355
9570
  const nextColumnId = visibleColumnOrder[i + 1];
9356
9571
  const colType = getColumnComputedType(c, columnTypes);
9572
+ const computedVisibleIndex = i;
9357
9573
  const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
9358
9574
  const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
9359
9575
  const computedSorted = !!computedSortInfo;
@@ -9366,7 +9582,15 @@ var getComputedVisibleColumns = ({
9366
9582
  const computedMaxWidth = maxSizes[i] || 1e4;
9367
9583
  const computedPinned = getComputedPinned(id, columnPinning);
9368
9584
  const computedLast = i === visibleColumnOrder.length - 1;
9585
+ let computedVisibleIndexInCategory = computedVisibleIndex;
9369
9586
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
9587
+ if (computedPinned == "start") {
9588
+ computedVisibleIndexInCategory = computedVisibleIndex;
9589
+ } else if (computedPinned === "end") {
9590
+ computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
9591
+ } else {
9592
+ computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
9593
+ }
9370
9594
  const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
9371
9595
  const computedFirstInCategory = computedPinned !== prevPinned;
9372
9596
  const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
@@ -9415,6 +9639,7 @@ var getComputedVisibleColumns = ({
9415
9639
  computedWidth,
9416
9640
  computedAbsoluteOffset,
9417
9641
  computedPinningOffset,
9642
+ computedVisibleIndexInCategory,
9418
9643
  computedOffset,
9419
9644
  computedSortable,
9420
9645
  computedSortInfo,
@@ -9423,7 +9648,7 @@ var getComputedVisibleColumns = ({
9423
9648
  computedSorted,
9424
9649
  computedSortedAsc,
9425
9650
  computedSortedDesc,
9426
- computedVisibleIndex: i,
9651
+ computedVisibleIndex,
9427
9652
  computedPinned,
9428
9653
  computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
9429
9654
  computedFirstInCategory,
@@ -9516,10 +9741,10 @@ var getComputedVisibleColumns = ({
9516
9741
  };
9517
9742
 
9518
9743
  // src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
9519
- var import_react43 = __toModule(require("react"));
9744
+ var import_react42 = __toModule(require("react"));
9520
9745
  var useRerenderOnKeyChange = (map2) => {
9521
9746
  const [renderId, rerender] = useRerender();
9522
- (0, import_react43.useEffect)(() => {
9747
+ (0, import_react42.useEffect)(() => {
9523
9748
  const update = rafFn(rerender);
9524
9749
  return interceptMap(map2, {
9525
9750
  set: update,
@@ -9573,7 +9798,7 @@ var useComputedVisibleColumns = ({
9573
9798
  computedPinnedEndOffset,
9574
9799
  computedPinnedEndWidth,
9575
9800
  computedPinnedStartWidth
9576
- } = (0, import_react44.useMemo)(() => {
9801
+ } = (0, import_react43.useMemo)(() => {
9577
9802
  return getComputedVisibleColumns({
9578
9803
  columns,
9579
9804
  bodySize,
@@ -9644,7 +9869,7 @@ var useComputedVisibleColumns = ({
9644
9869
  };
9645
9870
 
9646
9871
  // src/components/InfiniteTable/hooks/useScrollbars.ts
9647
- var import_react45 = __toModule(require("react"));
9872
+ var import_react44 = __toModule(require("react"));
9648
9873
  var INITIAL_SCROLLBARS = {
9649
9874
  vertical: false,
9650
9875
  horizontal: false
@@ -9652,8 +9877,8 @@ var INITIAL_SCROLLBARS = {
9652
9877
  function useScrollbars(brain) {
9653
9878
  const { getComponentState: getInfiniteTableState } = useComponentState();
9654
9879
  const { getState: getDataSourceState } = useDataSourceContextValue();
9655
- const [scrollbars, setScrollbars] = (0, import_react45.useState)(INITIAL_SCROLLBARS);
9656
- (0, import_react45.useEffect)(() => {
9880
+ const [scrollbars, setScrollbars] = (0, import_react44.useState)(INITIAL_SCROLLBARS);
9881
+ (0, import_react44.useEffect)(() => {
9657
9882
  return brain.onRenderCountChange(() => {
9658
9883
  const { scrollTopMax, scrollLeftMax } = brain;
9659
9884
  setScrollbars({
@@ -9662,7 +9887,7 @@ function useScrollbars(brain) {
9662
9887
  });
9663
9888
  });
9664
9889
  }, [brain]);
9665
- (0, import_react45.useLayoutEffect)(() => {
9890
+ (0, import_react44.useLayoutEffect)(() => {
9666
9891
  const dataSourceState = getDataSourceState();
9667
9892
  const { onScrollbarsChange } = getInfiniteTableState();
9668
9893
  const { notifyScrollbarsChange } = dataSourceState;
@@ -9693,7 +9918,7 @@ function useComputed() {
9693
9918
  bodySize,
9694
9919
  showSeparatePivotColumnForSingleAggregation
9695
9920
  } = componentState;
9696
- (0, import_react46.useState)(() => {
9921
+ (0, import_react45.useState)(() => {
9697
9922
  componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
9698
9923
  if (rowHeight) {
9699
9924
  componentActions.rowHeight = rowHeight;
@@ -9705,13 +9930,13 @@ function useComputed() {
9705
9930
  }
9706
9931
  });
9707
9932
  });
9708
- (0, import_react46.useEffect)(() => {
9933
+ (0, import_react45.useEffect)(() => {
9709
9934
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
9710
9935
  }, [showSeparatePivotColumnForSingleAggregation]);
9711
9936
  const { multiSort, filterValue } = dataSourceState;
9712
9937
  useColumnGroups();
9713
9938
  const { toggleGroupRow } = useColumnsWhen();
9714
- const setSortInfo = (0, import_react46.useCallback)((sortInfo) => {
9939
+ const setSortInfo = (0, import_react45.useCallback)((sortInfo) => {
9715
9940
  var _a2;
9716
9941
  const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
9717
9942
  dataSourceActions.sortInfo = newSortInfo;
@@ -9788,109 +10013,8 @@ function useComputed() {
9788
10013
  };
9789
10014
  }
9790
10015
 
9791
- // src/components/InfiniteTable/hooks/useDOMProps.ts
9792
- var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
9793
- var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
9794
- var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
9795
- var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
9796
- function useDOMProps(initialDOMProps) {
9797
- const { computed, componentState, componentActions } = useInfiniteTable();
9798
- const {
9799
- columnShifts,
9800
- focused,
9801
- focusedWithin,
9802
- domRef,
9803
- onBlurWithin,
9804
- onFocusWithin,
9805
- onSelfFocus,
9806
- onSelfBlur,
9807
- activeCellIndex
9808
- } = componentState;
9809
- const {
9810
- computedPinnedStartColumnsWidth,
9811
- computedPinnedEndColumnsWidth,
9812
- computedVisibleColumns
9813
- } = computed;
9814
- const cssVars = computedVisibleColumns.reduce((vars, col) => {
9815
- const index = col.computedVisibleIndex;
9816
- vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
9817
- vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
9818
- return vars;
9819
- }, {});
9820
- if (activeCellIndex != null) {
9821
- cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
9822
- cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
9823
- }
9824
- const setFocused = rafFn((focused2) => {
9825
- componentActions.focused = focused2;
9826
- });
9827
- const setFocusedWithin = rafFn((focused2) => {
9828
- componentActions.focusedWithin = focused2;
9829
- });
9830
- const onFocus = (event) => {
9831
- var _a;
9832
- (_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
9833
- if (event.target === domRef.current) {
9834
- setFocused(true);
9835
- onSelfFocus == null ? void 0 : onSelfFocus(event);
9836
- if (focusedWithin) {
9837
- setFocusedWithin(false);
9838
- onBlurWithin == null ? void 0 : onBlurWithin(event);
9839
- }
9840
- } else {
9841
- if (!focusedWithin) {
9842
- setFocusedWithin(true);
9843
- onFocusWithin == null ? void 0 : onFocusWithin(event);
9844
- }
9845
- }
9846
- };
9847
- const onBlur = (event) => {
9848
- var _a, _b;
9849
- (_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
9850
- if (event.target === domRef.current) {
9851
- setFocused(false);
9852
- onSelfBlur == null ? void 0 : onSelfBlur(event);
9853
- if (focusedWithin) {
9854
- setFocusedWithin(false);
9855
- onBlurWithin == null ? void 0 : onBlurWithin(event);
9856
- }
9857
- } else {
9858
- const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
9859
- if (!contained) {
9860
- setFocusedWithin(false);
9861
- onBlurWithin == null ? void 0 : onBlurWithin(event);
9862
- }
9863
- }
9864
- };
9865
- const domProps = __spreadProps(__spreadValues({
9866
- tabIndex: 0
9867
- }, initialDOMProps), {
9868
- onFocus,
9869
- onBlur
9870
- });
9871
- const className = join(InfiniteTableClassName, InfiniteCls, columnShifts ? `${InfiniteClsShiftingColumns} ${InfiniteTableClassName}--shifting` : "", domProps == null ? void 0 : domProps.className, computedPinnedStartColumnsWidth ? `${InfiniteTableClassName}--has-pinned-start` : null, computedPinnedEndColumnsWidth ? `${InfiniteTableClassName}--has-pinned-end` : null, focused ? `${InfiniteTableClassName}--focused` : null, focusedWithin ? `${InfiniteTableClassName}--focused-within` : null, focused && componentState.focusedClassName ? componentState.focusedClassName : null, focusedWithin && componentState.focusedWithinClassName ? componentState.focusedWithinClassName : null, computed.computedPinnedStartOverflow ? `${InfiniteTableClassName}--has-pinned-start-overflow` : null, computed.computedPinnedEndOverflow ? `${InfiniteTableClassName}--has-pinned-end-overflow` : null, InfiniteClsRecipe({
9872
- hasPinnedStart: !!computedPinnedStartColumnsWidth,
9873
- hasPinnedEnd: !!computedPinnedEndColumnsWidth,
9874
- focused,
9875
- focusedWithin
9876
- }));
9877
- domProps.className = className;
9878
- domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
9879
- if (focused) {
9880
- if (componentState.focusedStyle) {
9881
- Object.assign(domProps.style, componentState.focusedStyle);
9882
- }
9883
- }
9884
- if (focusedWithin) {
9885
- if (componentState.focusedWithinStyle) {
9886
- Object.assign(domProps.style, componentState.focusedWithinStyle);
9887
- }
9888
- }
9889
- return domProps;
9890
- }
9891
-
9892
10016
  // src/components/InfiniteTable/hooks/useLicense/useLicense.ts
9893
- var import_react47 = __toModule(require("react"));
10017
+ var import_react46 = __toModule(require("react"));
9894
10018
 
9895
10019
  // src/components/InfiniteTable/hooks/useLicense/crc32.ts
9896
10020
  var DEFAULT_ReversedPolynomial = 3988292384;
@@ -10048,10 +10172,10 @@ var isInsideSandbox = () => {
10048
10172
  };
10049
10173
  var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
10050
10174
  var useLicense = (licenseKey = "") => {
10051
- const valid = (0, import_react47.useMemo)(() => {
10175
+ const valid = (0, import_react46.useMemo)(() => {
10052
10176
  let valid2 = isValidLicense(licenseKey, {
10053
10177
  publishedAt: 1624970570587,
10054
- version: "0.3.15"
10178
+ version: "0.3.16"
10055
10179
  });
10056
10180
  if (!licenseKey && !valid2 && isInsidePlayground) {
10057
10181
  return true;
@@ -10061,6 +10185,73 @@ var useLicense = (licenseKey = "") => {
10061
10185
  return valid;
10062
10186
  };
10063
10187
 
10188
+ // src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
10189
+ var import_react47 = __toModule(require("react"));
10190
+ var RETRIES = 10;
10191
+ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
10192
+ const didScrollRef = (0, import_react47.useRef)(false);
10193
+ const rafId = (0, import_react47.useRef)(null);
10194
+ (0, import_react47.useEffect)(() => {
10195
+ if (activeCellIndex != null) {
10196
+ didScrollRef.current = false;
10197
+ cancelAnimationFrame(rafId.current);
10198
+ }
10199
+ }, [activeCellIndex]);
10200
+ (0, import_react47.useEffect)(() => {
10201
+ if (activeCellIndex != null && !didScrollRef.current) {
10202
+ let tryScroll = function(times = 0) {
10203
+ times++;
10204
+ cancelAnimationFrame(rafId.current);
10205
+ rafId.current = requestAnimationFrame(() => {
10206
+ didScrollRef.current = imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
10207
+ offset: 30
10208
+ });
10209
+ if (!didScrollRef.current && times < RETRIES) {
10210
+ tryScroll(times);
10211
+ }
10212
+ });
10213
+ };
10214
+ tryScroll();
10215
+ }
10216
+ return () => {
10217
+ cancelAnimationFrame(rafId.current);
10218
+ };
10219
+ }, [activeCellIndex, dataCount]);
10220
+ }
10221
+
10222
+ // src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
10223
+ var import_react48 = __toModule(require("react"));
10224
+ var RETRIES2 = 10;
10225
+ function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
10226
+ const didScrollRef = (0, import_react48.useRef)(false);
10227
+ const rafId = (0, import_react48.useRef)(null);
10228
+ (0, import_react48.useEffect)(() => {
10229
+ if (activeRowIndex != null) {
10230
+ didScrollRef.current = false;
10231
+ cancelAnimationFrame(rafId.current);
10232
+ }
10233
+ }, [activeRowIndex]);
10234
+ (0, import_react48.useEffect)(() => {
10235
+ if (activeRowIndex != null && !didScrollRef.current) {
10236
+ let tryScroll = function(times = 0) {
10237
+ times++;
10238
+ rafId.current = requestAnimationFrame(() => {
10239
+ didScrollRef.current = imperativeApi.scrollRowIntoView(activeRowIndex, {
10240
+ offset: 30
10241
+ });
10242
+ if (!didScrollRef.current && times < RETRIES2) {
10243
+ tryScroll(times);
10244
+ }
10245
+ });
10246
+ };
10247
+ tryScroll();
10248
+ }
10249
+ return () => {
10250
+ cancelAnimationFrame(rafId.current);
10251
+ };
10252
+ }, [activeRowIndex, dataCount]);
10253
+ }
10254
+
10064
10255
  // src/components/utils/clamp.ts
10065
10256
  function clamp(value, min, max) {
10066
10257
  return Math.min(Math.max(value, min), max);
@@ -10209,7 +10400,7 @@ function handleKeyboardNavigation(options) {
10209
10400
  }
10210
10401
 
10211
10402
  // src/components/InfiniteTable/state/getInitialState.ts
10212
- var import_react48 = __toModule(require("react"));
10403
+ var import_react49 = __toModule(require("react"));
10213
10404
 
10214
10405
  // src/components/VirtualBrain/ScrollListener.ts
10215
10406
  var initialScrollPosition = {
@@ -10304,11 +10495,10 @@ function initSetupState2() {
10304
10495
  propsCache: new Map([]),
10305
10496
  brain,
10306
10497
  headerBrain,
10307
- columnShifts: null,
10308
- domRef: (0, import_react48.createRef)(),
10309
- scrollerDOMRef: (0, import_react48.createRef)(),
10310
- portalDOMRef: (0, import_react48.createRef)(),
10311
- activeCellIndicatorDOMRef: (0, import_react48.createRef)(),
10498
+ domRef: (0, import_react49.createRef)(),
10499
+ scrollerDOMRef: (0, import_react49.createRef)(),
10500
+ portalDOMRef: (0, import_react49.createRef)(),
10501
+ activeCellIndicatorDOMRef: (0, import_react49.createRef)(),
10312
10502
  onRowHeightCSSVarChange: buildSubscriptionCallback(),
10313
10503
  onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
10314
10504
  bodySize: {
@@ -10319,11 +10509,11 @@ function initSetupState2() {
10319
10509
  scrollTop: 0,
10320
10510
  scrollLeft: 0
10321
10511
  },
10512
+ columnReorderInProgress: false,
10322
10513
  ready: false,
10323
10514
  focused: false,
10324
10515
  focusedWithin: false,
10325
10516
  columnsWhenGrouping: columnsGeneratedForGrouping,
10326
- draggingColumnId: null,
10327
10517
  pinnedStartScrollListener: new ScrollListener(),
10328
10518
  pinnedEndScrollListener: new ScrollListener(),
10329
10519
  columnsWhenInlineGroupRenderStrategy: void 0
@@ -10377,7 +10567,6 @@ var forwardProps3 = (setupState) => {
10377
10567
  pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
10378
10568
  pivotGrandTotalColumnPosition: 1,
10379
10569
  licenseKey: (licenseKey) => licenseKey || "",
10380
- keyboardNavigation: (keyboardNavigation) => keyboardNavigation != null ? keyboardNavigation : "cell",
10381
10570
  activeRowIndex: 1,
10382
10571
  activeCellIndex: 1,
10383
10572
  columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
@@ -10424,7 +10613,7 @@ var cleanupState = (state) => {
10424
10613
  state.pinnedStartScrollListener.destroy();
10425
10614
  };
10426
10615
  var mapPropsToState2 = (params) => {
10427
- var _a, _b;
10616
+ var _a, _b, _c;
10428
10617
  const { props, state, oldState, parentState } = params;
10429
10618
  const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
10430
10619
  const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(computedColumnGroups) : state.columnGroupsDepthsMap;
@@ -10440,7 +10629,8 @@ var mapPropsToState2 = (params) => {
10440
10629
  groupRenderStrategy,
10441
10630
  groupBy,
10442
10631
  computedColumns,
10443
- columnHeaderCssEllipsis: (_b = (_a = props.columnHeaderCssEllipsis) != null ? _a : props.columnCssEllipsis) != null ? _b : true,
10632
+ keyboardNavigation: (_a = state.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
10633
+ columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
10444
10634
  columnGroupsDepthsMap,
10445
10635
  columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
10446
10636
  computedColumnGroups,
@@ -10477,11 +10667,11 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10477
10667
  getState
10478
10668
  } = useInfiniteTable();
10479
10669
  const {
10480
- componentState: { loading },
10670
+ componentState: { loading, dataArray },
10481
10671
  getState: getDataSourceState,
10482
10672
  componentActions: dataSourceActions
10483
10673
  } = useDataSourceContextValue();
10484
- const [imperativeApi] = (0, import_react49.useState)(() => {
10674
+ const [imperativeApi] = (0, import_react50.useState)(() => {
10485
10675
  return getImperativeApi(getState, getComputed, getDataSourceState, actions);
10486
10676
  });
10487
10677
  const {
@@ -10505,27 +10695,14 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10505
10695
  activeCellIndex,
10506
10696
  onRenderUpdater
10507
10697
  } = componentState;
10508
- (0, import_react49.useEffect)(() => {
10509
- if (activeRowIndex != null) {
10510
- imperativeApi.scrollRowIntoView(activeRowIndex, {
10511
- offset: 30
10512
- });
10513
- }
10514
- }, [activeRowIndex]);
10515
- (0, import_react49.useEffect)(() => {
10516
- if (activeCellIndex != null) {
10517
- imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
10518
- offset: 30
10519
- });
10520
- }
10521
- }, [activeCellIndex]);
10522
- const { columnShifts, bodySize } = componentState;
10698
+ useScrollToActiveRow(activeRowIndex, dataArray.length, imperativeApi);
10699
+ useScrollToActiveCell(activeCellIndex, dataArray.length, imperativeApi);
10700
+ const { bodySize } = componentState;
10523
10701
  const { scrollbars } = computed;
10524
10702
  const { renderCell } = useCellRendering({
10525
10703
  imperativeApi,
10526
10704
  getComputed,
10527
10705
  domRef: componentState.domRef,
10528
- columnShifts,
10529
10706
  bodySize,
10530
10707
  computed
10531
10708
  });
@@ -10547,7 +10724,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10547
10724
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
10548
10725
  }, [scrollStopDelay]);
10549
10726
  useAutoSizeColumns();
10550
- const onKeyDown = (0, import_react49.useCallback)((event) => {
10727
+ const onKeyDown = (0, import_react50.useCallback)((event) => {
10551
10728
  if (handleKeyboardNavigation({
10552
10729
  getState,
10553
10730
  actions,
@@ -10569,7 +10746,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10569
10746
  }) : null, /* @__PURE__ */ React36.createElement(InfiniteTableBody, null, /* @__PURE__ */ React36.createElement(HeadlessTable, {
10570
10747
  tabIndex: 0,
10571
10748
  activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
10572
- activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
10749
+ activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
10573
10750
  scrollStopDelay,
10574
10751
  renderer,
10575
10752
  onRenderUpdater,
@@ -10581,7 +10758,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10581
10758
  visible: loading
10582
10759
  }, loadingText)), /* @__PURE__ */ React36.createElement("div", {
10583
10760
  ref: portalDOMRef,
10584
- className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
10761
+ className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
10585
10762
  }), rowHeightCSSVar ? /* @__PURE__ */ React36.createElement(CSSVariableWatch, {
10586
10763
  varName: rowHeightCSSVar,
10587
10764
  onChange: onRowHeightCSSVarChange