@infinite-table/infinite-react 0.3.17 → 0.3.20

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
@@ -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)", 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)" } } };
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)", columnReorderEffectDurationAtIndex: "var(--_1slvgu9a)", columnWidthAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndex: "var(--_1slvgu9c)", columnOffsetAtIndexWhileReordering: "var(--_1slvgu9d)", columnZIndexAtIndex: "var(--_1slvgu9e)", pinnedStartWidth: "var(--_1slvgu9f)", pinnedEndWidth: "var(--_1slvgu9g)", pinnedStartDraggingWidth: "var(--_1slvgu9h)", pinnedEndDraggingWidth: "var(--_1slvgu9i)", pinnedEndOffset: "var(--_1slvgu9j)", computedVisibleColumnsCount: "var(--_1slvgu9k)", baseZIndexForCells: "var(--_1slvgu9l)", bodyWidth: "var(--_1slvgu9m)", bodyHeight: "var(--_1slvgu9n)", scrollbarWidthHorizontal: "var(--_1slvgu9o)", scrollbarWidthVertical: "var(--_1slvgu9p)", scrollLeft: "var(--_1slvgu9q)", scrollTop: "var(--_1slvgu9r)" };
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)", pinnedBorder: "var(--infinite-pinned-cell-border)", 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
@@ -1121,8 +1121,11 @@ var InfiniteSelector = `.${internalProps.rootClassName}`;
1121
1121
  function getParentInfiniteNode(node) {
1122
1122
  return selectParent(node, InfiniteSelector);
1123
1123
  }
1124
+ var scrollLeft = stripVar(InternalVars.scrollLeft);
1125
+ var scrollTop = stripVar(InternalVars.scrollTop);
1124
1126
  var columnWidthAtIndex = stripVar(InternalVars.columnWidthAtIndex);
1125
1127
  var columnOffsetAtIndex = stripVar(InternalVars.columnOffsetAtIndex);
1128
+ var columnReorderEffectDurationAtIndex = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
1126
1129
  var columnOffsetAtIndexWhileReordering = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
1127
1130
  var columnZIndexAtIndex = stripVar(InternalVars.columnZIndexAtIndex);
