@infinite-table/infinite-react 0.3.13 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +68 -57
- package/index.d.ts +16 -10
- package/index.esm.css +68 -57
- package/index.esm.js +630 -449
- package/index.js +688 -502
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -638,9 +638,9 @@ import {
|
|
|
638
638
|
StrictMode,
|
|
639
639
|
createElement as createElement28,
|
|
640
640
|
memo as memo11,
|
|
641
|
-
useEffect as
|
|
641
|
+
useEffect as useEffect28
|
|
642
642
|
} from "react";
|
|
643
|
-
import { useCallback as useCallback18,
|
|
643
|
+
import { useCallback as useCallback18, useState as useState15 } from "react";
|
|
644
644
|
|
|
645
645
|
// src/utils/join.ts
|
|
646
646
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -878,7 +878,7 @@ import {
|
|
|
878
878
|
useCallback as useCallback4,
|
|
879
879
|
useEffect as useEffect7,
|
|
880
880
|
useRef as useRef7,
|
|
881
|
-
useState as
|
|
881
|
+
useState as useState3
|
|
882
882
|
} from "react";
|
|
883
883
|
|
|
884
884
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
@@ -1100,8 +1100,8 @@ function stripVar(cssVariableWithVarString) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
|
|
1102
1102
|
// src/components/InfiniteTable/theme.css.ts
|
|
1103
|
-
var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)",
|
|
1104
|
-
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: {
|
|
1103
|
+
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)" };
|
|
1104
|
+
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)" } } };
|
|
1105
1105
|
var columnHeaderHeightName = "column-header-height";
|
|
1106
1106
|
|
|
1107
1107
|
// src/utils/selectParent.ts
|
|
@@ -1131,6 +1131,8 @@ function getParentInfiniteNode(node) {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
var columnWidthAtIndex = stripVar(InternalVars.columnWidthAtIndex);
|
|
1133
1133
|
var columnOffsetAtIndex = stripVar(InternalVars.columnOffsetAtIndex);
|
|
1134
|
+
var columnOffsetAtIndexWhileReordering = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
|
|
1135
|
+
var columnZIndexAtIndex = stripVar(InternalVars.columnZIndexAtIndex);
|
|
1134
1136
|
function setInfiniteVarOnRoot(varName, varValue, node) {
|
|
1135
1137
|
const infinite = node ? getParentInfiniteNode(node) : document.querySelector(InfiniteSelector);
|
|
1136
1138
|
setInfiniteVarOnNode(varName, varValue, infinite);
|
|
@@ -1154,6 +1156,12 @@ function setInfiniteColumnWidth(colIndex, colWidth, node) {
|
|
|
1154
1156
|
function setInfiniteColumnOffset(colIndex, colOffset, node) {
|
|
1155
1157
|
setInfiniteVarOnRoot(`${columnOffsetAtIndex}-${colIndex}`, typeof colOffset === "number" ? colOffset + "px" : colOffset, node);
|
|
1156
1158
|
}
|
|
1159
|
+
function setInfiniteColumnZIndex(colIndex, colZIndex, node) {
|
|
1160
|
+
setInfiniteVarOnRoot(`${columnZIndexAtIndex}-${colIndex}`, `${colZIndex}`, node);
|
|
1161
|
+
}
|
|
1162
|
+
function setInfiniteColumnOffsetWhileReordering(colIndex, offset, node) {
|
|
1163
|
+
setInfiniteVarOnRoot(`${columnOffsetAtIndexWhileReordering}-${colIndex}`, typeof offset === "number" ? `calc( var(${columnOffsetAtIndex}-${colIndex}) + ${offset}px )` : offset, node);
|
|
1164
|
+
}
|
|
1157
1165
|
function getCSSVarNameForColWidth(colIndex) {
|
|
1158
1166
|
return `${columnWidthAtIndex}-${colIndex}`;
|
|
1159
1167
|
}
|
|
@@ -1453,6 +1461,36 @@ var MatrixBrain = class extends Logger {
|
|
|
1453
1461
|
renderCount = Math.min(count, renderCount);
|
|
1454
1462
|
return renderCount;
|
|
1455
1463
|
};
|
|
1464
|
+
this.isColFixedEnd = (colIndex) => {
|
|
1465
|
+
if (!this.fixedColsEnd) {
|
|
1466
|
+
return false;
|
|
1467
|
+
}
|
|
1468
|
+
return colIndex >= this.cols - this.fixedColsEnd;
|
|
1469
|
+
};
|
|
1470
|
+
this.isColFixedStart = (colIndex) => {
|
|
1471
|
+
if (!this.fixedColsStart) {
|
|
1472
|
+
return false;
|
|
1473
|
+
}
|
|
1474
|
+
return colIndex < this.fixedColsStart;
|
|
1475
|
+
};
|
|
1476
|
+
this.isRowFixedEnd = (rowIndex) => {
|
|
1477
|
+
if (!this.fixedRowsEnd) {
|
|
1478
|
+
return false;
|
|
1479
|
+
}
|
|
1480
|
+
return rowIndex >= this.rows - this.fixedRowsEnd;
|
|
1481
|
+
};
|
|
1482
|
+
this.isRowFixedStart = (rowIndex) => {
|
|
1483
|
+
if (!this.fixedRowsStart) {
|
|
1484
|
+
return false;
|
|
1485
|
+
}
|
|
1486
|
+
return rowIndex < this.fixedRowsStart;
|
|
1487
|
+
};
|
|
1488
|
+
this.isColFixed = (colIndex) => {
|
|
1489
|
+
return this.isColFixedStart(colIndex) || this.isColFixedEnd(colIndex);
|
|
1490
|
+
};
|
|
1491
|
+
this.isRowFixed = (rowIndex) => {
|
|
1492
|
+
return this.isRowFixedStart(rowIndex) || this.isRowFixedEnd(rowIndex);
|
|
1493
|
+
};
|
|
1456
1494
|
this.getFixedEndColsWidth = () => {
|
|
1457
1495
|
if (!this.fixedColsEnd) {
|
|
1458
1496
|
return 0;
|
|
@@ -2632,7 +2670,8 @@ var MappedCells = class extends Logger {
|
|
|
2632
2670
|
// src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx
|
|
2633
2671
|
var ITEM_POSITION_WITH_TRANSFORM = true;
|
|
2634
2672
|
var currentColumnTransformY = stripVar(InternalVars.currentColumnTransformY);
|
|
2635
|
-
var
|
|
2673
|
+
var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
2674
|
+
var columnOffsetAtIndexWhileReordering2 = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
|
|
2636
2675
|
var ReactHeadlessTableRenderer = class extends Logger {
|
|
2637
2676
|
constructor(brain) {
|
|
2638
2677
|
super("ReactHeadlessTableRenderer");
|
|
@@ -2647,14 +2686,17 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2647
2686
|
this.currentHoveredRow = -1;
|
|
2648
2687
|
this.hoverRowUpdatesInProgress = new Map();
|
|
2649
2688
|
this.infiniteNode = null;
|
|
2650
|
-
this.setTransform = (element, _rowIndex, colIndex, x, y) => {
|
|
2651
|
-
const
|
|
2689
|
+
this.setTransform = (element, _rowIndex, colIndex, x, y, zIndex2) => {
|
|
2690
|
+
const columnOffsetX = `${columnOffsetAtIndex2}-${colIndex}`;
|
|
2691
|
+
const columnOffsetXWhileReordering = `${columnOffsetAtIndexWhileReordering2}-${colIndex}`;
|
|
2652
2692
|
if (!this.infiniteNode) {
|
|
2653
2693
|
this.infiniteNode = getParentInfiniteNode(element);
|
|
2654
2694
|
}
|
|
2655
|
-
this.infiniteNode.style.setProperty(
|
|
2695
|
+
this.infiniteNode.style.setProperty(columnOffsetX, `${x}px`);
|
|
2656
2696
|
element.style.setProperty(currentColumnTransformY, `${y}px`);
|
|
2657
|
-
element.style.transform = `translate3d(var(${
|
|
2697
|
+
element.style.transform = `translate3d(var(${columnOffsetXWhileReordering}, var(${columnOffsetX})), ${InternalVars.currentColumnTransformY}, 0)`;
|
|
2698
|
+
if (zIndex2 != null) {
|
|
2699
|
+
}
|
|
2658
2700
|
};
|
|
2659
2701
|
this.getFullyVisibleRowsRange = () => {
|
|
2660
2702
|
let {
|
|
@@ -2684,21 +2726,26 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2684
2726
|
}
|
|
2685
2727
|
const rowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
2686
2728
|
const rowHeight = brain.getItemSize(rowIndex, "vertical");
|
|
2729
|
+
const fixedStartRowsHeight = brain.getFixedStartRowsHeight();
|
|
2730
|
+
const fixedEndRowsHeight = brain.getFixedEndRowsHeight();
|
|
2687
2731
|
const top2 = scrollPosition.scrollTop;
|
|
2688
2732
|
const availableSize = brain.getAvailableSize();
|
|
2733
|
+
if (!availableSize.height) {
|
|
2734
|
+
return null;
|
|
2735
|
+
}
|
|
2689
2736
|
const bottom = top2 + availableSize.height;
|
|
2690
2737
|
if (!scrollAdjustPosition) {
|
|
2691
|
-
scrollAdjustPosition = rowOffset > bottom ? "end" : rowOffset < top2 ? "start" : "end";
|
|
2738
|
+
scrollAdjustPosition = rowOffset > bottom - fixedEndRowsHeight ? "end" : rowOffset < top2 + fixedStartRowsHeight ? "start" : "end";
|
|
2692
2739
|
}
|
|
2693
2740
|
let scrollTop = scrollPosition.scrollTop;
|
|
2694
2741
|
if (scrollAdjustPosition === "center") {
|
|
2695
|
-
scrollTop = rowOffset - Math.floor(brain.getAvailableSize().height / 2);
|
|
2742
|
+
scrollTop = rowOffset - Math.floor((brain.getAvailableSize().height - fixedStartRowsHeight - fixedEndRowsHeight) / 2);
|
|
2696
2743
|
} else if (scrollAdjustPosition === "start") {
|
|
2697
2744
|
offset = -offset;
|
|
2698
|
-
scrollTop += rowOffset - top2 + offset;
|
|
2745
|
+
scrollTop += rowOffset - top2 + offset - fixedStartRowsHeight;
|
|
2699
2746
|
} else {
|
|
2700
2747
|
offset += rowHeight;
|
|
2701
|
-
scrollTop += rowOffset - bottom + offset;
|
|
2748
|
+
scrollTop += rowOffset - bottom + offset + fixedEndRowsHeight;
|
|
2702
2749
|
}
|
|
2703
2750
|
return __spreadProps(__spreadValues({}, scrollPosition), {
|
|
2704
2751
|
scrollTop
|
|
@@ -2711,37 +2758,47 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2711
2758
|
if (this.isColumnFullyVisible(colIndex) && !scrollAdjustPosition) {
|
|
2712
2759
|
return scrollPosition;
|
|
2713
2760
|
}
|
|
2714
|
-
const
|
|
2761
|
+
const colOffset = brain.getItemOffsetFor(colIndex, "horizontal");
|
|
2715
2762
|
const colWidth = brain.getItemSize(colIndex, "horizontal");
|
|
2763
|
+
const fixedStartColsWidth = brain.getFixedStartColsWidth();
|
|
2764
|
+
const fixedEndColsWidth = brain.getFixedStartColsWidth();
|
|
2716
2765
|
const left2 = scrollPosition.scrollLeft;
|
|
2717
2766
|
const availableSize = brain.getAvailableSize();
|
|
2767
|
+
if (!availableSize.width) {
|
|
2768
|
+
return null;
|
|
2769
|
+
}
|
|
2718
2770
|
const right = left2 + availableSize.width;
|
|
2719
2771
|
if (!scrollAdjustPosition) {
|
|
2720
|
-
scrollAdjustPosition =
|
|
2772
|
+
scrollAdjustPosition = colOffset > right - fixedEndColsWidth ? "end" : colOffset < left2 + fixedStartColsWidth ? "start" : "end";
|
|
2721
2773
|
}
|
|
2722
2774
|
let scrollLeft = scrollPosition.scrollLeft;
|
|
2723
2775
|
if (scrollAdjustPosition === "center") {
|
|
2724
|
-
scrollLeft =
|
|
2776
|
+
scrollLeft = colOffset - Math.floor((brain.getAvailableSize().width - fixedStartColsWidth - fixedEndColsWidth) / 2);
|
|
2725
2777
|
} else if (scrollAdjustPosition === "start") {
|
|
2726
2778
|
offset = -offset;
|
|
2727
|
-
scrollLeft +=
|
|
2779
|
+
scrollLeft += colOffset - left2 + offset - fixedStartColsWidth;
|
|
2728
2780
|
} else {
|
|
2729
2781
|
offset += colWidth;
|
|
2730
|
-
scrollLeft +=
|
|
2782
|
+
scrollLeft += colOffset - right + offset + fixedEndColsWidth;
|
|
2731
2783
|
}
|
|
2732
2784
|
return __spreadProps(__spreadValues({}, scrollPosition), {
|
|
2733
2785
|
scrollLeft
|
|
2734
2786
|
});
|
|
2735
2787
|
};
|
|
2736
2788
|
this.getScrollPositionForScrollCellIntoView = (rowIndex, colIndex, config = { offsetLeft: 0, offsetTop: 0 }) => {
|
|
2737
|
-
const
|
|
2789
|
+
const scrollPosForCol = this.getScrollPositionForScrollColumnIntoView(colIndex, {
|
|
2738
2790
|
scrollAdjustPosition: config.colScrollAdjustPosition || config.scrollAdjustPosition,
|
|
2739
2791
|
offset: config.offsetLeft
|
|
2740
2792
|
});
|
|
2741
|
-
const
|
|
2793
|
+
const scrollPosForRow = this.getScrollPositionForScrollRowIntoView(rowIndex, {
|
|
2742
2794
|
scrollAdjustPosition: config.rowScrollAdjustPosition || config.scrollAdjustPosition,
|
|
2743
2795
|
offset: config.offsetTop
|
|
2744
2796
|
});
|
|
2797
|
+
if (!scrollPosForCol || !scrollPosForRow) {
|
|
2798
|
+
return null;
|
|
2799
|
+
}
|
|
2800
|
+
const { scrollLeft } = scrollPosForCol;
|
|
2801
|
+
const { scrollTop } = scrollPosForRow;
|
|
2745
2802
|
return { scrollLeft, scrollTop };
|
|
2746
2803
|
};
|
|
2747
2804
|
this.isRowFullyVisible = (rowIndex, offsetMargin = 2) => {
|
|
@@ -2752,6 +2809,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2752
2809
|
return false;
|
|
2753
2810
|
}
|
|
2754
2811
|
const { brain } = this;
|
|
2812
|
+
if (brain.isRowFixed(rowIndex)) {
|
|
2813
|
+
return true;
|
|
2814
|
+
}
|
|
2755
2815
|
const {
|
|
2756
2816
|
start: [startRow],
|
|
2757
2817
|
end: [endRow]
|
|
@@ -2791,23 +2851,26 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2791
2851
|
return false;
|
|
2792
2852
|
}
|
|
2793
2853
|
const { brain } = this;
|
|
2854
|
+
if (brain.isColFixed(colIndex)) {
|
|
2855
|
+
return true;
|
|
2856
|
+
}
|
|
2794
2857
|
const {
|
|
2795
2858
|
start: [_, startCol],
|
|
2796
2859
|
end: [__, endCol]
|
|
2797
2860
|
} = brain.getRenderRange();
|
|
2798
|
-
const midCol = Math.floor((startCol + endCol) / 2);
|
|
2799
2861
|
if (colIndex < startCol) {
|
|
2800
2862
|
return false;
|
|
2801
2863
|
}
|
|
2802
2864
|
if (colIndex >= endCol) {
|
|
2803
2865
|
return false;
|
|
2804
2866
|
}
|
|
2867
|
+
const midCol = Math.floor((startCol + endCol) / 2);
|
|
2805
2868
|
if (colIndex >= midCol) {
|
|
2806
|
-
const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin, "horizontal");
|
|
2869
|
+
const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin - brain.getFixedEndColsWidth(), "horizontal");
|
|
2807
2870
|
return colIndex <= lastVisibleCol;
|
|
2808
2871
|
}
|
|
2809
2872
|
if (colIndex < midCol) {
|
|
2810
|
-
const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin, "horizontal");
|
|
2873
|
+
const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin + brain.getFixedStartColsWidth(), "horizontal");
|
|
2811
2874
|
return colIndex >= firstVisibleCol;
|
|
2812
2875
|
}
|
|
2813
2876
|
return true;
|
|
@@ -3150,7 +3213,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3150
3213
|
itemElement.dataset.rowIndex = rowIndex;
|
|
3151
3214
|
itemElement.dataset.colIndex = colIndex;
|
|
3152
3215
|
if (ITEM_POSITION_WITH_TRANSFORM) {
|
|
3153
|
-
this.setTransform(itemElement, rowIndex, colIndex, x, y);
|
|
3216
|
+
this.setTransform(itemElement, rowIndex, colIndex, x, y, null);
|
|
3154
3217
|
itemElement.style.willChange = "transform";
|
|
3155
3218
|
itemElement.style.backfaceVisibility = "hidden";
|
|
3156
3219
|
const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
|
|
@@ -3196,37 +3259,29 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3196
3259
|
}
|
|
3197
3260
|
}
|
|
3198
3261
|
const adjustColStart = (_rowIndex, colIndex, node, { x, y }, { scrollLeft }) => {
|
|
3199
|
-
node
|
|
3200
|
-
this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y);
|
|
3262
|
+
this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y, fixedColsStart - colIndex);
|
|
3201
3263
|
};
|
|
3202
3264
|
const adjustRowStart = (rowIndex, _colIndex, node, coords, scrollPosition2) => {
|
|
3203
|
-
node.
|
|
3204
|
-
this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop);
|
|
3265
|
+
this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop, fixedRowsStart - rowIndex);
|
|
3205
3266
|
};
|
|
3206
3267
|
const adjustColEnd = (_rowIndex, colIndex, node, { y }) => {
|
|
3207
|
-
node.style.zIndex = `${cols - colIndex}`;
|
|
3208
3268
|
const val = fixedEndColsOffsets[colIndex];
|
|
3209
|
-
this.setTransform(node, _rowIndex, colIndex, val, y);
|
|
3269
|
+
this.setTransform(node, _rowIndex, colIndex, val, y, cols - colIndex);
|
|
3210
3270
|
};
|
|
3211
3271
|
const adjustRowEnd = (rowIndex, _colIndex, node, coords) => {
|
|
3212
|
-
node.
|
|
3213
|
-
this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex]);
|
|
3272
|
+
this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex], rows - rowIndex);
|
|
3214
3273
|
};
|
|
3215
3274
|
const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }, scrollPosition2) => {
|
|
3216
|
-
node.
|
|
3217
|
-
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop);
|
|
3275
|
+
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop, 1e5);
|
|
3218
3276
|
};
|
|
3219
3277
|
const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }, scrollPosition2) => {
|
|
3220
|
-
node.
|
|
3221
|
-
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex]);
|
|
3278
|
+
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex], 2e5);
|
|
3222
3279
|
};
|
|
3223
3280
|
const adjustColEndRowStart = (_rowIndex, colIndex, node, coords) => {
|
|
3224
|
-
node.
|
|
3225
|
-
this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop);
|
|
3281
|
+
this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop, 3e5);
|
|
3226
3282
|
};
|
|
3227
3283
|
const adjustColEndRowEnd = (rowIndex, colIndex, node) => {
|
|
3228
|
-
node
|
|
3229
|
-
this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex]);
|
|
3284
|
+
this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex], 4e5);
|
|
3230
3285
|
};
|
|
3231
3286
|
if (fixedColsStart || fixedColsEnd) {
|
|
3232
3287
|
for (let rowIndex = startRow; rowIndex < endRow; rowIndex++) {
|
|
@@ -3447,7 +3502,7 @@ import {
|
|
|
3447
3502
|
createElement as createElement6,
|
|
3448
3503
|
memo as memo4
|
|
3449
3504
|
} from "react";
|
|
3450
|
-
import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect3, useRef as useRef5
|
|
3505
|
+
import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect3, useRef as useRef5 } from "react";
|
|
3451
3506
|
|
|
3452
3507
|
// src/components/hooks/useRerender.ts
|
|
3453
3508
|
import { useCallback as useCallback3, useState as useState2 } from "react";
|
|
@@ -3462,39 +3517,43 @@ var useRerender = () => {
|
|
|
3462
3517
|
};
|
|
3463
3518
|
|
|
3464
3519
|
// src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
|
|
3465
|
-
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwx
|
|
3466
|
-
var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwx
|
|
3520
|
+
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx", hidden: "nxbq1c3 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx" };
|
|
3521
|
+
var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx _16lm1iwt _16lm1iwn";
|
|
3467
3522
|
|
|
3468
3523
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
3469
|
-
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3
|
|
3524
|
+
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz" };
|
|
3470
3525
|
|
|
3471
3526
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
3472
3527
|
var { rootClassName: rootClassName3 } = internalProps;
|
|
3473
3528
|
var baseCls = `${rootClassName3}-ActiveRowIndicator`;
|
|
3529
|
+
var ActiveStyle = {
|
|
3530
|
+
[stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
|
|
3531
|
+
transform: `translate3d(0px, calc( ${InternalVars.activeCellOffsetY} + ${InternalVars.scrollTopForActiveRow}), 0px)`,
|
|
3532
|
+
height: InternalVars.activeCellRowHeight
|
|
3533
|
+
};
|
|
3474
3534
|
var ActiveRowIndicatorFn = (props) => {
|
|
3475
3535
|
const { brain } = props;
|
|
3476
|
-
const [state, setState] = useState3({
|
|
3477
|
-
top: 0,
|
|
3478
|
-
rowHeight: 0
|
|
3479
|
-
});
|
|
3480
3536
|
const domRef = useRef5(null);
|
|
3481
|
-
const stateRef = useRef5(state);
|
|
3482
3537
|
const active = props.activeRowIndex != null && brain.getRowCount() > props.activeRowIndex;
|
|
3483
|
-
const [
|
|
3538
|
+
const [_rerenderId, rerender] = useRerender();
|
|
3484
3539
|
useLayoutEffect3(() => {
|
|
3485
3540
|
if (props.activeRowIndex == null) {
|
|
3486
3541
|
return;
|
|
3487
3542
|
}
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3543
|
+
const rowIndex = props.activeRowIndex;
|
|
3544
|
+
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
3545
|
+
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
3546
|
+
const node = domRef.current;
|
|
3547
|
+
setInfiniteVarsOnNode({
|
|
3548
|
+
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
3549
|
+
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
3550
|
+
}, node);
|
|
3551
|
+
}, [props.activeRowIndex]);
|
|
3493
3552
|
useEffect5(() => {
|
|
3494
|
-
const removeOnScroll = brain.onScroll((
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3553
|
+
const removeOnScroll = brain.onScroll((scrollPosition) => {
|
|
3554
|
+
setInfiniteVarsOnNode({
|
|
3555
|
+
scrollTopForActiveRow: `${-scrollPosition.scrollTop}px`
|
|
3556
|
+
}, domRef.current);
|
|
3498
3557
|
});
|
|
3499
3558
|
const removeOnRenderCountChange = brain.onRenderCountChange(rerender);
|
|
3500
3559
|
return () => {
|
|
@@ -3509,10 +3568,7 @@ var ActiveRowIndicatorFn = (props) => {
|
|
|
3509
3568
|
ref: domRef,
|
|
3510
3569
|
"data-name": "active-row-indicator",
|
|
3511
3570
|
className: `${baseCls} ${active ? ActiveRowIndicatorCls.visible : ActiveRowIndicatorCls.hidden}`,
|
|
3512
|
-
style: active ?
|
|
3513
|
-
transform: `translate3d(0px, ${-brain.getScrollPosition().scrollTop + state.top}px,0)`,
|
|
3514
|
-
height: state.rowHeight
|
|
3515
|
-
} : void 0
|
|
3571
|
+
style: active ? ActiveStyle : void 0
|
|
3516
3572
|
}));
|
|
3517
3573
|
};
|
|
3518
3574
|
var ActiveRowIndicator = memo4(ActiveRowIndicatorFn);
|
|
@@ -3525,15 +3581,17 @@ import {
|
|
|
3525
3581
|
import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect4, useRef as useRef6 } from "react";
|
|
3526
3582
|
var { rootClassName: rootClassName4 } = internalProps;
|
|
3527
3583
|
var baseCls2 = `${rootClassName4}-ActiveCellIndicator`;
|
|
3528
|
-
var
|
|
3529
|
-
|
|
3530
|
-
[stripVar(InternalVars.
|
|
3584
|
+
var columnZIndexAtIndex2 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
3585
|
+
var ActiveStyle2 = {
|
|
3586
|
+
[stripVar(InternalVars.activeCellOffsetX)]: InternalVars.activeCellColOffset,
|
|
3587
|
+
[stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
|
|
3531
3588
|
transform: `translate3d(${InternalVars.activeCellOffsetX}, ${InternalVars.activeCellOffsetY}, 0px)`,
|
|
3532
3589
|
width: InternalVars.activeCellColWidth,
|
|
3533
3590
|
height: InternalVars.activeCellRowHeight
|
|
3534
3591
|
};
|
|
3535
3592
|
var ActiveCellIndicatorFn = (props) => {
|
|
3536
3593
|
const { brain } = props;
|
|
3594
|
+
const [_rerenderId, rerender] = useRerender();
|
|
3537
3595
|
const domRef = useRef6(null);
|
|
3538
3596
|
const active = props.activeCellIndex != null && brain.getRowCount() > props.activeCellIndex[0];
|
|
3539
3597
|
useLayoutEffect4(() => {
|
|
@@ -3544,33 +3602,30 @@ var ActiveCellIndicatorFn = (props) => {
|
|
|
3544
3602
|
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
3545
3603
|
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
3546
3604
|
const node = domRef.current;
|
|
3547
|
-
const scrollPosition = brain.getScrollPosition();
|
|
3548
3605
|
setInfiniteVarsOnNode({
|
|
3549
|
-
scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
|
|
3550
|
-
scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`,
|
|
3551
3606
|
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
3552
3607
|
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
3553
3608
|
}, node);
|
|
3554
3609
|
}, [props.activeCellIndex]);
|
|
3555
3610
|
useEffect6(() => {
|
|
3556
|
-
const
|
|
3557
|
-
|
|
3558
|
-
scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
|
|
3559
|
-
scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`
|
|
3560
|
-
}, domRef.current);
|
|
3611
|
+
const removeOnRenderCountChange = brain.onRenderCountChange(() => {
|
|
3612
|
+
rerender();
|
|
3561
3613
|
});
|
|
3562
3614
|
return () => {
|
|
3563
|
-
|
|
3615
|
+
removeOnRenderCountChange();
|
|
3564
3616
|
};
|
|
3565
3617
|
}, [brain]);
|
|
3566
3618
|
return /* @__PURE__ */ createElement7("div", {
|
|
3567
3619
|
className: ActiveIndicatorWrapperCls,
|
|
3568
|
-
"data-name": "active-cell"
|
|
3620
|
+
"data-name": "active-cell",
|
|
3621
|
+
style: active ? {
|
|
3622
|
+
zIndex: `var(${columnZIndexAtIndex2}-${props.activeCellIndex[1]})`
|
|
3623
|
+
} : void 0
|
|
3569
3624
|
}, /* @__PURE__ */ createElement7("div", {
|
|
3570
3625
|
ref: domRef,
|
|
3571
3626
|
"data-name": "active-cell-indicator",
|
|
3572
3627
|
className: `${baseCls2} ${active ? ActiveCellIndicatorCls.visible : ActiveCellIndicatorCls.hidden}`,
|
|
3573
|
-
style: active ?
|
|
3628
|
+
style: active ? ActiveStyle2 : void 0
|
|
3574
3629
|
}));
|
|
3575
3630
|
};
|
|
3576
3631
|
var ActiveCellIndicator = memo5(ActiveCellIndicatorFn);
|
|
@@ -3619,7 +3674,7 @@ function HeadlessTable(props) {
|
|
|
3619
3674
|
"onRenderUpdater"
|
|
3620
3675
|
]);
|
|
3621
3676
|
const domRef = useRef7(null);
|
|
3622
|
-
const [scrollSize, setTotalScrollSize] =
|
|
3677
|
+
const [scrollSize, setTotalScrollSize] = useState3({
|
|
3623
3678
|
width: 0,
|
|
3624
3679
|
height: 0
|
|
3625
3680
|
});
|
|
@@ -3670,12 +3725,12 @@ function HeadlessTable(props) {
|
|
|
3670
3725
|
renderCell,
|
|
3671
3726
|
brain,
|
|
3672
3727
|
cellHoverClassNames
|
|
3673
|
-
})), /* @__PURE__ */ createElement8(ActiveRowIndicator, {
|
|
3674
|
-
brain,
|
|
3675
|
-
activeRowIndex
|
|
3676
3728
|
}), /* @__PURE__ */ createElement8(ActiveCellIndicator, {
|
|
3677
3729
|
brain,
|
|
3678
3730
|
activeCellIndex
|
|
3731
|
+
})), /* @__PURE__ */ createElement8(ActiveRowIndicator, {
|
|
3732
|
+
brain,
|
|
3733
|
+
activeRowIndex
|
|
3679
3734
|
}), /* @__PURE__ */ createElement8(SpacePlaceholder, {
|
|
3680
3735
|
width: scrollSize.width,
|
|
3681
3736
|
height: scrollSize.height
|
|
@@ -3693,7 +3748,7 @@ import {
|
|
|
3693
3748
|
createContext as createContext2,
|
|
3694
3749
|
useMemo as useMemo3,
|
|
3695
3750
|
useEffect as useEffect8,
|
|
3696
|
-
useState as
|
|
3751
|
+
useState as useState4,
|
|
3697
3752
|
useRef as useRef10
|
|
3698
3753
|
} from "react";
|
|
3699
3754
|
|
|
@@ -3831,14 +3886,14 @@ function forwardProps(propsToForward, props) {
|
|
|
3831
3886
|
function getComponentStateRoot(config) {
|
|
3832
3887
|
return memo6(function ComponentStateRoot(props) {
|
|
3833
3888
|
var _a, _b;
|
|
3834
|
-
const [initialSetupState] =
|
|
3889
|
+
const [initialSetupState] = useState4(() => {
|
|
3835
3890
|
return config.initSetupState ? config.initSetupState() : {};
|
|
3836
3891
|
});
|
|
3837
3892
|
const propsToStateSetRef = useRef10(new Set());
|
|
3838
3893
|
const propsToForward = useMemo3(() => config.forwardProps ? config.forwardProps(initialSetupState) : {}, [initialSetupState]);
|
|
3839
3894
|
const parentState = (_b = (_a = config.getParentState) == null ? void 0 : _a.call(config)) != null ? _b : null;
|
|
3840
3895
|
const getParentState = useLatest(parentState);
|
|
3841
|
-
const [wholeState] =
|
|
3896
|
+
const [wholeState] = useState4(() => {
|
|
3842
3897
|
let mappedState = {};
|
|
3843
3898
|
if (propsToForward) {
|
|
3844
3899
|
mappedState = forwardProps(propsToForward, props);
|
|
@@ -4007,20 +4062,20 @@ var useInternalProps = () => {
|
|
|
4007
4062
|
};
|
|
4008
4063
|
|
|
4009
4064
|
// src/components/InfiniteTable/utilities.css.ts
|
|
4010
|
-
var alignItems = { center: "
|
|
4011
|
-
var cssEllipsisClassName = "
|
|
4065
|
+
var alignItems = { center: "_16lm1iw17", stretch: "_16lm1iw18" };
|
|
4066
|
+
var cssEllipsisClassName = "_16lm1iw1g _16lm1iw1h _16lm1iw1c";
|
|
4012
4067
|
var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
|
|
4013
|
-
var display = { flex: "
|
|
4068
|
+
var display = { flex: "_16lm1iwp", block: "_16lm1iwq", inlineBlock: "_16lm1iwr" };
|
|
4014
4069
|
var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
|
|
4015
|
-
var flexFlow = { column: "
|
|
4016
|
-
var justifyContent = { center: "
|
|
4017
|
-
var left = { "0": "
|
|
4018
|
-
var overflow = { hidden: "
|
|
4070
|
+
var flexFlow = { column: "_16lm1iw15", row: "_16lm1iw16" };
|
|
4071
|
+
var justifyContent = { center: "_16lm1iw19", start: "_16lm1iw1a", end: "_16lm1iw1b" };
|
|
4072
|
+
var left = { "0": "_16lm1iwz", "100%": "_16lm1iw10" };
|
|
4073
|
+
var overflow = { hidden: "_16lm1iw1c", auto: "_16lm1iw1d", visible: "_16lm1iw1e" };
|
|
4019
4074
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
4020
|
-
var top = { "0": "
|
|
4075
|
+
var top = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
|
|
4021
4076
|
var transformTranslateZero = "_16lm1iwa";
|
|
4022
|
-
var userSelect = { none: "
|
|
4023
|
-
var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm" };
|
|
4077
|
+
var userSelect = { none: "_16lm1iws" };
|
|
4078
|
+
var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm", "1000000": "_16lm1iwn", "10000000": "_16lm1iwo" };
|
|
4024
4079
|
|
|
4025
4080
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4026
4081
|
var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
|
|
@@ -4053,7 +4108,7 @@ import {
|
|
|
4053
4108
|
createElement as createElement16,
|
|
4054
4109
|
useMemo as useMemo5
|
|
4055
4110
|
} from "react";
|
|
4056
|
-
import { useCallback as useCallback8, useContext as
|
|
4111
|
+
import { useCallback as useCallback8, useContext as useContext4, useEffect as useEffect11, useRef as useRef12 } from "react";
|
|
4057
4112
|
import { createPortal } from "react-dom";
|
|
4058
4113
|
|
|
4059
4114
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -4157,12 +4212,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4157
4212
|
|
|
4158
4213
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4159
4214
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
4160
|
-
import {
|
|
4161
|
-
useCallback as useCallback6,
|
|
4162
|
-
useMemo as useMemo4,
|
|
4163
|
-
useRef as useRef11,
|
|
4164
|
-
useState as useState6
|
|
4165
|
-
} from "react";
|
|
4215
|
+
import { useCallback as useCallback6, useMemo as useMemo4, useState as useState5 } from "react";
|
|
4166
4216
|
|
|
4167
4217
|
// src/components/InfiniteTable/hooks/useInfiniteTable.ts
|
|
4168
4218
|
import { useContext as useContext3 } from "react";
|
|
@@ -4200,120 +4250,297 @@ var moveXatY = (arr, dragIndex, dropIndex) => {
|
|
|
4200
4250
|
return arr;
|
|
4201
4251
|
};
|
|
4202
4252
|
|
|
4253
|
+
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
4254
|
+
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4255
|
+
var FooterCls = "_16lm1iw1";
|
|
4256
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwp _16lm1iw15 _16lm1iw0";
|
|
4257
|
+
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"]] });
|
|
4258
|
+
var InfiniteClsShiftingColumns = "_1yeub2vl";
|
|
4259
|
+
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4260
|
+
|
|
4261
|
+
// src/components/InfiniteTable/utils/rafFn.ts
|
|
4262
|
+
var rafFn = (fn) => {
|
|
4263
|
+
let rafId = 0;
|
|
4264
|
+
return (...args) => {
|
|
4265
|
+
if (rafId) {
|
|
4266
|
+
cancelAnimationFrame(rafId);
|
|
4267
|
+
}
|
|
4268
|
+
rafId = requestAnimationFrame(() => {
|
|
4269
|
+
rafId = 0;
|
|
4270
|
+
fn(...args);
|
|
4271
|
+
});
|
|
4272
|
+
};
|
|
4273
|
+
};
|
|
4274
|
+
|
|
4275
|
+
// src/components/InfiniteTable/hooks/useDOMProps.ts
|
|
4276
|
+
var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4277
|
+
var columnOffsetAtIndex3 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4278
|
+
var columnZIndexAtIndex3 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
4279
|
+
var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
|
|
4280
|
+
var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
|
|
4281
|
+
var baseZIndexForCells = stripVar(InternalVars.baseZIndexForCells);
|
|
4282
|
+
var computedVisibleColumnsCountCSSVar = stripVar(InternalVars.computedVisibleColumnsCount);
|
|
4283
|
+
function getColumnZIndex(col, params) {
|
|
4284
|
+
let computedZIndex = "auto";
|
|
4285
|
+
const index = col.computedVisibleIndex;
|
|
4286
|
+
if (col.computedPinned) {
|
|
4287
|
+
if (col.computedPinned === "start") {
|
|
4288
|
+
computedZIndex = params.pinnedStartColsCount - col.computedVisibleIndexInCategory;
|
|
4289
|
+
} else if (col.computedPinned === "end") {
|
|
4290
|
+
computedZIndex = params.visibleColsCount - col.computedVisibleIndexInCategory;
|
|
4291
|
+
}
|
|
4292
|
+
} else {
|
|
4293
|
+
computedZIndex = -index * 10;
|
|
4294
|
+
}
|
|
4295
|
+
const zIndexValue = typeof computedZIndex === "number" ? `calc( var(${baseZIndexForCells}) ` + (computedZIndex < 0 ? "-" : "+") + ` ${Math.abs(computedZIndex)} )` : "auto";
|
|
4296
|
+
return zIndexValue;
|
|
4297
|
+
}
|
|
4298
|
+
function useDOMProps(initialDOMProps) {
|
|
4299
|
+
const { computed, componentState, componentActions } = useInfiniteTable();
|
|
4300
|
+
const {
|
|
4301
|
+
focused,
|
|
4302
|
+
focusedWithin,
|
|
4303
|
+
domRef,
|
|
4304
|
+
onBlurWithin,
|
|
4305
|
+
onFocusWithin,
|
|
4306
|
+
onSelfFocus,
|
|
4307
|
+
onSelfBlur,
|
|
4308
|
+
activeCellIndex
|
|
4309
|
+
} = componentState;
|
|
4310
|
+
const {
|
|
4311
|
+
computedPinnedStartColumnsWidth,
|
|
4312
|
+
computedPinnedEndColumnsWidth,
|
|
4313
|
+
computedPinnedStartColumns,
|
|
4314
|
+
computedVisibleColumns
|
|
4315
|
+
} = computed;
|
|
4316
|
+
const cssVars = computedVisibleColumns.reduce((vars, col) => {
|
|
4317
|
+
const index = col.computedVisibleIndex;
|
|
4318
|
+
vars[`${columnWidthAtIndex2}-${index}`] = col.computedWidth + "px";
|
|
4319
|
+
vars[`${columnOffsetAtIndex3}-${index}`] = col.computedOffset + "px";
|
|
4320
|
+
const zIndexValue = getColumnZIndex(col, {
|
|
4321
|
+
pinnedStartColsCount: computedPinnedStartColumns.length,
|
|
4322
|
+
visibleColsCount: computedVisibleColumns.length
|
|
4323
|
+
});
|
|
4324
|
+
vars[`${columnZIndexAtIndex3}-${index}`] = `${zIndexValue}`;
|
|
4325
|
+
return vars;
|
|
4326
|
+
}, {});
|
|
4327
|
+
if (activeCellIndex != null) {
|
|
4328
|
+
cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
|
|
4329
|
+
cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
|
|
4330
|
+
}
|
|
4331
|
+
cssVars[computedVisibleColumnsCountCSSVar] = computedVisibleColumns.length;
|
|
4332
|
+
cssVars[baseZIndexForCells] = computedVisibleColumns.length * 10;
|
|
4333
|
+
const setFocused = rafFn((focused2) => {
|
|
4334
|
+
componentActions.focused = focused2;
|
|
4335
|
+
});
|
|
4336
|
+
const setFocusedWithin = rafFn((focused2) => {
|
|
4337
|
+
componentActions.focusedWithin = focused2;
|
|
4338
|
+
});
|
|
4339
|
+
const onFocus = (event) => {
|
|
4340
|
+
var _a;
|
|
4341
|
+
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
4342
|
+
if (event.target === domRef.current) {
|
|
4343
|
+
setFocused(true);
|
|
4344
|
+
onSelfFocus == null ? void 0 : onSelfFocus(event);
|
|
4345
|
+
if (focusedWithin) {
|
|
4346
|
+
setFocusedWithin(false);
|
|
4347
|
+
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
4348
|
+
}
|
|
4349
|
+
} else {
|
|
4350
|
+
if (!focusedWithin) {
|
|
4351
|
+
setFocusedWithin(true);
|
|
4352
|
+
onFocusWithin == null ? void 0 : onFocusWithin(event);
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
};
|
|
4356
|
+
const onBlur = (event) => {
|
|
4357
|
+
var _a, _b;
|
|
4358
|
+
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
4359
|
+
if (event.target === domRef.current) {
|
|
4360
|
+
setFocused(false);
|
|
4361
|
+
onSelfBlur == null ? void 0 : onSelfBlur(event);
|
|
4362
|
+
if (focusedWithin) {
|
|
4363
|
+
setFocusedWithin(false);
|
|
4364
|
+
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
4365
|
+
}
|
|
4366
|
+
} else {
|
|
4367
|
+
const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
|
|
4368
|
+
if (!contained) {
|
|
4369
|
+
setFocusedWithin(false);
|
|
4370
|
+
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
};
|
|
4374
|
+
const domProps = __spreadProps(__spreadValues({
|
|
4375
|
+
tabIndex: 0
|
|
4376
|
+
}, initialDOMProps), {
|
|
4377
|
+
onFocus,
|
|
4378
|
+
onBlur
|
|
4379
|
+
});
|
|
4380
|
+
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({
|
|
4381
|
+
hasPinnedStart: !!computedPinnedStartColumnsWidth,
|
|
4382
|
+
hasPinnedEnd: !!computedPinnedEndColumnsWidth,
|
|
4383
|
+
focused,
|
|
4384
|
+
focusedWithin
|
|
4385
|
+
}));
|
|
4386
|
+
domProps.className = className;
|
|
4387
|
+
domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
|
|
4388
|
+
if (focused) {
|
|
4389
|
+
if (componentState.focusedStyle) {
|
|
4390
|
+
Object.assign(domProps.style, componentState.focusedStyle);
|
|
4391
|
+
}
|
|
4392
|
+
}
|
|
4393
|
+
if (focusedWithin) {
|
|
4394
|
+
if (componentState.focusedWithinStyle) {
|
|
4395
|
+
Object.assign(domProps.style, componentState.focusedWithinStyle);
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
return domProps;
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4203
4401
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4402
|
+
var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4403
|
+
var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4404
|
+
var PROXY_OFFSET = 10;
|
|
4204
4405
|
var getBreakPoints = (columns) => {
|
|
4205
4406
|
return Array.from(columns.values()).map((c) => {
|
|
4206
4407
|
return {
|
|
4207
4408
|
columnId: c.id,
|
|
4208
4409
|
breakpoint: c.computedAbsoluteOffset + Math.round(c.computedWidth / 2)
|
|
4209
4410
|
};
|
|
4210
|
-
});
|
|
4411
|
+
}).filter(Boolean);
|
|
4211
4412
|
};
|
|
4212
4413
|
var useColumnPointerEvents = ({
|
|
4213
4414
|
columnId,
|
|
4214
4415
|
domRef,
|
|
4215
4416
|
columns,
|
|
4216
|
-
computedRemainingSpace
|
|
4417
|
+
computedRemainingSpace,
|
|
4418
|
+
pinnedStartColsCount,
|
|
4419
|
+
visibleColsCount
|
|
4217
4420
|
}) => {
|
|
4218
|
-
const [
|
|
4219
|
-
const
|
|
4220
|
-
const
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
const { componentActions, computed } = useInfiniteTable();
|
|
4421
|
+
const [proxyPosition, setProxyPosition] = useState5(null);
|
|
4422
|
+
const dragging = proxyPosition != null;
|
|
4423
|
+
const {
|
|
4424
|
+
componentActions,
|
|
4425
|
+
computed,
|
|
4426
|
+
componentState: { domRef: rootRef, brain }
|
|
4427
|
+
} = useInfiniteTable();
|
|
4226
4428
|
const { computedColumnOrder } = computed;
|
|
4227
4429
|
const column = useMemo4(() => columns.get(columnId), [columnId, columns]);
|
|
4228
|
-
const {
|
|
4430
|
+
const { dragColumnIndex, columnsArray } = useMemo4(() => {
|
|
4229
4431
|
const columnsArray2 = Array.from(columns.values());
|
|
4432
|
+
const columnIndex = columnsArray2.findIndex((c) => c.id === columnId);
|
|
4230
4433
|
return {
|
|
4231
4434
|
columnsArray: columnsArray2,
|
|
4232
|
-
|
|
4233
|
-
columnWidth: column.computedWidth
|
|
4435
|
+
dragColumnIndex: columnIndex,
|
|
4436
|
+
columnWidth: column.computedWidth,
|
|
4437
|
+
columnOffsetVar: `var(${columnOffsetAtIndex4}-${column.computedVisibleIndex})`
|
|
4234
4438
|
};
|
|
4235
4439
|
}, [columns, columnId, column]);
|
|
4236
|
-
let cursorRef = useRef11("auto");
|
|
4237
4440
|
const onPointerDown = useCallback6((e) => {
|
|
4441
|
+
var _a;
|
|
4442
|
+
let breakpoints = [];
|
|
4238
4443
|
const target = domRef.current;
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4444
|
+
const initialClientPos = {
|
|
4445
|
+
clientX: Math.round(e.clientX),
|
|
4446
|
+
clientY: Math.round(e.clientY)
|
|
4447
|
+
};
|
|
4448
|
+
const initialScrollPosition2 = brain.getScrollPosition();
|
|
4449
|
+
const initialProxyPosition = {
|
|
4450
|
+
left: PROXY_OFFSET - initialScrollPosition2.scrollLeft,
|
|
4451
|
+
top: PROXY_OFFSET
|
|
4452
|
+
};
|
|
4453
|
+
let currentClientPos = initialClientPos;
|
|
4454
|
+
let currentDiff = {
|
|
4455
|
+
x: 0,
|
|
4456
|
+
y: 0
|
|
4457
|
+
};
|
|
4458
|
+
function updateColumnOffsets(pos) {
|
|
4459
|
+
const clientX = Math.round(pos.clientX);
|
|
4460
|
+
const clientY = Math.round(pos.clientY);
|
|
4461
|
+
if (clientX === currentClientPos.clientX && clientY === currentClientPos.clientY) {
|
|
4462
|
+
return;
|
|
4463
|
+
}
|
|
4464
|
+
currentClientPos = { clientX, clientY };
|
|
4465
|
+
currentDiff.x = currentClientPos.clientX - initialClientPos.clientX;
|
|
4466
|
+
currentDiff.y = currentClientPos.clientY - initialClientPos.clientY;
|
|
4467
|
+
setProxyPosition({
|
|
4468
|
+
left: initialProxyPosition.left + currentDiff.x,
|
|
4469
|
+
top: initialProxyPosition.top + currentDiff.y
|
|
4470
|
+
});
|
|
4471
|
+
}
|
|
4472
|
+
updateColumnOffsets(initialClientPos);
|
|
4473
|
+
let initialCursor = (_a = target.style.cursor) != null ? _a : "auto";
|
|
4474
|
+
let didDragAtLeastOnce = false;
|
|
4475
|
+
let currentDropIndex = dragColumnIndex;
|
|
4245
4476
|
const onPointerMove = (e2) => {
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
top: e2.clientY - rect.y - 10
|
|
4254
|
-
});
|
|
4477
|
+
var _a2;
|
|
4478
|
+
if (!didDragAtLeastOnce) {
|
|
4479
|
+
didDragAtLeastOnce = true;
|
|
4480
|
+
componentActions.columnReorderInProgress = true;
|
|
4481
|
+
breakpoints = getBreakPoints(columns);
|
|
4482
|
+
setInfiniteColumnZIndex(dragColumnIndex, 1e6, rootRef.current);
|
|
4483
|
+
(_a2 = rootRef.current) == null ? void 0 : _a2.classList.add(InfiniteClsShiftingColumns);
|
|
4255
4484
|
target.style.cursor = "grabbing";
|
|
4256
4485
|
}
|
|
4257
|
-
|
|
4258
|
-
const
|
|
4486
|
+
updateColumnOffsets(e2);
|
|
4487
|
+
const diffX = currentDiff.x;
|
|
4259
4488
|
const dir = diffX < 0 ? -1 : 1;
|
|
4260
|
-
const columnPinned = column.computedPinned;
|
|
4261
4489
|
let currentPos = dir === -1 ? column.computedAbsoluteOffset + diffX : column.computedAbsoluteOffset + column.computedWidth + diffX;
|
|
4262
|
-
|
|
4263
|
-
let index = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
|
|
4490
|
+
let idx = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
|
|
4264
4491
|
return breakpoint < value ? -1 : breakpoint > value ? 1 : 0;
|
|
4265
4492
|
});
|
|
4266
|
-
if (
|
|
4267
|
-
|
|
4268
|
-
}
|
|
4269
|
-
if (
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
total -= shiftBy;
|
|
4493
|
+
if (idx < 0) {
|
|
4494
|
+
idx = ~idx;
|
|
4495
|
+
}
|
|
4496
|
+
if (idx !== currentDropIndex) {
|
|
4497
|
+
currentDropIndex = idx;
|
|
4498
|
+
if (dir === 1 && currentDropIndex === dragColumnIndex + 1) {
|
|
4499
|
+
currentDropIndex = dragColumnIndex;
|
|
4500
|
+
}
|
|
4501
|
+
columnsArray.forEach((col) => {
|
|
4502
|
+
const colIndex = col.computedVisibleIndex;
|
|
4503
|
+
if (dir === -1) {
|
|
4504
|
+
let newPosition = colIndex === dragColumnIndex ? `var(${columnOffsetAtIndex4}-${currentDropIndex})` : colIndex < currentDropIndex || colIndex > dragColumnIndex ? `var(${columnOffsetAtIndex4}-${colIndex})` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) + var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
|
|
4505
|
+
setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
|
|
4506
|
+
return;
|
|
4281
4507
|
}
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4508
|
+
if (dir === 1) {
|
|
4509
|
+
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}) )`;
|
|
4510
|
+
setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
|
|
4511
|
+
return;
|
|
4286
4512
|
}
|
|
4287
|
-
}
|
|
4288
|
-
if (index !== columnIndex) {
|
|
4289
|
-
shifts[columnIndex] = total;
|
|
4290
|
-
}
|
|
4291
|
-
componentActions.columnShifts = shifts;
|
|
4292
|
-
componentActions.draggingColumnId = column.id;
|
|
4513
|
+
});
|
|
4293
4514
|
}
|
|
4294
|
-
setDraggingDiff({ left: diffX, top: diffY });
|
|
4295
4515
|
};
|
|
4296
4516
|
const onPointerUp = (e2) => {
|
|
4517
|
+
var _a2;
|
|
4297
4518
|
const target2 = domRef.current;
|
|
4298
|
-
|
|
4519
|
+
(_a2 = rootRef.current) == null ? void 0 : _a2.classList.remove(InfiniteClsShiftingColumns);
|
|
4520
|
+
columnsArray.forEach((col) => {
|
|
4521
|
+
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
4522
|
+
});
|
|
4523
|
+
setInfiniteColumnZIndex(dragColumnIndex, getColumnZIndex(column, {
|
|
4524
|
+
pinnedStartColsCount,
|
|
4525
|
+
visibleColsCount
|
|
4526
|
+
}), rootRef.current);
|
|
4527
|
+
target2.style.cursor = initialCursor;
|
|
4299
4528
|
target2.releasePointerCapture(e2.pointerId);
|
|
4300
4529
|
target2.removeEventListener("pointermove", onPointerMove);
|
|
4301
4530
|
target2.removeEventListener("pointerup", onPointerUp);
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
componentActions.draggingColumnId = null;
|
|
4305
|
-
if (!didDragRef.current && column.computedSortable) {
|
|
4531
|
+
setProxyPosition(null);
|
|
4532
|
+
if (!didDragAtLeastOnce && column.computedSortable) {
|
|
4306
4533
|
column.toggleSort();
|
|
4307
4534
|
}
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4535
|
+
if (currentDropIndex != null && currentDropIndex !== dragColumnIndex) {
|
|
4536
|
+
const newOrder = moveXatY(computedColumnOrder, dragColumnIndex, currentDropIndex > dragColumnIndex ? currentDropIndex - 1 : currentDropIndex);
|
|
4537
|
+
columnsArray.forEach((col) => {
|
|
4538
|
+
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
4539
|
+
});
|
|
4311
4540
|
componentActions.columnOrder = newOrder;
|
|
4312
4541
|
}
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
initialClientPos.current = null;
|
|
4316
|
-
currentDropIndexRef.current = null;
|
|
4542
|
+
componentActions.columnReorderInProgress = false;
|
|
4543
|
+
breakpoints = [];
|
|
4317
4544
|
};
|
|
4318
4545
|
target.addEventListener("pointermove", onPointerMove);
|
|
4319
4546
|
target.addEventListener("pointerup", onPointerUp);
|
|
@@ -4321,7 +4548,9 @@ var useColumnPointerEvents = ({
|
|
|
4321
4548
|
}, [
|
|
4322
4549
|
columns,
|
|
4323
4550
|
column,
|
|
4324
|
-
|
|
4551
|
+
dragColumnIndex,
|
|
4552
|
+
visibleColsCount,
|
|
4553
|
+
pinnedStartColsCount,
|
|
4325
4554
|
columnsArray,
|
|
4326
4555
|
computedRemainingSpace,
|
|
4327
4556
|
computedColumnOrder
|
|
@@ -4330,8 +4559,7 @@ var useColumnPointerEvents = ({
|
|
|
4330
4559
|
onPointerDown: column.computedDraggable ? onPointerDown : () => {
|
|
4331
4560
|
},
|
|
4332
4561
|
dragging,
|
|
4333
|
-
|
|
4334
|
-
draggingDiff: draggingDiff != null ? draggingDiff : { top: 0, left: 0 }
|
|
4562
|
+
proxyPosition
|
|
4335
4563
|
};
|
|
4336
4564
|
};
|
|
4337
4565
|
|
|
@@ -4381,23 +4609,23 @@ function NumberFilterEditor(props) {
|
|
|
4381
4609
|
import {
|
|
4382
4610
|
createElement as createElement12
|
|
4383
4611
|
} from "react";
|
|
4384
|
-
import { useEffect as useEffect9, useState as
|
|
4612
|
+
import { useEffect as useEffect9, useState as useState6 } from "react";
|
|
4385
4613
|
|
|
4386
4614
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
4387
|
-
var
|
|
4388
|
-
var CellCls = "_1eexc2a5
|
|
4389
|
-
var HeaderCellContentRecipe = (0,
|
|
4390
|
-
var HeaderCellProxy = "
|
|
4391
|
-
var HeaderCellRecipe = (0,
|
|
4392
|
-
var HeaderClsRecipe = (0,
|
|
4393
|
-
var HeaderFilterCls = "_12zfob11c
|
|
4394
|
-
var HeaderFilterEditorCls = "_16lm1iwu
|
|
4395
|
-
var HeaderGroupCls = "_12zfob11b
|
|
4396
|
-
var HeaderScrollbarPlaceholderCls = "
|
|
4615
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4616
|
+
var CellCls = "_1eexc2a5 _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw2 _16lm1iw1f _16lm1iw1g";
|
|
4617
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iwu _16lm1iww _16lm1iwp _16lm1iw16 _16lm1iw17", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4618
|
+
var HeaderCellProxy = "_12zfob1g _16lm1iw1g _16lm1iw1h _16lm1iw1c";
|
|
4619
|
+
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"]] });
|
|
4620
|
+
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"]] });
|
|
4621
|
+
var HeaderFilterCls = "_12zfob11c _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw1";
|
|
4622
|
+
var HeaderFilterEditorCls = "_16lm1iww _16lm1iwu";
|
|
4623
|
+
var HeaderGroupCls = "_12zfob11b _16lm1iwp _16lm1iw16 _16lm1iw17";
|
|
4624
|
+
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
4397
4625
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
4398
|
-
var HeaderSortIconIndexCls = "
|
|
4399
|
-
var HeaderSortIconRecipe = (0,
|
|
4400
|
-
var HeaderWrapperCls = "_12zfob11a
|
|
4626
|
+
var HeaderSortIconIndexCls = "_12zfob14";
|
|
4627
|
+
var HeaderSortIconRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4628
|
+
var HeaderWrapperCls = "_12zfob11a _16lm1iw1c _16lm1iw1 _16lm1iwp _16lm1iw16";
|
|
4401
4629
|
|
|
4402
4630
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4403
4631
|
var defaultLineStyle = {
|
|
@@ -4408,8 +4636,8 @@ var defaultLineStyle = {
|
|
|
4408
4636
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
4409
4637
|
function SortIcon(props) {
|
|
4410
4638
|
var _a;
|
|
4411
|
-
const [rendered, setRendered] =
|
|
4412
|
-
const [opacity, setOpacity] =
|
|
4639
|
+
const [rendered, setRendered] = useState6(true);
|
|
4640
|
+
const [opacity, setOpacity] = useState6(0);
|
|
4413
4641
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
4414
4642
|
const showIndex = index != null && index > 0;
|
|
4415
4643
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -4477,25 +4705,16 @@ import {
|
|
|
4477
4705
|
memo as memo7
|
|
4478
4706
|
} from "react";
|
|
4479
4707
|
|
|
4480
|
-
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
4481
|
-
import { useContext as useContext4 } from "react";
|
|
4482
|
-
var useInfiniteTableState = () => {
|
|
4483
|
-
const TableContext2 = getInfiniteTableContext();
|
|
4484
|
-
const { componentState } = useContext4(TableContext2);
|
|
4485
|
-
return componentState;
|
|
4486
|
-
};
|
|
4487
|
-
|
|
4488
4708
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
4489
|
-
var
|
|
4490
|
-
var
|
|
4491
|
-
var
|
|
4492
|
-
var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
|
|
4709
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4710
|
+
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw2 _16lm1iw1f _16lm1iw1g";
|
|
4711
|
+
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"]] });
|
|
4493
4712
|
|
|
4494
4713
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4495
4714
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
4496
4715
|
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
4497
4716
|
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
4498
|
-
var
|
|
4717
|
+
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4499
4718
|
function InfiniteTableCellFn(props) {
|
|
4500
4719
|
var _b, _c, _d;
|
|
4501
4720
|
const _a = props, {
|
|
@@ -4528,23 +4747,14 @@ function InfiniteTableCellFn(props) {
|
|
|
4528
4747
|
"renderChildren"
|
|
4529
4748
|
]);
|
|
4530
4749
|
const children = renderChildren();
|
|
4531
|
-
const { columnShifts } = useInfiniteTableState();
|
|
4532
|
-
const shifting = !!columnShifts;
|
|
4533
4750
|
const style = __spreadValues({
|
|
4534
|
-
width: `var(${
|
|
4751
|
+
width: `var(${columnWidthAtIndex4}-${column.computedVisibleIndex})`
|
|
4535
4752
|
}, domProps.style);
|
|
4536
|
-
if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
|
|
4537
|
-
const shiftLeft = columnShifts[column.computedVisibleIndex];
|
|
4538
|
-
if (virtualized) {
|
|
4539
|
-
style.left = shiftLeft;
|
|
4540
|
-
} else {
|
|
4541
|
-
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4542
|
-
}
|
|
4543
|
-
}
|
|
4544
4753
|
const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
|
|
4545
4754
|
style,
|
|
4546
4755
|
"data-column-id": column.id,
|
|
4547
|
-
|
|
4756
|
+
"data-z-index": style.zIndex,
|
|
4757
|
+
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
|
|
4548
4758
|
children: /* @__PURE__ */ createElement13(Fragment, null, beforeChildren, /* @__PURE__ */ createElement13("div", {
|
|
4549
4759
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
4550
4760
|
style: contentStyle
|
|
@@ -4564,13 +4774,13 @@ var InfiniteTableCell = memo7(InfiniteTableCellFn);
|
|
|
4564
4774
|
import {
|
|
4565
4775
|
createElement as createElement14
|
|
4566
4776
|
} from "react";
|
|
4567
|
-
import { useEffect as useEffect10, useState as
|
|
4777
|
+
import { useEffect as useEffect10, useState as useState7 } from "react";
|
|
4568
4778
|
var { rootClassName: rootClassName6 } = internalProps;
|
|
4569
4779
|
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
|
|
4570
4780
|
var stopPropagation = (e) => e.stopPropagation();
|
|
4571
4781
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
4572
4782
|
var _a, _b, _c, _d;
|
|
4573
|
-
const [theValue, setTheValue] =
|
|
4783
|
+
const [theValue, setTheValue] = useState7((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
4574
4784
|
const onInputChange = (filterValue) => {
|
|
4575
4785
|
setTheValue(filterValue);
|
|
4576
4786
|
props.onChange(filterValue);
|
|
@@ -4664,7 +4874,7 @@ var computeFlex = (params) => {
|
|
|
4664
4874
|
totalFlex += itemFlex != null ? itemFlex : 0;
|
|
4665
4875
|
totalFixedSize += (_e = item.size) != null ? _e : 0;
|
|
4666
4876
|
});
|
|
4667
|
-
let availableSizeForFlex = Math.max(availableSize - totalFixedSize, 0);
|
|
4877
|
+
let availableSizeForFlex = params.computeSpecialSpaceDistribution ? Math.max(availableSize, 0) : Math.max(availableSize - totalFixedSize, 0);
|
|
4668
4878
|
let sizePerFlex = availableSizeForFlex / totalFlex;
|
|
4669
4879
|
let maxxedFlexItems = {};
|
|
4670
4880
|
let minnedFlexItems = {};
|
|
@@ -4900,10 +5110,13 @@ var computeGroupResize = (params) => {
|
|
|
4900
5110
|
unresizableWidth += item.computedWidth;
|
|
4901
5111
|
}
|
|
4902
5112
|
return {
|
|
5113
|
+
maxSize: item.computedMaxWidth,
|
|
5114
|
+
minSize: item.computedMinWidth,
|
|
4903
5115
|
flex: item.resizable ? item.computedWidth : null,
|
|
4904
5116
|
size: 0
|
|
4905
5117
|
};
|
|
4906
5118
|
}),
|
|
5119
|
+
computeSpecialSpaceDistribution: true,
|
|
4907
5120
|
availableSize: Math.max(beforeSizes.reduce(sum, 0) + dragHandleOffset - unresizableWidth, 0)
|
|
4908
5121
|
});
|
|
4909
5122
|
const diffsForEachItem = beforeItems.map((item, index) => {
|
|
@@ -4958,7 +5171,7 @@ var computeGroupResize = (params) => {
|
|
|
4958
5171
|
};
|
|
4959
5172
|
|
|
4960
5173
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
4961
|
-
import React20, { useRef as
|
|
5174
|
+
import React20, { useRef as useRef11, useState as useState8 } from "react";
|
|
4962
5175
|
|
|
4963
5176
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
|
|
4964
5177
|
function getColumnResizer(colIndex, {
|
|
@@ -5013,17 +5226,17 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
5013
5226
|
}
|
|
5014
5227
|
|
|
5015
5228
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
5016
|
-
var
|
|
5017
|
-
var ResizeHandleCls = "zneyzh0 _16lm1iw2
|
|
5018
|
-
var ResizeHandleDraggerClsRecipe = (0,
|
|
5229
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5230
|
+
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iwx _16lm1iw13 _16lm1iw11 _16lm1iwe";
|
|
5231
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "zneyzh1 _16lm1iw2 _16lm1iwx _16lm1iw11", variantClassNames: { constrained: { false: "zneyzh2", true: "zneyzh3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5019
5232
|
|
|
5020
5233
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
5021
5234
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
5022
5235
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
|
|
5023
5236
|
function ResizeHandleFn(props) {
|
|
5024
|
-
const domRef =
|
|
5025
|
-
const [constrained, setConstrained] =
|
|
5026
|
-
const constrainedRef =
|
|
5237
|
+
const domRef = useRef11(null);
|
|
5238
|
+
const [constrained, setConstrained] = useState8(false);
|
|
5239
|
+
const constrainedRef = useRef11(constrained);
|
|
5027
5240
|
constrainedRef.current = constrained;
|
|
5028
5241
|
const onPointerDown = (e) => {
|
|
5029
5242
|
e.stopPropagation();
|
|
@@ -5078,7 +5291,6 @@ var ResizeHandle = React20.memo(ResizeHandleFn);
|
|
|
5078
5291
|
function useColumnResizeHandle(column) {
|
|
5079
5292
|
const {
|
|
5080
5293
|
computed: { computedVisibleColumns },
|
|
5081
|
-
componentState: { domRef },
|
|
5082
5294
|
getState,
|
|
5083
5295
|
getComputed,
|
|
5084
5296
|
componentActions
|
|
@@ -5088,12 +5300,12 @@ function useColumnResizeHandle(column) {
|
|
|
5088
5300
|
shareSpaceOnResize
|
|
5089
5301
|
}) => {
|
|
5090
5302
|
const state = getState();
|
|
5091
|
-
const { columnSizing, viewportReservedWidth, bodySize
|
|
5303
|
+
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
5092
5304
|
const columns = getComputed().computedVisibleColumns;
|
|
5093
5305
|
let atLeastOneFlex = false;
|
|
5094
5306
|
const columnSizingWithFlex = columns.reduce((acc, col) => {
|
|
5095
5307
|
if (col.computedFlex) {
|
|
5096
|
-
acc[col.id] = { flex: col.computedWidth };
|
|
5308
|
+
acc[col.id] = __spreadProps(__spreadValues({}, columnSizing[col.id]), { flex: col.computedWidth });
|
|
5097
5309
|
atLeastOneFlex = true;
|
|
5098
5310
|
}
|
|
5099
5311
|
return acc;
|
|
@@ -5116,20 +5328,8 @@ function useColumnResizeHandle(column) {
|
|
|
5116
5328
|
};
|
|
5117
5329
|
})
|
|
5118
5330
|
});
|
|
5119
|
-
if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
|
|
5120
|
-
const activeColumn = columns[activeCellIndex[1]];
|
|
5121
|
-
const currentColumn = columns[column.computedVisibleIndex];
|
|
5122
|
-
if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
|
|
5123
|
-
setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
|
|
5124
|
-
} else if (activeColumn) {
|
|
5125
|
-
setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
|
|
5126
|
-
}
|
|
5127
|
-
if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
|
|
5128
|
-
setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
|
|
5129
|
-
}
|
|
5130
|
-
}
|
|
5131
5331
|
return result;
|
|
5132
|
-
}, []);
|
|
5332
|
+
}, [column]);
|
|
5133
5333
|
const onColumnResize = useCallback7(({
|
|
5134
5334
|
diff,
|
|
5135
5335
|
shareSpaceOnResize
|
|
@@ -5142,7 +5342,7 @@ function useColumnResizeHandle(column) {
|
|
|
5142
5342
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
5143
5343
|
}
|
|
5144
5344
|
componentActions.columnSizing = columnSizing;
|
|
5145
|
-
}, []);
|
|
5345
|
+
}, [computeResizeForDiff]);
|
|
5146
5346
|
const resizeHandle = column.computedResizable ? /* @__PURE__ */ createElement15(ResizeHandle, {
|
|
5147
5347
|
columns: computedVisibleColumns,
|
|
5148
5348
|
columnIndex: column.computedVisibleIndex,
|
|
@@ -5156,6 +5356,8 @@ function useColumnResizeHandle(column) {
|
|
|
5156
5356
|
var InfiniteTableHeaderCellContext = createContext4(null);
|
|
5157
5357
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
5158
5358
|
var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
|
|
5359
|
+
var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5360
|
+
var columnOffsetAtIndex5 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
5159
5361
|
function InfiniteTableHeaderCell(props) {
|
|
5160
5362
|
var _a, _b, _c, _d, _e;
|
|
5161
5363
|
const column = props.column;
|
|
@@ -5194,12 +5396,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5194
5396
|
header = header != null ? header : column.name;
|
|
5195
5397
|
return /* @__PURE__ */ createElement16(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
|
|
5196
5398
|
};
|
|
5197
|
-
const domRef =
|
|
5399
|
+
const domRef = useRef12(null);
|
|
5198
5400
|
const {
|
|
5199
5401
|
computed: {
|
|
5200
5402
|
computedRemainingSpace,
|
|
5201
5403
|
showColumnFilters,
|
|
5202
|
-
computedVisibleColumns
|
|
5404
|
+
computedVisibleColumns,
|
|
5405
|
+
computedPinnedStartColumns
|
|
5203
5406
|
},
|
|
5204
5407
|
componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
|
|
5205
5408
|
} = useInfiniteTable();
|
|
@@ -5221,7 +5424,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5221
5424
|
const style = {
|
|
5222
5425
|
height
|
|
5223
5426
|
};
|
|
5224
|
-
const { onPointerDown, dragging,
|
|
5427
|
+
const { onPointerDown, dragging, proxyPosition } = useColumnPointerEvents({
|
|
5428
|
+
pinnedStartColsCount: computedPinnedStartColumns.length,
|
|
5429
|
+
visibleColsCount: computedVisibleColumns.length,
|
|
5225
5430
|
computedRemainingSpace,
|
|
5226
5431
|
columnId: column.id,
|
|
5227
5432
|
domRef,
|
|
@@ -5235,9 +5440,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5235
5440
|
position: "absolute",
|
|
5236
5441
|
height,
|
|
5237
5442
|
width,
|
|
5238
|
-
left: column.
|
|
5239
|
-
top: (
|
|
5240
|
-
zIndex:
|
|
5443
|
+
left: `calc( var(${columnOffsetAtIndex5}-${column.computedVisibleIndex}) + ${(_a = proxyPosition.left) != null ? _a : 0}px)`,
|
|
5444
|
+
top: (_b = proxyPosition.top) != null ? _b : 0,
|
|
5445
|
+
zIndex: 1e9
|
|
5241
5446
|
}
|
|
5242
5447
|
}, header);
|
|
5243
5448
|
draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
|
|
@@ -5308,6 +5513,8 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5308
5513
|
const filterType = column.computedFilterType;
|
|
5309
5514
|
const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
|
|
5310
5515
|
const resizeHandle = useColumnResizeHandle(column);
|
|
5516
|
+
const zIndex2 = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5517
|
+
style.zIndex = zIndex2;
|
|
5311
5518
|
return /* @__PURE__ */ createElement16(ContextProvider, {
|
|
5312
5519
|
value: renderParam
|
|
5313
5520
|
}, /* @__PURE__ */ createElement16(InfiniteTableCell, {
|
|
@@ -5316,7 +5523,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5316
5523
|
column,
|
|
5317
5524
|
"data-name": `HeaderCell`,
|
|
5318
5525
|
"data-column-id": column.id,
|
|
5319
|
-
"data-z-index":
|
|
5526
|
+
"data-z-index": zIndex2,
|
|
5320
5527
|
style,
|
|
5321
5528
|
width,
|
|
5322
5529
|
onPointerDown,
|
|
@@ -5337,7 +5544,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5337
5544
|
}), draggingProxy);
|
|
5338
5545
|
}
|
|
5339
5546
|
function useInfiniteHeaderCell() {
|
|
5340
|
-
const result =
|
|
5547
|
+
const result = useContext4(InfiniteTableHeaderCellContext);
|
|
5341
5548
|
return result;
|
|
5342
5549
|
}
|
|
5343
5550
|
|
|
@@ -5472,7 +5679,7 @@ import {
|
|
|
5472
5679
|
createElement as createElement19,
|
|
5473
5680
|
memo as memo8
|
|
5474
5681
|
} from "react";
|
|
5475
|
-
import { useCallback as useCallback10, useEffect as useEffect12, useRef as
|
|
5682
|
+
import { useCallback as useCallback10, useEffect as useEffect12, useRef as useRef14 } from "react";
|
|
5476
5683
|
|
|
5477
5684
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5478
5685
|
import {
|
|
@@ -5486,13 +5693,13 @@ import {
|
|
|
5486
5693
|
import { useCallback as useCallback9 } from "react";
|
|
5487
5694
|
|
|
5488
5695
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
5489
|
-
import React23, { useRef as
|
|
5696
|
+
import React23, { useRef as useRef13, useState as useState9 } from "react";
|
|
5490
5697
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
5491
5698
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
|
|
5492
5699
|
function GroupResizeHandleFn(props) {
|
|
5493
|
-
const domRef =
|
|
5494
|
-
const [constrained, setConstrained] =
|
|
5495
|
-
const constrainedRef =
|
|
5700
|
+
const domRef = useRef13(null);
|
|
5701
|
+
const [constrained, setConstrained] = useState9(false);
|
|
5702
|
+
const constrainedRef = useRef13(constrained);
|
|
5496
5703
|
constrainedRef.current = constrained;
|
|
5497
5704
|
const onPointerDown = (e) => {
|
|
5498
5705
|
e.stopPropagation();
|
|
@@ -5569,7 +5776,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5569
5776
|
let atLeastOneFlex = false;
|
|
5570
5777
|
const columnSizingWithFlex = columns.reduce((acc, col) => {
|
|
5571
5778
|
if (col.computedFlex) {
|
|
5572
|
-
acc[col.id] = { flex: col.computedWidth };
|
|
5779
|
+
acc[col.id] = __spreadProps(__spreadValues({}, columnSizing[col.id]), { flex: col.computedWidth });
|
|
5573
5780
|
atLeastOneFlex = true;
|
|
5574
5781
|
}
|
|
5575
5782
|
return acc;
|
|
@@ -5616,7 +5823,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5616
5823
|
|
|
5617
5824
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5618
5825
|
var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
5619
|
-
var
|
|
5826
|
+
var columnWidthAtIndex5 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5620
5827
|
function InfiniteTableHeaderGroup(props) {
|
|
5621
5828
|
const {
|
|
5622
5829
|
computed: { computedVisibleColumns }
|
|
@@ -5635,7 +5842,7 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5635
5842
|
columnGroupsMaxDepth
|
|
5636
5843
|
});
|
|
5637
5844
|
const firstColumn = columns[0];
|
|
5638
|
-
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${
|
|
5845
|
+
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
|
|
5639
5846
|
const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
|
|
5640
5847
|
return /* @__PURE__ */ createElement18("div", {
|
|
5641
5848
|
ref: props.domRef,
|
|
@@ -5676,7 +5883,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5676
5883
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
5677
5884
|
return removeOnScroll;
|
|
5678
5885
|
}, [brain]);
|
|
5679
|
-
const domRef =
|
|
5886
|
+
const domRef = useRef14(null);
|
|
5680
5887
|
const headerCls = HeaderClsRecipe({
|
|
5681
5888
|
overflow: false,
|
|
5682
5889
|
virtualized: true
|
|
@@ -5851,7 +6058,7 @@ import {
|
|
|
5851
6058
|
createElement as createElement21,
|
|
5852
6059
|
forwardRef as forwardRef4,
|
|
5853
6060
|
useCallback as useCallback12,
|
|
5854
|
-
useRef as
|
|
6061
|
+
useRef as useRef15
|
|
5855
6062
|
} from "react";
|
|
5856
6063
|
import { useEffect as useEffect13 } from "react";
|
|
5857
6064
|
|
|
@@ -5861,14 +6068,6 @@ function decamelize(str, options) {
|
|
|
5861
6068
|
return str.replace(/([a-z\d])([A-Z])/g, "$1" + separator + "$2").replace(new RegExp("(" + separator + "[A-Z])([A-Z])", "g"), "$1" + separator + "$2").toLowerCase();
|
|
5862
6069
|
}
|
|
5863
6070
|
|
|
5864
|
-
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5865
|
-
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5866
|
-
var FooterCls = "_16lm1iw1";
|
|
5867
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
|
|
5868
|
-
var InfiniteClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
|
|
5869
|
-
var InfiniteClsShiftingColumns = "_16lm1iwq";
|
|
5870
|
-
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5871
|
-
|
|
5872
6071
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
5873
6072
|
var defaultStyle = {
|
|
5874
6073
|
padding: ThemeVars.spacing[2],
|
|
@@ -5898,7 +6097,7 @@ var enforceStyle = (node, style) => {
|
|
|
5898
6097
|
};
|
|
5899
6098
|
var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
|
|
5900
6099
|
const { rootClassName: rootClassName13 } = useInternalProps();
|
|
5901
|
-
const domRef =
|
|
6100
|
+
const domRef = useRef15(null);
|
|
5902
6101
|
const domCallback = useCallback12((node) => {
|
|
5903
6102
|
domRef.current = node;
|
|
5904
6103
|
if (!ref) {
|
|
@@ -5943,8 +6142,9 @@ import {
|
|
|
5943
6142
|
createElement as createElement22,
|
|
5944
6143
|
memo as memo9
|
|
5945
6144
|
} from "react";
|
|
5946
|
-
import { useCallback as useCallback13, useContext as
|
|
6145
|
+
import { useCallback as useCallback13, useContext as useContext5, useMemo as useMemo7 } from "react";
|
|
5947
6146
|
var { rootClassName: rootClassName11 } = internalProps;
|
|
6147
|
+
var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5948
6148
|
var InfiniteTableColumnCellContext = createContext5(null);
|
|
5949
6149
|
var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
|
|
5950
6150
|
function isColumnWithField(c) {
|
|
@@ -6074,6 +6274,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6074
6274
|
}
|
|
6075
6275
|
style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
|
|
6076
6276
|
style.height = rowHeight;
|
|
6277
|
+
style.zIndex = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
6077
6278
|
const memoizedStyle = useMemo7(() => style, [!style ? null : JSON.stringify(style)]);
|
|
6078
6279
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
6079
6280
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
@@ -6097,7 +6298,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6097
6298
|
}
|
|
6098
6299
|
var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
|
|
6099
6300
|
function useInfiniteColumnCell() {
|
|
6100
|
-
const result =
|
|
6301
|
+
const result = useContext5(InfiniteTableColumnCellContext);
|
|
6101
6302
|
return result;
|
|
6102
6303
|
}
|
|
6103
6304
|
|
|
@@ -6114,8 +6315,8 @@ import {
|
|
|
6114
6315
|
} from "react";
|
|
6115
6316
|
|
|
6116
6317
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
6117
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
6118
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
6318
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11" };
|
|
6319
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11";
|
|
6119
6320
|
var LoadMaskTextCls = "qy58ya4";
|
|
6120
6321
|
|
|
6121
6322
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -6147,24 +6348,40 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6147
6348
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
6148
6349
|
const state = getState();
|
|
6149
6350
|
const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6351
|
+
if (!scrollPosition) {
|
|
6352
|
+
return false;
|
|
6353
|
+
}
|
|
6150
6354
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6355
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6356
|
+
if (scrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6357
|
+
return false;
|
|
6358
|
+
}
|
|
6151
6359
|
if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6152
6360
|
state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
|
|
6153
6361
|
}
|
|
6362
|
+
return true;
|
|
6154
6363
|
},
|
|
6155
6364
|
scrollColumnIntoView(colId, config = { offset: 0 }) {
|
|
6156
6365
|
const state = getState();
|
|
6157
6366
|
const computed = getComputed();
|
|
6158
6367
|
const computedColumn = computed.computedVisibleColumnsMap.get(colId);
|
|
6159
6368
|
if (!computedColumn) {
|
|
6160
|
-
return;
|
|
6369
|
+
return false;
|
|
6161
6370
|
}
|
|
6162
6371
|
const colIndex = computedColumn.computedVisibleIndex;
|
|
6163
6372
|
const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6373
|
+
if (!scrollPosition) {
|
|
6374
|
+
return false;
|
|
6375
|
+
}
|
|
6164
6376
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6377
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6378
|
+
if (scrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6379
|
+
return false;
|
|
6380
|
+
}
|
|
6165
6381
|
if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6166
6382
|
state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
|
|
6167
6383
|
}
|
|
6384
|
+
return true;
|
|
6168
6385
|
},
|
|
6169
6386
|
scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
|
|
6170
6387
|
const state = getState();
|
|
@@ -6173,33 +6390,48 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6173
6390
|
if (typeof colIdOrIndex === "string") {
|
|
6174
6391
|
const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
|
|
6175
6392
|
if (!computedColumn) {
|
|
6176
|
-
return;
|
|
6393
|
+
return false;
|
|
6177
6394
|
}
|
|
6178
6395
|
colIndex = computedColumn.computedVisibleIndex;
|
|
6179
6396
|
}
|
|
6180
6397
|
const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6181
6398
|
const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6399
|
+
if (!scrollPositionForCol || !scrollPositionForRow) {
|
|
6400
|
+
return false;
|
|
6401
|
+
}
|
|
6182
6402
|
const newScrollPosition = {
|
|
6183
6403
|
scrollLeft: scrollPositionForCol.scrollLeft,
|
|
6184
6404
|
scrollTop: scrollPositionForRow.scrollTop
|
|
6185
6405
|
};
|
|
6186
6406
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6407
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6408
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6409
|
+
if (newScrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6410
|
+
return false;
|
|
6411
|
+
}
|
|
6412
|
+
if (newScrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6413
|
+
return false;
|
|
6414
|
+
}
|
|
6187
6415
|
if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6188
6416
|
state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
|
|
6189
6417
|
}
|
|
6190
6418
|
if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6191
6419
|
state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
|
|
6192
6420
|
}
|
|
6421
|
+
return true;
|
|
6193
6422
|
}
|
|
6194
6423
|
};
|
|
6424
|
+
if (false) {
|
|
6425
|
+
globalThis.imperativeApi = imperativeApi;
|
|
6426
|
+
}
|
|
6195
6427
|
return imperativeApi;
|
|
6196
6428
|
}
|
|
6197
6429
|
|
|
6198
6430
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
6199
6431
|
import {
|
|
6200
6432
|
useEffect as useEffect14,
|
|
6201
|
-
useRef as
|
|
6202
|
-
useState as
|
|
6433
|
+
useRef as useRef16,
|
|
6434
|
+
useState as useState10
|
|
6203
6435
|
} from "react";
|
|
6204
6436
|
var OFFSET = 10;
|
|
6205
6437
|
function getColumnContentMaxWidths(domRef, options) {
|
|
@@ -6266,10 +6498,10 @@ function useAutoSizeColumns() {
|
|
|
6266
6498
|
componentActions,
|
|
6267
6499
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
6268
6500
|
} = useComponentState();
|
|
6269
|
-
const [refreshId, setRefreshId] =
|
|
6501
|
+
const [refreshId, setRefreshId] = useState10(0);
|
|
6270
6502
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
6271
6503
|
const getTheKey = useLatest(theKey);
|
|
6272
|
-
const lastExecutedIdentifierRef =
|
|
6504
|
+
const lastExecutedIdentifierRef = useRef16(null);
|
|
6273
6505
|
useEffect14(() => {
|
|
6274
6506
|
const key = getTheKey();
|
|
6275
6507
|
if (key == null) {
|
|
@@ -6328,7 +6560,7 @@ function useAutoSizeColumns() {
|
|
|
6328
6560
|
}
|
|
6329
6561
|
|
|
6330
6562
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
6331
|
-
import { useCallback as useCallback14, useEffect as useEffect15, useRef as
|
|
6563
|
+
import { useCallback as useCallback14, useEffect as useEffect15, useRef as useRef17 } from "react";
|
|
6332
6564
|
import React31 from "react";
|
|
6333
6565
|
|
|
6334
6566
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
@@ -6399,7 +6631,7 @@ function useCellRendering(param) {
|
|
|
6399
6631
|
bodySize,
|
|
6400
6632
|
rowspan
|
|
6401
6633
|
});
|
|
6402
|
-
const scrollTopMaxRef =
|
|
6634
|
+
const scrollTopMaxRef = useRef17(0);
|
|
6403
6635
|
useEffect15(() => {
|
|
6404
6636
|
return brain.onRenderCountChange(() => {
|
|
6405
6637
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
@@ -6489,7 +6721,7 @@ function useCellRendering(param) {
|
|
|
6489
6721
|
}
|
|
6490
6722
|
|
|
6491
6723
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
6492
|
-
import { useCallback as useCallback17, useEffect as useEffect25, useState as
|
|
6724
|
+
import { useCallback as useCallback17, useEffect as useEffect25, useState as useState14 } from "react";
|
|
6493
6725
|
|
|
6494
6726
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6495
6727
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -6559,20 +6791,6 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
6559
6791
|
return map2;
|
|
6560
6792
|
}
|
|
6561
6793
|
|
|
6562
|
-
// src/components/InfiniteTable/utils/rafFn.ts
|
|
6563
|
-
var rafFn = (fn) => {
|
|
6564
|
-
let rafId = 0;
|
|
6565
|
-
return (...args) => {
|
|
6566
|
-
if (rafId) {
|
|
6567
|
-
cancelAnimationFrame(rafId);
|
|
6568
|
-
}
|
|
6569
|
-
rafId = requestAnimationFrame(() => {
|
|
6570
|
-
rafId = 0;
|
|
6571
|
-
fn(...args);
|
|
6572
|
-
});
|
|
6573
|
-
};
|
|
6574
|
-
};
|
|
6575
|
-
|
|
6576
6794
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6577
6795
|
function useColumnGroups() {
|
|
6578
6796
|
const {
|
|
@@ -6692,7 +6910,7 @@ import {
|
|
|
6692
6910
|
createElement as createElement24,
|
|
6693
6911
|
useEffect as useEffect18
|
|
6694
6912
|
} from "react";
|
|
6695
|
-
import { useState as
|
|
6913
|
+
import { useState as useState11 } from "react";
|
|
6696
6914
|
|
|
6697
6915
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
6698
6916
|
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -6703,7 +6921,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ def
|
|
|
6703
6921
|
function ExpanderIcon(props) {
|
|
6704
6922
|
var _a;
|
|
6705
6923
|
const { size = 24 } = props;
|
|
6706
|
-
const [expanded, setExpanded] =
|
|
6924
|
+
const [expanded, setExpanded] = useState11((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
6707
6925
|
const onClick = () => {
|
|
6708
6926
|
var _a2;
|
|
6709
6927
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -6906,10 +7124,10 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
6906
7124
|
}
|
|
6907
7125
|
|
|
6908
7126
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
6909
|
-
import { useEffect as useEffect19, useRef as
|
|
7127
|
+
import { useEffect as useEffect19, useRef as useRef18 } from "react";
|
|
6910
7128
|
function useEffectWithRaf(fn, deps) {
|
|
6911
|
-
const rafId =
|
|
6912
|
-
const removeFnRaf =
|
|
7129
|
+
const rafId = useRef18(0);
|
|
7130
|
+
const removeFnRaf = useRef18();
|
|
6913
7131
|
useEffect19(() => {
|
|
6914
7132
|
rafId.current = requestAnimationFrame(() => {
|
|
6915
7133
|
removeFnRaf.current = fn();
|
|
@@ -7571,15 +7789,15 @@ var GroupRowsState = class {
|
|
|
7571
7789
|
};
|
|
7572
7790
|
|
|
7573
7791
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7574
|
-
import { useEffect as useEffect21, useMemo as useMemo9, useRef as
|
|
7792
|
+
import { useEffect as useEffect21, useMemo as useMemo9, useRef as useRef20, useState as useState12 } from "react";
|
|
7575
7793
|
|
|
7576
7794
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7577
|
-
import { useEffect as useEffect20, useRef as
|
|
7795
|
+
import { useEffect as useEffect20, useRef as useRef19 } from "react";
|
|
7578
7796
|
function useEffectWithChanges(fn, deps) {
|
|
7579
|
-
const prevRef =
|
|
7580
|
-
const oldValuesRef =
|
|
7797
|
+
const prevRef = useRef19({});
|
|
7798
|
+
const oldValuesRef = useRef19({});
|
|
7581
7799
|
const oldValues = oldValuesRef.current;
|
|
7582
|
-
const changesRef =
|
|
7800
|
+
const changesRef = useRef19({});
|
|
7583
7801
|
const changes = changesRef.current;
|
|
7584
7802
|
const useEffectDeps = [];
|
|
7585
7803
|
for (const k in deps) {
|
|
@@ -7860,11 +8078,11 @@ function useLoadData() {
|
|
|
7860
8078
|
livePaginationCursor,
|
|
7861
8079
|
cursorId: stateCursorId
|
|
7862
8080
|
} = componentState;
|
|
7863
|
-
const [scrollbars, setScrollbars] =
|
|
8081
|
+
const [scrollbars, setScrollbars] = useState12({
|
|
7864
8082
|
vertical: false,
|
|
7865
8083
|
horizontal: false
|
|
7866
8084
|
});
|
|
7867
|
-
const scrollbarsRef =
|
|
8085
|
+
const scrollbarsRef = useRef20(scrollbars);
|
|
7868
8086
|
useEffect21(() => {
|
|
7869
8087
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
7870
8088
|
if (!scrollbars2) {
|
|
@@ -7921,7 +8139,7 @@ function useLoadData() {
|
|
|
7921
8139
|
filterValue,
|
|
7922
8140
|
cursorId: livePagination ? stateCursorId : null
|
|
7923
8141
|
};
|
|
7924
|
-
const initialRef =
|
|
8142
|
+
const initialRef = useRef20(true);
|
|
7925
8143
|
useLazyLoadRange();
|
|
7926
8144
|
useEffectWithChanges(() => {
|
|
7927
8145
|
const componentState2 = getComponentState();
|
|
@@ -7962,7 +8180,7 @@ function useLazyLoadRange() {
|
|
|
7962
8180
|
dataArray,
|
|
7963
8181
|
scrollStopDelayUpdatedByTable
|
|
7964
8182
|
} = componentState;
|
|
7965
|
-
const latestRenderRangeRef =
|
|
8183
|
+
const latestRenderRangeRef = useRef20(null);
|
|
7966
8184
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
7967
8185
|
const componentState2 = getComponentState();
|
|
7968
8186
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -9298,7 +9516,7 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
|
|
|
9298
9516
|
};
|
|
9299
9517
|
var getComputedPinned = (colId, columnPinning) => {
|
|
9300
9518
|
const pinned = columnPinning.get(colId);
|
|
9301
|
-
const computedPinned = pinned === "start" ? "start" : pinned === "end" ? "end" : false;
|
|
9519
|
+
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
9302
9520
|
return computedPinned;
|
|
9303
9521
|
};
|
|
9304
9522
|
var getComputedVisibleColumns = ({
|
|
@@ -9434,6 +9652,7 @@ var getComputedVisibleColumns = ({
|
|
|
9434
9652
|
const id = visibleColumnOrder[i];
|
|
9435
9653
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
9436
9654
|
const colType = getColumnComputedType(c, columnTypes);
|
|
9655
|
+
const computedVisibleIndex = i;
|
|
9437
9656
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
9438
9657
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
9439
9658
|
const computedSorted = !!computedSortInfo;
|
|
@@ -9446,7 +9665,15 @@ var getComputedVisibleColumns = ({
|
|
|
9446
9665
|
const computedMaxWidth = maxSizes[i] || 1e4;
|
|
9447
9666
|
const computedPinned = getComputedPinned(id, columnPinning);
|
|
9448
9667
|
const computedLast = i === visibleColumnOrder.length - 1;
|
|
9668
|
+
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9449
9669
|
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
9670
|
+
if (computedPinned == "start") {
|
|
9671
|
+
computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9672
|
+
} else if (computedPinned === "end") {
|
|
9673
|
+
computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
|
|
9674
|
+
} else {
|
|
9675
|
+
computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
|
|
9676
|
+
}
|
|
9450
9677
|
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
9451
9678
|
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
9452
9679
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
@@ -9495,6 +9722,7 @@ var getComputedVisibleColumns = ({
|
|
|
9495
9722
|
computedWidth,
|
|
9496
9723
|
computedAbsoluteOffset,
|
|
9497
9724
|
computedPinningOffset,
|
|
9725
|
+
computedVisibleIndexInCategory,
|
|
9498
9726
|
computedOffset,
|
|
9499
9727
|
computedSortable,
|
|
9500
9728
|
computedSortInfo,
|
|
@@ -9503,7 +9731,7 @@ var getComputedVisibleColumns = ({
|
|
|
9503
9731
|
computedSorted,
|
|
9504
9732
|
computedSortedAsc,
|
|
9505
9733
|
computedSortedDesc,
|
|
9506
|
-
computedVisibleIndex
|
|
9734
|
+
computedVisibleIndex,
|
|
9507
9735
|
computedPinned,
|
|
9508
9736
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
9509
9737
|
computedFirstInCategory,
|
|
@@ -9694,6 +9922,7 @@ var useComputedVisibleColumns = ({
|
|
|
9694
9922
|
columnOrder,
|
|
9695
9923
|
columnVisibility,
|
|
9696
9924
|
columnVisibilityAssumeVisible,
|
|
9925
|
+
resizableColumns,
|
|
9697
9926
|
pinnedEndMaxWidth,
|
|
9698
9927
|
pinnedStartMaxWidth,
|
|
9699
9928
|
columnSizing,
|
|
@@ -9723,7 +9952,7 @@ var useComputedVisibleColumns = ({
|
|
|
9723
9952
|
};
|
|
9724
9953
|
|
|
9725
9954
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
9726
|
-
import { useState as
|
|
9955
|
+
import { useState as useState13, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
|
|
9727
9956
|
var INITIAL_SCROLLBARS = {
|
|
9728
9957
|
vertical: false,
|
|
9729
9958
|
horizontal: false
|
|
@@ -9731,7 +9960,7 @@ var INITIAL_SCROLLBARS = {
|
|
|
9731
9960
|
function useScrollbars(brain) {
|
|
9732
9961
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
9733
9962
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
9734
|
-
const [scrollbars, setScrollbars] =
|
|
9963
|
+
const [scrollbars, setScrollbars] = useState13(INITIAL_SCROLLBARS);
|
|
9735
9964
|
useEffect24(() => {
|
|
9736
9965
|
return brain.onRenderCountChange(() => {
|
|
9737
9966
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
@@ -9772,7 +10001,7 @@ function useComputed() {
|
|
|
9772
10001
|
bodySize,
|
|
9773
10002
|
showSeparatePivotColumnForSingleAggregation
|
|
9774
10003
|
} = componentState;
|
|
9775
|
-
|
|
10004
|
+
useState14(() => {
|
|
9776
10005
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
9777
10006
|
if (rowHeight) {
|
|
9778
10007
|
componentActions.rowHeight = rowHeight;
|
|
@@ -9867,107 +10096,6 @@ function useComputed() {
|
|
|
9867
10096
|
};
|
|
9868
10097
|
}
|
|
9869
10098
|
|
|
9870
|
-
// src/components/InfiniteTable/hooks/useDOMProps.ts
|
|
9871
|
-
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
9872
|
-
var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
9873
|
-
var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
|
|
9874
|
-
var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
|
|
9875
|
-
function useDOMProps(initialDOMProps) {
|
|
9876
|
-
const { computed, componentState, componentActions } = useInfiniteTable();
|
|
9877
|
-
const {
|
|
9878
|
-
columnShifts,
|
|
9879
|
-
focused,
|
|
9880
|
-
focusedWithin,
|
|
9881
|
-
domRef,
|
|
9882
|
-
onBlurWithin,
|
|
9883
|
-
onFocusWithin,
|
|
9884
|
-
onSelfFocus,
|
|
9885
|
-
onSelfBlur,
|
|
9886
|
-
activeCellIndex
|
|
9887
|
-
} = componentState;
|
|
9888
|
-
const {
|
|
9889
|
-
computedPinnedStartColumnsWidth,
|
|
9890
|
-
computedPinnedEndColumnsWidth,
|
|
9891
|
-
computedVisibleColumns
|
|
9892
|
-
} = computed;
|
|
9893
|
-
const cssVars = computedVisibleColumns.reduce((vars, col) => {
|
|
9894
|
-
const index = col.computedVisibleIndex;
|
|
9895
|
-
vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
|
|
9896
|
-
vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
|
|
9897
|
-
return vars;
|
|
9898
|
-
}, {});
|
|
9899
|
-
if (activeCellIndex != null) {
|
|
9900
|
-
cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
|
|
9901
|
-
cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
|
|
9902
|
-
}
|
|
9903
|
-
const setFocused = rafFn((focused2) => {
|
|
9904
|
-
componentActions.focused = focused2;
|
|
9905
|
-
});
|
|
9906
|
-
const setFocusedWithin = rafFn((focused2) => {
|
|
9907
|
-
componentActions.focusedWithin = focused2;
|
|
9908
|
-
});
|
|
9909
|
-
const onFocus = (event) => {
|
|
9910
|
-
var _a;
|
|
9911
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9912
|
-
if (event.target === domRef.current) {
|
|
9913
|
-
setFocused(true);
|
|
9914
|
-
onSelfFocus == null ? void 0 : onSelfFocus(event);
|
|
9915
|
-
if (focusedWithin) {
|
|
9916
|
-
setFocusedWithin(false);
|
|
9917
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9918
|
-
}
|
|
9919
|
-
} else {
|
|
9920
|
-
if (!focusedWithin) {
|
|
9921
|
-
setFocusedWithin(true);
|
|
9922
|
-
onFocusWithin == null ? void 0 : onFocusWithin(event);
|
|
9923
|
-
}
|
|
9924
|
-
}
|
|
9925
|
-
};
|
|
9926
|
-
const onBlur = (event) => {
|
|
9927
|
-
var _a, _b;
|
|
9928
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9929
|
-
if (event.target === domRef.current) {
|
|
9930
|
-
setFocused(false);
|
|
9931
|
-
onSelfBlur == null ? void 0 : onSelfBlur(event);
|
|
9932
|
-
if (focusedWithin) {
|
|
9933
|
-
setFocusedWithin(false);
|
|
9934
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9935
|
-
}
|
|
9936
|
-
} else {
|
|
9937
|
-
const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
|
|
9938
|
-
if (!contained) {
|
|
9939
|
-
setFocusedWithin(false);
|
|
9940
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9941
|
-
}
|
|
9942
|
-
}
|
|
9943
|
-
};
|
|
9944
|
-
const domProps = __spreadProps(__spreadValues({
|
|
9945
|
-
tabIndex: 0
|
|
9946
|
-
}, initialDOMProps), {
|
|
9947
|
-
onFocus,
|
|
9948
|
-
onBlur
|
|
9949
|
-
});
|
|
9950
|
-
const className = join(InfiniteTableClassName, InfiniteCls, columnShifts ? `${InfiniteClsShiftingColumns} ${InfiniteTableClassName}--shifting` : "", domProps == null ? void 0 : domProps.className, computedPinnedStartColumnsWidth ? `${InfiniteTableClassName}--has-pinned-start` : null, computedPinnedEndColumnsWidth ? `${InfiniteTableClassName}--has-pinned-end` : null, focused ? `${InfiniteTableClassName}--focused` : null, focusedWithin ? `${InfiniteTableClassName}--focused-within` : null, focused && componentState.focusedClassName ? componentState.focusedClassName : null, focusedWithin && componentState.focusedWithinClassName ? componentState.focusedWithinClassName : null, computed.computedPinnedStartOverflow ? `${InfiniteTableClassName}--has-pinned-start-overflow` : null, computed.computedPinnedEndOverflow ? `${InfiniteTableClassName}--has-pinned-end-overflow` : null, InfiniteClsRecipe({
|
|
9951
|
-
hasPinnedStart: !!computedPinnedStartColumnsWidth,
|
|
9952
|
-
hasPinnedEnd: !!computedPinnedEndColumnsWidth,
|
|
9953
|
-
focused,
|
|
9954
|
-
focusedWithin
|
|
9955
|
-
}));
|
|
9956
|
-
domProps.className = className;
|
|
9957
|
-
domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
|
|
9958
|
-
if (focused) {
|
|
9959
|
-
if (componentState.focusedStyle) {
|
|
9960
|
-
Object.assign(domProps.style, componentState.focusedStyle);
|
|
9961
|
-
}
|
|
9962
|
-
}
|
|
9963
|
-
if (focusedWithin) {
|
|
9964
|
-
if (componentState.focusedWithinStyle) {
|
|
9965
|
-
Object.assign(domProps.style, componentState.focusedWithinStyle);
|
|
9966
|
-
}
|
|
9967
|
-
}
|
|
9968
|
-
return domProps;
|
|
9969
|
-
}
|
|
9970
|
-
|
|
9971
10099
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
9972
10100
|
import { useMemo as useMemo12 } from "react";
|
|
9973
10101
|
|
|
@@ -10130,7 +10258,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
10130
10258
|
const valid = useMemo12(() => {
|
|
10131
10259
|
let valid2 = isValidLicense(licenseKey, {
|
|
10132
10260
|
publishedAt: 1624970570587,
|
|
10133
|
-
version: "0.3.
|
|
10261
|
+
version: "0.3.16"
|
|
10134
10262
|
});
|
|
10135
10263
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
10136
10264
|
return true;
|
|
@@ -10140,6 +10268,73 @@ var useLicense = (licenseKey = "") => {
|
|
|
10140
10268
|
return valid;
|
|
10141
10269
|
};
|
|
10142
10270
|
|
|
10271
|
+
// src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
|
|
10272
|
+
import { useRef as useRef21, useEffect as useEffect26 } from "react";
|
|
10273
|
+
var RETRIES = 10;
|
|
10274
|
+
function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
10275
|
+
const didScrollRef = useRef21(false);
|
|
10276
|
+
const rafId = useRef21(null);
|
|
10277
|
+
useEffect26(() => {
|
|
10278
|
+
if (activeCellIndex != null) {
|
|
10279
|
+
didScrollRef.current = false;
|
|
10280
|
+
cancelAnimationFrame(rafId.current);
|
|
10281
|
+
}
|
|
10282
|
+
}, [activeCellIndex]);
|
|
10283
|
+
useEffect26(() => {
|
|
10284
|
+
if (activeCellIndex != null && !didScrollRef.current) {
|
|
10285
|
+
let tryScroll = function(times = 0) {
|
|
10286
|
+
times++;
|
|
10287
|
+
cancelAnimationFrame(rafId.current);
|
|
10288
|
+
rafId.current = requestAnimationFrame(() => {
|
|
10289
|
+
didScrollRef.current = imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10290
|
+
offset: 30
|
|
10291
|
+
});
|
|
10292
|
+
if (!didScrollRef.current && times < RETRIES) {
|
|
10293
|
+
tryScroll(times);
|
|
10294
|
+
}
|
|
10295
|
+
});
|
|
10296
|
+
};
|
|
10297
|
+
tryScroll();
|
|
10298
|
+
}
|
|
10299
|
+
return () => {
|
|
10300
|
+
cancelAnimationFrame(rafId.current);
|
|
10301
|
+
};
|
|
10302
|
+
}, [activeCellIndex, dataCount]);
|
|
10303
|
+
}
|
|
10304
|
+
|
|
10305
|
+
// src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
|
|
10306
|
+
import { useRef as useRef22, useEffect as useEffect27 } from "react";
|
|
10307
|
+
var RETRIES2 = 10;
|
|
10308
|
+
function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
|
|
10309
|
+
const didScrollRef = useRef22(false);
|
|
10310
|
+
const rafId = useRef22(null);
|
|
10311
|
+
useEffect27(() => {
|
|
10312
|
+
if (activeRowIndex != null) {
|
|
10313
|
+
didScrollRef.current = false;
|
|
10314
|
+
cancelAnimationFrame(rafId.current);
|
|
10315
|
+
}
|
|
10316
|
+
}, [activeRowIndex]);
|
|
10317
|
+
useEffect27(() => {
|
|
10318
|
+
if (activeRowIndex != null && !didScrollRef.current) {
|
|
10319
|
+
let tryScroll = function(times = 0) {
|
|
10320
|
+
times++;
|
|
10321
|
+
rafId.current = requestAnimationFrame(() => {
|
|
10322
|
+
didScrollRef.current = imperativeApi.scrollRowIntoView(activeRowIndex, {
|
|
10323
|
+
offset: 30
|
|
10324
|
+
});
|
|
10325
|
+
if (!didScrollRef.current && times < RETRIES2) {
|
|
10326
|
+
tryScroll(times);
|
|
10327
|
+
}
|
|
10328
|
+
});
|
|
10329
|
+
};
|
|
10330
|
+
tryScroll();
|
|
10331
|
+
}
|
|
10332
|
+
return () => {
|
|
10333
|
+
cancelAnimationFrame(rafId.current);
|
|
10334
|
+
};
|
|
10335
|
+
}, [activeRowIndex, dataCount]);
|
|
10336
|
+
}
|
|
10337
|
+
|
|
10143
10338
|
// src/components/utils/clamp.ts
|
|
10144
10339
|
function clamp(value, min, max) {
|
|
10145
10340
|
return Math.min(Math.max(value, min), max);
|
|
@@ -10383,7 +10578,6 @@ function initSetupState2() {
|
|
|
10383
10578
|
propsCache: new Map([]),
|
|
10384
10579
|
brain,
|
|
10385
10580
|
headerBrain,
|
|
10386
|
-
columnShifts: null,
|
|
10387
10581
|
domRef: createRef(),
|
|
10388
10582
|
scrollerDOMRef: createRef(),
|
|
10389
10583
|
portalDOMRef: createRef(),
|
|
@@ -10398,11 +10592,11 @@ function initSetupState2() {
|
|
|
10398
10592
|
scrollTop: 0,
|
|
10399
10593
|
scrollLeft: 0
|
|
10400
10594
|
},
|
|
10595
|
+
columnReorderInProgress: false,
|
|
10401
10596
|
ready: false,
|
|
10402
10597
|
focused: false,
|
|
10403
10598
|
focusedWithin: false,
|
|
10404
10599
|
columnsWhenGrouping: columnsGeneratedForGrouping,
|
|
10405
|
-
draggingColumnId: null,
|
|
10406
10600
|
pinnedStartScrollListener: new ScrollListener(),
|
|
10407
10601
|
pinnedEndScrollListener: new ScrollListener(),
|
|
10408
10602
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
@@ -10456,7 +10650,6 @@ var forwardProps3 = (setupState) => {
|
|
|
10456
10650
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
10457
10651
|
pivotGrandTotalColumnPosition: 1,
|
|
10458
10652
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
10459
|
-
keyboardNavigation: (keyboardNavigation) => keyboardNavigation != null ? keyboardNavigation : "cell",
|
|
10460
10653
|
activeRowIndex: 1,
|
|
10461
10654
|
activeCellIndex: 1,
|
|
10462
10655
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
@@ -10503,7 +10696,7 @@ var cleanupState = (state) => {
|
|
|
10503
10696
|
state.pinnedStartScrollListener.destroy();
|
|
10504
10697
|
};
|
|
10505
10698
|
var mapPropsToState2 = (params) => {
|
|
10506
|
-
var _a, _b;
|
|
10699
|
+
var _a, _b, _c;
|
|
10507
10700
|
const { props, state, oldState, parentState } = params;
|
|
10508
10701
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
10509
10702
|
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(computedColumnGroups) : state.columnGroupsDepthsMap;
|
|
@@ -10519,7 +10712,8 @@ var mapPropsToState2 = (params) => {
|
|
|
10519
10712
|
groupRenderStrategy,
|
|
10520
10713
|
groupBy,
|
|
10521
10714
|
computedColumns,
|
|
10522
|
-
|
|
10715
|
+
keyboardNavigation: (_a = state.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
10716
|
+
columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
|
|
10523
10717
|
columnGroupsDepthsMap,
|
|
10524
10718
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
10525
10719
|
computedColumnGroups,
|
|
@@ -10556,11 +10750,11 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10556
10750
|
getState
|
|
10557
10751
|
} = useInfiniteTable();
|
|
10558
10752
|
const {
|
|
10559
|
-
componentState: { loading },
|
|
10753
|
+
componentState: { loading, dataArray },
|
|
10560
10754
|
getState: getDataSourceState,
|
|
10561
10755
|
componentActions: dataSourceActions
|
|
10562
10756
|
} = useDataSourceContextValue();
|
|
10563
|
-
const [imperativeApi] =
|
|
10757
|
+
const [imperativeApi] = useState15(() => {
|
|
10564
10758
|
return getImperativeApi(getState, getComputed, getDataSourceState, actions);
|
|
10565
10759
|
});
|
|
10566
10760
|
const {
|
|
@@ -10584,31 +10778,18 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10584
10778
|
activeCellIndex,
|
|
10585
10779
|
onRenderUpdater
|
|
10586
10780
|
} = componentState;
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
offset: 30
|
|
10591
|
-
});
|
|
10592
|
-
}
|
|
10593
|
-
}, [activeRowIndex]);
|
|
10594
|
-
useEffect27(() => {
|
|
10595
|
-
if (activeCellIndex != null) {
|
|
10596
|
-
imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10597
|
-
offset: 30
|
|
10598
|
-
});
|
|
10599
|
-
}
|
|
10600
|
-
}, [activeCellIndex]);
|
|
10601
|
-
const { columnShifts, bodySize } = componentState;
|
|
10781
|
+
useScrollToActiveRow(activeRowIndex, dataArray.length, imperativeApi);
|
|
10782
|
+
useScrollToActiveCell(activeCellIndex, dataArray.length, imperativeApi);
|
|
10783
|
+
const { bodySize } = componentState;
|
|
10602
10784
|
const { scrollbars } = computed;
|
|
10603
10785
|
const { renderCell } = useCellRendering({
|
|
10604
10786
|
imperativeApi,
|
|
10605
10787
|
getComputed,
|
|
10606
10788
|
domRef: componentState.domRef,
|
|
10607
|
-
columnShifts,
|
|
10608
10789
|
bodySize,
|
|
10609
10790
|
computed
|
|
10610
10791
|
});
|
|
10611
|
-
|
|
10792
|
+
useEffect28(() => {
|
|
10612
10793
|
const dataSourceState = getDataSourceState();
|
|
10613
10794
|
const onChange = debounce((renderRange) => {
|
|
10614
10795
|
dataSourceState.notifyRenderRangeChange({
|
|
@@ -10621,7 +10802,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10621
10802
|
const licenseValid = useLicense(licenseKey);
|
|
10622
10803
|
const domProps = useDOMProps(componentState.domProps);
|
|
10623
10804
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
10624
|
-
|
|
10805
|
+
useEffect28(() => {
|
|
10625
10806
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
10626
10807
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
10627
10808
|
}, [scrollStopDelay]);
|
|
@@ -10648,7 +10829,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10648
10829
|
}) : null, /* @__PURE__ */ createElement28(InfiniteTableBody, null, /* @__PURE__ */ createElement28(HeadlessTable, {
|
|
10649
10830
|
tabIndex: 0,
|
|
10650
10831
|
activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
|
|
10651
|
-
activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
|
|
10832
|
+
activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
|
|
10652
10833
|
scrollStopDelay,
|
|
10653
10834
|
renderer,
|
|
10654
10835
|
onRenderUpdater,
|
|
@@ -10660,7 +10841,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10660
10841
|
visible: loading
|
|
10661
10842
|
}, loadingText)), /* @__PURE__ */ createElement28("div", {
|
|
10662
10843
|
ref: portalDOMRef,
|
|
10663
|
-
className: join(`${rootClassName2}Portal`, zIndex[
|
|
10844
|
+
className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
|
|
10664
10845
|
}), rowHeightCSSVar ? /* @__PURE__ */ createElement28(CSSVariableWatch, {
|
|
10665
10846
|
varName: rowHeightCSSVar,
|
|
10666
10847
|
onChange: onRowHeightCSSVarChange
|
|
@@ -10693,13 +10874,13 @@ function InfiniteTableContextProvider() {
|
|
|
10693
10874
|
};
|
|
10694
10875
|
componentActions.bodySize = bodySize;
|
|
10695
10876
|
}, { earlyAttach: true, debounce: 50 });
|
|
10696
|
-
|
|
10877
|
+
useEffect28(() => {
|
|
10697
10878
|
return () => {
|
|
10698
10879
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
10699
10880
|
componentState.onColumnHeaderHeightCSSVarChange.destroy();
|
|
10700
10881
|
};
|
|
10701
10882
|
}, []);
|
|
10702
|
-
|
|
10883
|
+
useEffect28(() => {
|
|
10703
10884
|
if (scrollerDOMRef.current) {
|
|
10704
10885
|
scrollerDOMRef.current.scrollTop = 0;
|
|
10705
10886
|
}
|