@infinite-table/infinite-react 0.3.13 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +68 -57
- package/index.d.ts +16 -10
- package/index.esm.css +68 -57
- package/index.esm.js +630 -449
- package/index.js +688 -502
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -666,7 +666,7 @@ function debounce(fn, { wait }) {
|
|
|
666
666
|
|
|
667
667
|
// src/components/InfiniteTable/index.tsx
|
|
668
668
|
var React36 = __toModule(require("react"));
|
|
669
|
-
var
|
|
669
|
+
var import_react50 = __toModule(require("react"));
|
|
670
670
|
|
|
671
671
|
// src/utils/join.ts
|
|
672
672
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -1092,8 +1092,8 @@ function stripVar(cssVariableWithVarString) {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
|
|
1094
1094
|
// src/components/InfiniteTable/theme.css.ts
|
|
1095
|
-
var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)",
|
|
1096
|
-
var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: {
|
|
1095
|
+
var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)", scrollTopForActiveRow: "var(--_1slvgu97)", activeCellColWidth: "var(--_1slvgu98)", activeCellColOffset: "var(--_1slvgu99)", columnWidthAtIndex: "var(--_1slvgu9a)", columnOffsetAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndexWhileReordering: "var(--_1slvgu9c)", columnZIndexAtIndex: "var(--_1slvgu9d)", computedVisibleColumnsCount: "var(--_1slvgu9e)", baseZIndexForCells: "var(--_1slvgu9f)" };
|
|
1096
|
+
var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
|
|
1097
1097
|
var columnHeaderHeightName = "column-header-height";
|
|
1098
1098
|
|
|
1099
1099
|
// src/utils/selectParent.ts
|
|
@@ -1123,6 +1123,8 @@ function getParentInfiniteNode(node) {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
var columnWidthAtIndex = stripVar(InternalVars.columnWidthAtIndex);
|
|
1125
1125
|
var columnOffsetAtIndex = stripVar(InternalVars.columnOffsetAtIndex);
|
|
1126
|
+
var columnOffsetAtIndexWhileReordering = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
|
|
1127
|
+
var columnZIndexAtIndex = stripVar(InternalVars.columnZIndexAtIndex);
|
|
1126
1128
|
function setInfiniteVarOnRoot(varName, varValue, node) {
|
|
1127
1129
|
const infinite = node ? getParentInfiniteNode(node) : document.querySelector(InfiniteSelector);
|
|
1128
1130
|
setInfiniteVarOnNode(varName, varValue, infinite);
|
|
@@ -1146,6 +1148,12 @@ function setInfiniteColumnWidth(colIndex, colWidth, node) {
|
|
|
1146
1148
|
function setInfiniteColumnOffset(colIndex, colOffset, node) {
|
|
1147
1149
|
setInfiniteVarOnRoot(`${columnOffsetAtIndex}-${colIndex}`, typeof colOffset === "number" ? colOffset + "px" : colOffset, node);
|
|
1148
1150
|
}
|
|
1151
|
+
function setInfiniteColumnZIndex(colIndex, colZIndex, node) {
|
|
1152
|
+
setInfiniteVarOnRoot(`${columnZIndexAtIndex}-${colIndex}`, `${colZIndex}`, node);
|
|
1153
|
+
}
|
|
1154
|
+
function setInfiniteColumnOffsetWhileReordering(colIndex, offset, node) {
|
|
1155
|
+
setInfiniteVarOnRoot(`${columnOffsetAtIndexWhileReordering}-${colIndex}`, typeof offset === "number" ? `calc( var(${columnOffsetAtIndex}-${colIndex}) + ${offset}px )` : offset, node);
|
|
1156
|
+
}
|
|
1149
1157
|
function getCSSVarNameForColWidth(colIndex) {
|
|
1150
1158
|
return `${columnWidthAtIndex}-${colIndex}`;
|
|
1151
1159
|
}
|
|
@@ -1445,6 +1453,36 @@ var MatrixBrain = class extends Logger {
|
|
|
1445
1453
|
renderCount = Math.min(count, renderCount);
|
|
1446
1454
|
return renderCount;
|
|
1447
1455
|
};
|
|
1456
|
+
this.isColFixedEnd = (colIndex) => {
|
|
1457
|
+
if (!this.fixedColsEnd) {
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1460
|
+
return colIndex >= this.cols - this.fixedColsEnd;
|
|
1461
|
+
};
|
|
1462
|
+
this.isColFixedStart = (colIndex) => {
|
|
1463
|
+
if (!this.fixedColsStart) {
|
|
1464
|
+
return false;
|
|
1465
|
+
}
|
|
1466
|
+
return colIndex < this.fixedColsStart;
|
|
1467
|
+
};
|
|
1468
|
+
this.isRowFixedEnd = (rowIndex) => {
|
|
1469
|
+
if (!this.fixedRowsEnd) {
|
|
1470
|
+
return false;
|
|
1471
|
+
}
|
|
1472
|
+
return rowIndex >= this.rows - this.fixedRowsEnd;
|
|
1473
|
+
};
|
|
1474
|
+
this.isRowFixedStart = (rowIndex) => {
|
|
1475
|
+
if (!this.fixedRowsStart) {
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
return rowIndex < this.fixedRowsStart;
|
|
1479
|
+
};
|
|
1480
|
+
this.isColFixed = (colIndex) => {
|
|
1481
|
+
return this.isColFixedStart(colIndex) || this.isColFixedEnd(colIndex);
|
|
1482
|
+
};
|
|
1483
|
+
this.isRowFixed = (rowIndex) => {
|
|
1484
|
+
return this.isRowFixedStart(rowIndex) || this.isRowFixedEnd(rowIndex);
|
|
1485
|
+
};
|
|
1448
1486
|
this.getFixedEndColsWidth = () => {
|
|
1449
1487
|
if (!this.fixedColsEnd) {
|
|
1450
1488
|
return 0;
|
|
@@ -2624,7 +2662,8 @@ var MappedCells = class extends Logger {
|
|
|
2624
2662
|
// src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx
|
|
2625
2663
|
var ITEM_POSITION_WITH_TRANSFORM = true;
|
|
2626
2664
|
var currentColumnTransformY = stripVar(InternalVars.currentColumnTransformY);
|
|
2627
|
-
var
|
|
2665
|
+
var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
2666
|
+
var columnOffsetAtIndexWhileReordering2 = stripVar(InternalVars.columnOffsetAtIndexWhileReordering);
|
|
2628
2667
|
var ReactHeadlessTableRenderer = class extends Logger {
|
|
2629
2668
|
constructor(brain) {
|
|
2630
2669
|
super("ReactHeadlessTableRenderer");
|
|
@@ -2639,14 +2678,17 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2639
2678
|
this.currentHoveredRow = -1;
|
|
2640
2679
|
this.hoverRowUpdatesInProgress = new Map();
|
|
2641
2680
|
this.infiniteNode = null;
|
|
2642
|
-
this.setTransform = (element, _rowIndex, colIndex, x, y) => {
|
|
2643
|
-
const
|
|
2681
|
+
this.setTransform = (element, _rowIndex, colIndex, x, y, zIndex2) => {
|
|
2682
|
+
const columnOffsetX = `${columnOffsetAtIndex2}-${colIndex}`;
|
|
2683
|
+
const columnOffsetXWhileReordering = `${columnOffsetAtIndexWhileReordering2}-${colIndex}`;
|
|
2644
2684
|
if (!this.infiniteNode) {
|
|
2645
2685
|
this.infiniteNode = getParentInfiniteNode(element);
|
|
2646
2686
|
}
|
|
2647
|
-
this.infiniteNode.style.setProperty(
|
|
2687
|
+
this.infiniteNode.style.setProperty(columnOffsetX, `${x}px`);
|
|
2648
2688
|
element.style.setProperty(currentColumnTransformY, `${y}px`);
|
|
2649
|
-
element.style.transform = `translate3d(var(${
|
|
2689
|
+
element.style.transform = `translate3d(var(${columnOffsetXWhileReordering}, var(${columnOffsetX})), ${InternalVars.currentColumnTransformY}, 0)`;
|
|
2690
|
+
if (zIndex2 != null) {
|
|
2691
|
+
}
|
|
2650
2692
|
};
|
|
2651
2693
|
this.getFullyVisibleRowsRange = () => {
|
|
2652
2694
|
let {
|
|
@@ -2676,21 +2718,26 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2676
2718
|
}
|
|
2677
2719
|
const rowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
2678
2720
|
const rowHeight = brain.getItemSize(rowIndex, "vertical");
|
|
2721
|
+
const fixedStartRowsHeight = brain.getFixedStartRowsHeight();
|
|
2722
|
+
const fixedEndRowsHeight = brain.getFixedEndRowsHeight();
|
|
2679
2723
|
const top2 = scrollPosition.scrollTop;
|
|
2680
2724
|
const availableSize = brain.getAvailableSize();
|
|
2725
|
+
if (!availableSize.height) {
|
|
2726
|
+
return null;
|
|
2727
|
+
}
|
|
2681
2728
|
const bottom = top2 + availableSize.height;
|
|
2682
2729
|
if (!scrollAdjustPosition) {
|
|
2683
|
-
scrollAdjustPosition = rowOffset > bottom ? "end" : rowOffset < top2 ? "start" : "end";
|
|
2730
|
+
scrollAdjustPosition = rowOffset > bottom - fixedEndRowsHeight ? "end" : rowOffset < top2 + fixedStartRowsHeight ? "start" : "end";
|
|
2684
2731
|
}
|
|
2685
2732
|
let scrollTop = scrollPosition.scrollTop;
|
|
2686
2733
|
if (scrollAdjustPosition === "center") {
|
|
2687
|
-
scrollTop = rowOffset - Math.floor(brain.getAvailableSize().height / 2);
|
|
2734
|
+
scrollTop = rowOffset - Math.floor((brain.getAvailableSize().height - fixedStartRowsHeight - fixedEndRowsHeight) / 2);
|
|
2688
2735
|
} else if (scrollAdjustPosition === "start") {
|
|
2689
2736
|
offset = -offset;
|
|
2690
|
-
scrollTop += rowOffset - top2 + offset;
|
|
2737
|
+
scrollTop += rowOffset - top2 + offset - fixedStartRowsHeight;
|
|
2691
2738
|
} else {
|
|
2692
2739
|
offset += rowHeight;
|
|
2693
|
-
scrollTop += rowOffset - bottom + offset;
|
|
2740
|
+
scrollTop += rowOffset - bottom + offset + fixedEndRowsHeight;
|
|
2694
2741
|
}
|
|
2695
2742
|
return __spreadProps(__spreadValues({}, scrollPosition), {
|
|
2696
2743
|
scrollTop
|
|
@@ -2703,37 +2750,47 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2703
2750
|
if (this.isColumnFullyVisible(colIndex) && !scrollAdjustPosition) {
|
|
2704
2751
|
return scrollPosition;
|
|
2705
2752
|
}
|
|
2706
|
-
const
|
|
2753
|
+
const colOffset = brain.getItemOffsetFor(colIndex, "horizontal");
|
|
2707
2754
|
const colWidth = brain.getItemSize(colIndex, "horizontal");
|
|
2755
|
+
const fixedStartColsWidth = brain.getFixedStartColsWidth();
|
|
2756
|
+
const fixedEndColsWidth = brain.getFixedStartColsWidth();
|
|
2708
2757
|
const left2 = scrollPosition.scrollLeft;
|
|
2709
2758
|
const availableSize = brain.getAvailableSize();
|
|
2759
|
+
if (!availableSize.width) {
|
|
2760
|
+
return null;
|
|
2761
|
+
}
|
|
2710
2762
|
const right = left2 + availableSize.width;
|
|
2711
2763
|
if (!scrollAdjustPosition) {
|
|
2712
|
-
scrollAdjustPosition =
|
|
2764
|
+
scrollAdjustPosition = colOffset > right - fixedEndColsWidth ? "end" : colOffset < left2 + fixedStartColsWidth ? "start" : "end";
|
|
2713
2765
|
}
|
|
2714
2766
|
let scrollLeft = scrollPosition.scrollLeft;
|
|
2715
2767
|
if (scrollAdjustPosition === "center") {
|
|
2716
|
-
scrollLeft =
|
|
2768
|
+
scrollLeft = colOffset - Math.floor((brain.getAvailableSize().width - fixedStartColsWidth - fixedEndColsWidth) / 2);
|
|
2717
2769
|
} else if (scrollAdjustPosition === "start") {
|
|
2718
2770
|
offset = -offset;
|
|
2719
|
-
scrollLeft +=
|
|
2771
|
+
scrollLeft += colOffset - left2 + offset - fixedStartColsWidth;
|
|
2720
2772
|
} else {
|
|
2721
2773
|
offset += colWidth;
|
|
2722
|
-
scrollLeft +=
|
|
2774
|
+
scrollLeft += colOffset - right + offset + fixedEndColsWidth;
|
|
2723
2775
|
}
|
|
2724
2776
|
return __spreadProps(__spreadValues({}, scrollPosition), {
|
|
2725
2777
|
scrollLeft
|
|
2726
2778
|
});
|
|
2727
2779
|
};
|
|
2728
2780
|
this.getScrollPositionForScrollCellIntoView = (rowIndex, colIndex, config = { offsetLeft: 0, offsetTop: 0 }) => {
|
|
2729
|
-
const
|
|
2781
|
+
const scrollPosForCol = this.getScrollPositionForScrollColumnIntoView(colIndex, {
|
|
2730
2782
|
scrollAdjustPosition: config.colScrollAdjustPosition || config.scrollAdjustPosition,
|
|
2731
2783
|
offset: config.offsetLeft
|
|
2732
2784
|
});
|
|
2733
|
-
const
|
|
2785
|
+
const scrollPosForRow = this.getScrollPositionForScrollRowIntoView(rowIndex, {
|
|
2734
2786
|
scrollAdjustPosition: config.rowScrollAdjustPosition || config.scrollAdjustPosition,
|
|
2735
2787
|
offset: config.offsetTop
|
|
2736
2788
|
});
|
|
2789
|
+
if (!scrollPosForCol || !scrollPosForRow) {
|
|
2790
|
+
return null;
|
|
2791
|
+
}
|
|
2792
|
+
const { scrollLeft } = scrollPosForCol;
|
|
2793
|
+
const { scrollTop } = scrollPosForRow;
|
|
2737
2794
|
return { scrollLeft, scrollTop };
|
|
2738
2795
|
};
|
|
2739
2796
|
this.isRowFullyVisible = (rowIndex, offsetMargin = 2) => {
|
|
@@ -2744,6 +2801,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2744
2801
|
return false;
|
|
2745
2802
|
}
|
|
2746
2803
|
const { brain } = this;
|
|
2804
|
+
if (brain.isRowFixed(rowIndex)) {
|
|
2805
|
+
return true;
|
|
2806
|
+
}
|
|
2747
2807
|
const {
|
|
2748
2808
|
start: [startRow],
|
|
2749
2809
|
end: [endRow]
|
|
@@ -2783,23 +2843,26 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2783
2843
|
return false;
|
|
2784
2844
|
}
|
|
2785
2845
|
const { brain } = this;
|
|
2846
|
+
if (brain.isColFixed(colIndex)) {
|
|
2847
|
+
return true;
|
|
2848
|
+
}
|
|
2786
2849
|
const {
|
|
2787
2850
|
start: [_, startCol],
|
|
2788
2851
|
end: [__, endCol]
|
|
2789
2852
|
} = brain.getRenderRange();
|
|
2790
|
-
const midCol = Math.floor((startCol + endCol) / 2);
|
|
2791
2853
|
if (colIndex < startCol) {
|
|
2792
2854
|
return false;
|
|
2793
2855
|
}
|
|
2794
2856
|
if (colIndex >= endCol) {
|
|
2795
2857
|
return false;
|
|
2796
2858
|
}
|
|
2859
|
+
const midCol = Math.floor((startCol + endCol) / 2);
|
|
2797
2860
|
if (colIndex >= midCol) {
|
|
2798
|
-
const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin, "horizontal");
|
|
2861
|
+
const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin - brain.getFixedEndColsWidth(), "horizontal");
|
|
2799
2862
|
return colIndex <= lastVisibleCol;
|
|
2800
2863
|
}
|
|
2801
2864
|
if (colIndex < midCol) {
|
|
2802
|
-
const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin, "horizontal");
|
|
2865
|
+
const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin + brain.getFixedStartColsWidth(), "horizontal");
|
|
2803
2866
|
return colIndex >= firstVisibleCol;
|
|
2804
2867
|
}
|
|
2805
2868
|
return true;
|
|
@@ -3142,7 +3205,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3142
3205
|
itemElement.dataset.rowIndex = rowIndex;
|
|
3143
3206
|
itemElement.dataset.colIndex = colIndex;
|
|
3144
3207
|
if (ITEM_POSITION_WITH_TRANSFORM) {
|
|
3145
|
-
this.setTransform(itemElement, rowIndex, colIndex, x, y);
|
|
3208
|
+
this.setTransform(itemElement, rowIndex, colIndex, x, y, null);
|
|
3146
3209
|
itemElement.style.willChange = "transform";
|
|
3147
3210
|
itemElement.style.backfaceVisibility = "hidden";
|
|
3148
3211
|
const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
|
|
@@ -3188,37 +3251,29 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3188
3251
|
}
|
|
3189
3252
|
}
|
|
3190
3253
|
const adjustColStart = (_rowIndex, colIndex, node, { x, y }, { scrollLeft }) => {
|
|
3191
|
-
node
|
|
3192
|
-
this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y);
|
|
3254
|
+
this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y, fixedColsStart - colIndex);
|
|
3193
3255
|
};
|
|
3194
3256
|
const adjustRowStart = (rowIndex, _colIndex, node, coords, scrollPosition2) => {
|
|
3195
|
-
node.
|
|
3196
|
-
this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop);
|
|
3257
|
+
this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop, fixedRowsStart - rowIndex);
|
|
3197
3258
|
};
|
|
3198
3259
|
const adjustColEnd = (_rowIndex, colIndex, node, { y }) => {
|
|
3199
|
-
node.style.zIndex = `${cols - colIndex}`;
|
|
3200
3260
|
const val = fixedEndColsOffsets[colIndex];
|
|
3201
|
-
this.setTransform(node, _rowIndex, colIndex, val, y);
|
|
3261
|
+
this.setTransform(node, _rowIndex, colIndex, val, y, cols - colIndex);
|
|
3202
3262
|
};
|
|
3203
3263
|
const adjustRowEnd = (rowIndex, _colIndex, node, coords) => {
|
|
3204
|
-
node.
|
|
3205
|
-
this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex]);
|
|
3264
|
+
this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex], rows - rowIndex);
|
|
3206
3265
|
};
|
|
3207
3266
|
const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }, scrollPosition2) => {
|
|
3208
|
-
node.
|
|
3209
|
-
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop);
|
|
3267
|
+
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop, 1e5);
|
|
3210
3268
|
};
|
|
3211
3269
|
const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }, scrollPosition2) => {
|
|
3212
|
-
node.
|
|
3213
|
-
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex]);
|
|
3270
|
+
this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex], 2e5);
|
|
3214
3271
|
};
|
|
3215
3272
|
const adjustColEndRowStart = (_rowIndex, colIndex, node, coords) => {
|
|
3216
|
-
node.
|
|
3217
|
-
this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop);
|
|
3273
|
+
this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop, 3e5);
|
|
3218
3274
|
};
|
|
3219
3275
|
const adjustColEndRowEnd = (rowIndex, colIndex, node) => {
|
|
3220
|
-
node
|
|
3221
|
-
this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex]);
|
|
3276
|
+
this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex], 4e5);
|
|
3222
3277
|
};
|
|
3223
3278
|
if (fixedColsStart || fixedColsEnd) {
|
|
3224
3279
|
for (let rowIndex = startRow; rowIndex < endRow; rowIndex++) {
|
|
@@ -3451,39 +3506,43 @@ var useRerender = () => {
|
|
|
3451
3506
|
};
|
|
3452
3507
|
|
|
3453
3508
|
// src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
|
|
3454
|
-
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwx
|
|
3455
|
-
var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwx
|
|
3509
|
+
var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx", hidden: "nxbq1c3 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx" };
|
|
3510
|
+
var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwz _16lm1iwx _16lm1iwt _16lm1iwn";
|
|
3456
3511
|
|
|
3457
3512
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
3458
|
-
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3
|
|
3513
|
+
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iww _16lm1iwx _16lm1iwz" };
|
|
3459
3514
|
|
|
3460
3515
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
3461
3516
|
var { rootClassName: rootClassName3 } = internalProps;
|
|
3462
3517
|
var baseCls = `${rootClassName3}-ActiveRowIndicator`;
|
|
3518
|
+
var ActiveStyle = {
|
|
3519
|
+
[stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
|
|
3520
|
+
transform: `translate3d(0px, calc( ${InternalVars.activeCellOffsetY} + ${InternalVars.scrollTopForActiveRow}), 0px)`,
|
|
3521
|
+
height: InternalVars.activeCellRowHeight
|
|
3522
|
+
};
|
|
3463
3523
|
var ActiveRowIndicatorFn = (props) => {
|
|
3464
3524
|
const { brain } = props;
|
|
3465
|
-
const [state, setState] = (0, import_react9.useState)({
|
|
3466
|
-
top: 0,
|
|
3467
|
-
rowHeight: 0
|
|
3468
|
-
});
|
|
3469
3525
|
const domRef = (0, import_react9.useRef)(null);
|
|
3470
|
-
const stateRef = (0, import_react9.useRef)(state);
|
|
3471
3526
|
const active = props.activeRowIndex != null && brain.getRowCount() > props.activeRowIndex;
|
|
3472
|
-
const [
|
|
3527
|
+
const [_rerenderId, rerender] = useRerender();
|
|
3473
3528
|
(0, import_react9.useLayoutEffect)(() => {
|
|
3474
3529
|
if (props.activeRowIndex == null) {
|
|
3475
3530
|
return;
|
|
3476
3531
|
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3532
|
+
const rowIndex = props.activeRowIndex;
|
|
3533
|
+
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
3534
|
+
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
3535
|
+
const node = domRef.current;
|
|
3536
|
+
setInfiniteVarsOnNode({
|
|
3537
|
+
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
3538
|
+
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
3539
|
+
}, node);
|
|
3540
|
+
}, [props.activeRowIndex]);
|
|
3482
3541
|
(0, import_react9.useEffect)(() => {
|
|
3483
|
-
const removeOnScroll = brain.onScroll((
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3542
|
+
const removeOnScroll = brain.onScroll((scrollPosition) => {
|
|
3543
|
+
setInfiniteVarsOnNode({
|
|
3544
|
+
scrollTopForActiveRow: `${-scrollPosition.scrollTop}px`
|
|
3545
|
+
}, domRef.current);
|
|
3487
3546
|
});
|
|
3488
3547
|
const removeOnRenderCountChange = brain.onRenderCountChange(rerender);
|
|
3489
3548
|
return () => {
|
|
@@ -3498,10 +3557,7 @@ var ActiveRowIndicatorFn = (props) => {
|
|
|
3498
3557
|
ref: domRef,
|
|
3499
3558
|
"data-name": "active-row-indicator",
|
|
3500
3559
|
className: `${baseCls} ${active ? ActiveRowIndicatorCls.visible : ActiveRowIndicatorCls.hidden}`,
|
|
3501
|
-
style: active ?
|
|
3502
|
-
transform: `translate3d(0px, ${-brain.getScrollPosition().scrollTop + state.top}px,0)`,
|
|
3503
|
-
height: state.rowHeight
|
|
3504
|
-
} : void 0
|
|
3560
|
+
style: active ? ActiveStyle : void 0
|
|
3505
3561
|
}));
|
|
3506
3562
|
};
|
|
3507
3563
|
var ActiveRowIndicator = React10.memo(ActiveRowIndicatorFn);
|
|
@@ -3511,15 +3567,17 @@ var React11 = __toModule(require("react"));
|
|
|
3511
3567
|
var import_react10 = __toModule(require("react"));
|
|
3512
3568
|
var { rootClassName: rootClassName4 } = internalProps;
|
|
3513
3569
|
var baseCls2 = `${rootClassName4}-ActiveCellIndicator`;
|
|
3514
|
-
var
|
|
3515
|
-
|
|
3516
|
-
[stripVar(InternalVars.
|
|
3570
|
+
var columnZIndexAtIndex2 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
3571
|
+
var ActiveStyle2 = {
|
|
3572
|
+
[stripVar(InternalVars.activeCellOffsetX)]: InternalVars.activeCellColOffset,
|
|
3573
|
+
[stripVar(InternalVars.activeCellOffsetY)]: InternalVars.activeCellRowOffset,
|
|
3517
3574
|
transform: `translate3d(${InternalVars.activeCellOffsetX}, ${InternalVars.activeCellOffsetY}, 0px)`,
|
|
3518
3575
|
width: InternalVars.activeCellColWidth,
|
|
3519
3576
|
height: InternalVars.activeCellRowHeight
|
|
3520
3577
|
};
|
|
3521
3578
|
var ActiveCellIndicatorFn = (props) => {
|
|
3522
3579
|
const { brain } = props;
|
|
3580
|
+
const [_rerenderId, rerender] = useRerender();
|
|
3523
3581
|
const domRef = (0, import_react10.useRef)(null);
|
|
3524
3582
|
const active = props.activeCellIndex != null && brain.getRowCount() > props.activeCellIndex[0];
|
|
3525
3583
|
(0, import_react10.useLayoutEffect)(() => {
|
|
@@ -3530,33 +3588,30 @@ var ActiveCellIndicatorFn = (props) => {
|
|
|
3530
3588
|
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
3531
3589
|
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
3532
3590
|
const node = domRef.current;
|
|
3533
|
-
const scrollPosition = brain.getScrollPosition();
|
|
3534
3591
|
setInfiniteVarsOnNode({
|
|
3535
|
-
scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
|
|
3536
|
-
scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`,
|
|
3537
3592
|
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
3538
3593
|
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
3539
3594
|
}, node);
|
|
3540
3595
|
}, [props.activeCellIndex]);
|
|
3541
3596
|
(0, import_react10.useEffect)(() => {
|
|
3542
|
-
const
|
|
3543
|
-
|
|
3544
|
-
scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
|
|
3545
|
-
scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`
|
|
3546
|
-
}, domRef.current);
|
|
3597
|
+
const removeOnRenderCountChange = brain.onRenderCountChange(() => {
|
|
3598
|
+
rerender();
|
|
3547
3599
|
});
|
|
3548
3600
|
return () => {
|
|
3549
|
-
|
|
3601
|
+
removeOnRenderCountChange();
|
|
3550
3602
|
};
|
|
3551
3603
|
}, [brain]);
|
|
3552
3604
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
3553
3605
|
className: ActiveIndicatorWrapperCls,
|
|
3554
|
-
"data-name": "active-cell"
|
|
3606
|
+
"data-name": "active-cell",
|
|
3607
|
+
style: active ? {
|
|
3608
|
+
zIndex: `var(${columnZIndexAtIndex2}-${props.activeCellIndex[1]})`
|
|
3609
|
+
} : void 0
|
|
3555
3610
|
}, /* @__PURE__ */ React11.createElement("div", {
|
|
3556
3611
|
ref: domRef,
|
|
3557
3612
|
"data-name": "active-cell-indicator",
|
|
3558
3613
|
className: `${baseCls2} ${active ? ActiveCellIndicatorCls.visible : ActiveCellIndicatorCls.hidden}`,
|
|
3559
|
-
style: active ?
|
|
3614
|
+
style: active ? ActiveStyle2 : void 0
|
|
3560
3615
|
}));
|
|
3561
3616
|
};
|
|
3562
3617
|
var ActiveCellIndicator = React11.memo(ActiveCellIndicatorFn);
|
|
@@ -3656,12 +3711,12 @@ function HeadlessTable(props) {
|
|
|
3656
3711
|
renderCell,
|
|
3657
3712
|
brain,
|
|
3658
3713
|
cellHoverClassNames
|
|
3659
|
-
})), /* @__PURE__ */ React12.createElement(ActiveRowIndicator, {
|
|
3660
|
-
brain,
|
|
3661
|
-
activeRowIndex
|
|
3662
3714
|
}), /* @__PURE__ */ React12.createElement(ActiveCellIndicator, {
|
|
3663
3715
|
brain,
|
|
3664
3716
|
activeCellIndex
|
|
3717
|
+
})), /* @__PURE__ */ React12.createElement(ActiveRowIndicator, {
|
|
3718
|
+
brain,
|
|
3719
|
+
activeRowIndex
|
|
3665
3720
|
}), /* @__PURE__ */ React12.createElement(SpacePlaceholder, {
|
|
3666
3721
|
width: scrollSize.width,
|
|
3667
3722
|
height: scrollSize.height
|
|
@@ -3979,20 +4034,20 @@ var useInternalProps = () => {
|
|
|
3979
4034
|
};
|
|
3980
4035
|
|
|
3981
4036
|
// src/components/InfiniteTable/utilities.css.ts
|
|
3982
|
-
var alignItems = { center: "
|
|
3983
|
-
var cssEllipsisClassName = "
|
|
4037
|
+
var alignItems = { center: "_16lm1iw17", stretch: "_16lm1iw18" };
|
|
4038
|
+
var cssEllipsisClassName = "_16lm1iw1g _16lm1iw1h _16lm1iw1c";
|
|
3984
4039
|
var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
|
|
3985
|
-
var display = { flex: "
|
|
4040
|
+
var display = { flex: "_16lm1iwp", block: "_16lm1iwq", inlineBlock: "_16lm1iwr" };
|
|
3986
4041
|
var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
|
|
3987
|
-
var flexFlow = { column: "
|
|
3988
|
-
var justifyContent = { center: "
|
|
3989
|
-
var left = { "0": "
|
|
3990
|
-
var overflow = { hidden: "
|
|
4042
|
+
var flexFlow = { column: "_16lm1iw15", row: "_16lm1iw16" };
|
|
4043
|
+
var justifyContent = { center: "_16lm1iw19", start: "_16lm1iw1a", end: "_16lm1iw1b" };
|
|
4044
|
+
var left = { "0": "_16lm1iwz", "100%": "_16lm1iw10" };
|
|
4045
|
+
var overflow = { hidden: "_16lm1iw1c", auto: "_16lm1iw1d", visible: "_16lm1iw1e" };
|
|
3991
4046
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
3992
|
-
var top = { "0": "
|
|
4047
|
+
var top = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
|
|
3993
4048
|
var transformTranslateZero = "_16lm1iwa";
|
|
3994
|
-
var userSelect = { none: "
|
|
3995
|
-
var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm" };
|
|
4049
|
+
var userSelect = { none: "_16lm1iws" };
|
|
4050
|
+
var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm", "1000000": "_16lm1iwn", "10000000": "_16lm1iwo" };
|
|
3996
4051
|
|
|
3997
4052
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
3998
4053
|
var InfiniteTableBody = React14.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
@@ -4017,7 +4072,7 @@ var InfiniteTableFooter = React15.forwardRef(function InfiniteTableFooter2(props
|
|
|
4017
4072
|
|
|
4018
4073
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
4019
4074
|
var React22 = __toModule(require("react"));
|
|
4020
|
-
var
|
|
4075
|
+
var import_react23 = __toModule(require("react"));
|
|
4021
4076
|
var import_react_dom = __toModule(require("react-dom"));
|
|
4022
4077
|
|
|
4023
4078
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -4159,120 +4214,297 @@ var moveXatY = (arr, dragIndex, dropIndex) => {
|
|
|
4159
4214
|
return arr;
|
|
4160
4215
|
};
|
|
4161
4216
|
|
|
4217
|
+
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
4218
|
+
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4219
|
+
var FooterCls = "_16lm1iw1";
|
|
4220
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwp _16lm1iw15 _16lm1iw0";
|
|
4221
|
+
var InfiniteClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
|
|
4222
|
+
var InfiniteClsShiftingColumns = "_1yeub2vl";
|
|
4223
|
+
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4224
|
+
|
|
4225
|
+
// src/components/InfiniteTable/utils/rafFn.ts
|
|
4226
|
+
var rafFn = (fn) => {
|
|
4227
|
+
let rafId = 0;
|
|
4228
|
+
return (...args) => {
|
|
4229
|
+
if (rafId) {
|
|
4230
|
+
cancelAnimationFrame(rafId);
|
|
4231
|
+
}
|
|
4232
|
+
rafId = requestAnimationFrame(() => {
|
|
4233
|
+
rafId = 0;
|
|
4234
|
+
fn(...args);
|
|
4235
|
+
});
|
|
4236
|
+
};
|
|
4237
|
+
};
|
|
4238
|
+
|
|
4239
|
+
// src/components/InfiniteTable/hooks/useDOMProps.ts
|
|
4240
|
+
var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4241
|
+
var columnOffsetAtIndex3 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4242
|
+
var columnZIndexAtIndex3 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
4243
|
+
var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
|
|
4244
|
+
var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
|
|
4245
|
+
var baseZIndexForCells = stripVar(InternalVars.baseZIndexForCells);
|
|
4246
|
+
var computedVisibleColumnsCountCSSVar = stripVar(InternalVars.computedVisibleColumnsCount);
|
|
4247
|
+
function getColumnZIndex(col, params) {
|
|
4248
|
+
let computedZIndex = "auto";
|
|
4249
|
+
const index = col.computedVisibleIndex;
|
|
4250
|
+
if (col.computedPinned) {
|
|
4251
|
+
if (col.computedPinned === "start") {
|
|
4252
|
+
computedZIndex = params.pinnedStartColsCount - col.computedVisibleIndexInCategory;
|
|
4253
|
+
} else if (col.computedPinned === "end") {
|
|
4254
|
+
computedZIndex = params.visibleColsCount - col.computedVisibleIndexInCategory;
|
|
4255
|
+
}
|
|
4256
|
+
} else {
|
|
4257
|
+
computedZIndex = -index * 10;
|
|
4258
|
+
}
|
|
4259
|
+
const zIndexValue = typeof computedZIndex === "number" ? `calc( var(${baseZIndexForCells}) ` + (computedZIndex < 0 ? "-" : "+") + ` ${Math.abs(computedZIndex)} )` : "auto";
|
|
4260
|
+
return zIndexValue;
|
|
4261
|
+
}
|
|
4262
|
+
function useDOMProps(initialDOMProps) {
|
|
4263
|
+
const { computed, componentState, componentActions } = useInfiniteTable();
|
|
4264
|
+
const {
|
|
4265
|
+
focused,
|
|
4266
|
+
focusedWithin,
|
|
4267
|
+
domRef,
|
|
4268
|
+
onBlurWithin,
|
|
4269
|
+
onFocusWithin,
|
|
4270
|
+
onSelfFocus,
|
|
4271
|
+
onSelfBlur,
|
|
4272
|
+
activeCellIndex
|
|
4273
|
+
} = componentState;
|
|
4274
|
+
const {
|
|
4275
|
+
computedPinnedStartColumnsWidth,
|
|
4276
|
+
computedPinnedEndColumnsWidth,
|
|
4277
|
+
computedPinnedStartColumns,
|
|
4278
|
+
computedVisibleColumns
|
|
4279
|
+
} = computed;
|
|
4280
|
+
const cssVars = computedVisibleColumns.reduce((vars, col) => {
|
|
4281
|
+
const index = col.computedVisibleIndex;
|
|
4282
|
+
vars[`${columnWidthAtIndex2}-${index}`] = col.computedWidth + "px";
|
|
4283
|
+
vars[`${columnOffsetAtIndex3}-${index}`] = col.computedOffset + "px";
|
|
4284
|
+
const zIndexValue = getColumnZIndex(col, {
|
|
4285
|
+
pinnedStartColsCount: computedPinnedStartColumns.length,
|
|
4286
|
+
visibleColsCount: computedVisibleColumns.length
|
|
4287
|
+
});
|
|
4288
|
+
vars[`${columnZIndexAtIndex3}-${index}`] = `${zIndexValue}`;
|
|
4289
|
+
return vars;
|
|
4290
|
+
}, {});
|
|
4291
|
+
if (activeCellIndex != null) {
|
|
4292
|
+
cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
|
|
4293
|
+
cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
|
|
4294
|
+
}
|
|
4295
|
+
cssVars[computedVisibleColumnsCountCSSVar] = computedVisibleColumns.length;
|
|
4296
|
+
cssVars[baseZIndexForCells] = computedVisibleColumns.length * 10;
|
|
4297
|
+
const setFocused = rafFn((focused2) => {
|
|
4298
|
+
componentActions.focused = focused2;
|
|
4299
|
+
});
|
|
4300
|
+
const setFocusedWithin = rafFn((focused2) => {
|
|
4301
|
+
componentActions.focusedWithin = focused2;
|
|
4302
|
+
});
|
|
4303
|
+
const onFocus = (event) => {
|
|
4304
|
+
var _a;
|
|
4305
|
+
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
4306
|
+
if (event.target === domRef.current) {
|
|
4307
|
+
setFocused(true);
|
|
4308
|
+
onSelfFocus == null ? void 0 : onSelfFocus(event);
|
|
4309
|
+
if (focusedWithin) {
|
|
4310
|
+
setFocusedWithin(false);
|
|
4311
|
+
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
4312
|
+
}
|
|
4313
|
+
} else {
|
|
4314
|
+
if (!focusedWithin) {
|
|
4315
|
+
setFocusedWithin(true);
|
|
4316
|
+
onFocusWithin == null ? void 0 : onFocusWithin(event);
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
};
|
|
4320
|
+
const onBlur = (event) => {
|
|
4321
|
+
var _a, _b;
|
|
4322
|
+
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
4323
|
+
if (event.target === domRef.current) {
|
|
4324
|
+
setFocused(false);
|
|
4325
|
+
onSelfBlur == null ? void 0 : onSelfBlur(event);
|
|
4326
|
+
if (focusedWithin) {
|
|
4327
|
+
setFocusedWithin(false);
|
|
4328
|
+
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
4329
|
+
}
|
|
4330
|
+
} else {
|
|
4331
|
+
const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
|
|
4332
|
+
if (!contained) {
|
|
4333
|
+
setFocusedWithin(false);
|
|
4334
|
+
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
};
|
|
4338
|
+
const domProps = __spreadProps(__spreadValues({
|
|
4339
|
+
tabIndex: 0
|
|
4340
|
+
}, initialDOMProps), {
|
|
4341
|
+
onFocus,
|
|
4342
|
+
onBlur
|
|
4343
|
+
});
|
|
4344
|
+
const className = join(InfiniteTableClassName, InfiniteCls, domProps == null ? void 0 : domProps.className, computedPinnedStartColumnsWidth ? `${InfiniteTableClassName}--has-pinned-start` : null, computedPinnedEndColumnsWidth ? `${InfiniteTableClassName}--has-pinned-end` : null, focused ? `${InfiniteTableClassName}--focused` : null, focusedWithin ? `${InfiniteTableClassName}--focused-within` : null, focused && componentState.focusedClassName ? componentState.focusedClassName : null, focusedWithin && componentState.focusedWithinClassName ? componentState.focusedWithinClassName : null, computed.computedPinnedStartOverflow ? `${InfiniteTableClassName}--has-pinned-start-overflow` : null, computed.computedPinnedEndOverflow ? `${InfiniteTableClassName}--has-pinned-end-overflow` : null, InfiniteClsRecipe({
|
|
4345
|
+
hasPinnedStart: !!computedPinnedStartColumnsWidth,
|
|
4346
|
+
hasPinnedEnd: !!computedPinnedEndColumnsWidth,
|
|
4347
|
+
focused,
|
|
4348
|
+
focusedWithin
|
|
4349
|
+
}));
|
|
4350
|
+
domProps.className = className;
|
|
4351
|
+
domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
|
|
4352
|
+
if (focused) {
|
|
4353
|
+
if (componentState.focusedStyle) {
|
|
4354
|
+
Object.assign(domProps.style, componentState.focusedStyle);
|
|
4355
|
+
}
|
|
4356
|
+
}
|
|
4357
|
+
if (focusedWithin) {
|
|
4358
|
+
if (componentState.focusedWithinStyle) {
|
|
4359
|
+
Object.assign(domProps.style, componentState.focusedWithinStyle);
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
return domProps;
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4162
4365
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4366
|
+
var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4367
|
+
var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4368
|
+
var PROXY_OFFSET = 10;
|
|
4163
4369
|
var getBreakPoints = (columns) => {
|
|
4164
4370
|
return Array.from(columns.values()).map((c) => {
|
|
4165
4371
|
return {
|
|
4166
4372
|
columnId: c.id,
|
|
4167
4373
|
breakpoint: c.computedAbsoluteOffset + Math.round(c.computedWidth / 2)
|
|
4168
4374
|
};
|
|
4169
|
-
});
|
|
4375
|
+
}).filter(Boolean);
|
|
4170
4376
|
};
|
|
4171
4377
|
var useColumnPointerEvents = ({
|
|
4172
4378
|
columnId,
|
|
4173
4379
|
domRef,
|
|
4174
4380
|
columns,
|
|
4175
|
-
computedRemainingSpace
|
|
4381
|
+
computedRemainingSpace,
|
|
4382
|
+
pinnedStartColsCount,
|
|
4383
|
+
visibleColsCount
|
|
4176
4384
|
}) => {
|
|
4177
|
-
const [
|
|
4178
|
-
const
|
|
4179
|
-
const
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
const { componentActions, computed } = useInfiniteTable();
|
|
4385
|
+
const [proxyPosition, setProxyPosition] = (0, import_react17.useState)(null);
|
|
4386
|
+
const dragging = proxyPosition != null;
|
|
4387
|
+
const {
|
|
4388
|
+
componentActions,
|
|
4389
|
+
computed,
|
|
4390
|
+
componentState: { domRef: rootRef, brain }
|
|
4391
|
+
} = useInfiniteTable();
|
|
4185
4392
|
const { computedColumnOrder } = computed;
|
|
4186
4393
|
const column = (0, import_react17.useMemo)(() => columns.get(columnId), [columnId, columns]);
|
|
4187
|
-
const {
|
|
4394
|
+
const { dragColumnIndex, columnsArray } = (0, import_react17.useMemo)(() => {
|
|
4188
4395
|
const columnsArray2 = Array.from(columns.values());
|
|
4396
|
+
const columnIndex = columnsArray2.findIndex((c) => c.id === columnId);
|
|
4189
4397
|
return {
|
|
4190
4398
|
columnsArray: columnsArray2,
|
|
4191
|
-
|
|
4192
|
-
columnWidth: column.computedWidth
|
|
4399
|
+
dragColumnIndex: columnIndex,
|
|
4400
|
+
columnWidth: column.computedWidth,
|
|
4401
|
+
columnOffsetVar: `var(${columnOffsetAtIndex4}-${column.computedVisibleIndex})`
|
|
4193
4402
|
};
|
|
4194
4403
|
}, [columns, columnId, column]);
|
|
4195
|
-
let cursorRef = (0, import_react17.useRef)("auto");
|
|
4196
4404
|
const onPointerDown = (0, import_react17.useCallback)((e) => {
|
|
4405
|
+
var _a;
|
|
4406
|
+
let breakpoints = [];
|
|
4197
4407
|
const target = domRef.current;
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4408
|
+
const initialClientPos = {
|
|
4409
|
+
clientX: Math.round(e.clientX),
|
|
4410
|
+
clientY: Math.round(e.clientY)
|
|
4411
|
+
};
|
|
4412
|
+
const initialScrollPosition2 = brain.getScrollPosition();
|
|
4413
|
+
const initialProxyPosition = {
|
|
4414
|
+
left: PROXY_OFFSET - initialScrollPosition2.scrollLeft,
|
|
4415
|
+
top: PROXY_OFFSET
|
|
4416
|
+
};
|
|
4417
|
+
let currentClientPos = initialClientPos;
|
|
4418
|
+
let currentDiff = {
|
|
4419
|
+
x: 0,
|
|
4420
|
+
y: 0
|
|
4421
|
+
};
|
|
4422
|
+
function updateColumnOffsets(pos) {
|
|
4423
|
+
const clientX = Math.round(pos.clientX);
|
|
4424
|
+
const clientY = Math.round(pos.clientY);
|
|
4425
|
+
if (clientX === currentClientPos.clientX && clientY === currentClientPos.clientY) {
|
|
4426
|
+
return;
|
|
4427
|
+
}
|
|
4428
|
+
currentClientPos = { clientX, clientY };
|
|
4429
|
+
currentDiff.x = currentClientPos.clientX - initialClientPos.clientX;
|
|
4430
|
+
currentDiff.y = currentClientPos.clientY - initialClientPos.clientY;
|
|
4431
|
+
setProxyPosition({
|
|
4432
|
+
left: initialProxyPosition.left + currentDiff.x,
|
|
4433
|
+
top: initialProxyPosition.top + currentDiff.y
|
|
4434
|
+
});
|
|
4435
|
+
}
|
|
4436
|
+
updateColumnOffsets(initialClientPos);
|
|
4437
|
+
let initialCursor = (_a = target.style.cursor) != null ? _a : "auto";
|
|
4438
|
+
let didDragAtLeastOnce = false;
|
|
4439
|
+
let currentDropIndex = dragColumnIndex;
|
|
4204
4440
|
const onPointerMove = (e2) => {
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
top: e2.clientY - rect.y - 10
|
|
4213
|
-
});
|
|
4441
|
+
var _a2;
|
|
4442
|
+
if (!didDragAtLeastOnce) {
|
|
4443
|
+
didDragAtLeastOnce = true;
|
|
4444
|
+
componentActions.columnReorderInProgress = true;
|
|
4445
|
+
breakpoints = getBreakPoints(columns);
|
|
4446
|
+
setInfiniteColumnZIndex(dragColumnIndex, 1e6, rootRef.current);
|
|
4447
|
+
(_a2 = rootRef.current) == null ? void 0 : _a2.classList.add(InfiniteClsShiftingColumns);
|
|
4214
4448
|
target.style.cursor = "grabbing";
|
|
4215
4449
|
}
|
|
4216
|
-
|
|
4217
|
-
const
|
|
4450
|
+
updateColumnOffsets(e2);
|
|
4451
|
+
const diffX = currentDiff.x;
|
|
4218
4452
|
const dir = diffX < 0 ? -1 : 1;
|
|
4219
|
-
const columnPinned = column.computedPinned;
|
|
4220
4453
|
let currentPos = dir === -1 ? column.computedAbsoluteOffset + diffX : column.computedAbsoluteOffset + column.computedWidth + diffX;
|
|
4221
|
-
|
|
4222
|
-
let index = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
|
|
4454
|
+
let idx = (0, import_binary_search2.default)(breakpoints, currentPos, ({ breakpoint }, value) => {
|
|
4223
4455
|
return breakpoint < value ? -1 : breakpoint > value ? 1 : 0;
|
|
4224
4456
|
});
|
|
4225
|
-
if (
|
|
4226
|
-
|
|
4227
|
-
}
|
|
4228
|
-
if (
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
total -= shiftBy;
|
|
4457
|
+
if (idx < 0) {
|
|
4458
|
+
idx = ~idx;
|
|
4459
|
+
}
|
|
4460
|
+
if (idx !== currentDropIndex) {
|
|
4461
|
+
currentDropIndex = idx;
|
|
4462
|
+
if (dir === 1 && currentDropIndex === dragColumnIndex + 1) {
|
|
4463
|
+
currentDropIndex = dragColumnIndex;
|
|
4464
|
+
}
|
|
4465
|
+
columnsArray.forEach((col) => {
|
|
4466
|
+
const colIndex = col.computedVisibleIndex;
|
|
4467
|
+
if (dir === -1) {
|
|
4468
|
+
let newPosition = colIndex === dragColumnIndex ? `var(${columnOffsetAtIndex4}-${currentDropIndex})` : colIndex < currentDropIndex || colIndex > dragColumnIndex ? `var(${columnOffsetAtIndex4}-${colIndex})` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) + var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
|
|
4469
|
+
setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
|
|
4470
|
+
return;
|
|
4240
4471
|
}
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4472
|
+
if (dir === 1) {
|
|
4473
|
+
let newPosition = colIndex < dragColumnIndex || colIndex >= currentDropIndex ? `var(${columnOffsetAtIndex4}-${colIndex})` : colIndex === dragColumnIndex ? `calc( var(${columnOffsetAtIndex4}-${currentDropIndex - 1}) + var(${columnWidthAtIndex3}-${currentDropIndex - 1}) - var(${columnWidthAtIndex3}-${dragColumnIndex}) )` : `calc( var(${columnOffsetAtIndex4}-${colIndex}) - var(${columnWidthAtIndex3}-${dragColumnIndex}) )`;
|
|
4474
|
+
setInfiniteColumnOffsetWhileReordering(colIndex, newPosition, rootRef.current);
|
|
4475
|
+
return;
|
|
4245
4476
|
}
|
|
4246
|
-
}
|
|
4247
|
-
if (index !== columnIndex) {
|
|
4248
|
-
shifts[columnIndex] = total;
|
|
4249
|
-
}
|
|
4250
|
-
componentActions.columnShifts = shifts;
|
|
4251
|
-
componentActions.draggingColumnId = column.id;
|
|
4477
|
+
});
|
|
4252
4478
|
}
|
|
4253
|
-
setDraggingDiff({ left: diffX, top: diffY });
|
|
4254
4479
|
};
|
|
4255
4480
|
const onPointerUp = (e2) => {
|
|
4481
|
+
var _a2;
|
|
4256
4482
|
const target2 = domRef.current;
|
|
4257
|
-
|
|
4483
|
+
(_a2 = rootRef.current) == null ? void 0 : _a2.classList.remove(InfiniteClsShiftingColumns);
|
|
4484
|
+
columnsArray.forEach((col) => {
|
|
4485
|
+
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
4486
|
+
});
|
|
4487
|
+
setInfiniteColumnZIndex(dragColumnIndex, getColumnZIndex(column, {
|
|
4488
|
+
pinnedStartColsCount,
|
|
4489
|
+
visibleColsCount
|
|
4490
|
+
}), rootRef.current);
|
|
4491
|
+
target2.style.cursor = initialCursor;
|
|
4258
4492
|
target2.releasePointerCapture(e2.pointerId);
|
|
4259
4493
|
target2.removeEventListener("pointermove", onPointerMove);
|
|
4260
4494
|
target2.removeEventListener("pointerup", onPointerUp);
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
componentActions.draggingColumnId = null;
|
|
4264
|
-
if (!didDragRef.current && column.computedSortable) {
|
|
4495
|
+
setProxyPosition(null);
|
|
4496
|
+
if (!didDragAtLeastOnce && column.computedSortable) {
|
|
4265
4497
|
column.toggleSort();
|
|
4266
4498
|
}
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4499
|
+
if (currentDropIndex != null && currentDropIndex !== dragColumnIndex) {
|
|
4500
|
+
const newOrder = moveXatY(computedColumnOrder, dragColumnIndex, currentDropIndex > dragColumnIndex ? currentDropIndex - 1 : currentDropIndex);
|
|
4501
|
+
columnsArray.forEach((col) => {
|
|
4502
|
+
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
4503
|
+
});
|
|
4270
4504
|
componentActions.columnOrder = newOrder;
|
|
4271
4505
|
}
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
initialClientPos.current = null;
|
|
4275
|
-
currentDropIndexRef.current = null;
|
|
4506
|
+
componentActions.columnReorderInProgress = false;
|
|
4507
|
+
breakpoints = [];
|
|
4276
4508
|
};
|
|
4277
4509
|
target.addEventListener("pointermove", onPointerMove);
|
|
4278
4510
|
target.addEventListener("pointerup", onPointerUp);
|
|
@@ -4280,7 +4512,9 @@ var useColumnPointerEvents = ({
|
|
|
4280
4512
|
}, [
|
|
4281
4513
|
columns,
|
|
4282
4514
|
column,
|
|
4283
|
-
|
|
4515
|
+
dragColumnIndex,
|
|
4516
|
+
visibleColsCount,
|
|
4517
|
+
pinnedStartColsCount,
|
|
4284
4518
|
columnsArray,
|
|
4285
4519
|
computedRemainingSpace,
|
|
4286
4520
|
computedColumnOrder
|
|
@@ -4289,8 +4523,7 @@ var useColumnPointerEvents = ({
|
|
|
4289
4523
|
onPointerDown: column.computedDraggable ? onPointerDown : () => {
|
|
4290
4524
|
},
|
|
4291
4525
|
dragging,
|
|
4292
|
-
|
|
4293
|
-
draggingDiff: draggingDiff != null ? draggingDiff : { top: 0, left: 0 }
|
|
4526
|
+
proxyPosition
|
|
4294
4527
|
};
|
|
4295
4528
|
};
|
|
4296
4529
|
|
|
@@ -4341,20 +4574,20 @@ var React17 = __toModule(require("react"));
|
|
|
4341
4574
|
var import_react19 = __toModule(require("react"));
|
|
4342
4575
|
|
|
4343
4576
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
4344
|
-
var
|
|
4345
|
-
var CellCls = "_1eexc2a5
|
|
4346
|
-
var HeaderCellContentRecipe = (0,
|
|
4347
|
-
var HeaderCellProxy = "
|
|
4348
|
-
var HeaderCellRecipe = (0,
|
|
4349
|
-
var HeaderClsRecipe = (0,
|
|
4350
|
-
var HeaderFilterCls = "_12zfob11c
|
|
4351
|
-
var HeaderFilterEditorCls = "_16lm1iwu
|
|
4352
|
-
var HeaderGroupCls = "_12zfob11b
|
|
4353
|
-
var HeaderScrollbarPlaceholderCls = "
|
|
4577
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4578
|
+
var CellCls = "_1eexc2a5 _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw2 _16lm1iw1f _16lm1iw1g";
|
|
4579
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iwu _16lm1iww _16lm1iwp _16lm1iw16 _16lm1iw17", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4580
|
+
var HeaderCellProxy = "_12zfob1g _16lm1iw1g _16lm1iw1h _16lm1iw1c";
|
|
4581
|
+
var HeaderCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwq", variantClassNames: { rowActive: { false: "_12zfob1i", true: "_12zfob1j" }, zebra: { false: "_12zfob1k", even: "_12zfob1l", odd: "_12zfob1m" }, dragging: { true: "_12zfob1n", false: "_12zfob1o" }, first: { true: "_12zfob1p", false: "_12zfob1q" }, last: { true: "_12zfob1r", false: "_12zfob1s" }, groupByField: { true: "_12zfob1t", false: "_12zfob1u" }, firstInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, lastInCategory: { true: "_12zfob1x", false: "_12zfob1y" }, pinned: { start: "_12zfob1z", end: "_12zfob110", false: "_12zfob111" }, filtered: { true: "_12zfob112", false: "_12zfob113" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob114"], [{ pinned: "end", firstInCategory: true }, "_12zfob115"], [{ pinned: false, lastInCategory: true }, "_12zfob116"]] });
|
|
4582
|
+
var HeaderClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iwq _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, virtualized: { true: "_12zfob1a", false: "_12zfob1b" }, overflow: { true: "_12zfob1c", false: "_12zfob1d" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1e"], [{ overflow: true, pinned: "end" }, "_12zfob1f"]] });
|
|
4583
|
+
var HeaderFilterCls = "_12zfob11c _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw1";
|
|
4584
|
+
var HeaderFilterEditorCls = "_16lm1iww _16lm1iwu";
|
|
4585
|
+
var HeaderGroupCls = "_12zfob11b _16lm1iwp _16lm1iw16 _16lm1iw17";
|
|
4586
|
+
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
4354
4587
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
4355
|
-
var HeaderSortIconIndexCls = "
|
|
4356
|
-
var HeaderSortIconRecipe = (0,
|
|
4357
|
-
var HeaderWrapperCls = "_12zfob11a
|
|
4588
|
+
var HeaderSortIconIndexCls = "_12zfob14";
|
|
4589
|
+
var HeaderSortIconRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4590
|
+
var HeaderWrapperCls = "_12zfob11a _16lm1iw1c _16lm1iw1 _16lm1iwp _16lm1iw16";
|
|
4358
4591
|
|
|
4359
4592
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4360
4593
|
var defaultLineStyle = {
|
|
@@ -4430,25 +4663,16 @@ function SortIcon(props) {
|
|
|
4430
4663
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4431
4664
|
var React18 = __toModule(require("react"));
|
|
4432
4665
|
|
|
4433
|
-
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
4434
|
-
var import_react20 = __toModule(require("react"));
|
|
4435
|
-
var useInfiniteTableState = () => {
|
|
4436
|
-
const TableContext2 = getInfiniteTableContext();
|
|
4437
|
-
const { componentState } = (0, import_react20.useContext)(TableContext2);
|
|
4438
|
-
return componentState;
|
|
4439
|
-
};
|
|
4440
|
-
|
|
4441
4666
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
4442
|
-
var
|
|
4443
|
-
var
|
|
4444
|
-
var
|
|
4445
|
-
var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
|
|
4667
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4668
|
+
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwp _16lm1iw16 _16lm1iw17 _16lm1iw2 _16lm1iw1f _16lm1iw1g";
|
|
4669
|
+
var ColumnCellRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
|
|
4446
4670
|
|
|
4447
4671
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4448
4672
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
4449
4673
|
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
4450
4674
|
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
4451
|
-
var
|
|
4675
|
+
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4452
4676
|
function InfiniteTableCellFn(props) {
|
|
4453
4677
|
var _b, _c, _d;
|
|
4454
4678
|
const _a = props, {
|
|
@@ -4481,23 +4705,14 @@ function InfiniteTableCellFn(props) {
|
|
|
4481
4705
|
"renderChildren"
|
|
4482
4706
|
]);
|
|
4483
4707
|
const children = renderChildren();
|
|
4484
|
-
const { columnShifts } = useInfiniteTableState();
|
|
4485
|
-
const shifting = !!columnShifts;
|
|
4486
4708
|
const style = __spreadValues({
|
|
4487
|
-
width: `var(${
|
|
4709
|
+
width: `var(${columnWidthAtIndex4}-${column.computedVisibleIndex})`
|
|
4488
4710
|
}, domProps.style);
|
|
4489
|
-
if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
|
|
4490
|
-
const shiftLeft = columnShifts[column.computedVisibleIndex];
|
|
4491
|
-
if (virtualized) {
|
|
4492
|
-
style.left = shiftLeft;
|
|
4493
|
-
} else {
|
|
4494
|
-
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4495
|
-
}
|
|
4496
|
-
}
|
|
4497
4711
|
const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
|
|
4498
4712
|
style,
|
|
4499
4713
|
"data-column-id": column.id,
|
|
4500
|
-
|
|
4714
|
+
"data-z-index": style.zIndex,
|
|
4715
|
+
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
|
|
4501
4716
|
children: /* @__PURE__ */ React18.createElement(React18.Fragment, null, beforeChildren, /* @__PURE__ */ React18.createElement("div", {
|
|
4502
4717
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
4503
4718
|
style: contentStyle
|
|
@@ -4515,18 +4730,18 @@ var InfiniteTableCell = React18.memo(InfiniteTableCellFn);
|
|
|
4515
4730
|
|
|
4516
4731
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
|
|
4517
4732
|
var React19 = __toModule(require("react"));
|
|
4518
|
-
var
|
|
4733
|
+
var import_react20 = __toModule(require("react"));
|
|
4519
4734
|
var { rootClassName: rootClassName6 } = internalProps;
|
|
4520
4735
|
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
|
|
4521
4736
|
var stopPropagation = (e) => e.stopPropagation();
|
|
4522
4737
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
4523
4738
|
var _a, _b, _c, _d;
|
|
4524
|
-
const [theValue, setTheValue] = (0,
|
|
4739
|
+
const [theValue, setTheValue] = (0, import_react20.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
4525
4740
|
const onInputChange = (filterValue) => {
|
|
4526
4741
|
setTheValue(filterValue);
|
|
4527
4742
|
props.onChange(filterValue);
|
|
4528
4743
|
};
|
|
4529
|
-
(0,
|
|
4744
|
+
(0, import_react20.useEffect)(() => {
|
|
4530
4745
|
var _a2;
|
|
4531
4746
|
if (props.columnFilterValue) {
|
|
4532
4747
|
if (theValue !== props.columnFilterValue.filterValue) {
|
|
@@ -4571,7 +4786,7 @@ function InfiniteTableColumnHeaderFilterEmpty() {
|
|
|
4571
4786
|
|
|
4572
4787
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
4573
4788
|
var React21 = __toModule(require("react"));
|
|
4574
|
-
var
|
|
4789
|
+
var import_react22 = __toModule(require("react"));
|
|
4575
4790
|
|
|
4576
4791
|
// src/components/flexbox/index.ts
|
|
4577
4792
|
var computeFlex = (params) => {
|
|
@@ -4613,7 +4828,7 @@ var computeFlex = (params) => {
|
|
|
4613
4828
|
totalFlex += itemFlex != null ? itemFlex : 0;
|
|
4614
4829
|
totalFixedSize += (_e = item.size) != null ? _e : 0;
|
|
4615
4830
|
});
|
|
4616
|
-
let availableSizeForFlex = Math.max(availableSize - totalFixedSize, 0);
|
|
4831
|
+
let availableSizeForFlex = params.computeSpecialSpaceDistribution ? Math.max(availableSize, 0) : Math.max(availableSize - totalFixedSize, 0);
|
|
4617
4832
|
let sizePerFlex = availableSizeForFlex / totalFlex;
|
|
4618
4833
|
let maxxedFlexItems = {};
|
|
4619
4834
|
let minnedFlexItems = {};
|
|
@@ -4849,10 +5064,13 @@ var computeGroupResize = (params) => {
|
|
|
4849
5064
|
unresizableWidth += item.computedWidth;
|
|
4850
5065
|
}
|
|
4851
5066
|
return {
|
|
5067
|
+
maxSize: item.computedMaxWidth,
|
|
5068
|
+
minSize: item.computedMinWidth,
|
|
4852
5069
|
flex: item.resizable ? item.computedWidth : null,
|
|
4853
5070
|
size: 0
|
|
4854
5071
|
};
|
|
4855
5072
|
}),
|
|
5073
|
+
computeSpecialSpaceDistribution: true,
|
|
4856
5074
|
availableSize: Math.max(beforeSizes.reduce(sum, 0) + dragHandleOffset - unresizableWidth, 0)
|
|
4857
5075
|
});
|
|
4858
5076
|
const diffsForEachItem = beforeItems.map((item, index) => {
|
|
@@ -4907,7 +5125,7 @@ var computeGroupResize = (params) => {
|
|
|
4907
5125
|
};
|
|
4908
5126
|
|
|
4909
5127
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
4910
|
-
var
|
|
5128
|
+
var import_react21 = __toModule(require("react"));
|
|
4911
5129
|
|
|
4912
5130
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
|
|
4913
5131
|
function getColumnResizer(colIndex, {
|
|
@@ -4962,17 +5180,17 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
4962
5180
|
}
|
|
4963
5181
|
|
|
4964
5182
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
4965
|
-
var
|
|
4966
|
-
var ResizeHandleCls = "zneyzh0 _16lm1iw2
|
|
4967
|
-
var ResizeHandleDraggerClsRecipe = (0,
|
|
5183
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5184
|
+
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iwx _16lm1iw13 _16lm1iw11 _16lm1iwe";
|
|
5185
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "zneyzh1 _16lm1iw2 _16lm1iwx _16lm1iw11", variantClassNames: { constrained: { false: "zneyzh2", true: "zneyzh3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4968
5186
|
|
|
4969
5187
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
4970
5188
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
4971
5189
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
|
|
4972
5190
|
function ResizeHandleFn(props) {
|
|
4973
|
-
const domRef = (0,
|
|
4974
|
-
const [constrained, setConstrained] = (0,
|
|
4975
|
-
const constrainedRef = (0,
|
|
5191
|
+
const domRef = (0, import_react21.useRef)(null);
|
|
5192
|
+
const [constrained, setConstrained] = (0, import_react21.useState)(false);
|
|
5193
|
+
const constrainedRef = (0, import_react21.useRef)(constrained);
|
|
4976
5194
|
constrainedRef.current = constrained;
|
|
4977
5195
|
const onPointerDown = (e) => {
|
|
4978
5196
|
e.stopPropagation();
|
|
@@ -5011,38 +5229,37 @@ function ResizeHandleFn(props) {
|
|
|
5011
5229
|
target.addEventListener("pointermove", onPointerMove);
|
|
5012
5230
|
target.addEventListener("pointerup", onPointerUp);
|
|
5013
5231
|
};
|
|
5014
|
-
return /* @__PURE__ */
|
|
5232
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
5015
5233
|
ref: domRef,
|
|
5016
5234
|
className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls}`,
|
|
5017
5235
|
onPointerDown
|
|
5018
|
-
}, /* @__PURE__ */
|
|
5236
|
+
}, /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
5019
5237
|
className: ResizeHandleDraggerClsRecipe({
|
|
5020
5238
|
constrained
|
|
5021
5239
|
})
|
|
5022
5240
|
}));
|
|
5023
5241
|
}
|
|
5024
|
-
var ResizeHandle =
|
|
5242
|
+
var ResizeHandle = import_react21.default.memo(ResizeHandleFn);
|
|
5025
5243
|
|
|
5026
5244
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
5027
5245
|
function useColumnResizeHandle(column) {
|
|
5028
5246
|
const {
|
|
5029
5247
|
computed: { computedVisibleColumns },
|
|
5030
|
-
componentState: { domRef },
|
|
5031
5248
|
getState,
|
|
5032
5249
|
getComputed,
|
|
5033
5250
|
componentActions
|
|
5034
5251
|
} = useInfiniteTable();
|
|
5035
|
-
const computeResizeForDiff = (0,
|
|
5252
|
+
const computeResizeForDiff = (0, import_react22.useCallback)(({
|
|
5036
5253
|
diff,
|
|
5037
5254
|
shareSpaceOnResize
|
|
5038
5255
|
}) => {
|
|
5039
5256
|
const state = getState();
|
|
5040
|
-
const { columnSizing, viewportReservedWidth, bodySize
|
|
5257
|
+
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
5041
5258
|
const columns = getComputed().computedVisibleColumns;
|
|
5042
5259
|
let atLeastOneFlex = false;
|
|
5043
5260
|
const columnSizingWithFlex = columns.reduce((acc, col) => {
|
|
5044
5261
|
if (col.computedFlex) {
|
|
5045
|
-
acc[col.id] = { flex: col.computedWidth };
|
|
5262
|
+
acc[col.id] = __spreadProps(__spreadValues({}, columnSizing[col.id]), { flex: col.computedWidth });
|
|
5046
5263
|
atLeastOneFlex = true;
|
|
5047
5264
|
}
|
|
5048
5265
|
return acc;
|
|
@@ -5065,21 +5282,9 @@ function useColumnResizeHandle(column) {
|
|
|
5065
5282
|
};
|
|
5066
5283
|
})
|
|
5067
5284
|
});
|
|
5068
|
-
if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
|
|
5069
|
-
const activeColumn = columns[activeCellIndex[1]];
|
|
5070
|
-
const currentColumn = columns[column.computedVisibleIndex];
|
|
5071
|
-
if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
|
|
5072
|
-
setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
|
|
5073
|
-
} else if (activeColumn) {
|
|
5074
|
-
setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
|
|
5075
|
-
}
|
|
5076
|
-
if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
|
|
5077
|
-
setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
|
|
5078
|
-
}
|
|
5079
|
-
}
|
|
5080
5285
|
return result;
|
|
5081
|
-
}, []);
|
|
5082
|
-
const onColumnResize = (0,
|
|
5286
|
+
}, [column]);
|
|
5287
|
+
const onColumnResize = (0, import_react22.useCallback)(({
|
|
5083
5288
|
diff,
|
|
5084
5289
|
shareSpaceOnResize
|
|
5085
5290
|
}) => {
|
|
@@ -5091,7 +5296,7 @@ function useColumnResizeHandle(column) {
|
|
|
5091
5296
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
5092
5297
|
}
|
|
5093
5298
|
componentActions.columnSizing = columnSizing;
|
|
5094
|
-
}, []);
|
|
5299
|
+
}, [computeResizeForDiff]);
|
|
5095
5300
|
const resizeHandle = column.computedResizable ? /* @__PURE__ */ React21.createElement(ResizeHandle, {
|
|
5096
5301
|
columns: computedVisibleColumns,
|
|
5097
5302
|
columnIndex: column.computedVisibleIndex,
|
|
@@ -5105,6 +5310,8 @@ function useColumnResizeHandle(column) {
|
|
|
5105
5310
|
var InfiniteTableHeaderCellContext = React22.createContext(null);
|
|
5106
5311
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
5107
5312
|
var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
|
|
5313
|
+
var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5314
|
+
var columnOffsetAtIndex5 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
5108
5315
|
function InfiniteTableHeaderCell(props) {
|
|
5109
5316
|
var _a, _b, _c, _d, _e;
|
|
5110
5317
|
const column = props.column;
|
|
@@ -5112,7 +5319,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5112
5319
|
const { onResize, height, width, headerOptions } = props;
|
|
5113
5320
|
const sortInfo = column.computedSortInfo;
|
|
5114
5321
|
let header = column.header;
|
|
5115
|
-
const ref = (0,
|
|
5322
|
+
const ref = (0, import_react23.useCallback)((node) => {
|
|
5116
5323
|
var _a2;
|
|
5117
5324
|
domRef.current = node;
|
|
5118
5325
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
@@ -5143,12 +5350,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5143
5350
|
header = header != null ? header : column.name;
|
|
5144
5351
|
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
|
|
5145
5352
|
};
|
|
5146
|
-
const domRef = (0,
|
|
5353
|
+
const domRef = (0, import_react23.useRef)(null);
|
|
5147
5354
|
const {
|
|
5148
5355
|
computed: {
|
|
5149
5356
|
computedRemainingSpace,
|
|
5150
5357
|
showColumnFilters,
|
|
5151
|
-
computedVisibleColumns
|
|
5358
|
+
computedVisibleColumns,
|
|
5359
|
+
computedPinnedStartColumns
|
|
5152
5360
|
},
|
|
5153
5361
|
componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
|
|
5154
5362
|
} = useInfiniteTable();
|
|
@@ -5157,7 +5365,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5157
5365
|
getState: getDataSourceState,
|
|
5158
5366
|
componentState: { filterDelay, filterTypes }
|
|
5159
5367
|
} = useDataSourceContextValue();
|
|
5160
|
-
(0,
|
|
5368
|
+
(0, import_react23.useEffect)(() => {
|
|
5161
5369
|
let clearOnResize = null;
|
|
5162
5370
|
const node = domRef.current;
|
|
5163
5371
|
if (onResize && node) {
|
|
@@ -5170,7 +5378,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5170
5378
|
const style = {
|
|
5171
5379
|
height
|
|
5172
5380
|
};
|
|
5173
|
-
const { onPointerDown, dragging,
|
|
5381
|
+
const { onPointerDown, dragging, proxyPosition } = useColumnPointerEvents({
|
|
5382
|
+
pinnedStartColsCount: computedPinnedStartColumns.length,
|
|
5383
|
+
visibleColsCount: computedVisibleColumns.length,
|
|
5174
5384
|
computedRemainingSpace,
|
|
5175
5385
|
columnId: column.id,
|
|
5176
5386
|
domRef,
|
|
@@ -5184,9 +5394,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5184
5394
|
position: "absolute",
|
|
5185
5395
|
height,
|
|
5186
5396
|
width,
|
|
5187
|
-
left: column.
|
|
5188
|
-
top: (
|
|
5189
|
-
zIndex:
|
|
5397
|
+
left: `calc( var(${columnOffsetAtIndex5}-${column.computedVisibleIndex}) + ${(_a = proxyPosition.left) != null ? _a : 0}px)`,
|
|
5398
|
+
top: (_b = proxyPosition.top) != null ? _b : 0,
|
|
5399
|
+
zIndex: 1e9
|
|
5190
5400
|
}
|
|
5191
5401
|
}, header);
|
|
5192
5402
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
@@ -5195,7 +5405,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5195
5405
|
const contentRecipeVariants = {
|
|
5196
5406
|
filtered: column.computedFiltered
|
|
5197
5407
|
};
|
|
5198
|
-
const setFilterValue = (0,
|
|
5408
|
+
const setFilterValue = (0, import_react23.useCallback)((filterValue) => {
|
|
5199
5409
|
var _a2;
|
|
5200
5410
|
const state = getDataSourceState();
|
|
5201
5411
|
let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
|
|
@@ -5257,6 +5467,8 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5257
5467
|
const filterType = column.computedFilterType;
|
|
5258
5468
|
const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
|
|
5259
5469
|
const resizeHandle = useColumnResizeHandle(column);
|
|
5470
|
+
const zIndex2 = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5471
|
+
style.zIndex = zIndex2;
|
|
5260
5472
|
return /* @__PURE__ */ React22.createElement(ContextProvider, {
|
|
5261
5473
|
value: renderParam
|
|
5262
5474
|
}, /* @__PURE__ */ React22.createElement(InfiniteTableCell, {
|
|
@@ -5265,7 +5477,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5265
5477
|
column,
|
|
5266
5478
|
"data-name": `HeaderCell`,
|
|
5267
5479
|
"data-column-id": column.id,
|
|
5268
|
-
"data-z-index":
|
|
5480
|
+
"data-z-index": zIndex2,
|
|
5269
5481
|
style,
|
|
5270
5482
|
width,
|
|
5271
5483
|
onPointerDown,
|
|
@@ -5286,7 +5498,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5286
5498
|
}), draggingProxy);
|
|
5287
5499
|
}
|
|
5288
5500
|
function useInfiniteHeaderCell() {
|
|
5289
|
-
const result = (0,
|
|
5501
|
+
const result = (0, import_react23.useContext)(InfiniteTableHeaderCellContext);
|
|
5290
5502
|
return result;
|
|
5291
5503
|
}
|
|
5292
5504
|
|
|
@@ -5414,23 +5626,23 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
5414
5626
|
|
|
5415
5627
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5416
5628
|
var React26 = __toModule(require("react"));
|
|
5417
|
-
var
|
|
5629
|
+
var import_react26 = __toModule(require("react"));
|
|
5418
5630
|
|
|
5419
5631
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5420
5632
|
var React25 = __toModule(require("react"));
|
|
5421
5633
|
|
|
5422
5634
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
5423
5635
|
var React24 = __toModule(require("react"));
|
|
5424
|
-
var
|
|
5636
|
+
var import_react25 = __toModule(require("react"));
|
|
5425
5637
|
|
|
5426
5638
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
5427
|
-
var
|
|
5639
|
+
var import_react24 = __toModule(require("react"));
|
|
5428
5640
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
5429
5641
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
|
|
5430
5642
|
function GroupResizeHandleFn(props) {
|
|
5431
|
-
const domRef = (0,
|
|
5432
|
-
const [constrained, setConstrained] = (0,
|
|
5433
|
-
const constrainedRef = (0,
|
|
5643
|
+
const domRef = (0, import_react24.useRef)(null);
|
|
5644
|
+
const [constrained, setConstrained] = (0, import_react24.useState)(false);
|
|
5645
|
+
const constrainedRef = (0, import_react24.useRef)(constrained);
|
|
5434
5646
|
constrainedRef.current = constrained;
|
|
5435
5647
|
const onPointerDown = (e) => {
|
|
5436
5648
|
e.stopPropagation();
|
|
@@ -5477,18 +5689,18 @@ function GroupResizeHandleFn(props) {
|
|
|
5477
5689
|
target.addEventListener("pointermove", onPointerMove);
|
|
5478
5690
|
target.addEventListener("pointerup", onPointerUp);
|
|
5479
5691
|
};
|
|
5480
|
-
return /* @__PURE__ */
|
|
5692
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
5481
5693
|
ref: domRef,
|
|
5482
5694
|
className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls}`,
|
|
5483
5695
|
onPointerDown
|
|
5484
|
-
}, /* @__PURE__ */
|
|
5696
|
+
}, /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
5485
5697
|
style: props.style,
|
|
5486
5698
|
className: ResizeHandleDraggerClsRecipe({
|
|
5487
5699
|
constrained
|
|
5488
5700
|
})
|
|
5489
5701
|
}));
|
|
5490
5702
|
}
|
|
5491
|
-
var GroupResizeHandle =
|
|
5703
|
+
var GroupResizeHandle = import_react24.default.memo(GroupResizeHandleFn);
|
|
5492
5704
|
|
|
5493
5705
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
5494
5706
|
function useColumnGroupResizeHandle(groupColumns, config) {
|
|
@@ -5500,14 +5712,14 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5500
5712
|
componentActions
|
|
5501
5713
|
} = useInfiniteTable();
|
|
5502
5714
|
const lastColumnInGroup = groupColumns[groupColumns.length - 1];
|
|
5503
|
-
const computeResizeForDiff = (0,
|
|
5715
|
+
const computeResizeForDiff = (0, import_react25.useCallback)((diff) => {
|
|
5504
5716
|
const state = getState();
|
|
5505
5717
|
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
5506
5718
|
const columns = getComputed().computedVisibleColumns;
|
|
5507
5719
|
let atLeastOneFlex = false;
|
|
5508
5720
|
const columnSizingWithFlex = columns.reduce((acc, col) => {
|
|
5509
5721
|
if (col.computedFlex) {
|
|
5510
|
-
acc[col.id] = { flex: col.computedWidth };
|
|
5722
|
+
acc[col.id] = __spreadProps(__spreadValues({}, columnSizing[col.id]), { flex: col.computedWidth });
|
|
5511
5723
|
atLeastOneFlex = true;
|
|
5512
5724
|
}
|
|
5513
5725
|
return acc;
|
|
@@ -5533,7 +5745,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5533
5745
|
});
|
|
5534
5746
|
return result;
|
|
5535
5747
|
}, []);
|
|
5536
|
-
const onColumnResize = (0,
|
|
5748
|
+
const onColumnResize = (0, import_react25.useCallback)((diff) => {
|
|
5537
5749
|
const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
|
|
5538
5750
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
5539
5751
|
componentActions.columnSizing = columnSizing;
|
|
@@ -5554,7 +5766,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5554
5766
|
|
|
5555
5767
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5556
5768
|
var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
5557
|
-
var
|
|
5769
|
+
var columnWidthAtIndex5 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5558
5770
|
function InfiniteTableHeaderGroup(props) {
|
|
5559
5771
|
const {
|
|
5560
5772
|
computed: { computedVisibleColumns }
|
|
@@ -5573,7 +5785,7 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5573
5785
|
columnGroupsMaxDepth
|
|
5574
5786
|
});
|
|
5575
5787
|
const firstColumn = columns[0];
|
|
5576
|
-
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${
|
|
5788
|
+
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
|
|
5577
5789
|
const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
|
|
5578
5790
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
5579
5791
|
ref: props.domRef,
|
|
@@ -5605,7 +5817,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5605
5817
|
componentState: { headerBrain, headerOptions }
|
|
5606
5818
|
} = useInfiniteTable();
|
|
5607
5819
|
const { computedVisibleColumnsMap, showColumnFilters } = computed;
|
|
5608
|
-
(0,
|
|
5820
|
+
(0, import_react26.useEffect)(() => {
|
|
5609
5821
|
const onScroll = (scrollPosition) => {
|
|
5610
5822
|
if (domRef.current) {
|
|
5611
5823
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -5614,7 +5826,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5614
5826
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
5615
5827
|
return removeOnScroll;
|
|
5616
5828
|
}, [brain]);
|
|
5617
|
-
const domRef = (0,
|
|
5829
|
+
const domRef = (0, import_react26.useRef)(null);
|
|
5618
5830
|
const headerCls = HeaderClsRecipe({
|
|
5619
5831
|
overflow: false,
|
|
5620
5832
|
virtualized: true
|
|
@@ -5624,7 +5836,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5624
5836
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
5625
5837
|
style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
|
|
5626
5838
|
};
|
|
5627
|
-
const renderCell = (0,
|
|
5839
|
+
const renderCell = (0, import_react26.useCallback)((params) => {
|
|
5628
5840
|
const {
|
|
5629
5841
|
rowIndex,
|
|
5630
5842
|
colIndex,
|
|
@@ -5786,7 +5998,7 @@ function TableHeaderWrapper(props) {
|
|
|
5786
5998
|
|
|
5787
5999
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
5788
6000
|
var React28 = __toModule(require("react"));
|
|
5789
|
-
var
|
|
6001
|
+
var import_react27 = __toModule(require("react"));
|
|
5790
6002
|
|
|
5791
6003
|
// src/components/utils/decamelize.ts
|
|
5792
6004
|
function decamelize(str, options) {
|
|
@@ -5794,14 +6006,6 @@ function decamelize(str, options) {
|
|
|
5794
6006
|
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();
|
|
5795
6007
|
}
|
|
5796
6008
|
|
|
5797
|
-
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5798
|
-
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5799
|
-
var FooterCls = "_16lm1iw1";
|
|
5800
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
|
|
5801
|
-
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"]] });
|
|
5802
|
-
var InfiniteClsShiftingColumns = "_16lm1iwq";
|
|
5803
|
-
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5804
|
-
|
|
5805
6009
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
5806
6010
|
var defaultStyle = {
|
|
5807
6011
|
padding: ThemeVars.spacing[2],
|
|
@@ -5843,7 +6047,7 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
|
|
|
5843
6047
|
ref.current = node;
|
|
5844
6048
|
}
|
|
5845
6049
|
}, []);
|
|
5846
|
-
(0,
|
|
6050
|
+
(0, import_react27.useEffect)(() => {
|
|
5847
6051
|
const forceStyle = () => {
|
|
5848
6052
|
requestAnimationFrame(() => {
|
|
5849
6053
|
var _a;
|
|
@@ -5872,8 +6076,9 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
|
|
|
5872
6076
|
|
|
5873
6077
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5874
6078
|
var React29 = __toModule(require("react"));
|
|
5875
|
-
var
|
|
6079
|
+
var import_react28 = __toModule(require("react"));
|
|
5876
6080
|
var { rootClassName: rootClassName11 } = internalProps;
|
|
6081
|
+
var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5877
6082
|
var InfiniteTableColumnCellContext = React29.createContext(null);
|
|
5878
6083
|
var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
|
|
5879
6084
|
function isColumnWithField(c) {
|
|
@@ -5930,7 +6135,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5930
6135
|
value
|
|
5931
6136
|
});
|
|
5932
6137
|
}
|
|
5933
|
-
const onClick = (0,
|
|
6138
|
+
const onClick = (0, import_react28.useCallback)(() => {
|
|
5934
6139
|
if (keyboardNavigation === "row") {
|
|
5935
6140
|
componentActions.activeRowIndex = rowIndex;
|
|
5936
6141
|
return;
|
|
@@ -5970,7 +6175,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5970
6175
|
isGroupRow,
|
|
5971
6176
|
rowIndex,
|
|
5972
6177
|
toggleGroupRow,
|
|
5973
|
-
toggleCurrentGroupRow: (0,
|
|
6178
|
+
toggleCurrentGroupRow: (0, import_react28.useCallback)(() => {
|
|
5974
6179
|
if (!rowInfo.isGroupRow) {
|
|
5975
6180
|
return;
|
|
5976
6181
|
}
|
|
@@ -5979,7 +6184,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5979
6184
|
groupBy: computedDataSource.groupBy,
|
|
5980
6185
|
pivotBy: computedDataSource.pivotBy
|
|
5981
6186
|
});
|
|
5982
|
-
const renderChildren = (0,
|
|
6187
|
+
const renderChildren = (0, import_react28.useCallback)(() => {
|
|
5983
6188
|
if (hidden) {
|
|
5984
6189
|
return null;
|
|
5985
6190
|
}
|
|
@@ -6003,7 +6208,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6003
6208
|
}
|
|
6004
6209
|
style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
|
|
6005
6210
|
style.height = rowHeight;
|
|
6006
|
-
|
|
6211
|
+
style.zIndex = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
6212
|
+
const memoizedStyle = (0, import_react28.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
|
|
6007
6213
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
6008
6214
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
6009
6215
|
const cellProps = {
|
|
@@ -6026,7 +6232,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6026
6232
|
}
|
|
6027
6233
|
var InfiniteTableColumnCell = React29.memo(InfiniteTableColumnCellFn);
|
|
6028
6234
|
function useInfiniteColumnCell() {
|
|
6029
|
-
const result = (0,
|
|
6235
|
+
const result = (0, import_react28.useContext)(InfiniteTableColumnCellContext);
|
|
6030
6236
|
return result;
|
|
6031
6237
|
}
|
|
6032
6238
|
|
|
@@ -6040,8 +6246,8 @@ var RowHoverCls = "_7pupv01";
|
|
|
6040
6246
|
var React30 = __toModule(require("react"));
|
|
6041
6247
|
|
|
6042
6248
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
6043
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
6044
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
6249
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11" };
|
|
6250
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11";
|
|
6045
6251
|
var LoadMaskTextCls = "qy58ya4";
|
|
6046
6252
|
|
|
6047
6253
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -6073,24 +6279,40 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6073
6279
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
6074
6280
|
const state = getState();
|
|
6075
6281
|
const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6282
|
+
if (!scrollPosition) {
|
|
6283
|
+
return false;
|
|
6284
|
+
}
|
|
6076
6285
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6286
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6287
|
+
if (scrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6288
|
+
return false;
|
|
6289
|
+
}
|
|
6077
6290
|
if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6078
6291
|
state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
|
|
6079
6292
|
}
|
|
6293
|
+
return true;
|
|
6080
6294
|
},
|
|
6081
6295
|
scrollColumnIntoView(colId, config = { offset: 0 }) {
|
|
6082
6296
|
const state = getState();
|
|
6083
6297
|
const computed = getComputed();
|
|
6084
6298
|
const computedColumn = computed.computedVisibleColumnsMap.get(colId);
|
|
6085
6299
|
if (!computedColumn) {
|
|
6086
|
-
return;
|
|
6300
|
+
return false;
|
|
6087
6301
|
}
|
|
6088
6302
|
const colIndex = computedColumn.computedVisibleIndex;
|
|
6089
6303
|
const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6304
|
+
if (!scrollPosition) {
|
|
6305
|
+
return false;
|
|
6306
|
+
}
|
|
6090
6307
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6308
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6309
|
+
if (scrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6310
|
+
return false;
|
|
6311
|
+
}
|
|
6091
6312
|
if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6092
6313
|
state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
|
|
6093
6314
|
}
|
|
6315
|
+
return true;
|
|
6094
6316
|
},
|
|
6095
6317
|
scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
|
|
6096
6318
|
const state = getState();
|
|
@@ -6099,30 +6321,45 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6099
6321
|
if (typeof colIdOrIndex === "string") {
|
|
6100
6322
|
const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
|
|
6101
6323
|
if (!computedColumn) {
|
|
6102
|
-
return;
|
|
6324
|
+
return false;
|
|
6103
6325
|
}
|
|
6104
6326
|
colIndex = computedColumn.computedVisibleIndex;
|
|
6105
6327
|
}
|
|
6106
6328
|
const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6107
6329
|
const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6330
|
+
if (!scrollPositionForCol || !scrollPositionForRow) {
|
|
6331
|
+
return false;
|
|
6332
|
+
}
|
|
6108
6333
|
const newScrollPosition = {
|
|
6109
6334
|
scrollLeft: scrollPositionForCol.scrollLeft,
|
|
6110
6335
|
scrollTop: scrollPositionForRow.scrollTop
|
|
6111
6336
|
};
|
|
6112
6337
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6338
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6339
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6340
|
+
if (newScrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6341
|
+
return false;
|
|
6342
|
+
}
|
|
6343
|
+
if (newScrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6344
|
+
return false;
|
|
6345
|
+
}
|
|
6113
6346
|
if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6114
6347
|
state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
|
|
6115
6348
|
}
|
|
6116
6349
|
if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6117
6350
|
state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
|
|
6118
6351
|
}
|
|
6352
|
+
return true;
|
|
6119
6353
|
}
|
|
6120
6354
|
};
|
|
6355
|
+
if (false) {
|
|
6356
|
+
globalThis.imperativeApi = imperativeApi;
|
|
6357
|
+
}
|
|
6121
6358
|
return imperativeApi;
|
|
6122
6359
|
}
|
|
6123
6360
|
|
|
6124
6361
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
6125
|
-
var
|
|
6362
|
+
var import_react29 = __toModule(require("react"));
|
|
6126
6363
|
var OFFSET = 10;
|
|
6127
6364
|
function getColumnContentMaxWidths(domRef, options) {
|
|
6128
6365
|
var _a;
|
|
@@ -6188,11 +6425,11 @@ function useAutoSizeColumns() {
|
|
|
6188
6425
|
componentActions,
|
|
6189
6426
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
6190
6427
|
} = useComponentState();
|
|
6191
|
-
const [refreshId, setRefreshId] = (0,
|
|
6428
|
+
const [refreshId, setRefreshId] = (0, import_react29.useState)(0);
|
|
6192
6429
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
6193
6430
|
const getTheKey = useLatest(theKey);
|
|
6194
|
-
const lastExecutedIdentifierRef = (0,
|
|
6195
|
-
(0,
|
|
6431
|
+
const lastExecutedIdentifierRef = (0, import_react29.useRef)(null);
|
|
6432
|
+
(0, import_react29.useEffect)(() => {
|
|
6196
6433
|
const key = getTheKey();
|
|
6197
6434
|
if (key == null) {
|
|
6198
6435
|
return;
|
|
@@ -6205,7 +6442,7 @@ function useAutoSizeColumns() {
|
|
|
6205
6442
|
};
|
|
6206
6443
|
return brain.onRenderRangeChange(onChange);
|
|
6207
6444
|
}, [brain]);
|
|
6208
|
-
(0,
|
|
6445
|
+
(0, import_react29.useEffect)(() => {
|
|
6209
6446
|
var _a;
|
|
6210
6447
|
if (theKey == null) {
|
|
6211
6448
|
return;
|
|
@@ -6250,8 +6487,8 @@ function useAutoSizeColumns() {
|
|
|
6250
6487
|
}
|
|
6251
6488
|
|
|
6252
6489
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
6490
|
+
var import_react30 = __toModule(require("react"));
|
|
6253
6491
|
var import_react31 = __toModule(require("react"));
|
|
6254
|
-
var import_react32 = __toModule(require("react"));
|
|
6255
6492
|
|
|
6256
6493
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
6257
6494
|
function useYourBrain(param) {
|
|
@@ -6321,13 +6558,13 @@ function useCellRendering(param) {
|
|
|
6321
6558
|
bodySize,
|
|
6322
6559
|
rowspan
|
|
6323
6560
|
});
|
|
6324
|
-
const scrollTopMaxRef = (0,
|
|
6325
|
-
(0,
|
|
6561
|
+
const scrollTopMaxRef = (0, import_react30.useRef)(0);
|
|
6562
|
+
(0, import_react30.useEffect)(() => {
|
|
6326
6563
|
return brain.onRenderCountChange(() => {
|
|
6327
6564
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
6328
6565
|
});
|
|
6329
6566
|
}, [brain]);
|
|
6330
|
-
(0,
|
|
6567
|
+
(0, import_react30.useEffect)(() => {
|
|
6331
6568
|
return brain.onScrollStop((scrollPosition) => {
|
|
6332
6569
|
const { scrollTop } = scrollPosition;
|
|
6333
6570
|
if (scrollTop === 0) {
|
|
@@ -6344,7 +6581,7 @@ function useCellRendering(param) {
|
|
|
6344
6581
|
}
|
|
6345
6582
|
});
|
|
6346
6583
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
6347
|
-
(0,
|
|
6584
|
+
(0, import_react30.useEffect)(() => {
|
|
6348
6585
|
if (!bodySize.height) {
|
|
6349
6586
|
return;
|
|
6350
6587
|
}
|
|
@@ -6355,10 +6592,10 @@ function useCellRendering(param) {
|
|
|
6355
6592
|
}
|
|
6356
6593
|
}, [!!bodySize.height]);
|
|
6357
6594
|
const [, rerender] = useRerender();
|
|
6358
|
-
(0,
|
|
6595
|
+
(0, import_react30.useEffect)(() => {
|
|
6359
6596
|
rerender();
|
|
6360
6597
|
}, [dataSourceState]);
|
|
6361
|
-
const renderCell = (0,
|
|
6598
|
+
const renderCell = (0, import_react30.useCallback)((params) => {
|
|
6362
6599
|
const {
|
|
6363
6600
|
rowIndex,
|
|
6364
6601
|
colIndex,
|
|
@@ -6393,7 +6630,7 @@ function useCellRendering(param) {
|
|
|
6393
6630
|
rowStyle,
|
|
6394
6631
|
rowClassName
|
|
6395
6632
|
};
|
|
6396
|
-
return /* @__PURE__ */
|
|
6633
|
+
return /* @__PURE__ */ import_react31.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
6397
6634
|
}, [
|
|
6398
6635
|
rowHeight,
|
|
6399
6636
|
getData,
|
|
@@ -6411,13 +6648,13 @@ function useCellRendering(param) {
|
|
|
6411
6648
|
}
|
|
6412
6649
|
|
|
6413
6650
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
6414
|
-
var
|
|
6651
|
+
var import_react45 = __toModule(require("react"));
|
|
6415
6652
|
|
|
6416
6653
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6417
|
-
var
|
|
6654
|
+
var import_react33 = __toModule(require("react"));
|
|
6418
6655
|
|
|
6419
6656
|
// src/components/hooks/useInterceptedMap.ts
|
|
6420
|
-
var
|
|
6657
|
+
var import_react32 = __toModule(require("react"));
|
|
6421
6658
|
function interceptMap(map2, fns) {
|
|
6422
6659
|
const { set, delete: deleteKey, clear } = map2;
|
|
6423
6660
|
if (fns.set) {
|
|
@@ -6481,20 +6718,6 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
6481
6718
|
return map2;
|
|
6482
6719
|
}
|
|
6483
6720
|
|
|
6484
|
-
// src/components/InfiniteTable/utils/rafFn.ts
|
|
6485
|
-
var rafFn = (fn) => {
|
|
6486
|
-
let rafId = 0;
|
|
6487
|
-
return (...args) => {
|
|
6488
|
-
if (rafId) {
|
|
6489
|
-
cancelAnimationFrame(rafId);
|
|
6490
|
-
}
|
|
6491
|
-
rafId = requestAnimationFrame(() => {
|
|
6492
|
-
rafId = 0;
|
|
6493
|
-
fn(...args);
|
|
6494
|
-
});
|
|
6495
|
-
};
|
|
6496
|
-
};
|
|
6497
|
-
|
|
6498
6721
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6499
6722
|
function useColumnGroups() {
|
|
6500
6723
|
const {
|
|
@@ -6505,7 +6728,7 @@ function useColumnGroups() {
|
|
|
6505
6728
|
componentActions,
|
|
6506
6729
|
getComponentState
|
|
6507
6730
|
} = useComponentState();
|
|
6508
|
-
(0,
|
|
6731
|
+
(0, import_react33.useEffect)(() => {
|
|
6509
6732
|
const recompute = () => {
|
|
6510
6733
|
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
6511
6734
|
};
|
|
@@ -6516,7 +6739,7 @@ function useColumnGroups() {
|
|
|
6516
6739
|
set: update
|
|
6517
6740
|
});
|
|
6518
6741
|
}, [computedColumnGroups]);
|
|
6519
|
-
(0,
|
|
6742
|
+
(0, import_react33.useEffect)(() => {
|
|
6520
6743
|
return interceptMap(collapsedColumnGroups, {
|
|
6521
6744
|
set: (key, visibleCol) => {
|
|
6522
6745
|
const colIds = key.slice(1);
|
|
@@ -6551,10 +6774,10 @@ function useColumnGroups() {
|
|
|
6551
6774
|
}
|
|
6552
6775
|
|
|
6553
6776
|
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
6554
|
-
var
|
|
6777
|
+
var import_react34 = __toModule(require("react"));
|
|
6555
6778
|
function useColumnRowspan(computedVisibleColumns) {
|
|
6556
6779
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
6557
|
-
const rowspan = (0,
|
|
6780
|
+
const rowspan = (0, import_react34.useMemo)(() => {
|
|
6558
6781
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
6559
6782
|
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
6560
6783
|
const dataArray = getDataSourceState().dataArray;
|
|
@@ -6580,10 +6803,10 @@ function useColumnRowspan(computedVisibleColumns) {
|
|
|
6580
6803
|
}
|
|
6581
6804
|
|
|
6582
6805
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
6583
|
-
var
|
|
6806
|
+
var import_react35 = __toModule(require("react"));
|
|
6584
6807
|
var debug4 = dbg("useColumnSizeFn");
|
|
6585
6808
|
function useColumnSizeFn(columns) {
|
|
6586
|
-
const columnSize = (0,
|
|
6809
|
+
const columnSize = (0, import_react35.useCallback)((index) => {
|
|
6587
6810
|
const column = columns[index];
|
|
6588
6811
|
if (false) {
|
|
6589
6812
|
debug4("cannot find column at index", index, columns);
|
|
@@ -6594,7 +6817,7 @@ function useColumnSizeFn(columns) {
|
|
|
6594
6817
|
}
|
|
6595
6818
|
|
|
6596
6819
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
6597
|
-
var
|
|
6820
|
+
var import_react41 = __toModule(require("react"));
|
|
6598
6821
|
|
|
6599
6822
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
6600
6823
|
var React34 = __toModule(require("react"));
|
|
@@ -6609,7 +6832,7 @@ var showLoadingIcon = (rowInfo) => {
|
|
|
6609
6832
|
|
|
6610
6833
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
6611
6834
|
var React32 = __toModule(require("react"));
|
|
6612
|
-
var
|
|
6835
|
+
var import_react36 = __toModule(require("react"));
|
|
6613
6836
|
|
|
6614
6837
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
6615
6838
|
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -6620,7 +6843,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ def
|
|
|
6620
6843
|
function ExpanderIcon(props) {
|
|
6621
6844
|
var _a;
|
|
6622
6845
|
const { size = 24 } = props;
|
|
6623
|
-
const [expanded, setExpanded] = (0,
|
|
6846
|
+
const [expanded, setExpanded] = (0, import_react36.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
6624
6847
|
const onClick = () => {
|
|
6625
6848
|
var _a2;
|
|
6626
6849
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -6821,11 +7044,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
6821
7044
|
}
|
|
6822
7045
|
|
|
6823
7046
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
6824
|
-
var
|
|
7047
|
+
var import_react37 = __toModule(require("react"));
|
|
6825
7048
|
function useEffectWithRaf(fn, deps) {
|
|
6826
|
-
const rafId = (0,
|
|
6827
|
-
const removeFnRaf = (0,
|
|
6828
|
-
(0,
|
|
7049
|
+
const rafId = (0, import_react37.useRef)(0);
|
|
7050
|
+
const removeFnRaf = (0, import_react37.useRef)();
|
|
7051
|
+
(0, import_react37.useEffect)(() => {
|
|
6829
7052
|
rafId.current = requestAnimationFrame(() => {
|
|
6830
7053
|
removeFnRaf.current = fn();
|
|
6831
7054
|
});
|
|
@@ -6842,7 +7065,7 @@ function useEffectWithRaf(fn, deps) {
|
|
|
6842
7065
|
}
|
|
6843
7066
|
|
|
6844
7067
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
6845
|
-
var
|
|
7068
|
+
var import_react40 = __toModule(require("react"));
|
|
6846
7069
|
|
|
6847
7070
|
// src/utils/groupAndPivot/index.ts
|
|
6848
7071
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
@@ -7483,15 +7706,15 @@ var GroupRowsState = class {
|
|
|
7483
7706
|
};
|
|
7484
7707
|
|
|
7485
7708
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7486
|
-
var
|
|
7709
|
+
var import_react39 = __toModule(require("react"));
|
|
7487
7710
|
|
|
7488
7711
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7489
|
-
var
|
|
7712
|
+
var import_react38 = __toModule(require("react"));
|
|
7490
7713
|
function useEffectWithChanges(fn, deps) {
|
|
7491
|
-
const prevRef = (0,
|
|
7492
|
-
const oldValuesRef = (0,
|
|
7714
|
+
const prevRef = (0, import_react38.useRef)({});
|
|
7715
|
+
const oldValuesRef = (0, import_react38.useRef)({});
|
|
7493
7716
|
const oldValues = oldValuesRef.current;
|
|
7494
|
-
const changesRef = (0,
|
|
7717
|
+
const changesRef = (0, import_react38.useRef)({});
|
|
7495
7718
|
const changes = changesRef.current;
|
|
7496
7719
|
const useEffectDeps = [];
|
|
7497
7720
|
for (const k in deps) {
|
|
@@ -7504,7 +7727,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
7504
7727
|
}
|
|
7505
7728
|
}
|
|
7506
7729
|
prevRef.current = deps;
|
|
7507
|
-
(0,
|
|
7730
|
+
(0, import_react38.useEffect)(() => {
|
|
7508
7731
|
const changes2 = changesRef.current;
|
|
7509
7732
|
const result = fn(changes2, oldValues);
|
|
7510
7733
|
changesRef.current = {};
|
|
@@ -7772,12 +7995,12 @@ function useLoadData() {
|
|
|
7772
7995
|
livePaginationCursor,
|
|
7773
7996
|
cursorId: stateCursorId
|
|
7774
7997
|
} = componentState;
|
|
7775
|
-
const [scrollbars, setScrollbars] = (0,
|
|
7998
|
+
const [scrollbars, setScrollbars] = (0, import_react39.useState)({
|
|
7776
7999
|
vertical: false,
|
|
7777
8000
|
horizontal: false
|
|
7778
8001
|
});
|
|
7779
|
-
const scrollbarsRef = (0,
|
|
7780
|
-
(0,
|
|
8002
|
+
const scrollbarsRef = (0, import_react39.useRef)(scrollbars);
|
|
8003
|
+
(0, import_react39.useEffect)(() => {
|
|
7781
8004
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
7782
8005
|
if (!scrollbars2) {
|
|
7783
8006
|
return;
|
|
@@ -7787,7 +8010,7 @@ function useLoadData() {
|
|
|
7787
8010
|
});
|
|
7788
8011
|
return () => notifyScrollbarsChange.destroy();
|
|
7789
8012
|
}, [notifyScrollbarsChange]);
|
|
7790
|
-
(0,
|
|
8013
|
+
(0, import_react39.useEffect)(() => {
|
|
7791
8014
|
if (!livePagination) {
|
|
7792
8015
|
return;
|
|
7793
8016
|
}
|
|
@@ -7801,7 +8024,7 @@ function useLoadData() {
|
|
|
7801
8024
|
});
|
|
7802
8025
|
return () => cancelAnimationFrame(frameId);
|
|
7803
8026
|
}, [livePaginationCursor]);
|
|
7804
|
-
(0,
|
|
8027
|
+
(0, import_react39.useEffect)(() => {
|
|
7805
8028
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
7806
8029
|
return;
|
|
7807
8030
|
}
|
|
@@ -7815,7 +8038,7 @@ function useLoadData() {
|
|
|
7815
8038
|
});
|
|
7816
8039
|
return () => cancelAnimationFrame(frameId);
|
|
7817
8040
|
}, [dataArray.length, livePaginationCursor]);
|
|
7818
|
-
(0,
|
|
8041
|
+
(0, import_react39.useEffect)(() => {
|
|
7819
8042
|
const state = getComponentState();
|
|
7820
8043
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
7821
8044
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -7833,7 +8056,7 @@ function useLoadData() {
|
|
|
7833
8056
|
filterValue,
|
|
7834
8057
|
cursorId: livePagination ? stateCursorId : null
|
|
7835
8058
|
};
|
|
7836
|
-
const initialRef = (0,
|
|
8059
|
+
const initialRef = (0, import_react39.useRef)(true);
|
|
7837
8060
|
useLazyLoadRange();
|
|
7838
8061
|
useEffectWithChanges(() => {
|
|
7839
8062
|
const componentState2 = getComponentState();
|
|
@@ -7865,7 +8088,7 @@ function useLazyLoadRange() {
|
|
|
7865
8088
|
componentActions: actions,
|
|
7866
8089
|
componentState
|
|
7867
8090
|
} = useComponentState();
|
|
7868
|
-
(0,
|
|
8091
|
+
(0, import_react39.useEffect)(() => {
|
|
7869
8092
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
7870
8093
|
}, [componentState.data, componentState.dataParams]);
|
|
7871
8094
|
const {
|
|
@@ -7874,7 +8097,7 @@ function useLazyLoadRange() {
|
|
|
7874
8097
|
dataArray,
|
|
7875
8098
|
scrollStopDelayUpdatedByTable
|
|
7876
8099
|
} = componentState;
|
|
7877
|
-
const latestRenderRangeRef = (0,
|
|
8100
|
+
const latestRenderRangeRef = (0, import_react39.useRef)(null);
|
|
7878
8101
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
7879
8102
|
const componentState2 = getComponentState();
|
|
7880
8103
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -7893,8 +8116,8 @@ function useLazyLoadRange() {
|
|
|
7893
8116
|
componentActions: actions
|
|
7894
8117
|
}, cache);
|
|
7895
8118
|
};
|
|
7896
|
-
const debouncedLoadRange = (0,
|
|
7897
|
-
(0,
|
|
8119
|
+
const debouncedLoadRange = (0, import_react39.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8120
|
+
(0, import_react39.useEffect)(() => {
|
|
7898
8121
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
7899
8122
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
7900
8123
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -7903,7 +8126,7 @@ function useLazyLoadRange() {
|
|
|
7903
8126
|
}
|
|
7904
8127
|
return;
|
|
7905
8128
|
}, [lazyLoadBatchSize]);
|
|
7906
|
-
(0,
|
|
8129
|
+
(0, import_react39.useEffect)(() => {
|
|
7907
8130
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
7908
8131
|
debouncedLoadRange();
|
|
7909
8132
|
}
|
|
@@ -8744,7 +8967,7 @@ function DataSource(props) {
|
|
|
8744
8967
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
8745
8968
|
function useToggleGroupRow() {
|
|
8746
8969
|
const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
8747
|
-
const toggleGroupRow = (0,
|
|
8970
|
+
const toggleGroupRow = (0, import_react40.useCallback)((groupKeys) => {
|
|
8748
8971
|
const state = getDataSourceState();
|
|
8749
8972
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
8750
8973
|
newState.toggleGroupRow(groupKeys);
|
|
@@ -8776,7 +8999,7 @@ function useToggleGroupRow() {
|
|
|
8776
8999
|
|
|
8777
9000
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
8778
9001
|
function useGroupByMap(groupBy) {
|
|
8779
|
-
const groupByMap = (0,
|
|
9002
|
+
const groupByMap = (0, import_react41.useMemo)(() => {
|
|
8780
9003
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
8781
9004
|
acc.set(groupBy2.field, {
|
|
8782
9005
|
groupBy: groupBy2,
|
|
@@ -8800,13 +9023,13 @@ function useColumnsWhen() {
|
|
|
8800
9023
|
}
|
|
8801
9024
|
} = useComponentState();
|
|
8802
9025
|
const groupByMap = useGroupByMap(groupBy);
|
|
8803
|
-
(0,
|
|
9026
|
+
(0, import_react41.useEffect)(() => {
|
|
8804
9027
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
8805
9028
|
}, [groupRenderStrategy]);
|
|
8806
|
-
(0,
|
|
9029
|
+
(0, import_react41.useEffect)(() => {
|
|
8807
9030
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
8808
9031
|
}, [pivotTotalColumnPosition]);
|
|
8809
|
-
(0,
|
|
9032
|
+
(0, import_react41.useEffect)(() => {
|
|
8810
9033
|
if (pivotGrandTotalColumnPosition != void 0) {
|
|
8811
9034
|
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
8812
9035
|
}
|
|
@@ -8880,7 +9103,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
8880
9103
|
});
|
|
8881
9104
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
8882
9105
|
}
|
|
8883
|
-
(0,
|
|
9106
|
+
(0, import_react41.useEffect)(() => {
|
|
8884
9107
|
const update = () => {
|
|
8885
9108
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
8886
9109
|
};
|
|
@@ -8909,7 +9132,7 @@ function useColumnsWhenGrouping() {
|
|
|
8909
9132
|
}
|
|
8910
9133
|
} = useComponentState();
|
|
8911
9134
|
const toggleGroupRow = useToggleGroupRow();
|
|
8912
|
-
(0,
|
|
9135
|
+
(0, import_react41.useEffect)(() => {
|
|
8913
9136
|
const update = () => {
|
|
8914
9137
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
8915
9138
|
columns,
|
|
@@ -9045,7 +9268,7 @@ function useHideColumns(groupByMap) {
|
|
|
9045
9268
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
9046
9269
|
hideEmptyGroupColumns
|
|
9047
9270
|
]);
|
|
9048
|
-
(0,
|
|
9271
|
+
(0, import_react41.useEffect)(() => {
|
|
9049
9272
|
const isGrouped = groupBy.length > 0;
|
|
9050
9273
|
const currentState = getComponentState();
|
|
9051
9274
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -9160,7 +9383,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
9160
9383
|
}
|
|
9161
9384
|
|
|
9162
9385
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
9163
|
-
var
|
|
9386
|
+
var import_react43 = __toModule(require("react"));
|
|
9164
9387
|
|
|
9165
9388
|
// src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
|
|
9166
9389
|
var order = ["start", void 0, "end"];
|
|
@@ -9210,7 +9433,7 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
|
|
|
9210
9433
|
};
|
|
9211
9434
|
var getComputedPinned = (colId, columnPinning) => {
|
|
9212
9435
|
const pinned = columnPinning.get(colId);
|
|
9213
|
-
const computedPinned = pinned === "start" ? "start" : pinned === "end" ? "end" : false;
|
|
9436
|
+
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
9214
9437
|
return computedPinned;
|
|
9215
9438
|
};
|
|
9216
9439
|
var getComputedVisibleColumns = ({
|
|
@@ -9346,6 +9569,7 @@ var getComputedVisibleColumns = ({
|
|
|
9346
9569
|
const id = visibleColumnOrder[i];
|
|
9347
9570
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
9348
9571
|
const colType = getColumnComputedType(c, columnTypes);
|
|
9572
|
+
const computedVisibleIndex = i;
|
|
9349
9573
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
9350
9574
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
9351
9575
|
const computedSorted = !!computedSortInfo;
|
|
@@ -9358,7 +9582,15 @@ var getComputedVisibleColumns = ({
|
|
|
9358
9582
|
const computedMaxWidth = maxSizes[i] || 1e4;
|
|
9359
9583
|
const computedPinned = getComputedPinned(id, columnPinning);
|
|
9360
9584
|
const computedLast = i === visibleColumnOrder.length - 1;
|
|
9585
|
+
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9361
9586
|
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
9587
|
+
if (computedPinned == "start") {
|
|
9588
|
+
computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9589
|
+
} else if (computedPinned === "end") {
|
|
9590
|
+
computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
|
|
9591
|
+
} else {
|
|
9592
|
+
computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
|
|
9593
|
+
}
|
|
9362
9594
|
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
9363
9595
|
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
9364
9596
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
@@ -9407,6 +9639,7 @@ var getComputedVisibleColumns = ({
|
|
|
9407
9639
|
computedWidth,
|
|
9408
9640
|
computedAbsoluteOffset,
|
|
9409
9641
|
computedPinningOffset,
|
|
9642
|
+
computedVisibleIndexInCategory,
|
|
9410
9643
|
computedOffset,
|
|
9411
9644
|
computedSortable,
|
|
9412
9645
|
computedSortInfo,
|
|
@@ -9415,7 +9648,7 @@ var getComputedVisibleColumns = ({
|
|
|
9415
9648
|
computedSorted,
|
|
9416
9649
|
computedSortedAsc,
|
|
9417
9650
|
computedSortedDesc,
|
|
9418
|
-
computedVisibleIndex
|
|
9651
|
+
computedVisibleIndex,
|
|
9419
9652
|
computedPinned,
|
|
9420
9653
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
9421
9654
|
computedFirstInCategory,
|
|
@@ -9508,10 +9741,10 @@ var getComputedVisibleColumns = ({
|
|
|
9508
9741
|
};
|
|
9509
9742
|
|
|
9510
9743
|
// src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
|
|
9511
|
-
var
|
|
9744
|
+
var import_react42 = __toModule(require("react"));
|
|
9512
9745
|
var useRerenderOnKeyChange = (map2) => {
|
|
9513
9746
|
const [renderId, rerender] = useRerender();
|
|
9514
|
-
(0,
|
|
9747
|
+
(0, import_react42.useEffect)(() => {
|
|
9515
9748
|
const update = rafFn(rerender);
|
|
9516
9749
|
return interceptMap(map2, {
|
|
9517
9750
|
set: update,
|
|
@@ -9565,7 +9798,7 @@ var useComputedVisibleColumns = ({
|
|
|
9565
9798
|
computedPinnedEndOffset,
|
|
9566
9799
|
computedPinnedEndWidth,
|
|
9567
9800
|
computedPinnedStartWidth
|
|
9568
|
-
} = (0,
|
|
9801
|
+
} = (0, import_react43.useMemo)(() => {
|
|
9569
9802
|
return getComputedVisibleColumns({
|
|
9570
9803
|
columns,
|
|
9571
9804
|
bodySize,
|
|
@@ -9606,6 +9839,7 @@ var useComputedVisibleColumns = ({
|
|
|
9606
9839
|
columnOrder,
|
|
9607
9840
|
columnVisibility,
|
|
9608
9841
|
columnVisibilityAssumeVisible,
|
|
9842
|
+
resizableColumns,
|
|
9609
9843
|
pinnedEndMaxWidth,
|
|
9610
9844
|
pinnedStartMaxWidth,
|
|
9611
9845
|
columnSizing,
|
|
@@ -9635,7 +9869,7 @@ var useComputedVisibleColumns = ({
|
|
|
9635
9869
|
};
|
|
9636
9870
|
|
|
9637
9871
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
9638
|
-
var
|
|
9872
|
+
var import_react44 = __toModule(require("react"));
|
|
9639
9873
|
var INITIAL_SCROLLBARS = {
|
|
9640
9874
|
vertical: false,
|
|
9641
9875
|
horizontal: false
|
|
@@ -9643,8 +9877,8 @@ var INITIAL_SCROLLBARS = {
|
|
|
9643
9877
|
function useScrollbars(brain) {
|
|
9644
9878
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
9645
9879
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
9646
|
-
const [scrollbars, setScrollbars] = (0,
|
|
9647
|
-
(0,
|
|
9880
|
+
const [scrollbars, setScrollbars] = (0, import_react44.useState)(INITIAL_SCROLLBARS);
|
|
9881
|
+
(0, import_react44.useEffect)(() => {
|
|
9648
9882
|
return brain.onRenderCountChange(() => {
|
|
9649
9883
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
9650
9884
|
setScrollbars({
|
|
@@ -9653,7 +9887,7 @@ function useScrollbars(brain) {
|
|
|
9653
9887
|
});
|
|
9654
9888
|
});
|
|
9655
9889
|
}, [brain]);
|
|
9656
|
-
(0,
|
|
9890
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
9657
9891
|
const dataSourceState = getDataSourceState();
|
|
9658
9892
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
9659
9893
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -9684,7 +9918,7 @@ function useComputed() {
|
|
|
9684
9918
|
bodySize,
|
|
9685
9919
|
showSeparatePivotColumnForSingleAggregation
|
|
9686
9920
|
} = componentState;
|
|
9687
|
-
(0,
|
|
9921
|
+
(0, import_react45.useState)(() => {
|
|
9688
9922
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
9689
9923
|
if (rowHeight) {
|
|
9690
9924
|
componentActions.rowHeight = rowHeight;
|
|
@@ -9696,13 +9930,13 @@ function useComputed() {
|
|
|
9696
9930
|
}
|
|
9697
9931
|
});
|
|
9698
9932
|
});
|
|
9699
|
-
(0,
|
|
9933
|
+
(0, import_react45.useEffect)(() => {
|
|
9700
9934
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
9701
9935
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
9702
9936
|
const { multiSort, filterValue } = dataSourceState;
|
|
9703
9937
|
useColumnGroups();
|
|
9704
9938
|
const { toggleGroupRow } = useColumnsWhen();
|
|
9705
|
-
const setSortInfo = (0,
|
|
9939
|
+
const setSortInfo = (0, import_react45.useCallback)((sortInfo) => {
|
|
9706
9940
|
var _a2;
|
|
9707
9941
|
const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
9708
9942
|
dataSourceActions.sortInfo = newSortInfo;
|
|
@@ -9779,109 +10013,8 @@ function useComputed() {
|
|
|
9779
10013
|
};
|
|
9780
10014
|
}
|
|
9781
10015
|
|
|
9782
|
-
// src/components/InfiniteTable/hooks/useDOMProps.ts
|
|
9783
|
-
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
9784
|
-
var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
9785
|
-
var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
|
|
9786
|
-
var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
|
|
9787
|
-
function useDOMProps(initialDOMProps) {
|
|
9788
|
-
const { computed, componentState, componentActions } = useInfiniteTable();
|
|
9789
|
-
const {
|
|
9790
|
-
columnShifts,
|
|
9791
|
-
focused,
|
|
9792
|
-
focusedWithin,
|
|
9793
|
-
domRef,
|
|
9794
|
-
onBlurWithin,
|
|
9795
|
-
onFocusWithin,
|
|
9796
|
-
onSelfFocus,
|
|
9797
|
-
onSelfBlur,
|
|
9798
|
-
activeCellIndex
|
|
9799
|
-
} = componentState;
|
|
9800
|
-
const {
|
|
9801
|
-
computedPinnedStartColumnsWidth,
|
|
9802
|
-
computedPinnedEndColumnsWidth,
|
|
9803
|
-
computedVisibleColumns
|
|
9804
|
-
} = computed;
|
|
9805
|
-
const cssVars = computedVisibleColumns.reduce((vars, col) => {
|
|
9806
|
-
const index = col.computedVisibleIndex;
|
|
9807
|
-
vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
|
|
9808
|
-
vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
|
|
9809
|
-
return vars;
|
|
9810
|
-
}, {});
|
|
9811
|
-
if (activeCellIndex != null) {
|
|
9812
|
-
cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
|
|
9813
|
-
cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
|
|
9814
|
-
}
|
|
9815
|
-
const setFocused = rafFn((focused2) => {
|
|
9816
|
-
componentActions.focused = focused2;
|
|
9817
|
-
});
|
|
9818
|
-
const setFocusedWithin = rafFn((focused2) => {
|
|
9819
|
-
componentActions.focusedWithin = focused2;
|
|
9820
|
-
});
|
|
9821
|
-
const onFocus = (event) => {
|
|
9822
|
-
var _a;
|
|
9823
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9824
|
-
if (event.target === domRef.current) {
|
|
9825
|
-
setFocused(true);
|
|
9826
|
-
onSelfFocus == null ? void 0 : onSelfFocus(event);
|
|
9827
|
-
if (focusedWithin) {
|
|
9828
|
-
setFocusedWithin(false);
|
|
9829
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9830
|
-
}
|
|
9831
|
-
} else {
|
|
9832
|
-
if (!focusedWithin) {
|
|
9833
|
-
setFocusedWithin(true);
|
|
9834
|
-
onFocusWithin == null ? void 0 : onFocusWithin(event);
|
|
9835
|
-
}
|
|
9836
|
-
}
|
|
9837
|
-
};
|
|
9838
|
-
const onBlur = (event) => {
|
|
9839
|
-
var _a, _b;
|
|
9840
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9841
|
-
if (event.target === domRef.current) {
|
|
9842
|
-
setFocused(false);
|
|
9843
|
-
onSelfBlur == null ? void 0 : onSelfBlur(event);
|
|
9844
|
-
if (focusedWithin) {
|
|
9845
|
-
setFocusedWithin(false);
|
|
9846
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9847
|
-
}
|
|
9848
|
-
} else {
|
|
9849
|
-
const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
|
|
9850
|
-
if (!contained) {
|
|
9851
|
-
setFocusedWithin(false);
|
|
9852
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9853
|
-
}
|
|
9854
|
-
}
|
|
9855
|
-
};
|
|
9856
|
-
const domProps = __spreadProps(__spreadValues({
|
|
9857
|
-
tabIndex: 0
|
|
9858
|
-
}, initialDOMProps), {
|
|
9859
|
-
onFocus,
|
|
9860
|
-
onBlur
|
|
9861
|
-
});
|
|
9862
|
-
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({
|
|
9863
|
-
hasPinnedStart: !!computedPinnedStartColumnsWidth,
|
|
9864
|
-
hasPinnedEnd: !!computedPinnedEndColumnsWidth,
|
|
9865
|
-
focused,
|
|
9866
|
-
focusedWithin
|
|
9867
|
-
}));
|
|
9868
|
-
domProps.className = className;
|
|
9869
|
-
domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
|
|
9870
|
-
if (focused) {
|
|
9871
|
-
if (componentState.focusedStyle) {
|
|
9872
|
-
Object.assign(domProps.style, componentState.focusedStyle);
|
|
9873
|
-
}
|
|
9874
|
-
}
|
|
9875
|
-
if (focusedWithin) {
|
|
9876
|
-
if (componentState.focusedWithinStyle) {
|
|
9877
|
-
Object.assign(domProps.style, componentState.focusedWithinStyle);
|
|
9878
|
-
}
|
|
9879
|
-
}
|
|
9880
|
-
return domProps;
|
|
9881
|
-
}
|
|
9882
|
-
|
|
9883
10016
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
9884
|
-
var
|
|
10017
|
+
var import_react46 = __toModule(require("react"));
|
|
9885
10018
|
|
|
9886
10019
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
9887
10020
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -10039,10 +10172,10 @@ var isInsideSandbox = () => {
|
|
|
10039
10172
|
};
|
|
10040
10173
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
10041
10174
|
var useLicense = (licenseKey = "") => {
|
|
10042
|
-
const valid = (0,
|
|
10175
|
+
const valid = (0, import_react46.useMemo)(() => {
|
|
10043
10176
|
let valid2 = isValidLicense(licenseKey, {
|
|
10044
10177
|
publishedAt: 1624970570587,
|
|
10045
|
-
version: "0.3.
|
|
10178
|
+
version: "0.3.16"
|
|
10046
10179
|
});
|
|
10047
10180
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
10048
10181
|
return true;
|
|
@@ -10052,6 +10185,73 @@ var useLicense = (licenseKey = "") => {
|
|
|
10052
10185
|
return valid;
|
|
10053
10186
|
};
|
|
10054
10187
|
|
|
10188
|
+
// src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
|
|
10189
|
+
var import_react47 = __toModule(require("react"));
|
|
10190
|
+
var RETRIES = 10;
|
|
10191
|
+
function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
10192
|
+
const didScrollRef = (0, import_react47.useRef)(false);
|
|
10193
|
+
const rafId = (0, import_react47.useRef)(null);
|
|
10194
|
+
(0, import_react47.useEffect)(() => {
|
|
10195
|
+
if (activeCellIndex != null) {
|
|
10196
|
+
didScrollRef.current = false;
|
|
10197
|
+
cancelAnimationFrame(rafId.current);
|
|
10198
|
+
}
|
|
10199
|
+
}, [activeCellIndex]);
|
|
10200
|
+
(0, import_react47.useEffect)(() => {
|
|
10201
|
+
if (activeCellIndex != null && !didScrollRef.current) {
|
|
10202
|
+
let tryScroll = function(times = 0) {
|
|
10203
|
+
times++;
|
|
10204
|
+
cancelAnimationFrame(rafId.current);
|
|
10205
|
+
rafId.current = requestAnimationFrame(() => {
|
|
10206
|
+
didScrollRef.current = imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10207
|
+
offset: 30
|
|
10208
|
+
});
|
|
10209
|
+
if (!didScrollRef.current && times < RETRIES) {
|
|
10210
|
+
tryScroll(times);
|
|
10211
|
+
}
|
|
10212
|
+
});
|
|
10213
|
+
};
|
|
10214
|
+
tryScroll();
|
|
10215
|
+
}
|
|
10216
|
+
return () => {
|
|
10217
|
+
cancelAnimationFrame(rafId.current);
|
|
10218
|
+
};
|
|
10219
|
+
}, [activeCellIndex, dataCount]);
|
|
10220
|
+
}
|
|
10221
|
+
|
|
10222
|
+
// src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
|
|
10223
|
+
var import_react48 = __toModule(require("react"));
|
|
10224
|
+
var RETRIES2 = 10;
|
|
10225
|
+
function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
|
|
10226
|
+
const didScrollRef = (0, import_react48.useRef)(false);
|
|
10227
|
+
const rafId = (0, import_react48.useRef)(null);
|
|
10228
|
+
(0, import_react48.useEffect)(() => {
|
|
10229
|
+
if (activeRowIndex != null) {
|
|
10230
|
+
didScrollRef.current = false;
|
|
10231
|
+
cancelAnimationFrame(rafId.current);
|
|
10232
|
+
}
|
|
10233
|
+
}, [activeRowIndex]);
|
|
10234
|
+
(0, import_react48.useEffect)(() => {
|
|
10235
|
+
if (activeRowIndex != null && !didScrollRef.current) {
|
|
10236
|
+
let tryScroll = function(times = 0) {
|
|
10237
|
+
times++;
|
|
10238
|
+
rafId.current = requestAnimationFrame(() => {
|
|
10239
|
+
didScrollRef.current = imperativeApi.scrollRowIntoView(activeRowIndex, {
|
|
10240
|
+
offset: 30
|
|
10241
|
+
});
|
|
10242
|
+
if (!didScrollRef.current && times < RETRIES2) {
|
|
10243
|
+
tryScroll(times);
|
|
10244
|
+
}
|
|
10245
|
+
});
|
|
10246
|
+
};
|
|
10247
|
+
tryScroll();
|
|
10248
|
+
}
|
|
10249
|
+
return () => {
|
|
10250
|
+
cancelAnimationFrame(rafId.current);
|
|
10251
|
+
};
|
|
10252
|
+
}, [activeRowIndex, dataCount]);
|
|
10253
|
+
}
|
|
10254
|
+
|
|
10055
10255
|
// src/components/utils/clamp.ts
|
|
10056
10256
|
function clamp(value, min, max) {
|
|
10057
10257
|
return Math.min(Math.max(value, min), max);
|
|
@@ -10200,7 +10400,7 @@ function handleKeyboardNavigation(options) {
|
|
|
10200
10400
|
}
|
|
10201
10401
|
|
|
10202
10402
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
10203
|
-
var
|
|
10403
|
+
var import_react49 = __toModule(require("react"));
|
|
10204
10404
|
|
|
10205
10405
|
// src/components/VirtualBrain/ScrollListener.ts
|
|
10206
10406
|
var initialScrollPosition = {
|
|
@@ -10295,11 +10495,10 @@ function initSetupState2() {
|
|
|
10295
10495
|
propsCache: new Map([]),
|
|
10296
10496
|
brain,
|
|
10297
10497
|
headerBrain,
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
activeCellIndicatorDOMRef: (0, import_react48.createRef)(),
|
|
10498
|
+
domRef: (0, import_react49.createRef)(),
|
|
10499
|
+
scrollerDOMRef: (0, import_react49.createRef)(),
|
|
10500
|
+
portalDOMRef: (0, import_react49.createRef)(),
|
|
10501
|
+
activeCellIndicatorDOMRef: (0, import_react49.createRef)(),
|
|
10303
10502
|
onRowHeightCSSVarChange: buildSubscriptionCallback(),
|
|
10304
10503
|
onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
|
|
10305
10504
|
bodySize: {
|
|
@@ -10310,11 +10509,11 @@ function initSetupState2() {
|
|
|
10310
10509
|
scrollTop: 0,
|
|
10311
10510
|
scrollLeft: 0
|
|
10312
10511
|
},
|
|
10512
|
+
columnReorderInProgress: false,
|
|
10313
10513
|
ready: false,
|
|
10314
10514
|
focused: false,
|
|
10315
10515
|
focusedWithin: false,
|
|
10316
10516
|
columnsWhenGrouping: columnsGeneratedForGrouping,
|
|
10317
|
-
draggingColumnId: null,
|
|
10318
10517
|
pinnedStartScrollListener: new ScrollListener(),
|
|
10319
10518
|
pinnedEndScrollListener: new ScrollListener(),
|
|
10320
10519
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
@@ -10368,7 +10567,6 @@ var forwardProps3 = (setupState) => {
|
|
|
10368
10567
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
10369
10568
|
pivotGrandTotalColumnPosition: 1,
|
|
10370
10569
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
10371
|
-
keyboardNavigation: (keyboardNavigation) => keyboardNavigation != null ? keyboardNavigation : "cell",
|
|
10372
10570
|
activeRowIndex: 1,
|
|
10373
10571
|
activeCellIndex: 1,
|
|
10374
10572
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
@@ -10415,7 +10613,7 @@ var cleanupState = (state) => {
|
|
|
10415
10613
|
state.pinnedStartScrollListener.destroy();
|
|
10416
10614
|
};
|
|
10417
10615
|
var mapPropsToState2 = (params) => {
|
|
10418
|
-
var _a, _b;
|
|
10616
|
+
var _a, _b, _c;
|
|
10419
10617
|
const { props, state, oldState, parentState } = params;
|
|
10420
10618
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
10421
10619
|
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;
|
|
@@ -10431,7 +10629,8 @@ var mapPropsToState2 = (params) => {
|
|
|
10431
10629
|
groupRenderStrategy,
|
|
10432
10630
|
groupBy,
|
|
10433
10631
|
computedColumns,
|
|
10434
|
-
|
|
10632
|
+
keyboardNavigation: (_a = state.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
10633
|
+
columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
|
|
10435
10634
|
columnGroupsDepthsMap,
|
|
10436
10635
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
10437
10636
|
computedColumnGroups,
|
|
@@ -10468,11 +10667,11 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10468
10667
|
getState
|
|
10469
10668
|
} = useInfiniteTable();
|
|
10470
10669
|
const {
|
|
10471
|
-
componentState: { loading },
|
|
10670
|
+
componentState: { loading, dataArray },
|
|
10472
10671
|
getState: getDataSourceState,
|
|
10473
10672
|
componentActions: dataSourceActions
|
|
10474
10673
|
} = useDataSourceContextValue();
|
|
10475
|
-
const [imperativeApi] = (0,
|
|
10674
|
+
const [imperativeApi] = (0, import_react50.useState)(() => {
|
|
10476
10675
|
return getImperativeApi(getState, getComputed, getDataSourceState, actions);
|
|
10477
10676
|
});
|
|
10478
10677
|
const {
|
|
@@ -10496,27 +10695,14 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10496
10695
|
activeCellIndex,
|
|
10497
10696
|
onRenderUpdater
|
|
10498
10697
|
} = componentState;
|
|
10499
|
-
(
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
offset: 30
|
|
10503
|
-
});
|
|
10504
|
-
}
|
|
10505
|
-
}, [activeRowIndex]);
|
|
10506
|
-
(0, import_react49.useEffect)(() => {
|
|
10507
|
-
if (activeCellIndex != null) {
|
|
10508
|
-
imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10509
|
-
offset: 30
|
|
10510
|
-
});
|
|
10511
|
-
}
|
|
10512
|
-
}, [activeCellIndex]);
|
|
10513
|
-
const { columnShifts, bodySize } = componentState;
|
|
10698
|
+
useScrollToActiveRow(activeRowIndex, dataArray.length, imperativeApi);
|
|
10699
|
+
useScrollToActiveCell(activeCellIndex, dataArray.length, imperativeApi);
|
|
10700
|
+
const { bodySize } = componentState;
|
|
10514
10701
|
const { scrollbars } = computed;
|
|
10515
10702
|
const { renderCell } = useCellRendering({
|
|
10516
10703
|
imperativeApi,
|
|
10517
10704
|
getComputed,
|
|
10518
10705
|
domRef: componentState.domRef,
|
|
10519
|
-
columnShifts,
|
|
10520
10706
|
bodySize,
|
|
10521
10707
|
computed
|
|
10522
10708
|
});
|
|
@@ -10538,7 +10724,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10538
10724
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
10539
10725
|
}, [scrollStopDelay]);
|
|
10540
10726
|
useAutoSizeColumns();
|
|
10541
|
-
const onKeyDown = (0,
|
|
10727
|
+
const onKeyDown = (0, import_react50.useCallback)((event) => {
|
|
10542
10728
|
if (handleKeyboardNavigation({
|
|
10543
10729
|
getState,
|
|
10544
10730
|
actions,
|
|
@@ -10560,7 +10746,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10560
10746
|
}) : null, /* @__PURE__ */ React36.createElement(InfiniteTableBody, null, /* @__PURE__ */ React36.createElement(HeadlessTable, {
|
|
10561
10747
|
tabIndex: 0,
|
|
10562
10748
|
activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
|
|
10563
|
-
activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
|
|
10749
|
+
activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
|
|
10564
10750
|
scrollStopDelay,
|
|
10565
10751
|
renderer,
|
|
10566
10752
|
onRenderUpdater,
|
|
@@ -10572,7 +10758,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10572
10758
|
visible: loading
|
|
10573
10759
|
}, loadingText)), /* @__PURE__ */ React36.createElement("div", {
|
|
10574
10760
|
ref: portalDOMRef,
|
|
10575
|
-
className: join(`${rootClassName2}Portal`, zIndex[
|
|
10761
|
+
className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
|
|
10576
10762
|
}), rowHeightCSSVar ? /* @__PURE__ */ React36.createElement(CSSVariableWatch, {
|
|
10577
10763
|
varName: rowHeightCSSVar,
|
|
10578
10764
|
onChange: onRowHeightCSSVarChange
|