1128
1131
  function setInfiniteVarOnRoot(varName, varValue, node) {
@@ -1148,18 +1151,34 @@ function setInfiniteColumnWidth(colIndex, colWidth, node) {
1148
1151
  function setInfiniteColumnOffset(colIndex, colOffset, node) {
1149
1152
  setInfiniteVarOnRoot(`${columnOffsetAtIndex}-${colIndex}`, typeof colOffset === "number" ? colOffset + "px" : colOffset, node);
1150
1153
  }
1154
+ function addToInfiniteColumnOffset(column, amountToAdd, node) {
1155
+ setInfiniteVarOnRoot(`${columnOffsetAtIndex}-${column.computedVisibleIndex}`, !column.computedPinned ? `${column.computedAbsoluteOffset + amountToAdd}px` : `calc( ${column.computedAbsoluteOffset + amountToAdd}px + var(${scrollLeft}))`, node);
1156
+ }
1151
1157
  function setInfiniteColumnZIndex(colIndex, colZIndex, node) {
1152
1158
  setInfiniteVarOnRoot(`${columnZIndexAtIndex}-${colIndex}`, `${colZIndex}`, node);
1153
1159
  }
1154
1160
  function setInfiniteColumnOffsetWhileReordering(colIndex, offset, node) {
1155
1161
  setInfiniteVarOnRoot(`${columnOffsetAtIndexWhileReordering}-${colIndex}`, typeof offset === "number" ? `calc( var(${columnOffsetAtIndex}-${colIndex}) + ${offset}px )` : offset, node);
1156
1162
  }
1163
+ function clearInfiniteColumnReorderDuration(colIndex, node, defaultValue) {
1164
+ setInfiniteVarOnRoot(`${columnReorderEffectDurationAtIndex}-${colIndex}`, defaultValue != null ? defaultValue : "", node);
1165
+ }
1166
+ function restoreInfiniteColumnReorderDuration(colIndex, node) {
1167
+ const varName = `${columnReorderEffectDurationAtIndex}-${colIndex}`;
1168
+ setInfiniteVarOnRoot(varName, ThemeVars.components.Cell.reorderEffectDuration, node);
1169
+ }
1157
1170
  function getCSSVarNameForColWidth(colIndex) {
1158
1171
  return `${columnWidthAtIndex}-${colIndex}`;
1159
1172
  }
1160
1173
  function getCSSVarNameForColOffset(colIndex) {
1161
1174
  return `${columnOffsetAtIndex}-${colIndex}`;
1162
1175
  }
1176
+ function setInfiniteScrollPosition(scrollPosition, node) {
1177
+ setInfiniteVarsOnNode({
1178
+ [scrollLeft]: `${scrollPosition.scrollLeft}px`,
1179
+ [scrollTop]: `${scrollPosition.scrollTop}px`
1180
+ }, node);
1181
+ }
1163
1182
 
1164
1183
  // src/components/VirtualBrain/MatrixBrain.ts
1165
1184
  var import_binary_search = __toModule(require_binary_search());
@@ -1493,11 +1512,11 @@ var MatrixBrain = class extends Logger {
1493
1512
  }
1494
1513
  return sum2;
1495
1514
  };
1496
- this.getFixedEndColsOffsets = () => {
1515
+ this.getFixedEndColsOffsets = ({ skipScroll } = { skipScroll: false }) => {
1497
1516
  if (!this.fixedColsEnd) {
1498
1517
  return [];
1499
1518
  }
1500
- const { scrollLeft } = this.scrollPosition;
1519
+ const { scrollLeft: scrollLeft2 } = this.scrollPosition;
1501
1520
  const { width } = this.getAvailableSize();
1502
1521
  const offsets = [];
1503
1522
  const widths = [];
@@ -1507,7 +1526,7 @@ var MatrixBrain = class extends Logger {
1507
1526
  widths.push(colWidth);
1508
1527
  sum2 += colWidth;
1509
1528
  }
1510
- const baseOffset = width - sum2 + scrollLeft;
1529
+ const baseOffset = width - sum2 + (skipScroll ? 0 : scrollLeft2);
1511
1530
  sum2 = 0;
1512
1531
  let index = 0;
1513
1532
  for (let colIndex = this.cols - this.fixedColsEnd; colIndex < this.cols; colIndex++) {
@@ -1518,11 +1537,11 @@ var MatrixBrain = class extends Logger {
1518
1537
  }
1519
1538
  return offsets;
1520
1539
  };
1521
- this.getFixedEndRowsOffsets = () => {
1540
+ this.getFixedEndRowsOffsets = ({ skipScroll } = { skipScroll: false }) => {
1522
1541
  if (!this.fixedRowsEnd) {
1523
1542
  return [];
1524
1543
  }
1525
- const { scrollTop } = this.scrollPosition;
1544
+ const { scrollTop: scrollTop2 } = this.scrollPosition;
1526
1545
  const { height } = this.getAvailableSize();
1527
1546
  const offsets = [];
1528
1547
  const heights = [];
@@ -1532,7 +1551,7 @@ var MatrixBrain = class extends Logger {
1532
1551
  heights.push(rowHeight);
1533
1552
  sum2 += rowHeight;
1534
1553
  }
1535
- const baseOffset = height - sum2 + scrollTop;
1554
+ const baseOffset = height - sum2 + (skipScroll ? 0 : scrollTop2);
1536
1555
  sum2 = 0;
1537
1556
  let index = 0;
1538
1557
  for (let rowIndex = this.rows - this.fixedRowsEnd; rowIndex < this.rows; rowIndex++) {
@@ -1594,6 +1613,12 @@ var MatrixBrain = class extends Logger {
1594
1613
  horizontal,
1595
1614
  vertical
1596
1615
  }) => {
1616
+ if (horizontal === void 0) {
1617
+ horizontal = this.horizontalRenderCount;
1618
+ }
1619
+ if (vertical === void 0) {
1620
+ vertical = this.verticalRenderCount;
1621
+ }
1597
1622
  const horizontalSame = horizontal === this.horizontalRenderCount;
1598
1623
  const verticalSame = vertical === this.verticalRenderCount;
1599
1624
  if (horizontalSame && verticalSame) {
@@ -2662,6 +2687,7 @@ var MappedCells = class extends Logger {
2662
2687
  // src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx
2663
2688
  var ITEM_POSITION_WITH_TRANSFORM = true;
2664
2689
  var currentColumnTransformY = stripVar(InternalVars.currentColumnTransformY);
2690
+ var scrollTopCSSVar = stripVar(InternalVars.scrollTop);
2665
2691
  var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
2666
2692
  var columnOffsetAtIndexWhileReordering2 = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
2667
2693
  var ReactHeadlessTableRenderer = class extends Logger {
@@ -2678,14 +2704,15 @@ var ReactHeadlessTableRenderer = class extends Logger {
2678
2704
  this.currentHoveredRow = -1;
2679
2705
  this.hoverRowUpdatesInProgress = new Map();
2680
2706
  this.infiniteNode = null;
2681
- this.setTransform = (element, _rowIndex, colIndex, x, y, zIndex2) => {
2707
+ this.setTransform = (element, _rowIndex, colIndex, {
2708
+ x,
2709
+ y,
2710
+ scrollLeft: scrollLeft2,
2711
+ scrollTop: scrollTop2
2712
+ }, zIndex2) => {
2682
2713
  const columnOffsetX = `${columnOffsetAtIndex2}-${colIndex}`;
2683
2714
  const columnOffsetXWhileReordering = `${columnOffsetAtIndexWhileReordering2}-${colIndex}`;
2684
- if (!this.infiniteNode) {
2685
- this.infiniteNode = getParentInfiniteNode(element);
2686
- }
2687
- this.infiniteNode.style.setProperty(columnOffsetX, `${x}px`);
2688
- element.style.setProperty(currentColumnTransformY, `${y}px`);
2715
+ element.style.setProperty(currentColumnTransformY, scrollTop2 ? `calc( ${y}px + var(${scrollTopCSSVar}) )` : `${y}px`);
2689
2716
  element.style.transform = `translate3d(var(${columnOffsetXWhileReordering}, var(${columnOffsetX})), ${InternalVars.currentColumnTransformY}, 0)`;
2690
2717
  if (zIndex2 != null) {
2691
2718
  }
@@ -2729,18 +2756,18 @@ var ReactHeadlessTableRenderer = class extends Logger {
2729
2756
  if (!scrollAdjustPosition) {
2730
2757
  scrollAdjustPosition = rowOffset > bottom - fixedEndRowsHeight ? "end" : rowOffset < top2 + fixedStartRowsHeight ? "start" : "end";
2731
2758
  }
2732
- let scrollTop = scrollPosition.scrollTop;
2759
+ let scrollTop2 = scrollPosition.scrollTop;
2733
2760
  if (scrollAdjustPosition === "center") {
2734
- scrollTop = rowOffset - Math.floor((brain.getAvailableSize().height - fixedStartRowsHeight - fixedEndRowsHeight) / 2);
2761
+ scrollTop2 = rowOffset - Math.floor((brain.getAvailableSize().height - fixedStartRowsHeight - fixedEndRowsHeight) / 2);
2735
2762
  } else if (scrollAdjustPosition === "start") {
2736
2763
  offset = -offset;
2737
- scrollTop += rowOffset - top2 + offset - fixedStartRowsHeight;
2764
+ scrollTop2 += rowOffset - top2 + offset - fixedStartRowsHeight;
2738
2765
  } else {
2739
2766
  offset += rowHeight;
2740
- scrollTop += rowOffset - bottom + offset + fixedEndRowsHeight;
2767
+ scrollTop2 += rowOffset - bottom + offset + fixedEndRowsHeight;
2741
2768
  }
2742
2769
  return __spreadProps(__spreadValues({}, scrollPosition), {
2743
- scrollTop
2770
+ scrollTop: scrollTop2
2744
2771
  });
2745
2772
  };
2746
2773
  this.getScrollPositionForScrollColumnIntoView = (colIndex, config = { offset: 0 }) => {
@@ -2763,18 +2790,18 @@ var ReactHeadlessTableRenderer = class extends Logger {
2763
2790
  if (!scrollAdjustPosition) {
2764
2791
  scrollAdjustPosition = colOffset > right - fixedEndColsWidth ? "end" : colOffset < left2 + fixedStartColsWidth ? "start" : "end";
2765
2792
  }
2766
- let scrollLeft = scrollPosition.scrollLeft;
2793
+ let scrollLeft2 = scrollPosition.scrollLeft;
2767
2794
  if (scrollAdjustPosition === "center") {
2768
- scrollLeft = colOffset - Math.floor((brain.getAvailableSize().width - fixedStartColsWidth - fixedEndColsWidth) / 2);
2795
+ scrollLeft2 = colOffset - Math.floor((brain.getAvailableSize().width - fixedStartColsWidth - fixedEndColsWidth) / 2);
2769
2796
  } else if (scrollAdjustPosition === "start") {
2770
2797
  offset = -offset;
2771
- scrollLeft += colOffset - left2 + offset - fixedStartColsWidth;
2798
+ scrollLeft2 += colOffset - left2 + offset - fixedStartColsWidth;
2772
2799
  } else {
2773
2800
  offset += colWidth;
2774
- scrollLeft += colOffset - right + offset + fixedEndColsWidth;
2801
+ scrollLeft2 += colOffset - right + offset + fixedEndColsWidth;
2775
2802
  }
2776
2803
  return __spreadProps(__spreadValues({}, scrollPosition), {
2777
- scrollLeft
2804
+ scrollLeft: scrollLeft2
2778
2805
  });
2779
2806
  };
2780
2807
  this.getScrollPositionForScrollCellIntoView = (rowIndex, colIndex, config = { offsetLeft: 0, offsetTop: 0 }) => {
@@ -2789,9 +2816,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
2789
2816
  if (!scrollPosForCol || !scrollPosForRow) {
2790
2817
  return null;
2791
2818
  }
2792
- const { scrollLeft } = scrollPosForCol;
2793
- const { scrollTop } = scrollPosForRow;
2794
- return { scrollLeft, scrollTop };
2819
+ const { scrollLeft: scrollLeft2 } = scrollPosForCol;
2820
+ const { scrollTop: scrollTop2 } = scrollPosForRow;
2821
+ return { scrollLeft: scrollLeft2, scrollTop: scrollTop2 };
2795
2822
  };
2796
2823
  this.isRowFullyVisible = (rowIndex, offsetMargin = 2) => {
2797
2824
  return this.isRowVisible(rowIndex, this.brain.getRowHeight(rowIndex) - offsetMargin);
@@ -3178,10 +3205,10 @@ var ReactHeadlessTableRenderer = class extends Logger {
3178
3205
  }
3179
3206
  };
3180
3207
  raf(() => {
3181
- checkHoverClass();
3182
- if (false) {
3208
+ if (this.destroyed) {
3183
3209
  return;
3184
3210
  }
3211
+ checkHoverClass();
3185
3212
  this.hoverRowUpdatesInProgress.delete(rowIndex);
3186
3213
  });
3187
3214
  };
@@ -3205,7 +3232,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3205
3232
  itemElement.dataset.rowIndex = rowIndex;
3206
3233
  itemElement.dataset.colIndex = colIndex;
3207
3234
  if (ITEM_POSITION_WITH_TRANSFORM) {
3208
- this.setTransform(itemElement, rowIndex, colIndex, x, y, null);
3235
+ this.setTransform(itemElement, rowIndex, colIndex, { x, y }, null);
3209
3236
  itemElement.style.willChange = "transform";
3210
3237
  itemElement.style.backfaceVisibility = "hidden";
3211
3238
  const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
@@ -3234,8 +3261,15 @@ var ReactHeadlessTableRenderer = class extends Logger {
3234
3261
  if (!fixedColsStart && !fixedColsEnd && !fixedRowsStart && !fixedRowsEnd) {
3235
3262
  return;
3236
3263
  }
3237
- const fixedEndColsOffsets = this.brain.getFixedEndColsOffsets();
3238
- const fixedEndRowsOffsets = this.brain.getFixedEndRowsOffsets();
3264
+ if (itemDOMElements[0]) {
3265
+ setInfiniteScrollPosition(scrollPosition, this.getInfiniteNode(itemDOMElements[0]));
3266
+ }
3267
+ const fixedEndColsOffsets = this.brain.getFixedEndColsOffsets({
3268
+ skipScroll: true
3269
+ });
3270
+ const fixedEndRowsOffsets = this.brain.getFixedEndRowsOffsets({
3271
+ skipScroll: true
3272
+ });
3239
3273
  const { start, end } = this.brain.getRenderRange();
3240
3274
  const [startRow, startCol] = start;
3241
3275
  const [endRow, endCol] = end;
@@ -3247,33 +3281,48 @@ var ReactHeadlessTableRenderer = class extends Logger {
3247
3281
  const itemPosition = brain.getCellOffset(rowIndex, colIndex);
3248
3282
  const node = itemDOMElements[elementIndex];
3249
3283
  if (elementIndex != null && node && itemPosition) {
3250
- fn(rowIndex, colIndex, node, itemPosition, scrollPosition);
3284
+ fn(rowIndex, colIndex, node, itemPosition);
3251
3285
  }
3252
3286
  }
3253
- const adjustColStart = (_rowIndex, colIndex, node, { x, y }, { scrollLeft }) => {
3254
- this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y, fixedColsStart - colIndex);
3287
+ const adjustColStart = (_rowIndex, colIndex, node, { x, y }) => {
3288
+ this.setTransform(node, _rowIndex, colIndex, { x, y, scrollLeft: true }, fixedColsStart - colIndex);
3255
3289
  };
3256
- const adjustRowStart = (rowIndex, _colIndex, node, coords, scrollPosition2) => {
3257
- this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop, fixedRowsStart - rowIndex);
3290
+ const adjustRowStart = (rowIndex, _colIndex, node, coords) => {
3291
+ this.setTransform(node, rowIndex, _colIndex, { x: coords.x, y: coords.y, scrollTop: true }, fixedRowsStart - rowIndex);
3258
3292
  };
3259
3293
  const adjustColEnd = (_rowIndex, colIndex, node, { y }) => {
3260
3294
  const val = fixedEndColsOffsets[colIndex];
3261
- this.setTransform(node, _rowIndex, colIndex, val, y, cols - colIndex);
3295
+ this.setTransform(node, _rowIndex, colIndex, { x: val, y, scrollLeft: true }, cols - colIndex);
3262
3296
  };
3263
3297
  const adjustRowEnd = (rowIndex, _colIndex, node, coords) => {
3264
- this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex], rows - rowIndex);
3298
+ this.setTransform(node, rowIndex, _colIndex, { x: coords.x, y: fixedEndRowsOffsets[rowIndex], scrollTop: true }, rows - rowIndex);
3265
3299
  };
3266
- const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }, scrollPosition2) => {
3267
- this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop, 1e5);
3300
+ const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }) => {
3301
+ this.setTransform(node, _rowIndex, _colIndex, { x, scrollLeft: true, y, scrollTop: true }, 1e5);
3268
3302
  };
3269
- const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }, scrollPosition2) => {
3270
- this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex], 2e5);
3303
+ const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }) => {
3304
+ this.setTransform(node, _rowIndex, _colIndex, {
3305
+ x,
3306
+ scrollLeft: true,
3307
+ y: fixedEndRowsOffsets[_rowIndex],
3308
+ scrollTop: true
3309
+ }, 2e5);
3271
3310
  };
3272
3311
  const adjustColEndRowStart = (_rowIndex, colIndex, node, coords) => {
3273
- this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop, 3e5);
3312
+ this.setTransform(node, _rowIndex, colIndex, {
3313
+ x: fixedEndColsOffsets[colIndex],
3314
+ y: coords.y,
3315
+ scrollLeft: true,
3316
+ scrollTop: true
3317
+ }, 3e5);
3274
3318
  };
3275
3319
  const adjustColEndRowEnd = (rowIndex, colIndex, node) => {
3276
- this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex], 4e5);
3320
+ this.setTransform(node, rowIndex, colIndex, {
3321
+ x: fixedEndColsOffsets[colIndex],
3322
+ y: fixedEndRowsOffsets[rowIndex],
3323
+ scrollLeft: true,
3324
+ scrollTop: true
3325
+ }, 4e5);
3277
3326
  };
3278
3327
  if (fixedColsStart || fixedColsEnd) {
3279
3328
  for (let rowIndex = startRow; rowIndex < endRow; rowIndex++) {
@@ -3352,6 +3401,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
3352
3401
  const removeOnSizeChange = brain.onAvailableSizeChange(() => {
3353
3402
  this.adjustFixedElementsOnScroll();
3354
3403
  raf(() => {
3404
+ if (this.destroyed) {
3405
+ return;
3406
+ }
3355
3407
  this.adjustFixedElementsOnScroll();
3356
3408
  });
3357
3409
  });
@@ -3364,6 +3416,12 @@ var ReactHeadlessTableRenderer = class extends Logger {
3364
3416
  removeOnScrollStop();
3365
3417
  };
3366
3418
  }
3419
+ getInfiniteNode(node) {
3420
+ if (!this.infiniteNode) {
3421
+ this.infiniteNode = getParentInfiniteNode(node);
3422
+ }
3423
+ return this.infiniteNode;
3424
+ }
3367
3425
  renderElement(elementIndex) {
3368
3426
  const domRef = (node) => {
3369
3427
  if (node) {
@@ -3506,11 +3564,11 @@ var useRerender = () => {
3506
3564
  };
3507
3565
 
3508
3566
  // src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
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";
3567
+ var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iw14 _16lm1iw12", hidden: "nxbq1c3 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iw14 _16lm1iw12" };
3568
+ var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iw14 _16lm1iw12 _16lm1iwy _16lm1iwo";
3511
3569
 
3512
3570
  // src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
3513
- var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz" };
3571
+ var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iw11 _16lm1iw12 _16lm1iw14", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iw11 _16lm1iw12 _16lm1iw14" };
3514
3572
 
3515
3573
  // src/components/InfiniteTable/components/ActiveRowIndicator.tsx
3516
3574
  var { rootClassName: rootClassName3 } = internalProps;
@@ -4034,20 +4092,20 @@ var useInternalProps = () => {
4034
4092
  };
4035
4093
 
4036
4094
  // src/components/InfiniteTable/utilities.css.ts
4037
- var alignItems = { center: "_16lm1iw17", stretch: "_16lm1iw18" };
4038
- var cssEllipsisClassName = "_16lm1iw1g _16lm1iw1h _16lm1iw1c";
4095
+ var alignItems = { center: "_16lm1iw1e", stretch: "_16lm1iw1f" };
4096
+ var cssEllipsisClassName = "_16lm1iw1p _16lm1iw1q _16lm1iw1j";
4039
4097
  var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
4040
- var display = { flex: "_16lm1iwp", block: "_16lm1iwq", inlineBlock: "_16lm1iwr" };
4098
+ var display = { flex: "_16lm1iwt", none: "_16lm1iwu", block: "_16lm1iwv", inlineBlock: "_16lm1iww" };
4041
4099
  var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
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" };
4100
+ var flexFlow = { column: "_16lm1iw1c", row: "_16lm1iw1d" };
4101
+ var justifyContent = { center: "_16lm1iw1g", start: "_16lm1iw1h", end: "_16lm1iw1i" };
4102
+ var left = { "0": "_16lm1iw14", "100%": "_16lm1iw15", auto: "_16lm1iw16" };
4103
+ var overflow = { hidden: "_16lm1iw1j", auto: "_16lm1iw1k", visible: "_16lm1iw1l" };
4046
4104
  var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
4047
- var top = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
4105
+ var top = { "0": "_16lm1iw12", "100%": "_16lm1iw13" };
4048
4106
  var transformTranslateZero = "_16lm1iwa";
4049
- var userSelect = { none: "_16lm1iws" };
4050
- var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm", "1000000": "_16lm1iwn", "10000000": "_16lm1iwo" };
4107
+ var userSelect = { none: "_16lm1iwx" };
4108
+ var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "100": "_16lm1iwk", "1000": "_16lm1iwl", "10000": "_16lm1iwm", "100000": "_16lm1iwn", "1000000": "_16lm1iwo", "10000000": "_16lm1iwp", "1k": "_16lm1iwq", "10k": "_16lm1iwr", "100k": "_16lm1iws" };
4051
4109
 
4052
4110
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
4053
4111
  var InfiniteTableBody = React14.forwardRef(function InfiniteTableBody2(props, ref) {
@@ -4217,10 +4275,36 @@ var moveXatY = (arr, dragIndex, dropIndex) => {
4217
4275
  // src/components/InfiniteTable/InfiniteCls.css.ts
4218
4276
  var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4219
4277
  var FooterCls = "_16lm1iw1";
4220
- var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwp _16lm1iw15 _16lm1iw0";
4278
+ var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwt _16lm1iw1c _16lm1iw0";
4279
+ var InfiniteClsHasPinnedEnd = "_1yeub2vo";
4280
+ var InfiniteClsHasPinnedStart = "_1yeub2vn";
4221
4281
  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
4282
  var InfiniteClsShiftingColumns = "_1yeub2vl";
4283
+ var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2 _16lm1iw12 _16lm1iwe _16lm1iwx _16lm1iw10 _16lm1iw1n _16lm1iwf _16lm1iwl";
4223
4284
  var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
4285
+ var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2 _16lm1iw12 _16lm1iwe _16lm1iwx _16lm1iw10 _16lm1iw1n _16lm1iwf _16lm1iwl";
4286
+
4287
+ // src/components/utils/getScrollbarWidth.ts
4288
+ var scrollbarWidth;
4289
+ function getScrollbarWidth() {
4290
+ var _a, _b;
4291
+ if (scrollbarWidth != null) {
4292
+ return scrollbarWidth;
4293
+ }
4294
+ const doc = (_a = getGlobal().document) != null ? _a : null;
4295
+ if (!doc) {
4296
+ return 0;
4297
+ }
4298
+ const outer = doc.createElement("div");
4299
+ outer.style.visibility = "hidden";
4300
+ outer.style.overflow = "scroll";
4301
+ doc.body.appendChild(outer);
4302
+ const inner = doc.createElement("div");
4303
+ outer.appendChild(inner);
4304
+ scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
4305
+ (_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
4306
+ return scrollbarWidth;
4307
+ }
4224
4308
 
4225
4309
  // src/components/InfiniteTable/utils/rafFn.ts
4226
4310
  var rafFn = (fn) => {
@@ -4237,12 +4321,22 @@ var rafFn = (fn) => {
4237
4321
  };
4238
4322
 
4239
4323
  // src/components/InfiniteTable/hooks/useDOMProps.ts
4324
+ var scrollbarWidthHorizontal = stripVar(InternalVars.scrollbarWidthHorizontal);
4325
+ var scrollbarWidthVertical = stripVar(InternalVars.scrollbarWidthVertical);
4240
4326
  var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
4241
4327
  var columnOffsetAtIndex3 = stripVar(InternalVars.columnOffsetAtIndex);
4242
4328
  var columnZIndexAtIndex3 = stripVar(InternalVars.columnZIndexAtIndex);
4329
+ var scrollLeftCSSVar = stripVar(InternalVars.scrollLeft);
4243
4330
  var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
4244
4331
  var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
4245
4332
  var baseZIndexForCells = stripVar(InternalVars.baseZIndexForCells);
4333
+ var pinnedStartWidthCSSVar = stripVar(InternalVars.pinnedStartWidth);
4334
+ var pinnedStartDraggingWidthCSSVar = stripVar(InternalVars.pinnedStartDraggingWidth);
4335
+ var bodyWidthCSSVar = stripVar(InternalVars.bodyWidth);
4336
+ var bodyHeightCSSVar = stripVar(InternalVars.bodyHeight);
4337
+ var pinnedEndOffsetCSSVar = stripVar(InternalVars.pinnedEndOffset);
4338
+ var pinnedEndWidthCSSVar = stripVar(InternalVars.pinnedEndWidth);
4339
+ var pinnedEndDraggingWidthCSSVar = stripVar(InternalVars.pinnedEndDraggingWidth);
4246
4340
  var computedVisibleColumnsCountCSSVar = stripVar(InternalVars.computedVisibleColumnsCount);
4247
4341
  function getColumnZIndex(col, params) {
4248
4342
  let computedZIndex = "auto";
@@ -4251,7 +4345,7 @@ function getColumnZIndex(col, params) {
4251
4345
  if (col.computedPinned === "start") {
4252
4346
  computedZIndex = params.pinnedStartColsCount - col.computedVisibleIndexInCategory;
4253
4347
  } else if (col.computedPinned === "end") {
4254
- computedZIndex = params.visibleColsCount - col.computedVisibleIndexInCategory;
4348
+ computedZIndex = params.visibleColsCount + col.computedVisibleIndexInCategory;
4255
4349
  }
4256
4350
  } else {
4257
4351
  computedZIndex = -index * 10;
@@ -4260,6 +4354,7 @@ function getColumnZIndex(col, params) {
4260
4354
  return zIndexValue;
4261
4355
  }
4262
4356
  function useDOMProps(initialDOMProps) {
4357
+ const scrollbarWidth2 = getScrollbarWidth();
4263
4358
  const { computed, componentState, componentActions } = useInfiniteTable();
4264
4359
  const {
4265
4360
  focused,
@@ -4269,23 +4364,30 @@ function useDOMProps(initialDOMProps) {
4269
4364
  onFocusWithin,
4270
4365
  onSelfFocus,
4271
4366
  onSelfBlur,
4367
+ bodySize,
4272
4368
  activeCellIndex
4273
4369
  } = componentState;
4274
4370
  const {
4275
4371
  computedPinnedStartColumnsWidth,
4276
4372
  computedPinnedEndColumnsWidth,
4277
4373
  computedPinnedStartColumns,
4278
- computedVisibleColumns
4374
+ computedPinnedEndColumns,
4375
+ computedVisibleColumns,
4376
+ scrollbars
4279
4377
  } = computed;
4378
+ const prevPinnedEndCols = [];
4280
4379
  const cssVars = computedVisibleColumns.reduce((vars, col) => {
4281
4380
  const index = col.computedVisibleIndex;
4282
4381
  vars[`${columnWidthAtIndex2}-${index}`] = col.computedWidth + "px";
4283
- vars[`${columnOffsetAtIndex3}-${index}`] = col.computedOffset + "px";
4382
+ vars[`${columnOffsetAtIndex3}-${index}`] = col.computedPinned === "start" ? `calc( ${col.computedOffset}px + var(${scrollLeftCSSVar}) )` : col.computedPinned === "end" ? `calc( var(${pinnedEndOffsetCSSVar}) ${prevPinnedEndCols.length ? "+" : ""} ${prevPinnedEndCols.map((c) => `var(${columnWidthAtIndex2}-${c.computedVisibleIndex})`).join(" + ")} + var(${scrollLeftCSSVar}) )` : `${col.computedOffset}px`;
4284
4383
  const zIndexValue = getColumnZIndex(col, {
4285
4384
  pinnedStartColsCount: computedPinnedStartColumns.length,
4286
4385
  visibleColsCount: computedVisibleColumns.length
4287
4386
  });
4288
4387
  vars[`${columnZIndexAtIndex3}-${index}`] = `${zIndexValue}`;
4388
+ if (col.computedPinned === "end") {
4389
+ prevPinnedEndCols.push(col);
4390
+ }
4289
4391
  return vars;
4290
4392
  }, {});
4291
4393
  if (activeCellIndex != null) {
@@ -4293,7 +4395,14 @@ function useDOMProps(initialDOMProps) {
4293
4395
  cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
4294
4396
  }
4295
4397
  cssVars[computedVisibleColumnsCountCSSVar] = computedVisibleColumns.length;
4398
+ cssVars[scrollbarWidthHorizontal] = scrollbars.horizontal ? `${scrollbarWidth2}px` : "0px";
4399
+ cssVars[scrollbarWidthVertical] = scrollbars.vertical ? `${scrollbarWidth2}px` : "0px";
4400
+ cssVars[pinnedStartWidthCSSVar] = `calc( ` + computedPinnedStartColumns.map((c) => `var(${getCSSVarNameForColWidth(c.computedVisibleIndex)})`).join(" + ") + ` - var(${pinnedStartDraggingWidthCSSVar}, 0px) )`;
4401
+ cssVars[pinnedEndWidthCSSVar] = `calc( ` + computedPinnedEndColumns.map((c) => `var(${getCSSVarNameForColWidth(c.computedVisibleIndex)})`).join(" + ") + ` - var(${pinnedEndDraggingWidthCSSVar}, 0px) )`;
4296
4402
  cssVars[baseZIndexForCells] = computedVisibleColumns.length * 10;
4403
+ cssVars[pinnedEndOffsetCSSVar] = `calc( var(${bodyWidthCSSVar}) - var(${pinnedEndWidthCSSVar}) - var(${scrollbarWidthVertical}) )`;
4404
+ cssVars[bodyWidthCSSVar] = `${bodySize.width}px`;
4405
+ cssVars[bodyHeightCSSVar] = `${bodySize.height}px`;
4297
4406
  const setFocused = rafFn((focused2) => {
4298
4407
  componentActions.focused = focused2;
4299
4408
  });
@@ -4341,7 +4450,7 @@ function useDOMProps(initialDOMProps) {
4341
4450
  onFocus,
4342
4451
  onBlur
4343
4452
  });
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({
4453
+ const className = join(InfiniteTableClassName, InfiniteCls, domProps == null ? void 0 : domProps.className, computedPinnedStartColumnsWidth ? `${InfiniteTableClassName}--has-pinned-start ${InfiniteClsHasPinnedStart}` : null, computedPinnedEndColumnsWidth ? `${InfiniteTableClassName}--has-pinned-end ${InfiniteClsHasPinnedEnd}` : 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
4454
  hasPinnedStart: !!computedPinnedStartColumnsWidth,
4346
4455
  hasPinnedEnd: !!computedPinnedEndColumnsWidth,
4347
4456
  focused,
@@ -4362,64 +4471,169 @@ function useDOMProps(initialDOMProps) {
4362
4471
  return domProps;
4363
4472
  }
4364
4473
 
4474
+ // src/components/InfiniteTable/utils/progressiveSpeedScroller.ts
4475
+ var progressiveSpeedScroller = (staticOptions) => {
4476
+ let scrollLeftRafId = null;
4477
+ let scrollRightRafId = null;
4478
+ return {
4479
+ stop() {
4480
+ if (scrollLeftRafId !== null) {
4481
+ cancelRaf(scrollLeftRafId);
4482
+ }
4483
+ if (scrollRightRafId != null) {
4484
+ cancelRaf(scrollRightRafId);
4485
+ }
4486
+ },
4487
+ scroll(dynamicOptions) {
4488
+ if (scrollLeftRafId !== null) {
4489
+ cancelRaf(scrollLeftRafId);
4490
+ }
4491
+ if (scrollRightRafId != null) {
4492
+ cancelRaf(scrollRightRafId);
4493
+ }
4494
+ const opts = __spreadValues(__spreadValues({
4495
+ offset: 100,
4496
+ scrollAmountsPerRaf: [1, 1, 2, 4, 6, 8, 11, 15]
4497
+ }, staticOptions), dynamicOptions);
4498
+ const self = this;
4499
+ function scrollLeft2() {
4500
+ const marginDistance = opts.scrollOffsetStart + opts.offset - opts.mousePosition.clientX;
4501
+ const shouldScrollLeft = marginDistance > 0 && marginDistance <= opts.offset;
4502
+ if (!shouldScrollLeft) {
4503
+ return false;
4504
+ }
4505
+ const segmentCount = opts.scrollAmountsPerRaf.length;
4506
+ const segmentDistance = Math.round(opts.offset / segmentCount);
4507
+ let speed = 0;
4508
+ for (let i = 0; i < segmentCount; i++) {
4509
+ if (marginDistance > (i + 1) * segmentDistance) {
4510
+ speed = opts.scrollAmountsPerRaf[i];
4511
+ }
4512
+ }
4513
+ dynamicOptions.scrollLeft = dynamicOptions.scrollLeft - speed;
4514
+ scrollLeftRafId = raf(() => {
4515
+ self.scroll(dynamicOptions);
4516
+ });
4517
+ return true;
4518
+ }
4519
+ function scrollRight() {
4520
+ const marginDistance = opts.mousePosition.clientX - (opts.scrollOffsetEnd - opts.offset);
4521
+ const shouldScrollRight = marginDistance > 0 && marginDistance <= opts.offset;
4522
+ if (!shouldScrollRight) {
4523
+ return false;
4524
+ }
4525
+ const segmentCount = opts.scrollAmountsPerRaf.length;
4526
+ const segmentDistance = Math.round(opts.offset / segmentCount);
4527
+ let speed = 0;
4528
+ for (let i = 0; i < segmentCount; i++) {
4529
+ if (marginDistance > (i + 1) * segmentDistance) {
4530
+ speed = opts.scrollAmountsPerRaf[i];
4531
+ }
4532
+ }
4533
+ dynamicOptions.scrollLeft = dynamicOptions.scrollLeft + speed;
4534
+ scrollRightRafId = raf(() => {
4535
+ self.scroll(dynamicOptions);
4536
+ });
4537
+ return true;
4538
+ }
4539
+ if (scrollLeft2()) {
4540
+ return true;
4541
+ }
4542
+ if (scrollRight()) {
4543
+ return true;
4544
+ }
4545
+ return false;
4546
+ }
4547
+ };
4548
+ };
4549
+
4365
4550
  // src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
4366
4551
  var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
4367
4552
  var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
4553
+ var baseZIndexForCells2 = stripVar(InternalVars.baseZIndexForCells);
4368
4554
  var PROXY_OFFSET = 10;
4369
4555
  var getBreakPoints = (columns) => {
4370
- return Array.from(columns.values()).map((c) => {
4556
+ return columns.map((c) => {
4371
4557
  return {
4372
4558
  columnId: c.id,
4373
- breakpoint: c.computedAbsoluteOffset + Math.round(c.computedWidth / 2)
4559
+ index: c.computedVisibleIndex,
4560
+ breakpoint: c.computedOffset + Math.round(c.computedWidth / 2)
4374
4561
  };
4375
4562
  }).filter(Boolean);
4376
4563
  };
4377
4564
  var useColumnPointerEvents = ({
4378
4565
  columnId,
4379
- domRef,
4380
- columns,
4381
- computedRemainingSpace,
4382
- pinnedStartColsCount,
4383
- visibleColsCount
4566
+ domRef
4384
4567
  }) => {
4568
+ var _a;
4385
4569
  const [proxyPosition, setProxyPosition] = (0, import_react17.useState)(null);
4386
- const dragging = proxyPosition != null;
4387
4570
  const {
4388
4571
  componentActions,
4389
4572
  computed,
4390
- componentState: { domRef: rootRef, brain }
4573
+ getComputed,
4574
+ imperativeApi,
4575
+ componentState: { domRef: rootRef, brain, headerBrain }
4391
4576
  } = useInfiniteTable();
4392
- const { computedColumnOrder } = computed;
4393
- const column = (0, import_react17.useMemo)(() => columns.get(columnId), [columnId, columns]);
4394
- const { dragColumnIndex, columnsArray } = (0, import_react17.useMemo)(() => {
4395
- const columnsArray2 = Array.from(columns.values());
4396
- const columnIndex = columnsArray2.findIndex((c) => c.id === columnId);
4397
- return {
4398
- columnsArray: columnsArray2,
4399
- dragColumnIndex: columnIndex,
4400
- columnWidth: column.computedWidth,
4401
- columnOffsetVar: `var(${columnOffsetAtIndex4}-${column.computedVisibleIndex})`
4402
- };
4403
- }, [columns, columnId, column]);
4404
4577
  const onPointerDown = (0, import_react17.useCallback)((e) => {
4405
- var _a;
4406
- let breakpoints = [];
4578
+ var _a2;
4579
+ const {
4580
+ computedVisibleColumns,
4581
+ computedVisibleColumnsMap,
4582
+ computedPinnedStartColumns
4583
+ } = getComputed();
4584
+ const dragColumn = computedVisibleColumnsMap.get(columnId);
4585
+ const initialBreakpoints = getBreakPoints(computedVisibleColumns);
4407
4586
  const target = domRef.current;
4587
+ const targetRect = target.getBoundingClientRect();
4588
+ const tableRect = rootRef.current.getBoundingClientRect();
4589
+ const initialAvailableSize = brain.getAvailableSize();
4590
+ const dragColumnIndex = dragColumn.computedVisibleIndex;
4591
+ let currentColumnIndexes = computedVisibleColumns.map((c) => c.computedVisibleIndex);
4592
+ const initialColumnIndexes = currentColumnIndexes;
4593
+ const pinnedStartCurrentWidth = brain.getFixedStartColsWidth() - (dragColumn.computedPinned === "start" ? dragColumn.computedWidth : 0);
4594
+ const pinnedStartColsRight = tableRect.left + pinnedStartCurrentWidth;
4595
+ const pinnedEndCurrentWidth = brain.getFixedEndColsWidth() - (dragColumn.computedPinned === "end" ? dragColumn.computedWidth : 0);
4596
+ const pinnedEndColsLeft = tableRect.right - pinnedEndCurrentWidth;
4597
+ const speedScroller = progressiveSpeedScroller({
4598
+ scrollOffsetStart: pinnedStartColsRight,
4599
+ scrollOffsetEnd: pinnedEndColsLeft
4600
+ });
4601
+ const isColumnVisible2 = (columnIndex, { scrollLeft: scrollLeft2 }) => {
4602
+ if (columnIndex === dragColumnIndex) {
4603
+ return true;
4604
+ }
4605
+ const col = computedVisibleColumns[columnIndex];
4606
+ if (col.computedPinned) {
4607
+ return true;
4608
+ }
4609
+ return col.computedOffset >= scrollLeft2 + pinnedStartCurrentWidth && col.computedOffset + col.computedWidth < scrollLeft2 + tableRect.width - pinnedEndCurrentWidth;
4610
+ };
4408
4611
  const initialClientPos = {
4409
4612
  clientX: Math.round(e.clientX),
4410
4613
  clientY: Math.round(e.clientY)
4411
4614
  };
4615
+ let currentScrollPosition = {
4616
+ scrollLeft: 0,
4617
+ scrollTop: 0
4618
+ };
4412
4619
  const initialScrollPosition2 = brain.getScrollPosition();
4620
+ const updateScrollPosition = (scrollPosition) => {
4621
+ currentScrollPosition = scrollPosition;
4622
+ };
4623
+ updateScrollPosition(initialScrollPosition2);
4624
+ const removeOnScroll = brain.onScroll((scrollPosition) => {
4625
+ currentScrollPosition = scrollPosition;
4626
+ });
4413
4627
  const initialProxyPosition = {
4414
- left: PROXY_OFFSET - initialScrollPosition2.scrollLeft,
4415
- top: PROXY_OFFSET
4628
+ left: initialClientPos.clientX - tableRect.left - (initialClientPos.clientX - targetRect.left) + PROXY_OFFSET,
4629
+ top: initialClientPos.clientY - tableRect.top - (initialClientPos.clientY - targetRect.top) + PROXY_OFFSET
4416
4630
  };
4417
4631
  let currentClientPos = initialClientPos;
4418
4632
  let currentDiff = {
4419
4633
  x: 0,
4420
4634
  y: 0
4421
4635
  };
4422
- function updateColumnOffsets(pos) {
4636
+ function updateProxyPosition(pos) {
4423
4637
  const clientX = Math.round(pos.clientX);
4424
4638
  const clientY = Math.round(pos.clientY);
4425
4639
  if (clientX === currentClientPos.clientX && clientY === currentClientPos.clientY) {
@@ -4433,96 +4647,134 @@ var useColumnPointerEvents = ({
4433
4647
  top: initialProxyPosition.top + currentDiff.y
4434
4648
  });
4435
4649
  }
4436
- updateColumnOffsets(initialClientPos);
4437
- let initialCursor = (_a = target.style.cursor) != null ? _a : "auto";
4650
+ updateProxyPosition(initialClientPos);
4651
+ let initialCursor = (_a2 = target.style.cursor) != null ? _a2 : "auto";
4438
4652
  let didDragAtLeastOnce = false;
4439
4653
  let currentDropIndex = dragColumnIndex;
4440
4654
  const onPointerMove = (e2) => {
4441
- var _a2;
4655
+ var _a3;
4442
4656
  if (!didDragAtLeastOnce) {
4443
4657
  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);
4658
+ brain.setRenderCount({
4659
+ horizontal: computedVisibleColumns.length,
4660
+ vertical: void 0
4661
+ });
4662
+ headerBrain.setRenderCount({
4663
+ horizontal: computedVisibleColumns.length,
4664
+ vertical: void 0
4665
+ });
4666
+ componentActions.columnReorderDragColumnId = dragColumn.id;
4667
+ setInfiniteColumnZIndex(dragColumnIndex, `calc( var(${baseZIndexForCells2}) + 10000 )`, rootRef.current);
4668
+ (_a3 = rootRef.current) == null ? void 0 : _a3.classList.add(InfiniteClsShiftingColumns);
4448
4669
  target.style.cursor = "grabbing";
4449
4670
  }
4450
- updateColumnOffsets(e2);
4451
- const diffX = currentDiff.x;
4671
+ updateProxyPosition(e2);
4672
+ const scrollLeft2 = currentScrollPosition.scrollLeft;
4673
+ const scrollLeftDiff = scrollLeft2 - initialScrollPosition2.scrollLeft;
4674
+ let diffX = currentDiff.x + scrollLeftDiff;
4452
4675
  const dir = diffX < 0 ? -1 : 1;
4453
- let currentPos = dir === -1 ? column.computedAbsoluteOffset + diffX : column.computedAbsoluteOffset + column.computedWidth + diffX;
4676
+ let currentPos = dir === -1 ? dragColumn.computedOffset + diffX : dragColumn.computedOffset + dragColumn.computedWidth + diffX;
4677
+ speedScroller.scroll({
4678
+ mousePosition: currentClientPos,
4679
+ get scrollLeft() {
4680
+ return brain.getScrollPosition().scrollLeft;
4681
+ },
4682
+ set scrollLeft(value) {
4683
+ imperativeApi.scrollLeft = value;
4684
+ }
4685
+ });
4686
+ const breakpoints = initialBreakpoints.filter((b) => isColumnVisible2(b.index, {
4687
+ scrollLeft: currentScrollPosition.scrollLeft
4688
+ })).map((b) => {
4689
+ return __spreadProps(__spreadValues({}, b), { breakpoint: b.breakpoint - scrollLeft2 });
4690
+ });
4454
4691
  let idx = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
4455
4692
  return breakpoint < value ? -1 : breakpoint > value ? 1 : 0;
4456
4693
  });
4457
4694
  if (idx < 0) {
4458
4695
  idx = ~idx;
4696
+ console.log("found breakpoint", breakpoints[idx], "at index", idx, "for currentPos", currentPos, JSON.parse(JSON.stringify(breakpoints)));
4459
4697
  }
4460
- if (idx !== currentDropIndex) {
4698
+ idx = breakpoints[idx] ? breakpoints[idx].index : breakpoints[breakpoints.length - 1].index + 1;
4699
+ if (idx != null && idx !== currentDropIndex) {
4461
4700
  currentDropIndex = idx;
4462
4701
  if (dir === 1 && currentDropIndex === dragColumnIndex + 1) {
4463
4702
  currentDropIndex = dragColumnIndex;
4464
4703
  }
4465
- columnsArray.forEach((col) => {
4704
+ const newColumnIndexes = moveXatY(initialColumnIndexes, dragColumnIndex, currentDropIndex > dragColumnIndex ? currentDropIndex - 1 : currentDropIndex);
4705
+ const indexesWithTransition = new Set();
4706
+ newColumnIndexes.forEach((newIndex, i) => {
4707
+ const currentIndex = currentColumnIndexes[i];
4708
+ if (newIndex !== currentIndex) {
4709
+ indexesWithTransition.add(newIndex);
4710
+ }
4711
+ });
4712
+ console.log(JSON.stringify(currentColumnIndexes));
4713
+ console.log(JSON.stringify(newColumnIndexes));
4714
+ console.log("switched", indexesWithTransition);
4715
+ console.log("----");
4716
+ currentColumnIndexes = newColumnIndexes;
4717
+ computedVisibleColumns.forEach((col) => {
4466
4718
  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;
4719
+ if (indexesWithTransition.has(colIndex)) {
4720
+ restoreInfiniteColumnReorderDuration(colIndex, rootRef.current);
4721
+ } else {
4722
+ clearInfiniteColumnReorderDuration(colIndex, rootRef.current);
4471
4723
  }
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;
4724
+ const isDragColumn = colIndex === dragColumnIndex;
4725
+ let isOutsideCol = dir === -1 ? colIndex < currentDropIndex || colIndex > dragColumnIndex : colIndex < dragColumnIndex || colIndex >= currentDropIndex;
4726
+ let newPosition = "";
4727
+ if (dir === -1) {
4728
+ newPosition = isDragColumn ? `var(${columnOffsetAtIndex4}-${currentDropIndex})` : isOutsideCol ? `var(${columnOffsetAtIndex4}-${colIndex})` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) + var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
4729
+ } else {
4730
+ newPosition = isOutsideCol ? `var(${columnOffsetAtIndex4}-${colIndex})` : isDragColumn ? `calc( var(${columnOffsetAtIndex4}-${currentDropIndex - 1}) + var(${columnWidthAtIndex3}-${currentDropIndex - 1}) - var(${columnWidthAtIndex3}-${dragColumnIndex}) )` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) - var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
4476
4731
  }
4732
+ setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
4477
4733
  });
4478
4734
  }
4479
4735
  };
4736
+ function persistColumnOrder() {
4737
+ if (currentDropIndex != null && currentDropIndex !== dragColumnIndex) {
4738
+ const newOrder = moveXatY(getComputed().computedColumnOrder, dragColumnIndex, currentDropIndex > dragColumnIndex ? currentDropIndex - 1 : currentDropIndex);
4739
+ computedVisibleColumns.forEach((col) => {
4740
+ setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
4741
+ });
4742
+ componentActions.columnOrder = newOrder;
4743
+ }
4744
+ }
4480
4745
  const onPointerUp = (e2) => {
4481
- var _a2;
4746
+ var _a3;
4482
4747
  const target2 = domRef.current;
4483
- (_a2 = rootRef.current) == null ? void 0 : _a2.classList.remove(InfiniteClsShiftingColumns);
4484
- columnsArray.forEach((col) => {
4748
+ (_a3 = rootRef.current) == null ? void 0 : _a3.classList.remove(InfiniteClsShiftingColumns);
4749
+ removeOnScroll();
4750
+ speedScroller.stop();
4751
+ brain.setAvailableSize(__spreadValues({}, initialAvailableSize));
4752
+ computedVisibleColumns.forEach((col) => {
4753
+ clearInfiniteColumnReorderDuration(col.computedVisibleIndex, rootRef.current);
4485
4754
  setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
4486
4755
  });
4487
- setInfiniteColumnZIndex(dragColumnIndex, getColumnZIndex(column, {
4488
- pinnedStartColsCount,
4489
- visibleColsCount
4756
+ setInfiniteColumnZIndex(dragColumnIndex, getColumnZIndex(dragColumn, {
4757
+ pinnedStartColsCount: computedPinnedStartColumns.length,
4758
+ visibleColsCount: computedVisibleColumns.length
4490
4759
  }), rootRef.current);
4491
4760
  target2.style.cursor = initialCursor;
4492
4761
  target2.releasePointerCapture(e2.pointerId);
4493
4762
  target2.removeEventListener("pointermove", onPointerMove);
4494
4763
  target2.removeEventListener("pointerup", onPointerUp);
4495
4764
  setProxyPosition(null);
4496
- if (!didDragAtLeastOnce && column.computedSortable) {
4497
- column.toggleSort();
4498
- }
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
- });
4504
- componentActions.columnOrder = newOrder;
4765
+ if (!didDragAtLeastOnce && dragColumn.computedSortable) {
4766
+ dragColumn.toggleSort();
4505
4767
  }
4506
- componentActions.columnReorderInProgress = false;
4507
- breakpoints = [];
4768
+ persistColumnOrder();
4769
+ componentActions.columnReorderDragColumnId = false;
4508
4770
  };
4509
4771
  target.addEventListener("pointermove", onPointerMove);
4510
4772
  target.addEventListener("pointerup", onPointerUp);
4511
4773
  target.setPointerCapture(e.pointerId);
4512
- }, [
4513
- columns,
4514
- column,
4515
- dragColumnIndex,
4516
- visibleColsCount,
4517
- pinnedStartColsCount,
4518
- columnsArray,
4519
- computedRemainingSpace,
4520
- computedColumnOrder
4521
- ]);
4774
+ }, [columnId]);
4522
4775
  return {
4523
- onPointerDown: column.computedDraggable ? onPointerDown : () => {
4776
+ onPointerDown: ((_a = computed.computedVisibleColumnsMap.get(columnId)) == null ? void 0 : _a.computedDraggable) ? onPointerDown : () => {
4524
4777
  },
4525
- dragging,
4526
4778
  proxyPosition
4527
4779
  };
4528
4780
  };
@@ -4575,19 +4827,19 @@ var import_react19 = __toModule(require("react"));
4575
4827
 
4576
4828
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
4577
4829
  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";
4830
+ var CellCls = "_1eexc2a5 _16lm1iwt _16lm1iw1d _16lm1iw1e _16lm1iw2 _16lm1iw1o _16lm1iw1p";
4831
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob11b _16lm1iwz _16lm1iw11 _16lm1iwt _16lm1iw1d _16lm1iw1e", variantClassNames: { filtered: { false: "_12zfob11c", true: "_12zfob11d" } }, defaultVariants: {}, compoundVariants: [] });
4832
+ var HeaderCellProxy = "_12zfob1k _16lm1iw1p _16lm1iw1q _16lm1iw1j";
4833
+ var HeaderCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob1l _16lm1iwv", variantClassNames: { rowActive: { false: "_12zfob1m", true: "_12zfob1n" }, zebra: { false: "_12zfob1o", even: "_12zfob1p", odd: "_12zfob1q" }, dragging: { true: "_12zfob1r", false: "_12zfob1s" }, first: { true: "_12zfob1t", false: "_12zfob1u" }, last: { true: "_12zfob1v", false: "_12zfob1w" }, groupByField: { true: "_12zfob1x", false: "_12zfob1y" }, firstInCategory: { true: "_12zfob1z", false: "_12zfob110" }, lastInCategory: { true: "_12zfob111", false: "_12zfob112" }, pinned: { start: "_12zfob113", end: "_12zfob114", false: "_12zfob115" }, filtered: { true: "_12zfob116", false: "_12zfob117" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob118"], [{ pinned: "end", firstInCategory: true }, "_12zfob119"], [{ pinned: false, lastInCategory: true }, "_12zfob11a"]] });
4834
+ var HeaderClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iwv _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, firstInCategory: { true: "_12zfob1a", false: "_12zfob1b" }, lastInCategory: { true: "_12zfob1c", false: "_12zfob1d" }, overflow: { true: "_12zfob1e", false: "_12zfob1f" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1g"], [{ pinned: "start", firstInCategory: true }, "_12zfob1h"], [{ overflow: true, pinned: "end" }, "_12zfob1i"], [{ pinned: "end", lastInCategory: true }, "_12zfob1j"]] });
4835
+ var HeaderFilterCls = "_12zfob11g _16lm1iwt _16lm1iw1d _16lm1iw1e _16lm1iw1";
4836
+ var HeaderFilterEditorCls = "_16lm1iw11 _16lm1iwz";
4837
+ var HeaderGroupCls = "_12zfob11f _16lm1iwt _16lm1iw1d _16lm1iw1e";
4586
4838
  var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
4587
4839
  var HeaderSortIconCls = "_16lm1iw1";
4588
4840
  var HeaderSortIconIndexCls = "_12zfob14";
4589
4841
  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";
4842
+ var HeaderWrapperCls = "_12zfob11e _16lm1iw1j _16lm1iw1 _16lm1iwt _16lm1iw1d";
4591
4843
 
4592
4844
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
4593
4845
  var defaultLineStyle = {
@@ -4665,14 +4917,15 @@ var React18 = __toModule(require("react"));
4665
4917
 
4666
4918
  // src/components/InfiniteTable/components/cell.css.ts
4667
4919
  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"]] });
4920
+ var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwt _16lm1iw1d _16lm1iw1e _16lm1iw2 _16lm1iw1o _16lm1iw1p";
4921
+ 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: "start", firstInCategory: true }, "_1eexc2av"], [{ pinned: "end", firstInCategory: true }, "_1eexc2aw"], [{ pinned: "end", lastInCategory: true }, "_1eexc2ax"]] });
4670
4922
 
4671
4923
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
4672
4924
  var { rootClassName: rootClassName5 } = internalProps;
4673
4925
  var InfiniteTableCellClassName = `${rootClassName5}Cell`;
4674
4926
  var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
4675
4927
  var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
4928
+ var columnReorderEffectDurationAtIndex2 = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
4676
4929
  function InfiniteTableCellFn(props) {
4677
4930
  var _b, _c, _d;
4678
4931
  const _a = props, {
@@ -4706,7 +4959,8 @@ function InfiniteTableCellFn(props) {
4706
4959
  ]);
4707
4960
  const children = renderChildren();
4708
4961
  const style = __spreadValues({
4709
- width: `var(${columnWidthAtIndex4}-${column.computedVisibleIndex})`
4962
+ width: `var(${columnWidthAtIndex4}-${column.computedVisibleIndex})`,
4963
+ transition: `transform var(${columnReorderEffectDurationAtIndex2}-${column.computedVisibleIndex}, 0s)`
4710
4964
  }, domProps.style);
4711
4965
  const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
4712
4966
  style,
@@ -5144,11 +5398,36 @@ function getColumnResizer(colIndex, {
5144
5398
  return;
5145
5399
  }
5146
5400
  setInfiniteColumnWidth(nextColIndex, nextColumn.computedWidth - diff, domRef.current);
5147
- setInfiniteColumnOffset(nextColIndex, nextColumn.computedOffset + diff, domRef.current);
5401
+ if (nextColumn.computedPinned === "start") {
5402
+ addToInfiniteColumnOffset(nextColumn, diff, domRef.current);
5403
+ } else {
5404
+ setInfiniteColumnOffset(nextColIndex, nextColumn.computedOffset + diff, domRef.current);
5405
+ }
5406
+ return;
5407
+ }
5408
+ if (column.computedPinned === "end") {
5409
+ return;
5410
+ }
5411
+ if (column.computedPinned === "start") {
5412
+ for (let i = nextColIndex, len = columns.length; i < len; i++) {
5413
+ const col = columns[i];
5414
+ if (col.computedPinned === "start") {
5415
+ addToInfiniteColumnOffset(col, diff, domRef.current);
5416
+ continue;
5417
+ }
5418
+ if (col.computedPinned === "end") {
5419
+ continue;
5420
+ }
5421
+ setInfiniteColumnOffset(i, col.computedOffset + diff, domRef.current);
5422
+ }
5148
5423
  return;
5149
5424
  }
5150
5425
  for (let i = nextColIndex, len = columns.length; i < len; i++) {
5151
- setInfiniteColumnOffset(i, columns[i].computedOffset + diff, domRef.current);
5426
+ const col = columns[i];
5427
+ if (col.computedPinned) {
5428
+ continue;
5429
+ }
5430
+ setInfiniteColumnOffset(i, col.computedOffset + diff, domRef.current);
5152
5431
  }
5153
5432
  }
5154
5433
  };
@@ -5158,7 +5437,8 @@ function getColumnGroupResizer(colIndexes, config) {
5158
5437
  return {
5159
5438
  resize(diffs) {
5160
5439
  const { columns, domRef } = config;
5161
- let offset = columns[colIndexes[0]].computedOffset;
5440
+ const firstCol = columns[colIndexes[0]];
5441
+ let offset = firstCol.computedOffset;
5162
5442
  let diffSum = 0;
5163
5443
  const node = domRef.current;
5164
5444
  diffs.forEach((diff, i) => {
@@ -5167,13 +5447,23 @@ function getColumnGroupResizer(colIndexes, config) {
5167
5447
  const column = columns[colIndex];
5168
5448
  const newWidth = column.computedWidth + diff;
5169
5449
  setInfiniteColumnWidth(colIndex, newWidth, node);
5450
+ if (column.computedPinned === "end") {
5451
+ return;
5452
+ }
5170
5453
  if (offset) {
5171
5454
  setInfiniteColumnOffset(colIndex, offset, node);
5172
5455
  }
5173
5456
  offset += newWidth;
5174
5457
  });
5458
+ if (firstCol.computedPinned === "end") {
5459
+ return;
5460
+ }
5175
5461
  for (let i = lastColIndex + 1; i < columns.length; i++) {
5176
- setInfiniteColumnOffset(i, columns[i].computedOffset + diffSum, node);
5462
+ const col = columns[i];
5463
+ if (col.computedPinned === "end") {
5464
+ continue;
5465
+ }
5466
+ setInfiniteColumnOffset(i, col.computedOffset + diffSum, node);
5177
5467
  }
5178
5468
  }
5179
5469
  };
@@ -5181,8 +5471,9 @@ function getColumnGroupResizer(colIndexes, config) {
5181
5471
 
5182
5472
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
5183
5473
  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: [] });
5474
+ var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw12 _16lm1iw19 _16lm1iw17 _16lm1iwe _16lm1iw1j";
5475
+ var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw12 _16lm1iw17", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
5476
+ var ResizeHandleRecipeCls = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2 _16lm1iw14 _16lm1iw1b", false: "zneyzh3" }, computedFirstInCategory: { true: "zneyzh4", false: "zneyzh5" }, computedLastInCategory: { true: "zneyzh6", false: "zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "zneyzha"]] });
5186
5477
 
5187
5478
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
5188
5479
  var { rootClassName: rootClassName7 } = internalProps;
@@ -5192,6 +5483,13 @@ function ResizeHandleFn(props) {
5192
5483
  const [constrained, setConstrained] = (0, import_react21.useState)(false);
5193
5484
  const constrainedRef = (0, import_react21.useRef)(constrained);
5194
5485
  constrainedRef.current = constrained;
5486
+ const col = props.columns[props.columnIndex];
5487
+ if (!col) {
5488
+ return null;
5489
+ }
5490
+ const computedPinned = col.computedPinned;
5491
+ const computedFirstInCategory = col.computedFirstInCategory;
5492
+ const computedLastInCategory = col.computedLastInCategory;
5195
5493
  const onPointerDown = (e) => {
5196
5494
  e.stopPropagation();
5197
5495
  const shareSpaceOnResize = !!e.shiftKey;
@@ -5205,6 +5503,9 @@ function ResizeHandleFn(props) {
5205
5503
  domRef
5206
5504
  });
5207
5505
  const resizeDiff = (diff) => {
5506
+ if (computedPinned === "end") {
5507
+ diff *= -1;
5508
+ }
5208
5509
  const { adjustedDiff, constrained: constrained2 } = props.computeResize({
5209
5510
  diff,
5210
5511
  shareSpaceOnResize
@@ -5229,11 +5530,19 @@ function ResizeHandleFn(props) {
5229
5530
  target.addEventListener("pointermove", onPointerMove);
5230
5531
  target.addEventListener("pointerup", onPointerUp);
5231
5532
  };
5533
+ const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
5534
+ right: computedPinned === "start" ? 0 : 0
5535
+ } : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
5232
5536
  return /* @__PURE__ */ import_react21.default.createElement("div", {
5233
5537
  ref: domRef,
5234
- className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls}`,
5538
+ className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
5539
+ computedPinned,
5540
+ computedFirstInCategory,
5541
+ computedLastInCategory
5542
+ })}`,
5235
5543
  onPointerDown
5236
5544
  }, /* @__PURE__ */ import_react21.default.createElement("div", {
5545
+ style,
5237
5546
  className: ResizeHandleDraggerClsRecipe({
5238
5547
  constrained
5239
5548
  })
@@ -5311,11 +5620,19 @@ var InfiniteTableHeaderCellContext = React22.createContext(null);
5311
5620
  var { rootClassName: rootClassName8 } = internalProps;
5312
5621
  var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
5313
5622
  var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
5314
- var columnOffsetAtIndex5 = stripVar(InternalVars.columnOffsetAtIndex);
5315
5623
  function InfiniteTableHeaderCell(props) {
5316
5624
  var _a, _b, _c, _d, _e;
5317
5625
  const column = props.column;
5318
- const columns = props.columns;
5626
+ const {
5627
+ computed: { showColumnFilters },
5628
+ componentState: {
5629
+ portalDOMRef,
5630
+ columnHeaderHeight,
5631
+ filterEditors,
5632
+ columnReorderDragColumnId
5633
+ }
5634
+ } = useInfiniteTable();
5635
+ const dragging = columnReorderDragColumnId === column.id;
5319
5636
  const { onResize, height, width, headerOptions } = props;
5320
5637
  const sortInfo = column.computedSortInfo;
5321
5638
  let header = column.header;
@@ -5333,6 +5650,7 @@ function InfiniteTableHeaderCell(props) {
5333
5650
  direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
5334
5651
  }) : null;
5335
5652
  const renderParam = {
5653
+ dragging,
5336
5654
  domRef: ref,
5337
5655
  column,
5338
5656
  columnSortInfo: sortInfo,
@@ -5351,15 +5669,6 @@ function InfiniteTableHeaderCell(props) {
5351
5669
  return /* @__PURE__ */ React22.createElement(React22.Fragment, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
5352
5670
  };
5353
5671
  const domRef = (0, import_react23.useRef)(null);
5354
- const {
5355
- computed: {
5356
- computedRemainingSpace,
5357
- showColumnFilters,
5358
- computedVisibleColumns,
5359
- computedPinnedStartColumns
5360
- },
5361
- componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
5362
- } = useInfiniteTable();
5363
5672
  const {
5364
5673
  componentActions: dataSourceActions,
5365
5674
  getState: getDataSourceState,
@@ -5375,26 +5684,27 @@ function InfiniteTableHeaderCell(props) {
5375
5684
  clearOnResize == null ? void 0 : clearOnResize();
5376
5685
  };
5377
5686
  }, [domRef.current, props.onResize]);
5378
- const style = {
5687
+ let style = {
5379
5688
  height
5380
5689
  };
5381
- const { onPointerDown, dragging, proxyPosition } = useColumnPointerEvents({
5382
- pinnedStartColsCount: computedPinnedStartColumns.length,
5383
- visibleColsCount: computedVisibleColumns.length,
5384
- computedRemainingSpace,
5690
+ if (column.headerStyle) {
5691
+ style = typeof column.headerStyle === "function" ? __spreadValues(__spreadValues({}, style), column.headerStyle(renderParam) || {}) : __spreadValues(__spreadValues({}, style), column.headerStyle);
5692
+ }
5693
+ const headerClassName = typeof column.headerClassName === "function" ? column.headerClassName(renderParam) : column.headerClassName;
5694
+ const { onPointerDown, proxyPosition } = useColumnPointerEvents({
5385
5695
  columnId: column.id,
5386
- domRef,
5387
- columns
5696
+ domRef
5388
5697
  });
5389
5698
  let draggingProxy = null;
5390
- if (dragging) {
5699
+ if (dragging && proxyPosition) {
5391
5700
  draggingProxy = /* @__PURE__ */ React22.createElement("div", {
5701
+ key: column.id,
5392
5702
  className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
5393
5703
  style: {
5394
5704
  position: "absolute",
5395
5705
  height,
5396
5706
  width,
5397
- left: `calc( var(${columnOffsetAtIndex5}-${column.computedVisibleIndex}) + ${(_a = proxyPosition.left) != null ? _a : 0}px)`,
5707
+ left: (_a = proxyPosition.left) != null ? _a : 0,
5398
5708
  top: (_b = proxyPosition.top) != null ? _b : 0,
5399
5709
  zIndex: 1e9
5400
5710
  }
@@ -5483,7 +5793,11 @@ function InfiniteTableHeaderCell(props) {
5483
5793
  onPointerDown,
5484
5794
  contentClassName: join(HeaderCellContentRecipe(contentRecipeVariants), justifyContent[(_c = column.align) != null ? _c : "start"]),
5485
5795
  contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
5486
- className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false, rowActive: false }), CellCls),
5796
+ className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", headerClassName, useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, {
5797
+ dragging,
5798
+ zebra: false,
5799
+ rowActive: false
5800
+ }), CellCls),
5487
5801
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
5488
5802
  afterChildren: /* @__PURE__ */ React22.createElement(React22.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React22.createElement(InfiniteTableColumnHeaderFilter, {
5489
5803
  filterEditor: FilterEditor,
@@ -5505,47 +5819,27 @@ function useInfiniteHeaderCell() {
5505
5819
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
5506
5820
  var React27 = __toModule(require("react"));
5507
5821
 
5508
- // src/components/utils/getScrollbarWidth.ts
5509
- var scrollbarWidth;
5510
- function getScrollbarWidth() {
5511
- var _a, _b;
5512
- if (scrollbarWidth != null) {
5513
- return scrollbarWidth;
5514
- }
5515
- const doc = (_a = getGlobal().document) != null ? _a : null;
5516
- if (!doc) {
5517
- return 0;
5518
- }
5519
- const outer = doc.createElement("div");
5520
- outer.style.visibility = "hidden";
5521
- outer.style.overflow = "scroll";
5522
- doc.body.appendChild(outer);
5523
- const inner = doc.createElement("div");
5524
- outer.appendChild(inner);
5525
- scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
5526
- (_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
5527
- return scrollbarWidth;
5528
- }
5529
-
5530
5822
  // src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
5531
5823
  function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth) {
5532
5824
  const map2 = new Map();
5533
5825
  const temporaryMap = new Map();
5534
5826
  const mapOfAllParentGroupsForColumns = new Map();
5535
5827
  columns.forEach((col, index) => {
5536
- var _a, _b, _c, _d, _e;
5828
+ var _a, _b, _c, _d;
5537
5829
  const colId = col.id;
5538
- const previousColumnId = (_b = (_a = columns[index - 1]) == null ? void 0 : _a.id) != null ? _b : "";
5830
+ const previousColumn = columns[index - 1];
5831
+ const previousColumnId = (_a = previousColumn == null ? void 0 : previousColumn.id) != null ? _a : "";
5539
5832
  const parentGroups = new Set();
5540
- const parentGroupsOfPreviousColumn = (_c = mapOfAllParentGroupsForColumns.get(previousColumnId)) != null ? _c : new Set();
5833
+ const parentGroupsOfPreviousColumn = (previousColumn == null ? void 0 : previousColumn.computedPinned) !== col.computedPinned ? new Set() : (_b = mapOfAllParentGroupsForColumns.get(previousColumnId)) != null ? _b : new Set();
5541
5834
  mapOfAllParentGroupsForColumns.set(colId, parentGroups);
5542
5835
  const colItem = {
5543
5836
  type: "column",
5544
5837
  id: colId,
5545
5838
  ref: col,
5546
5839
  groupOffset: 0,
5840
+ computedPinned: col.computedPinned,
5547
5841
  computedWidth: col.computedWidth,
5548
- depth: col.columnGroup ? ((_d = columnGroupsDepthsMap.get(col.columnGroup)) != null ? _d : 0) + 1 : 0
5842
+ depth: col.columnGroup ? ((_c = columnGroupsDepthsMap.get(col.columnGroup)) != null ? _c : 0) + 1 : 0
5549
5843
  };
5550
5844
  map2.set([colId], colItem);
5551
5845
  let groupId = col.columnGroup;
@@ -5567,7 +5861,8 @@ function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, c
5567
5861
  groupOffset: 0,
5568
5862
  uniqueGroupId: [groupId],
5569
5863
  computedWidth: 0,
5570
- depth: (_e = columnGroupsDepthsMap.get(groupId)) != null ? _e : 0
5864
+ computedPinned: colItem.computedPinned,
5865
+ depth: (_d = columnGroupsDepthsMap.get(groupId)) != null ? _d : 0
5571
5866
  };
5572
5867
  map2.set(groupAbsoluteId, colGroupItem);
5573
5868
  temporaryMap.set(groupId, colGroupItem);
@@ -5644,6 +5939,13 @@ function GroupResizeHandleFn(props) {
5644
5939
  const [constrained, setConstrained] = (0, import_react24.useState)(false);
5645
5940
  const constrainedRef = (0, import_react24.useRef)(constrained);
5646
5941
  constrainedRef.current = constrained;
5942
+ const col = props.groupColumns[0];
5943
+ if (!col) {
5944
+ return null;
5945
+ }
5946
+ const computedPinned = col.computedPinned;
5947
+ const computedFirstInCategory = col.computedFirstInCategory;
5948
+ const computedLastInCategory = col.computedLastInCategory;
5647
5949
  const onPointerDown = (e) => {
5648
5950
  e.stopPropagation();
5649
5951
  const pointerId = e.pointerId;
@@ -5656,6 +5958,9 @@ function GroupResizeHandleFn(props) {
5656
5958
  domRef
5657
5959
  });
5658
5960
  const resizeDiff = (diff) => {
5961
+ if (computedPinned === "end") {
5962
+ diff *= -1;
5963
+ }
5659
5964
  const { constrained: constrained2, adjustedDiffs, adjustedDiff } = props.computeResize(diff);
5660
5965
  if (constrainedRef.current !== constrained2) {
5661
5966
  setConstrained(constrained2);
@@ -5665,8 +5970,8 @@ function GroupResizeHandleFn(props) {
5665
5970
  };
5666
5971
  const onPointerMove = (e2) => {
5667
5972
  if (initialMove) {
5668
- const maxDiff = props.groupColumns.reduce((diff, col) => {
5669
- return diff + col.computedWidth - col.computedMinWidth;
5973
+ const maxDiff = props.groupColumns.reduce((diff, col2) => {
5974
+ return diff + col2.computedWidth - col2.computedMinWidth;
5670
5975
  }, 0);
5671
5976
  const currentSize = props.brain.getAvailableSize();
5672
5977
  const newSize = {
@@ -5689,12 +5994,19 @@ function GroupResizeHandleFn(props) {
5689
5994
  target.addEventListener("pointermove", onPointerMove);
5690
5995
  target.addEventListener("pointerup", onPointerUp);
5691
5996
  };
5997
+ const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
5998
+ right: computedPinned === "start" ? 0 : ThemeVars.components.HeaderCell.resizeHandleWidth
5999
+ } : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
5692
6000
  return /* @__PURE__ */ import_react24.default.createElement("div", {
5693
6001
  ref: domRef,
5694
- className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls}`,
6002
+ className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
6003
+ computedPinned,
6004
+ computedFirstInCategory,
6005
+ computedLastInCategory
6006
+ })}`,
5695
6007
  onPointerDown
5696
6008
  }, /* @__PURE__ */ import_react24.default.createElement("div", {
5697
- style: props.style,
6009
+ style: __spreadValues(__spreadValues({}, style), props.style),
5698
6010
  className: ResizeHandleDraggerClsRecipe({
5699
6011
  constrained
5700
6012
  })
@@ -5744,12 +6056,12 @@ function useColumnGroupResizeHandle(groupColumns, config) {
5744
6056
  })
5745
6057
  });
5746
6058
  return result;
5747
- }, []);
6059
+ }, [lastColumnInGroup]);
5748
6060
  const onColumnResize = (0, import_react25.useCallback)((diff) => {
5749
6061
  const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
5750
6062
  componentActions.viewportReservedWidth = reservedWidth;
5751
6063
  componentActions.columnSizing = columnSizing;
5752
- }, []);
6064
+ }, [computeResizeForDiff]);
5753
6065
  const groupResizable = groupColumns.some((c) => c.computedResizable);
5754
6066
  const resizeHandle = groupResizable ? /* @__PURE__ */ React24.createElement(GroupResizeHandle, {
5755
6067
  brain: bodyBrain,
@@ -5826,8 +6138,7 @@ function InfiniteTableHeaderFn(props) {
5826
6138
  }, [brain]);
5827
6139
  const domRef = (0, import_react26.useRef)(null);
5828
6140
  const headerCls = HeaderClsRecipe({
5829
- overflow: false,
5830
- virtualized: true
6141
+ overflow: false
5831
6142
  });
5832
6143
  const domProps = {
5833
6144
  ref: domRef,
@@ -6047,7 +6358,7 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
6047
6358
  }, []);
6048
6359
  (0, import_react27.useEffect)(() => {
6049
6360
  const forceStyle = () => {
6050
- requestAnimationFrame(() => {
6361
+ raf(() => {
6051
6362
  var _a;
6052
6363
  enforceStyle(domRef.current, defaultStyle);
6053
6364
  enforceStyle((_a = domRef.current) == null ? void 0 : _a.firstElementChild, anchorStyle);
@@ -6244,8 +6555,8 @@ var RowHoverCls = "_7pupv01";
6244
6555
  var React30 = __toModule(require("react"));
6245
6556
 
6246
6557
  // src/components/InfiniteTable/components/LoadMask.css.ts
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";
6558
+ var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw12 _16lm1iw14 _16lm1iw19 _16lm1iw17", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw12 _16lm1iw14 _16lm1iw19 _16lm1iw17" };
6559
+ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iw12 _16lm1iw14 _16lm1iw19 _16lm1iw17";
6249
6560
  var LoadMaskTextCls = "qy58ya4";
6250
6561
 
6251
6562
  // src/components/InfiniteTable/components/LoadMask.tsx
@@ -6274,6 +6585,22 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
6274
6585
  },
6275
6586
  getState,
6276
6587
  getDataSourceState,
6588
+ get scrollLeft() {
6589
+ const state = getState();
6590
+ return state.brain.getScrollPosition().scrollLeft;
6591
+ },
6592
+ set scrollLeft(scrollLeft2) {
6593
+ const state = getState();
6594
+ state.scrollerDOMRef.current.scrollLeft = Math.max(scrollLeft2, 0);
6595
+ },
6596
+ get scrollTop() {
6597
+ const state = getState();
6598
+ return state.brain.getScrollPosition().scrollTop;
6599
+ },
6600
+ set scrollTop(scrollTop2) {
6601
+ const state = getState();
6602
+ state.scrollerDOMRef.current.scrollTop = Math.max(scrollTop2, 0);
6603
+ },
6277
6604
  scrollRowIntoView(rowIndex, config = { offset: 0 }) {
6278
6605
  const state = getState();
6279
6606
  const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
@@ -6564,12 +6891,12 @@ function useCellRendering(param) {
6564
6891
  }, [brain]);
6565
6892
  (0, import_react30.useEffect)(() => {
6566
6893
  return brain.onScrollStop((scrollPosition) => {
6567
- const { scrollTop } = scrollPosition;
6568
- if (scrollTop === 0) {
6894
+ const { scrollTop: scrollTop2 } = scrollPosition;
6895
+ if (scrollTop2 === 0) {
6569
6896
  onScrollToTop == null ? void 0 : onScrollToTop();
6570
6897
  }
6571
6898
  const offset = scrollToBottomOffset != null ? scrollToBottomOffset : SCROLL_BOTTOM_OFFSET;
6572
- const isScrollBottom = scrollTop + offset >= scrollTopMaxRef.current;
6899
+ const isScrollBottom = scrollTop2 + offset >= scrollTopMaxRef.current;
6573
6900
  if (isScrollBottom) {
6574
6901
  onScrollToBottom == null ? void 0 : onScrollToBottom();
6575
6902
  const { livePagination, livePaginationCursor, dataArray: dataArray2 } = getDataSourceState();
@@ -7763,7 +8090,7 @@ function getChangeDetect() {
7763
8090
  // src/components/DataSource/privateHooks/useLoadData.ts
7764
8091
  var CACHE_DEFAULT = true;
7765
8092
  var getRafPromise = () => new Promise((resolve) => {
7766
- requestAnimationFrame(resolve);
8093
+ raf(resolve);
7767
8094
  });
7768
8095
  var SKIP_DATA_CHANGES_KEYS = {
7769
8096
  originalDataArray: true,
@@ -7929,17 +8256,15 @@ function loadData(data, componentState, actions, overrides) {
7929
8256
  lazyGroupData.set(theKey, currentGroupRowInfo);
7930
8257
  }
7931
8258
  } else {
7932
- if (parentKeys) {
7933
- newGroupRowInfo.children.forEach((child) => {
7934
- if (child && child.dataset) {
7935
- childDatasets.push({
7936
- keys: child.keys,
7937
- dataset: child.dataset
7938
- });
7939
- }
7940
- });
7941
- newGroupRowInfo.children.length = newGroupRowInfo.totalCount;
7942
- }
8259
+ newGroupRowInfo.children.forEach((child) => {
8260
+ if (child && child.dataset) {
8261
+ childDatasets.push({
8262
+ keys: child.keys,
8263
+ dataset: child.dataset
8264
+ });
8265
+ }
8266
+ });
8267
+ newGroupRowInfo.children.length = newGroupRowInfo.totalCount;
7943
8268
  lazyGroupData.set(theKey, newGroupRowInfo);
7944
8269
  }
7945
8270
  let skipTriggerChangeAsAlreadyOriginalArrayWasUpdated = false;
@@ -8091,6 +8416,7 @@ function useLazyLoadRange() {
8091
8416
  }, [componentState.data, componentState.dataParams]);
8092
8417
  const {
8093
8418
  lazyLoadBatchSize,
8419
+ lazyLoad,
8094
8420
  notifyRenderRangeChange,
8095
8421
  dataArray,
8096
8422
  scrollStopDelayUpdatedByTable
@@ -8103,27 +8429,33 @@ function useLazyLoadRange() {
8103
8429
  return;
8104
8430
  }
8105
8431
  const { renderStartIndex: startIndex, renderEndIndex: endIndex } = renderRange;
8106
- if (!lazyLoadBatchSize || lazyLoadBatchSize <= 0) {
8432
+ const { lazyLoadBatchSize: lazyLoadBatchSize2, lazyLoad: lazyLoad2 } = componentState2;
8433
+ if (!lazyLoad2) {
8107
8434
  return;
8108
8435
  }
8436
+ if (!lazyLoadBatchSize2 || lazyLoadBatchSize2 <= 0) {
8437
+ if (!componentState2.groupBy || componentState2.groupBy.length === 0) {
8438
+ return;
8439
+ }
8440
+ }
8109
8441
  lazyLoadRange({
8110
8442
  startIndex,
8111
8443
  endIndex,
8112
- lazyLoadBatchSize,
8444
+ lazyLoadBatchSize: lazyLoadBatchSize2,
8113
8445
  componentState: componentState2,
8114
8446
  componentActions: actions
8115
8447
  }, cache);
8116
8448
  };
8117
8449
  const debouncedLoadRange = (0, import_react39.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
8118
8450
  (0, import_react39.useEffect)(() => {
8119
- if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
8451
+ if (lazyLoad) {
8120
8452
  return notifyRenderRangeChange.onChange((renderRange) => {
8121
8453
  latestRenderRangeRef.current = renderRange;
8122
8454
  loadRange(renderRange);
8123
8455
  });
8124
8456
  }
8125
8457
  return;
8126
- }, [lazyLoadBatchSize]);
8458
+ }, [lazyLoadBatchSize, lazyLoad]);
8127
8459
  (0, import_react39.useEffect)(() => {
8128
8460
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
8129
8461
  debouncedLoadRange();
@@ -8177,7 +8509,7 @@ function lazyLoadRange(options, cache) {
8177
8509
  }
8178
8510
  }
8179
8511
  }
8180
- if (!rowLoaded) {
8512
+ if (!rowLoaded && lazyLoadBatchSize != void 0) {
8181
8513
  let cachedFnCalls = perGroupFnCalls.get(cacheKeys);
8182
8514
  const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
8183
8515
  const offset = indexInGroup - batchStartIndexInGroup;
@@ -8440,7 +8772,7 @@ function getInterceptActions() {
8440
8772
  });
8441
8773
  actions.dataParams = dataParams;
8442
8774
  if (state.livePagination) {
8443
- requestAnimationFrame(() => {
8775
+ raf(() => {
8444
8776
  actions.livePaginationCursor = null;
8445
8777
  });
8446
8778
  }
@@ -8452,7 +8784,7 @@ function getInterceptActions() {
8452
8784
  });
8453
8785
  actions.dataParams = dataParams;
8454
8786
  if (state.livePagination) {
8455
- requestAnimationFrame(() => {
8787
+ raf(() => {
8456
8788
  actions.livePaginationCursor = null;
8457
8789
  });
8458
8790
  }
@@ -8464,7 +8796,7 @@ function getInterceptActions() {
8464
8796
  });
8465
8797
  actions.dataParams = dataParams;
8466
8798
  if (state.livePagination) {
8467
- requestAnimationFrame(() => {
8799
+ raf(() => {
8468
8800
  actions.livePaginationCursor = null;
8469
8801
  });
8470
8802
  }
@@ -8476,7 +8808,7 @@ function getInterceptActions() {
8476
8808
  });
8477
8809
  actions.dataParams = dataParams;
8478
8810
  if (state.livePagination) {
8479
- requestAnimationFrame(() => {
8811
+ raf(() => {
8480
8812
  actions.livePaginationCursor = null;
8481
8813
  });
8482
8814
  }
@@ -9386,10 +9718,10 @@ var import_react43 = __toModule(require("react"));
9386
9718
  // src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
9387
9719
  var order = ["start", void 0, "end"];
9388
9720
  var adjustColumnOrderForPinning = (columnOrder, columnPinning) => {
9389
- if (columnPinning.size > 0) {
9721
+ if (columnPinning && Object.keys(columnPinning).length > 0) {
9390
9722
  columnOrder.sort((colId1, colId2) => {
9391
- let p1 = columnPinning.get(colId1);
9392
- let p2 = columnPinning.get(colId2);
9723
+ let p1 = columnPinning[colId1];
9724
+ let p2 = columnPinning[colId2];
9393
9725
  if (p1 === true) {
9394
9726
  p1 = "start";
9395
9727
  }
@@ -9430,7 +9762,10 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
9430
9762
  return columnVisibility[colId] !== false;
9431
9763
  };
9432
9764
  var getComputedPinned = (colId, columnPinning) => {
9433
- const pinned = columnPinning.get(colId);
9765
+ if (!columnPinning) {
9766
+ return false;
9767
+ }
9768
+ const pinned = columnPinning[colId];
9434
9769
  const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
9435
9770
  return computedPinned;
9436
9771
  };
@@ -9618,6 +9953,8 @@ var getComputedVisibleColumns = ({
9618
9953
  renderValue: colType.renderValue,
9619
9954
  render: colType.render,
9620
9955
  style: colType.style,
9956
+ headerStyle: colType.headerStyle,
9957
+ headerClassName: colType.headerClassName,
9621
9958
  components: colType.components,
9622
9959
  columnGroup: colType.columnGroup,
9623
9960
  field
@@ -9780,7 +10117,6 @@ var useComputedVisibleColumns = ({
9780
10117
  columnSizing
9781
10118
  }) => {
9782
10119
  const columnsRenderId = useRerenderOnKeyChange(columns);
9783
- const pinningRenderId = useRerenderOnKeyChange(columnPinning);
9784
10120
  const {
9785
10121
  computedRemainingSpace,
9786
10122
  computedColumnOrder,
@@ -9843,8 +10179,7 @@ var useComputedVisibleColumns = ({
9843
10179
  columnSizing,
9844
10180
  columnTypes,
9845
10181
  columnPinning,
9846
- columnsRenderId,
9847
- pinningRenderId
10182
+ columnsRenderId
9848
10183
  ]);
9849
10184
  const result = {
9850
10185
  columns,
@@ -10173,7 +10508,7 @@ var useLicense = (licenseKey = "") => {
10173
10508
  const valid = (0, import_react46.useMemo)(() => {
10174
10509
  let valid2 = isValidLicense(licenseKey, {
10175
10510
  publishedAt: 1624970570587,
10176
- version: "0.3.17"
10511
+ version: "0.3.20"
10177
10512
  });
10178
10513
  if (!licenseKey && !valid2 && isInsidePlayground) {
10179
10514
  return true;
@@ -10200,7 +10535,7 @@ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
10200
10535
  let tryScroll = function(times = 0) {
10201
10536
  times++;
10202
10537
  cancelAnimationFrame(rafId.current);
10203
- rafId.current = requestAnimationFrame(() => {
10538
+ rafId.current = raf(() => {
10204
10539
  didScrollRef.current = imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
10205
10540
  offset: 30
10206
10541
  });
@@ -10507,7 +10842,7 @@ function initSetupState2() {
10507
10842
  scrollTop: 0,
10508
10843
  scrollLeft: 0
10509
10844
  },
10510
- columnReorderInProgress: false,
10845
+ columnReorderDragColumnId: false,
10511
10846
  ready: false,
10512
10847
  focused: false,
10513
10848
  focusedWithin: false,
@@ -10576,7 +10911,6 @@ var forwardProps3 = (setupState) => {
10576
10911
  columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
10577
10912
  columns: (columns) => toMap(columns, setupState.propsCache.get("columns")),
10578
10913
  columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : {},
10579
- columnPinning: (columnPinning) => toMap(columnPinning, setupState.propsCache.get("columnPinning")),
10580
10914
  columnSizing: (columnSizing) => columnSizing || {},
10581
10915
  columnTypes: (columnTypes) => columnTypes || {},
10582
10916
  collapsedColumnGroups: (collapsedColumnGroups) => collapsedColumnGroups != null ? collapsedColumnGroups : new Map(),
@@ -10623,6 +10957,8 @@ var mapPropsToState2 = (params) => {
10623
10957
  });
10624
10958
  const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
10625
10959
  return {
10960
+ columnPinning: state.columnPinningWhileDragging || state.columnPinning || props.columnPinning,
10961
+ columnPinningWhileDragging: state.columnPinningWhileDragging,
10626
10962
  controlledColumnVisibility: !!props.columnVisibility,
10627
10963
  groupRenderStrategy,
10628
10964
  groupBy,
@@ -10662,16 +10998,14 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10662
10998
  getComputed,
10663
10999
  computed,
10664
11000
  componentActions: actions,
10665
- getState
11001
+ getState,
11002
+ imperativeApi
10666
11003
  } = useInfiniteTable();
10667
11004
  const {
10668
11005
  componentState: { loading, dataArray },
10669
11006
  getState: getDataSourceState,
10670
11007
  componentActions: dataSourceActions
10671
11008
  } = useDataSourceContextValue();
10672
- const [imperativeApi] = (0, import_react50.useState)(() => {
10673
- return getImperativeApi(getState, getComputed, getDataSourceState, actions);
10674
- });
10675
11009
  const {
10676
11010
  domRef,
10677
11011
  scrollerDOMRef,
@@ -10744,7 +11078,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10744
11078
  }) : null, /* @__PURE__ */ React36.createElement(InfiniteTableBody, null, /* @__PURE__ */ React36.createElement(HeadlessTable, {
10745
11079
  tabIndex: 0,
10746
11080
  activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
10747
- activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
11081
+ activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderDragColumnId ? activeCellIndex : null,
10748
11082
  scrollStopDelay,
10749
11083
  renderer,
10750
11084
  onRenderUpdater,
@@ -10757,6 +11091,12 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
10757
11091
  }, loadingText)), /* @__PURE__ */ React36.createElement("div", {
10758
11092
  ref: portalDOMRef,
10759
11093
  className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
11094
+ }), /* @__PURE__ */ React36.createElement("div", {
11095
+ "data-name": "pinned-start-border",
11096
+ className: PinnedStartIndicatorBorder
11097
+ }), /* @__PURE__ */ React36.createElement("div", {
11098
+ "data-name": "pinned-end-border",
11099
+ className: PinnedEndIndicatorBorder
10760
11100
  }), rowHeightCSSVar ? /* @__PURE__ */ React36.createElement(CSSVariableWatch, {
10761
11101
  varName: rowHeightCSSVar,
10762
11102
  onChange: onRowHeightCSSVarChange
@@ -10775,12 +11115,17 @@ function InfiniteTableContextProvider() {
10775
11115
  globalThis.getState = getState;
10776
11116
  globalThis.getComputed = getComputed;
10777
11117
  }
11118
+ const { getState: getDataSourceState } = useDataSourceContextValue();
11119
+ const [imperativeApi] = (0, import_react50.useState)(() => {
11120
+ return getImperativeApi(getState, getComputed, getDataSourceState, componentActions);
11121
+ });
10778
11122
  const contextValue = {
10779
11123
  componentActions,
10780
11124
  componentState,
10781
11125
  computed,
10782
11126
  getComputed,
10783
- getState
11127
+ getState,
11128
+ imperativeApi
10784
11129
  };
10785
11130
  useResizeObserver(scrollerDOMRef, (size) => {
10786
11131
  const bodySize = {