@infinite-table/infinite-react 0.3.14 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -18
- package/index.css +68 -57
- package/index.d.ts +16 -10
- package/index.esm.css +68 -57
- package/index.esm.js +625 -450
- package/index.js +683 -503
- package/package.json +2 -2
package/index.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) => {
|
|
@@ -4910,7 +5125,7 @@ var computeGroupResize = (params) => {
|
|
|
4910
5125
|
};
|
|
4911
5126
|
|
|
4912
5127
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
4913
|
-
var
|
|
5128
|
+
var import_react21 = __toModule(require("react"));
|
|
4914
5129
|
|
|
4915
5130
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
|
|
4916
5131
|
function getColumnResizer(colIndex, {
|
|
@@ -4965,17 +5180,17 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
4965
5180
|
}
|
|
4966
5181
|
|
|
4967
5182
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
4968
|
-
var
|
|
4969
|
-
var ResizeHandleCls = "zneyzh0 _16lm1iw2
|
|
4970
|
-
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: [] });
|
|
4971
5186
|
|
|
4972
5187
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
4973
5188
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
4974
5189
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
|
|
4975
5190
|
function ResizeHandleFn(props) {
|
|
4976
|
-
const domRef = (0,
|
|
4977
|
-
const [constrained, setConstrained] = (0,
|
|
4978
|
-
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);
|
|
4979
5194
|
constrainedRef.current = constrained;
|
|
4980
5195
|
const onPointerDown = (e) => {
|
|
4981
5196
|
e.stopPropagation();
|
|
@@ -5014,33 +5229,32 @@ function ResizeHandleFn(props) {
|
|
|
5014
5229
|
target.addEventListener("pointermove", onPointerMove);
|
|
5015
5230
|
target.addEventListener("pointerup", onPointerUp);
|
|
5016
5231
|
};
|
|
5017
|
-
return /* @__PURE__ */
|
|
5232
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
5018
5233
|
ref: domRef,
|
|
5019
5234
|
className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls}`,
|
|
5020
5235
|
onPointerDown
|
|
5021
|
-
}, /* @__PURE__ */
|
|
5236
|
+
}, /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
5022
5237
|
className: ResizeHandleDraggerClsRecipe({
|
|
5023
5238
|
constrained
|
|
5024
5239
|
})
|
|
5025
5240
|
}));
|
|
5026
5241
|
}
|
|
5027
|
-
var ResizeHandle =
|
|
5242
|
+
var ResizeHandle = import_react21.default.memo(ResizeHandleFn);
|
|
5028
5243
|
|
|
5029
5244
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
5030
5245
|
function useColumnResizeHandle(column) {
|
|
5031
5246
|
const {
|
|
5032
5247
|
computed: { computedVisibleColumns },
|
|
5033
|
-
componentState: { domRef },
|
|
5034
5248
|
getState,
|
|
5035
5249
|
getComputed,
|
|
5036
5250
|
componentActions
|
|
5037
5251
|
} = useInfiniteTable();
|
|
5038
|
-
const computeResizeForDiff = (0,
|
|
5252
|
+
const computeResizeForDiff = (0, import_react22.useCallback)(({
|
|
5039
5253
|
diff,
|
|
5040
5254
|
shareSpaceOnResize
|
|
5041
5255
|
}) => {
|
|
5042
5256
|
const state = getState();
|
|
5043
|
-
const { columnSizing, viewportReservedWidth, bodySize
|
|
5257
|
+
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
5044
5258
|
const columns = getComputed().computedVisibleColumns;
|
|
5045
5259
|
let atLeastOneFlex = false;
|
|
5046
5260
|
const columnSizingWithFlex = columns.reduce((acc, col) => {
|
|
@@ -5068,21 +5282,9 @@ function useColumnResizeHandle(column) {
|
|
|
5068
5282
|
};
|
|
5069
5283
|
})
|
|
5070
5284
|
});
|
|
5071
|
-
if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
|
|
5072
|
-
const activeColumn = columns[activeCellIndex[1]];
|
|
5073
|
-
const currentColumn = columns[column.computedVisibleIndex];
|
|
5074
|
-
if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
|
|
5075
|
-
setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
|
|
5076
|
-
} else if (activeColumn) {
|
|
5077
|
-
setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
|
|
5078
|
-
}
|
|
5079
|
-
if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
|
|
5080
|
-
setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
|
|
5081
|
-
}
|
|
5082
|
-
}
|
|
5083
5285
|
return result;
|
|
5084
|
-
}, []);
|
|
5085
|
-
const onColumnResize = (0,
|
|
5286
|
+
}, [column]);
|
|
5287
|
+
const onColumnResize = (0, import_react22.useCallback)(({
|
|
5086
5288
|
diff,
|
|
5087
5289
|
shareSpaceOnResize
|
|
5088
5290
|
}) => {
|
|
@@ -5094,7 +5296,7 @@ function useColumnResizeHandle(column) {
|
|
|
5094
5296
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
5095
5297
|
}
|
|
5096
5298
|
componentActions.columnSizing = columnSizing;
|
|
5097
|
-
}, []);
|
|
5299
|
+
}, [computeResizeForDiff]);
|
|
5098
5300
|
const resizeHandle = column.computedResizable ? /* @__PURE__ */ React21.createElement(ResizeHandle, {
|
|
5099
5301
|
columns: computedVisibleColumns,
|
|
5100
5302
|
columnIndex: column.computedVisibleIndex,
|
|
@@ -5108,6 +5310,8 @@ function useColumnResizeHandle(column) {
|
|
|
5108
5310
|
var InfiniteTableHeaderCellContext = React22.createContext(null);
|
|
5109
5311
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
5110
5312
|
var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
|
|
5313
|
+
var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5314
|
+
var columnOffsetAtIndex5 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
5111
5315
|
function InfiniteTableHeaderCell(props) {
|
|
5112
5316
|
var _a, _b, _c, _d, _e;
|
|
5113
5317
|
const column = props.column;
|
|
@@ -5115,7 +5319,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5115
5319
|
const { onResize, height, width, headerOptions } = props;
|
|
5116
5320
|
const sortInfo = column.computedSortInfo;
|
|
5117
5321
|
let header = column.header;
|
|
5118
|
-
const ref = (0,
|
|
5322
|
+
const ref = (0, import_react23.useCallback)((node) => {
|
|
5119
5323
|
var _a2;
|
|
5120
5324
|
domRef.current = node;
|
|
5121
5325
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
@@ -5146,12 +5350,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5146
5350
|
header = header != null ? header : column.name;
|
|
5147
5351
|
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
|
|
5148
5352
|
};
|
|
5149
|
-
const domRef = (0,
|
|
5353
|
+
const domRef = (0, import_react23.useRef)(null);
|
|
5150
5354
|
const {
|
|
5151
5355
|
computed: {
|
|
5152
5356
|
computedRemainingSpace,
|
|
5153
5357
|
showColumnFilters,
|
|
5154
|
-
computedVisibleColumns
|
|
5358
|
+
computedVisibleColumns,
|
|
5359
|
+
computedPinnedStartColumns
|
|
5155
5360
|
},
|
|
5156
5361
|
componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
|
|
5157
5362
|
} = useInfiniteTable();
|
|
@@ -5160,7 +5365,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5160
5365
|
getState: getDataSourceState,
|
|
5161
5366
|
componentState: { filterDelay, filterTypes }
|
|
5162
5367
|
} = useDataSourceContextValue();
|
|
5163
|
-
(0,
|
|
5368
|
+
(0, import_react23.useEffect)(() => {
|
|
5164
5369
|
let clearOnResize = null;
|
|
5165
5370
|
const node = domRef.current;
|
|
5166
5371
|
if (onResize && node) {
|
|
@@ -5173,7 +5378,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5173
5378
|
const style = {
|
|
5174
5379
|
height
|
|
5175
5380
|
};
|
|
5176
|
-
const { onPointerDown, dragging,
|
|
5381
|
+
const { onPointerDown, dragging, proxyPosition } = useColumnPointerEvents({
|
|
5382
|
+
pinnedStartColsCount: computedPinnedStartColumns.length,
|
|
5383
|
+
visibleColsCount: computedVisibleColumns.length,
|
|
5177
5384
|
computedRemainingSpace,
|
|
5178
5385
|
columnId: column.id,
|
|
5179
5386
|
domRef,
|
|
@@ -5187,9 +5394,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5187
5394
|
position: "absolute",
|
|
5188
5395
|
height,
|
|
5189
5396
|
width,
|
|
5190
|
-
left: column.
|
|
5191
|
-
top: (
|
|
5192
|
-
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
|
|
5193
5400
|
}
|
|
5194
5401
|
}, header);
|
|
5195
5402
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
@@ -5198,7 +5405,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5198
5405
|
const contentRecipeVariants = {
|
|
5199
5406
|
filtered: column.computedFiltered
|
|
5200
5407
|
};
|
|
5201
|
-
const setFilterValue = (0,
|
|
5408
|
+
const setFilterValue = (0, import_react23.useCallback)((filterValue) => {
|
|
5202
5409
|
var _a2;
|
|
5203
5410
|
const state = getDataSourceState();
|
|
5204
5411
|
let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
|
|
@@ -5260,6 +5467,8 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5260
5467
|
const filterType = column.computedFilterType;
|
|
5261
5468
|
const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
|
|
5262
5469
|
const resizeHandle = useColumnResizeHandle(column);
|
|
5470
|
+
const zIndex2 = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5471
|
+
style.zIndex = zIndex2;
|
|
5263
5472
|
return /* @__PURE__ */ React22.createElement(ContextProvider, {
|
|
5264
5473
|
value: renderParam
|
|
5265
5474
|
}, /* @__PURE__ */ React22.createElement(InfiniteTableCell, {
|
|
@@ -5268,7 +5477,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5268
5477
|
column,
|
|
5269
5478
|
"data-name": `HeaderCell`,
|
|
5270
5479
|
"data-column-id": column.id,
|
|
5271
|
-
"data-z-index":
|
|
5480
|
+
"data-z-index": zIndex2,
|
|
5272
5481
|
style,
|
|
5273
5482
|
width,
|
|
5274
5483
|
onPointerDown,
|
|
@@ -5289,7 +5498,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5289
5498
|
}), draggingProxy);
|
|
5290
5499
|
}
|
|
5291
5500
|
function useInfiniteHeaderCell() {
|
|
5292
|
-
const result = (0,
|
|
5501
|
+
const result = (0, import_react23.useContext)(InfiniteTableHeaderCellContext);
|
|
5293
5502
|
return result;
|
|
5294
5503
|
}
|
|
5295
5504
|
|
|
@@ -5417,23 +5626,23 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
5417
5626
|
|
|
5418
5627
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5419
5628
|
var React26 = __toModule(require("react"));
|
|
5420
|
-
var
|
|
5629
|
+
var import_react26 = __toModule(require("react"));
|
|
5421
5630
|
|
|
5422
5631
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5423
5632
|
var React25 = __toModule(require("react"));
|
|
5424
5633
|
|
|
5425
5634
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
5426
5635
|
var React24 = __toModule(require("react"));
|
|
5427
|
-
var
|
|
5636
|
+
var import_react25 = __toModule(require("react"));
|
|
5428
5637
|
|
|
5429
5638
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
5430
|
-
var
|
|
5639
|
+
var import_react24 = __toModule(require("react"));
|
|
5431
5640
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
5432
5641
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
|
|
5433
5642
|
function GroupResizeHandleFn(props) {
|
|
5434
|
-
const domRef = (0,
|
|
5435
|
-
const [constrained, setConstrained] = (0,
|
|
5436
|
-
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);
|
|
5437
5646
|
constrainedRef.current = constrained;
|
|
5438
5647
|
const onPointerDown = (e) => {
|
|
5439
5648
|
e.stopPropagation();
|
|
@@ -5480,18 +5689,18 @@ function GroupResizeHandleFn(props) {
|
|
|
5480
5689
|
target.addEventListener("pointermove", onPointerMove);
|
|
5481
5690
|
target.addEventListener("pointerup", onPointerUp);
|
|
5482
5691
|
};
|
|
5483
|
-
return /* @__PURE__ */
|
|
5692
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
5484
5693
|
ref: domRef,
|
|
5485
5694
|
className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls}`,
|
|
5486
5695
|
onPointerDown
|
|
5487
|
-
}, /* @__PURE__ */
|
|
5696
|
+
}, /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
5488
5697
|
style: props.style,
|
|
5489
5698
|
className: ResizeHandleDraggerClsRecipe({
|
|
5490
5699
|
constrained
|
|
5491
5700
|
})
|
|
5492
5701
|
}));
|
|
5493
5702
|
}
|
|
5494
|
-
var GroupResizeHandle =
|
|
5703
|
+
var GroupResizeHandle = import_react24.default.memo(GroupResizeHandleFn);
|
|
5495
5704
|
|
|
5496
5705
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
5497
5706
|
function useColumnGroupResizeHandle(groupColumns, config) {
|
|
@@ -5503,7 +5712,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5503
5712
|
componentActions
|
|
5504
5713
|
} = useInfiniteTable();
|
|
5505
5714
|
const lastColumnInGroup = groupColumns[groupColumns.length - 1];
|
|
5506
|
-
const computeResizeForDiff = (0,
|
|
5715
|
+
const computeResizeForDiff = (0, import_react25.useCallback)((diff) => {
|
|
5507
5716
|
const state = getState();
|
|
5508
5717
|
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
5509
5718
|
const columns = getComputed().computedVisibleColumns;
|
|
@@ -5536,7 +5745,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5536
5745
|
});
|
|
5537
5746
|
return result;
|
|
5538
5747
|
}, []);
|
|
5539
|
-
const onColumnResize = (0,
|
|
5748
|
+
const onColumnResize = (0, import_react25.useCallback)((diff) => {
|
|
5540
5749
|
const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
|
|
5541
5750
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
5542
5751
|
componentActions.columnSizing = columnSizing;
|
|
@@ -5557,11 +5766,9 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
5557
5766
|
|
|
5558
5767
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5559
5768
|
var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
5560
|
-
var
|
|
5769
|
+
var columnWidthAtIndex5 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5770
|
+
var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5561
5771
|
function InfiniteTableHeaderGroup(props) {
|
|
5562
|
-
const {
|
|
5563
|
-
computed: { computedVisibleColumns }
|
|
5564
|
-
} = useInfiniteTable();
|
|
5565
5772
|
const { columnGroup, height, columns, bodyBrain, columnGroupsMaxDepth } = props;
|
|
5566
5773
|
let { header } = columnGroup;
|
|
5567
5774
|
if (header instanceof Function) {
|
|
@@ -5576,8 +5783,8 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5576
5783
|
columnGroupsMaxDepth
|
|
5577
5784
|
});
|
|
5578
5785
|
const firstColumn = columns[0];
|
|
5579
|
-
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${
|
|
5580
|
-
const zIndex2 =
|
|
5786
|
+
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
|
|
5787
|
+
const zIndex2 = `calc(var(${columnZIndexAtIndex5}-${firstColumn.computedVisibleIndex}) + ${columnGroupsMaxDepth - columnGroup.depth})`;
|
|
5581
5788
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
5582
5789
|
ref: props.domRef,
|
|
5583
5790
|
"data-group-id": columnGroup.uniqueGroupId,
|
|
@@ -5608,7 +5815,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5608
5815
|
componentState: { headerBrain, headerOptions }
|
|
5609
5816
|
} = useInfiniteTable();
|
|
5610
5817
|
const { computedVisibleColumnsMap, showColumnFilters } = computed;
|
|
5611
|
-
(0,
|
|
5818
|
+
(0, import_react26.useEffect)(() => {
|
|
5612
5819
|
const onScroll = (scrollPosition) => {
|
|
5613
5820
|
if (domRef.current) {
|
|
5614
5821
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -5617,7 +5824,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5617
5824
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
5618
5825
|
return removeOnScroll;
|
|
5619
5826
|
}, [brain]);
|
|
5620
|
-
const domRef = (0,
|
|
5827
|
+
const domRef = (0, import_react26.useRef)(null);
|
|
5621
5828
|
const headerCls = HeaderClsRecipe({
|
|
5622
5829
|
overflow: false,
|
|
5623
5830
|
virtualized: true
|
|
@@ -5627,7 +5834,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5627
5834
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
5628
5835
|
style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
|
|
5629
5836
|
};
|
|
5630
|
-
const renderCell = (0,
|
|
5837
|
+
const renderCell = (0, import_react26.useCallback)((params) => {
|
|
5631
5838
|
const {
|
|
5632
5839
|
rowIndex,
|
|
5633
5840
|
colIndex,
|
|
@@ -5789,7 +5996,7 @@ function TableHeaderWrapper(props) {
|
|
|
5789
5996
|
|
|
5790
5997
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
5791
5998
|
var React28 = __toModule(require("react"));
|
|
5792
|
-
var
|
|
5999
|
+
var import_react27 = __toModule(require("react"));
|
|
5793
6000
|
|
|
5794
6001
|
// src/components/utils/decamelize.ts
|
|
5795
6002
|
function decamelize(str, options) {
|
|
@@ -5797,14 +6004,6 @@ function decamelize(str, options) {
|
|
|
5797
6004
|
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();
|
|
5798
6005
|
}
|
|
5799
6006
|
|
|
5800
|
-
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5801
|
-
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5802
|
-
var FooterCls = "_16lm1iw1";
|
|
5803
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
|
|
5804
|
-
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"]] });
|
|
5805
|
-
var InfiniteClsShiftingColumns = "_16lm1iwq";
|
|
5806
|
-
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5807
|
-
|
|
5808
6007
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
5809
6008
|
var defaultStyle = {
|
|
5810
6009
|
padding: ThemeVars.spacing[2],
|
|
@@ -5846,7 +6045,7 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
|
|
|
5846
6045
|
ref.current = node;
|
|
5847
6046
|
}
|
|
5848
6047
|
}, []);
|
|
5849
|
-
(0,
|
|
6048
|
+
(0, import_react27.useEffect)(() => {
|
|
5850
6049
|
const forceStyle = () => {
|
|
5851
6050
|
requestAnimationFrame(() => {
|
|
5852
6051
|
var _a;
|
|
@@ -5875,8 +6074,9 @@ var InfiniteTableLicenseFooter = React28.forwardRef(function InfiniteTableLicens
|
|
|
5875
6074
|
|
|
5876
6075
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5877
6076
|
var React29 = __toModule(require("react"));
|
|
5878
|
-
var
|
|
6077
|
+
var import_react28 = __toModule(require("react"));
|
|
5879
6078
|
var { rootClassName: rootClassName11 } = internalProps;
|
|
6079
|
+
var columnZIndexAtIndex6 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5880
6080
|
var InfiniteTableColumnCellContext = React29.createContext(null);
|
|
5881
6081
|
var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
|
|
5882
6082
|
function isColumnWithField(c) {
|
|
@@ -5933,7 +6133,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5933
6133
|
value
|
|
5934
6134
|
});
|
|
5935
6135
|
}
|
|
5936
|
-
const onClick = (0,
|
|
6136
|
+
const onClick = (0, import_react28.useCallback)(() => {
|
|
5937
6137
|
if (keyboardNavigation === "row") {
|
|
5938
6138
|
componentActions.activeRowIndex = rowIndex;
|
|
5939
6139
|
return;
|
|
@@ -5973,7 +6173,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5973
6173
|
isGroupRow,
|
|
5974
6174
|
rowIndex,
|
|
5975
6175
|
toggleGroupRow,
|
|
5976
|
-
toggleCurrentGroupRow: (0,
|
|
6176
|
+
toggleCurrentGroupRow: (0, import_react28.useCallback)(() => {
|
|
5977
6177
|
if (!rowInfo.isGroupRow) {
|
|
5978
6178
|
return;
|
|
5979
6179
|
}
|
|
@@ -5982,7 +6182,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5982
6182
|
groupBy: computedDataSource.groupBy,
|
|
5983
6183
|
pivotBy: computedDataSource.pivotBy
|
|
5984
6184
|
});
|
|
5985
|
-
const renderChildren = (0,
|
|
6185
|
+
const renderChildren = (0, import_react28.useCallback)(() => {
|
|
5986
6186
|
if (hidden) {
|
|
5987
6187
|
return null;
|
|
5988
6188
|
}
|
|
@@ -6006,7 +6206,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6006
6206
|
}
|
|
6007
6207
|
style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
|
|
6008
6208
|
style.height = rowHeight;
|
|
6009
|
-
|
|
6209
|
+
style.zIndex = `var(${columnZIndexAtIndex6}-${column.computedVisibleIndex})`;
|
|
6210
|
+
const memoizedStyle = (0, import_react28.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
|
|
6010
6211
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
6011
6212
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
6012
6213
|
const cellProps = {
|
|
@@ -6029,7 +6230,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6029
6230
|
}
|
|
6030
6231
|
var InfiniteTableColumnCell = React29.memo(InfiniteTableColumnCellFn);
|
|
6031
6232
|
function useInfiniteColumnCell() {
|
|
6032
|
-
const result = (0,
|
|
6233
|
+
const result = (0, import_react28.useContext)(InfiniteTableColumnCellContext);
|
|
6033
6234
|
return result;
|
|
6034
6235
|
}
|
|
6035
6236
|
|
|
@@ -6043,8 +6244,8 @@ var RowHoverCls = "_7pupv01";
|
|
|
6043
6244
|
var React30 = __toModule(require("react"));
|
|
6044
6245
|
|
|
6045
6246
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
6046
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
6047
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
6247
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11" };
|
|
6248
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwx _16lm1iwz _16lm1iw13 _16lm1iw11";
|
|
6048
6249
|
var LoadMaskTextCls = "qy58ya4";
|
|
6049
6250
|
|
|
6050
6251
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -6076,24 +6277,40 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6076
6277
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
6077
6278
|
const state = getState();
|
|
6078
6279
|
const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6280
|
+
if (!scrollPosition) {
|
|
6281
|
+
return false;
|
|
6282
|
+
}
|
|
6079
6283
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6284
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6285
|
+
if (scrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6286
|
+
return false;
|
|
6287
|
+
}
|
|
6080
6288
|
if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6081
6289
|
state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
|
|
6082
6290
|
}
|
|
6291
|
+
return true;
|
|
6083
6292
|
},
|
|
6084
6293
|
scrollColumnIntoView(colId, config = { offset: 0 }) {
|
|
6085
6294
|
const state = getState();
|
|
6086
6295
|
const computed = getComputed();
|
|
6087
6296
|
const computedColumn = computed.computedVisibleColumnsMap.get(colId);
|
|
6088
6297
|
if (!computedColumn) {
|
|
6089
|
-
return;
|
|
6298
|
+
return false;
|
|
6090
6299
|
}
|
|
6091
6300
|
const colIndex = computedColumn.computedVisibleIndex;
|
|
6092
6301
|
const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6302
|
+
if (!scrollPosition) {
|
|
6303
|
+
return false;
|
|
6304
|
+
}
|
|
6093
6305
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6306
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6307
|
+
if (scrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6308
|
+
return false;
|
|
6309
|
+
}
|
|
6094
6310
|
if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6095
6311
|
state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
|
|
6096
6312
|
}
|
|
6313
|
+
return true;
|
|
6097
6314
|
},
|
|
6098
6315
|
scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
|
|
6099
6316
|
const state = getState();
|
|
@@ -6102,30 +6319,45 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
|
|
|
6102
6319
|
if (typeof colIdOrIndex === "string") {
|
|
6103
6320
|
const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
|
|
6104
6321
|
if (!computedColumn) {
|
|
6105
|
-
return;
|
|
6322
|
+
return false;
|
|
6106
6323
|
}
|
|
6107
6324
|
colIndex = computedColumn.computedVisibleIndex;
|
|
6108
6325
|
}
|
|
6109
6326
|
const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
6110
6327
|
const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
6328
|
+
if (!scrollPositionForCol || !scrollPositionForRow) {
|
|
6329
|
+
return false;
|
|
6330
|
+
}
|
|
6111
6331
|
const newScrollPosition = {
|
|
6112
6332
|
scrollLeft: scrollPositionForCol.scrollLeft,
|
|
6113
6333
|
scrollTop: scrollPositionForRow.scrollTop
|
|
6114
6334
|
};
|
|
6115
6335
|
const currentScrollPosition = state.brain.getScrollPosition();
|
|
6336
|
+
const scrollLeftMax = state.brain.scrollLeftMax;
|
|
6337
|
+
const scrollTopMax = state.brain.scrollTopMax;
|
|
6338
|
+
if (newScrollPosition.scrollLeft > scrollLeftMax + (config.offset || 0)) {
|
|
6339
|
+
return false;
|
|
6340
|
+
}
|
|
6341
|
+
if (newScrollPosition.scrollTop > scrollTopMax + (config.offset || 0)) {
|
|
6342
|
+
return false;
|
|
6343
|
+
}
|
|
6116
6344
|
if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
6117
6345
|
state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
|
|
6118
6346
|
}
|
|
6119
6347
|
if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
6120
6348
|
state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
|
|
6121
6349
|
}
|
|
6350
|
+
return true;
|
|
6122
6351
|
}
|
|
6123
6352
|
};
|
|
6353
|
+
if (false) {
|
|
6354
|
+
globalThis.imperativeApi = imperativeApi;
|
|
6355
|
+
}
|
|
6124
6356
|
return imperativeApi;
|
|
6125
6357
|
}
|
|
6126
6358
|
|
|
6127
6359
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
6128
|
-
var
|
|
6360
|
+
var import_react29 = __toModule(require("react"));
|
|
6129
6361
|
var OFFSET = 10;
|
|
6130
6362
|
function getColumnContentMaxWidths(domRef, options) {
|
|
6131
6363
|
var _a;
|
|
@@ -6191,11 +6423,11 @@ function useAutoSizeColumns() {
|
|
|
6191
6423
|
componentActions,
|
|
6192
6424
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
6193
6425
|
} = useComponentState();
|
|
6194
|
-
const [refreshId, setRefreshId] = (0,
|
|
6426
|
+
const [refreshId, setRefreshId] = (0, import_react29.useState)(0);
|
|
6195
6427
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
6196
6428
|
const getTheKey = useLatest(theKey);
|
|
6197
|
-
const lastExecutedIdentifierRef = (0,
|
|
6198
|
-
(0,
|
|
6429
|
+
const lastExecutedIdentifierRef = (0, import_react29.useRef)(null);
|
|
6430
|
+
(0, import_react29.useEffect)(() => {
|
|
6199
6431
|
const key = getTheKey();
|
|
6200
6432
|
if (key == null) {
|
|
6201
6433
|
return;
|
|
@@ -6208,7 +6440,7 @@ function useAutoSizeColumns() {
|
|
|
6208
6440
|
};
|
|
6209
6441
|
return brain.onRenderRangeChange(onChange);
|
|
6210
6442
|
}, [brain]);
|
|
6211
|
-
(0,
|
|
6443
|
+
(0, import_react29.useEffect)(() => {
|
|
6212
6444
|
var _a;
|
|
6213
6445
|
if (theKey == null) {
|
|
6214
6446
|
return;
|
|
@@ -6253,8 +6485,8 @@ function useAutoSizeColumns() {
|
|
|
6253
6485
|
}
|
|
6254
6486
|
|
|
6255
6487
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
6488
|
+
var import_react30 = __toModule(require("react"));
|
|
6256
6489
|
var import_react31 = __toModule(require("react"));
|
|
6257
|
-
var import_react32 = __toModule(require("react"));
|
|
6258
6490
|
|
|
6259
6491
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
6260
6492
|
function useYourBrain(param) {
|
|
@@ -6324,13 +6556,13 @@ function useCellRendering(param) {
|
|
|
6324
6556
|
bodySize,
|
|
6325
6557
|
rowspan
|
|
6326
6558
|
});
|
|
6327
|
-
const scrollTopMaxRef = (0,
|
|
6328
|
-
(0,
|
|
6559
|
+
const scrollTopMaxRef = (0, import_react30.useRef)(0);
|
|
6560
|
+
(0, import_react30.useEffect)(() => {
|
|
6329
6561
|
return brain.onRenderCountChange(() => {
|
|
6330
6562
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
6331
6563
|
});
|
|
6332
6564
|
}, [brain]);
|
|
6333
|
-
(0,
|
|
6565
|
+
(0, import_react30.useEffect)(() => {
|
|
6334
6566
|
return brain.onScrollStop((scrollPosition) => {
|
|
6335
6567
|
const { scrollTop } = scrollPosition;
|
|
6336
6568
|
if (scrollTop === 0) {
|
|
@@ -6347,7 +6579,7 @@ function useCellRendering(param) {
|
|
|
6347
6579
|
}
|
|
6348
6580
|
});
|
|
6349
6581
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
6350
|
-
(0,
|
|
6582
|
+
(0, import_react30.useEffect)(() => {
|
|
6351
6583
|
if (!bodySize.height) {
|
|
6352
6584
|
return;
|
|
6353
6585
|
}
|
|
@@ -6358,10 +6590,10 @@ function useCellRendering(param) {
|
|
|
6358
6590
|
}
|
|
6359
6591
|
}, [!!bodySize.height]);
|
|
6360
6592
|
const [, rerender] = useRerender();
|
|
6361
|
-
(0,
|
|
6593
|
+
(0, import_react30.useEffect)(() => {
|
|
6362
6594
|
rerender();
|
|
6363
6595
|
}, [dataSourceState]);
|
|
6364
|
-
const renderCell = (0,
|
|
6596
|
+
const renderCell = (0, import_react30.useCallback)((params) => {
|
|
6365
6597
|
const {
|
|
6366
6598
|
rowIndex,
|
|
6367
6599
|
colIndex,
|
|
@@ -6396,7 +6628,7 @@ function useCellRendering(param) {
|
|
|
6396
6628
|
rowStyle,
|
|
6397
6629
|
rowClassName
|
|
6398
6630
|
};
|
|
6399
|
-
return /* @__PURE__ */
|
|
6631
|
+
return /* @__PURE__ */ import_react31.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
6400
6632
|
}, [
|
|
6401
6633
|
rowHeight,
|
|
6402
6634
|
getData,
|
|
@@ -6414,13 +6646,13 @@ function useCellRendering(param) {
|
|
|
6414
6646
|
}
|
|
6415
6647
|
|
|
6416
6648
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
6417
|
-
var
|
|
6649
|
+
var import_react45 = __toModule(require("react"));
|
|
6418
6650
|
|
|
6419
6651
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6420
|
-
var
|
|
6652
|
+
var import_react33 = __toModule(require("react"));
|
|
6421
6653
|
|
|
6422
6654
|
// src/components/hooks/useInterceptedMap.ts
|
|
6423
|
-
var
|
|
6655
|
+
var import_react32 = __toModule(require("react"));
|
|
6424
6656
|
function interceptMap(map2, fns) {
|
|
6425
6657
|
const { set, delete: deleteKey, clear } = map2;
|
|
6426
6658
|
if (fns.set) {
|
|
@@ -6484,20 +6716,6 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
6484
6716
|
return map2;
|
|
6485
6717
|
}
|
|
6486
6718
|
|
|
6487
|
-
// src/components/InfiniteTable/utils/rafFn.ts
|
|
6488
|
-
var rafFn = (fn) => {
|
|
6489
|
-
let rafId = 0;
|
|
6490
|
-
return (...args) => {
|
|
6491
|
-
if (rafId) {
|
|
6492
|
-
cancelAnimationFrame(rafId);
|
|
6493
|
-
}
|
|
6494
|
-
rafId = requestAnimationFrame(() => {
|
|
6495
|
-
rafId = 0;
|
|
6496
|
-
fn(...args);
|
|
6497
|
-
});
|
|
6498
|
-
};
|
|
6499
|
-
};
|
|
6500
|
-
|
|
6501
6719
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
6502
6720
|
function useColumnGroups() {
|
|
6503
6721
|
const {
|
|
@@ -6508,7 +6726,7 @@ function useColumnGroups() {
|
|
|
6508
6726
|
componentActions,
|
|
6509
6727
|
getComponentState
|
|
6510
6728
|
} = useComponentState();
|
|
6511
|
-
(0,
|
|
6729
|
+
(0, import_react33.useEffect)(() => {
|
|
6512
6730
|
const recompute = () => {
|
|
6513
6731
|
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
6514
6732
|
};
|
|
@@ -6519,7 +6737,7 @@ function useColumnGroups() {
|
|
|
6519
6737
|
set: update
|
|
6520
6738
|
});
|
|
6521
6739
|
}, [computedColumnGroups]);
|
|
6522
|
-
(0,
|
|
6740
|
+
(0, import_react33.useEffect)(() => {
|
|
6523
6741
|
return interceptMap(collapsedColumnGroups, {
|
|
6524
6742
|
set: (key, visibleCol) => {
|
|
6525
6743
|
const colIds = key.slice(1);
|
|
@@ -6554,10 +6772,10 @@ function useColumnGroups() {
|
|
|
6554
6772
|
}
|
|
6555
6773
|
|
|
6556
6774
|
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
6557
|
-
var
|
|
6775
|
+
var import_react34 = __toModule(require("react"));
|
|
6558
6776
|
function useColumnRowspan(computedVisibleColumns) {
|
|
6559
6777
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
6560
|
-
const rowspan = (0,
|
|
6778
|
+
const rowspan = (0, import_react34.useMemo)(() => {
|
|
6561
6779
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
6562
6780
|
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
6563
6781
|
const dataArray = getDataSourceState().dataArray;
|
|
@@ -6583,10 +6801,10 @@ function useColumnRowspan(computedVisibleColumns) {
|
|
|
6583
6801
|
}
|
|
6584
6802
|
|
|
6585
6803
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
6586
|
-
var
|
|
6804
|
+
var import_react35 = __toModule(require("react"));
|
|
6587
6805
|
var debug4 = dbg("useColumnSizeFn");
|
|
6588
6806
|
function useColumnSizeFn(columns) {
|
|
6589
|
-
const columnSize = (0,
|
|
6807
|
+
const columnSize = (0, import_react35.useCallback)((index) => {
|
|
6590
6808
|
const column = columns[index];
|
|
6591
6809
|
if (false) {
|
|
6592
6810
|
debug4("cannot find column at index", index, columns);
|
|
@@ -6597,7 +6815,7 @@ function useColumnSizeFn(columns) {
|
|
|
6597
6815
|
}
|
|
6598
6816
|
|
|
6599
6817
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
6600
|
-
var
|
|
6818
|
+
var import_react41 = __toModule(require("react"));
|
|
6601
6819
|
|
|
6602
6820
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
6603
6821
|
var React34 = __toModule(require("react"));
|
|
@@ -6612,7 +6830,7 @@ var showLoadingIcon = (rowInfo) => {
|
|
|
6612
6830
|
|
|
6613
6831
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
6614
6832
|
var React32 = __toModule(require("react"));
|
|
6615
|
-
var
|
|
6833
|
+
var import_react36 = __toModule(require("react"));
|
|
6616
6834
|
|
|
6617
6835
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
6618
6836
|
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -6623,7 +6841,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ def
|
|
|
6623
6841
|
function ExpanderIcon(props) {
|
|
6624
6842
|
var _a;
|
|
6625
6843
|
const { size = 24 } = props;
|
|
6626
|
-
const [expanded, setExpanded] = (0,
|
|
6844
|
+
const [expanded, setExpanded] = (0, import_react36.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
6627
6845
|
const onClick = () => {
|
|
6628
6846
|
var _a2;
|
|
6629
6847
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -6824,11 +7042,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
6824
7042
|
}
|
|
6825
7043
|
|
|
6826
7044
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
6827
|
-
var
|
|
7045
|
+
var import_react37 = __toModule(require("react"));
|
|
6828
7046
|
function useEffectWithRaf(fn, deps) {
|
|
6829
|
-
const rafId = (0,
|
|
6830
|
-
const removeFnRaf = (0,
|
|
6831
|
-
(0,
|
|
7047
|
+
const rafId = (0, import_react37.useRef)(0);
|
|
7048
|
+
const removeFnRaf = (0, import_react37.useRef)();
|
|
7049
|
+
(0, import_react37.useEffect)(() => {
|
|
6832
7050
|
rafId.current = requestAnimationFrame(() => {
|
|
6833
7051
|
removeFnRaf.current = fn();
|
|
6834
7052
|
});
|
|
@@ -6845,7 +7063,7 @@ function useEffectWithRaf(fn, deps) {
|
|
|
6845
7063
|
}
|
|
6846
7064
|
|
|
6847
7065
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
6848
|
-
var
|
|
7066
|
+
var import_react40 = __toModule(require("react"));
|
|
6849
7067
|
|
|
6850
7068
|
// src/utils/groupAndPivot/index.ts
|
|
6851
7069
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
@@ -7486,15 +7704,15 @@ var GroupRowsState = class {
|
|
|
7486
7704
|
};
|
|
7487
7705
|
|
|
7488
7706
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7489
|
-
var
|
|
7707
|
+
var import_react39 = __toModule(require("react"));
|
|
7490
7708
|
|
|
7491
7709
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7492
|
-
var
|
|
7710
|
+
var import_react38 = __toModule(require("react"));
|
|
7493
7711
|
function useEffectWithChanges(fn, deps) {
|
|
7494
|
-
const prevRef = (0,
|
|
7495
|
-
const oldValuesRef = (0,
|
|
7712
|
+
const prevRef = (0, import_react38.useRef)({});
|
|
7713
|
+
const oldValuesRef = (0, import_react38.useRef)({});
|
|
7496
7714
|
const oldValues = oldValuesRef.current;
|
|
7497
|
-
const changesRef = (0,
|
|
7715
|
+
const changesRef = (0, import_react38.useRef)({});
|
|
7498
7716
|
const changes = changesRef.current;
|
|
7499
7717
|
const useEffectDeps = [];
|
|
7500
7718
|
for (const k in deps) {
|
|
@@ -7507,7 +7725,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
7507
7725
|
}
|
|
7508
7726
|
}
|
|
7509
7727
|
prevRef.current = deps;
|
|
7510
|
-
(0,
|
|
7728
|
+
(0, import_react38.useEffect)(() => {
|
|
7511
7729
|
const changes2 = changesRef.current;
|
|
7512
7730
|
const result = fn(changes2, oldValues);
|
|
7513
7731
|
changesRef.current = {};
|
|
@@ -7775,12 +7993,12 @@ function useLoadData() {
|
|
|
7775
7993
|
livePaginationCursor,
|
|
7776
7994
|
cursorId: stateCursorId
|
|
7777
7995
|
} = componentState;
|
|
7778
|
-
const [scrollbars, setScrollbars] = (0,
|
|
7996
|
+
const [scrollbars, setScrollbars] = (0, import_react39.useState)({
|
|
7779
7997
|
vertical: false,
|
|
7780
7998
|
horizontal: false
|
|
7781
7999
|
});
|
|
7782
|
-
const scrollbarsRef = (0,
|
|
7783
|
-
(0,
|
|
8000
|
+
const scrollbarsRef = (0, import_react39.useRef)(scrollbars);
|
|
8001
|
+
(0, import_react39.useEffect)(() => {
|
|
7784
8002
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
7785
8003
|
if (!scrollbars2) {
|
|
7786
8004
|
return;
|
|
@@ -7790,7 +8008,7 @@ function useLoadData() {
|
|
|
7790
8008
|
});
|
|
7791
8009
|
return () => notifyScrollbarsChange.destroy();
|
|
7792
8010
|
}, [notifyScrollbarsChange]);
|
|
7793
|
-
(0,
|
|
8011
|
+
(0, import_react39.useEffect)(() => {
|
|
7794
8012
|
if (!livePagination) {
|
|
7795
8013
|
return;
|
|
7796
8014
|
}
|
|
@@ -7804,7 +8022,7 @@ function useLoadData() {
|
|
|
7804
8022
|
});
|
|
7805
8023
|
return () => cancelAnimationFrame(frameId);
|
|
7806
8024
|
}, [livePaginationCursor]);
|
|
7807
|
-
(0,
|
|
8025
|
+
(0, import_react39.useEffect)(() => {
|
|
7808
8026
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
7809
8027
|
return;
|
|
7810
8028
|
}
|
|
@@ -7818,7 +8036,7 @@ function useLoadData() {
|
|
|
7818
8036
|
});
|
|
7819
8037
|
return () => cancelAnimationFrame(frameId);
|
|
7820
8038
|
}, [dataArray.length, livePaginationCursor]);
|
|
7821
|
-
(0,
|
|
8039
|
+
(0, import_react39.useEffect)(() => {
|
|
7822
8040
|
const state = getComponentState();
|
|
7823
8041
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
7824
8042
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -7836,7 +8054,7 @@ function useLoadData() {
|
|
|
7836
8054
|
filterValue,
|
|
7837
8055
|
cursorId: livePagination ? stateCursorId : null
|
|
7838
8056
|
};
|
|
7839
|
-
const initialRef = (0,
|
|
8057
|
+
const initialRef = (0, import_react39.useRef)(true);
|
|
7840
8058
|
useLazyLoadRange();
|
|
7841
8059
|
useEffectWithChanges(() => {
|
|
7842
8060
|
const componentState2 = getComponentState();
|
|
@@ -7868,7 +8086,7 @@ function useLazyLoadRange() {
|
|
|
7868
8086
|
componentActions: actions,
|
|
7869
8087
|
componentState
|
|
7870
8088
|
} = useComponentState();
|
|
7871
|
-
(0,
|
|
8089
|
+
(0, import_react39.useEffect)(() => {
|
|
7872
8090
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
7873
8091
|
}, [componentState.data, componentState.dataParams]);
|
|
7874
8092
|
const {
|
|
@@ -7877,7 +8095,7 @@ function useLazyLoadRange() {
|
|
|
7877
8095
|
dataArray,
|
|
7878
8096
|
scrollStopDelayUpdatedByTable
|
|
7879
8097
|
} = componentState;
|
|
7880
|
-
const latestRenderRangeRef = (0,
|
|
8098
|
+
const latestRenderRangeRef = (0, import_react39.useRef)(null);
|
|
7881
8099
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
7882
8100
|
const componentState2 = getComponentState();
|
|
7883
8101
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -7896,8 +8114,8 @@ function useLazyLoadRange() {
|
|
|
7896
8114
|
componentActions: actions
|
|
7897
8115
|
}, cache);
|
|
7898
8116
|
};
|
|
7899
|
-
const debouncedLoadRange = (0,
|
|
7900
|
-
(0,
|
|
8117
|
+
const debouncedLoadRange = (0, import_react39.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8118
|
+
(0, import_react39.useEffect)(() => {
|
|
7901
8119
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
7902
8120
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
7903
8121
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -7906,7 +8124,7 @@ function useLazyLoadRange() {
|
|
|
7906
8124
|
}
|
|
7907
8125
|
return;
|
|
7908
8126
|
}, [lazyLoadBatchSize]);
|
|
7909
|
-
(0,
|
|
8127
|
+
(0, import_react39.useEffect)(() => {
|
|
7910
8128
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
7911
8129
|
debouncedLoadRange();
|
|
7912
8130
|
}
|
|
@@ -8747,7 +8965,7 @@ function DataSource(props) {
|
|
|
8747
8965
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
8748
8966
|
function useToggleGroupRow() {
|
|
8749
8967
|
const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
8750
|
-
const toggleGroupRow = (0,
|
|
8968
|
+
const toggleGroupRow = (0, import_react40.useCallback)((groupKeys) => {
|
|
8751
8969
|
const state = getDataSourceState();
|
|
8752
8970
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
8753
8971
|
newState.toggleGroupRow(groupKeys);
|
|
@@ -8779,7 +8997,7 @@ function useToggleGroupRow() {
|
|
|
8779
8997
|
|
|
8780
8998
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
8781
8999
|
function useGroupByMap(groupBy) {
|
|
8782
|
-
const groupByMap = (0,
|
|
9000
|
+
const groupByMap = (0, import_react41.useMemo)(() => {
|
|
8783
9001
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
8784
9002
|
acc.set(groupBy2.field, {
|
|
8785
9003
|
groupBy: groupBy2,
|
|
@@ -8803,13 +9021,13 @@ function useColumnsWhen() {
|
|
|
8803
9021
|
}
|
|
8804
9022
|
} = useComponentState();
|
|
8805
9023
|
const groupByMap = useGroupByMap(groupBy);
|
|
8806
|
-
(0,
|
|
9024
|
+
(0, import_react41.useEffect)(() => {
|
|
8807
9025
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
8808
9026
|
}, [groupRenderStrategy]);
|
|
8809
|
-
(0,
|
|
9027
|
+
(0, import_react41.useEffect)(() => {
|
|
8810
9028
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
8811
9029
|
}, [pivotTotalColumnPosition]);
|
|
8812
|
-
(0,
|
|
9030
|
+
(0, import_react41.useEffect)(() => {
|
|
8813
9031
|
if (pivotGrandTotalColumnPosition != void 0) {
|
|
8814
9032
|
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
8815
9033
|
}
|
|
@@ -8883,7 +9101,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
8883
9101
|
});
|
|
8884
9102
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
8885
9103
|
}
|
|
8886
|
-
(0,
|
|
9104
|
+
(0, import_react41.useEffect)(() => {
|
|
8887
9105
|
const update = () => {
|
|
8888
9106
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
8889
9107
|
};
|
|
@@ -8912,7 +9130,7 @@ function useColumnsWhenGrouping() {
|
|
|
8912
9130
|
}
|
|
8913
9131
|
} = useComponentState();
|
|
8914
9132
|
const toggleGroupRow = useToggleGroupRow();
|
|
8915
|
-
(0,
|
|
9133
|
+
(0, import_react41.useEffect)(() => {
|
|
8916
9134
|
const update = () => {
|
|
8917
9135
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
8918
9136
|
columns,
|
|
@@ -9048,7 +9266,7 @@ function useHideColumns(groupByMap) {
|
|
|
9048
9266
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
9049
9267
|
hideEmptyGroupColumns
|
|
9050
9268
|
]);
|
|
9051
|
-
(0,
|
|
9269
|
+
(0, import_react41.useEffect)(() => {
|
|
9052
9270
|
const isGrouped = groupBy.length > 0;
|
|
9053
9271
|
const currentState = getComponentState();
|
|
9054
9272
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -9163,7 +9381,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
9163
9381
|
}
|
|
9164
9382
|
|
|
9165
9383
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
9166
|
-
var
|
|
9384
|
+
var import_react43 = __toModule(require("react"));
|
|
9167
9385
|
|
|
9168
9386
|
// src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
|
|
9169
9387
|
var order = ["start", void 0, "end"];
|
|
@@ -9213,7 +9431,7 @@ var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId)
|
|
|
9213
9431
|
};
|
|
9214
9432
|
var getComputedPinned = (colId, columnPinning) => {
|
|
9215
9433
|
const pinned = columnPinning.get(colId);
|
|
9216
|
-
const computedPinned = pinned === "start" ? "start" : pinned === "end" ? "end" : false;
|
|
9434
|
+
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
9217
9435
|
return computedPinned;
|
|
9218
9436
|
};
|
|
9219
9437
|
var getComputedVisibleColumns = ({
|
|
@@ -9349,6 +9567,7 @@ var getComputedVisibleColumns = ({
|
|
|
9349
9567
|
const id = visibleColumnOrder[i];
|
|
9350
9568
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
9351
9569
|
const colType = getColumnComputedType(c, columnTypes);
|
|
9570
|
+
const computedVisibleIndex = i;
|
|
9352
9571
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
9353
9572
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
9354
9573
|
const computedSorted = !!computedSortInfo;
|
|
@@ -9361,7 +9580,15 @@ var getComputedVisibleColumns = ({
|
|
|
9361
9580
|
const computedMaxWidth = maxSizes[i] || 1e4;
|
|
9362
9581
|
const computedPinned = getComputedPinned(id, columnPinning);
|
|
9363
9582
|
const computedLast = i === visibleColumnOrder.length - 1;
|
|
9583
|
+
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9364
9584
|
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
9585
|
+
if (computedPinned == "start") {
|
|
9586
|
+
computedVisibleIndexInCategory = computedVisibleIndex;
|
|
9587
|
+
} else if (computedPinned === "end") {
|
|
9588
|
+
computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
|
|
9589
|
+
} else {
|
|
9590
|
+
computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
|
|
9591
|
+
}
|
|
9365
9592
|
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
9366
9593
|
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
9367
9594
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
@@ -9410,6 +9637,7 @@ var getComputedVisibleColumns = ({
|
|
|
9410
9637
|
computedWidth,
|
|
9411
9638
|
computedAbsoluteOffset,
|
|
9412
9639
|
computedPinningOffset,
|
|
9640
|
+
computedVisibleIndexInCategory,
|
|
9413
9641
|
computedOffset,
|
|
9414
9642
|
computedSortable,
|
|
9415
9643
|
computedSortInfo,
|
|
@@ -9418,7 +9646,7 @@ var getComputedVisibleColumns = ({
|
|
|
9418
9646
|
computedSorted,
|
|
9419
9647
|
computedSortedAsc,
|
|
9420
9648
|
computedSortedDesc,
|
|
9421
|
-
computedVisibleIndex
|
|
9649
|
+
computedVisibleIndex,
|
|
9422
9650
|
computedPinned,
|
|
9423
9651
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
9424
9652
|
computedFirstInCategory,
|
|
@@ -9511,10 +9739,10 @@ var getComputedVisibleColumns = ({
|
|
|
9511
9739
|
};
|
|
9512
9740
|
|
|
9513
9741
|
// src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
|
|
9514
|
-
var
|
|
9742
|
+
var import_react42 = __toModule(require("react"));
|
|
9515
9743
|
var useRerenderOnKeyChange = (map2) => {
|
|
9516
9744
|
const [renderId, rerender] = useRerender();
|
|
9517
|
-
(0,
|
|
9745
|
+
(0, import_react42.useEffect)(() => {
|
|
9518
9746
|
const update = rafFn(rerender);
|
|
9519
9747
|
return interceptMap(map2, {
|
|
9520
9748
|
set: update,
|
|
@@ -9568,7 +9796,7 @@ var useComputedVisibleColumns = ({
|
|
|
9568
9796
|
computedPinnedEndOffset,
|
|
9569
9797
|
computedPinnedEndWidth,
|
|
9570
9798
|
computedPinnedStartWidth
|
|
9571
|
-
} = (0,
|
|
9799
|
+
} = (0, import_react43.useMemo)(() => {
|
|
9572
9800
|
return getComputedVisibleColumns({
|
|
9573
9801
|
columns,
|
|
9574
9802
|
bodySize,
|
|
@@ -9639,7 +9867,7 @@ var useComputedVisibleColumns = ({
|
|
|
9639
9867
|
};
|
|
9640
9868
|
|
|
9641
9869
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
9642
|
-
var
|
|
9870
|
+
var import_react44 = __toModule(require("react"));
|
|
9643
9871
|
var INITIAL_SCROLLBARS = {
|
|
9644
9872
|
vertical: false,
|
|
9645
9873
|
horizontal: false
|
|
@@ -9647,8 +9875,8 @@ var INITIAL_SCROLLBARS = {
|
|
|
9647
9875
|
function useScrollbars(brain) {
|
|
9648
9876
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
9649
9877
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
9650
|
-
const [scrollbars, setScrollbars] = (0,
|
|
9651
|
-
(0,
|
|
9878
|
+
const [scrollbars, setScrollbars] = (0, import_react44.useState)(INITIAL_SCROLLBARS);
|
|
9879
|
+
(0, import_react44.useEffect)(() => {
|
|
9652
9880
|
return brain.onRenderCountChange(() => {
|
|
9653
9881
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
9654
9882
|
setScrollbars({
|
|
@@ -9657,7 +9885,7 @@ function useScrollbars(brain) {
|
|
|
9657
9885
|
});
|
|
9658
9886
|
});
|
|
9659
9887
|
}, [brain]);
|
|
9660
|
-
(0,
|
|
9888
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
9661
9889
|
const dataSourceState = getDataSourceState();
|
|
9662
9890
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
9663
9891
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -9688,7 +9916,7 @@ function useComputed() {
|
|
|
9688
9916
|
bodySize,
|
|
9689
9917
|
showSeparatePivotColumnForSingleAggregation
|
|
9690
9918
|
} = componentState;
|
|
9691
|
-
(0,
|
|
9919
|
+
(0, import_react45.useState)(() => {
|
|
9692
9920
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
9693
9921
|
if (rowHeight) {
|
|
9694
9922
|
componentActions.rowHeight = rowHeight;
|
|
@@ -9700,13 +9928,13 @@ function useComputed() {
|
|
|
9700
9928
|
}
|
|
9701
9929
|
});
|
|
9702
9930
|
});
|
|
9703
|
-
(0,
|
|
9931
|
+
(0, import_react45.useEffect)(() => {
|
|
9704
9932
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
9705
9933
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
9706
9934
|
const { multiSort, filterValue } = dataSourceState;
|
|
9707
9935
|
useColumnGroups();
|
|
9708
9936
|
const { toggleGroupRow } = useColumnsWhen();
|
|
9709
|
-
const setSortInfo = (0,
|
|
9937
|
+
const setSortInfo = (0, import_react45.useCallback)((sortInfo) => {
|
|
9710
9938
|
var _a2;
|
|
9711
9939
|
const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
9712
9940
|
dataSourceActions.sortInfo = newSortInfo;
|
|
@@ -9783,109 +10011,8 @@ function useComputed() {
|
|
|
9783
10011
|
};
|
|
9784
10012
|
}
|
|
9785
10013
|
|
|
9786
|
-
// src/components/InfiniteTable/hooks/useDOMProps.ts
|
|
9787
|
-
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
9788
|
-
var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
9789
|
-
var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
|
|
9790
|
-
var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
|
|
9791
|
-
function useDOMProps(initialDOMProps) {
|
|
9792
|
-
const { computed, componentState, componentActions } = useInfiniteTable();
|
|
9793
|
-
const {
|
|
9794
|
-
columnShifts,
|
|
9795
|
-
focused,
|
|
9796
|
-
focusedWithin,
|
|
9797
|
-
domRef,
|
|
9798
|
-
onBlurWithin,
|
|
9799
|
-
onFocusWithin,
|
|
9800
|
-
onSelfFocus,
|
|
9801
|
-
onSelfBlur,
|
|
9802
|
-
activeCellIndex
|
|
9803
|
-
} = componentState;
|
|
9804
|
-
const {
|
|
9805
|
-
computedPinnedStartColumnsWidth,
|
|
9806
|
-
computedPinnedEndColumnsWidth,
|
|
9807
|
-
computedVisibleColumns
|
|
9808
|
-
} = computed;
|
|
9809
|
-
const cssVars = computedVisibleColumns.reduce((vars, col) => {
|
|
9810
|
-
const index = col.computedVisibleIndex;
|
|
9811
|
-
vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
|
|
9812
|
-
vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
|
|
9813
|
-
return vars;
|
|
9814
|
-
}, {});
|
|
9815
|
-
if (activeCellIndex != null) {
|
|
9816
|
-
cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
|
|
9817
|
-
cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
|
|
9818
|
-
}
|
|
9819
|
-
const setFocused = rafFn((focused2) => {
|
|
9820
|
-
componentActions.focused = focused2;
|
|
9821
|
-
});
|
|
9822
|
-
const setFocusedWithin = rafFn((focused2) => {
|
|
9823
|
-
componentActions.focusedWithin = focused2;
|
|
9824
|
-
});
|
|
9825
|
-
const onFocus = (event) => {
|
|
9826
|
-
var _a;
|
|
9827
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onFocus) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9828
|
-
if (event.target === domRef.current) {
|
|
9829
|
-
setFocused(true);
|
|
9830
|
-
onSelfFocus == null ? void 0 : onSelfFocus(event);
|
|
9831
|
-
if (focusedWithin) {
|
|
9832
|
-
setFocusedWithin(false);
|
|
9833
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9834
|
-
}
|
|
9835
|
-
} else {
|
|
9836
|
-
if (!focusedWithin) {
|
|
9837
|
-
setFocusedWithin(true);
|
|
9838
|
-
onFocusWithin == null ? void 0 : onFocusWithin(event);
|
|
9839
|
-
}
|
|
9840
|
-
}
|
|
9841
|
-
};
|
|
9842
|
-
const onBlur = (event) => {
|
|
9843
|
-
var _a, _b;
|
|
9844
|
-
(_a = initialDOMProps == null ? void 0 : initialDOMProps.onBlur) == null ? void 0 : _a.call(initialDOMProps, event);
|
|
9845
|
-
if (event.target === domRef.current) {
|
|
9846
|
-
setFocused(false);
|
|
9847
|
-
onSelfBlur == null ? void 0 : onSelfBlur(event);
|
|
9848
|
-
if (focusedWithin) {
|
|
9849
|
-
setFocusedWithin(false);
|
|
9850
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9851
|
-
}
|
|
9852
|
-
} else {
|
|
9853
|
-
const contained = (_b = domRef.current) == null ? void 0 : _b.contains(event.relatedTarget);
|
|
9854
|
-
if (!contained) {
|
|
9855
|
-
setFocusedWithin(false);
|
|
9856
|
-
onBlurWithin == null ? void 0 : onBlurWithin(event);
|
|
9857
|
-
}
|
|
9858
|
-
}
|
|
9859
|
-
};
|
|
9860
|
-
const domProps = __spreadProps(__spreadValues({
|
|
9861
|
-
tabIndex: 0
|
|
9862
|
-
}, initialDOMProps), {
|
|
9863
|
-
onFocus,
|
|
9864
|
-
onBlur
|
|
9865
|
-
});
|
|
9866
|
-
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({
|
|
9867
|
-
hasPinnedStart: !!computedPinnedStartColumnsWidth,
|
|
9868
|
-
hasPinnedEnd: !!computedPinnedEndColumnsWidth,
|
|
9869
|
-
focused,
|
|
9870
|
-
focusedWithin
|
|
9871
|
-
}));
|
|
9872
|
-
domProps.className = className;
|
|
9873
|
-
domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
|
|
9874
|
-
if (focused) {
|
|
9875
|
-
if (componentState.focusedStyle) {
|
|
9876
|
-
Object.assign(domProps.style, componentState.focusedStyle);
|
|
9877
|
-
}
|
|
9878
|
-
}
|
|
9879
|
-
if (focusedWithin) {
|
|
9880
|
-
if (componentState.focusedWithinStyle) {
|
|
9881
|
-
Object.assign(domProps.style, componentState.focusedWithinStyle);
|
|
9882
|
-
}
|
|
9883
|
-
}
|
|
9884
|
-
return domProps;
|
|
9885
|
-
}
|
|
9886
|
-
|
|
9887
10014
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
9888
|
-
var
|
|
10015
|
+
var import_react46 = __toModule(require("react"));
|
|
9889
10016
|
|
|
9890
10017
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
9891
10018
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -10043,10 +10170,10 @@ var isInsideSandbox = () => {
|
|
|
10043
10170
|
};
|
|
10044
10171
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
10045
10172
|
var useLicense = (licenseKey = "") => {
|
|
10046
|
-
const valid = (0,
|
|
10173
|
+
const valid = (0, import_react46.useMemo)(() => {
|
|
10047
10174
|
let valid2 = isValidLicense(licenseKey, {
|
|
10048
10175
|
publishedAt: 1624970570587,
|
|
10049
|
-
version: "0.3.
|
|
10176
|
+
version: "0.3.17"
|
|
10050
10177
|
});
|
|
10051
10178
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
10052
10179
|
return true;
|
|
@@ -10056,6 +10183,73 @@ var useLicense = (licenseKey = "") => {
|
|
|
10056
10183
|
return valid;
|
|
10057
10184
|
};
|
|
10058
10185
|
|
|
10186
|
+
// src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
|
|
10187
|
+
var import_react47 = __toModule(require("react"));
|
|
10188
|
+
var RETRIES = 10;
|
|
10189
|
+
function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
10190
|
+
const didScrollRef = (0, import_react47.useRef)(false);
|
|
10191
|
+
const rafId = (0, import_react47.useRef)(null);
|
|
10192
|
+
(0, import_react47.useEffect)(() => {
|
|
10193
|
+
if (activeCellIndex != null) {
|
|
10194
|
+
didScrollRef.current = false;
|
|
10195
|
+
cancelAnimationFrame(rafId.current);
|
|
10196
|
+
}
|
|
10197
|
+
}, [activeCellIndex]);
|
|
10198
|
+
(0, import_react47.useEffect)(() => {
|
|
10199
|
+
if (activeCellIndex != null && !didScrollRef.current) {
|
|
10200
|
+
let tryScroll = function(times = 0) {
|
|
10201
|
+
times++;
|
|
10202
|
+
cancelAnimationFrame(rafId.current);
|
|
10203
|
+
rafId.current = requestAnimationFrame(() => {
|
|
10204
|
+
didScrollRef.current = imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10205
|
+
offset: 30
|
|
10206
|
+
});
|
|
10207
|
+
if (!didScrollRef.current && times < RETRIES) {
|
|
10208
|
+
tryScroll(times);
|
|
10209
|
+
}
|
|
10210
|
+
});
|
|
10211
|
+
};
|
|
10212
|
+
tryScroll();
|
|
10213
|
+
}
|
|
10214
|
+
return () => {
|
|
10215
|
+
cancelAnimationFrame(rafId.current);
|
|
10216
|
+
};
|
|
10217
|
+
}, [activeCellIndex, dataCount]);
|
|
10218
|
+
}
|
|
10219
|
+
|
|
10220
|
+
// src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
|
|
10221
|
+
var import_react48 = __toModule(require("react"));
|
|
10222
|
+
var RETRIES2 = 10;
|
|
10223
|
+
function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
|
|
10224
|
+
const didScrollRef = (0, import_react48.useRef)(false);
|
|
10225
|
+
const rafId = (0, import_react48.useRef)(null);
|
|
10226
|
+
(0, import_react48.useEffect)(() => {
|
|
10227
|
+
if (activeRowIndex != null) {
|
|
10228
|
+
didScrollRef.current = false;
|
|
10229
|
+
cancelAnimationFrame(rafId.current);
|
|
10230
|
+
}
|
|
10231
|
+
}, [activeRowIndex]);
|
|
10232
|
+
(0, import_react48.useEffect)(() => {
|
|
10233
|
+
if (activeRowIndex != null && !didScrollRef.current) {
|
|
10234
|
+
let tryScroll = function(times = 0) {
|
|
10235
|
+
times++;
|
|
10236
|
+
rafId.current = requestAnimationFrame(() => {
|
|
10237
|
+
didScrollRef.current = imperativeApi.scrollRowIntoView(activeRowIndex, {
|
|
10238
|
+
offset: 30
|
|
10239
|
+
});
|
|
10240
|
+
if (!didScrollRef.current && times < RETRIES2) {
|
|
10241
|
+
tryScroll(times);
|
|
10242
|
+
}
|
|
10243
|
+
});
|
|
10244
|
+
};
|
|
10245
|
+
tryScroll();
|
|
10246
|
+
}
|
|
10247
|
+
return () => {
|
|
10248
|
+
cancelAnimationFrame(rafId.current);
|
|
10249
|
+
};
|
|
10250
|
+
}, [activeRowIndex, dataCount]);
|
|
10251
|
+
}
|
|
10252
|
+
|
|
10059
10253
|
// src/components/utils/clamp.ts
|
|
10060
10254
|
function clamp(value, min, max) {
|
|
10061
10255
|
return Math.min(Math.max(value, min), max);
|
|
@@ -10204,7 +10398,7 @@ function handleKeyboardNavigation(options) {
|
|
|
10204
10398
|
}
|
|
10205
10399
|
|
|
10206
10400
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
10207
|
-
var
|
|
10401
|
+
var import_react49 = __toModule(require("react"));
|
|
10208
10402
|
|
|
10209
10403
|
// src/components/VirtualBrain/ScrollListener.ts
|
|
10210
10404
|
var initialScrollPosition = {
|
|
@@ -10299,11 +10493,10 @@ function initSetupState2() {
|
|
|
10299
10493
|
propsCache: new Map([]),
|
|
10300
10494
|
brain,
|
|
10301
10495
|
headerBrain,
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
activeCellIndicatorDOMRef: (0, import_react48.createRef)(),
|
|
10496
|
+
domRef: (0, import_react49.createRef)(),
|
|
10497
|
+
scrollerDOMRef: (0, import_react49.createRef)(),
|
|
10498
|
+
portalDOMRef: (0, import_react49.createRef)(),
|
|
10499
|
+
activeCellIndicatorDOMRef: (0, import_react49.createRef)(),
|
|
10307
10500
|
onRowHeightCSSVarChange: buildSubscriptionCallback(),
|
|
10308
10501
|
onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
|
|
10309
10502
|
bodySize: {
|
|
@@ -10314,11 +10507,11 @@ function initSetupState2() {
|
|
|
10314
10507
|
scrollTop: 0,
|
|
10315
10508
|
scrollLeft: 0
|
|
10316
10509
|
},
|
|
10510
|
+
columnReorderInProgress: false,
|
|
10317
10511
|
ready: false,
|
|
10318
10512
|
focused: false,
|
|
10319
10513
|
focusedWithin: false,
|
|
10320
10514
|
columnsWhenGrouping: columnsGeneratedForGrouping,
|
|
10321
|
-
draggingColumnId: null,
|
|
10322
10515
|
pinnedStartScrollListener: new ScrollListener(),
|
|
10323
10516
|
pinnedEndScrollListener: new ScrollListener(),
|
|
10324
10517
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
@@ -10372,7 +10565,6 @@ var forwardProps3 = (setupState) => {
|
|
|
10372
10565
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
10373
10566
|
pivotGrandTotalColumnPosition: 1,
|
|
10374
10567
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
10375
|
-
keyboardNavigation: (keyboardNavigation) => keyboardNavigation != null ? keyboardNavigation : "cell",
|
|
10376
10568
|
activeRowIndex: 1,
|
|
10377
10569
|
activeCellIndex: 1,
|
|
10378
10570
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
@@ -10419,7 +10611,7 @@ var cleanupState = (state) => {
|
|
|
10419
10611
|
state.pinnedStartScrollListener.destroy();
|
|
10420
10612
|
};
|
|
10421
10613
|
var mapPropsToState2 = (params) => {
|
|
10422
|
-
var _a, _b;
|
|
10614
|
+
var _a, _b, _c;
|
|
10423
10615
|
const { props, state, oldState, parentState } = params;
|
|
10424
10616
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
10425
10617
|
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;
|
|
@@ -10435,7 +10627,8 @@ var mapPropsToState2 = (params) => {
|
|
|
10435
10627
|
groupRenderStrategy,
|
|
10436
10628
|
groupBy,
|
|
10437
10629
|
computedColumns,
|
|
10438
|
-
|
|
10630
|
+
keyboardNavigation: (_a = state.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
10631
|
+
columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
|
|
10439
10632
|
columnGroupsDepthsMap,
|
|
10440
10633
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
10441
10634
|
computedColumnGroups,
|
|
@@ -10472,11 +10665,11 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10472
10665
|
getState
|
|
10473
10666
|
} = useInfiniteTable();
|
|
10474
10667
|
const {
|
|
10475
|
-
componentState: { loading },
|
|
10668
|
+
componentState: { loading, dataArray },
|
|
10476
10669
|
getState: getDataSourceState,
|
|
10477
10670
|
componentActions: dataSourceActions
|
|
10478
10671
|
} = useDataSourceContextValue();
|
|
10479
|
-
const [imperativeApi] = (0,
|
|
10672
|
+
const [imperativeApi] = (0, import_react50.useState)(() => {
|
|
10480
10673
|
return getImperativeApi(getState, getComputed, getDataSourceState, actions);
|
|
10481
10674
|
});
|
|
10482
10675
|
const {
|
|
@@ -10500,27 +10693,14 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10500
10693
|
activeCellIndex,
|
|
10501
10694
|
onRenderUpdater
|
|
10502
10695
|
} = componentState;
|
|
10503
|
-
(
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
offset: 30
|
|
10507
|
-
});
|
|
10508
|
-
}
|
|
10509
|
-
}, [activeRowIndex]);
|
|
10510
|
-
(0, import_react49.useEffect)(() => {
|
|
10511
|
-
if (activeCellIndex != null) {
|
|
10512
|
-
imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
10513
|
-
offset: 30
|
|
10514
|
-
});
|
|
10515
|
-
}
|
|
10516
|
-
}, [activeCellIndex]);
|
|
10517
|
-
const { columnShifts, bodySize } = componentState;
|
|
10696
|
+
useScrollToActiveRow(activeRowIndex, dataArray.length, imperativeApi);
|
|
10697
|
+
useScrollToActiveCell(activeCellIndex, dataArray.length, imperativeApi);
|
|
10698
|
+
const { bodySize } = componentState;
|
|
10518
10699
|
const { scrollbars } = computed;
|
|
10519
10700
|
const { renderCell } = useCellRendering({
|
|
10520
10701
|
imperativeApi,
|
|
10521
10702
|
getComputed,
|
|
10522
10703
|
domRef: componentState.domRef,
|
|
10523
|
-
columnShifts,
|
|
10524
10704
|
bodySize,
|
|
10525
10705
|
computed
|
|
10526
10706
|
});
|
|
@@ -10542,7 +10722,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10542
10722
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
10543
10723
|
}, [scrollStopDelay]);
|
|
10544
10724
|
useAutoSizeColumns();
|
|
10545
|
-
const onKeyDown = (0,
|
|
10725
|
+
const onKeyDown = (0, import_react50.useCallback)((event) => {
|
|
10546
10726
|
if (handleKeyboardNavigation({
|
|
10547
10727
|
getState,
|
|
10548
10728
|
actions,
|
|
@@ -10564,7 +10744,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10564
10744
|
}) : null, /* @__PURE__ */ React36.createElement(InfiniteTableBody, null, /* @__PURE__ */ React36.createElement(HeadlessTable, {
|
|
10565
10745
|
tabIndex: 0,
|
|
10566
10746
|
activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
|
|
10567
|
-
activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
|
|
10747
|
+
activeCellIndex: componentState.ready && keyboardNavigation === "cell" && !componentState.columnReorderInProgress ? activeCellIndex : null,
|
|
10568
10748
|
scrollStopDelay,
|
|
10569
10749
|
renderer,
|
|
10570
10750
|
onRenderUpdater,
|
|
@@ -10576,7 +10756,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
10576
10756
|
visible: loading
|
|
10577
10757
|
}, loadingText)), /* @__PURE__ */ React36.createElement("div", {
|
|
10578
10758
|
ref: portalDOMRef,
|
|
10579
|
-
className: join(`${rootClassName2}Portal`, zIndex[
|
|
10759
|
+
className: join(`${rootClassName2}Portal`, zIndex[1e7], position.absolute, top[0], left[0])
|
|
10580
10760
|
}), rowHeightCSSVar ? /* @__PURE__ */ React36.createElement(CSSVariableWatch, {
|
|
10581
10761
|
varName: rowHeightCSSVar,
|
|
10582
10762
|
onChange: onRowHeightCSSVarChange
|