@infinite-table/infinite-react 0.2.16 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +4 -0
- package/index.esm.js +309 -273
- package/index.js +377 -338
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -657,7 +657,7 @@ function debounce(fn, { wait }) {
|
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
// src/components/InfiniteTable/index.tsx
|
|
660
|
-
var
|
|
660
|
+
var React34 = __toModule(require("react"));
|
|
661
661
|
|
|
662
662
|
// src/components/InfiniteTable/internalProps.ts
|
|
663
663
|
var rootClassName = "Infinite";
|
|
@@ -1309,7 +1309,7 @@ var forwardProps = (setupState) => {
|
|
|
1309
1309
|
pivotColumnGroups: 1,
|
|
1310
1310
|
onScrollbarsChange: 1,
|
|
1311
1311
|
autoSizeColumnsKey: 1,
|
|
1312
|
-
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay :
|
|
1312
|
+
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
1313
1313
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
1314
1314
|
activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
|
|
1315
1315
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
@@ -1321,6 +1321,7 @@ var forwardProps = (setupState) => {
|
|
|
1321
1321
|
sortable: (sortable) => sortable != null ? sortable : true,
|
|
1322
1322
|
hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
|
|
1323
1323
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
1324
|
+
pivotGrandTotalColumnPosition: 1,
|
|
1324
1325
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
1325
1326
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
1326
1327
|
header: (header) => header != null ? header : true,
|
|
@@ -2155,7 +2156,7 @@ var useComputedVisibleColumns = ({
|
|
|
2155
2156
|
var sortAscending = (a, b) => a - b;
|
|
2156
2157
|
|
|
2157
2158
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
2158
|
-
var
|
|
2159
|
+
var import_react19 = __toModule(require("react"));
|
|
2159
2160
|
|
|
2160
2161
|
// src/components/hooks/useComponentState/index.tsx
|
|
2161
2162
|
var React2 = __toModule(require("react"));
|
|
@@ -2539,10 +2540,10 @@ function useColumnGroups() {
|
|
|
2539
2540
|
}
|
|
2540
2541
|
|
|
2541
2542
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2542
|
-
var
|
|
2543
|
+
var import_react18 = __toModule(require("react"));
|
|
2543
2544
|
|
|
2544
2545
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2545
|
-
var
|
|
2546
|
+
var React6 = __toModule(require("react"));
|
|
2546
2547
|
|
|
2547
2548
|
// src/utils/join.ts
|
|
2548
2549
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -2614,9 +2615,8 @@ var willChange = { transform: "_16lm1iw19" };
|
|
|
2614
2615
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2615
2616
|
|
|
2616
2617
|
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
2617
|
-
var React6 = __toModule(require("react"));
|
|
2618
2618
|
function RenderHookComponent(props) {
|
|
2619
|
-
return
|
|
2619
|
+
return props.render(props.renderParam);
|
|
2620
2620
|
}
|
|
2621
2621
|
|
|
2622
2622
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
@@ -2629,7 +2629,7 @@ function getGroupColumnRender({
|
|
|
2629
2629
|
var _a, _b, _c;
|
|
2630
2630
|
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2631
2631
|
if (column.renderValue) {
|
|
2632
|
-
value = /* @__PURE__ */
|
|
2632
|
+
value = /* @__PURE__ */ React6.createElement(RenderHookComponent, {
|
|
2633
2633
|
render: column.renderValue,
|
|
2634
2634
|
renderParam: renderOptions
|
|
2635
2635
|
});
|
|
@@ -2658,20 +2658,20 @@ function getGroupColumnRender({
|
|
|
2658
2658
|
let icon = null;
|
|
2659
2659
|
const showExpanderIcon = pivotBy ? (((_b = groupRowInfo.groupKeys) == null ? void 0 : _b.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_c = groupRowInfo.groupKeys) == null ? void 0 : _c.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
|
|
2660
2660
|
if (showExpanderIcon) {
|
|
2661
|
-
const defaultIcon = /* @__PURE__ */
|
|
2661
|
+
const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2662
2662
|
expanded: !collapsed,
|
|
2663
2663
|
onChange: () => {
|
|
2664
2664
|
toggleGroupRow(groupKeys);
|
|
2665
2665
|
}
|
|
2666
2666
|
});
|
|
2667
|
-
icon = column.renderGroupIcon ? /* @__PURE__ */
|
|
2667
|
+
icon = column.renderGroupIcon ? /* @__PURE__ */ React6.createElement(RenderHookComponent, {
|
|
2668
2668
|
render: column.renderGroupIcon,
|
|
2669
2669
|
renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
|
|
2670
2670
|
}) : defaultIcon;
|
|
2671
2671
|
}
|
|
2672
|
-
return /* @__PURE__ */
|
|
2672
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2673
2673
|
className: join(display.flex, alignItems.center)
|
|
2674
|
-
}, icon, /* @__PURE__ */
|
|
2674
|
+
}, icon, /* @__PURE__ */ React6.createElement("div", {
|
|
2675
2675
|
className: cssEllipsisClassName
|
|
2676
2676
|
}, value != null ? value : null));
|
|
2677
2677
|
};
|
|
@@ -2719,7 +2719,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2719
2719
|
let icon = null;
|
|
2720
2720
|
const showExpanderIcon = pivotBy ? (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_b = rowInfo.groupKeys) == null ? void 0 : _b.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
|
|
2721
2721
|
if (showExpanderIcon) {
|
|
2722
|
-
const defaultIcon = /* @__PURE__ */
|
|
2722
|
+
const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2723
2723
|
expanded: !collapsed,
|
|
2724
2724
|
onChange: () => {
|
|
2725
2725
|
toggleGroupRow(rowInfo.groupKeys);
|
|
@@ -2727,9 +2727,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2727
2727
|
});
|
|
2728
2728
|
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2729
2729
|
}
|
|
2730
|
-
return /* @__PURE__ */
|
|
2730
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2731
2731
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2732
|
-
}, icon, /* @__PURE__ */
|
|
2732
|
+
}, icon, /* @__PURE__ */ React6.createElement("div", {
|
|
2733
2733
|
className: cssEllipsisClassName
|
|
2734
2734
|
}, value != null ? value : null));
|
|
2735
2735
|
}
|
|
@@ -2744,11 +2744,32 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2744
2744
|
return generatedGroupColumn;
|
|
2745
2745
|
}
|
|
2746
2746
|
|
|
2747
|
+
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
2748
|
+
var import_react14 = __toModule(require("react"));
|
|
2749
|
+
function useEffectWithRaf(fn, deps) {
|
|
2750
|
+
const rafId = (0, import_react14.useRef)(0);
|
|
2751
|
+
const removeFnRaf = (0, import_react14.useRef)();
|
|
2752
|
+
(0, import_react14.useEffect)(() => {
|
|
2753
|
+
rafId.current = requestAnimationFrame(() => {
|
|
2754
|
+
removeFnRaf.current = fn();
|
|
2755
|
+
});
|
|
2756
|
+
return () => {
|
|
2757
|
+
if (rafId.current) {
|
|
2758
|
+
cancelAnimationFrame(rafId.current);
|
|
2759
|
+
}
|
|
2760
|
+
if (typeof removeFnRaf.current === "function") {
|
|
2761
|
+
removeFnRaf.current();
|
|
2762
|
+
removeFnRaf.current = void 0;
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
2765
|
+
}, deps);
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2747
2768
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
2748
|
-
var
|
|
2769
|
+
var import_react17 = __toModule(require("react"));
|
|
2749
2770
|
|
|
2750
2771
|
// src/components/DataSource/index.tsx
|
|
2751
|
-
var
|
|
2772
|
+
var React7 = __toModule(require("react"));
|
|
2752
2773
|
|
|
2753
2774
|
// src/utils/multisort/sortTypes.ts
|
|
2754
2775
|
var numberComparator = function(first, second) {
|
|
@@ -2825,7 +2846,7 @@ var getMultisortFunction = (sortInfo, get) => {
|
|
|
2825
2846
|
};
|
|
2826
2847
|
|
|
2827
2848
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
2828
|
-
var
|
|
2849
|
+
var import_react16 = __toModule(require("react"));
|
|
2829
2850
|
|
|
2830
2851
|
// src/utils/DeepMap/once.ts
|
|
2831
2852
|
function once(fn) {
|
|
@@ -2911,14 +2932,13 @@ var DeepMap = class {
|
|
|
2911
2932
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2912
2933
|
const key = keys[i];
|
|
2913
2934
|
const last = i === len - 1;
|
|
2935
|
+
const pair = currentMap.get(key) || {};
|
|
2914
2936
|
if (last) {
|
|
2915
|
-
const pair = currentMap.has(key) ? currentMap.get(key) : {};
|
|
2916
2937
|
pair.revision = this.revision++;
|
|
2917
2938
|
pair.value = value;
|
|
2918
2939
|
currentMap.set(key, pair);
|
|
2919
2940
|
this.length++;
|
|
2920
2941
|
} else {
|
|
2921
|
-
const pair = currentMap.has(key) ? currentMap.get(key) : {};
|
|
2922
2942
|
if (!pair.map) {
|
|
2923
2943
|
pair.map = new Map();
|
|
2924
2944
|
currentMap.set(key, pair);
|
|
@@ -2929,7 +2949,6 @@ var DeepMap = class {
|
|
|
2929
2949
|
return this;
|
|
2930
2950
|
}
|
|
2931
2951
|
get(keys) {
|
|
2932
|
-
var _a;
|
|
2933
2952
|
let currentMap = this.map;
|
|
2934
2953
|
if (!keys.length) {
|
|
2935
2954
|
keys = [this.emptyKey];
|
|
@@ -2937,10 +2956,10 @@ var DeepMap = class {
|
|
|
2937
2956
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2938
2957
|
const key = keys[i];
|
|
2939
2958
|
const last = i === len - 1;
|
|
2959
|
+
const pair = currentMap.get(key);
|
|
2940
2960
|
if (last) {
|
|
2941
|
-
return
|
|
2961
|
+
return pair ? pair.value : void 0;
|
|
2942
2962
|
} else {
|
|
2943
|
-
const pair = currentMap.get(key);
|
|
2944
2963
|
if (!pair || !pair.map) {
|
|
2945
2964
|
return;
|
|
2946
2965
|
}
|
|
@@ -2978,8 +2997,8 @@ var DeepMap = class {
|
|
|
2978
2997
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2979
2998
|
const key = keys[i];
|
|
2980
2999
|
const last = i === len - 1;
|
|
3000
|
+
const pair = currentMap.get(key);
|
|
2981
3001
|
if (last) {
|
|
2982
|
-
const pair = currentMap.get(key);
|
|
2983
3002
|
if (pair) {
|
|
2984
3003
|
if (pair.hasOwnProperty("value")) {
|
|
2985
3004
|
delete pair.value;
|
|
@@ -2996,7 +3015,6 @@ var DeepMap = class {
|
|
|
2996
3015
|
}
|
|
2997
3016
|
break;
|
|
2998
3017
|
} else {
|
|
2999
|
-
const pair = currentMap.get(key);
|
|
3000
3018
|
if (!pair || !pair.map) {
|
|
3001
3019
|
result = false;
|
|
3002
3020
|
break;
|
|
@@ -3006,11 +3024,11 @@ var DeepMap = class {
|
|
|
3006
3024
|
}
|
|
3007
3025
|
}
|
|
3008
3026
|
while (maps.length) {
|
|
3009
|
-
|
|
3010
|
-
|
|
3027
|
+
const map2 = maps.pop();
|
|
3028
|
+
const key = keys.pop();
|
|
3011
3029
|
if (key && (map2 == null ? void 0 : map2.size) === 0) {
|
|
3012
|
-
|
|
3013
|
-
|
|
3030
|
+
const parentMap = maps[maps.length - 1];
|
|
3031
|
+
const pair = parentMap == null ? void 0 : parentMap.get(key);
|
|
3014
3032
|
if (pair) {
|
|
3015
3033
|
delete pair.map;
|
|
3016
3034
|
if (!pair.hasOwnProperty("value")) {
|
|
@@ -3029,11 +3047,10 @@ var DeepMap = class {
|
|
|
3029
3047
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
3030
3048
|
const key = keys[i];
|
|
3031
3049
|
const last = i === len - 1;
|
|
3050
|
+
const pair = currentMap.get(key);
|
|
3032
3051
|
if (last) {
|
|
3033
|
-
|
|
3034
|
-
return !!pair && pair.hasOwnProperty("value");
|
|
3052
|
+
return pair ? pair.hasOwnProperty("value") : false;
|
|
3035
3053
|
} else {
|
|
3036
|
-
const pair = currentMap.get(key);
|
|
3037
3054
|
if (!pair || !pair.map) {
|
|
3038
3055
|
return false;
|
|
3039
3056
|
}
|
|
@@ -3501,12 +3518,12 @@ function enhancedFlatten(param) {
|
|
|
3501
3518
|
}
|
|
3502
3519
|
|
|
3503
3520
|
// src/components/hooks/useEffectWithChanges.ts
|
|
3504
|
-
var
|
|
3521
|
+
var import_react15 = __toModule(require("react"));
|
|
3505
3522
|
function useEffectWithChanges(fn, deps) {
|
|
3506
|
-
const prevRef = (0,
|
|
3507
|
-
const oldValuesRef = (0,
|
|
3523
|
+
const prevRef = (0, import_react15.useRef)({});
|
|
3524
|
+
const oldValuesRef = (0, import_react15.useRef)({});
|
|
3508
3525
|
const oldValues = oldValuesRef.current;
|
|
3509
|
-
const changesRef = (0,
|
|
3526
|
+
const changesRef = (0, import_react15.useRef)({});
|
|
3510
3527
|
const changes = changesRef.current;
|
|
3511
3528
|
const useEffectDeps = [];
|
|
3512
3529
|
for (let k in deps) {
|
|
@@ -3519,7 +3536,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
3519
3536
|
}
|
|
3520
3537
|
}
|
|
3521
3538
|
prevRef.current = deps;
|
|
3522
|
-
(0,
|
|
3539
|
+
(0, import_react15.useEffect)(() => {
|
|
3523
3540
|
const changes2 = changesRef.current;
|
|
3524
3541
|
const result = fn(changes2, oldValues);
|
|
3525
3542
|
changesRef.current = {};
|
|
@@ -3687,12 +3704,12 @@ function useLoadData() {
|
|
|
3687
3704
|
livePaginationCursor,
|
|
3688
3705
|
cursorId: stateCursorId
|
|
3689
3706
|
} = componentState;
|
|
3690
|
-
const [scrollbars, setScrollbars] = (0,
|
|
3707
|
+
const [scrollbars, setScrollbars] = (0, import_react16.useState)({
|
|
3691
3708
|
vertical: false,
|
|
3692
3709
|
horizontal: false
|
|
3693
3710
|
});
|
|
3694
|
-
const scrollbarsRef = (0,
|
|
3695
|
-
(0,
|
|
3711
|
+
const scrollbarsRef = (0, import_react16.useRef)(scrollbars);
|
|
3712
|
+
(0, import_react16.useEffect)(() => {
|
|
3696
3713
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
3697
3714
|
if (!scrollbars2) {
|
|
3698
3715
|
return;
|
|
@@ -3702,7 +3719,7 @@ function useLoadData() {
|
|
|
3702
3719
|
});
|
|
3703
3720
|
return () => notifyScrollbarsChange.destroy();
|
|
3704
3721
|
}, [notifyScrollbarsChange]);
|
|
3705
|
-
(0,
|
|
3722
|
+
(0, import_react16.useEffect)(() => {
|
|
3706
3723
|
const frameId = requestAnimationFrame(() => {
|
|
3707
3724
|
var _a;
|
|
3708
3725
|
if (!((_a = scrollbarsRef.current) == null ? void 0 : _a.vertical) && livePaginationCursor) {
|
|
@@ -3711,7 +3728,7 @@ function useLoadData() {
|
|
|
3711
3728
|
});
|
|
3712
3729
|
return () => cancelAnimationFrame(frameId);
|
|
3713
3730
|
}, [livePaginationCursor]);
|
|
3714
|
-
(0,
|
|
3731
|
+
(0, import_react16.useEffect)(() => {
|
|
3715
3732
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2 } = getComponentState();
|
|
3716
3733
|
if (!scrollbars.vertical && livePagination2) {
|
|
3717
3734
|
if (livePaginationCursor2) {
|
|
@@ -3725,7 +3742,7 @@ function useLoadData() {
|
|
|
3725
3742
|
pivotBy,
|
|
3726
3743
|
cursorId: livePagination ? stateCursorId : null
|
|
3727
3744
|
};
|
|
3728
|
-
const initialRef = (0,
|
|
3745
|
+
const initialRef = (0, import_react16.useRef)(true);
|
|
3729
3746
|
useLazyLoadRange();
|
|
3730
3747
|
useEffectWithChanges(() => {
|
|
3731
3748
|
const componentState2 = getComponentState();
|
|
@@ -3754,7 +3771,7 @@ function useLazyLoadRange() {
|
|
|
3754
3771
|
componentActions: actions,
|
|
3755
3772
|
componentState
|
|
3756
3773
|
} = useComponentState();
|
|
3757
|
-
const loadingCache = (0,
|
|
3774
|
+
const loadingCache = (0, import_react16.useMemo)(() => {
|
|
3758
3775
|
return new Map();
|
|
3759
3776
|
}, [componentState.data]);
|
|
3760
3777
|
const {
|
|
@@ -3763,7 +3780,7 @@ function useLazyLoadRange() {
|
|
|
3763
3780
|
dataArray,
|
|
3764
3781
|
scrollStopDelayUpdatedByTable
|
|
3765
3782
|
} = componentState;
|
|
3766
|
-
const latestRenderRangeRef = (0,
|
|
3783
|
+
const latestRenderRangeRef = (0, import_react16.useRef)(null);
|
|
3767
3784
|
const loadRange = (renderRange, cache = loadingCache) => {
|
|
3768
3785
|
const componentState2 = getComponentState();
|
|
3769
3786
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -3782,8 +3799,8 @@ function useLazyLoadRange() {
|
|
|
3782
3799
|
componentActions: actions
|
|
3783
3800
|
}, cache);
|
|
3784
3801
|
};
|
|
3785
|
-
const debouncedLoadRange = (0,
|
|
3786
|
-
(0,
|
|
3802
|
+
const debouncedLoadRange = (0, import_react16.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
3803
|
+
(0, import_react16.useEffect)(() => {
|
|
3787
3804
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3788
3805
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
3789
3806
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -3792,7 +3809,7 @@ function useLazyLoadRange() {
|
|
|
3792
3809
|
}
|
|
3793
3810
|
return;
|
|
3794
3811
|
}, [lazyLoadBatchSize, loadingCache]);
|
|
3795
|
-
(0,
|
|
3812
|
+
(0, import_react16.useEffect)(() => {
|
|
3796
3813
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3797
3814
|
debouncedLoadRange();
|
|
3798
3815
|
}
|
|
@@ -3860,11 +3877,7 @@ function lazyLoadRange(options, cache) {
|
|
|
3860
3877
|
}
|
|
3861
3878
|
cache == null ? void 0 : cache.set(cacheKey, true);
|
|
3862
3879
|
const args = [componentState.data, componentState, componentActions, fnCall];
|
|
3863
|
-
return promise.then(() => getRafPromise()).then(() => loadData(...args))
|
|
3864
|
-
requestAnimationFrame(() => {
|
|
3865
|
-
cache == null ? void 0 : cache.delete(cacheKey);
|
|
3866
|
-
});
|
|
3867
|
-
});
|
|
3880
|
+
return promise.then(() => getRafPromise()).then(() => loadData(...args));
|
|
3868
3881
|
}, initialPromise);
|
|
3869
3882
|
}
|
|
3870
3883
|
|
|
@@ -4068,6 +4081,7 @@ function initSetupState2() {
|
|
|
4068
4081
|
notifyScrollStop: buildSubscriptionCallback(),
|
|
4069
4082
|
notifyRenderRangeChange: buildSubscriptionCallback(),
|
|
4070
4083
|
pivotTotalColumnPosition: "end",
|
|
4084
|
+
pivotGrandTotalColumnPosition: false,
|
|
4071
4085
|
scrollStopDelayUpdatedByTable: 100,
|
|
4072
4086
|
originalLazyGroupData,
|
|
4073
4087
|
originalLazyGroupDataChangeDetect: 0,
|
|
@@ -4255,6 +4269,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4255
4269
|
deepMap,
|
|
4256
4270
|
pivotBy,
|
|
4257
4271
|
pivotTotalColumnPosition,
|
|
4272
|
+
pivotGrandTotalColumnPosition,
|
|
4258
4273
|
reducers = {},
|
|
4259
4274
|
showSeparatePivotColumnForSingleAggregation = false
|
|
4260
4275
|
}) {
|
|
@@ -4264,6 +4279,28 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4264
4279
|
});
|
|
4265
4280
|
const columns = new Map([]);
|
|
4266
4281
|
const columnGroups = new Map();
|
|
4282
|
+
const addGrandTotalColumns = once(function() {
|
|
4283
|
+
aggregationReducers.forEach((reducer, index) => {
|
|
4284
|
+
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4285
|
+
header: `${reducer.name || reducer.id} total`,
|
|
4286
|
+
pivotBy,
|
|
4287
|
+
pivotColumn: true,
|
|
4288
|
+
pivotTotalColumn: true,
|
|
4289
|
+
pivotAggregator: reducer,
|
|
4290
|
+
pivotAggregatorIndex: index,
|
|
4291
|
+
pivotGroupKeys: [],
|
|
4292
|
+
pivotGroupKey: "",
|
|
4293
|
+
pivotIndex: -1,
|
|
4294
|
+
valueGetter: ({ rowInfo }) => {
|
|
4295
|
+
var _a;
|
|
4296
|
+
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
|
|
4297
|
+
}
|
|
4298
|
+
}));
|
|
4299
|
+
});
|
|
4300
|
+
});
|
|
4301
|
+
if (!pivotLength && pivotTotalColumnPosition === "start" || pivotGrandTotalColumnPosition === "start") {
|
|
4302
|
+
addGrandTotalColumns();
|
|
4303
|
+
}
|
|
4267
4304
|
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
4268
4305
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
4269
4306
|
keys = [...keys];
|
|
@@ -4368,24 +4405,8 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4368
4405
|
next == null ? void 0 : next();
|
|
4369
4406
|
}
|
|
4370
4407
|
});
|
|
4371
|
-
if (!pivotLength) {
|
|
4372
|
-
|
|
4373
|
-
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4374
|
-
header: `${reducer.name || reducer.id} total`,
|
|
4375
|
-
pivotBy,
|
|
4376
|
-
pivotColumn: true,
|
|
4377
|
-
pivotTotalColumn: true,
|
|
4378
|
-
pivotAggregator: reducer,
|
|
4379
|
-
pivotAggregatorIndex: index,
|
|
4380
|
-
pivotGroupKeys: [],
|
|
4381
|
-
pivotGroupKey: "",
|
|
4382
|
-
pivotIndex: -1,
|
|
4383
|
-
valueGetter: ({ rowInfo }) => {
|
|
4384
|
-
var _a;
|
|
4385
|
-
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
|
|
4386
|
-
}
|
|
4387
|
-
}));
|
|
4388
|
-
});
|
|
4408
|
+
if (!pivotLength && pivotTotalColumnPosition === "end" || pivotGrandTotalColumnPosition === "end") {
|
|
4409
|
+
addGrandTotalColumns();
|
|
4389
4410
|
}
|
|
4390
4411
|
const result = {
|
|
4391
4412
|
columns,
|
|
@@ -4417,7 +4438,7 @@ function toRowInfo(data, id, index) {
|
|
|
4417
4438
|
};
|
|
4418
4439
|
}
|
|
4419
4440
|
function concludeReducer(params) {
|
|
4420
|
-
var _a;
|
|
4441
|
+
var _a, _b;
|
|
4421
4442
|
const { state, previousState } = params;
|
|
4422
4443
|
const sortInfo = state.sortInfo;
|
|
4423
4444
|
let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
|
|
@@ -4452,6 +4473,7 @@ function concludeReducer(params) {
|
|
|
4452
4473
|
"pivotBy",
|
|
4453
4474
|
"aggregationReducers",
|
|
4454
4475
|
"pivotTotalColumnPosition",
|
|
4476
|
+
"pivotGrandTotalColumnPosition",
|
|
4455
4477
|
"showSeparatePivotColumnForSingleAggregation",
|
|
4456
4478
|
"sortInfo"
|
|
4457
4479
|
]);
|
|
@@ -4498,6 +4520,7 @@ function concludeReducer(params) {
|
|
|
4498
4520
|
deepMap: groupResult.topLevelPivotColumns,
|
|
4499
4521
|
pivotBy,
|
|
4500
4522
|
pivotTotalColumnPosition: (_a = state.pivotTotalColumnPosition) != null ? _a : "end",
|
|
4523
|
+
pivotGrandTotalColumnPosition: (_b = state.pivotGrandTotalColumnPosition) != null ? _b : false,
|
|
4501
4524
|
reducers: state.aggregationReducers,
|
|
4502
4525
|
showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
|
|
4503
4526
|
}) : void 0;
|
|
@@ -4541,7 +4564,7 @@ function DataSourceWithContext(props) {
|
|
|
4541
4564
|
if (typeof children === "function") {
|
|
4542
4565
|
children = children(computedValues);
|
|
4543
4566
|
}
|
|
4544
|
-
return /* @__PURE__ */
|
|
4567
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children);
|
|
4545
4568
|
}
|
|
4546
4569
|
var DataSourceRoot = getComponentStateRoot({
|
|
4547
4570
|
initSetupState: initSetupState2,
|
|
@@ -4564,14 +4587,14 @@ function DataSourceCmp({ children }) {
|
|
|
4564
4587
|
globalThis.getDataSourceState = getState;
|
|
4565
4588
|
}
|
|
4566
4589
|
useLoadData();
|
|
4567
|
-
return /* @__PURE__ */
|
|
4590
|
+
return /* @__PURE__ */ React7.createElement(DataSourceContext.Provider, {
|
|
4568
4591
|
value: contextValue
|
|
4569
|
-
}, /* @__PURE__ */
|
|
4592
|
+
}, /* @__PURE__ */ React7.createElement(DataSourceWithContext, {
|
|
4570
4593
|
children
|
|
4571
4594
|
}));
|
|
4572
4595
|
}
|
|
4573
4596
|
function DataSource(props) {
|
|
4574
|
-
return /* @__PURE__ */
|
|
4597
|
+
return /* @__PURE__ */ React7.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React7.createElement(DataSourceCmp, {
|
|
4575
4598
|
children: props.children
|
|
4576
4599
|
}));
|
|
4577
4600
|
}
|
|
@@ -4579,7 +4602,7 @@ function DataSource(props) {
|
|
|
4579
4602
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
4580
4603
|
function useToggleGroupRow() {
|
|
4581
4604
|
const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
4582
|
-
const toggleGroupRow = (0,
|
|
4605
|
+
const toggleGroupRow = (0, import_react17.useCallback)((groupKeys) => {
|
|
4583
4606
|
const state = getDataSourceState();
|
|
4584
4607
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
4585
4608
|
newState.toggleGroupRow(groupKeys);
|
|
@@ -4595,7 +4618,7 @@ function useToggleGroupRow() {
|
|
|
4595
4618
|
|
|
4596
4619
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
4597
4620
|
function useGroupByMap(groupBy) {
|
|
4598
|
-
const groupByMap = (0,
|
|
4621
|
+
const groupByMap = (0, import_react18.useMemo)(() => {
|
|
4599
4622
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
4600
4623
|
acc.set(groupBy2.field, {
|
|
4601
4624
|
groupBy: groupBy2,
|
|
@@ -4612,15 +4635,24 @@ function useColumnsWhen() {
|
|
|
4612
4635
|
componentActions: dataSourceActions
|
|
4613
4636
|
} = useDataSourceContextValue();
|
|
4614
4637
|
const {
|
|
4615
|
-
componentState: {
|
|
4638
|
+
componentState: {
|
|
4639
|
+
groupRenderStrategy,
|
|
4640
|
+
pivotTotalColumnPosition,
|
|
4641
|
+
pivotGrandTotalColumnPosition
|
|
4642
|
+
}
|
|
4616
4643
|
} = useComponentState();
|
|
4617
4644
|
const groupByMap = useGroupByMap(groupBy);
|
|
4618
|
-
(0,
|
|
4645
|
+
(0, import_react18.useEffect)(() => {
|
|
4619
4646
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
4620
4647
|
}, [groupRenderStrategy]);
|
|
4621
|
-
(0,
|
|
4648
|
+
(0, import_react18.useEffect)(() => {
|
|
4622
4649
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
4623
4650
|
}, [pivotTotalColumnPosition]);
|
|
4651
|
+
(0, import_react18.useEffect)(() => {
|
|
4652
|
+
if (pivotGrandTotalColumnPosition != void 0) {
|
|
4653
|
+
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
4654
|
+
}
|
|
4655
|
+
}, [pivotGrandTotalColumnPosition]);
|
|
4624
4656
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4625
4657
|
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4626
4658
|
useHideColumns(groupByMap);
|
|
@@ -4684,7 +4716,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4684
4716
|
});
|
|
4685
4717
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
4686
4718
|
}
|
|
4687
|
-
(0,
|
|
4719
|
+
(0, import_react18.useEffect)(() => {
|
|
4688
4720
|
const update = () => {
|
|
4689
4721
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
4690
4722
|
};
|
|
@@ -4708,17 +4740,19 @@ function useColumnsWhenGrouping() {
|
|
|
4708
4740
|
groupRenderStrategy,
|
|
4709
4741
|
pivotColumns,
|
|
4710
4742
|
pivotColumn,
|
|
4711
|
-
pivotTotalColumnPosition
|
|
4743
|
+
pivotTotalColumnPosition,
|
|
4744
|
+
pivotGrandTotalColumnPosition
|
|
4712
4745
|
}
|
|
4713
4746
|
} = useComponentState();
|
|
4714
4747
|
const toggleGroupRow = useToggleGroupRow();
|
|
4715
|
-
(0,
|
|
4748
|
+
(0, import_react18.useEffect)(() => {
|
|
4716
4749
|
const update = () => {
|
|
4717
4750
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
4718
4751
|
columns,
|
|
4719
4752
|
groupColumn,
|
|
4720
4753
|
pivotColumn,
|
|
4721
4754
|
pivotTotalColumnPosition,
|
|
4755
|
+
pivotGrandTotalColumnPosition,
|
|
4722
4756
|
groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
|
|
4723
4757
|
groupBy,
|
|
4724
4758
|
pivotBy,
|
|
@@ -4766,7 +4800,7 @@ function useHideColumns(groupByMap) {
|
|
|
4766
4800
|
}
|
|
4767
4801
|
} = useComponentState();
|
|
4768
4802
|
const prevHideEmptyGroupColumns = usePrevious(hideEmptyGroupColumns);
|
|
4769
|
-
(
|
|
4803
|
+
useEffectWithRaf(() => {
|
|
4770
4804
|
if (groupRenderStrategy !== "multi-column") {
|
|
4771
4805
|
return;
|
|
4772
4806
|
}
|
|
@@ -4844,7 +4878,7 @@ function useHideColumns(groupByMap) {
|
|
|
4844
4878
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4845
4879
|
hideEmptyGroupColumns
|
|
4846
4880
|
]);
|
|
4847
|
-
(0,
|
|
4881
|
+
(0, import_react18.useEffect)(() => {
|
|
4848
4882
|
const isGrouped = groupBy.length > 0;
|
|
4849
4883
|
const currentState = getComponentState();
|
|
4850
4884
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -4879,6 +4913,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4879
4913
|
pivotBy,
|
|
4880
4914
|
groupColumn,
|
|
4881
4915
|
pivotTotalColumnPosition,
|
|
4916
|
+
pivotGrandTotalColumnPosition,
|
|
4882
4917
|
pivotColumn,
|
|
4883
4918
|
groupRenderStrategy,
|
|
4884
4919
|
toggleGroupRow,
|
|
@@ -4918,7 +4953,12 @@ function getColumnsWhenGrouping(params) {
|
|
|
4918
4953
|
});
|
|
4919
4954
|
pivotColumns.forEach((col, key) => {
|
|
4920
4955
|
var _a, _b;
|
|
4921
|
-
|
|
4956
|
+
const isSimpleTotalColumn = col.pivotTotalColumn && col.columnGroup;
|
|
4957
|
+
const isGrandTotalColumn = col.pivotTotalColumn && !col.columnGroup;
|
|
4958
|
+
if (isSimpleTotalColumn && pivotTotalColumnPosition === false) {
|
|
4959
|
+
return;
|
|
4960
|
+
}
|
|
4961
|
+
if (isGrandTotalColumn && pivotGrandTotalColumnPosition === false) {
|
|
4922
4962
|
return;
|
|
4923
4963
|
}
|
|
4924
4964
|
let column = __spreadValues({}, col);
|
|
@@ -4970,7 +5010,7 @@ function useComputed() {
|
|
|
4970
5010
|
bodySize,
|
|
4971
5011
|
showSeparatePivotColumnForSingleAggregation
|
|
4972
5012
|
} = componentState;
|
|
4973
|
-
(0,
|
|
5013
|
+
(0, import_react19.useState)(() => {
|
|
4974
5014
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
4975
5015
|
if (rowHeight) {
|
|
4976
5016
|
componentActions.rowHeight = rowHeight;
|
|
@@ -4982,13 +5022,13 @@ function useComputed() {
|
|
|
4982
5022
|
}
|
|
4983
5023
|
});
|
|
4984
5024
|
});
|
|
4985
|
-
(0,
|
|
5025
|
+
(0, import_react19.useEffect)(() => {
|
|
4986
5026
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
4987
5027
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
4988
5028
|
const { multiSort } = dataSourceState;
|
|
4989
5029
|
useColumnGroups();
|
|
4990
5030
|
const { toggleGroupRow } = useColumnsWhen();
|
|
4991
|
-
const setSortInfo = (0,
|
|
5031
|
+
const setSortInfo = (0, import_react19.useCallback)((sortInfo) => {
|
|
4992
5032
|
var _a2;
|
|
4993
5033
|
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
4994
5034
|
dataSourceActions.sortInfo = newSortInfo;
|
|
@@ -5032,7 +5072,7 @@ function useComputed() {
|
|
|
5032
5072
|
columnSizing,
|
|
5033
5073
|
columnTypes
|
|
5034
5074
|
});
|
|
5035
|
-
const rowSpan = (0,
|
|
5075
|
+
const rowSpan = (0, import_react19.useMemo)(() => {
|
|
5036
5076
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
5037
5077
|
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
5038
5078
|
let maxSpan = 1;
|
|
@@ -5108,7 +5148,7 @@ function useComputed() {
|
|
|
5108
5148
|
}
|
|
5109
5149
|
|
|
5110
5150
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5111
|
-
var
|
|
5151
|
+
var React8 = __toModule(require("react"));
|
|
5112
5152
|
|
|
5113
5153
|
// src/components/InfiniteTable/hooks/useInternalProps.ts
|
|
5114
5154
|
var useInternalProps = () => {
|
|
@@ -5116,9 +5156,9 @@ var useInternalProps = () => {
|
|
|
5116
5156
|
};
|
|
5117
5157
|
|
|
5118
5158
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5119
|
-
var InfiniteTableBody =
|
|
5159
|
+
var InfiniteTableBody = React8.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
5120
5160
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
5121
|
-
return /* @__PURE__ */
|
|
5161
|
+
return /* @__PURE__ */ React8.createElement("div", __spreadProps(__spreadValues({
|
|
5122
5162
|
ref
|
|
5123
5163
|
}, props), {
|
|
5124
5164
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -5126,16 +5166,16 @@ var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref
|
|
|
5126
5166
|
});
|
|
5127
5167
|
|
|
5128
5168
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
5129
|
-
var
|
|
5169
|
+
var React20 = __toModule(require("react"));
|
|
5130
5170
|
|
|
5131
5171
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
5132
|
-
var
|
|
5172
|
+
var React9 = __toModule(require("react"));
|
|
5133
5173
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
5134
5174
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
5135
5175
|
if (!scrollbarWidth2) {
|
|
5136
5176
|
return null;
|
|
5137
5177
|
}
|
|
5138
|
-
return /* @__PURE__ */
|
|
5178
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
5139
5179
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
5140
5180
|
style: __spreadValues({
|
|
5141
5181
|
position: "absolute",
|
|
@@ -5145,13 +5185,13 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
5145
5185
|
}, props.style)
|
|
5146
5186
|
});
|
|
5147
5187
|
}
|
|
5148
|
-
var HorizontalScrollbarPlaceholder =
|
|
5188
|
+
var HorizontalScrollbarPlaceholder = React9.memo(HorizontalScrollbarPlaceholderFn);
|
|
5149
5189
|
function VerticalScrollbarPlaceholderFn(props) {
|
|
5150
5190
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
5151
5191
|
if (!scrollbarWidth2) {
|
|
5152
5192
|
return null;
|
|
5153
5193
|
}
|
|
5154
|
-
return /* @__PURE__ */
|
|
5194
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
5155
5195
|
"data-name": "vertical-scrollbar-placeholder",
|
|
5156
5196
|
style: __spreadValues({
|
|
5157
5197
|
position: "absolute",
|
|
@@ -5161,7 +5201,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
5161
5201
|
}, props.style)
|
|
5162
5202
|
});
|
|
5163
5203
|
}
|
|
5164
|
-
var VerticalScrollbarPlaceholder =
|
|
5204
|
+
var VerticalScrollbarPlaceholder = React9.memo(VerticalScrollbarPlaceholderFn);
|
|
5165
5205
|
|
|
5166
5206
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5167
5207
|
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -5176,21 +5216,21 @@ var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
|
5176
5216
|
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
5177
5217
|
|
|
5178
5218
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5179
|
-
var
|
|
5180
|
-
var
|
|
5219
|
+
var React16 = __toModule(require("react"));
|
|
5220
|
+
var import_react27 = __toModule(require("react"));
|
|
5181
5221
|
|
|
5182
5222
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5183
|
-
var
|
|
5184
|
-
var
|
|
5223
|
+
var React12 = __toModule(require("react"));
|
|
5224
|
+
var import_react23 = __toModule(require("react"));
|
|
5185
5225
|
|
|
5186
5226
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5187
|
-
var
|
|
5227
|
+
var React10 = __toModule(require("react"));
|
|
5188
5228
|
|
|
5189
5229
|
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
5190
|
-
var
|
|
5230
|
+
var import_react20 = __toModule(require("react"));
|
|
5191
5231
|
var useInfiniteTableState = () => {
|
|
5192
5232
|
const TableContext2 = getInfiniteTableContext();
|
|
5193
|
-
const { componentState } = (0,
|
|
5233
|
+
const { componentState } = (0, import_react20.useContext)(TableContext2);
|
|
5194
5234
|
return componentState;
|
|
5195
5235
|
};
|
|
5196
5236
|
|
|
@@ -5253,23 +5293,23 @@ function InfiniteTableCellFn(props) {
|
|
|
5253
5293
|
style,
|
|
5254
5294
|
"data-name": "Cell",
|
|
5255
5295
|
className: join(domProps.className, columnAlignCellStyle[(_b = column.align) != null ? _b : "start"], justifyContent[(_c = column.align) != null ? _c : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
|
|
5256
|
-
children: /* @__PURE__ */
|
|
5296
|
+
children: /* @__PURE__ */ React10.createElement(React10.Fragment, null, beforeChildren, /* @__PURE__ */ React10.createElement("div", {
|
|
5257
5297
|
className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
|
|
5258
5298
|
}, children), afterChildren)
|
|
5259
5299
|
});
|
|
5260
5300
|
const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
|
|
5261
5301
|
if (RenderComponent) {
|
|
5262
|
-
return /* @__PURE__ */
|
|
5302
|
+
return /* @__PURE__ */ React10.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5263
5303
|
}
|
|
5264
|
-
return /* @__PURE__ */
|
|
5304
|
+
return /* @__PURE__ */ React10.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5265
5305
|
ref: domRef
|
|
5266
5306
|
}));
|
|
5267
5307
|
}
|
|
5268
|
-
var InfiniteTableCell =
|
|
5308
|
+
var InfiniteTableCell = React10.memo(InfiniteTableCellFn);
|
|
5269
5309
|
|
|
5270
5310
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
5271
5311
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
5272
|
-
var
|
|
5312
|
+
var import_react21 = __toModule(require("react"));
|
|
5273
5313
|
|
|
5274
5314
|
// src/components/InfiniteTable/utils/moveXatY.ts
|
|
5275
5315
|
var moveXatY = (arr, dragIndex, dropIndex) => {
|
|
@@ -5303,18 +5343,18 @@ var useColumnPointerEvents = ({
|
|
|
5303
5343
|
columns,
|
|
5304
5344
|
computedRemainingSpace
|
|
5305
5345
|
}) => {
|
|
5306
|
-
const [draggingDiff, setDraggingDiff] = (0,
|
|
5307
|
-
const [proxyOffset, setProxyOffset] = (0,
|
|
5308
|
-
const breakpointsRef = (0,
|
|
5309
|
-
const pointerMoveRef = (0,
|
|
5310
|
-
const didDragRef = (0,
|
|
5311
|
-
const initialClientPos = (0,
|
|
5312
|
-
const currentDropIndexRef = (0,
|
|
5346
|
+
const [draggingDiff, setDraggingDiff] = (0, import_react21.useState)(null);
|
|
5347
|
+
const [proxyOffset, setProxyOffset] = (0, import_react21.useState)(null);
|
|
5348
|
+
const breakpointsRef = (0, import_react21.useRef)([]);
|
|
5349
|
+
const pointerMoveRef = (0, import_react21.useRef)(null);
|
|
5350
|
+
const didDragRef = (0, import_react21.useRef)(false);
|
|
5351
|
+
const initialClientPos = (0, import_react21.useRef)(null);
|
|
5352
|
+
const currentDropIndexRef = (0, import_react21.useRef)(null);
|
|
5313
5353
|
const dragging = draggingDiff != null;
|
|
5314
5354
|
const { componentActions, computed } = useInfiniteTable();
|
|
5315
5355
|
const { computedColumnOrder } = computed;
|
|
5316
|
-
const column = (0,
|
|
5317
|
-
const { columnIndex, columnWidth, columnsArray } = (0,
|
|
5356
|
+
const column = (0, import_react21.useMemo)(() => columns.get(columnId), [columnId, columns]);
|
|
5357
|
+
const { columnIndex, columnWidth, columnsArray } = (0, import_react21.useMemo)(() => {
|
|
5318
5358
|
const columnsArray2 = Array.from(columns.values());
|
|
5319
5359
|
return {
|
|
5320
5360
|
columnsArray: columnsArray2,
|
|
@@ -5322,8 +5362,8 @@ var useColumnPointerEvents = ({
|
|
|
5322
5362
|
columnWidth: column.computedWidth
|
|
5323
5363
|
};
|
|
5324
5364
|
}, [columns, columnId, column]);
|
|
5325
|
-
let cursorRef = (0,
|
|
5326
|
-
const onPointerDown = (0,
|
|
5365
|
+
let cursorRef = (0, import_react21.useRef)("auto");
|
|
5366
|
+
const onPointerDown = (0, import_react21.useCallback)((e) => {
|
|
5327
5367
|
const target = domRef.current;
|
|
5328
5368
|
cursorRef.current = target.style.cursor;
|
|
5329
5369
|
didDragRef.current = false;
|
|
@@ -5386,7 +5426,7 @@ var useColumnPointerEvents = ({
|
|
|
5386
5426
|
target.addEventListener("pointermove", onPointerMove);
|
|
5387
5427
|
target.setPointerCapture(e.pointerId);
|
|
5388
5428
|
}, [columns, column, columnIndex, columnsArray, computedRemainingSpace]);
|
|
5389
|
-
const onPointerUp = (0,
|
|
5429
|
+
const onPointerUp = (0, import_react21.useCallback)((e) => {
|
|
5390
5430
|
const target = domRef.current;
|
|
5391
5431
|
target.style.cursor = cursorRef.current;
|
|
5392
5432
|
target.releasePointerCapture(e.pointerId);
|
|
@@ -5460,8 +5500,8 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
5460
5500
|
var import_react_dom = __toModule(require("react-dom"));
|
|
5461
5501
|
|
|
5462
5502
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5463
|
-
var
|
|
5464
|
-
var
|
|
5503
|
+
var React11 = __toModule(require("react"));
|
|
5504
|
+
var import_react22 = __toModule(require("react"));
|
|
5465
5505
|
var defaultLineStyle = {
|
|
5466
5506
|
marginTop: 2,
|
|
5467
5507
|
marginBottom: 2,
|
|
@@ -5470,8 +5510,8 @@ var defaultLineStyle = {
|
|
|
5470
5510
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
5471
5511
|
function SortIcon(props) {
|
|
5472
5512
|
var _a;
|
|
5473
|
-
const [rendered, setRendered] = (0,
|
|
5474
|
-
const [opacity, setOpacity] = (0,
|
|
5513
|
+
const [rendered, setRendered] = (0, import_react22.useState)(true);
|
|
5514
|
+
const [opacity, setOpacity] = (0, import_react22.useState)(0);
|
|
5475
5515
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
5476
5516
|
const showIndex = index != null && index > 0;
|
|
5477
5517
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -5485,7 +5525,7 @@ function SortIcon(props) {
|
|
|
5485
5525
|
}), props.lineStyle), {
|
|
5486
5526
|
opacity
|
|
5487
5527
|
});
|
|
5488
|
-
(0,
|
|
5528
|
+
(0, import_react22.useEffect)(() => {
|
|
5489
5529
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
5490
5530
|
if (!rendered && newOpacity) {
|
|
5491
5531
|
setRendered(true);
|
|
@@ -5515,24 +5555,24 @@ function SortIcon(props) {
|
|
|
5515
5555
|
if (direction === -1) {
|
|
5516
5556
|
indexStyle.top = "100%";
|
|
5517
5557
|
}
|
|
5518
|
-
return /* @__PURE__ */
|
|
5558
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
5519
5559
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5520
5560
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5521
|
-
}, showIndex ? /* @__PURE__ */
|
|
5561
|
+
}, showIndex ? /* @__PURE__ */ React11.createElement("div", {
|
|
5522
5562
|
"data-name": "index",
|
|
5523
5563
|
style: indexStyle
|
|
5524
|
-
}, index) : null, /* @__PURE__ */
|
|
5564
|
+
}, index) : null, /* @__PURE__ */ React11.createElement("div", {
|
|
5525
5565
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5526
5566
|
onTransitionEnd
|
|
5527
|
-
}), /* @__PURE__ */
|
|
5567
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
5528
5568
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5529
|
-
}), /* @__PURE__ */
|
|
5569
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
5530
5570
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5531
5571
|
}));
|
|
5532
5572
|
}
|
|
5533
5573
|
|
|
5534
5574
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5535
|
-
var InfiniteTableHeaderCellContext =
|
|
5575
|
+
var InfiniteTableHeaderCellContext = React12.createContext(null);
|
|
5536
5576
|
var defaultStyle = {
|
|
5537
5577
|
position: "absolute",
|
|
5538
5578
|
top: 0
|
|
@@ -5551,12 +5591,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5551
5591
|
}
|
|
5552
5592
|
const sortInfo = column.computedSortInfo;
|
|
5553
5593
|
let header = column.header;
|
|
5554
|
-
const ref = (0,
|
|
5594
|
+
const ref = (0, import_react23.useCallback)((node) => {
|
|
5555
5595
|
var _a2;
|
|
5556
5596
|
domRef.current = node;
|
|
5557
5597
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
5558
5598
|
}, [props.domRef]);
|
|
5559
|
-
const sortTool = /* @__PURE__ */
|
|
5599
|
+
const sortTool = /* @__PURE__ */ React12.createElement(SortIcon, {
|
|
5560
5600
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
5561
5601
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
|
|
5562
5602
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
@@ -5569,7 +5609,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5569
5609
|
};
|
|
5570
5610
|
const renderChildren = () => {
|
|
5571
5611
|
if (header instanceof Function) {
|
|
5572
|
-
header = /* @__PURE__ */
|
|
5612
|
+
header = /* @__PURE__ */ React12.createElement(RenderHookComponent, {
|
|
5573
5613
|
render: header,
|
|
5574
5614
|
renderParam
|
|
5575
5615
|
});
|
|
@@ -5577,12 +5617,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5577
5617
|
header = header != null ? header : column.name;
|
|
5578
5618
|
return header;
|
|
5579
5619
|
};
|
|
5580
|
-
const domRef = (0,
|
|
5620
|
+
const domRef = (0, import_react23.useRef)(null);
|
|
5581
5621
|
const {
|
|
5582
5622
|
computed: { computedRemainingSpace },
|
|
5583
5623
|
componentState: { portalDOMRef }
|
|
5584
5624
|
} = useInfiniteTable();
|
|
5585
|
-
(0,
|
|
5625
|
+
(0, import_react23.useEffect)(() => {
|
|
5586
5626
|
let clearOnResize = null;
|
|
5587
5627
|
const node = domRef.current;
|
|
5588
5628
|
if (onResize && node) {
|
|
@@ -5605,7 +5645,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5605
5645
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
5606
5646
|
let draggingProxy = null;
|
|
5607
5647
|
if (dragging) {
|
|
5608
|
-
draggingProxy = /* @__PURE__ */
|
|
5648
|
+
draggingProxy = /* @__PURE__ */ React12.createElement("div", {
|
|
5609
5649
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
5610
5650
|
style: {
|
|
5611
5651
|
position: "absolute",
|
|
@@ -5619,9 +5659,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5619
5659
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
5620
5660
|
}
|
|
5621
5661
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5622
|
-
return /* @__PURE__ */
|
|
5662
|
+
return /* @__PURE__ */ React12.createElement(ContextProvider, {
|
|
5623
5663
|
value: renderParam
|
|
5624
|
-
}, /* @__PURE__ */
|
|
5664
|
+
}, /* @__PURE__ */ React12.createElement(InfiniteTableCell, {
|
|
5625
5665
|
domRef: ref,
|
|
5626
5666
|
cellType: "header",
|
|
5627
5667
|
column,
|
|
@@ -5638,34 +5678,34 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5638
5678
|
}), draggingProxy);
|
|
5639
5679
|
}
|
|
5640
5680
|
function useInfiniteHeaderCell() {
|
|
5641
|
-
const result = (0,
|
|
5681
|
+
const result = (0, import_react23.useContext)(InfiniteTableHeaderCellContext);
|
|
5642
5682
|
return result;
|
|
5643
5683
|
}
|
|
5644
5684
|
|
|
5645
5685
|
// src/components/RawList/index.tsx
|
|
5646
|
-
var
|
|
5647
|
-
var
|
|
5686
|
+
var React15 = __toModule(require("react"));
|
|
5687
|
+
var import_react26 = __toModule(require("react"));
|
|
5648
5688
|
|
|
5649
5689
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
5650
|
-
var
|
|
5651
|
-
var
|
|
5690
|
+
var React13 = __toModule(require("react"));
|
|
5691
|
+
var import_react24 = __toModule(require("react"));
|
|
5652
5692
|
function AvoidReactDiffFn(props) {
|
|
5653
|
-
const [children, setChildren] = (0,
|
|
5654
|
-
(0,
|
|
5693
|
+
const [children, setChildren] = (0, import_react24.useState)(props.updater.get());
|
|
5694
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
5655
5695
|
const remove = props.updater.onChange((children2) => {
|
|
5656
5696
|
setChildren(children2);
|
|
5657
5697
|
});
|
|
5658
5698
|
return remove;
|
|
5659
5699
|
}, [props.updater]);
|
|
5660
|
-
return /* @__PURE__ */
|
|
5700
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, children);
|
|
5661
5701
|
}
|
|
5662
|
-
var AvoidReactDiff =
|
|
5702
|
+
var AvoidReactDiff = React13.memo(AvoidReactDiffFn);
|
|
5663
5703
|
|
|
5664
5704
|
// src/components/RawList/useVirtualRenderer.ts
|
|
5665
|
-
var
|
|
5705
|
+
var import_react25 = __toModule(require("react"));
|
|
5666
5706
|
|
|
5667
5707
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
5668
|
-
var
|
|
5708
|
+
var React14 = __toModule(require("react"));
|
|
5669
5709
|
|
|
5670
5710
|
// src/components/RawList/MappedItems.ts
|
|
5671
5711
|
var MappedItems = class extends Logger {
|
|
@@ -5910,7 +5950,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5910
5950
|
};
|
|
5911
5951
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5912
5952
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5913
|
-
const item = /* @__PURE__ */
|
|
5953
|
+
const item = /* @__PURE__ */ React14.createElement(AvoidReactDiff, {
|
|
5914
5954
|
key: elementIndex,
|
|
5915
5955
|
name: `${elementIndex}`,
|
|
5916
5956
|
updater: this.updaters[elementIndex]
|
|
@@ -5946,7 +5986,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5946
5986
|
}
|
|
5947
5987
|
this.mappedItems.renderItemAtElement(itemIndex, elementIndex, renderedNode);
|
|
5948
5988
|
if (true) {
|
|
5949
|
-
this.
|
|
5989
|
+
dbg(`ReactVirtualRenderer:${this.brain.getOptions().mainAxis}`)(`Render item ${itemIndex} at element ${elementIndex}`);
|
|
5950
5990
|
}
|
|
5951
5991
|
itemUpdater(renderedNode);
|
|
5952
5992
|
this.updateElementPosition(elementIndex);
|
|
@@ -5976,7 +6016,7 @@ function createRenderer(brain) {
|
|
|
5976
6016
|
function useVirtualRenderer({
|
|
5977
6017
|
brain
|
|
5978
6018
|
}) {
|
|
5979
|
-
return (0,
|
|
6019
|
+
return (0, import_react25.useMemo)(() => {
|
|
5980
6020
|
return createRenderer(brain);
|
|
5981
6021
|
}, [brain]);
|
|
5982
6022
|
}
|
|
@@ -5989,7 +6029,7 @@ function RawListFn(props) {
|
|
|
5989
6029
|
debugChannel
|
|
5990
6030
|
});
|
|
5991
6031
|
const getRenderItem = useLatest(renderItem);
|
|
5992
|
-
(0,
|
|
6032
|
+
(0, import_react26.useEffect)(() => {
|
|
5993
6033
|
const renderRange = brain.getRenderRange();
|
|
5994
6034
|
renderer.renderRange(renderRange, {
|
|
5995
6035
|
renderItem,
|
|
@@ -5997,7 +6037,7 @@ function RawListFn(props) {
|
|
|
5997
6037
|
onRender: onRenderUpdater
|
|
5998
6038
|
});
|
|
5999
6039
|
}, [brain, renderItem, onRenderUpdater]);
|
|
6000
|
-
(0,
|
|
6040
|
+
(0, import_react26.useEffect)(() => {
|
|
6001
6041
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
6002
6042
|
renderer.renderRange(renderRange, {
|
|
6003
6043
|
force: false,
|
|
@@ -6007,11 +6047,11 @@ function RawListFn(props) {
|
|
|
6007
6047
|
});
|
|
6008
6048
|
return remove;
|
|
6009
6049
|
}, [brain, onRenderUpdater]);
|
|
6010
|
-
return /* @__PURE__ */
|
|
6050
|
+
return /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
|
|
6011
6051
|
updater: onRenderUpdater
|
|
6012
6052
|
});
|
|
6013
6053
|
}
|
|
6014
|
-
var RawList =
|
|
6054
|
+
var RawList = React15.memo(RawListFn);
|
|
6015
6055
|
|
|
6016
6056
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
6017
6057
|
var debug3 = dbg("Header");
|
|
@@ -6024,7 +6064,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6024
6064
|
componentState: { headerHeight }
|
|
6025
6065
|
} = useInfiniteTable();
|
|
6026
6066
|
const { computedVisibleColumnsMap } = computed;
|
|
6027
|
-
const renderColumn = (0,
|
|
6067
|
+
const renderColumn = (0, import_react27.useCallback)(({ domRef: domRef2, itemIndex: columnIndex }) => {
|
|
6028
6068
|
const column = columns[columnIndex];
|
|
6029
6069
|
if (!column) {
|
|
6030
6070
|
if (true) {
|
|
@@ -6032,14 +6072,14 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6032
6072
|
}
|
|
6033
6073
|
return null;
|
|
6034
6074
|
}
|
|
6035
|
-
return /* @__PURE__ */
|
|
6075
|
+
return /* @__PURE__ */ React16.createElement(InfiniteTableHeaderCell, {
|
|
6036
6076
|
domRef: domRef2,
|
|
6037
6077
|
column,
|
|
6038
6078
|
headerHeight,
|
|
6039
6079
|
columns: computedVisibleColumnsMap
|
|
6040
6080
|
});
|
|
6041
6081
|
}, [computedVisibleColumnsMap, columns, repaintId, headerHeight]);
|
|
6042
|
-
(0,
|
|
6082
|
+
(0, import_react27.useEffect)(() => {
|
|
6043
6083
|
const onScroll = (scrollPosition) => {
|
|
6044
6084
|
if (domRef.current) {
|
|
6045
6085
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -6048,7 +6088,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6048
6088
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
6049
6089
|
return removeOnScroll;
|
|
6050
6090
|
}, [brain]);
|
|
6051
|
-
const domRef = (0,
|
|
6091
|
+
const domRef = (0, import_react27.useRef)(null);
|
|
6052
6092
|
const headerCls = HeaderClsRecipe({
|
|
6053
6093
|
pinned: pinning,
|
|
6054
6094
|
overflow: false,
|
|
@@ -6059,18 +6099,18 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6059
6099
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
6060
6100
|
style
|
|
6061
6101
|
};
|
|
6062
|
-
return /* @__PURE__ */
|
|
6102
|
+
return /* @__PURE__ */ React16.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React16.createElement(RawList, {
|
|
6063
6103
|
brain,
|
|
6064
6104
|
renderItem: renderColumn
|
|
6065
6105
|
}));
|
|
6066
6106
|
}
|
|
6067
|
-
var InfiniteTableHeader =
|
|
6107
|
+
var InfiniteTableHeader = React16.memo(InfiniteTableHeaderFn);
|
|
6068
6108
|
|
|
6069
6109
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
6070
|
-
var
|
|
6110
|
+
var React19 = __toModule(require("react"));
|
|
6071
6111
|
|
|
6072
6112
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
6073
|
-
var
|
|
6113
|
+
var React18 = __toModule(require("react"));
|
|
6074
6114
|
|
|
6075
6115
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
6076
6116
|
function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap) {
|
|
@@ -6160,7 +6200,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6160
6200
|
}
|
|
6161
6201
|
|
|
6162
6202
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6163
|
-
var
|
|
6203
|
+
var React17 = __toModule(require("react"));
|
|
6164
6204
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
6165
6205
|
function InfiniteTableHeaderGroup(props) {
|
|
6166
6206
|
const { columnGroup, height, headerHeight } = props;
|
|
@@ -6174,16 +6214,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6174
6214
|
width: columnGroup.computedWidth,
|
|
6175
6215
|
height
|
|
6176
6216
|
};
|
|
6177
|
-
return /* @__PURE__ */
|
|
6217
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
6178
6218
|
"data-group-id": columnGroup.id,
|
|
6179
6219
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
6180
6220
|
style
|
|
6181
|
-
}, /* @__PURE__ */
|
|
6221
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
6182
6222
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
6183
6223
|
style: { height: headerHeight }
|
|
6184
|
-
}, /* @__PURE__ */
|
|
6224
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
6185
6225
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6186
|
-
}, header)), /* @__PURE__ */
|
|
6226
|
+
}, header)), /* @__PURE__ */ React17.createElement("div", {
|
|
6187
6227
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
6188
6228
|
}, props.children));
|
|
6189
6229
|
}
|
|
@@ -6206,7 +6246,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6206
6246
|
return items2.map((colGroupItem) => {
|
|
6207
6247
|
if (colGroupItem.type === "column") {
|
|
6208
6248
|
const col = colGroupItem.ref;
|
|
6209
|
-
return /* @__PURE__ */
|
|
6249
|
+
return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderCell, {
|
|
6210
6250
|
key: col.id,
|
|
6211
6251
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
6212
6252
|
column: col,
|
|
@@ -6220,7 +6260,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6220
6260
|
colIds.push(col.id);
|
|
6221
6261
|
return col;
|
|
6222
6262
|
});
|
|
6223
|
-
return /* @__PURE__ */
|
|
6263
|
+
return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderGroup, {
|
|
6224
6264
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
6225
6265
|
columns: columns2,
|
|
6226
6266
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -6240,7 +6280,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6240
6280
|
}
|
|
6241
6281
|
|
|
6242
6282
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
6243
|
-
var
|
|
6283
|
+
var import_react28 = __toModule(require("react"));
|
|
6244
6284
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
6245
6285
|
var TableHeaderClassName2 = `${rootClassName5}Header`;
|
|
6246
6286
|
var UPDATE_SCROLL = (node, scrollPosition) => {
|
|
@@ -6273,9 +6313,9 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6273
6313
|
},
|
|
6274
6314
|
computed: { computedVisibleColumnsMap: columnsMap }
|
|
6275
6315
|
} = useInfiniteTable();
|
|
6276
|
-
const domRef =
|
|
6316
|
+
const domRef = React19.useRef(null);
|
|
6277
6317
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
6278
|
-
const columnHeaderGroups =
|
|
6318
|
+
const columnHeaderGroups = React19.useMemo(() => {
|
|
6279
6319
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
6280
6320
|
columnGroups: computedColumnGroups,
|
|
6281
6321
|
columnGroupsDepthsMap,
|
|
@@ -6294,7 +6334,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6294
6334
|
columnGroupsMaxDepth
|
|
6295
6335
|
]);
|
|
6296
6336
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
6297
|
-
return /* @__PURE__ */
|
|
6337
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
|
|
6298
6338
|
key: c.id,
|
|
6299
6339
|
headerHeight,
|
|
6300
6340
|
column: c,
|
|
@@ -6306,7 +6346,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6306
6346
|
if (totalWidth != null) {
|
|
6307
6347
|
style.width = availableWidth;
|
|
6308
6348
|
}
|
|
6309
|
-
(0,
|
|
6349
|
+
(0, import_react28.useEffect)(() => {
|
|
6310
6350
|
const scroller = brain || scrollListener;
|
|
6311
6351
|
if (!scroller || !scrollable) {
|
|
6312
6352
|
return;
|
|
@@ -6319,20 +6359,20 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6319
6359
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
6320
6360
|
return removeOnScroll;
|
|
6321
6361
|
}, [brain, scrollListener]);
|
|
6322
|
-
return /* @__PURE__ */
|
|
6362
|
+
return /* @__PURE__ */ React19.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6323
6363
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
6324
6364
|
pinned: pinning,
|
|
6325
6365
|
virtualized: false,
|
|
6326
6366
|
overflow: scrollable
|
|
6327
6367
|
})),
|
|
6328
6368
|
style
|
|
6329
|
-
}), /* @__PURE__ */
|
|
6369
|
+
}), /* @__PURE__ */ React19.createElement("div", {
|
|
6330
6370
|
style: { width: totalWidth },
|
|
6331
6371
|
className: join(flexFlow.row, display.flex),
|
|
6332
6372
|
ref: domRef
|
|
6333
6373
|
}, children));
|
|
6334
6374
|
}
|
|
6335
|
-
var InfiniteTableHeaderUnvirtualized =
|
|
6375
|
+
var InfiniteTableHeaderUnvirtualized = React19.memo(InfiniteTableHeaderUnvirtualizedFn);
|
|
6336
6376
|
|
|
6337
6377
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6338
6378
|
function TableHeaderWrapper(props) {
|
|
@@ -6365,7 +6405,7 @@ function TableHeaderWrapper(props) {
|
|
|
6365
6405
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
6366
6406
|
left: computedPinnedStartWidth
|
|
6367
6407
|
} : void 0;
|
|
6368
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
6408
|
+
const header = virtualizeHeader ? /* @__PURE__ */ React20.createElement(InfiniteTableHeader, {
|
|
6369
6409
|
columns: computedUnpinnedColumns,
|
|
6370
6410
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
6371
6411
|
brain,
|
|
@@ -6378,7 +6418,7 @@ function TableHeaderWrapper(props) {
|
|
|
6378
6418
|
},
|
|
6379
6419
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6380
6420
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6381
|
-
}) : /* @__PURE__ */
|
|
6421
|
+
}) : /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6382
6422
|
style: unvirtualizedStyle,
|
|
6383
6423
|
brain,
|
|
6384
6424
|
scrollable: true,
|
|
@@ -6387,12 +6427,12 @@ function TableHeaderWrapper(props) {
|
|
|
6387
6427
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6388
6428
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6389
6429
|
});
|
|
6390
|
-
return /* @__PURE__ */
|
|
6430
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
6391
6431
|
className: HeaderWrapperCls,
|
|
6392
6432
|
style: {
|
|
6393
6433
|
height: virtualizeHeader ? height : void 0
|
|
6394
6434
|
}
|
|
6395
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
6435
|
+
}, hasPinnedStart ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6396
6436
|
style: {
|
|
6397
6437
|
left: 0,
|
|
6398
6438
|
position: "absolute",
|
|
@@ -6404,7 +6444,7 @@ function TableHeaderWrapper(props) {
|
|
|
6404
6444
|
scrollable: computedPinnedStartOverflow,
|
|
6405
6445
|
pinning: "start",
|
|
6406
6446
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
6407
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
6447
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6408
6448
|
style: {
|
|
6409
6449
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
6410
6450
|
position: "absolute",
|
|
@@ -6416,7 +6456,7 @@ function TableHeaderWrapper(props) {
|
|
|
6416
6456
|
scrollable: computedPinnedEndOverflow,
|
|
6417
6457
|
pinning: "end",
|
|
6418
6458
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
6419
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
6459
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ React20.createElement(VerticalScrollbarPlaceholder, {
|
|
6420
6460
|
style: {
|
|
6421
6461
|
height: "100%",
|
|
6422
6462
|
right: 0
|
|
@@ -6425,13 +6465,13 @@ function TableHeaderWrapper(props) {
|
|
|
6425
6465
|
}
|
|
6426
6466
|
|
|
6427
6467
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6428
|
-
var
|
|
6429
|
-
var
|
|
6468
|
+
var React21 = __toModule(require("react"));
|
|
6469
|
+
var import_react30 = __toModule(require("react"));
|
|
6430
6470
|
|
|
6431
6471
|
// src/components/hooks/useOnScroll.ts
|
|
6432
|
-
var
|
|
6472
|
+
var import_react29 = __toModule(require("react"));
|
|
6433
6473
|
var useOnScroll = (domRef, onScroll) => {
|
|
6434
|
-
(0,
|
|
6474
|
+
(0, import_react29.useEffect)(() => {
|
|
6435
6475
|
const domNode = domRef == null ? void 0 : domRef.current;
|
|
6436
6476
|
const scrollFn = (event) => {
|
|
6437
6477
|
const node = event.target;
|
|
@@ -6469,7 +6509,7 @@ var getScrollableClassName = (scrollable) => {
|
|
|
6469
6509
|
|
|
6470
6510
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6471
6511
|
var rootClassName6 = "InfiniteVirtualScrollContainer";
|
|
6472
|
-
var VirtualScrollContainer =
|
|
6512
|
+
var VirtualScrollContainer = React21.forwardRef(function VirtualScrollContainer2(props, ref) {
|
|
6473
6513
|
const {
|
|
6474
6514
|
children,
|
|
6475
6515
|
scrollable = true,
|
|
@@ -6477,9 +6517,9 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
|
|
|
6477
6517
|
className,
|
|
6478
6518
|
style
|
|
6479
6519
|
} = props;
|
|
6480
|
-
const domRef = ref != null ? ref : (0,
|
|
6520
|
+
const domRef = ref != null ? ref : (0, import_react30.useRef)(null);
|
|
6481
6521
|
useOnScroll(domRef, onContainerScroll);
|
|
6482
|
-
return /* @__PURE__ */
|
|
6522
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
6483
6523
|
ref: domRef,
|
|
6484
6524
|
style,
|
|
6485
6525
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -6487,7 +6527,7 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
|
|
|
6487
6527
|
});
|
|
6488
6528
|
|
|
6489
6529
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
6490
|
-
var
|
|
6530
|
+
var React22 = __toModule(require("react"));
|
|
6491
6531
|
function SpacePlaceholderFn(props) {
|
|
6492
6532
|
const { height, width, count } = props;
|
|
6493
6533
|
const style = {
|
|
@@ -6497,7 +6537,7 @@ function SpacePlaceholderFn(props) {
|
|
|
6497
6537
|
opacity: 0,
|
|
6498
6538
|
pointerEvents: "none"
|
|
6499
6539
|
};
|
|
6500
|
-
return /* @__PURE__ */
|
|
6540
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
6501
6541
|
"data-count": count,
|
|
6502
6542
|
"data-placeholder-width": true ? width : void 0,
|
|
6503
6543
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -6505,21 +6545,21 @@ function SpacePlaceholderFn(props) {
|
|
|
6505
6545
|
style
|
|
6506
6546
|
});
|
|
6507
6547
|
}
|
|
6508
|
-
var SpacePlaceholder =
|
|
6548
|
+
var SpacePlaceholder = React22.memo(SpacePlaceholderFn);
|
|
6509
6549
|
|
|
6510
6550
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
6511
|
-
var
|
|
6551
|
+
var import_react42 = __toModule(require("react"));
|
|
6512
6552
|
|
|
6513
6553
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6514
|
-
var
|
|
6515
|
-
var
|
|
6554
|
+
var React28 = __toModule(require("react"));
|
|
6555
|
+
var import_react35 = __toModule(require("react"));
|
|
6516
6556
|
|
|
6517
6557
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6518
|
-
var
|
|
6558
|
+
var React24 = __toModule(require("react"));
|
|
6519
6559
|
|
|
6520
6560
|
// src/components/VirtualList/VirtualList.tsx
|
|
6521
|
-
var
|
|
6522
|
-
var
|
|
6561
|
+
var React23 = __toModule(require("react"));
|
|
6562
|
+
var import_react31 = __toModule(require("react"));
|
|
6523
6563
|
|
|
6524
6564
|
// src/components/VirtualList/VirtualList.css.ts
|
|
6525
6565
|
var VirtualListCls = "_16lm1iw1 _16lm1iw8 _16lm1iw0";
|
|
@@ -6562,11 +6602,11 @@ var VirtualList = (props) => {
|
|
|
6562
6602
|
"onContainerScroll",
|
|
6563
6603
|
"children"
|
|
6564
6604
|
]);
|
|
6565
|
-
const domRef = (0,
|
|
6605
|
+
const domRef = (0, import_react31.useRef)(null);
|
|
6566
6606
|
const [, rerender] = useRerender();
|
|
6567
|
-
const [totalSize, setTotalSize] = (0,
|
|
6568
|
-
const renderCountRef = (0,
|
|
6569
|
-
(0,
|
|
6607
|
+
const [totalSize, setTotalSize] = (0, import_react31.useState)(0);
|
|
6608
|
+
const renderCountRef = (0, import_react31.useRef)(0);
|
|
6609
|
+
(0, import_react31.useEffect)(() => {
|
|
6570
6610
|
const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
|
|
6571
6611
|
renderCountRef.current = renderCount;
|
|
6572
6612
|
if (true) {
|
|
@@ -6585,7 +6625,7 @@ var VirtualList = (props) => {
|
|
|
6585
6625
|
removeOnTotalSizeChange();
|
|
6586
6626
|
};
|
|
6587
6627
|
}, [virtualBrain]);
|
|
6588
|
-
(0,
|
|
6628
|
+
(0, import_react31.useEffect)(() => {
|
|
6589
6629
|
const onScroll = (scrollPosition) => {
|
|
6590
6630
|
UPDATE_SCROLL2(domRef.current, scrollPosition);
|
|
6591
6631
|
};
|
|
@@ -6600,19 +6640,19 @@ var VirtualList = (props) => {
|
|
|
6600
6640
|
if (true) {
|
|
6601
6641
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
6602
6642
|
}
|
|
6603
|
-
return /* @__PURE__ */
|
|
6643
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React23.createElement(VirtualScrollContainer, {
|
|
6604
6644
|
scrollable,
|
|
6605
6645
|
onContainerScroll
|
|
6606
|
-
}, /* @__PURE__ */
|
|
6646
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
6607
6647
|
ref: domRef,
|
|
6608
6648
|
className: scrollTransformTargetCls,
|
|
6609
6649
|
"data-name": "scroll-transform-target"
|
|
6610
|
-
}, /* @__PURE__ */
|
|
6650
|
+
}, /* @__PURE__ */ React23.createElement(RawList, {
|
|
6611
6651
|
brain: virtualBrain,
|
|
6612
6652
|
renderItem,
|
|
6613
6653
|
repaintId,
|
|
6614
6654
|
debugChannel: "VirtualList-" + mainAxis
|
|
6615
|
-
})), children, /* @__PURE__ */
|
|
6655
|
+
})), children, /* @__PURE__ */ React23.createElement(SpacePlaceholder, {
|
|
6616
6656
|
count,
|
|
6617
6657
|
width,
|
|
6618
6658
|
height
|
|
@@ -6622,14 +6662,14 @@ var VirtualList = (props) => {
|
|
|
6622
6662
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6623
6663
|
var VirtualRowList = (props) => {
|
|
6624
6664
|
const _a = props, { rowWidth, rowHeight, renderRow } = _a, listProps = __objRest(_a, ["rowWidth", "rowHeight", "renderRow"]);
|
|
6625
|
-
const renderItem =
|
|
6665
|
+
const renderItem = React24.useCallback((renderProps) => {
|
|
6626
6666
|
return renderRow({
|
|
6627
6667
|
domRef: renderProps.domRef,
|
|
6628
6668
|
rowHeight: renderProps.itemSize,
|
|
6629
6669
|
rowIndex: renderProps.itemIndex
|
|
6630
6670
|
});
|
|
6631
6671
|
}, [renderRow]);
|
|
6632
|
-
return /* @__PURE__ */
|
|
6672
|
+
return /* @__PURE__ */ React24.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
6633
6673
|
renderItem,
|
|
6634
6674
|
mainAxis: "vertical",
|
|
6635
6675
|
itemMainAxisSize: rowHeight,
|
|
@@ -6638,14 +6678,14 @@ var VirtualRowList = (props) => {
|
|
|
6638
6678
|
};
|
|
6639
6679
|
|
|
6640
6680
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
6641
|
-
var
|
|
6642
|
-
var
|
|
6681
|
+
var React26 = __toModule(require("react"));
|
|
6682
|
+
var import_react34 = __toModule(require("react"));
|
|
6643
6683
|
|
|
6644
6684
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
6645
|
-
var
|
|
6646
|
-
var
|
|
6685
|
+
var React25 = __toModule(require("react"));
|
|
6686
|
+
var import_react32 = __toModule(require("react"));
|
|
6647
6687
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6648
|
-
var InfiniteTableColumnCellContext =
|
|
6688
|
+
var InfiniteTableColumnCellContext = React25.createContext(null);
|
|
6649
6689
|
var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
|
|
6650
6690
|
function isColumnWithField(c) {
|
|
6651
6691
|
return typeof c.field === "string";
|
|
@@ -6710,7 +6750,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6710
6750
|
}
|
|
6711
6751
|
const renderFn = column.render || column.renderValue;
|
|
6712
6752
|
if (renderFn) {
|
|
6713
|
-
return /* @__PURE__ */
|
|
6753
|
+
return /* @__PURE__ */ React25.createElement(RenderHookComponent, {
|
|
6714
6754
|
render: renderFn,
|
|
6715
6755
|
renderParam
|
|
6716
6756
|
});
|
|
@@ -6757,18 +6797,18 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6757
6797
|
renderChildren
|
|
6758
6798
|
});
|
|
6759
6799
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
6760
|
-
return /* @__PURE__ */
|
|
6800
|
+
return /* @__PURE__ */ React25.createElement(ContextProvider, {
|
|
6761
6801
|
value: renderParam
|
|
6762
|
-
}, /* @__PURE__ */
|
|
6802
|
+
}, /* @__PURE__ */ React25.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
6763
6803
|
}
|
|
6764
|
-
var InfiniteTableColumnCell =
|
|
6804
|
+
var InfiniteTableColumnCell = React25.memo(InfiniteTableColumnCellFn);
|
|
6765
6805
|
function useInfiniteColumnCell() {
|
|
6766
|
-
const result = (0,
|
|
6806
|
+
const result = (0, import_react32.useContext)(InfiniteTableColumnCellContext);
|
|
6767
6807
|
return result;
|
|
6768
6808
|
}
|
|
6769
6809
|
|
|
6770
6810
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
|
|
6771
|
-
var
|
|
6811
|
+
var import_react33 = __toModule(require("react"));
|
|
6772
6812
|
|
|
6773
6813
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
|
|
6774
6814
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
@@ -6794,8 +6834,8 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6794
6834
|
rowInfo,
|
|
6795
6835
|
rowSpan
|
|
6796
6836
|
} = props;
|
|
6797
|
-
const domRef = (0,
|
|
6798
|
-
const rowDOMRef = (0,
|
|
6837
|
+
const domRef = (0, import_react33.useRef)(null);
|
|
6838
|
+
const rowDOMRef = (0, import_react33.useCallback)((node) => {
|
|
6799
6839
|
domRefFromProps(node);
|
|
6800
6840
|
domRef.current = node;
|
|
6801
6841
|
}, []);
|
|
@@ -6826,7 +6866,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6826
6866
|
}), `${InfiniteTableRowClassName}--${rowInfo.isGroupRow ? "group" : "normal"}-row`, inlineGroupRoot ? `${InfiniteTableRowClassName}--inline-group-row` : "", showZebraRows ? `${InfiniteTableRowClassName}--${odd ? "odd" : "even"}` : null, showHoverRows ? `${InfiniteTableRowClassName}--show-hover` : null, domProps == null ? void 0 : domProps.className, rowProps == null ? void 0 : rowProps.className, rowComputedClassName);
|
|
6827
6867
|
const initialMouseEnter = rowProps == null ? void 0 : rowProps.onMouseEnter;
|
|
6828
6868
|
const initialMouseLeave = rowProps == null ? void 0 : rowProps.onMouseLeave;
|
|
6829
|
-
const onMouseEnter = (0,
|
|
6869
|
+
const onMouseEnter = (0, import_react33.useCallback)((event) => {
|
|
6830
6870
|
var _a;
|
|
6831
6871
|
initialMouseEnter == null ? void 0 : initialMouseEnter(event);
|
|
6832
6872
|
const rowIndex2 = ((_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex) * 1;
|
|
@@ -6840,7 +6880,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6840
6880
|
const rows = parentNode.querySelectorAll(hoverSelector.join(","));
|
|
6841
6881
|
rows.forEach((row) => row.classList.add(InfiniteTableRowClassName__hover, RowHoverCls));
|
|
6842
6882
|
}, [initialMouseEnter, showHoverRows]);
|
|
6843
|
-
const onMouseLeave = (0,
|
|
6883
|
+
const onMouseLeave = (0, import_react33.useCallback)((event) => {
|
|
6844
6884
|
var _a;
|
|
6845
6885
|
initialMouseLeave == null ? void 0 : initialMouseLeave(event);
|
|
6846
6886
|
const rowIndex2 = (_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex;
|
|
@@ -6896,13 +6936,13 @@ function InfiniteTableRowFn(props) {
|
|
|
6896
6936
|
width: rowWidth,
|
|
6897
6937
|
height: rowHeight
|
|
6898
6938
|
}, domProps.style);
|
|
6899
|
-
const renderCellRef = (0,
|
|
6900
|
-
const renderCell =
|
|
6939
|
+
const renderCellRef = (0, import_react34.useRef)(null);
|
|
6940
|
+
const renderCell = React26.useCallback(({ domRef, itemIndex }) => {
|
|
6901
6941
|
const column = columns[itemIndex];
|
|
6902
6942
|
if (!column) {
|
|
6903
6943
|
}
|
|
6904
6944
|
const hidden = false;
|
|
6905
|
-
return /* @__PURE__ */
|
|
6945
|
+
return /* @__PURE__ */ React26.createElement(InfiniteTableColumnCell, {
|
|
6906
6946
|
getData,
|
|
6907
6947
|
rowInfo,
|
|
6908
6948
|
groupRenderStrategy,
|
|
@@ -6929,18 +6969,18 @@ function InfiniteTableRowFn(props) {
|
|
|
6929
6969
|
if (true) {
|
|
6930
6970
|
domProps["data-cmp-name"] = "ITableRow";
|
|
6931
6971
|
}
|
|
6932
|
-
return /* @__PURE__ */
|
|
6972
|
+
return /* @__PURE__ */ React26.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6933
6973
|
style
|
|
6934
|
-
}), /* @__PURE__ */
|
|
6974
|
+
}), /* @__PURE__ */ React26.createElement(RawList, {
|
|
6935
6975
|
brain,
|
|
6936
6976
|
renderItem: renderCell,
|
|
6937
6977
|
debugChannel: `${rowIndex}`
|
|
6938
6978
|
}));
|
|
6939
6979
|
}
|
|
6940
|
-
var InfiniteTableRow =
|
|
6980
|
+
var InfiniteTableRow = React26.memo(InfiniteTableRowFn);
|
|
6941
6981
|
|
|
6942
6982
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
6943
|
-
var
|
|
6983
|
+
var React27 = __toModule(require("react"));
|
|
6944
6984
|
function TableRowUnvirtualizedFn(props) {
|
|
6945
6985
|
const {
|
|
6946
6986
|
rowHeight,
|
|
@@ -6961,7 +7001,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6961
7001
|
}, domProps.style);
|
|
6962
7002
|
const children = columns.map((col) => {
|
|
6963
7003
|
const hidden = false;
|
|
6964
|
-
return /* @__PURE__ */
|
|
7004
|
+
return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
|
|
6965
7005
|
key: col.id,
|
|
6966
7006
|
virtualized: false,
|
|
6967
7007
|
rowHeight,
|
|
@@ -6974,11 +7014,11 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6974
7014
|
column: col
|
|
6975
7015
|
});
|
|
6976
7016
|
});
|
|
6977
|
-
return /* @__PURE__ */
|
|
7017
|
+
return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6978
7018
|
style
|
|
6979
7019
|
}), children);
|
|
6980
7020
|
}
|
|
6981
|
-
var TableRowUnvirtualized =
|
|
7021
|
+
var TableRowUnvirtualized = React27.memo(TableRowUnvirtualizedFn);
|
|
6982
7022
|
|
|
6983
7023
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6984
7024
|
function useUnpinnedRendering(params) {
|
|
@@ -7001,7 +7041,7 @@ function useUnpinnedRendering(params) {
|
|
|
7001
7041
|
} = params;
|
|
7002
7042
|
const { virtualizeColumns } = getState();
|
|
7003
7043
|
const shouldVirtualizeColumns = typeof virtualizeColumns === "function" ? virtualizeColumns(computedUnpinnedColumns) : virtualizeColumns != null ? virtualizeColumns : true;
|
|
7004
|
-
const renderRowUnpinned = (0,
|
|
7044
|
+
const renderRowUnpinned = (0, import_react35.useCallback)((rowParams) => {
|
|
7005
7045
|
const dataArray = getData();
|
|
7006
7046
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
7007
7047
|
const { showZebraRows, showHoverRows } = getState();
|
|
@@ -7023,7 +7063,7 @@ function useUnpinnedRendering(params) {
|
|
|
7023
7063
|
rowProps.repaintId = repaintId;
|
|
7024
7064
|
}
|
|
7025
7065
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
7026
|
-
return /* @__PURE__ */
|
|
7066
|
+
return /* @__PURE__ */ React28.createElement(TableRowComponent, __spreadValues({}, rowProps));
|
|
7027
7067
|
}, [
|
|
7028
7068
|
repaintId,
|
|
7029
7069
|
rowHeight,
|
|
@@ -7034,7 +7074,7 @@ function useUnpinnedRendering(params) {
|
|
|
7034
7074
|
horizontalVirtualBrain,
|
|
7035
7075
|
verticalVirtualBrain
|
|
7036
7076
|
]);
|
|
7037
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
7077
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React28.createElement("div", {
|
|
7038
7078
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
7039
7079
|
style: {
|
|
7040
7080
|
position: "absolute",
|
|
@@ -7045,10 +7085,10 @@ function useUnpinnedRendering(params) {
|
|
|
7045
7085
|
overflow: "auto",
|
|
7046
7086
|
visibility: columnShifts ? "visible" : "hidden"
|
|
7047
7087
|
}
|
|
7048
|
-
}, /* @__PURE__ */
|
|
7088
|
+
}, /* @__PURE__ */ React28.createElement("div", {
|
|
7049
7089
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
7050
7090
|
})) : null;
|
|
7051
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
7091
|
+
return rowHeight != 0 ? /* @__PURE__ */ React28.createElement(VirtualRowList, {
|
|
7052
7092
|
repaintId: `${repaintId}-unpinned-`,
|
|
7053
7093
|
brain: verticalVirtualBrain,
|
|
7054
7094
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -7069,7 +7109,7 @@ function useUnpinnedRendering(params) {
|
|
|
7069
7109
|
}
|
|
7070
7110
|
|
|
7071
7111
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
7072
|
-
var
|
|
7112
|
+
var import_react36 = __toModule(require("react"));
|
|
7073
7113
|
|
|
7074
7114
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
7075
7115
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -7094,7 +7134,6 @@ var useOnContainerScroll = ({
|
|
|
7094
7134
|
componentState: {
|
|
7095
7135
|
scrollStopDelay,
|
|
7096
7136
|
scrollerDOMRef,
|
|
7097
|
-
domRef,
|
|
7098
7137
|
scrollToBottomOffset,
|
|
7099
7138
|
onScrollToBottom,
|
|
7100
7139
|
onScrollToTop,
|
|
@@ -7107,18 +7146,18 @@ var useOnContainerScroll = ({
|
|
|
7107
7146
|
getState: getDataSourceState,
|
|
7108
7147
|
componentState: { notifyScrollStop }
|
|
7109
7148
|
} = useDataSourceContextValue();
|
|
7110
|
-
const onScrollStop = (0,
|
|
7149
|
+
const onScrollStop = (0, import_react36.useCallback)((param) => {
|
|
7111
7150
|
onScrollStopFromProps == null ? void 0 : onScrollStopFromProps(param);
|
|
7112
7151
|
notifyScrollStop(param);
|
|
7113
7152
|
}, [onScrollStopFromProps, notifyScrollStop]);
|
|
7114
|
-
const timeoutIdRef = (0,
|
|
7115
|
-
const scrollingRef = (0,
|
|
7116
|
-
const scrollTopMaxRef = (0,
|
|
7117
|
-
(0,
|
|
7153
|
+
const timeoutIdRef = (0, import_react36.useRef)(0);
|
|
7154
|
+
const scrollingRef = (0, import_react36.useRef)(false);
|
|
7155
|
+
const scrollTopMaxRef = (0, import_react36.useRef)(0);
|
|
7156
|
+
(0, import_react36.useEffect)(() => {
|
|
7118
7157
|
const { current: node } = scrollerDOMRef;
|
|
7119
7158
|
scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
|
|
7120
7159
|
}, [reservedContentHeight, bodySize.height]);
|
|
7121
|
-
const setScrolling = (0,
|
|
7160
|
+
const setScrolling = (0, import_react36.useCallback)((scrolling) => {
|
|
7122
7161
|
var _a;
|
|
7123
7162
|
const prevScrolling = scrollingRef.current;
|
|
7124
7163
|
scrollingRef.current = scrolling;
|
|
@@ -7140,7 +7179,7 @@ var useOnContainerScroll = ({
|
|
|
7140
7179
|
lastVisibleRowIndex: range.renderEndIndex
|
|
7141
7180
|
});
|
|
7142
7181
|
}
|
|
7143
|
-
const classList = (_a =
|
|
7182
|
+
const classList = (_a = scrollerDOMRef.current) == null ? void 0 : _a.classList;
|
|
7144
7183
|
if (!classList) {
|
|
7145
7184
|
return;
|
|
7146
7185
|
}
|
|
@@ -7151,25 +7190,25 @@ var useOnContainerScroll = ({
|
|
|
7151
7190
|
}
|
|
7152
7191
|
}
|
|
7153
7192
|
}, [scrollStopDelay, onScrollStop]);
|
|
7154
|
-
const onContainerScroll = (0,
|
|
7193
|
+
const onContainerScroll = (0, import_react36.useCallback)((scrollInfo) => {
|
|
7155
7194
|
verticalVirtualBrain.setScrollPosition(scrollInfo);
|
|
7156
7195
|
horizontalVirtualBrain.setScrollPosition(scrollInfo);
|
|
7157
7196
|
setScrolling(true);
|
|
7158
7197
|
}, [
|
|
7159
7198
|
horizontalVirtualBrain,
|
|
7160
7199
|
verticalVirtualBrain,
|
|
7161
|
-
|
|
7200
|
+
scrollerDOMRef.current,
|
|
7162
7201
|
setScrolling
|
|
7163
7202
|
]);
|
|
7164
|
-
const scrollPositionRef = (0,
|
|
7203
|
+
const scrollPositionRef = (0, import_react36.useRef)({
|
|
7165
7204
|
scrollLeft: 0,
|
|
7166
7205
|
scrollTop: 0
|
|
7167
7206
|
});
|
|
7168
|
-
const applyScrollHorizontal = (0,
|
|
7207
|
+
const applyScrollHorizontal = (0, import_react36.useCallback)(({ scrollLeft }) => {
|
|
7169
7208
|
scrollPositionRef.current.scrollLeft = scrollLeft;
|
|
7170
7209
|
onContainerScroll(scrollPositionRef.current);
|
|
7171
7210
|
}, [onContainerScroll]);
|
|
7172
|
-
const applyScrollVertical = (0,
|
|
7211
|
+
const applyScrollVertical = (0, import_react36.useCallback)(({ scrollTop }) => {
|
|
7173
7212
|
scrollPositionRef.current.scrollTop = scrollTop;
|
|
7174
7213
|
onContainerScroll(scrollPositionRef.current);
|
|
7175
7214
|
if (scrollTop === 0) {
|
|
@@ -7191,17 +7230,17 @@ var useOnContainerScroll = ({
|
|
|
7191
7230
|
};
|
|
7192
7231
|
|
|
7193
7232
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
7194
|
-
var
|
|
7195
|
-
var
|
|
7233
|
+
var React30 = __toModule(require("react"));
|
|
7234
|
+
var import_react39 = __toModule(require("react"));
|
|
7196
7235
|
|
|
7197
7236
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
7198
|
-
var
|
|
7199
|
-
var
|
|
7237
|
+
var React29 = __toModule(require("react"));
|
|
7238
|
+
var import_react38 = __toModule(require("react"));
|
|
7200
7239
|
|
|
7201
7240
|
// src/components/hooks/useOnMount.ts
|
|
7202
|
-
var
|
|
7241
|
+
var import_react37 = __toModule(require("react"));
|
|
7203
7242
|
function useOnMount(domRef, props) {
|
|
7204
|
-
(0,
|
|
7243
|
+
(0, import_react37.useEffect)(() => {
|
|
7205
7244
|
const { onMount, onUnmount } = props;
|
|
7206
7245
|
const node = domRef == null ? void 0 : domRef.current;
|
|
7207
7246
|
onMount == null ? void 0 : onMount(node);
|
|
@@ -7232,8 +7271,8 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7232
7271
|
onMount,
|
|
7233
7272
|
onUnmount
|
|
7234
7273
|
} = props;
|
|
7235
|
-
const domRef = (0,
|
|
7236
|
-
const renderItem = (0,
|
|
7274
|
+
const domRef = (0, import_react38.useRef)(null);
|
|
7275
|
+
const renderItem = (0, import_react38.useCallback)((renderProps) => renderRow({
|
|
7237
7276
|
domRef: renderProps.domRef,
|
|
7238
7277
|
rowHeight: renderProps.itemSize,
|
|
7239
7278
|
rowIndex: renderProps.itemIndex
|
|
@@ -7242,7 +7281,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7242
7281
|
onMount,
|
|
7243
7282
|
onUnmount
|
|
7244
7283
|
});
|
|
7245
|
-
(0,
|
|
7284
|
+
(0, import_react38.useEffect)(() => {
|
|
7246
7285
|
const onScroll = (scrollPosition) => {
|
|
7247
7286
|
const node = domRef.current;
|
|
7248
7287
|
if (node) {
|
|
@@ -7271,7 +7310,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7271
7310
|
if (true) {
|
|
7272
7311
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
7273
7312
|
}
|
|
7274
|
-
return /* @__PURE__ */
|
|
7313
|
+
return /* @__PURE__ */ React29.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React29.createElement(RawList, {
|
|
7275
7314
|
brain,
|
|
7276
7315
|
renderItem,
|
|
7277
7316
|
repaintId
|
|
@@ -7294,7 +7333,7 @@ function PinnedRowsContainer(props) {
|
|
|
7294
7333
|
brain,
|
|
7295
7334
|
renderRow
|
|
7296
7335
|
} = props;
|
|
7297
|
-
const style =
|
|
7336
|
+
const style = React30.useMemo(() => {
|
|
7298
7337
|
const result = pinning === "end" ? {
|
|
7299
7338
|
width: rowWidth,
|
|
7300
7339
|
height,
|
|
@@ -7309,7 +7348,7 @@ function PinnedRowsContainer(props) {
|
|
|
7309
7348
|
}
|
|
7310
7349
|
return result;
|
|
7311
7350
|
}, [height, rowWidth, pinning, hasOverflow]);
|
|
7312
|
-
const updateScroll = (0,
|
|
7351
|
+
const updateScroll = (0, import_react39.useCallback)((node, scrollPosition) => {
|
|
7313
7352
|
UPDATE_SCROLL3(node, scrollPosition, hasOverflow ? pinnedScrollListener.getScrollPosition() : void 0);
|
|
7314
7353
|
}, [hasOverflow, pinnedScrollListener]);
|
|
7315
7354
|
const rowListProps = {
|
|
@@ -7320,7 +7359,7 @@ function PinnedRowsContainer(props) {
|
|
|
7320
7359
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
7321
7360
|
};
|
|
7322
7361
|
if (hasOverflow) {
|
|
7323
|
-
return /* @__PURE__ */
|
|
7362
|
+
return /* @__PURE__ */ React30.createElement(VirtualScrollContainer, {
|
|
7324
7363
|
scrollable: {
|
|
7325
7364
|
horizontal: true,
|
|
7326
7365
|
vertical: false
|
|
@@ -7336,23 +7375,23 @@ function PinnedRowsContainer(props) {
|
|
|
7336
7375
|
className: join(PinnedRowsContainerClsVariants({
|
|
7337
7376
|
pinned: pinning
|
|
7338
7377
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
7339
|
-
}, /* @__PURE__ */
|
|
7378
|
+
}, /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
7340
7379
|
onMount: (node) => {
|
|
7341
7380
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
7342
7381
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
7343
7382
|
});
|
|
7344
7383
|
}
|
|
7345
|
-
})), /* @__PURE__ */
|
|
7384
|
+
})), /* @__PURE__ */ React30.createElement(SpacePlaceholder, {
|
|
7346
7385
|
width: rowWidth,
|
|
7347
7386
|
height: 1
|
|
7348
7387
|
}));
|
|
7349
7388
|
}
|
|
7350
|
-
return /* @__PURE__ */
|
|
7389
|
+
return /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
7351
7390
|
}
|
|
7352
7391
|
function useRenderPinnedRow(params) {
|
|
7353
7392
|
const { getData, getState, columnsWidth, columns, rowSpan, verticalBrain } = params;
|
|
7354
7393
|
const dataArray = getData();
|
|
7355
|
-
const renderPinnedRow = (0,
|
|
7394
|
+
const renderPinnedRow = (0, import_react39.useCallback)((rowParams) => {
|
|
7356
7395
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
7357
7396
|
const { showZebraRows, showHoverRows } = getState();
|
|
7358
7397
|
const rowProps = __spreadValues({
|
|
@@ -7368,7 +7407,7 @@ function useRenderPinnedRow(params) {
|
|
|
7368
7407
|
rowWidth: columnsWidth,
|
|
7369
7408
|
columns
|
|
7370
7409
|
}, rowParams);
|
|
7371
|
-
return /* @__PURE__ */
|
|
7410
|
+
return /* @__PURE__ */ React30.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
7372
7411
|
}, [columnsWidth, columns, verticalBrain, dataArray]);
|
|
7373
7412
|
return renderPinnedRow;
|
|
7374
7413
|
}
|
|
@@ -7414,7 +7453,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7414
7453
|
columns,
|
|
7415
7454
|
columnsWidth
|
|
7416
7455
|
});
|
|
7417
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
7456
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React30.createElement(PinnedRowsContainer, {
|
|
7418
7457
|
pinning: side,
|
|
7419
7458
|
pinnedScrollListener,
|
|
7420
7459
|
hasOverflow,
|
|
@@ -7427,7 +7466,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7427
7466
|
brain: verticalVirtualBrain,
|
|
7428
7467
|
renderRow: renderRowPinned
|
|
7429
7468
|
}) : null;
|
|
7430
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
7469
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React30.createElement(HorizontalScrollbarPlaceholder, {
|
|
7431
7470
|
style: side === "end" ? {
|
|
7432
7471
|
width: columnsWidth,
|
|
7433
7472
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -7469,13 +7508,13 @@ function usePinnedStartRendering(params) {
|
|
|
7469
7508
|
}
|
|
7470
7509
|
|
|
7471
7510
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
7472
|
-
var
|
|
7511
|
+
var import_react41 = __toModule(require("react"));
|
|
7473
7512
|
|
|
7474
7513
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
7475
|
-
var
|
|
7514
|
+
var import_react40 = __toModule(require("react"));
|
|
7476
7515
|
var debug5 = dbg("useColumnSizeFn");
|
|
7477
7516
|
function useColumnSizeFn(computedUnpinnedColumns) {
|
|
7478
|
-
const columnSize = (0,
|
|
7517
|
+
const columnSize = (0, import_react40.useCallback)((index) => {
|
|
7479
7518
|
const column = computedUnpinnedColumns[index];
|
|
7480
7519
|
if (!column) {
|
|
7481
7520
|
debug5("cannot find column at index", index, computedUnpinnedColumns);
|
|
@@ -7505,13 +7544,13 @@ function useYourBrain(param) {
|
|
|
7505
7544
|
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
7506
7545
|
globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
|
|
7507
7546
|
}
|
|
7508
|
-
(0,
|
|
7547
|
+
(0, import_react41.useEffect)(() => {
|
|
7509
7548
|
verticalVirtualBrain.setAvailableSize({
|
|
7510
7549
|
height: bodySize.height,
|
|
7511
7550
|
width: 0
|
|
7512
7551
|
});
|
|
7513
7552
|
}, [bodySize, verticalVirtualBrain]);
|
|
7514
|
-
(0,
|
|
7553
|
+
(0, import_react41.useEffect)(() => {
|
|
7515
7554
|
horizontalVirtualBrain.setAvailableSize({
|
|
7516
7555
|
height: 0,
|
|
7517
7556
|
width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
|
|
@@ -7552,7 +7591,7 @@ function useListRendering(param) {
|
|
|
7552
7591
|
horizontalVirtualBrain
|
|
7553
7592
|
} = componentState;
|
|
7554
7593
|
const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
|
|
7555
|
-
const repaintIdRef = (0,
|
|
7594
|
+
const repaintIdRef = (0, import_react42.useRef)(0);
|
|
7556
7595
|
if (prevDataSourceTimestamp !== dataSourceState.updatedAt || !shallowEqualObjects(prevComputed, computed)) {
|
|
7557
7596
|
repaintIdRef.current++;
|
|
7558
7597
|
}
|
|
@@ -7571,11 +7610,11 @@ function useListRendering(param) {
|
|
|
7571
7610
|
const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
|
|
7572
7611
|
const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
|
|
7573
7612
|
const hasVerticalScrollbar = bodySize.height > 0 && bodySize.height < reservedContentHeight;
|
|
7574
|
-
const scrollbars = (0,
|
|
7613
|
+
const scrollbars = (0, import_react42.useMemo)(() => ({
|
|
7575
7614
|
vertical: hasVerticalScrollbar,
|
|
7576
7615
|
horizontal: hasHorizontalScrollbar
|
|
7577
7616
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
7578
|
-
(0,
|
|
7617
|
+
(0, import_react42.useEffect)(() => {
|
|
7579
7618
|
if (!bodySize.height) {
|
|
7580
7619
|
return;
|
|
7581
7620
|
}
|
|
@@ -7631,7 +7670,7 @@ function useListRendering(param) {
|
|
|
7631
7670
|
computedUnpinnedColumns
|
|
7632
7671
|
});
|
|
7633
7672
|
const [, rerender] = useRerender();
|
|
7634
|
-
(0,
|
|
7673
|
+
(0, import_react42.useEffect)(() => {
|
|
7635
7674
|
rerender();
|
|
7636
7675
|
}, [dataSourceState]);
|
|
7637
7676
|
const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
|
|
@@ -7654,8 +7693,8 @@ function useListRendering(param) {
|
|
|
7654
7693
|
}
|
|
7655
7694
|
|
|
7656
7695
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7657
|
-
var
|
|
7658
|
-
var
|
|
7696
|
+
var React31 = __toModule(require("react"));
|
|
7697
|
+
var import_react43 = __toModule(require("react"));
|
|
7659
7698
|
|
|
7660
7699
|
// src/components/utils/decamelize.ts
|
|
7661
7700
|
function decamelize(str, options) {
|
|
@@ -7690,10 +7729,10 @@ var enforceStyle = (node, style) => {
|
|
|
7690
7729
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
7691
7730
|
}
|
|
7692
7731
|
};
|
|
7693
|
-
var InfiniteTableLicenseFooter =
|
|
7732
|
+
var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7694
7733
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7695
|
-
const domRef =
|
|
7696
|
-
const domCallback =
|
|
7734
|
+
const domRef = React31.useRef(null);
|
|
7735
|
+
const domCallback = React31.useCallback((node) => {
|
|
7697
7736
|
domRef.current = node;
|
|
7698
7737
|
if (!ref) {
|
|
7699
7738
|
return;
|
|
@@ -7704,7 +7743,7 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7704
7743
|
ref.current = node;
|
|
7705
7744
|
}
|
|
7706
7745
|
}, []);
|
|
7707
|
-
(0,
|
|
7746
|
+
(0, import_react43.useEffect)(() => {
|
|
7708
7747
|
const forceStyle = () => {
|
|
7709
7748
|
requestAnimationFrame(() => {
|
|
7710
7749
|
var _a;
|
|
@@ -7718,12 +7757,12 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7718
7757
|
clearInterval(intervalId);
|
|
7719
7758
|
};
|
|
7720
7759
|
}, []);
|
|
7721
|
-
return /* @__PURE__ */
|
|
7760
|
+
return /* @__PURE__ */ React31.createElement("div", __spreadProps(__spreadValues({
|
|
7722
7761
|
ref: domCallback
|
|
7723
7762
|
}, props), {
|
|
7724
7763
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7725
7764
|
style: defaultStyle2
|
|
7726
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7765
|
+
}), "Powered by", " ", /* @__PURE__ */ React31.createElement("a", {
|
|
7727
7766
|
href: "https://infinite-table.com",
|
|
7728
7767
|
rel: "noopener noreferrer",
|
|
7729
7768
|
role: "link",
|
|
@@ -7732,7 +7771,7 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7732
7771
|
});
|
|
7733
7772
|
|
|
7734
7773
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
7735
|
-
var
|
|
7774
|
+
var import_react44 = __toModule(require("react"));
|
|
7736
7775
|
|
|
7737
7776
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
7738
7777
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -7890,10 +7929,10 @@ var isInsideSandbox = () => {
|
|
|
7890
7929
|
};
|
|
7891
7930
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
7892
7931
|
var useLicense = (licenseKey = "") => {
|
|
7893
|
-
const valid = (0,
|
|
7932
|
+
const valid = (0, import_react44.useMemo)(() => {
|
|
7894
7933
|
let valid2 = isValidLicense(licenseKey, {
|
|
7895
7934
|
publishedAt: 1624970570587,
|
|
7896
|
-
version: "0.2.
|
|
7935
|
+
version: "0.2.19"
|
|
7897
7936
|
});
|
|
7898
7937
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
7899
7938
|
return true;
|
|
@@ -7904,8 +7943,8 @@ var useLicense = (licenseKey = "") => {
|
|
|
7904
7943
|
};
|
|
7905
7944
|
|
|
7906
7945
|
// src/components/CSSVariableWatch.tsx
|
|
7907
|
-
var
|
|
7908
|
-
var
|
|
7946
|
+
var React32 = __toModule(require("react"));
|
|
7947
|
+
var import_react45 = __toModule(require("react"));
|
|
7909
7948
|
var error = err("CSSVariableWatch");
|
|
7910
7949
|
var debug6 = dbg("CSSVariableWatch");
|
|
7911
7950
|
var WRAPPER_STYLE = {
|
|
@@ -7918,15 +7957,15 @@ var WRAPPER_STYLE = {
|
|
|
7918
7957
|
overflow: "hidden"
|
|
7919
7958
|
};
|
|
7920
7959
|
var useCSSVariableWatch = (params) => {
|
|
7921
|
-
const lastValueRef = (0,
|
|
7922
|
-
const onResize =
|
|
7960
|
+
const lastValueRef = (0, import_react45.useRef)(0);
|
|
7961
|
+
const onResize = React32.useCallback(({ height }) => {
|
|
7923
7962
|
if (height && height !== lastValueRef.current) {
|
|
7924
7963
|
lastValueRef.current = height;
|
|
7925
7964
|
params.onChange(height);
|
|
7926
7965
|
}
|
|
7927
7966
|
}, [params.onChange]);
|
|
7928
7967
|
useResizeObserver(params.ref, onResize, { earlyAttach: true });
|
|
7929
|
-
|
|
7968
|
+
React32.useLayoutEffect(() => {
|
|
7930
7969
|
const value = params.ref.current.getBoundingClientRect().height;
|
|
7931
7970
|
if (value) {
|
|
7932
7971
|
lastValueRef.current = value;
|
|
@@ -7938,15 +7977,15 @@ var useCSSVariableWatch = (params) => {
|
|
|
7938
7977
|
}, []);
|
|
7939
7978
|
};
|
|
7940
7979
|
var CSSVariableWatch = (props) => {
|
|
7941
|
-
const domRef = (0,
|
|
7980
|
+
const domRef = (0, import_react45.useRef)(null);
|
|
7942
7981
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7943
7982
|
ref: domRef
|
|
7944
7983
|
}));
|
|
7945
|
-
return /* @__PURE__ */
|
|
7984
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
7946
7985
|
"data-name": "css-variable-watcher",
|
|
7947
7986
|
"data-var": props.varName,
|
|
7948
7987
|
style: WRAPPER_STYLE
|
|
7949
|
-
}, /* @__PURE__ */
|
|
7988
|
+
}, /* @__PURE__ */ React32.createElement("div", {
|
|
7950
7989
|
ref: domRef,
|
|
7951
7990
|
style: {
|
|
7952
7991
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -8039,7 +8078,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
8039
8078
|
}
|
|
8040
8079
|
|
|
8041
8080
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
8042
|
-
var
|
|
8081
|
+
var React33 = __toModule(require("react"));
|
|
8043
8082
|
|
|
8044
8083
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
8045
8084
|
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
@@ -8051,18 +8090,18 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
8051
8090
|
var baseCls = `${rootClassName11}-LoadMask`;
|
|
8052
8091
|
function LoadMaskFn(props) {
|
|
8053
8092
|
const { visible, children = "Loading" } = props;
|
|
8054
|
-
return /* @__PURE__ */
|
|
8093
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
8055
8094
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls}`
|
|
8056
|
-
}, /* @__PURE__ */
|
|
8095
|
+
}, /* @__PURE__ */ React33.createElement("div", {
|
|
8057
8096
|
className: `${LoadMaskOverlayCls} ${baseCls}-Overlay`
|
|
8058
|
-
}), /* @__PURE__ */
|
|
8097
|
+
}), /* @__PURE__ */ React33.createElement("div", {
|
|
8059
8098
|
className: `${LoadMaskTextCls} ${baseCls}-Text`
|
|
8060
8099
|
}, children));
|
|
8061
8100
|
}
|
|
8062
|
-
var LoadMask =
|
|
8101
|
+
var LoadMask = React33.memo(LoadMaskFn);
|
|
8063
8102
|
|
|
8064
8103
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
8065
|
-
var
|
|
8104
|
+
var import_react46 = __toModule(require("react"));
|
|
8066
8105
|
var OFFSET = 10;
|
|
8067
8106
|
function getColumnContentMaxWidths(domRef, options) {
|
|
8068
8107
|
var _a;
|
|
@@ -8127,11 +8166,11 @@ function useAutoSizeColumns() {
|
|
|
8127
8166
|
horizontalVirtualBrain
|
|
8128
8167
|
}
|
|
8129
8168
|
} = useComponentState();
|
|
8130
|
-
const [refreshId, setRefreshId] = (0,
|
|
8169
|
+
const [refreshId, setRefreshId] = (0, import_react46.useState)(0);
|
|
8131
8170
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
8132
8171
|
const getTheKey = useLatest(theKey);
|
|
8133
|
-
const lastExecutedIdentifierRef = (0,
|
|
8134
|
-
(0,
|
|
8172
|
+
const lastExecutedIdentifierRef = (0, import_react46.useRef)(null);
|
|
8173
|
+
(0, import_react46.useEffect)(() => {
|
|
8135
8174
|
const key = getTheKey();
|
|
8136
8175
|
if (key == null) {
|
|
8137
8176
|
return;
|
|
@@ -8149,7 +8188,7 @@ function useAutoSizeColumns() {
|
|
|
8149
8188
|
removeHorizontal();
|
|
8150
8189
|
};
|
|
8151
8190
|
}, [verticalVirtualBrain, horizontalVirtualBrain]);
|
|
8152
|
-
(0,
|
|
8191
|
+
(0, import_react46.useEffect)(() => {
|
|
8153
8192
|
var _a;
|
|
8154
8193
|
if (theKey == null) {
|
|
8155
8194
|
return;
|
|
@@ -8210,7 +8249,7 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
8210
8249
|
getParentState: () => useDataSource(),
|
|
8211
8250
|
debugName: "InfiniteTable"
|
|
8212
8251
|
});
|
|
8213
|
-
var InfiniteTableComponent =
|
|
8252
|
+
var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
|
|
8214
8253
|
var _a;
|
|
8215
8254
|
const {
|
|
8216
8255
|
componentState,
|
|
@@ -8257,7 +8296,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
8257
8296
|
bodySize,
|
|
8258
8297
|
computed
|
|
8259
8298
|
});
|
|
8260
|
-
|
|
8299
|
+
React34.useEffect(() => {
|
|
8261
8300
|
const dataSourceState = getDataSourceState();
|
|
8262
8301
|
const onChange = debounce((renderRange) => {
|
|
8263
8302
|
dataSourceState.notifyRenderRangeChange(renderRange);
|
|
@@ -8267,7 +8306,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
8267
8306
|
const licenseValid = useLicense(licenseKey);
|
|
8268
8307
|
const domProps = useDOMProps(componentState.domProps);
|
|
8269
8308
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
8270
|
-
|
|
8309
|
+
React34.useLayoutEffect(() => {
|
|
8271
8310
|
const dataSourceState = getDataSourceState();
|
|
8272
8311
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
8273
8312
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -8276,35 +8315,35 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
8276
8315
|
}
|
|
8277
8316
|
notifyScrollbarsChange(scrollbars);
|
|
8278
8317
|
}, [scrollbars]);
|
|
8279
|
-
|
|
8318
|
+
React34.useEffect(() => {
|
|
8280
8319
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
8281
8320
|
}, [scrollStopDelay]);
|
|
8282
8321
|
useAutoSizeColumns();
|
|
8283
|
-
return /* @__PURE__ */
|
|
8322
|
+
return /* @__PURE__ */ React34.createElement("div", __spreadValues({
|
|
8284
8323
|
ref: domRef
|
|
8285
|
-
}, domProps), header ? /* @__PURE__ */
|
|
8324
|
+
}, domProps), header ? /* @__PURE__ */ React34.createElement(TableHeaderWrapper, {
|
|
8286
8325
|
brain: horizontalVirtualBrain,
|
|
8287
8326
|
repaintId,
|
|
8288
8327
|
scrollbars
|
|
8289
|
-
}) : null, /* @__PURE__ */
|
|
8328
|
+
}) : null, /* @__PURE__ */ React34.createElement(InfiniteTableBody, null, /* @__PURE__ */ React34.createElement(VirtualScrollContainer, {
|
|
8290
8329
|
ref: scrollerDOMRef,
|
|
8291
8330
|
onContainerScroll: applyScrollVertical,
|
|
8292
8331
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
8293
|
-
}, /* @__PURE__ */
|
|
8332
|
+
}, /* @__PURE__ */ React34.createElement("div", {
|
|
8294
8333
|
className: display.flex
|
|
8295
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
8334
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React34.createElement(SpacePlaceholder, {
|
|
8296
8335
|
count: dataArray.length,
|
|
8297
8336
|
width: 0,
|
|
8298
8337
|
height: reservedContentHeight
|
|
8299
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
8338
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React34.createElement(LoadMaskCmp, {
|
|
8300
8339
|
visible: loading
|
|
8301
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
8340
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ React34.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React34.createElement("div", {
|
|
8302
8341
|
ref: portalDOMRef,
|
|
8303
8342
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
8304
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
8343
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
|
|
8305
8344
|
varName: rowHeightCSSVar,
|
|
8306
8345
|
onChange: onRowHeightCSSVarChange
|
|
8307
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
8346
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
|
|
8308
8347
|
varName: headerHeightCSSVar,
|
|
8309
8348
|
onChange: onHeaderHeightCSSVarChange
|
|
8310
8349
|
}) : null);
|
|
@@ -8340,25 +8379,25 @@ function InfiniteTableContextProvider() {
|
|
|
8340
8379
|
}
|
|
8341
8380
|
componentActions.bodySize = bodySize;
|
|
8342
8381
|
}, { earlyAttach: true });
|
|
8343
|
-
|
|
8382
|
+
React34.useEffect(() => {
|
|
8344
8383
|
return () => {
|
|
8345
8384
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
8346
8385
|
componentState.onHeaderHeightCSSVarChange.destroy();
|
|
8347
8386
|
};
|
|
8348
8387
|
}, []);
|
|
8349
|
-
|
|
8388
|
+
React34.useEffect(() => {
|
|
8350
8389
|
if (scrollerDOMRef.current) {
|
|
8351
8390
|
scrollerDOMRef.current.scrollTop = 0;
|
|
8352
8391
|
}
|
|
8353
8392
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
8354
8393
|
const TableContext2 = getInfiniteTableContext();
|
|
8355
|
-
return /* @__PURE__ */
|
|
8394
|
+
return /* @__PURE__ */ React34.createElement(TableContext2.Provider, {
|
|
8356
8395
|
value: contextValue
|
|
8357
|
-
}, /* @__PURE__ */
|
|
8396
|
+
}, /* @__PURE__ */ React34.createElement(InfiniteTableComponent, null));
|
|
8358
8397
|
}
|
|
8359
8398
|
function InfiniteTable(props) {
|
|
8360
|
-
const table = /* @__PURE__ */
|
|
8361
|
-
return /* @__PURE__ */
|
|
8399
|
+
const table = /* @__PURE__ */ React34.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React34.createElement(InfiniteTableContextProvider, null));
|
|
8400
|
+
return /* @__PURE__ */ React34.createElement(React34.StrictMode, null, table);
|
|
8362
8401
|
}
|
|
8363
8402
|
InfiniteTable.defaultProps = {
|
|
8364
8403
|
rowHeight: 40,
|