@infinite-table/infinite-react 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +68 -57
- package/index.d.ts +16 -10
- package/index.esm.css +68 -57
- package/index.esm.js +619 -447
- package/index.js +677 -500
- 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,9 +3581,10 @@ 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
|
|
@@ -3545,37 +3602,30 @@ var ActiveCellIndicatorFn = (props) => {
|
|
|
3545
3602
|
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
3546
3603
|
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
3547
3604
|
const node = domRef.current;
|
|
3548
|
-
const scrollPosition = brain.getScrollPosition();
|
|
3549
3605
|
setInfiniteVarsOnNode({
|
|
3550
|
-
scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
|
|
3551
|
-
scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`,
|
|
3552
3606
|
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
3553
3607
|
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
3554
3608
|
}, node);
|
|
3555
3609
|
}, [props.activeCellIndex]);
|
|
3556
3610
|
useEffect6(() => {
|
|
3557
|
-
const removeOnSCroll = brain.onScroll((scrollPosition) => {
|
|
3558
|
-
setInfiniteVarsOnNode({
|
|
3559
|
-
scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
|
|
3560
|
-
scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`
|
|
3561
|
-
}, domRef.current);
|
|
3562
|
-
});
|
|
3563
3611
|
const removeOnRenderCountChange = brain.onRenderCountChange(() => {
|
|
3564
3612
|
rerender();
|
|
3565
3613
|
});
|
|
3566
3614
|
return () => {
|
|
3567
3615
|
removeOnRenderCountChange();
|
|
3568
|
-
removeOnSCroll();
|
|
3569
3616
|
};
|
|
3570
3617
|
}, [brain]);
|
|
3571
3618
|
return /* @__PURE__ */ createElement7("div", {
|
|
3572
3619
|
className: ActiveIndicatorWrapperCls,
|
|
3573
|
-
"data-name": "active-cell"
|
|
3620
|
+
"data-name": "active-cell",
|
|
3621
|
+
style: active ? {
|
|
3622
|
+
zIndex: `var(${columnZIndexAtIndex2}-${props.activeCellIndex[1]})`
|
|
3623
|
+
} : void 0
|
|
3574
3624
|
}, /* @__PURE__ */ createElement7("div", {
|
|
3575
3625
|
ref: domRef,
|
|
3576
3626
|
"data-name": "active-cell-indicator",
|
|
3577
3627
|
className: `${baseCls2} ${active ? ActiveCellIndicatorCls.visible : ActiveCellIndicatorCls.hidden}`,
|
|
3578
|
-
style: active ?
|
|
3628
|
+
style: active ? ActiveStyle2 : void 0
|
|
3579
3629
|
}));
|
|
3580
3630
|
};
|
|
3581
3631
|
var ActiveCellIndicator = memo5(ActiveCellIndicatorFn);
|
|
@@ -3624,7 +3674,7 @@ function HeadlessTable(props) {
|
|
|
3624
3674
|
"onRenderUpdater"
|
|
3625
3675
|
]);
|
|
3626
3676
|
const domRef = useRef7(null);
|
|
3627
|
-
const [scrollSize, setTotalScrollSize] =
|
|
3677
|
+
const [scrollSize, setTotalScrollSize] = useState3({
|
|
3628
3678
|
width: 0,
|
|
3629
3679
|
height: 0
|
|
3630
3680
|
});
|
|
@@ -3675,12 +3725,12 @@ function HeadlessTable(props) {
|
|
|
3675
3725
|
renderCell,
|
|
3676
3726
|
brain,
|
|
3677
3727
|
cellHoverClassNames
|
|
3678
|
-
})), /* @__PURE__ */ createElement8(ActiveRowIndicator, {
|
|
3679
|
-
brain,
|
|
3680
|
-
activeRowIndex
|
|
3681
3728
|
}), /* @__PURE__ */ createElement8(ActiveCellIndicator, {
|
|
3682
3729
|
brain,
|
|
3683
3730
|
activeCellIndex
|
|
3731
|
+
})), /* @__PURE__ */ createElement8(ActiveRowIndicator, {
|
|
3732
|
+
brain,
|
|
3733
|
+
activeRowIndex
|
|
3684
3734
|
}), /* @__PURE__ */ createElement8(SpacePlaceholder, {
|
|
3685
3735
|
width: scrollSize.width,
|
|
3686
3736
|
height: scrollSize.height
|
|
@@ -3698,7 +3748,7 @@ import {
|
|
|
3698
3748
|
createContext as createContext2,
|
|
3699
3749
|
useMemo as useMemo3,
|
|
3700
3750
|
useEffect as useEffect8,
|
|
3701
|
-
useState as
|
|
3751
|
+
useState as useState4,
|
|
3702
3752
|
useRef as useRef10
|
|
3703
3753
|
} from "react";
|
|
3704
3754
|
|
|
@@ -3836,14 +3886,14 @@ function forwardProps(propsToForward, props) {
|
|
|
3836
3886
|
function getComponentStateRoot(config) {
|
|
3837
3887
|
return memo6(function ComponentStateRoot(props) {
|
|
3838
3888
|
var _a, _b;
|
|
3839
|
-
const [initialSetupState] =
|
|
3889
|
+
const [initialSetupState] = useState4(() => {
|
|
3840
3890
|
return config.initSetupState ? config.initSetupState() : {};
|
|
3841
3891
|
});
|
|
3842
3892
|
const propsToStateSetRef = useRef10(new Set());
|
|
3843
3893
|
const propsToForward = useMemo3(() => config.forwardProps ? config.forwardProps(initialSetupState) : {}, [initialSetupState]);
|
|
3844
3894
|
const parentState = (_b = (_a = config.getParentState) == null ? void 0 : _a.call(config)) != null ? _b : null;
|
|
3845
3895
|
const getParentState = useLatest(parentState);
|
|
3846
|
-
const [wholeState] =
|
|
3896
|
+
const [wholeState] = useState4(() => {
|
|
3847
3897
|
let mappedState = {};
|
|
3848
3898
|
if (propsToForward) {
|
|
3849
3899
|
mappedState = forwardProps(propsToForward, props);
|
|
@@ -4012,20 +4062,20 @@ var useInternalProps = () => {
|
|
|
4012
4062
|
};
|
|
4013
4063
|
|
|
4014
4064
|
// src/components/InfiniteTable/utilities.css.ts
|
|
4015
|
-
var alignItems = { center: "
|
|
4016
|
-
var cssEllipsisClassName = "
|
|
4065
|
+
var alignItems = { center: "_16lm1iw17", stretch: "_16lm1iw18" };
|
|
4066
|
+
var cssEllipsisClassName = "_16lm1iw1g _16lm1iw1h _16lm1iw1c";
|
|
4017
4067
|
var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
|
|
4018
|
-
var display = { flex: "
|
|
4068
|
+
var display = { flex: "_16lm1iwp", block: "_16lm1iwq", inlineBlock: "_16lm1iwr" };
|
|
4019
4069
|
var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
|
|
4020
|
-
var flexFlow = { column: "
|
|
4021
|
-
var justifyContent = { center: "
|
|
4022
|
-
var left = { "0": "
|
|
4023
|
-
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" };
|
|
4024
4074
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
4025
|
-
var top = { "0": "
|
|
4075
|
+
var top = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
|
|
4026
4076
|
var transformTranslateZero = "_16lm1iwa";
|
|
4027
|
-
var userSelect = { none: "
|
|
4028
|
-
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" };
|
|
4029
4079
|
|
|
4030
4080
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4031
4081
|
var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
|
|
@@ -4058,7 +4108,7 @@ import {
|
|
|
4058
4108
|
createElement as createElement16,
|
|
4059
4109
|
useMemo as useMemo5
|
|
4060
4110
|
} from "react";
|
|
4061
|
-
import { useCallback as useCallback8, useContext as
|
|
4111
|
+
import { useCallback as useCallback8, useContext as useContext4, useEffect as useEffect11, useRef as useRef12 } from "react";
|
|
4062
4112
|
import { createPortal } from "react-dom";
|
|
4063
4113
|
|
|
4064
4114
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -4162,12 +4212,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4162
4212
|
|
|
4163
4213
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4164
4214
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
4165
|
-
import {
|
|
4166
|
-
useCallback as useCallback6,
|
|
4167
|
-
useMemo as useMemo4,
|
|
4168
|
-
useRef as useRef11,
|
|
4169
|
-
useState as useState6
|
|
4170
|
-
} from "react";
|
|
4215
|
+
import { useCallback as useCallback6, useMemo as useMemo4, useState as useState5 } from "react";
|
|
4171
4216
|
|
|
4172
4217
|
// src/components/InfiniteTable/hooks/useInfiniteTable.ts
|
|
4173
4218
|
import { useContext as useContext3 } from "react";
|
|
@@ -4205,120 +4250,297 @@ var moveXatY = (arr, dragIndex, dropIndex) => {
|
|
|
4205
4250
|
return arr;
|
|
4206
4251
|
};
|
|
4207
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
|
+
|
|
4208
4401
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4402
|
+
var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4403
|
+
var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4404
|
+
var PROXY_OFFSET = 10;
|
|
4209
4405
|
var getBreakPoints = (columns) => {
|
|
4210
4406
|
return Array.from(columns.values()).map((c) => {
|
|
4211
4407
|
return {
|
|
4212
4408
|
columnId: c.id,
|
|
4213
4409
|
breakpoint: c.computedAbsoluteOffset + Math.round(c.computedWidth / 2)
|
|
4214
4410
|
};
|
|
4215
|
-
});
|
|
4411
|
+
}).filter(Boolean);
|
|
4216
4412
|
};
|
|
4217
4413
|
var useColumnPointerEvents = ({
|
|
4218
4414
|
columnId,
|
|
4219
4415
|
domRef,
|
|
4220
4416
|
columns,
|
|
4221
|
-
computedRemainingSpace
|
|
4417
|
+
computedRemainingSpace,
|
|
4418
|
+
pinnedStartColsCount,
|
|
4419
|
+
visibleColsCount
|
|
4222
4420
|
}) => {
|
|
4223
|
-
const [
|
|
4224
|
-
const
|
|
4225
|
-
const
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
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();
|
|
4231
4428
|
const { computedColumnOrder } = computed;
|
|
4232
4429
|
const column = useMemo4(() => columns.get(columnId), [columnId, columns]);
|
|
4233
|
-
const {
|
|
4430
|
+
const { dragColumnIndex, columnsArray } = useMemo4(() => {
|
|
4234
4431
|
const columnsArray2 = Array.from(columns.values());
|
|
4432
|
+
const columnIndex = columnsArray2.findIndex((c) => c.id === columnId);
|
|
4235
4433
|
return {
|
|
4236
4434
|
columnsArray: columnsArray2,
|
|
4237
|
-
|
|
4238
|
-
columnWidth: column.computedWidth
|
|
4435
|
+
dragColumnIndex: columnIndex,
|
|
4436
|
+
columnWidth: column.computedWidth,
|
|
4437
|
+
columnOffsetVar: `var(${columnOffsetAtIndex4}-${column.computedVisibleIndex})`
|
|
4239
4438
|
};
|
|
4240
4439
|
}, [columns, columnId, column]);
|
|
4241
|
-
let cursorRef = useRef11("auto");
|
|
4242
4440
|
const onPointerDown = useCallback6((e) => {
|
|
4441
|
+
var _a;
|
|
4442
|
+
let breakpoints = [];
|
|
4243
4443
|
const target = domRef.current;
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
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;
|
|
4250
4476
|
const onPointerMove = (e2) => {
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
top: e2.clientY - rect.y - 10
|
|
4259
|
-
});
|
|
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);
|
|
4260
4484
|
target.style.cursor = "grabbing";
|
|
4261
4485
|
}
|
|
4262
|
-
|
|
4263
|
-
const
|
|
4486
|
+
updateColumnOffsets(e2);
|
|
4487
|
+
const diffX = currentDiff.x;
|
|
4264
4488
|
const dir = diffX < 0 ? -1 : 1;
|
|
4265
|
-
const columnPinned = column.computedPinned;
|
|
4266
4489
|
let currentPos = dir === -1 ? column.computedAbsoluteOffset + diffX : column.computedAbsoluteOffset + column.computedWidth + diffX;
|
|
4267
|
-
|
|
4268
|
-
let index = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
|
|
4490
|
+
let idx = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
|
|
4269
4491
|
return breakpoint < value ? -1 : breakpoint > value ? 1 : 0;
|
|
4270
4492
|
});
|
|
4271
|
-
if (
|
|
4272
|
-
|
|
4273
|
-
}
|
|
4274
|
-
if (
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
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;
|
|
4286
4507
|
}
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
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;
|
|
4291
4512
|
}
|
|
4292
|
-
}
|
|
4293
|
-
if (index !== columnIndex) {
|
|
4294
|
-
shifts[columnIndex] = total;
|
|
4295
|
-
}
|
|
4296
|
-
componentActions.columnShifts = shifts;
|
|
4297
|
-
componentActions.draggingColumnId = column.id;
|
|
4513
|
+
});
|
|
4298
4514
|
}
|
|
4299
|
-
setDraggingDiff({ left: diffX, top: diffY });
|
|
4300
4515
|
};
|
|
4301
4516
|
const onPointerUp = (e2) => {
|
|
4517
|
+
var _a2;
|
|
4302
4518
|
const target2 = domRef.current;
|
|
4303
|
-
|
|
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;
|
|
4304
4528
|
target2.releasePointerCapture(e2.pointerId);
|
|
4305
4529
|
target2.removeEventListener("pointermove", onPointerMove);
|
|
4306
4530
|
target2.removeEventListener("pointerup", onPointerUp);
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
componentActions.draggingColumnId = null;
|
|
4310
|
-
if (!didDragRef.current && column.computedSortable) {
|
|
4531
|
+
setProxyPosition(null);
|
|
4532
|
+
if (!didDragAtLeastOnce && column.computedSortable) {
|
|
4311
4533
|
column.toggleSort();
|
|
4312
4534
|
}
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
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
|
+
});
|
|
4316
4540
|
componentActions.columnOrder = newOrder;
|
|
4317
4541
|
}
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
initialClientPos.current = null;
|
|
4321
|
-
currentDropIndexRef.current = null;
|
|
4542
|
+
componentActions.columnReorderInProgress = false;
|
|
4543
|
+
breakpoints = [];
|
|
4322
4544
|
};
|
|
4323
4545
|
target.addEventListener("pointermove", onPointerMove);
|
|
4324
4546
|
target.addEventListener("pointerup", onPointerUp);
|
|
@@ -4326,7 +4548,9 @@ var useColumnPointerEvents = ({
|
|
|
4326
4548
|
}, [
|
|
4327
4549
|
columns,
|
|
4328
4550
|
column,
|
|
4329
|
-
|
|
4551
|
+
dragColumnIndex,
|
|
4552
|
+
visibleColsCount,
|
|
4553
|
+
pinnedStartColsCount,
|
|
4330
4554
|
columnsArray,
|
|
4331
4555
|
computedRemainingSpace,
|
|
4332
4556
|
computedColumnOrder
|
|
@@ -4335,8 +4559,7 @@ var useColumnPointerEvents = ({
|
|
|
4335
4559
|
onPointerDown: column.computedDraggable ? onPointerDown : () => {
|
|
4336
4560
|
},
|
|
4337
4561
|
dragging,
|
|
4338
|
-
|
|
4339
|
-
draggingDiff: draggingDiff != null ? draggingDiff : { top: 0, left: 0 }
|
|
4562
|
+
proxyPosition
|
|
4340
4563
|
};
|
|
4341
4564
|
};
|
|
4342
4565
|
|
|
@@ -4386,23 +4609,23 @@ function NumberFilterEditor(props) {
|
|
|
4386
4609
|
import {
|
|
4387
4610
|
createElement as createElement12
|
|
4388
4611
|
} from "react";
|
|
4389
|
-
import { useEffect as useEffect9, useState as
|
|
4612
|
+
import { useEffect as useEffect9, useState as useState6 } from "react";
|
|
4390
4613
|
|
|
4391
4614
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
4392
|
-
var
|
|
4393
|
-
var CellCls = "_1eexc2a5
|
|
4394
|
-
var HeaderCellContentRecipe = (0,
|
|
4395
|
-
var HeaderCellProxy = "
|
|
4396
|
-
var HeaderCellRecipe = (0,
|
|
4397
|
-
var HeaderClsRecipe = (0,
|
|
4398
|
-
var HeaderFilterCls = "_12zfob11c
|
|
4399
|
-
var HeaderFilterEditorCls = "_16lm1iwu
|
|
4400
|
-
var HeaderGroupCls = "_12zfob11b
|
|
4401
|
-
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";
|
|
4402
4625
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
4403
|
-
var HeaderSortIconIndexCls = "
|
|
4404
|
-
var HeaderSortIconRecipe = (0,
|
|
4405
|
-
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";
|
|
4406
4629
|
|
|
4407
4630
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4408
4631
|
var defaultLineStyle = {
|
|
@@ -4413,8 +4636,8 @@ var defaultLineStyle = {
|
|
|
4413
4636
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
4414
4637
|
function SortIcon(props) {
|
|
4415
4638
|
var _a;
|
|
4416
|
-
const [rendered, setRendered] =
|
|
4417
|
-
const [opacity, setOpacity] =
|
|
4639
|
+
const [rendered, setRendered] = useState6(true);
|
|
4640
|
+
const [opacity, setOpacity] = useState6(0);
|
|
4418
4641
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
4419
4642
|
const showIndex = index != null && index > 0;
|
|
4420
4643
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -4482,25 +4705,16 @@ import {
|
|
|
4482
4705
|
memo as memo7
|
|
4483
4706
|
} from "react";
|
|
4484
4707
|
|
|
4485
|
-
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
4486
|
-
import { useContext as useContext4 } from "react";
|
|
4487
|
-
var useInfiniteTableState = () => {
|
|
4488
|
-
const TableContext2 = getInfiniteTableContext();
|
|
4489
|
-
const { componentState } = useContext4(TableContext2);
|
|
4490
|
-
return componentState;
|
|
4491
|
-
};
|
|
4492
|
-
|
|
4493
4708
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
4494
|
-
var
|
|
4495
|
-
var
|
|
4496
|
-
var
|
|
4497
|
-
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"]] });
|
|
4498
4712
|
|
|
4499
4713
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4500
4714
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
4501
4715
|
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
4502
4716
|
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
4503
|
-
var
|
|
4717
|
+
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4504
4718
|
function InfiniteTableCellFn(props) {
|
|
4505
4719
|
var _b, _c, _d;
|
|
4506
4720
|
const _a = props, {
|
|
@@ -4533,23 +4747,14 @@ function InfiniteTableCellFn(props) {
|
|
|
4533
4747
|
"renderChildren"
|
|
4534
4748
|
]);
|
|
4535
4749
|
const children = renderChildren();
|
|
4536
|
-
const { columnShifts } = useInfiniteTableState();
|
|
4537
|
-
const shifting = !!columnShifts;
|
|
4538
4750
|
const style = __spreadValues({
|
|
4539
|
-
width: `var(${
|
|
4751
|
+
width: `var(${columnWidthAtIndex4}-${column.computedVisibleIndex})`
|
|
4540
4752
|
}, domProps.style);
|
|
4541
|
-
if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
|
|
4542
|
-
const shiftLeft = columnShifts[column.computedVisibleIndex];
|
|
4543
|
-
if (virtualized) {
|
|
4544
|
-
style.left = shiftLeft;
|
|
4545
|
-
} else {
|
|
4546
|
-
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4547
|
-
}
|
|
4548
|
-
}
|
|
4549
4753
|
const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
|
|
4550
4754
|
style,
|
|
4551
4755
|
"data-column-id": column.id,
|
|
4552
|
-
|
|
4756
|
+
"data-z-index": style.zIndex,
|
|
4757
|
+
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
|
|
4553
4758
|
children: /* @__PURE__ */ createElement13(Fragment, null, beforeChildren, /* @__PURE__ */ createElement13("div", {
|
|
4554
4759
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
4555
4760
|
style: contentStyle
|
|
@@ -4569,13 +4774,13 @@ var InfiniteTableCell = memo7(InfiniteTableCellFn);
|
|
|
4569
4774
|
import {
|
|
4570
4775
|
createElement as createElement14
|
|
4571
4776
|
} from "react";
|
|
4572
|
-
import { useEffect as useEffect10, useState as
|
|
4777
|
+
import { useEffect as useEffect10, useState as useState7 } from "react";
|
|
4573
4778
|
var { rootClassName: rootClassName6 } = internalProps;
|
|
4574
4779
|
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
|
|
4575
4780
|
var stopPropagation = (e) => e.stopPropagation();
|
|
4576
4781
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
4577
4782
|
var _a, _b, _c, _d;
|
|
4578
|
-
const [theValue, setTheValue] =
|
|
4783
|
+
const [theValue, setTheValue] = useState7((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
4579
4784
|
const onInputChange = (filterValue) => {
|
|
4580
4785
|
setTheValue(filterValue);
|
|
4581
4786
|
props.onChange(filterValue);
|
|
@@ -4966,7 +5171,7 @@ var computeGroupResize = (params) => {
|
|
|
4966
5171
|
};
|
|
4967
5172
|
|
|
4968
5173
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
4969
|
-
import React20, { useRef as
|
|
5174
|
+
import React20, { useRef as useRef11, useState as useState8 } from "react";
|
|
4970
5175
|
|
|
4971
5176
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
|
|
4972
5177
|
function getColumnResizer(colIndex, {
|
|
@@ -5021,17 +5226,17 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
5021
5226
|
}
|
|
5022
5227
|
|
|
5023
5228
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
5024
|
-
var
|
|
5025
|
-
var ResizeHandleCls = "zneyzh0 _16lm1iw2
|
|
5026
|
-
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: [] });
|
|
5027
5232
|
|
|
5028
5233
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
5029
5234
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
5030
5235
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
|
|
5031
5236
|
function ResizeHandleFn(props) {
|
|
5032
|
-
const domRef =
|
|
5033
|
-
const [constrained, setConstrained] =
|
|
5034
|
-
const constrainedRef =
|
|
5237
|
+
const domRef = useRef11(null);
|
|
5238
|
+
const [constrained, setConstrained] = useState8(false);
|
|
5239
|
+
const constrainedRef = useRef11(constrained);
|
|
5035
5240
|
constrainedRef.current = constrained;
|
|
5036
5241
|
const onPointerDown = (e) => {
|
|
5037
5242
|
e.stopPropagation();
|
|
@@ -5086,7 +5291,6 @@ var ResizeHandle = React20.memo(ResizeHandleFn);
|
|
|
5086
5291
|
function useColumnResizeHandle(column) {
|
|
5087
5292
|
const {
|
|
5088
5293
|
computed: { computedVisibleColumns },
|
|
5089
|
-
componentState: { domRef },
|
|
5090
5294
|
getState,
|
|
5091
5295
|
getComputed,
|
|
5092
5296
|
componentActions
|
|
@@ -5096,7 +5300,7 @@ function useColumnResizeHandle(column) {
|
|
|
5096
5300
|
shareSpaceOnResize
|
|
5097
5301
|
}) => {
|
|
5098
5302
|
const state = getState();
|
|
5099
|
-
const { columnSizing, viewportReservedWidth, bodySize
|
|
5303
|
+
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
5100
5304
|
const columns = getComputed().computedVisibleColumns;
|
|
5101
5305
|
let atLeastOneFlex = false;
|
|
5102
5306
|
const columnSizingWithFlex = columns.reduce((acc, col) => {
|
|
@@ -5124,20 +5328,8 @@ function useColumnResizeHandle(column) {
|
|
|
5124
5328
|
};
|
|
5125
5329
|
})
|
|
5126
5330
|
});
|
|
5127
|
-
if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
|
|
5128
|
-
const activeColumn = columns[activeCellIndex[1]];
|
|
5129
|
-
const currentColumn = columns[column.computedVisibleIndex];
|
|
5130
|
-
if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
|
|
5131
|
-
setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
|
|
5132
|
-
} else if (activeColumn) {
|
|
5133
|
-
setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
|
|
5134
|
-
}
|
|
5135
|
-
if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
|
|
5136
|
-
setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
|
|
5137
|
-
}
|
|
5138
|
-
}
|
|
5139
5331
|
return result;
|
|
5140
|
-
}, []);
|
|
5332
|
+
}, [column]);
|
|
5141
5333
|
const onColumnResize = useCallback7(({
|
|
5142
5334
|
diff,
|
|
5143
5335
|
shareSpaceOnResize
|
|
@@ -5150,7 +5342,7 @@ function useColumnResizeHandle(column) {
|
|
|
5150
5342
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
5151
5343
|
}
|
|
5152
5344
|
componentActions.columnSizing = columnSizing;
|
|
5153
|
-
}, []);
|
|
5345
|
+
}, [computeResizeForDiff]);
|
|
5154
5346
|
const resizeHandle = column.computedResizable ? /* @__PURE__ */ createElement15(ResizeHandle, {
|
|
5155
5347
|
columns: computedVisibleColumns,
|
|
5156
5348
|
columnIndex: column.computedVisibleIndex,
|
|
@@ -5164,6 +5356,8 @@ function useColumnResizeHandle(column) {
|
|
|
5164
5356
|
var InfiniteTableHeaderCellContext = createContext4(null);
|
|
5165
5357
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
5166
5358
|
var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
|
|
5359
|
+
var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5360
|
+
var columnOffsetAtIndex5 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
5167
5361
|
function InfiniteTableHeaderCell(props) {
|
|
5168
5362
|
var _a, _b, _c, _d, _e;
|
|
5169
5363
|
const column = props.column;
|
|
@@ -5202,12 +5396,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5202
5396
|
header = header != null ? header : column.name;
|
|
5203
5397
|
return /* @__PURE__ */ createElement16(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
|
|
5204
5398
|
};
|
|
5205
|
-
const domRef =
|
|
5399
|
+
const domRef = useRef12(null);
|
|
5206
5400
|
const {
|
|
5207
5401
|
computed: {
|
|
5208
5402
|
computedRemainingSpace,
|
|
5209
5403
|
showColumnFilters,
|
|
5210
|
-
computedVisibleColumns
|
|
5404
|
+
computedVisibleColumns,
|
|
5405
|
+
computedPinnedStartColumns
|
|
5211
5406
|
},
|
|
5212
5407
|
componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
|
|
5213
5408
|
} = useInfiniteTable();
|
|
@@ -5229,7 +5424,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5229
5424
|
const style = {
|
|
5230
5425
|
height
|
|
5231
5426
|
};
|
|
5232
|
-
const { onPointerDown, dragging,
|
|
5427
|
+
const { onPointerDown, dragging, proxyPosition } = useColumnPointerEvents({
|
|
5428
|
+
pinnedStartColsCount: computedPinnedStartColumns.length,
|
|
5429
|
+
visibleColsCount: computedVisibleColumns.length,
|
|
5233
5430
|
computedRemainingSpace,
|
|
5234
5431
|
columnId: column.id,
|
|
5235
5432
|
domRef,
|
|
@@ -5243,9 +5440,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5243
5440
|
position: "absolute",
|
|
5244
5441
|
height,
|
|
5245
5442
|
width,
|
|
5246
|
-
left: column.
|
|
5247
|
-
top: (
|
|
5248
|
-
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
|
|
5249
5446
|
}
|
|
5250
5447
|
}, header);
|
|
5251
5448
|
draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
|
|
@@ -5316,6 +5513,8 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5316
5513
|
const filterType = column.computedFilterType;
|
|
5317
5514
|
const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
|
|
5318
5515
|
const resizeHandle = useColumnResizeHandle(column);
|
|
5516
|
+
const zIndex2 = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5517
|
+
style.zIndex = zIndex2;
|
|
5319
5518
|
return /* @__PURE__ */ createElement16(ContextProvider, {
|
|
5320
5519
|
value: renderParam
|
|
5321
5520
|
}, /* @__PURE__ */ createElement16(InfiniteTableCell, {
|
|
@@ -5324,7 +5523,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5324
5523
|
column,
|
|
5325
5524
|
"data-name": `HeaderCell`,
|
|
5326
5525
|
"data-column-id": column.id,
|
|
5327
|
-
"data-z-index":
|
|
5526
|
+
"data-z-index": zIndex2,
|
|
5328
5527
|
style,
|
|
5329
5528
|
width,
|
|
5330
5529
|
onPointerDown,
|
|
@@ -5345,7 +5544,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5345
5544
|
}), draggingProxy);
|
|
5346
5545
|
}
|
|
5347
5546
|
function useInfiniteHeaderCell() {
|
|
5348
|
-
const result =
|
|
5547
|
+
const result = useContext4(InfiniteTableHeaderCellContext);
|
|
5349
5548
|
return result;
|
|
5350
5549
|
}
|
|
5351
5550
|
|
|
@@ -5480,7 +5679,7 @@ import {
|
|
|
5480
5679
|
createElement as createElement19,
|
|
5481
5680
|
memo as memo8
|
|
5482
5681
|
} from "react";
|
|
5483
|
-
import { useCallback as useCallback10, useEffect as useEffect12, useRef as
|
|
5682
|
+
import { useCallback as useCallback10, useEffect as useEffect12, useRef as useRef14 } from "react";
|
|
5484
5683
|
|
|
5485
5684
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5486
5685
|
import {
|
|
@@ -5494,13 +5693,13 @@ import {
|
|
|
5494
5693
|
import { useCallback as useCallback9 } from "react";
|
|
5495
5694
|
|
|
5496
5695
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
5497
|
-
import React23, { useRef as
|
|
5696
|
+
import React23, { useRef as useRef13, useState as useState9 } from "react";
|
|
5498
5697
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
5499
5698
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
|
|
5500
5699
|
function GroupResizeHandleFn(props) {
|
|
5501
|
-
const domRef =
|
|
5502
|
-
const [constrained, setConstrained] =
|
|
5503
|
-
const constrainedRef =
|
|
5700
|
+
const domRef = useRef13(null);
|
|
5701
|
+
const [constrained, setConstrained] = useState9(false);
|
|
5702
|
+
const constrainedRef = useRef13(constrained);
|
|
5504
5703
|
constrainedRef.current = constrained;
|
|
5505
5704
|
const onPointerDown = (e) => {
|
|
5506
5705
|
e.stopPropagation();
|
|
@@ -5624,7 +5823,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5624
5823
|
|
|
5625
5824
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5626
5825
|
var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
5627
|
-
var
|
|
5826
|
+
var columnWidthAtIndex5 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5628
5827
|
function InfiniteTableHeaderGroup(props) {
|
|
5629
5828
|
const {
|
|
5630
5829
|
computed: { computedVisibleColumns }
|
|
@@ -5643,7 +5842,7 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5643
5842
|
columnGroupsMaxDepth
|
|
5644
5843
|
});
|
|
5645
5844
|
const firstColumn = columns[0];
|
|
5646
|
-
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})`;
|
|
5647
5846
|
const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
|
|
5648
5847
|
return /* @__PURE__ */ createElement18("div", {
|
|
5649
5848
|
ref: props.domRef,
|
|
@@ -5684,7 +5883,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5684
5883
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
5685
5884
|
return removeOnScroll;
|
|
5686
5885
|
}, [brain]);
|
|
5687
|
-
const domRef =
|
|
5886
|
+
const domRef = useRef14(null);
|
|
5688
5887
|
const headerCls = HeaderClsRecipe({
|
|
5689
5888
|
overflow: false,
|
|
5690
5889
|
virtualized: true
|
|
@@ -5859,7 +6058,7 @@ import {
|
|
|
5859
6058
|
createElement as createElement21,
|
|
5860
6059
|
forwardRef as forwardRef4,
|
|
5861
6060
|
useCallback as useCallback12,
|
|
5862
|
-
useRef as
|
|
6061
|
+
useRef as useRef15
|
|
5863
6062
|
} from "react";
|
|
5864
6063
|
import { useEffect as useEffect13 } from "react";
|
|
5865
6064
|
|
|
@@ -5869,14 +6068,6 @@ function decamelize(str, options) {
|
|
|
5869
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();
|
|
5870
6069
|
}
|
|
5871
6070
|
|
|
5872
|
-
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5873
|
-
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5874
|
-
var FooterCls = "_16lm1iw1";
|
|
5875
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
|
|
5876
|
-
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"]] });
|
|
5877
|
-
var InfiniteClsShiftingColumns = "_16lm1iwq";
|
|
5878
|
-
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5879
|
-
|
|
5880
6071
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
5881
6072
|
var defaultStyle = {
|
|
5882
6073
|
padding: ThemeVars.spacing[2],
|
|
@@ -5906,7 +6097,7 @@ var enforceStyle = (node, style) => {
|
|
|
5906
6097
|
};
|
|
5907
6098
|
var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
|
|
5908
6099
|
const { rootClassName: rootClassName13 } = useInternalProps();
|
|
5909
|
-
const domRef =
|
|
6100
|
+
const domRef = useRef15(null);
|
|
5910
6101
|
const domCallback = useCallback12((node) => {
|
|
5911
6102
|
domRef.current = node;
|
|
5912
6103
|
if (!ref) {
|
|
@@ -5951,8 +6142,9 @@ import {
|
|
|
5951
6142
|
createElement as createElement22,
|
|
5952
6143
|
memo as memo9
|
|
5953
6144
|
} from "react";
|
|
5954
|
-
import { useCallback as useCallback13, useContext as
|
|
6145
|
+
import { useCallback as useCallback13, useContext as useContext5, useMemo as useMemo7 } from "react";
|
|
5955
6146
|
var { rootClassName: rootClassName11 } = internalProps;
|
|
6147
|
+
var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5956
6148
|
var InfiniteTableColumnCellContext = createContext5(null);
|
|
5957
6149
|
var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
|
|
5958
6150
|
function isColumnWithField(c) {
|
|
@@ -6082,6 +6274,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6082
6274
|
}
|
|
6083
6275
|
style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
|
|
6084
6276
|
style.height = rowHeight;
|
|
6277
|
+
style.zIndex = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
6085
6278
|
const memoizedStyle = useMemo7(() => style, [!style ? null : JSON.stringify(style)]);
|
|
6086
6279
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
6087
6280
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
@@ -6105,7 +6298,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6105
6298
|
}
|
|
6106
6299
|
var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
|
|
6107
6300
|
function useInfiniteColumnCell() {
|
|
6108
|
-
const result =
|
|
6301
|
+
const result = useContext5(InfiniteTableColumnCellContext);
|
|
6109
6302
|
return result;
|
|
6110
6303
|
}
|
|
6111
6304
|
|
|
@@ -6122,8 +6315,8 @@ import {
|
|
|
6122
6315
|
} from "react";
|
|
6123
6316
|
|
|
6124
6317
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
6125
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
6126
|
-
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";
|
|
6127
6320
|
var LoadMaskTextCls = "qy58ya4";
|
|
6128
6321
|
|
|
6129
6322
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -6155,24 +6348,40 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6155
6348
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
6156
6349
|
const state = getState();
|
|
6157
6350
|
const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6351
|
+
if (!scrollPosition) {
|
|
6352
|
+
return false;
|
|
6353
|
+
}
|
|
6158
6354
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6355
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6356
|
+
if (scrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6357
|
+
return false;
|
|
6358
|
+
}
|
|
6159
6359
|
if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6160
6360
|
state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
|
|
6161
6361
|
}
|
|
6362
|
+
return true;
|
|
6162
6363
|
},
|
|
6163
6364
|
scrollColumnIntoView(colId, config = { offset: 0 }) {
|
|
6164
6365
|
const state = getState();
|
|
6165
6366
|
const computed = getComputed();
|
|
6166
6367
|
const computedColumn = computed.computedVisibleColumnsMap.get(colId);
|
|
6167
6368
|
if (!computedColumn) {
|
|
6168
|
-
return;
|
|
6369
|
+
return false;
|
|
6169
6370
|
}
|
|
6170
6371
|
const colIndex = computedColumn.computedVisibleIndex;
|
|
6171
6372
|
const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6373
|
+
if (!scrollPosition) {
|
|
6374
|
+
return false;
|
|
6375
|
+
}
|
|
6172
6376
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6377
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6378
|
+
if (scrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6379
|
+
return false;
|
|
6380
|
+
}
|
|
6173
6381
|
if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6174
6382
|
state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
|
|
6175
6383
|
}
|
|
6384
|
+
return true;
|
|
6176
6385
|
},
|
|
6177
6386
|
scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
|
|
6178
6387
|
const state = getState();
|
|
@@ -6181,33 +6390,48 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6181
6390
|
if (typeof colIdOrIndex === "string") {
|
|
6182
6391
|
const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
|
|
6183
6392
|
if (!computedColumn) {
|
|
6184
|
-
return;
|
|
6393
|
+
return false;
|
|
6185
6394
|
}
|
|
6186
6395
|
colIndex = computedColumn.computedVisibleIndex;
|
|
6187
6396
|
}
|
|
6188
6397
|
const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6189
6398
|
const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6399
|
+
if (!scrollPositionForCol || !scrollPositionForRow) {
|
|
6400
|
+
return false;
|
|
6401
|
+
}
|
|
6190
6402
|
const newScrollPosition = {
|
|
6191
6403
|
scrollLeft: scrollPositionForCol.scrollLeft,
|
|
6192
6404
|
scrollTop: scrollPositionForRow.scrollTop
|
|
6193
6405
|
};
|
|
6194
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
|
+
}
|
|
6195
6415
|
if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6196
6416
|
state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
|
|
6197
6417
|
}
|
|
6198
6418
|
if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6199
6419
|
state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
|
|
6200
6420
|
}
|
|
6421
|
+
return true;
|
|
6201
6422
|
}
|
|
6202
6423
|
};
|
|
6424
|
+
if (false) {
|
|
6425
|
+
globalThis.imperativeApi = imperativeApi;
|
|
6426
|
+
}
|
|
6203
6427
|
return imperativeApi;
|
|
6204
6428
|
}
|
|
6205
6429
|
|
|
6206
6430
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
6207
6431
|
import {
|
|
6208
6432
|
useEffect as useEffect14,
|
|
6209
|
-
useRef as
|
|
6210
|
-
useState as
|
|
6433
|
+
useRef as useRef16,
|
|
6434
|
+
useState as useState10
|
|
6211
6435
|
} from "react";
|
|
6212
6436
|
var OFFSET = 10;
|
|
6213
6437
|
function getColumnContentMaxWidths(domRef, options) {
|
|
@@ -6274,10 +6498,10 @@ function useAutoSizeColumns() {
|
|
|
6274
6498
|
componentActions,
|
|
6275
6499
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
6276
6500
|
} = useComponentState();
|
|
6277
|
-
const [refreshId, setRefreshId] =
|
|
6501
|
+
const [refreshId, setRefreshId] = useState10(0);
|
|
6278
6502
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
6279
6503
|
const getTheKey = useLatest(theKey);
|
|
6280
|
-
const lastExecutedIdentifierRef =
|
|
6504
|
+
const lastExecutedIdentifierRef = useRef16(null);
|
|
6281
6505
|
useEffect14(() => {
|
|
6282
6506
|
const key = getTheKey();
|
|
6283
6507
|
if (key == null) {
|
|
@@ -6336,7 +6560,7 @@ function useAutoSizeColumns() {
|
|
|
6336
6560
|
}
|
|
6337
6561
|
|
|
6338
6562
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
6339
|
-
import { useCallback as useCallback14, useEffect as useEffect15, useRef as
|
|
6563
|
+
import { useCallback as useCallback14, useEffect as useEffect15, useRef as useRef17 } from "react";
|
|
6340
6564
|
import React31 from "react";
|
|
6341
6565
|
|
|
6342
6566
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
@@ -6407,7 +6631,7 @@ function useCellRendering(param) {
|
|
|
6407
6631
|
bodySize,
|
|
6408
6632
|
rowspan
|
|
6409
6633
|
});
|
|
6410
|
-
const scrollTopMaxRef =
|
|
6634
|
+
const scrollTopMaxRef = useRef17(0);
|
|
6411
6635
|
useEffect15(() => {
|
|
6412
6636
|
return brain.onRenderCountChange(() => {
|
|
6413
6637
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
@@ -6497,7 +6721,7 @@ function useCellRendering(param) {
|
|
|
6497
6721
|
}
|
|
6498
6722
|
|
|
6499
6723
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
6500
|
-
import { useCallback as useCallback17, useEffect as useEffect25, useState as
|
|
6724
|
+
import { useCallback as useCallback17, useEffect as useEffect25, useState as useState14 } from "react";
|
|
6501
6725
|
|
|
6502
6726
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6503
6727
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -6567,20 +6791,6 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
6567
6791
|
return map2;
|
|
6568
6792
|
}
|
|
6569
6793
|
|
|
6570
|
-
// src/components/InfiniteTable/utils/rafFn.ts
|
|
6571
|
-
var rafFn = (fn) => {
|
|
6572
|
-
let rafId = 0;
|
|
6573
|
-
return (...args) => {
|
|
6574
|
-
if (rafId) {
|
|
6575
|
-
cancelAnimationFrame(rafId);
|
|
6576
|
-
}
|
|
6577
|
-
rafId = requestAnimationFrame(() => {
|
|
6578
|
-
rafId = 0;
|
|
6579
|
-
fn(...args);
|
|
6580
|
-
});
|
|
6581
|
-
};
|
|
6582
|
-
};
|
|
6583
|
-
|
|
6584
6794
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6585
6795
|
function useColumnGroups() {
|
|
6586
6796
|
const {
|
|
@@ -6700,7 +6910,7 @@ import {
|
|
|
6700
6910
|
createElement as createElement24,
|
|
6701
6911
|
useEffect as useEffect18
|
|
6702
6912
|
} from "react";
|
|
6703
|
-
import { useState as
|
|
6913
|
+
import { useState as useState11 } from "react";
|
|
6704
6914
|
|
|
6705
6915
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
6706
6916
|
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -6711,7 +6921,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ def
|
|
|
6711
6921
|
function ExpanderIcon(props) {
|
|
6712
6922
|
var _a;
|
|
6713
6923
|
const { size = 24 } = props;
|
|
6714
|
-
const [expanded, setExpanded] =
|
|
6924
|
+
const [expanded, setExpanded] = useState11((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
6715
6925
|
const onClick = () => {
|
|
6716
6926
|
var _a2;
|
|
6717
6927
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -6914,10 +7124,10 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
6914
7124
|
}
|
|
6915
7125
|
|
|
6916
7126
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
6917
|
-
import { useEffect as useEffect19, useRef as
|
|
7127
|
+
import { useEffect as useEffect19, useRef as useRef18 } from "react";
|
|
6918
7128
|
function useEffectWithRaf(fn, deps) {
|
|
6919
|
-
const rafId =
|
|
6920
|
-
const removeFnRaf =
|
|
7129
|
+
const rafId = useRef18(0);
|
|
7130
|
+
const removeFnRaf = useRef18();
|
|
6921
7131
|
useEffect19(() => {
|
|
6922
7132
|
rafId.current = requestAnimationFrame(() => {
|
|
6923
7133
|
removeFnRaf.current = fn();
|
|
@@ -7579,15 +7789,15 @@ var GroupRowsState = class {
|
|
|
7579
7789
|
};
|
|
7580
7790
|
|
|
7581
7791
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7582
|
-
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";
|
|
7583
7793
|
|
|
7584
7794
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7585
|
-
import { useEffect as useEffect20, useRef as
|
|
7795
|
+
import { useEffect as useEffect20, useRef as useRef19 } from "react";
|
|
7586
7796
|
function useEffectWithChanges(fn, deps) {
|
|
7587
|
-
const prevRef =
|
|
7588
|
-
const oldValuesRef =
|
|
7797
|
+
const prevRef = useRef19({});
|
|
7798
|
+
const oldValuesRef = useRef19({});
|
|
7589
7799
|
const oldValues = oldValuesRef.current;
|
|
7590
|
-
const changesRef =
|
|
7800
|
+
const changesRef = useRef19({});
|
|
7591
7801
|
const changes = changesRef.current;
|
|
7592
7802
|
const useEffectDeps = [];
|
|
7593
7803
|
for (const k in deps) {
|
|
@@ -7868,11 +8078,11 @@ function useLoadData() {
|
|
|
7868
8078
|
livePaginationCursor,
|
|
7869
8079
|
cursorId: stateCursorId
|
|
7870
8080
|
} = componentState;
|
|
7871
|
-
const [scrollbars, setScrollbars] =
|
|
8081
|
+
const [scrollbars, setScrollbars] = useState12({
|
|
7872
8082
|
vertical: false,
|
|
7873
8083
|
horizontal: false
|
|
7874
8084
|
});
|
|
7875
|
-
const scrollbarsRef =
|
|
8085
|
+
const scrollbarsRef = useRef20(scrollbars);
|
|
7876
8086
|
useEffect21(() => {
|
|
7877
8087
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
7878
8088
|
if (!scrollbars2) {
|
|
@@ -7929,7 +8139,7 @@ function useLoadData() {
|
|
|
7929
8139
|
filterValue,
|
|
7930
8140
|
cursorId: livePagination ? stateCursorId : null
|
|
7931
8141
|
};
|
|
7932
|
-
const initialRef =
|
|
8142
|
+
const initialRef = useRef20(true);
|
|
7933
8143
|
useLazyLoadRange();
|
|
7934
8144
|
useEffectWithChanges(() => {
|
|
7935
8145
|
const componentState2 = getComponentState();
|
|
@@ -7970,7 +8180,7 @@ function useLazyLoadRange() {
|
|
|
7970
8180
|
dataArray,
|
|
7971
8181
|
scrollStopDelayUpdatedByTable
|
|
7972
8182
|
} = componentState;
|
|
7973
|
-
const latestRenderRangeRef =
|
|
8183
|
+
const latestRenderRangeRef = useRef20(null);
|
|
7974
8184
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
7975
8185
|
const componentState2 = getComponentState();
|
|
7976
8186
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -9306,7 +9516,7 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
|
|
|
9306
9516
|
};
|
|
9307
9517
|
var getComputedPinned = (colId, columnPinning) => {
|
|
9308
9518
|
const pinned = columnPinning.get(colId);
|
|
9309
|
-
const computedPinned = pinned === "start" ? "start" : pinned === "end" ? "end" : false;
|
|
9519
|
+
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
9310
9520
|
return computedPinned;
|
|
9311
9521
|
};
|
|
9312
9522
|
var getComputedVisibleColumns = ({
|
|
@@ -9442,6 +9652,7 @@ var getComputedVisibleColumns = ({
|
|
|
9442
9652
|
const id = visibleColumnOrder[i];
|
|
9443
9653
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
9444
9654
|
const colType = getColumnComputedType(c, columnTypes);
|
|
9655
|
+
const computedVisibleIndex = i;
|
|
9445
9656
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
9446
9657
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
9447
9658
|
const computedSorted = !!computedSortInfo;
|
|
@@ -9454,7 +9665,15 @@ var getComputedVisibleColumns = ({
|
|
|
9454
9665
|
const computedMaxWidth = maxSizes[i] || 1e4;
|
|
9455
9666
|
const computedPinned = getComputedPinned(id, columnPinning);
|
|
9456
9667
|
const computedLast = i === visibleColumnOrder.length - 1;
|
|
9668
|
+
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9457
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
|
+
}
|
|
9458
9677
|
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
9459
9678
|
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
9460
9679
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
@@ -9503,6 +9722,7 @@ var getComputedVisibleColumns = ({
|
|
|
9503
9722
|
computedWidth,
|
|
9504
9723
|
computedAbsoluteOffset,
|
|
9505
9724
|
computedPinningOffset,
|
|
9725
|
+
computedVisibleIndexInCategory,
|
|
9506
9726
|
computedOffset,
|
|
9507
9727
|
computedSortable,
|
|
9508
9728
|
computedSortInfo,
|
|
@@ -9511,7 +9731,7 @@ var getComputedVisibleColumns = ({
|
|
|
9511
9731
|
computedSorted,
|
|
9512
9732
|
computedSortedAsc,
|
|
9513
9733
|
computedSortedDesc,
|
|
9514
|
-
computedVisibleIndex
|
|
9734
|
+
computedVisibleIndex,
|
|
9515
9735
|
computedPinned,
|
|
9516
9736
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
9517
9737
|
computedFirstInCategory,
|
|
@@ -9732,7 +9952,7 @@ var useComputedVisibleColumns = ({
|
|
|
9732
9952
|
};
|
|
9733
9953
|
|
|
9734
9954
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
9735
|
-
import { useState as
|
|
9955
|
+
import { useState as useState13, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
|
|
9736
9956
|
var INITIAL_SCROLLBARS = {
|
|
9737
9957
|
vertical: false,
|
|
9738
9958
|
horizontal: false
|
|
@@ -9740,7 +9960,7 @@ var INITIAL_SCROLLBARS = {
|
|
|
9740
9960
|
function useScrollbars(brain) {
|
|
9741
9961
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
9742
9962
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
9743
|
-
const [scrollbars, setScrollbars] =
|
|
9963
|
+
const [scrollbars, setScrollbars] = useState13(INITIAL_SCROLLBARS);
|
|
9744
9964
|
useEffect24(() => {
|
|
9745
9965
|
return brain.onRenderCountChange(() => {
|
|
9746
9966
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
@@ -9781,7 +10001,7 @@ function useComputed() {
|
|
|
9781
10001
|
bodySize,
|
|
9782
10002
|
showSeparatePivotColumnForSingleAggregation
|
|
9783
10003
|
} = componentState;
|
|
9784
|
-
|
|
10004
|
+
useState14(() => {
|
|
9785
10005
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
9786
10006
|
if (rowHeight) {
|
|
9787
10007
|
componentActions.rowHeight = rowHeight;
|
|
@@ -9876,107 +10096,6 @@ function useComputed() {
|
|
|
9876
10096
|
};
|
|
9877
10097
|
}
|
|
9878
10098
|
|
|
9879
|
-
// src/components/InfiniteTable/hooks/useDOMProps.ts
|
|
9880
|
-
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
9881
|
-
var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
9882
|
-
var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
|
|
9883
|
-
var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
|
|
9884
|
-
function useDOMProps(initialDOMProps) {
|
|
9885
|
-
const { computed, componentState, componentActions } = useInfiniteTable();
|
|
9886
|
-
const {
|
|
9887
|
-
columnShifts,
|
|
9888
|
-
focused,
|
|
9889
|
-
focusedWithin,
|
|
9890
|
-
domRef,
|
|
9891
|
-
onBlurWithin,
|
|
9892
|
-
onFocusWithin,
|
|
9893
|
-
onSelfFocus,
|
|
9894
|
-
onSelfBlur,
|
|
9895
|
-
activeCellIndex
|
|
9896
|
-
} = componentState;
|
|
9897
|
-
const {
|
|
9898
|
-
computedPinnedStartColumnsWidth,
|
|
9899
|
-
computedPinnedEndColumnsWidth,
|
|
9900
|
-
computedVisibleColumns
|
|
9901
|
-
} = computed;
|
|
9902
|
-
const cssVars = computedVisibleColumns.reduce((vars, col) => {
|
|
9903
|
-
const index = col.computedVisibleIndex;
|
|
9904
|
-
vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
|
|
9905
|
-
vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
|
|
9906
|
-
return vars;
|
|
9907
|
-
}, {});
|
|
9908
|
-
if (activeCellIndex != null) {
|
|
9909
|
-
cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
|
|
9910
|
-
cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
|
|
9911
|
-
}
|
|
9912
|
-
const setFocused = rafFn((focused2) => {
|
|
9913
|
-
componentActions.focused = focused2;
|
|
9914
|
-
});
|
|
9915
|
-
const setFocusedWithin = rafFn((focused2) => {
|
|
9916
|
-
componentActions.focusedWithin = focused2;
|
|
9917
|
-
});
|
|
9918
|
-
const onFocus = (event) => {
|
|
9919
|
-
var _a;
|
|
9920
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9921
|
-
if (event.target === domRef.current) {
|
|
9922
|
-
setFocused(true);
|
|
9923
|
-
onSelfFocus == null ? void 0 : onSelfFocus(event);
|
|
9924
|
-
if (focusedWithin) {
|
|
9925
|
-
setFocusedWithin(false);
|
|
9926
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9927
|
-
}
|
|
9928
|
-
} else {
|
|
9929
|
-
if (!focusedWithin) {
|
|
9930
|
-
setFocusedWithin(true);
|
|
9931
|
-
onFocusWithin == null ? void 0 : onFocusWithin(event);
|
|
9932
|
-
}
|
|
9933
|
-
}
|
|
9934
|
-
};
|
|
9935
|
-
const onBlur = (event) => {
|
|
9936
|
-
var _a, _b;
|
|
9937
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9938
|
-
if (event.target === domRef.current) {
|
|
9939
|
-
setFocused(false);
|
|
9940
|
-
onSelfBlur == null ? void 0 : onSelfBlur(event);
|
|
9941
|
-
if (focusedWithin) {
|
|
9942
|
-
setFocusedWithin(false);
|
|
9943
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9944
|
-
}
|
|
9945
|
-
} else {
|
|
9946
|
-
const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
|
|
9947
|
-
if (!contained) {
|
|
9948
|
-
setFocusedWithin(false);
|
|
9949
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9950
|
-
}
|
|
9951
|
-
}
|
|
9952
|
-
};
|
|
9953
|
-
const domProps = __spreadProps(__spreadValues({
|
|
9954
|
-
tabIndex: 0
|
|
9955
|
-
}, initialDOMProps), {
|
|
9956
|
-
onFocus,
|
|
9957
|
-
onBlur
|
|
9958
|
-
});
|
|
9959
|
-
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({
|
|
9960
|
-
hasPinnedStart: !!computedPinnedStartColumnsWidth,
|
|
9961
|
-
hasPinnedEnd: !!computedPinnedEndColumnsWidth,
|
|
9962
|
-
focused,
|
|
9963
|
-
focusedWithin
|
|
9964
|
-
}));
|
|
9965
|
-
domProps.className = className;
|
|
9966
|
-
domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
|
|
9967
|
-
if (focused) {
|
|
9968
|
-
if (componentState.focusedStyle) {
|
|
9969
|
-
Object.assign(domProps.style, componentState.focusedStyle);
|
|
9970
|
-
}
|
|
9971
|
-
}
|
|
9972
|
-
if (focusedWithin) {
|
|
9973
|
-
if (componentState.focusedWithinStyle) {
|
|
9974
|
-
Object.assign(domProps.style, componentState.focusedWithinStyle);
|
|
9975
|
-
}
|
|
9976
|
-
}
|
|
9977
|
-
return domProps;
|
|
9978
|
-
}
|
|
9979
|
-
|
|
9980
10099
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
9981
10100
|
import { useMemo as useMemo12 } from "react";
|
|
9982
10101
|
|
|
@@ -10139,7 +10258,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
10139
10258
|
const valid = useMemo12(() => {
|
|
10140
10259
|
let valid2 = isValidLicense(licenseKey, {
|
|
10141
10260
|
publishedAt: 1624970570587,
|
|
10142
|
-
version: "0.3.
|
|
10261
|
+
version: "0.3.16"
|
|
10143
10262
|
});
|
|
10144
10263
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
10145
10264
|
return true;
|
|
@@ -10149,6 +10268,73 @@ var useLicense = (licenseKey = "") => {
|
|
|
10149
10268
|
return valid;
|
|
10150
10269
|
};
|
|
10151
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
|
+
|
|
10152
10338
|
// src/components/utils/clamp.ts
|
|
10153
10339
|
function clamp(value, min, max) {
|
|
10154
10340
|
return Math.min(Math.max(value, min), max);
|
|
@@ -10392,7 +10578,6 @@ function initSetupState2() {
|
|
|
10392
10578
|
propsCache: new Map([]),
|
|
10393
10579
|
brain,
|
|
10394
10580
|
headerBrain,
|
|
10395
|
-
columnShifts: null,
|
|
10396
10581
|
domRef: createRef(),
|
|
10397
10582
|
scrollerDOMRef: createRef(),
|
|
10398
10583
|
portalDOMRef: createRef(),
|
|
@@ -10407,11 +10592,11 @@ function initSetupState2() {
|
|
|
10407
10592
|
scrollTop: 0,
|
|
10408
10593
|
scrollLeft: 0
|
|
10409
10594
|
},
|
|
10595
|
+
columnReorderInProgress: false,
|
|
10410
10596
|
ready: false,
|
|
10411
10597
|
focused: false,
|
|
10412
10598
|
focusedWithin: false,
|
|
10413
10599
|
columnsWhenGrouping: columnsGeneratedForGrouping,
|
|
10414
|
-
draggingColumnId: null,
|
|
10415
10600
|
pinnedStartScrollListener: new ScrollListener(),
|
|
10416
10601
|
pinnedEndScrollListener: new ScrollListener(),
|
|
10417
10602
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
@@ -10465,7 +10650,6 @@ var forwardProps3 = (setupState) => {
|
|
|
10465
10650
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
10466
10651
|
pivotGrandTotalColumnPosition: 1,
|
|
10467
10652
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
10468
|
-
keyboardNavigation: (keyboardNavigation) => keyboardNavigation != null ? keyboardNavigation : "cell",
|
|
10469
10653
|
activeRowIndex: 1,
|
|
10470
10654
|
activeCellIndex: 1,
|
|
10471
10655
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
@@ -10512,7 +10696,7 @@ var cleanupState = (state) => {
|
|
|
10512
10696
|
state.pinnedStartScrollListener.destroy();
|
|
10513
10697
|
};
|
|
10514
10698
|
var mapPropsToState2 = (params) => {
|
|
10515
|
-
var _a, _b;
|
|
10699
|
+
var _a, _b, _c;
|
|
10516
10700
|
const { props, state, oldState, parentState } = params;
|
|
10517
10701
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
10518
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;
|
|
@@ -10528,7 +10712,8 @@ var mapPropsToState2 = (params) => {
|
|
|
10528
10712
|
groupRenderStrategy,
|
|
10529
10713
|
groupBy,
|
|
10530
10714
|
computedColumns,
|
|
10531
|
-
|
|
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,
|
|
10532
10717
|
columnGroupsDepthsMap,
|
|
10533
10718
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
10534
10719
|
computedColumnGroups,
|
|
@@ -10565,11 +10750,11 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10565
10750
|
getState
|
|
10566
10751
|
} = useInfiniteTable();
|
|
10567
10752
|
const {
|
|
10568
|
-
componentState: { loading },
|
|
10753
|
+
componentState: { loading, dataArray },
|
|
10569
10754
|
getState: getDataSourceState,
|
|
10570
10755
|
componentActions: dataSourceActions
|
|
10571
10756
|
} = useDataSourceContextValue();
|
|
10572
|
-
const [imperativeApi] =
|
|
10757
|
+
const [imperativeApi] = useState15(() => {
|
|
10573
10758
|
return getImperativeApi(getState, getComputed, getDataSourceState, actions);
|
|
10574
10759
|
});
|
|
10575
10760
|
const {
|
|
@@ -10593,31 +10778,18 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10593
10778
|
activeCellIndex,
|
|
10594
10779
|
onRenderUpdater
|
|
10595
10780
|
} = componentState;
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
offset: 30
|
|
10600
|
-
});
|
|
10601
|
-
}
|
|
10602
|
-
}, [activeRowIndex]);
|
|
10603
|
-
useEffect27(() => {
|
|
10604
|
-
if (activeCellIndex != null) {
|
|
10605
|
-
imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10606
|
-
offset: 30
|
|
10607
|
-
});
|
|
10608
|
-
}
|
|
10609
|
-
}, [activeCellIndex]);
|
|
10610
|
-
const { columnShifts, bodySize } = componentState;
|
|
10781
|
+
useScrollToActiveRow(activeRowIndex, dataArray.length, imperativeApi);
|
|
10782
|
+
useScrollToActiveCell(activeCellIndex, dataArray.length, imperativeApi);
|
|
10783
|
+
const { bodySize } = componentState;
|
|
10611
10784
|
const { scrollbars } = computed;
|
|
10612
10785
|
const { renderCell } = useCellRendering({
|
|
10613
10786
|
imperativeApi,
|
|
10614
10787
|
getComputed,
|
|
10615
10788
|
domRef: componentState.domRef,
|
|
10616
|
-
columnShifts,
|
|
10617
10789
|
bodySize,
|
|
10618
10790
|
computed
|
|
10619
10791
|
});
|
|
10620
|
-
|
|
10792
|
+
useEffect28(() => {
|
|
10621
10793
|
const dataSourceState = getDataSourceState();
|
|
10622
10794
|
const onChange = debounce((renderRange) => {
|
|
10623
10795
|
dataSourceState.notifyRenderRangeChange({
|
|
@@ -10630,7 +10802,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10630
10802
|
const licenseValid = useLicense(licenseKey);
|
|
10631
10803
|
const domProps = useDOMProps(componentState.domProps);
|
|
10632
10804
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
10633
|
-
|
|
10805
|
+
useEffect28(() => {
|
|
10634
10806
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
10635
10807
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
10636
10808
|
}, [scrollStopDelay]);
|
|
@@ -10657,7 +10829,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10657
10829
|
}) : null, /* @__PURE__ */ createElement28(InfiniteTableBody, null, /* @__PURE__ */ createElement28(HeadlessTable, {
|
|
10658
10830
|
tabIndex: 0,
|
|
10659
10831
|
activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
|
|
10660
|
-
activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
|
|
10832
|
+
activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
|
|
10661
10833
|
scrollStopDelay,
|
|
10662
10834
|
renderer,
|
|
10663
10835
|
onRenderUpdater,
|
|
@@ -10669,7 +10841,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
|
10669
10841
|
visible: loading
|
|
10670
10842
|
}, loadingText)), /* @__PURE__ */ createElement28("div", {
|
|
10671
10843
|
ref: portalDOMRef,
|
|
10672
|
-
className: join(`${rootClassName2}Portal`, zIndex[
|
|
10844
|
+
className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
|
|
10673
10845
|
}), rowHeightCSSVar ? /* @__PURE__ */ createElement28(CSSVariableWatch, {
|
|
10674
10846
|
varName: rowHeightCSSVar,
|
|
10675
10847
|
onChange: onRowHeightCSSVarChange
|
|
@@ -10702,13 +10874,13 @@ function InfiniteTableContextProvider() {
|
|
|
10702
10874
|
};
|
|
10703
10875
|
componentActions.bodySize = bodySize;
|
|
10704
10876
|
}, { earlyAttach: true, debounce: 50 });
|
|
10705
|
-
|
|
10877
|
+
useEffect28(() => {
|
|
10706
10878
|
return () => {
|
|
10707
10879
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
10708
10880
|
componentState.onColumnHeaderHeightCSSVarChange.destroy();
|
|
10709
10881
|
};
|
|
10710
10882
|
}, []);
|
|
10711
|
-
|
|
10883
|
+
useEffect28(() => {
|
|
10712
10884
|
if (scrollerDOMRef.current) {
|
|
10713
10885
|
scrollerDOMRef.current.scrollTop = 0;
|
|
10714
10886
|
}
|