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