@infinite-table/infinite-react 0.3.15 → 0.3.18

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,11 +5766,9 @@ 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);
5770
+ var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
5566
5771
  function InfiniteTableHeaderGroup(props) {
5567
- const {
5568
- computed: { computedVisibleColumns }
5569
- } = useInfiniteTable();
5570
5772
  const { columnGroup, height, columns, bodyBrain, columnGroupsMaxDepth } = props;
5571
5773
  let { header } = columnGroup;
5572
5774
  if (header instanceof Function) {
@@ -5581,8 +5783,8 @@ function InfiniteTableHeaderGroup(props) {
5581
5783
  columnGroupsMaxDepth
5582
5784
  });
5583
5785
  const firstColumn = columns[0];
5584
- const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex3}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex3}-${firstColumn.computedVisibleIndex})`;
5585
- const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
5786
+ const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
5787
+ const zIndex2 = `calc(var(${columnZIndexAtIndex5}-${firstColumn.computedVisibleIndex}) + ${columnGroupsMaxDepth - columnGroup.depth})`;
5586
5788
  return /* @__PURE__ */ React25.createElement("div", {
5587
5789
  ref: props.domRef,
5588
5790
  "data-group-id": columnGroup.uniqueGroupId,
@@ -5613,7 +5815,7 @@ function InfiniteTableHeaderFn(props) {
5613
5815
  componentState: { headerBrain, headerOptions }
5614
5816
  } = useInfiniteTable();
5615
5817
  const { computedVisibleColumnsMap, showColumnFilters } = computed;
5616
- (0, import_react27.useEffect)(() => {
5818
+ (0, import_react26.useEffect)(() => {
5617
5819
  const onScroll = (scrollPosition) => {
5618
5820
  if (domRef.current) {
5619
5821
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
@@ -5622,7 +5824,7 @@ function InfiniteTableHeaderFn(props) {
5622
5824
  const removeOnScroll = brain.onScroll(onScroll);
5623
5825
  return removeOnScroll;
5624
5826
  }, [brain]);
5625
- const domRef = (0, import_react27.useRef)(null);
5827
+ const domRef = (0, import_react26.useRef)(null);
5626
5828
  const headerCls = HeaderClsRecipe({
5627
5829
  overflow: false,
5628
5830
  virtualized: true
@@ -5632,7 +5834,7 @@ function InfiniteTableHeaderFn(props) {
5632
5834
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
5633
5835
  style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
5634
5836
  };
5635
- const renderCell = (0, import_react27.useCallback)((params) => {
5837
+ const renderCell = (0, import_react26.useCallback)((params) => {
5636
5838
  const {
5637
5839
  rowIndex,
5638
5840
  colIndex,
@@ -5794,7 +5996,7 @@ function TableHeaderWrapper(props) {
5794
5996
 
5795
5997
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5796
5998
  var React28 = __toModule(require("react"));
5797
- var import_react28 = __toModule(require("react"));
5999
+ var import_react27 = __toModule(require("react"));
5798
6000
 
5799
6001
  // src/components/utils/decamelize.ts
5800
6002
  function decamelize(str, options) {
@@ -5802,14 +6004,6 @@ function decamelize(str, options) {
5802
6004
  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
6005
  }
5804
6006
 
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
6007
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5814
6008
  var defaultStyle = {
5815
6009
  padding: ThemeVars.spacing[2],
@@ -5851,7 +6045,7 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
5851
6045
  ref.current = node;
5852
6046
  }
5853
6047
  }, []);
5854
- (0, import_react28.useEffect)(() => {
6048
+ (0, import_react27.useEffect)(() => {
5855
6049
  const forceStyle = () => {
5856
6050
  requestAnimationFrame(() => {
5857
6051
  var _a;
@@ -5880,8 +6074,9 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
5880
6074
 
5881
6075
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5882
6076
  var React29 = __toModule(require("react"));
5883
- var import_react29 = __toModule(require("react"));
6077
+ var import_react28 = __toModule(require("react"));
5884
6078
  var { rootClassName: rootClassName11 } = internalProps;
6079
+ var columnZIndexAtIndex6 = stripVar(InternalVars.columnZIndexAtIndex);
5885
6080
  var InfiniteTableColumnCellContext = React29.createContext(null);
5886
6081
  var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
5887
6082
  function isColumnWithField(c) {
@@ -5938,7 +6133,7 @@ function InfiniteTableColumnCellFn(props) {
5938
6133
  value
5939
6134
  });
5940
6135
  }
5941
- const onClick = (0, import_react29.useCallback)(() => {
6136
+ const onClick = (0, import_react28.useCallback)(() => {
5942
6137
  if (keyboardNavigation === "row") {
5943
6138
  componentActions.activeRowIndex = rowIndex;
5944
6139
  return;
@@ -5978,7 +6173,7 @@ function InfiniteTableColumnCellFn(props) {
5978
6173
  isGroupRow,
5979
6174
  rowIndex,
5980
6175
  toggleGroupRow,
5981
- toggleCurrentGroupRow: (0, import_react29.useCallback)(() => {
6176
+ toggleCurrentGroupRow: (0, import_react28.useCallback)(() => {
5982
6177
  if (!rowInfo.isGroupRow) {
5983
6178
  return;
5984
6179
  }
@@ -5987,7 +6182,7 @@ function InfiniteTableColumnCellFn(props) {
5987
6182
  groupBy: computedDataSource.groupBy,
5988
6183
  pivotBy: computedDataSource.pivotBy
5989
6184
  });
5990
- const renderChildren = (0, import_react29.useCallback)(() => {
6185
+ const renderChildren = (0, import_react28.useCallback)(() => {
5991
6186
  if (hidden) {
5992
6187
  return null;
5993
6188
  }
@@ -6011,7 +6206,8 @@ function InfiniteTableColumnCellFn(props) {
6011
6206
  }
6012
6207
  style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
6013
6208
  style.height = rowHeight;
6014
- const memoizedStyle = (0, import_react29.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
6209
+ style.zIndex = `var(${columnZIndexAtIndex6}-${column.computedVisibleIndex})`;
6210
+ const memoizedStyle = (0, import_react28.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
6015
6211
  const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
6016
6212
  const zebra = showZebraRows ? odd ? "odd" : "even" : false;
6017
6213
  const cellProps = {
@@ -6034,7 +6230,7 @@ function InfiniteTableColumnCellFn(props) {
6034
6230
  }
6035
6231
  var InfiniteTableColumnCell = React29.memo(InfiniteTableColumnCellFn);
6036
6232
  function useInfiniteColumnCell() {
6037
- const result = (0, import_react29.useContext)(InfiniteTableColumnCellContext);
6233
+ const result = (0, import_react28.useContext)(InfiniteTableColumnCellContext);
6038
6234
  return result;
6039
6235
  }
6040
6236
 
@@ -6048,8 +6244,8 @@ var RowHoverCls = "_7pupv01";
6048
6244
  var React30 = __toModule(require("react"));
6049
6245
 
6050
6246
  // 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";
6247
+ var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11" };
6248
+ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11";
6053
6249
  var LoadMaskTextCls = "qy58ya4";
6054
6250
 
6055
6251
  // src/components/InfiniteTable/components/LoadMask.tsx
@@ -6081,24 +6277,40 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
6081
6277
  scrollRowIntoView(rowIndex, config = { offset: 0 }) {
6082
6278
  const state = getState();
6083
6279
  const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
6280
+ if (!scrollPosition) {
6281
+ return false;
6282
+ }
6084
6283
  const currentScrollPosition = state.brain.getScrollPosition();
6284
+ const scrollTopMax = state.brain.scrollTopMax;
6285
+ if (scrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
6286
+ return false;
6287
+ }
6085
6288
  if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
6086
6289
  state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
6087
6290
  }
6291
+ return true;
6088
6292
  },
6089
6293
  scrollColumnIntoView(colId, config = { offset: 0 }) {
6090
6294
  const state = getState();
6091
6295
  const computed = getComputed();
6092
6296
  const computedColumn = computed.computedVisibleColumnsMap.get(colId);
6093
6297
  if (!computedColumn) {
6094
- return;
6298
+ return false;
6095
6299
  }
6096
6300
  const colIndex = computedColumn.computedVisibleIndex;
6097
6301
  const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
6302
+ if (!scrollPosition) {
6303
+ return false;
6304
+ }
6098
6305
  const currentScrollPosition = state.brain.getScrollPosition();
6306
+ const scrollLeftMax = state.brain.scrollLeftMax;
6307
+ if (scrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
6308
+ return false;
6309
+ }
6099
6310
  if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
6100
6311
  state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
6101
6312
  }
6313
+ return true;
6102
6314
  },
6103
6315
  scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
6104
6316
  const state = getState();
@@ -6107,30 +6319,45 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
6107
6319
  if (typeof colIdOrIndex === "string") {
6108
6320
  const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
6109
6321
  if (!computedColumn) {
6110
- return;
6322
+ return false;
6111
6323
  }
6112
6324
  colIndex = computedColumn.computedVisibleIndex;
6113
6325
  }
6114
6326
  const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
6115
6327
  const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
6328
+ if (!scrollPositionForCol || !scrollPositionForRow) {
6329
+ return false;
6330
+ }
6116
6331
  const newScrollPosition = {
6117
6332
  scrollLeft: scrollPositionForCol.scrollLeft,
6118
6333
  scrollTop: scrollPositionForRow.scrollTop
6119
6334
  };
6120
6335
  const currentScrollPosition = state.brain.getScrollPosition();
6336
+ const scrollLeftMax = state.brain.scrollLeftMax;
6337
+ const scrollTopMax = state.brain.scrollTopMax;
6338
+ if (newScrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
6339
+ return false;
6340
+ }
6341
+ if (newScrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
6342
+ return false;
6343
+ }
6121
6344
  if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
6122
6345
  state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
6123
6346
  }
6124
6347
  if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
6125
6348
  state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
6126
6349
  }
6350
+ return true;
6127
6351
  }
6128
6352
  };
6353
+ if (false) {
6354
+ globalThis.imperativeApi = imperativeApi;
6355
+ }
6129
6356
  return imperativeApi;
6130
6357
  }
6131
6358
 
6132
6359
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
6133
- var import_react30 = __toModule(require("react"));
6360
+ var import_react29 = __toModule(require("react"));
6134
6361
  var OFFSET = 10;
6135
6362
  function getColumnContentMaxWidths(domRef, options) {
6136
6363
  var _a;
@@ -6196,11 +6423,11 @@ function useAutoSizeColumns() {
6196
6423
  componentActions,
6197
6424
  componentState: { domRef, ready, autoSizeColumnsKey, brain }
6198
6425
  } = useComponentState();
6199
- const [refreshId, setRefreshId] = (0, import_react30.useState)(0);
6426
+ const [refreshId, setRefreshId] = (0, import_react29.useState)(0);
6200
6427
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
6201
6428
  const getTheKey = useLatest(theKey);
6202
- const lastExecutedIdentifierRef = (0, import_react30.useRef)(null);
6203
- (0, import_react30.useEffect)(() => {
6429
+ const lastExecutedIdentifierRef = (0, import_react29.useRef)(null);
6430
+ (0, import_react29.useEffect)(() => {
6204
6431
  const key = getTheKey();
6205
6432
  if (key == null) {
6206
6433
  return;
@@ -6213,7 +6440,7 @@ function useAutoSizeColumns() {
6213
6440
  };
6214
6441
  return brain.onRenderRangeChange(onChange);
6215
6442
  }, [brain]);
6216
- (0, import_react30.useEffect)(() => {
6443
+ (0, import_react29.useEffect)(() => {
6217
6444
  var _a;
6218
6445
  if (theKey == null) {
6219
6446
  return;
@@ -6258,8 +6485,8 @@ function useAutoSizeColumns() {
6258
6485
  }
6259
6486
 
6260
6487
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
6488
+ var import_react30 = __toModule(require("react"));
6261
6489
  var import_react31 = __toModule(require("react"));
6262
- var import_react32 = __toModule(require("react"));
6263
6490
 
6264
6491
  // src/components/InfiniteTable/hooks/useYourBrain.ts
6265
6492
  function useYourBrain(param) {
@@ -6329,13 +6556,13 @@ function useCellRendering(param) {
6329
6556
  bodySize,
6330
6557
  rowspan
6331
6558
  });
6332
- const scrollTopMaxRef = (0, import_react31.useRef)(0);
6333
- (0, import_react31.useEffect)(() => {
6559
+ const scrollTopMaxRef = (0, import_react30.useRef)(0);
6560
+ (0, import_react30.useEffect)(() => {
6334
6561
  return brain.onRenderCountChange(() => {
6335
6562
  scrollTopMaxRef.current = brain.scrollTopMax;
6336
6563
  });
6337
6564
  }, [brain]);
6338
- (0, import_react31.useEffect)(() => {
6565
+ (0, import_react30.useEffect)(() => {
6339
6566
  return brain.onScrollStop((scrollPosition) => {
6340
6567
  const { scrollTop } = scrollPosition;
6341
6568
  if (scrollTop === 0) {
@@ -6352,7 +6579,7 @@ function useCellRendering(param) {
6352
6579
  }
6353
6580
  });
6354
6581
  }, [brain, onScrollToTop, onScrollToBottom]);
6355
- (0, import_react31.useEffect)(() => {
6582
+ (0, import_react30.useEffect)(() => {
6356
6583
  if (!bodySize.height) {
6357
6584
  return;
6358
6585
  }
@@ -6363,10 +6590,10 @@ function useCellRendering(param) {
6363
6590
  }
6364
6591
  }, [!!bodySize.height]);
6365
6592
  const [, rerender] = useRerender();
6366
- (0, import_react31.useEffect)(() => {
6593
+ (0, import_react30.useEffect)(() => {
6367
6594
  rerender();
6368
6595
  }, [dataSourceState]);
6369
- const renderCell = (0, import_react31.useCallback)((params) => {
6596
+ const renderCell = (0, import_react30.useCallback)((params) => {
6370
6597
  const {
6371
6598
  rowIndex,
6372
6599
  colIndex,
@@ -6401,7 +6628,7 @@ function useCellRendering(param) {
6401
6628
  rowStyle,
6402
6629
  rowClassName
6403
6630
  };
6404
- return /* @__PURE__ */ import_react32.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
6631
+ return /* @__PURE__ */ import_react31.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
6405
6632
  }, [
6406
6633
  rowHeight,
6407
6634
  getData,
@@ -6419,13 +6646,13 @@ function useCellRendering(param) {
6419
6646
  }
6420
6647
 
6421
6648
  // src/components/InfiniteTable/hooks/useComputed.ts
6422
- var import_react46 = __toModule(require("react"));
6649
+ var import_react45 = __toModule(require("react"));
6423
6650
 
6424
6651
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
6425
- var import_react34 = __toModule(require("react"));
6652
+ var import_react33 = __toModule(require("react"));
6426
6653
 
6427
6654
  // src/components/hooks/useInterceptedMap.ts
6428
- var import_react33 = __toModule(require("react"));
6655
+ var import_react32 = __toModule(require("react"));
6429
6656
  function interceptMap(map2, fns) {
6430
6657
  const { set, delete: deleteKey, clear } = map2;
6431
6658
  if (fns.set) {
@@ -6489,20 +6716,6 @@ function computeColumnGroupsDepths(columnGroups) {
6489
6716
  return map2;
6490
6717
  }
6491
6718
 
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
6719
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
6507
6720
  function useColumnGroups() {
6508
6721
  const {
@@ -6513,7 +6726,7 @@ function useColumnGroups() {
6513
6726
  componentActions,
6514
6727
  getComponentState
6515
6728
  } = useComponentState();
6516
- (0, import_react34.useEffect)(() => {
6729
+ (0, import_react33.useEffect)(() => {
6517
6730
  const recompute = () => {
6518
6731
  componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
6519
6732
  };
@@ -6524,7 +6737,7 @@ function useColumnGroups() {
6524
6737
  set: update
6525
6738
  });
6526
6739
  }, [computedColumnGroups]);
6527
- (0, import_react34.useEffect)(() => {
6740
+ (0, import_react33.useEffect)(() => {
6528
6741
  return interceptMap(collapsedColumnGroups, {
6529
6742
  set: (key, visibleCol) => {
6530
6743
  const colIds = key.slice(1);
@@ -6559,10 +6772,10 @@ function useColumnGroups() {
6559
6772
  }
6560
6773
 
6561
6774
  // src/components/InfiniteTable/hooks/useColumnRowspan.ts
6562
- var import_react35 = __toModule(require("react"));
6775
+ var import_react34 = __toModule(require("react"));
6563
6776
  function useColumnRowspan(computedVisibleColumns) {
6564
6777
  const { getState: getDataSourceState } = useDataSourceContextValue();
6565
- const rowspan = (0, import_react35.useMemo)(() => {
6778
+ const rowspan = (0, import_react34.useMemo)(() => {
6566
6779
  const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
6567
6780
  return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
6568
6781
  const dataArray = getDataSourceState().dataArray;
@@ -6588,10 +6801,10 @@ function useColumnRowspan(computedVisibleColumns) {
6588
6801
  }
6589
6802
 
6590
6803
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
6591
- var import_react36 = __toModule(require("react"));
6804
+ var import_react35 = __toModule(require("react"));
6592
6805
  var debug4 = dbg("useColumnSizeFn");
6593
6806
  function useColumnSizeFn(columns) {
6594
- const columnSize = (0, import_react36.useCallback)((index) => {
6807
+ const columnSize = (0, import_react35.useCallback)((index) => {
6595
6808
  const column = columns[index];
6596
6809
  if (false) {
6597
6810
  debug4("cannot find column at index", index, columns);
@@ -6602,7 +6815,7 @@ function useColumnSizeFn(columns) {
6602
6815
  }
6603
6816
 
6604
6817
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
6605
- var import_react42 = __toModule(require("react"));
6818
+ var import_react41 = __toModule(require("react"));
6606
6819
 
6607
6820
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
6608
6821
  var React34 = __toModule(require("react"));
@@ -6617,7 +6830,7 @@ var showLoadingIcon = (rowInfo) => {
6617
6830
 
6618
6831
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
6619
6832
  var React32 = __toModule(require("react"));
6620
- var import_react37 = __toModule(require("react"));
6833
+ var import_react36 = __toModule(require("react"));
6621
6834
 
6622
6835
  // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
6623
6836
  var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -6628,7 +6841,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ def
6628
6841
  function ExpanderIcon(props) {
6629
6842
  var _a;
6630
6843
  const { size = 24 } = props;
6631
- const [expanded, setExpanded] = (0, import_react37.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
6844
+ const [expanded, setExpanded] = (0, import_react36.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
6632
6845
  const onClick = () => {
6633
6846
  var _a2;
6634
6847
  (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
@@ -6829,11 +7042,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6829
7042
  }
6830
7043
 
6831
7044
  // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
6832
- var import_react38 = __toModule(require("react"));
7045
+ var import_react37 = __toModule(require("react"));
6833
7046
  function useEffectWithRaf(fn, deps) {
6834
- const rafId = (0, import_react38.useRef)(0);
6835
- const removeFnRaf = (0, import_react38.useRef)();
6836
- (0, import_react38.useEffect)(() => {
7047
+ const rafId = (0, import_react37.useRef)(0);
7048
+ const removeFnRaf = (0, import_react37.useRef)();
7049
+ (0, import_react37.useEffect)(() => {
6837
7050
  rafId.current = requestAnimationFrame(() => {
6838
7051
  removeFnRaf.current = fn();
6839
7052
  });
@@ -6850,7 +7063,7 @@ function useEffectWithRaf(fn, deps) {
6850
7063
  }
6851
7064
 
6852
7065
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
6853
- var import_react41 = __toModule(require("react"));
7066
+ var import_react40 = __toModule(require("react"));
6854
7067
 
6855
7068
  // src/utils/groupAndPivot/index.ts
6856
7069
  var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
@@ -7491,15 +7704,15 @@ var GroupRowsState = class {
7491
7704
  };
7492
7705
 
7493
7706
  // src/components/DataSource/privateHooks/useLoadData.ts
7494
- var import_react40 = __toModule(require("react"));
7707
+ var import_react39 = __toModule(require("react"));
7495
7708
 
7496
7709
  // src/components/hooks/useEffectWithChanges.ts
7497
- var import_react39 = __toModule(require("react"));
7710
+ var import_react38 = __toModule(require("react"));
7498
7711
  function useEffectWithChanges(fn, deps) {
7499
- const prevRef = (0, import_react39.useRef)({});
7500
- const oldValuesRef = (0, import_react39.useRef)({});
7712
+ const prevRef = (0, import_react38.useRef)({});
7713
+ const oldValuesRef = (0, import_react38.useRef)({});
7501
7714
  const oldValues = oldValuesRef.current;
7502
- const changesRef = (0, import_react39.useRef)({});
7715
+ const changesRef = (0, import_react38.useRef)({});
7503
7716
  const changes = changesRef.current;
7504
7717
  const useEffectDeps = [];
7505
7718
  for (const k in deps) {
@@ -7512,7 +7725,7 @@ function useEffectWithChanges(fn, deps) {
7512
7725
  }
7513
7726
  }
7514
7727
  prevRef.current = deps;
7515
- (0, import_react39.useEffect)(() => {
7728
+ (0, import_react38.useEffect)(() => {
7516
7729
  const changes2 = changesRef.current;
7517
7730
  const result = fn(changes2, oldValues);
7518
7731
  changesRef.current = {};
@@ -7780,12 +7993,12 @@ function useLoadData() {
7780
7993
  livePaginationCursor,
7781
7994
  cursorId: stateCursorId
7782
7995
  } = componentState;
7783
- const [scrollbars, setScrollbars] = (0, import_react40.useState)({
7996
+ const [scrollbars, setScrollbars] = (0, import_react39.useState)({
7784
7997
  vertical: false,
7785
7998
  horizontal: false
7786
7999
  });
7787
- const scrollbarsRef = (0, import_react40.useRef)(scrollbars);
7788
- (0, import_react40.useEffect)(() => {
8000
+ const scrollbarsRef = (0, import_react39.useRef)(scrollbars);
8001
+ (0, import_react39.useEffect)(() => {
7789
8002
  notifyScrollbarsChange.onChange((scrollbars2) => {
7790
8003
  if (!scrollbars2) {
7791
8004
  return;
@@ -7795,7 +8008,7 @@ function useLoadData() {
7795
8008
  });
7796
8009
  return () => notifyScrollbarsChange.destroy();
7797
8010
  }, [notifyScrollbarsChange]);
7798
- (0, import_react40.useEffect)(() => {
8011
+ (0, import_react39.useEffect)(() => {
7799
8012
  if (!livePagination) {
7800
8013
  return;
7801
8014
  }
@@ -7809,7 +8022,7 @@ function useLoadData() {
7809
8022
  });
7810
8023
  return () => cancelAnimationFrame(frameId);
7811
8024
  }, [livePaginationCursor]);
7812
- (0, import_react40.useEffect)(() => {
8025
+ (0, import_react39.useEffect)(() => {
7813
8026
  if (!livePagination || livePaginationCursor !== void 0) {
7814
8027
  return;
7815
8028
  }
@@ -7823,7 +8036,7 @@ function useLoadData() {
7823
8036
  });
7824
8037
  return () => cancelAnimationFrame(frameId);
7825
8038
  }, [dataArray.length, livePaginationCursor]);
7826
- (0, import_react40.useEffect)(() => {
8039
+ (0, import_react39.useEffect)(() => {
7827
8040
  const state = getComponentState();
7828
8041
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
7829
8042
  if (!scrollbars.vertical && livePagination2) {
@@ -7841,7 +8054,7 @@ function useLoadData() {
7841
8054
  filterValue,
7842
8055
  cursorId: livePagination ? stateCursorId : null
7843
8056
  };
7844
- const initialRef = (0, import_react40.useRef)(true);
8057
+ const initialRef = (0, import_react39.useRef)(true);
7845
8058
  useLazyLoadRange();
7846
8059
  useEffectWithChanges(() => {
7847
8060
  const componentState2 = getComponentState();
@@ -7873,7 +8086,7 @@ function useLazyLoadRange() {
7873
8086
  componentActions: actions,
7874
8087
  componentState
7875
8088
  } = useComponentState();
7876
- (0, import_react40.useEffect)(() => {
8089
+ (0, import_react39.useEffect)(() => {
7877
8090
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
7878
8091
  }, [componentState.data, componentState.dataParams]);
7879
8092
  const {
@@ -7882,7 +8095,7 @@ function useLazyLoadRange() {
7882
8095
  dataArray,
7883
8096
  scrollStopDelayUpdatedByTable
7884
8097
  } = componentState;
7885
- const latestRenderRangeRef = (0, import_react40.useRef)(null);
8098
+ const latestRenderRangeRef = (0, import_react39.useRef)(null);
7886
8099
  const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
7887
8100
  const componentState2 = getComponentState();
7888
8101
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -7901,8 +8114,8 @@ function useLazyLoadRange() {
7901
8114
  componentActions: actions
7902
8115
  }, cache);
7903
8116
  };
7904
- const debouncedLoadRange = (0, import_react40.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
7905
- (0, import_react40.useEffect)(() => {
8117
+ const debouncedLoadRange = (0, import_react39.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
8118
+ (0, import_react39.useEffect)(() => {
7906
8119
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
7907
8120
  return notifyRenderRangeChange.onChange((renderRange) => {
7908
8121
  latestRenderRangeRef.current = renderRange;
@@ -7911,7 +8124,7 @@ function useLazyLoadRange() {
7911
8124
  }
7912
8125
  return;
7913
8126
  }, [lazyLoadBatchSize]);
7914
- (0, import_react40.useEffect)(() => {
8127
+ (0, import_react39.useEffect)(() => {
7915
8128
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
7916
8129
  debouncedLoadRange();
7917
8130
  }
@@ -8752,7 +8965,7 @@ function DataSource(props) {
8752
8965
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
8753
8966
  function useToggleGroupRow() {
8754
8967
  const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
8755
- const toggleGroupRow = (0, import_react41.useCallback)((groupKeys) => {
8968
+ const toggleGroupRow = (0, import_react40.useCallback)((groupKeys) => {
8756
8969
  const state = getDataSourceState();
8757
8970
  const newState = new GroupRowsState(state.groupRowsState);
8758
8971
  newState.toggleGroupRow(groupKeys);
@@ -8784,7 +8997,7 @@ function useToggleGroupRow() {
8784
8997
 
8785
8998
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
8786
8999
  function useGroupByMap(groupBy) {
8787
- const groupByMap = (0, import_react42.useMemo)(() => {
9000
+ const groupByMap = (0, import_react41.useMemo)(() => {
8788
9001
  return groupBy.reduce((acc, groupBy2, index) => {
8789
9002
  acc.set(groupBy2.field, {
8790
9003
  groupBy: groupBy2,
@@ -8808,13 +9021,13 @@ function useColumnsWhen() {
8808
9021
  }
8809
9022
  } = useComponentState();
8810
9023
  const groupByMap = useGroupByMap(groupBy);
8811
- (0, import_react42.useEffect)(() => {
9024
+ (0, import_react41.useEffect)(() => {
8812
9025
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
8813
9026
  }, [groupRenderStrategy]);
8814
- (0, import_react42.useEffect)(() => {
9027
+ (0, import_react41.useEffect)(() => {
8815
9028
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
8816
9029
  }, [pivotTotalColumnPosition]);
8817
- (0, import_react42.useEffect)(() => {
9030
+ (0, import_react41.useEffect)(() => {
8818
9031
  if (pivotGrandTotalColumnPosition != void 0) {
8819
9032
  dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
8820
9033
  }
@@ -8888,7 +9101,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
8888
9101
  });
8889
9102
  return computedColumns.size === 0 ? void 0 : computedColumns;
8890
9103
  }
8891
- (0, import_react42.useEffect)(() => {
9104
+ (0, import_react41.useEffect)(() => {
8892
9105
  const update = () => {
8893
9106
  componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
8894
9107
  };
@@ -8917,7 +9130,7 @@ function useColumnsWhenGrouping() {
8917
9130
  }
8918
9131
  } = useComponentState();
8919
9132
  const toggleGroupRow = useToggleGroupRow();
8920
- (0, import_react42.useEffect)(() => {
9133
+ (0, import_react41.useEffect)(() => {
8921
9134
  const update = () => {
8922
9135
  const columnsWhenGrouping = getColumnsWhenGrouping({
8923
9136
  columns,
@@ -9053,7 +9266,7 @@ function useHideColumns(groupByMap) {
9053
9266
  hideEmptyGroupColumns ? groupRowsState : null,
9054
9267
  hideEmptyGroupColumns
9055
9268
  ]);
9056
- (0, import_react42.useEffect)(() => {
9269
+ (0, import_react41.useEffect)(() => {
9057
9270
  const isGrouped = groupBy.length > 0;
9058
9271
  const currentState = getComponentState();
9059
9272
  const { controlledColumnVisibility, columnVisibility } = currentState;
@@ -9168,7 +9381,7 @@ function getColumnsWhenGrouping(params) {
9168
9381
  }
9169
9382
 
9170
9383
  // src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
9171
- var import_react44 = __toModule(require("react"));
9384
+ var import_react43 = __toModule(require("react"));
9172
9385
 
9173
9386
  // src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
9174
9387
  var order = ["start", void 0, "end"];
@@ -9218,7 +9431,7 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
9218
9431
  };
9219
9432
  var getComputedPinned = (colId, columnPinning) => {
9220
9433
  const pinned = columnPinning.get(colId);
9221
- const computedPinned = pinned === "start" ? "start" : pinned === "end" ? "end" : false;
9434
+ const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
9222
9435
  return computedPinned;
9223
9436
  };
9224
9437
  var getComputedVisibleColumns = ({
@@ -9354,6 +9567,7 @@ var getComputedVisibleColumns = ({
9354
9567
  const id = visibleColumnOrder[i];
9355
9568
  const nextColumnId = visibleColumnOrder[i + 1];
9356
9569
  const colType = getColumnComputedType(c, columnTypes);
9570
+ const computedVisibleIndex = i;
9357
9571
  const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
9358
9572
  const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
9359
9573
  const computedSorted = !!computedSortInfo;
@@ -9366,7 +9580,15 @@ var getComputedVisibleColumns = ({
9366
9580
  const computedMaxWidth = maxSizes[i] || 1e4;
9367
9581
  const computedPinned = getComputedPinned(id, columnPinning);
9368
9582
  const computedLast = i === visibleColumnOrder.length - 1;
9583
+ let computedVisibleIndexInCategory = computedVisibleIndex;
9369
9584
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
9585
+ if (computedPinned == "start") {
9586
+ computedVisibleIndexInCategory = computedVisibleIndex;
9587
+ } else if (computedPinned === "end") {
9588
+ computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
9589
+ } else {
9590
+ computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
9591
+ }
9370
9592
  const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
9371
9593
  const computedFirstInCategory = computedPinned !== prevPinned;
9372
9594
  const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
@@ -9415,6 +9637,7 @@ var getComputedVisibleColumns = ({
9415
9637
  computedWidth,
9416
9638
  computedAbsoluteOffset,
9417
9639
  computedPinningOffset,
9640
+ computedVisibleIndexInCategory,
9418
9641
  computedOffset,
9419
9642
  computedSortable,
9420
9643
  computedSortInfo,
@@ -9423,7 +9646,7 @@ var getComputedVisibleColumns = ({
9423
9646
  computedSorted,
9424
9647
  computedSortedAsc,
9425
9648
  computedSortedDesc,
9426
- computedVisibleIndex: i,
9649
+ computedVisibleIndex,
9427
9650
  computedPinned,
9428
9651
  computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
9429
9652
  computedFirstInCategory,
@@ -9516,10 +9739,10 @@ var getComputedVisibleColumns = ({
9516
9739
  };
9517
9740
 
9518
9741
  // src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
9519
- var import_react43 = __toModule(require("react"));
9742
+ var import_react42 = __toModule(require("react"));
9520
9743
  var useRerenderOnKeyChange = (map2) => {
9521
9744
  const [renderId, rerender] = useRerender();
9522
- (0, import_react43.useEffect)(() => {
9745
+ (0, import_react42.useEffect)(() => {
9523
9746
  const update = rafFn(rerender);
9524
9747
  return interceptMap(map2, {
9525
9748
  set: update,
@@ -9573,7 +9796,7 @@ var useComputedVisibleColumns = ({
9573
9796
  computedPinnedEndOffset,
9574
9797
  computedPinnedEndWidth,
9575
9798
  computedPinnedStartWidth
9576
- } = (0, import_react44.useMemo)(() => {
9799
+ } = (0, import_react43.useMemo)(() => {
9577
9800
  return getComputedVisibleColumns({
9578
9801
  columns,
9579
9802
  bodySize,
@@ -9644,7 +9867,7 @@ var useComputedVisibleColumns = ({
9644
9867
  };
9645
9868
 
9646
9869
  // src/components/InfiniteTable/hooks/useScrollbars.ts
9647
- var import_react45 = __toModule(require("react"));
9870
+ var import_react44 = __toModule(require("react"));
9648
9871
  var INITIAL_SCROLLBARS = {
9649
9872
  vertical: false,
9650
9873
  horizontal: false
@@ -9652,8 +9875,8 @@ var INITIAL_SCROLLBARS = {
9652
9875
  function useScrollbars(brain) {
9653
9876
  const { getComponentState: getInfiniteTableState } = useComponentState();
9654
9877
  const { getState: getDataSourceState } = useDataSourceContextValue();
9655
- const [scrollbars, setScrollbars] = (0, import_react45.useState)(INITIAL_SCROLLBARS);
9656
- (0, import_react45.useEffect)(() => {
9878
+ const [scrollbars, setScrollbars] = (0, import_react44.useState)(INITIAL_SCROLLBARS);
9879
+ (0, import_react44.useEffect)(() => {
9657
9880
  return brain.onRenderCountChange(() => {
9658
9881
  const { scrollTopMax, scrollLeftMax } = brain;
9659
9882
  setScrollbars({
@@ -9662,7 +9885,7 @@ function useScrollbars(brain) {
9662
9885
  });
9663
9886
  });
9664
9887
  }, [brain]);
9665
- (0, import_react45.useLayoutEffect)(() => {
9888
+ (0, import_react44.useLayoutEffect)(() => {
9666
9889
  const dataSourceState = getDataSourceState();
9667
9890
  const { onScrollbarsChange } = getInfiniteTableState();
9668
9891
  const { notifyScrollbarsChange } = dataSourceState;
@@ -9693,7 +9916,7 @@ function useComputed() {
9693
9916
  bodySize,
9694
9917
  showSeparatePivotColumnForSingleAggregation
9695
9918
  } = componentState;
9696
- (0, import_react46.useState)(() => {
9919
+ (0, import_react45.useState)(() => {
9697
9920
  componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
9698
9921
  if (rowHeight) {
9699
9922
  componentActions.rowHeight = rowHeight;
@@ -9705,13 +9928,13 @@ function useComputed() {
9705
9928
  }
9706
9929
  });
9707
9930
  });
9708
- (0, import_react46.useEffect)(() => {
9931
+ (0, import_react45.useEffect)(() => {
9709
9932
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
9710
9933
  }, [showSeparatePivotColumnForSingleAggregation]);
9711
9934
  const { multiSort, filterValue } = dataSourceState;
9712
9935
  useColumnGroups();
9713
9936
  const { toggleGroupRow } = useColumnsWhen();
9714
- const setSortInfo = (0, import_react46.useCallback)((sortInfo) => {
9937
+ const setSortInfo = (0, import_react45.useCallback)((sortInfo) => {
9715
9938
  var _a2;
9716
9939
  const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
9717
9940
  dataSourceActions.sortInfo = newSortInfo;
@@ -9788,109 +10011,8 @@ function useComputed() {
9788
10011
  };
9789
10012
  }
9790
10013
 
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
10014
  // src/components/InfiniteTable/hooks/useLicense/useLicense.ts
9893
- var import_react47 = __toModule(require("react"));
10015
+ var import_react46 = __toModule(require("react"));
9894
10016
 
9895
10017
  // src/components/InfiniteTable/hooks/useLicense/crc32.ts
9896
10018
  var DEFAULT_ReversedPolynomial = 3988292384;
@@ -10048,10 +10170,10 @@ var isInsideSandbox = () => {
10048
10170
  };
10049
10171
  var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
10050
10172
  var useLicense = (licenseKey = "") => {
10051
- const valid = (0, import_react47.useMemo)(() => {
10173
+ const valid = (0, import_react46.useMemo)(() => {
10052
10174
  let valid2 = isValidLicense(licenseKey, {
10053
10175
  publishedAt: 1624970570587,
10054
- version: "0.3.15"
10176
+ version: "0.3.18"
10055
10177
  });
10056
10178
  if (!licenseKey && !valid2 && isInsidePlayground) {
10057
10179
  return true;
@@ -10061,6 +10183,73 @@ var useLicense = (licenseKey = "") => {
10061
10183
  return valid;
10062
10184
  };
10063
10185
 
10186
+ // src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
10187
+ var import_react47 = __toModule(require("react"));
10188
+ var RETRIES = 10;
10189
+ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
10190
+ const didScrollRef = (0, import_react47.useRef)(false);
10191
+ const rafId = (0, import_react47.useRef)(null);
10192
+ (0, import_react47.useEffect)(() => {
10193
+ if (activeCellIndex != null) {
10194
+ didScrollRef.current = false;
10195
+ cancelAnimationFrame(rafId.current);
10196
+ }
10197
+ }, [activeCellIndex]);
10198
+ (0, import_react47.useEffect)(() => {
10199
+ if (activeCellIndex != null && !didScrollRef.current) {
10200
+ let tryScroll = function(times = 0) {
10201
+ times++;
10202
+ cancelAnimationFrame(rafId.current);
10203
+ rafId.current = requestAnimationFrame(() => {
10204
+ didScrollRef.current = imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
10205
+ offset: 30
10206
+ });
10207
+ if (!didScrollRef.current && times < RETRIES) {
10208
+ tryScroll(times);
10209
+ }
10210
+ });
10211
+ };
10212
+ tryScroll();
10213
+ }
10214
+ return () => {
10215
+ cancelAnimationFrame(rafId.current);
10216
+ };
10217
+ }, [activeCellIndex, dataCount]);
10218
+ }
10219
+
10220
+ // src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
10221
+ var import_react48 = __toModule(require("react"));
10222
+ var RETRIES2 = 10;
10223
+ function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
10224
+ const didScrollRef = (0, import_react48.useRef)(false);
10225
+ const rafId = (0, import_react48.useRef)(null);
10226
+ (0, import_react48.useEffect)(() => {
10227
+ if (activeRowIndex != null) {
10228
+ didScrollRef.current = false;
10229
+ cancelAnimationFrame(rafId.current);
10230
+ }
10231
+ }, [activeRowIndex]);
10232
+ (0, import_react48.useEffect)(() => {
10233
+ if (activeRowIndex != null && !didScrollRef.current) {
10234
+ let tryScroll = function(times = 0) {
10235
+ times++;
10236
+ rafId.current = requestAnimationFrame(() => {
10237
+ didScrollRef.current = imperativeApi.scrollRowIntoView(activeRowIndex, {
10238
+ offset: 30
10239
+ });
10240
+ if (!didScrollRef.current && times < RETRIES2) {
10241
+ tryScroll(times);
10242
+ }
10243
+ });
10244
+ };
10245
+ tryScroll();
10246
+ }
10247
+ return () => {
10248
+ cancelAnimationFrame(rafId.current);
10249
+ };
10250
+ }, [activeRowIndex, dataCount]);
10251
+ }
10252
+
10064
10253
  // src/components/utils/clamp.ts
10065
10254
  function clamp(value, min, max) {
10066
10255
  return Math.min(Math.max(value, min), max);
@@ -10209,7 +10398,7 @@ function handleKeyboardNavigation(options) {
10209
10398
  }
10210
10399
 
10211
10400
  // src/components/InfiniteTable/state/getInitialState.ts
10212
- var import_react48 = __toModule(require("react"));
10401
+ var import_react49 = __toModule(require("react"));
10213
10402
 
10214
10403
  // src/components/VirtualBrain/ScrollListener.ts
10215
10404
  var initialScrollPosition = {
@@ -10304,11 +10493,10 @@ function initSetupState2() {
10304
10493
  propsCache: new Map([]),
10305
10494
  brain,
10306
10495
  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)(),
10496
+ domRef: (0, import_react49.createRef)(),
10497
+ scrollerDOMRef: (0, import_react49.createRef)(),
10498
+ portalDOMRef: (0, import_react49.createRef)(),
10499
+ activeCellIndicatorDOMRef: (0, import_react49.createRef)(),
10312
10500
  onRowHeightCSSVarChange: buildSubscriptionCallback(),
10313
10501
  onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
10314
10502
  bodySize: {
@@ -10319,11 +10507,11 @@ function initSetupState2() {
10319
10507
  scrollTop: 0,
10320
10508
  scrollLeft: 0
10321
10509
  },
10510
+ columnReorderInProgress: false,
10322
10511
  ready: false,
10323
10512
  focused: false,
10324
10513
  focusedWithin: false,
10325
10514
  columnsWhenGrouping: columnsGeneratedForGrouping,
10326
- draggingColumnId: null,
10327
10515
  pinnedStartScrollListener: new ScrollListener(),
10328
10516
  pinnedEndScrollListener: new ScrollListener(),
10329
10517
  columnsWhenInlineGroupRenderStrategy: void 0
@@ -10377,7 +10565,6 @@ var forwardProps3 = (setupState) => {
10377
10565
  pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
10378
10566
  pivotGrandTotalColumnPosition: 1,
10379
10567
  licenseKey: (licenseKey) => licenseKey || "",
10380
- keyboardNavigation: (keyboardNavigation) => keyboardNavigation != null ? keyboardNavigation : "cell",
10381
10568
  activeRowIndex: 1,
10382
10569
  activeCellIndex: 1,
10383
10570
  columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
@@ -10424,7 +10611,7 @@ var cleanupState = (state) => {
10424
10611
  state.pinnedStartScrollListener.destroy();
10425
10612
  };
10426
10613
  var mapPropsToState2 = (params) => {
10427
- var _a, _b;
10614
+ var _a, _b, _c;
10428
10615
  const { props, state, oldState, parentState } = params;
10429
10616
  const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
10430
10617
  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 +10627,8 @@ var mapPropsToState2 = (params) => {
10440
10627
  groupRenderStrategy,
10441
10628
  groupBy,
10442
10629
  computedColumns,
10443
- columnHeaderCssEllipsis: (_b = (_a = props.columnHeaderCssEllipsis) != null ? _a : props.columnCssEllipsis) != null ? _b : true,
10630
+ keyboardNavigation: (_a = state.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
10631
+ columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
10444
10632
  columnGroupsDepthsMap,
10445
10633
  columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
10446
10634
  computedColumnGroups,
@@ -10477,11 +10665,11 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10477
10665
  getState
10478
10666
  } = useInfiniteTable();
10479
10667
  const {
10480
- componentState: { loading },
10668
+ componentState: { loading, dataArray },
10481
10669
  getState: getDataSourceState,
10482
10670
  componentActions: dataSourceActions
10483
10671
  } = useDataSourceContextValue();
10484
- const [imperativeApi] = (0, import_react49.useState)(() => {
10672
+ const [imperativeApi] = (0, import_react50.useState)(() => {
10485
10673
  return getImperativeApi(getState, getComputed, getDataSourceState, actions);
10486
10674
  });
10487
10675
  const {
@@ -10505,27 +10693,14 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10505
10693
  activeCellIndex,
10506
10694
  onRenderUpdater
10507
10695
  } = 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;
10696
+ useScrollToActiveRow(activeRowIndex, dataArray.length, imperativeApi);
10697
+ useScrollToActiveCell(activeCellIndex, dataArray.length, imperativeApi);
10698
+ const { bodySize } = componentState;
10523
10699
  const { scrollbars } = computed;
10524
10700
  const { renderCell } = useCellRendering({
10525
10701
  imperativeApi,
10526
10702
  getComputed,
10527
10703
  domRef: componentState.domRef,
10528
- columnShifts,
10529
10704
  bodySize,
10530
10705
  computed
10531
10706
  });
@@ -10547,7 +10722,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10547
10722
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
10548
10723
  }, [scrollStopDelay]);
10549
10724
  useAutoSizeColumns();
10550
- const onKeyDown = (0, import_react49.useCallback)((event) => {
10725
+ const onKeyDown = (0, import_react50.useCallback)((event) => {
10551
10726
  if (handleKeyboardNavigation({
10552
10727
  getState,
10553
10728
  actions,
@@ -10569,7 +10744,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10569
10744
  }) : null, /* @__PURE__ */ React36.createElement(InfiniteTableBody, null, /* @__PURE__ */ React36.createElement(HeadlessTable, {
10570
10745
  tabIndex: 0,
10571
10746
  activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
10572
- activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
10747
+ activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
10573
10748
  scrollStopDelay,
10574
10749
  renderer,
10575
10750
  onRenderUpdater,
@@ -10581,7 +10756,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10581
10756
  visible: loading
10582
10757
  }, loadingText)), /* @__PURE__ */ React36.createElement("div", {
10583
10758
  ref: portalDOMRef,
10584
- className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
10759
+ className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
10585
10760
  }), rowHeightCSSVar ? /* @__PURE__ */ React36.createElement(CSSVariableWatch, {
10586
10761
  varName: rowHeightCSSVar,
10587
10762
  onChange: onRowHeightCSSVarChange