@infinite-table/infinite-react 0.2.15 → 0.2.18
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 +7 -2
- package/index.esm.js +310 -269
- package/index.js +378 -334
- 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,
|
|
@@ -1894,7 +1895,8 @@ var getComputedVisibleColumns = ({
|
|
|
1894
1895
|
valueGetter: colType.valueGetter,
|
|
1895
1896
|
renderValue: colType.renderValue,
|
|
1896
1897
|
render: colType.render,
|
|
1897
|
-
style: colType.style
|
|
1898
|
+
style: colType.style,
|
|
1899
|
+
components: colType.components
|
|
1898
1900
|
}, c), {
|
|
1899
1901
|
cssEllipsis,
|
|
1900
1902
|
headerCssEllipsis,
|
|
@@ -2154,7 +2156,7 @@ var useComputedVisibleColumns = ({
|
|
|
2154
2156
|
var sortAscending = (a, b) => a - b;
|
|
2155
2157
|
|
|
2156
2158
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
2157
|
-
var
|
|
2159
|
+
var import_react19 = __toModule(require("react"));
|
|
2158
2160
|
|
|
2159
2161
|
// src/components/hooks/useComponentState/index.tsx
|
|
2160
2162
|
var React2 = __toModule(require("react"));
|
|
@@ -2538,10 +2540,10 @@ function useColumnGroups() {
|
|
|
2538
2540
|
}
|
|
2539
2541
|
|
|
2540
2542
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2541
|
-
var
|
|
2543
|
+
var import_react18 = __toModule(require("react"));
|
|
2542
2544
|
|
|
2543
2545
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2544
|
-
var
|
|
2546
|
+
var React6 = __toModule(require("react"));
|
|
2545
2547
|
|
|
2546
2548
|
// src/utils/join.ts
|
|
2547
2549
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -2613,9 +2615,8 @@ var willChange = { transform: "_16lm1iw19" };
|
|
|
2613
2615
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2614
2616
|
|
|
2615
2617
|
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
2616
|
-
var React6 = __toModule(require("react"));
|
|
2617
2618
|
function RenderHookComponent(props) {
|
|
2618
|
-
return
|
|
2619
|
+
return props.render(props.renderParam);
|
|
2619
2620
|
}
|
|
2620
2621
|
|
|
2621
2622
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
@@ -2628,7 +2629,7 @@ function getGroupColumnRender({
|
|
|
2628
2629
|
var _a, _b, _c;
|
|
2629
2630
|
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2630
2631
|
if (column.renderValue) {
|
|
2631
|
-
value = /* @__PURE__ */
|
|
2632
|
+
value = /* @__PURE__ */ React6.createElement(RenderHookComponent, {
|
|
2632
2633
|
render: column.renderValue,
|
|
2633
2634
|
renderParam: renderOptions
|
|
2634
2635
|
});
|
|
@@ -2657,20 +2658,20 @@ function getGroupColumnRender({
|
|
|
2657
2658
|
let icon = null;
|
|
2658
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);
|
|
2659
2660
|
if (showExpanderIcon) {
|
|
2660
|
-
const defaultIcon = /* @__PURE__ */
|
|
2661
|
+
const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2661
2662
|
expanded: !collapsed,
|
|
2662
2663
|
onChange: () => {
|
|
2663
2664
|
toggleGroupRow(groupKeys);
|
|
2664
2665
|
}
|
|
2665
2666
|
});
|
|
2666
|
-
icon = column.renderGroupIcon ? /* @__PURE__ */
|
|
2667
|
+
icon = column.renderGroupIcon ? /* @__PURE__ */ React6.createElement(RenderHookComponent, {
|
|
2667
2668
|
render: column.renderGroupIcon,
|
|
2668
2669
|
renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
|
|
2669
2670
|
}) : defaultIcon;
|
|
2670
2671
|
}
|
|
2671
|
-
return /* @__PURE__ */
|
|
2672
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2672
2673
|
className: join(display.flex, alignItems.center)
|
|
2673
|
-
}, icon, /* @__PURE__ */
|
|
2674
|
+
}, icon, /* @__PURE__ */ React6.createElement("div", {
|
|
2674
2675
|
className: cssEllipsisClassName
|
|
2675
2676
|
}, value != null ? value : null));
|
|
2676
2677
|
};
|
|
@@ -2718,7 +2719,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2718
2719
|
let icon = null;
|
|
2719
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);
|
|
2720
2721
|
if (showExpanderIcon) {
|
|
2721
|
-
const defaultIcon = /* @__PURE__ */
|
|
2722
|
+
const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2722
2723
|
expanded: !collapsed,
|
|
2723
2724
|
onChange: () => {
|
|
2724
2725
|
toggleGroupRow(rowInfo.groupKeys);
|
|
@@ -2726,9 +2727,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2726
2727
|
});
|
|
2727
2728
|
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2728
2729
|
}
|
|
2729
|
-
return /* @__PURE__ */
|
|
2730
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2730
2731
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2731
|
-
}, icon, /* @__PURE__ */
|
|
2732
|
+
}, icon, /* @__PURE__ */ React6.createElement("div", {
|
|
2732
2733
|
className: cssEllipsisClassName
|
|
2733
2734
|
}, value != null ? value : null));
|
|
2734
2735
|
}
|
|
@@ -2743,11 +2744,32 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2743
2744
|
return generatedGroupColumn;
|
|
2744
2745
|
}
|
|
2745
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
|
+
|
|
2746
2768
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
2747
|
-
var
|
|
2769
|
+
var import_react17 = __toModule(require("react"));
|
|
2748
2770
|
|
|
2749
2771
|
// src/components/DataSource/index.tsx
|
|
2750
|
-
var
|
|
2772
|
+
var React7 = __toModule(require("react"));
|
|
2751
2773
|
|
|
2752
2774
|
// src/utils/multisort/sortTypes.ts
|
|
2753
2775
|
var numberComparator = function(first, second) {
|
|
@@ -2824,7 +2846,7 @@ var getMultisortFunction = (sortInfo, get) => {
|
|
|
2824
2846
|
};
|
|
2825
2847
|
|
|
2826
2848
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
2827
|
-
var
|
|
2849
|
+
var import_react16 = __toModule(require("react"));
|
|
2828
2850
|
|
|
2829
2851
|
// src/utils/DeepMap/once.ts
|
|
2830
2852
|
function once(fn) {
|
|
@@ -2910,14 +2932,13 @@ var DeepMap = class {
|
|
|
2910
2932
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2911
2933
|
const key = keys[i];
|
|
2912
2934
|
const last = i === len - 1;
|
|
2935
|
+
const pair = currentMap.get(key) || {};
|
|
2913
2936
|
if (last) {
|
|
2914
|
-
const pair = currentMap.has(key) ? currentMap.get(key) : {};
|
|
2915
2937
|
pair.revision = this.revision++;
|
|
2916
2938
|
pair.value = value;
|
|
2917
2939
|
currentMap.set(key, pair);
|
|
2918
2940
|
this.length++;
|
|
2919
2941
|
} else {
|
|
2920
|
-
const pair = currentMap.has(key) ? currentMap.get(key) : {};
|
|
2921
2942
|
if (!pair.map) {
|
|
2922
2943
|
pair.map = new Map();
|
|
2923
2944
|
currentMap.set(key, pair);
|
|
@@ -2928,7 +2949,6 @@ var DeepMap = class {
|
|
|
2928
2949
|
return this;
|
|
2929
2950
|
}
|
|
2930
2951
|
get(keys) {
|
|
2931
|
-
var _a;
|
|
2932
2952
|
let currentMap = this.map;
|
|
2933
2953
|
if (!keys.length) {
|
|
2934
2954
|
keys = [this.emptyKey];
|
|
@@ -2936,10 +2956,10 @@ var DeepMap = class {
|
|
|
2936
2956
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2937
2957
|
const key = keys[i];
|
|
2938
2958
|
const last = i === len - 1;
|
|
2959
|
+
const pair = currentMap.get(key);
|
|
2939
2960
|
if (last) {
|
|
2940
|
-
return
|
|
2961
|
+
return pair ? pair.value : void 0;
|
|
2941
2962
|
} else {
|
|
2942
|
-
const pair = currentMap.get(key);
|
|
2943
2963
|
if (!pair || !pair.map) {
|
|
2944
2964
|
return;
|
|
2945
2965
|
}
|
|
@@ -2977,8 +2997,8 @@ var DeepMap = class {
|
|
|
2977
2997
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2978
2998
|
const key = keys[i];
|
|
2979
2999
|
const last = i === len - 1;
|
|
3000
|
+
const pair = currentMap.get(key);
|
|
2980
3001
|
if (last) {
|
|
2981
|
-
const pair = currentMap.get(key);
|
|
2982
3002
|
if (pair) {
|
|
2983
3003
|
if (pair.hasOwnProperty("value")) {
|
|
2984
3004
|
delete pair.value;
|
|
@@ -2995,7 +3015,6 @@ var DeepMap = class {
|
|
|
2995
3015
|
}
|
|
2996
3016
|
break;
|
|
2997
3017
|
} else {
|
|
2998
|
-
const pair = currentMap.get(key);
|
|
2999
3018
|
if (!pair || !pair.map) {
|
|
3000
3019
|
result = false;
|
|
3001
3020
|
break;
|
|
@@ -3005,11 +3024,11 @@ var DeepMap = class {
|
|
|
3005
3024
|
}
|
|
3006
3025
|
}
|
|
3007
3026
|
while (maps.length) {
|
|
3008
|
-
|
|
3009
|
-
|
|
3027
|
+
const map2 = maps.pop();
|
|
3028
|
+
const key = keys.pop();
|
|
3010
3029
|
if (key && (map2 == null ? void 0 : map2.size) === 0) {
|
|
3011
|
-
|
|
3012
|
-
|
|
3030
|
+
const parentMap = maps[maps.length - 1];
|
|
3031
|
+
const pair = parentMap == null ? void 0 : parentMap.get(key);
|
|
3013
3032
|
if (pair) {
|
|
3014
3033
|
delete pair.map;
|
|
3015
3034
|
if (!pair.hasOwnProperty("value")) {
|
|
@@ -3028,11 +3047,10 @@ var DeepMap = class {
|
|
|
3028
3047
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
3029
3048
|
const key = keys[i];
|
|
3030
3049
|
const last = i === len - 1;
|
|
3050
|
+
const pair = currentMap.get(key);
|
|
3031
3051
|
if (last) {
|
|
3032
|
-
|
|
3033
|
-
return !!pair && pair.hasOwnProperty("value");
|
|
3052
|
+
return pair ? pair.hasOwnProperty("value") : false;
|
|
3034
3053
|
} else {
|
|
3035
|
-
const pair = currentMap.get(key);
|
|
3036
3054
|
if (!pair || !pair.map) {
|
|
3037
3055
|
return false;
|
|
3038
3056
|
}
|
|
@@ -3500,12 +3518,12 @@ function enhancedFlatten(param) {
|
|
|
3500
3518
|
}
|
|
3501
3519
|
|
|
3502
3520
|
// src/components/hooks/useEffectWithChanges.ts
|
|
3503
|
-
var
|
|
3521
|
+
var import_react15 = __toModule(require("react"));
|
|
3504
3522
|
function useEffectWithChanges(fn, deps) {
|
|
3505
|
-
const prevRef = (0,
|
|
3506
|
-
const oldValuesRef = (0,
|
|
3523
|
+
const prevRef = (0, import_react15.useRef)({});
|
|
3524
|
+
const oldValuesRef = (0, import_react15.useRef)({});
|
|
3507
3525
|
const oldValues = oldValuesRef.current;
|
|
3508
|
-
const changesRef = (0,
|
|
3526
|
+
const changesRef = (0, import_react15.useRef)({});
|
|
3509
3527
|
const changes = changesRef.current;
|
|
3510
3528
|
const useEffectDeps = [];
|
|
3511
3529
|
for (let k in deps) {
|
|
@@ -3518,7 +3536,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
3518
3536
|
}
|
|
3519
3537
|
}
|
|
3520
3538
|
prevRef.current = deps;
|
|
3521
|
-
(0,
|
|
3539
|
+
(0, import_react15.useEffect)(() => {
|
|
3522
3540
|
const changes2 = changesRef.current;
|
|
3523
3541
|
const result = fn(changes2, oldValues);
|
|
3524
3542
|
changesRef.current = {};
|
|
@@ -3686,12 +3704,12 @@ function useLoadData() {
|
|
|
3686
3704
|
livePaginationCursor,
|
|
3687
3705
|
cursorId: stateCursorId
|
|
3688
3706
|
} = componentState;
|
|
3689
|
-
const [scrollbars, setScrollbars] = (0,
|
|
3707
|
+
const [scrollbars, setScrollbars] = (0, import_react16.useState)({
|
|
3690
3708
|
vertical: false,
|
|
3691
3709
|
horizontal: false
|
|
3692
3710
|
});
|
|
3693
|
-
const scrollbarsRef = (0,
|
|
3694
|
-
(0,
|
|
3711
|
+
const scrollbarsRef = (0, import_react16.useRef)(scrollbars);
|
|
3712
|
+
(0, import_react16.useEffect)(() => {
|
|
3695
3713
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
3696
3714
|
if (!scrollbars2) {
|
|
3697
3715
|
return;
|
|
@@ -3701,7 +3719,7 @@ function useLoadData() {
|
|
|
3701
3719
|
});
|
|
3702
3720
|
return () => notifyScrollbarsChange.destroy();
|
|
3703
3721
|
}, [notifyScrollbarsChange]);
|
|
3704
|
-
(0,
|
|
3722
|
+
(0, import_react16.useEffect)(() => {
|
|
3705
3723
|
const frameId = requestAnimationFrame(() => {
|
|
3706
3724
|
var _a;
|
|
3707
3725
|
if (!((_a = scrollbarsRef.current) == null ? void 0 : _a.vertical) && livePaginationCursor) {
|
|
@@ -3710,7 +3728,7 @@ function useLoadData() {
|
|
|
3710
3728
|
});
|
|
3711
3729
|
return () => cancelAnimationFrame(frameId);
|
|
3712
3730
|
}, [livePaginationCursor]);
|
|
3713
|
-
(0,
|
|
3731
|
+
(0, import_react16.useEffect)(() => {
|
|
3714
3732
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2 } = getComponentState();
|
|
3715
3733
|
if (!scrollbars.vertical && livePagination2) {
|
|
3716
3734
|
if (livePaginationCursor2) {
|
|
@@ -3724,7 +3742,7 @@ function useLoadData() {
|
|
|
3724
3742
|
pivotBy,
|
|
3725
3743
|
cursorId: livePagination ? stateCursorId : null
|
|
3726
3744
|
};
|
|
3727
|
-
const initialRef = (0,
|
|
3745
|
+
const initialRef = (0, import_react16.useRef)(true);
|
|
3728
3746
|
useLazyLoadRange();
|
|
3729
3747
|
useEffectWithChanges(() => {
|
|
3730
3748
|
const componentState2 = getComponentState();
|
|
@@ -3753,7 +3771,7 @@ function useLazyLoadRange() {
|
|
|
3753
3771
|
componentActions: actions,
|
|
3754
3772
|
componentState
|
|
3755
3773
|
} = useComponentState();
|
|
3756
|
-
const loadingCache = (0,
|
|
3774
|
+
const loadingCache = (0, import_react16.useMemo)(() => {
|
|
3757
3775
|
return new Map();
|
|
3758
3776
|
}, [componentState.data]);
|
|
3759
3777
|
const {
|
|
@@ -3762,7 +3780,7 @@ function useLazyLoadRange() {
|
|
|
3762
3780
|
dataArray,
|
|
3763
3781
|
scrollStopDelayUpdatedByTable
|
|
3764
3782
|
} = componentState;
|
|
3765
|
-
const latestRenderRangeRef = (0,
|
|
3783
|
+
const latestRenderRangeRef = (0, import_react16.useRef)(null);
|
|
3766
3784
|
const loadRange = (renderRange, cache = loadingCache) => {
|
|
3767
3785
|
const componentState2 = getComponentState();
|
|
3768
3786
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -3781,8 +3799,8 @@ function useLazyLoadRange() {
|
|
|
3781
3799
|
componentActions: actions
|
|
3782
3800
|
}, cache);
|
|
3783
3801
|
};
|
|
3784
|
-
const debouncedLoadRange = (0,
|
|
3785
|
-
(0,
|
|
3802
|
+
const debouncedLoadRange = (0, import_react16.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
3803
|
+
(0, import_react16.useEffect)(() => {
|
|
3786
3804
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3787
3805
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
3788
3806
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -3791,7 +3809,7 @@ function useLazyLoadRange() {
|
|
|
3791
3809
|
}
|
|
3792
3810
|
return;
|
|
3793
3811
|
}, [lazyLoadBatchSize, loadingCache]);
|
|
3794
|
-
(0,
|
|
3812
|
+
(0, import_react16.useEffect)(() => {
|
|
3795
3813
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3796
3814
|
debouncedLoadRange();
|
|
3797
3815
|
}
|
|
@@ -4067,6 +4085,7 @@ function initSetupState2() {
|
|
|
4067
4085
|
notifyScrollStop: buildSubscriptionCallback(),
|
|
4068
4086
|
notifyRenderRangeChange: buildSubscriptionCallback(),
|
|
4069
4087
|
pivotTotalColumnPosition: "end",
|
|
4088
|
+
pivotGrandTotalColumnPosition: false,
|
|
4070
4089
|
scrollStopDelayUpdatedByTable: 100,
|
|
4071
4090
|
originalLazyGroupData,
|
|
4072
4091
|
originalLazyGroupDataChangeDetect: 0,
|
|
@@ -4254,6 +4273,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4254
4273
|
deepMap,
|
|
4255
4274
|
pivotBy,
|
|
4256
4275
|
pivotTotalColumnPosition,
|
|
4276
|
+
pivotGrandTotalColumnPosition,
|
|
4257
4277
|
reducers = {},
|
|
4258
4278
|
showSeparatePivotColumnForSingleAggregation = false
|
|
4259
4279
|
}) {
|
|
@@ -4263,6 +4283,28 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4263
4283
|
});
|
|
4264
4284
|
const columns = new Map([]);
|
|
4265
4285
|
const columnGroups = new Map();
|
|
4286
|
+
const addGrandTotalColumns = once(function() {
|
|
4287
|
+
aggregationReducers.forEach((reducer, index) => {
|
|
4288
|
+
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4289
|
+
header: `${reducer.name || reducer.id} total`,
|
|
4290
|
+
pivotBy,
|
|
4291
|
+
pivotColumn: true,
|
|
4292
|
+
pivotTotalColumn: true,
|
|
4293
|
+
pivotAggregator: reducer,
|
|
4294
|
+
pivotAggregatorIndex: index,
|
|
4295
|
+
pivotGroupKeys: [],
|
|
4296
|
+
pivotGroupKey: "",
|
|
4297
|
+
pivotIndex: -1,
|
|
4298
|
+
valueGetter: ({ rowInfo }) => {
|
|
4299
|
+
var _a;
|
|
4300
|
+
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
|
|
4301
|
+
}
|
|
4302
|
+
}));
|
|
4303
|
+
});
|
|
4304
|
+
});
|
|
4305
|
+
if (!pivotLength && pivotTotalColumnPosition === "start" || pivotGrandTotalColumnPosition === "start") {
|
|
4306
|
+
addGrandTotalColumns();
|
|
4307
|
+
}
|
|
4266
4308
|
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
4267
4309
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
4268
4310
|
keys = [...keys];
|
|
@@ -4367,24 +4409,8 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4367
4409
|
next == null ? void 0 : next();
|
|
4368
4410
|
}
|
|
4369
4411
|
});
|
|
4370
|
-
if (!pivotLength) {
|
|
4371
|
-
|
|
4372
|
-
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4373
|
-
header: `${reducer.name || reducer.id} total`,
|
|
4374
|
-
pivotBy,
|
|
4375
|
-
pivotColumn: true,
|
|
4376
|
-
pivotTotalColumn: true,
|
|
4377
|
-
pivotAggregator: reducer,
|
|
4378
|
-
pivotAggregatorIndex: index,
|
|
4379
|
-
pivotGroupKeys: [],
|
|
4380
|
-
pivotGroupKey: "",
|
|
4381
|
-
pivotIndex: -1,
|
|
4382
|
-
valueGetter: ({ rowInfo }) => {
|
|
4383
|
-
var _a;
|
|
4384
|
-
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
|
|
4385
|
-
}
|
|
4386
|
-
}));
|
|
4387
|
-
});
|
|
4412
|
+
if (!pivotLength && pivotTotalColumnPosition === "end" || pivotGrandTotalColumnPosition === "end") {
|
|
4413
|
+
addGrandTotalColumns();
|
|
4388
4414
|
}
|
|
4389
4415
|
const result = {
|
|
4390
4416
|
columns,
|
|
@@ -4416,7 +4442,7 @@ function toRowInfo(data, id, index) {
|
|
|
4416
4442
|
};
|
|
4417
4443
|
}
|
|
4418
4444
|
function concludeReducer(params) {
|
|
4419
|
-
var _a;
|
|
4445
|
+
var _a, _b;
|
|
4420
4446
|
const { state, previousState } = params;
|
|
4421
4447
|
const sortInfo = state.sortInfo;
|
|
4422
4448
|
let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
|
|
@@ -4451,6 +4477,7 @@ function concludeReducer(params) {
|
|
|
4451
4477
|
"pivotBy",
|
|
4452
4478
|
"aggregationReducers",
|
|
4453
4479
|
"pivotTotalColumnPosition",
|
|
4480
|
+
"pivotGrandTotalColumnPosition",
|
|
4454
4481
|
"showSeparatePivotColumnForSingleAggregation",
|
|
4455
4482
|
"sortInfo"
|
|
4456
4483
|
]);
|
|
@@ -4497,6 +4524,7 @@ function concludeReducer(params) {
|
|
|
4497
4524
|
deepMap: groupResult.topLevelPivotColumns,
|
|
4498
4525
|
pivotBy,
|
|
4499
4526
|
pivotTotalColumnPosition: (_a = state.pivotTotalColumnPosition) != null ? _a : "end",
|
|
4527
|
+
pivotGrandTotalColumnPosition: (_b = state.pivotGrandTotalColumnPosition) != null ? _b : false,
|
|
4500
4528
|
reducers: state.aggregationReducers,
|
|
4501
4529
|
showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
|
|
4502
4530
|
}) : void 0;
|
|
@@ -4540,7 +4568,7 @@ function DataSourceWithContext(props) {
|
|
|
4540
4568
|
if (typeof children === "function") {
|
|
4541
4569
|
children = children(computedValues);
|
|
4542
4570
|
}
|
|
4543
|
-
return /* @__PURE__ */
|
|
4571
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children);
|
|
4544
4572
|
}
|
|
4545
4573
|
var DataSourceRoot = getComponentStateRoot({
|
|
4546
4574
|
initSetupState: initSetupState2,
|
|
@@ -4563,14 +4591,14 @@ function DataSourceCmp({ children }) {
|
|
|
4563
4591
|
globalThis.getDataSourceState = getState;
|
|
4564
4592
|
}
|
|
4565
4593
|
useLoadData();
|
|
4566
|
-
return /* @__PURE__ */
|
|
4594
|
+
return /* @__PURE__ */ React7.createElement(DataSourceContext.Provider, {
|
|
4567
4595
|
value: contextValue
|
|
4568
|
-
}, /* @__PURE__ */
|
|
4596
|
+
}, /* @__PURE__ */ React7.createElement(DataSourceWithContext, {
|
|
4569
4597
|
children
|
|
4570
4598
|
}));
|
|
4571
4599
|
}
|
|
4572
4600
|
function DataSource(props) {
|
|
4573
|
-
return /* @__PURE__ */
|
|
4601
|
+
return /* @__PURE__ */ React7.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React7.createElement(DataSourceCmp, {
|
|
4574
4602
|
children: props.children
|
|
4575
4603
|
}));
|
|
4576
4604
|
}
|
|
@@ -4578,7 +4606,7 @@ function DataSource(props) {
|
|
|
4578
4606
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
4579
4607
|
function useToggleGroupRow() {
|
|
4580
4608
|
const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
4581
|
-
const toggleGroupRow = (0,
|
|
4609
|
+
const toggleGroupRow = (0, import_react17.useCallback)((groupKeys) => {
|
|
4582
4610
|
const state = getDataSourceState();
|
|
4583
4611
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
4584
4612
|
newState.toggleGroupRow(groupKeys);
|
|
@@ -4594,7 +4622,7 @@ function useToggleGroupRow() {
|
|
|
4594
4622
|
|
|
4595
4623
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
4596
4624
|
function useGroupByMap(groupBy) {
|
|
4597
|
-
const groupByMap = (0,
|
|
4625
|
+
const groupByMap = (0, import_react18.useMemo)(() => {
|
|
4598
4626
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
4599
4627
|
acc.set(groupBy2.field, {
|
|
4600
4628
|
groupBy: groupBy2,
|
|
@@ -4611,15 +4639,24 @@ function useColumnsWhen() {
|
|
|
4611
4639
|
componentActions: dataSourceActions
|
|
4612
4640
|
} = useDataSourceContextValue();
|
|
4613
4641
|
const {
|
|
4614
|
-
componentState: {
|
|
4642
|
+
componentState: {
|
|
4643
|
+
groupRenderStrategy,
|
|
4644
|
+
pivotTotalColumnPosition,
|
|
4645
|
+
pivotGrandTotalColumnPosition
|
|
4646
|
+
}
|
|
4615
4647
|
} = useComponentState();
|
|
4616
4648
|
const groupByMap = useGroupByMap(groupBy);
|
|
4617
|
-
(0,
|
|
4649
|
+
(0, import_react18.useEffect)(() => {
|
|
4618
4650
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
4619
4651
|
}, [groupRenderStrategy]);
|
|
4620
|
-
(0,
|
|
4652
|
+
(0, import_react18.useEffect)(() => {
|
|
4621
4653
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
4622
4654
|
}, [pivotTotalColumnPosition]);
|
|
4655
|
+
(0, import_react18.useEffect)(() => {
|
|
4656
|
+
if (pivotGrandTotalColumnPosition != void 0) {
|
|
4657
|
+
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
4658
|
+
}
|
|
4659
|
+
}, [pivotGrandTotalColumnPosition]);
|
|
4623
4660
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4624
4661
|
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4625
4662
|
useHideColumns(groupByMap);
|
|
@@ -4683,7 +4720,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4683
4720
|
});
|
|
4684
4721
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
4685
4722
|
}
|
|
4686
|
-
(0,
|
|
4723
|
+
(0, import_react18.useEffect)(() => {
|
|
4687
4724
|
const update = () => {
|
|
4688
4725
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
4689
4726
|
};
|
|
@@ -4707,17 +4744,19 @@ function useColumnsWhenGrouping() {
|
|
|
4707
4744
|
groupRenderStrategy,
|
|
4708
4745
|
pivotColumns,
|
|
4709
4746
|
pivotColumn,
|
|
4710
|
-
pivotTotalColumnPosition
|
|
4747
|
+
pivotTotalColumnPosition,
|
|
4748
|
+
pivotGrandTotalColumnPosition
|
|
4711
4749
|
}
|
|
4712
4750
|
} = useComponentState();
|
|
4713
4751
|
const toggleGroupRow = useToggleGroupRow();
|
|
4714
|
-
(0,
|
|
4752
|
+
(0, import_react18.useEffect)(() => {
|
|
4715
4753
|
const update = () => {
|
|
4716
4754
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
4717
4755
|
columns,
|
|
4718
4756
|
groupColumn,
|
|
4719
4757
|
pivotColumn,
|
|
4720
4758
|
pivotTotalColumnPosition,
|
|
4759
|
+
pivotGrandTotalColumnPosition,
|
|
4721
4760
|
groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
|
|
4722
4761
|
groupBy,
|
|
4723
4762
|
pivotBy,
|
|
@@ -4765,7 +4804,7 @@ function useHideColumns(groupByMap) {
|
|
|
4765
4804
|
}
|
|
4766
4805
|
} = useComponentState();
|
|
4767
4806
|
const prevHideEmptyGroupColumns = usePrevious(hideEmptyGroupColumns);
|
|
4768
|
-
(
|
|
4807
|
+
useEffectWithRaf(() => {
|
|
4769
4808
|
if (groupRenderStrategy !== "multi-column") {
|
|
4770
4809
|
return;
|
|
4771
4810
|
}
|
|
@@ -4843,7 +4882,7 @@ function useHideColumns(groupByMap) {
|
|
|
4843
4882
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4844
4883
|
hideEmptyGroupColumns
|
|
4845
4884
|
]);
|
|
4846
|
-
(0,
|
|
4885
|
+
(0, import_react18.useEffect)(() => {
|
|
4847
4886
|
const isGrouped = groupBy.length > 0;
|
|
4848
4887
|
const currentState = getComponentState();
|
|
4849
4888
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -4878,6 +4917,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4878
4917
|
pivotBy,
|
|
4879
4918
|
groupColumn,
|
|
4880
4919
|
pivotTotalColumnPosition,
|
|
4920
|
+
pivotGrandTotalColumnPosition,
|
|
4881
4921
|
pivotColumn,
|
|
4882
4922
|
groupRenderStrategy,
|
|
4883
4923
|
toggleGroupRow,
|
|
@@ -4917,7 +4957,12 @@ function getColumnsWhenGrouping(params) {
|
|
|
4917
4957
|
});
|
|
4918
4958
|
pivotColumns.forEach((col, key) => {
|
|
4919
4959
|
var _a, _b;
|
|
4920
|
-
|
|
4960
|
+
const isSimpleTotalColumn = col.pivotTotalColumn && col.columnGroup;
|
|
4961
|
+
const isGrandTotalColumn = col.pivotTotalColumn && !col.columnGroup;
|
|
4962
|
+
if (isSimpleTotalColumn && pivotTotalColumnPosition === false) {
|
|
4963
|
+
return;
|
|
4964
|
+
}
|
|
4965
|
+
if (isGrandTotalColumn && pivotGrandTotalColumnPosition === false) {
|
|
4921
4966
|
return;
|
|
4922
4967
|
}
|
|
4923
4968
|
let column = __spreadValues({}, col);
|
|
@@ -4969,7 +5014,7 @@ function useComputed() {
|
|
|
4969
5014
|
bodySize,
|
|
4970
5015
|
showSeparatePivotColumnForSingleAggregation
|
|
4971
5016
|
} = componentState;
|
|
4972
|
-
(0,
|
|
5017
|
+
(0, import_react19.useState)(() => {
|
|
4973
5018
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
4974
5019
|
if (rowHeight) {
|
|
4975
5020
|
componentActions.rowHeight = rowHeight;
|
|
@@ -4981,13 +5026,13 @@ function useComputed() {
|
|
|
4981
5026
|
}
|
|
4982
5027
|
});
|
|
4983
5028
|
});
|
|
4984
|
-
(0,
|
|
5029
|
+
(0, import_react19.useEffect)(() => {
|
|
4985
5030
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
4986
5031
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
4987
5032
|
const { multiSort } = dataSourceState;
|
|
4988
5033
|
useColumnGroups();
|
|
4989
5034
|
const { toggleGroupRow } = useColumnsWhen();
|
|
4990
|
-
const setSortInfo = (0,
|
|
5035
|
+
const setSortInfo = (0, import_react19.useCallback)((sortInfo) => {
|
|
4991
5036
|
var _a2;
|
|
4992
5037
|
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
4993
5038
|
dataSourceActions.sortInfo = newSortInfo;
|
|
@@ -5031,7 +5076,7 @@ function useComputed() {
|
|
|
5031
5076
|
columnSizing,
|
|
5032
5077
|
columnTypes
|
|
5033
5078
|
});
|
|
5034
|
-
const rowSpan = (0,
|
|
5079
|
+
const rowSpan = (0, import_react19.useMemo)(() => {
|
|
5035
5080
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
5036
5081
|
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
5037
5082
|
let maxSpan = 1;
|
|
@@ -5107,7 +5152,7 @@ function useComputed() {
|
|
|
5107
5152
|
}
|
|
5108
5153
|
|
|
5109
5154
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5110
|
-
var
|
|
5155
|
+
var React8 = __toModule(require("react"));
|
|
5111
5156
|
|
|
5112
5157
|
// src/components/InfiniteTable/hooks/useInternalProps.ts
|
|
5113
5158
|
var useInternalProps = () => {
|
|
@@ -5115,9 +5160,9 @@ var useInternalProps = () => {
|
|
|
5115
5160
|
};
|
|
5116
5161
|
|
|
5117
5162
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5118
|
-
var InfiniteTableBody =
|
|
5163
|
+
var InfiniteTableBody = React8.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
5119
5164
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
5120
|
-
return /* @__PURE__ */
|
|
5165
|
+
return /* @__PURE__ */ React8.createElement("div", __spreadProps(__spreadValues({
|
|
5121
5166
|
ref
|
|
5122
5167
|
}, props), {
|
|
5123
5168
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -5125,16 +5170,16 @@ var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref
|
|
|
5125
5170
|
});
|
|
5126
5171
|
|
|
5127
5172
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
5128
|
-
var
|
|
5173
|
+
var React20 = __toModule(require("react"));
|
|
5129
5174
|
|
|
5130
5175
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
5131
|
-
var
|
|
5176
|
+
var React9 = __toModule(require("react"));
|
|
5132
5177
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
5133
5178
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
5134
5179
|
if (!scrollbarWidth2) {
|
|
5135
5180
|
return null;
|
|
5136
5181
|
}
|
|
5137
|
-
return /* @__PURE__ */
|
|
5182
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
5138
5183
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
5139
5184
|
style: __spreadValues({
|
|
5140
5185
|
position: "absolute",
|
|
@@ -5144,13 +5189,13 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
5144
5189
|
}, props.style)
|
|
5145
5190
|
});
|
|
5146
5191
|
}
|
|
5147
|
-
var HorizontalScrollbarPlaceholder =
|
|
5192
|
+
var HorizontalScrollbarPlaceholder = React9.memo(HorizontalScrollbarPlaceholderFn);
|
|
5148
5193
|
function VerticalScrollbarPlaceholderFn(props) {
|
|
5149
5194
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
5150
5195
|
if (!scrollbarWidth2) {
|
|
5151
5196
|
return null;
|
|
5152
5197
|
}
|
|
5153
|
-
return /* @__PURE__ */
|
|
5198
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
5154
5199
|
"data-name": "vertical-scrollbar-placeholder",
|
|
5155
5200
|
style: __spreadValues({
|
|
5156
5201
|
position: "absolute",
|
|
@@ -5160,7 +5205,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
5160
5205
|
}, props.style)
|
|
5161
5206
|
});
|
|
5162
5207
|
}
|
|
5163
|
-
var VerticalScrollbarPlaceholder =
|
|
5208
|
+
var VerticalScrollbarPlaceholder = React9.memo(VerticalScrollbarPlaceholderFn);
|
|
5164
5209
|
|
|
5165
5210
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5166
5211
|
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -5175,21 +5220,21 @@ var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
|
5175
5220
|
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
5176
5221
|
|
|
5177
5222
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5178
|
-
var
|
|
5179
|
-
var
|
|
5223
|
+
var React16 = __toModule(require("react"));
|
|
5224
|
+
var import_react27 = __toModule(require("react"));
|
|
5180
5225
|
|
|
5181
5226
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5182
|
-
var
|
|
5183
|
-
var
|
|
5227
|
+
var React12 = __toModule(require("react"));
|
|
5228
|
+
var import_react23 = __toModule(require("react"));
|
|
5184
5229
|
|
|
5185
5230
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5186
|
-
var
|
|
5231
|
+
var React10 = __toModule(require("react"));
|
|
5187
5232
|
|
|
5188
5233
|
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
5189
|
-
var
|
|
5234
|
+
var import_react20 = __toModule(require("react"));
|
|
5190
5235
|
var useInfiniteTableState = () => {
|
|
5191
5236
|
const TableContext2 = getInfiniteTableContext();
|
|
5192
|
-
const { componentState } = (0,
|
|
5237
|
+
const { componentState } = (0, import_react20.useContext)(TableContext2);
|
|
5193
5238
|
return componentState;
|
|
5194
5239
|
};
|
|
5195
5240
|
|
|
@@ -5252,23 +5297,23 @@ function InfiniteTableCellFn(props) {
|
|
|
5252
5297
|
style,
|
|
5253
5298
|
"data-name": "Cell",
|
|
5254
5299
|
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}` : ""),
|
|
5255
|
-
children: /* @__PURE__ */
|
|
5300
|
+
children: /* @__PURE__ */ React10.createElement(React10.Fragment, null, beforeChildren, /* @__PURE__ */ React10.createElement("div", {
|
|
5256
5301
|
className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
|
|
5257
5302
|
}, children), afterChildren)
|
|
5258
5303
|
});
|
|
5259
5304
|
const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
|
|
5260
5305
|
if (RenderComponent) {
|
|
5261
|
-
return /* @__PURE__ */
|
|
5306
|
+
return /* @__PURE__ */ React10.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5262
5307
|
}
|
|
5263
|
-
return /* @__PURE__ */
|
|
5308
|
+
return /* @__PURE__ */ React10.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5264
5309
|
ref: domRef
|
|
5265
5310
|
}));
|
|
5266
5311
|
}
|
|
5267
|
-
var InfiniteTableCell =
|
|
5312
|
+
var InfiniteTableCell = React10.memo(InfiniteTableCellFn);
|
|
5268
5313
|
|
|
5269
5314
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
5270
5315
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
5271
|
-
var
|
|
5316
|
+
var import_react21 = __toModule(require("react"));
|
|
5272
5317
|
|
|
5273
5318
|
// src/components/InfiniteTable/utils/moveXatY.ts
|
|
5274
5319
|
var moveXatY = (arr, dragIndex, dropIndex) => {
|
|
@@ -5302,18 +5347,18 @@ var useColumnPointerEvents = ({
|
|
|
5302
5347
|
columns,
|
|
5303
5348
|
computedRemainingSpace
|
|
5304
5349
|
}) => {
|
|
5305
|
-
const [draggingDiff, setDraggingDiff] = (0,
|
|
5306
|
-
const [proxyOffset, setProxyOffset] = (0,
|
|
5307
|
-
const breakpointsRef = (0,
|
|
5308
|
-
const pointerMoveRef = (0,
|
|
5309
|
-
const didDragRef = (0,
|
|
5310
|
-
const initialClientPos = (0,
|
|
5311
|
-
const currentDropIndexRef = (0,
|
|
5350
|
+
const [draggingDiff, setDraggingDiff] = (0, import_react21.useState)(null);
|
|
5351
|
+
const [proxyOffset, setProxyOffset] = (0, import_react21.useState)(null);
|
|
5352
|
+
const breakpointsRef = (0, import_react21.useRef)([]);
|
|
5353
|
+
const pointerMoveRef = (0, import_react21.useRef)(null);
|
|
5354
|
+
const didDragRef = (0, import_react21.useRef)(false);
|
|
5355
|
+
const initialClientPos = (0, import_react21.useRef)(null);
|
|
5356
|
+
const currentDropIndexRef = (0, import_react21.useRef)(null);
|
|
5312
5357
|
const dragging = draggingDiff != null;
|
|
5313
5358
|
const { componentActions, computed } = useInfiniteTable();
|
|
5314
5359
|
const { computedColumnOrder } = computed;
|
|
5315
|
-
const column = (0,
|
|
5316
|
-
const { columnIndex, columnWidth, columnsArray } = (0,
|
|
5360
|
+
const column = (0, import_react21.useMemo)(() => columns.get(columnId), [columnId, columns]);
|
|
5361
|
+
const { columnIndex, columnWidth, columnsArray } = (0, import_react21.useMemo)(() => {
|
|
5317
5362
|
const columnsArray2 = Array.from(columns.values());
|
|
5318
5363
|
return {
|
|
5319
5364
|
columnsArray: columnsArray2,
|
|
@@ -5321,8 +5366,8 @@ var useColumnPointerEvents = ({
|
|
|
5321
5366
|
columnWidth: column.computedWidth
|
|
5322
5367
|
};
|
|
5323
5368
|
}, [columns, columnId, column]);
|
|
5324
|
-
let cursorRef = (0,
|
|
5325
|
-
const onPointerDown = (0,
|
|
5369
|
+
let cursorRef = (0, import_react21.useRef)("auto");
|
|
5370
|
+
const onPointerDown = (0, import_react21.useCallback)((e) => {
|
|
5326
5371
|
const target = domRef.current;
|
|
5327
5372
|
cursorRef.current = target.style.cursor;
|
|
5328
5373
|
didDragRef.current = false;
|
|
@@ -5385,7 +5430,7 @@ var useColumnPointerEvents = ({
|
|
|
5385
5430
|
target.addEventListener("pointermove", onPointerMove);
|
|
5386
5431
|
target.setPointerCapture(e.pointerId);
|
|
5387
5432
|
}, [columns, column, columnIndex, columnsArray, computedRemainingSpace]);
|
|
5388
|
-
const onPointerUp = (0,
|
|
5433
|
+
const onPointerUp = (0, import_react21.useCallback)((e) => {
|
|
5389
5434
|
const target = domRef.current;
|
|
5390
5435
|
target.style.cursor = cursorRef.current;
|
|
5391
5436
|
target.releasePointerCapture(e.pointerId);
|
|
@@ -5459,8 +5504,8 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
5459
5504
|
var import_react_dom = __toModule(require("react-dom"));
|
|
5460
5505
|
|
|
5461
5506
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5462
|
-
var
|
|
5463
|
-
var
|
|
5507
|
+
var React11 = __toModule(require("react"));
|
|
5508
|
+
var import_react22 = __toModule(require("react"));
|
|
5464
5509
|
var defaultLineStyle = {
|
|
5465
5510
|
marginTop: 2,
|
|
5466
5511
|
marginBottom: 2,
|
|
@@ -5469,8 +5514,8 @@ var defaultLineStyle = {
|
|
|
5469
5514
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
5470
5515
|
function SortIcon(props) {
|
|
5471
5516
|
var _a;
|
|
5472
|
-
const [rendered, setRendered] = (0,
|
|
5473
|
-
const [opacity, setOpacity] = (0,
|
|
5517
|
+
const [rendered, setRendered] = (0, import_react22.useState)(true);
|
|
5518
|
+
const [opacity, setOpacity] = (0, import_react22.useState)(0);
|
|
5474
5519
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
5475
5520
|
const showIndex = index != null && index > 0;
|
|
5476
5521
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -5484,7 +5529,7 @@ function SortIcon(props) {
|
|
|
5484
5529
|
}), props.lineStyle), {
|
|
5485
5530
|
opacity
|
|
5486
5531
|
});
|
|
5487
|
-
(0,
|
|
5532
|
+
(0, import_react22.useEffect)(() => {
|
|
5488
5533
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
5489
5534
|
if (!rendered && newOpacity) {
|
|
5490
5535
|
setRendered(true);
|
|
@@ -5514,24 +5559,24 @@ function SortIcon(props) {
|
|
|
5514
5559
|
if (direction === -1) {
|
|
5515
5560
|
indexStyle.top = "100%";
|
|
5516
5561
|
}
|
|
5517
|
-
return /* @__PURE__ */
|
|
5562
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
5518
5563
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5519
5564
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5520
|
-
}, showIndex ? /* @__PURE__ */
|
|
5565
|
+
}, showIndex ? /* @__PURE__ */ React11.createElement("div", {
|
|
5521
5566
|
"data-name": "index",
|
|
5522
5567
|
style: indexStyle
|
|
5523
|
-
}, index) : null, /* @__PURE__ */
|
|
5568
|
+
}, index) : null, /* @__PURE__ */ React11.createElement("div", {
|
|
5524
5569
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5525
5570
|
onTransitionEnd
|
|
5526
|
-
}), /* @__PURE__ */
|
|
5571
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
5527
5572
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5528
|
-
}), /* @__PURE__ */
|
|
5573
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
5529
5574
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5530
5575
|
}));
|
|
5531
5576
|
}
|
|
5532
5577
|
|
|
5533
5578
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5534
|
-
var InfiniteTableHeaderCellContext =
|
|
5579
|
+
var InfiniteTableHeaderCellContext = React12.createContext(null);
|
|
5535
5580
|
var defaultStyle = {
|
|
5536
5581
|
position: "absolute",
|
|
5537
5582
|
top: 0
|
|
@@ -5550,12 +5595,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5550
5595
|
}
|
|
5551
5596
|
const sortInfo = column.computedSortInfo;
|
|
5552
5597
|
let header = column.header;
|
|
5553
|
-
const ref = (0,
|
|
5598
|
+
const ref = (0, import_react23.useCallback)((node) => {
|
|
5554
5599
|
var _a2;
|
|
5555
5600
|
domRef.current = node;
|
|
5556
5601
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
5557
5602
|
}, [props.domRef]);
|
|
5558
|
-
const sortTool = /* @__PURE__ */
|
|
5603
|
+
const sortTool = /* @__PURE__ */ React12.createElement(SortIcon, {
|
|
5559
5604
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
5560
5605
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
|
|
5561
5606
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
@@ -5568,7 +5613,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5568
5613
|
};
|
|
5569
5614
|
const renderChildren = () => {
|
|
5570
5615
|
if (header instanceof Function) {
|
|
5571
|
-
header = /* @__PURE__ */
|
|
5616
|
+
header = /* @__PURE__ */ React12.createElement(RenderHookComponent, {
|
|
5572
5617
|
render: header,
|
|
5573
5618
|
renderParam
|
|
5574
5619
|
});
|
|
@@ -5576,12 +5621,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5576
5621
|
header = header != null ? header : column.name;
|
|
5577
5622
|
return header;
|
|
5578
5623
|
};
|
|
5579
|
-
const domRef = (0,
|
|
5624
|
+
const domRef = (0, import_react23.useRef)(null);
|
|
5580
5625
|
const {
|
|
5581
5626
|
computed: { computedRemainingSpace },
|
|
5582
5627
|
componentState: { portalDOMRef }
|
|
5583
5628
|
} = useInfiniteTable();
|
|
5584
|
-
(0,
|
|
5629
|
+
(0, import_react23.useEffect)(() => {
|
|
5585
5630
|
let clearOnResize = null;
|
|
5586
5631
|
const node = domRef.current;
|
|
5587
5632
|
if (onResize && node) {
|
|
@@ -5604,7 +5649,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5604
5649
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
5605
5650
|
let draggingProxy = null;
|
|
5606
5651
|
if (dragging) {
|
|
5607
|
-
draggingProxy = /* @__PURE__ */
|
|
5652
|
+
draggingProxy = /* @__PURE__ */ React12.createElement("div", {
|
|
5608
5653
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
5609
5654
|
style: {
|
|
5610
5655
|
position: "absolute",
|
|
@@ -5618,9 +5663,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5618
5663
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
5619
5664
|
}
|
|
5620
5665
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5621
|
-
return /* @__PURE__ */
|
|
5666
|
+
return /* @__PURE__ */ React12.createElement(ContextProvider, {
|
|
5622
5667
|
value: renderParam
|
|
5623
|
-
}, /* @__PURE__ */
|
|
5668
|
+
}, /* @__PURE__ */ React12.createElement(InfiniteTableCell, {
|
|
5624
5669
|
domRef: ref,
|
|
5625
5670
|
cellType: "header",
|
|
5626
5671
|
column,
|
|
@@ -5637,34 +5682,34 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5637
5682
|
}), draggingProxy);
|
|
5638
5683
|
}
|
|
5639
5684
|
function useInfiniteHeaderCell() {
|
|
5640
|
-
const result = (0,
|
|
5685
|
+
const result = (0, import_react23.useContext)(InfiniteTableHeaderCellContext);
|
|
5641
5686
|
return result;
|
|
5642
5687
|
}
|
|
5643
5688
|
|
|
5644
5689
|
// src/components/RawList/index.tsx
|
|
5645
|
-
var
|
|
5646
|
-
var
|
|
5690
|
+
var React15 = __toModule(require("react"));
|
|
5691
|
+
var import_react26 = __toModule(require("react"));
|
|
5647
5692
|
|
|
5648
5693
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
5649
|
-
var
|
|
5650
|
-
var
|
|
5694
|
+
var React13 = __toModule(require("react"));
|
|
5695
|
+
var import_react24 = __toModule(require("react"));
|
|
5651
5696
|
function AvoidReactDiffFn(props) {
|
|
5652
|
-
const [children, setChildren] = (0,
|
|
5653
|
-
(0,
|
|
5697
|
+
const [children, setChildren] = (0, import_react24.useState)(props.updater.get());
|
|
5698
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
5654
5699
|
const remove = props.updater.onChange((children2) => {
|
|
5655
5700
|
setChildren(children2);
|
|
5656
5701
|
});
|
|
5657
5702
|
return remove;
|
|
5658
5703
|
}, [props.updater]);
|
|
5659
|
-
return /* @__PURE__ */
|
|
5704
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, children);
|
|
5660
5705
|
}
|
|
5661
|
-
var AvoidReactDiff =
|
|
5706
|
+
var AvoidReactDiff = React13.memo(AvoidReactDiffFn);
|
|
5662
5707
|
|
|
5663
5708
|
// src/components/RawList/useVirtualRenderer.ts
|
|
5664
|
-
var
|
|
5709
|
+
var import_react25 = __toModule(require("react"));
|
|
5665
5710
|
|
|
5666
5711
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
5667
|
-
var
|
|
5712
|
+
var React14 = __toModule(require("react"));
|
|
5668
5713
|
|
|
5669
5714
|
// src/components/RawList/MappedItems.ts
|
|
5670
5715
|
var MappedItems = class extends Logger {
|
|
@@ -5909,7 +5954,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5909
5954
|
};
|
|
5910
5955
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5911
5956
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5912
|
-
const item = /* @__PURE__ */
|
|
5957
|
+
const item = /* @__PURE__ */ React14.createElement(AvoidReactDiff, {
|
|
5913
5958
|
key: elementIndex,
|
|
5914
5959
|
name: `${elementIndex}`,
|
|
5915
5960
|
updater: this.updaters[elementIndex]
|
|
@@ -5945,7 +5990,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5945
5990
|
}
|
|
5946
5991
|
this.mappedItems.renderItemAtElement(itemIndex, elementIndex, renderedNode);
|
|
5947
5992
|
if (true) {
|
|
5948
|
-
this.
|
|
5993
|
+
dbg(`ReactVirtualRenderer:${this.brain.getOptions().mainAxis}`)(`Render item ${itemIndex} at element ${elementIndex}`);
|
|
5949
5994
|
}
|
|
5950
5995
|
itemUpdater(renderedNode);
|
|
5951
5996
|
this.updateElementPosition(elementIndex);
|
|
@@ -5975,7 +6020,7 @@ function createRenderer(brain) {
|
|
|
5975
6020
|
function useVirtualRenderer({
|
|
5976
6021
|
brain
|
|
5977
6022
|
}) {
|
|
5978
|
-
return (0,
|
|
6023
|
+
return (0, import_react25.useMemo)(() => {
|
|
5979
6024
|
return createRenderer(brain);
|
|
5980
6025
|
}, [brain]);
|
|
5981
6026
|
}
|
|
@@ -5988,7 +6033,7 @@ function RawListFn(props) {
|
|
|
5988
6033
|
debugChannel
|
|
5989
6034
|
});
|
|
5990
6035
|
const getRenderItem = useLatest(renderItem);
|
|
5991
|
-
(0,
|
|
6036
|
+
(0, import_react26.useEffect)(() => {
|
|
5992
6037
|
const renderRange = brain.getRenderRange();
|
|
5993
6038
|
renderer.renderRange(renderRange, {
|
|
5994
6039
|
renderItem,
|
|
@@ -5996,7 +6041,7 @@ function RawListFn(props) {
|
|
|
5996
6041
|
onRender: onRenderUpdater
|
|
5997
6042
|
});
|
|
5998
6043
|
}, [brain, renderItem, onRenderUpdater]);
|
|
5999
|
-
(0,
|
|
6044
|
+
(0, import_react26.useEffect)(() => {
|
|
6000
6045
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
6001
6046
|
renderer.renderRange(renderRange, {
|
|
6002
6047
|
force: false,
|
|
@@ -6006,11 +6051,11 @@ function RawListFn(props) {
|
|
|
6006
6051
|
});
|
|
6007
6052
|
return remove;
|
|
6008
6053
|
}, [brain, onRenderUpdater]);
|
|
6009
|
-
return /* @__PURE__ */
|
|
6054
|
+
return /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
|
|
6010
6055
|
updater: onRenderUpdater
|
|
6011
6056
|
});
|
|
6012
6057
|
}
|
|
6013
|
-
var RawList =
|
|
6058
|
+
var RawList = React15.memo(RawListFn);
|
|
6014
6059
|
|
|
6015
6060
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
6016
6061
|
var debug3 = dbg("Header");
|
|
@@ -6023,7 +6068,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6023
6068
|
componentState: { headerHeight }
|
|
6024
6069
|
} = useInfiniteTable();
|
|
6025
6070
|
const { computedVisibleColumnsMap } = computed;
|
|
6026
|
-
const renderColumn = (0,
|
|
6071
|
+
const renderColumn = (0, import_react27.useCallback)(({ domRef: domRef2, itemIndex: columnIndex }) => {
|
|
6027
6072
|
const column = columns[columnIndex];
|
|
6028
6073
|
if (!column) {
|
|
6029
6074
|
if (true) {
|
|
@@ -6031,14 +6076,14 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6031
6076
|
}
|
|
6032
6077
|
return null;
|
|
6033
6078
|
}
|
|
6034
|
-
return /* @__PURE__ */
|
|
6079
|
+
return /* @__PURE__ */ React16.createElement(InfiniteTableHeaderCell, {
|
|
6035
6080
|
domRef: domRef2,
|
|
6036
6081
|
column,
|
|
6037
6082
|
headerHeight,
|
|
6038
6083
|
columns: computedVisibleColumnsMap
|
|
6039
6084
|
});
|
|
6040
6085
|
}, [computedVisibleColumnsMap, columns, repaintId, headerHeight]);
|
|
6041
|
-
(0,
|
|
6086
|
+
(0, import_react27.useEffect)(() => {
|
|
6042
6087
|
const onScroll = (scrollPosition) => {
|
|
6043
6088
|
if (domRef.current) {
|
|
6044
6089
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -6047,7 +6092,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6047
6092
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
6048
6093
|
return removeOnScroll;
|
|
6049
6094
|
}, [brain]);
|
|
6050
|
-
const domRef = (0,
|
|
6095
|
+
const domRef = (0, import_react27.useRef)(null);
|
|
6051
6096
|
const headerCls = HeaderClsRecipe({
|
|
6052
6097
|
pinned: pinning,
|
|
6053
6098
|
overflow: false,
|
|
@@ -6058,18 +6103,18 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6058
6103
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
6059
6104
|
style
|
|
6060
6105
|
};
|
|
6061
|
-
return /* @__PURE__ */
|
|
6106
|
+
return /* @__PURE__ */ React16.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React16.createElement(RawList, {
|
|
6062
6107
|
brain,
|
|
6063
6108
|
renderItem: renderColumn
|
|
6064
6109
|
}));
|
|
6065
6110
|
}
|
|
6066
|
-
var InfiniteTableHeader =
|
|
6111
|
+
var InfiniteTableHeader = React16.memo(InfiniteTableHeaderFn);
|
|
6067
6112
|
|
|
6068
6113
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
6069
|
-
var
|
|
6114
|
+
var React19 = __toModule(require("react"));
|
|
6070
6115
|
|
|
6071
6116
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
6072
|
-
var
|
|
6117
|
+
var React18 = __toModule(require("react"));
|
|
6073
6118
|
|
|
6074
6119
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
6075
6120
|
function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap) {
|
|
@@ -6159,7 +6204,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6159
6204
|
}
|
|
6160
6205
|
|
|
6161
6206
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6162
|
-
var
|
|
6207
|
+
var React17 = __toModule(require("react"));
|
|
6163
6208
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
6164
6209
|
function InfiniteTableHeaderGroup(props) {
|
|
6165
6210
|
const { columnGroup, height, headerHeight } = props;
|
|
@@ -6173,16 +6218,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6173
6218
|
width: columnGroup.computedWidth,
|
|
6174
6219
|
height
|
|
6175
6220
|
};
|
|
6176
|
-
return /* @__PURE__ */
|
|
6221
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
6177
6222
|
"data-group-id": columnGroup.id,
|
|
6178
6223
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
6179
6224
|
style
|
|
6180
|
-
}, /* @__PURE__ */
|
|
6225
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
6181
6226
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
6182
6227
|
style: { height: headerHeight }
|
|
6183
|
-
}, /* @__PURE__ */
|
|
6228
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
6184
6229
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6185
|
-
}, header)), /* @__PURE__ */
|
|
6230
|
+
}, header)), /* @__PURE__ */ React17.createElement("div", {
|
|
6186
6231
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
6187
6232
|
}, props.children));
|
|
6188
6233
|
}
|
|
@@ -6205,7 +6250,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6205
6250
|
return items2.map((colGroupItem) => {
|
|
6206
6251
|
if (colGroupItem.type === "column") {
|
|
6207
6252
|
const col = colGroupItem.ref;
|
|
6208
|
-
return /* @__PURE__ */
|
|
6253
|
+
return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderCell, {
|
|
6209
6254
|
key: col.id,
|
|
6210
6255
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
6211
6256
|
column: col,
|
|
@@ -6219,7 +6264,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6219
6264
|
colIds.push(col.id);
|
|
6220
6265
|
return col;
|
|
6221
6266
|
});
|
|
6222
|
-
return /* @__PURE__ */
|
|
6267
|
+
return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderGroup, {
|
|
6223
6268
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
6224
6269
|
columns: columns2,
|
|
6225
6270
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -6239,7 +6284,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6239
6284
|
}
|
|
6240
6285
|
|
|
6241
6286
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
6242
|
-
var
|
|
6287
|
+
var import_react28 = __toModule(require("react"));
|
|
6243
6288
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
6244
6289
|
var TableHeaderClassName2 = `${rootClassName5}Header`;
|
|
6245
6290
|
var UPDATE_SCROLL = (node, scrollPosition) => {
|
|
@@ -6272,9 +6317,9 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6272
6317
|
},
|
|
6273
6318
|
computed: { computedVisibleColumnsMap: columnsMap }
|
|
6274
6319
|
} = useInfiniteTable();
|
|
6275
|
-
const domRef =
|
|
6320
|
+
const domRef = React19.useRef(null);
|
|
6276
6321
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
6277
|
-
const columnHeaderGroups =
|
|
6322
|
+
const columnHeaderGroups = React19.useMemo(() => {
|
|
6278
6323
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
6279
6324
|
columnGroups: computedColumnGroups,
|
|
6280
6325
|
columnGroupsDepthsMap,
|
|
@@ -6293,7 +6338,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6293
6338
|
columnGroupsMaxDepth
|
|
6294
6339
|
]);
|
|
6295
6340
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
6296
|
-
return /* @__PURE__ */
|
|
6341
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
|
|
6297
6342
|
key: c.id,
|
|
6298
6343
|
headerHeight,
|
|
6299
6344
|
column: c,
|
|
@@ -6305,7 +6350,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6305
6350
|
if (totalWidth != null) {
|
|
6306
6351
|
style.width = availableWidth;
|
|
6307
6352
|
}
|
|
6308
|
-
(0,
|
|
6353
|
+
(0, import_react28.useEffect)(() => {
|
|
6309
6354
|
const scroller = brain || scrollListener;
|
|
6310
6355
|
if (!scroller || !scrollable) {
|
|
6311
6356
|
return;
|
|
@@ -6318,20 +6363,20 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6318
6363
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
6319
6364
|
return removeOnScroll;
|
|
6320
6365
|
}, [brain, scrollListener]);
|
|
6321
|
-
return /* @__PURE__ */
|
|
6366
|
+
return /* @__PURE__ */ React19.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6322
6367
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
6323
6368
|
pinned: pinning,
|
|
6324
6369
|
virtualized: false,
|
|
6325
6370
|
overflow: scrollable
|
|
6326
6371
|
})),
|
|
6327
6372
|
style
|
|
6328
|
-
}), /* @__PURE__ */
|
|
6373
|
+
}), /* @__PURE__ */ React19.createElement("div", {
|
|
6329
6374
|
style: { width: totalWidth },
|
|
6330
6375
|
className: join(flexFlow.row, display.flex),
|
|
6331
6376
|
ref: domRef
|
|
6332
6377
|
}, children));
|
|
6333
6378
|
}
|
|
6334
|
-
var InfiniteTableHeaderUnvirtualized =
|
|
6379
|
+
var InfiniteTableHeaderUnvirtualized = React19.memo(InfiniteTableHeaderUnvirtualizedFn);
|
|
6335
6380
|
|
|
6336
6381
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6337
6382
|
function TableHeaderWrapper(props) {
|
|
@@ -6364,7 +6409,7 @@ function TableHeaderWrapper(props) {
|
|
|
6364
6409
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
6365
6410
|
left: computedPinnedStartWidth
|
|
6366
6411
|
} : void 0;
|
|
6367
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
6412
|
+
const header = virtualizeHeader ? /* @__PURE__ */ React20.createElement(InfiniteTableHeader, {
|
|
6368
6413
|
columns: computedUnpinnedColumns,
|
|
6369
6414
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
6370
6415
|
brain,
|
|
@@ -6377,7 +6422,7 @@ function TableHeaderWrapper(props) {
|
|
|
6377
6422
|
},
|
|
6378
6423
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6379
6424
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6380
|
-
}) : /* @__PURE__ */
|
|
6425
|
+
}) : /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6381
6426
|
style: unvirtualizedStyle,
|
|
6382
6427
|
brain,
|
|
6383
6428
|
scrollable: true,
|
|
@@ -6386,12 +6431,12 @@ function TableHeaderWrapper(props) {
|
|
|
6386
6431
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6387
6432
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6388
6433
|
});
|
|
6389
|
-
return /* @__PURE__ */
|
|
6434
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
6390
6435
|
className: HeaderWrapperCls,
|
|
6391
6436
|
style: {
|
|
6392
6437
|
height: virtualizeHeader ? height : void 0
|
|
6393
6438
|
}
|
|
6394
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
6439
|
+
}, hasPinnedStart ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6395
6440
|
style: {
|
|
6396
6441
|
left: 0,
|
|
6397
6442
|
position: "absolute",
|
|
@@ -6403,7 +6448,7 @@ function TableHeaderWrapper(props) {
|
|
|
6403
6448
|
scrollable: computedPinnedStartOverflow,
|
|
6404
6449
|
pinning: "start",
|
|
6405
6450
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
6406
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
6451
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6407
6452
|
style: {
|
|
6408
6453
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
6409
6454
|
position: "absolute",
|
|
@@ -6415,7 +6460,7 @@ function TableHeaderWrapper(props) {
|
|
|
6415
6460
|
scrollable: computedPinnedEndOverflow,
|
|
6416
6461
|
pinning: "end",
|
|
6417
6462
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
6418
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
6463
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ React20.createElement(VerticalScrollbarPlaceholder, {
|
|
6419
6464
|
style: {
|
|
6420
6465
|
height: "100%",
|
|
6421
6466
|
right: 0
|
|
@@ -6424,13 +6469,13 @@ function TableHeaderWrapper(props) {
|
|
|
6424
6469
|
}
|
|
6425
6470
|
|
|
6426
6471
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6427
|
-
var
|
|
6428
|
-
var
|
|
6472
|
+
var React21 = __toModule(require("react"));
|
|
6473
|
+
var import_react30 = __toModule(require("react"));
|
|
6429
6474
|
|
|
6430
6475
|
// src/components/hooks/useOnScroll.ts
|
|
6431
|
-
var
|
|
6476
|
+
var import_react29 = __toModule(require("react"));
|
|
6432
6477
|
var useOnScroll = (domRef, onScroll) => {
|
|
6433
|
-
(0,
|
|
6478
|
+
(0, import_react29.useEffect)(() => {
|
|
6434
6479
|
const domNode = domRef == null ? void 0 : domRef.current;
|
|
6435
6480
|
const scrollFn = (event) => {
|
|
6436
6481
|
const node = event.target;
|
|
@@ -6468,7 +6513,7 @@ var getScrollableClassName = (scrollable) => {
|
|
|
6468
6513
|
|
|
6469
6514
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6470
6515
|
var rootClassName6 = "InfiniteVirtualScrollContainer";
|
|
6471
|
-
var VirtualScrollContainer =
|
|
6516
|
+
var VirtualScrollContainer = React21.forwardRef(function VirtualScrollContainer2(props, ref) {
|
|
6472
6517
|
const {
|
|
6473
6518
|
children,
|
|
6474
6519
|
scrollable = true,
|
|
@@ -6476,9 +6521,9 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
|
|
|
6476
6521
|
className,
|
|
6477
6522
|
style
|
|
6478
6523
|
} = props;
|
|
6479
|
-
const domRef = ref != null ? ref : (0,
|
|
6524
|
+
const domRef = ref != null ? ref : (0, import_react30.useRef)(null);
|
|
6480
6525
|
useOnScroll(domRef, onContainerScroll);
|
|
6481
|
-
return /* @__PURE__ */
|
|
6526
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
6482
6527
|
ref: domRef,
|
|
6483
6528
|
style,
|
|
6484
6529
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -6486,7 +6531,7 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
|
|
|
6486
6531
|
});
|
|
6487
6532
|
|
|
6488
6533
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
6489
|
-
var
|
|
6534
|
+
var React22 = __toModule(require("react"));
|
|
6490
6535
|
function SpacePlaceholderFn(props) {
|
|
6491
6536
|
const { height, width, count } = props;
|
|
6492
6537
|
const style = {
|
|
@@ -6496,7 +6541,7 @@ function SpacePlaceholderFn(props) {
|
|
|
6496
6541
|
opacity: 0,
|
|
6497
6542
|
pointerEvents: "none"
|
|
6498
6543
|
};
|
|
6499
|
-
return /* @__PURE__ */
|
|
6544
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
6500
6545
|
"data-count": count,
|
|
6501
6546
|
"data-placeholder-width": true ? width : void 0,
|
|
6502
6547
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -6504,21 +6549,21 @@ function SpacePlaceholderFn(props) {
|
|
|
6504
6549
|
style
|
|
6505
6550
|
});
|
|
6506
6551
|
}
|
|
6507
|
-
var SpacePlaceholder =
|
|
6552
|
+
var SpacePlaceholder = React22.memo(SpacePlaceholderFn);
|
|
6508
6553
|
|
|
6509
6554
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
6510
|
-
var
|
|
6555
|
+
var import_react42 = __toModule(require("react"));
|
|
6511
6556
|
|
|
6512
6557
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6513
|
-
var
|
|
6514
|
-
var
|
|
6558
|
+
var React28 = __toModule(require("react"));
|
|
6559
|
+
var import_react35 = __toModule(require("react"));
|
|
6515
6560
|
|
|
6516
6561
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6517
|
-
var
|
|
6562
|
+
var React24 = __toModule(require("react"));
|
|
6518
6563
|
|
|
6519
6564
|
// src/components/VirtualList/VirtualList.tsx
|
|
6520
|
-
var
|
|
6521
|
-
var
|
|
6565
|
+
var React23 = __toModule(require("react"));
|
|
6566
|
+
var import_react31 = __toModule(require("react"));
|
|
6522
6567
|
|
|
6523
6568
|
// src/components/VirtualList/VirtualList.css.ts
|
|
6524
6569
|
var VirtualListCls = "_16lm1iw1 _16lm1iw8 _16lm1iw0";
|
|
@@ -6561,11 +6606,11 @@ var VirtualList = (props) => {
|
|
|
6561
6606
|
"onContainerScroll",
|
|
6562
6607
|
"children"
|
|
6563
6608
|
]);
|
|
6564
|
-
const domRef = (0,
|
|
6609
|
+
const domRef = (0, import_react31.useRef)(null);
|
|
6565
6610
|
const [, rerender] = useRerender();
|
|
6566
|
-
const [totalSize, setTotalSize] = (0,
|
|
6567
|
-
const renderCountRef = (0,
|
|
6568
|
-
(0,
|
|
6611
|
+
const [totalSize, setTotalSize] = (0, import_react31.useState)(0);
|
|
6612
|
+
const renderCountRef = (0, import_react31.useRef)(0);
|
|
6613
|
+
(0, import_react31.useEffect)(() => {
|
|
6569
6614
|
const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
|
|
6570
6615
|
renderCountRef.current = renderCount;
|
|
6571
6616
|
if (true) {
|
|
@@ -6584,7 +6629,7 @@ var VirtualList = (props) => {
|
|
|
6584
6629
|
removeOnTotalSizeChange();
|
|
6585
6630
|
};
|
|
6586
6631
|
}, [virtualBrain]);
|
|
6587
|
-
(0,
|
|
6632
|
+
(0, import_react31.useEffect)(() => {
|
|
6588
6633
|
const onScroll = (scrollPosition) => {
|
|
6589
6634
|
UPDATE_SCROLL2(domRef.current, scrollPosition);
|
|
6590
6635
|
};
|
|
@@ -6599,19 +6644,19 @@ var VirtualList = (props) => {
|
|
|
6599
6644
|
if (true) {
|
|
6600
6645
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
6601
6646
|
}
|
|
6602
|
-
return /* @__PURE__ */
|
|
6647
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React23.createElement(VirtualScrollContainer, {
|
|
6603
6648
|
scrollable,
|
|
6604
6649
|
onContainerScroll
|
|
6605
|
-
}, /* @__PURE__ */
|
|
6650
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
6606
6651
|
ref: domRef,
|
|
6607
6652
|
className: scrollTransformTargetCls,
|
|
6608
6653
|
"data-name": "scroll-transform-target"
|
|
6609
|
-
}, /* @__PURE__ */
|
|
6654
|
+
}, /* @__PURE__ */ React23.createElement(RawList, {
|
|
6610
6655
|
brain: virtualBrain,
|
|
6611
6656
|
renderItem,
|
|
6612
6657
|
repaintId,
|
|
6613
6658
|
debugChannel: "VirtualList-" + mainAxis
|
|
6614
|
-
})), children, /* @__PURE__ */
|
|
6659
|
+
})), children, /* @__PURE__ */ React23.createElement(SpacePlaceholder, {
|
|
6615
6660
|
count,
|
|
6616
6661
|
width,
|
|
6617
6662
|
height
|
|
@@ -6621,14 +6666,14 @@ var VirtualList = (props) => {
|
|
|
6621
6666
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6622
6667
|
var VirtualRowList = (props) => {
|
|
6623
6668
|
const _a = props, { rowWidth, rowHeight, renderRow } = _a, listProps = __objRest(_a, ["rowWidth", "rowHeight", "renderRow"]);
|
|
6624
|
-
const renderItem =
|
|
6669
|
+
const renderItem = React24.useCallback((renderProps) => {
|
|
6625
6670
|
return renderRow({
|
|
6626
6671
|
domRef: renderProps.domRef,
|
|
6627
6672
|
rowHeight: renderProps.itemSize,
|
|
6628
6673
|
rowIndex: renderProps.itemIndex
|
|
6629
6674
|
});
|
|
6630
6675
|
}, [renderRow]);
|
|
6631
|
-
return /* @__PURE__ */
|
|
6676
|
+
return /* @__PURE__ */ React24.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
6632
6677
|
renderItem,
|
|
6633
6678
|
mainAxis: "vertical",
|
|
6634
6679
|
itemMainAxisSize: rowHeight,
|
|
@@ -6637,14 +6682,14 @@ var VirtualRowList = (props) => {
|
|
|
6637
6682
|
};
|
|
6638
6683
|
|
|
6639
6684
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
6640
|
-
var
|
|
6641
|
-
var
|
|
6685
|
+
var React26 = __toModule(require("react"));
|
|
6686
|
+
var import_react34 = __toModule(require("react"));
|
|
6642
6687
|
|
|
6643
6688
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
6644
|
-
var
|
|
6645
|
-
var
|
|
6689
|
+
var React25 = __toModule(require("react"));
|
|
6690
|
+
var import_react32 = __toModule(require("react"));
|
|
6646
6691
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6647
|
-
var InfiniteTableColumnCellContext =
|
|
6692
|
+
var InfiniteTableColumnCellContext = React25.createContext(null);
|
|
6648
6693
|
var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
|
|
6649
6694
|
function isColumnWithField(c) {
|
|
6650
6695
|
return typeof c.field === "string";
|
|
@@ -6709,7 +6754,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6709
6754
|
}
|
|
6710
6755
|
const renderFn = column.render || column.renderValue;
|
|
6711
6756
|
if (renderFn) {
|
|
6712
|
-
return /* @__PURE__ */
|
|
6757
|
+
return /* @__PURE__ */ React25.createElement(RenderHookComponent, {
|
|
6713
6758
|
render: renderFn,
|
|
6714
6759
|
renderParam
|
|
6715
6760
|
});
|
|
@@ -6756,18 +6801,18 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6756
6801
|
renderChildren
|
|
6757
6802
|
});
|
|
6758
6803
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
6759
|
-
return /* @__PURE__ */
|
|
6804
|
+
return /* @__PURE__ */ React25.createElement(ContextProvider, {
|
|
6760
6805
|
value: renderParam
|
|
6761
|
-
}, /* @__PURE__ */
|
|
6806
|
+
}, /* @__PURE__ */ React25.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
6762
6807
|
}
|
|
6763
|
-
var InfiniteTableColumnCell =
|
|
6808
|
+
var InfiniteTableColumnCell = React25.memo(InfiniteTableColumnCellFn);
|
|
6764
6809
|
function useInfiniteColumnCell() {
|
|
6765
|
-
const result = (0,
|
|
6810
|
+
const result = (0, import_react32.useContext)(InfiniteTableColumnCellContext);
|
|
6766
6811
|
return result;
|
|
6767
6812
|
}
|
|
6768
6813
|
|
|
6769
6814
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
|
|
6770
|
-
var
|
|
6815
|
+
var import_react33 = __toModule(require("react"));
|
|
6771
6816
|
|
|
6772
6817
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
|
|
6773
6818
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
@@ -6793,8 +6838,8 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6793
6838
|
rowInfo,
|
|
6794
6839
|
rowSpan
|
|
6795
6840
|
} = props;
|
|
6796
|
-
const domRef = (0,
|
|
6797
|
-
const rowDOMRef = (0,
|
|
6841
|
+
const domRef = (0, import_react33.useRef)(null);
|
|
6842
|
+
const rowDOMRef = (0, import_react33.useCallback)((node) => {
|
|
6798
6843
|
domRefFromProps(node);
|
|
6799
6844
|
domRef.current = node;
|
|
6800
6845
|
}, []);
|
|
@@ -6825,7 +6870,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6825
6870
|
}), `${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);
|
|
6826
6871
|
const initialMouseEnter = rowProps == null ? void 0 : rowProps.onMouseEnter;
|
|
6827
6872
|
const initialMouseLeave = rowProps == null ? void 0 : rowProps.onMouseLeave;
|
|
6828
|
-
const onMouseEnter = (0,
|
|
6873
|
+
const onMouseEnter = (0, import_react33.useCallback)((event) => {
|
|
6829
6874
|
var _a;
|
|
6830
6875
|
initialMouseEnter == null ? void 0 : initialMouseEnter(event);
|
|
6831
6876
|
const rowIndex2 = ((_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex) * 1;
|
|
@@ -6839,7 +6884,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6839
6884
|
const rows = parentNode.querySelectorAll(hoverSelector.join(","));
|
|
6840
6885
|
rows.forEach((row) => row.classList.add(InfiniteTableRowClassName__hover, RowHoverCls));
|
|
6841
6886
|
}, [initialMouseEnter, showHoverRows]);
|
|
6842
|
-
const onMouseLeave = (0,
|
|
6887
|
+
const onMouseLeave = (0, import_react33.useCallback)((event) => {
|
|
6843
6888
|
var _a;
|
|
6844
6889
|
initialMouseLeave == null ? void 0 : initialMouseLeave(event);
|
|
6845
6890
|
const rowIndex2 = (_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex;
|
|
@@ -6895,13 +6940,13 @@ function InfiniteTableRowFn(props) {
|
|
|
6895
6940
|
width: rowWidth,
|
|
6896
6941
|
height: rowHeight
|
|
6897
6942
|
}, domProps.style);
|
|
6898
|
-
const renderCellRef = (0,
|
|
6899
|
-
const renderCell =
|
|
6943
|
+
const renderCellRef = (0, import_react34.useRef)(null);
|
|
6944
|
+
const renderCell = React26.useCallback(({ domRef, itemIndex }) => {
|
|
6900
6945
|
const column = columns[itemIndex];
|
|
6901
6946
|
if (!column) {
|
|
6902
6947
|
}
|
|
6903
6948
|
const hidden = false;
|
|
6904
|
-
return /* @__PURE__ */
|
|
6949
|
+
return /* @__PURE__ */ React26.createElement(InfiniteTableColumnCell, {
|
|
6905
6950
|
getData,
|
|
6906
6951
|
rowInfo,
|
|
6907
6952
|
groupRenderStrategy,
|
|
@@ -6928,18 +6973,18 @@ function InfiniteTableRowFn(props) {
|
|
|
6928
6973
|
if (true) {
|
|
6929
6974
|
domProps["data-cmp-name"] = "ITableRow";
|
|
6930
6975
|
}
|
|
6931
|
-
return /* @__PURE__ */
|
|
6976
|
+
return /* @__PURE__ */ React26.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6932
6977
|
style
|
|
6933
|
-
}), /* @__PURE__ */
|
|
6978
|
+
}), /* @__PURE__ */ React26.createElement(RawList, {
|
|
6934
6979
|
brain,
|
|
6935
6980
|
renderItem: renderCell,
|
|
6936
6981
|
debugChannel: `${rowIndex}`
|
|
6937
6982
|
}));
|
|
6938
6983
|
}
|
|
6939
|
-
var InfiniteTableRow =
|
|
6984
|
+
var InfiniteTableRow = React26.memo(InfiniteTableRowFn);
|
|
6940
6985
|
|
|
6941
6986
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
6942
|
-
var
|
|
6987
|
+
var React27 = __toModule(require("react"));
|
|
6943
6988
|
function TableRowUnvirtualizedFn(props) {
|
|
6944
6989
|
const {
|
|
6945
6990
|
rowHeight,
|
|
@@ -6960,7 +7005,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6960
7005
|
}, domProps.style);
|
|
6961
7006
|
const children = columns.map((col) => {
|
|
6962
7007
|
const hidden = false;
|
|
6963
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
|
|
6964
7009
|
key: col.id,
|
|
6965
7010
|
virtualized: false,
|
|
6966
7011
|
rowHeight,
|
|
@@ -6973,11 +7018,11 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6973
7018
|
column: col
|
|
6974
7019
|
});
|
|
6975
7020
|
});
|
|
6976
|
-
return /* @__PURE__ */
|
|
7021
|
+
return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6977
7022
|
style
|
|
6978
7023
|
}), children);
|
|
6979
7024
|
}
|
|
6980
|
-
var TableRowUnvirtualized =
|
|
7025
|
+
var TableRowUnvirtualized = React27.memo(TableRowUnvirtualizedFn);
|
|
6981
7026
|
|
|
6982
7027
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6983
7028
|
function useUnpinnedRendering(params) {
|
|
@@ -7000,7 +7045,7 @@ function useUnpinnedRendering(params) {
|
|
|
7000
7045
|
} = params;
|
|
7001
7046
|
const { virtualizeColumns } = getState();
|
|
7002
7047
|
const shouldVirtualizeColumns = typeof virtualizeColumns === "function" ? virtualizeColumns(computedUnpinnedColumns) : virtualizeColumns != null ? virtualizeColumns : true;
|
|
7003
|
-
const renderRowUnpinned = (0,
|
|
7048
|
+
const renderRowUnpinned = (0, import_react35.useCallback)((rowParams) => {
|
|
7004
7049
|
const dataArray = getData();
|
|
7005
7050
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
7006
7051
|
const { showZebraRows, showHoverRows } = getState();
|
|
@@ -7022,7 +7067,7 @@ function useUnpinnedRendering(params) {
|
|
|
7022
7067
|
rowProps.repaintId = repaintId;
|
|
7023
7068
|
}
|
|
7024
7069
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
7025
|
-
return /* @__PURE__ */
|
|
7070
|
+
return /* @__PURE__ */ React28.createElement(TableRowComponent, __spreadValues({}, rowProps));
|
|
7026
7071
|
}, [
|
|
7027
7072
|
repaintId,
|
|
7028
7073
|
rowHeight,
|
|
@@ -7033,7 +7078,7 @@ function useUnpinnedRendering(params) {
|
|
|
7033
7078
|
horizontalVirtualBrain,
|
|
7034
7079
|
verticalVirtualBrain
|
|
7035
7080
|
]);
|
|
7036
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
7081
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React28.createElement("div", {
|
|
7037
7082
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
7038
7083
|
style: {
|
|
7039
7084
|
position: "absolute",
|
|
@@ -7044,10 +7089,10 @@ function useUnpinnedRendering(params) {
|
|
|
7044
7089
|
overflow: "auto",
|
|
7045
7090
|
visibility: columnShifts ? "visible" : "hidden"
|
|
7046
7091
|
}
|
|
7047
|
-
}, /* @__PURE__ */
|
|
7092
|
+
}, /* @__PURE__ */ React28.createElement("div", {
|
|
7048
7093
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
7049
7094
|
})) : null;
|
|
7050
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
7095
|
+
return rowHeight != 0 ? /* @__PURE__ */ React28.createElement(VirtualRowList, {
|
|
7051
7096
|
repaintId: `${repaintId}-unpinned-`,
|
|
7052
7097
|
brain: verticalVirtualBrain,
|
|
7053
7098
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -7068,7 +7113,7 @@ function useUnpinnedRendering(params) {
|
|
|
7068
7113
|
}
|
|
7069
7114
|
|
|
7070
7115
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
7071
|
-
var
|
|
7116
|
+
var import_react36 = __toModule(require("react"));
|
|
7072
7117
|
|
|
7073
7118
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
7074
7119
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -7093,7 +7138,6 @@ var useOnContainerScroll = ({
|
|
|
7093
7138
|
componentState: {
|
|
7094
7139
|
scrollStopDelay,
|
|
7095
7140
|
scrollerDOMRef,
|
|
7096
|
-
domRef,
|
|
7097
7141
|
scrollToBottomOffset,
|
|
7098
7142
|
onScrollToBottom,
|
|
7099
7143
|
onScrollToTop,
|
|
@@ -7106,18 +7150,18 @@ var useOnContainerScroll = ({
|
|
|
7106
7150
|
getState: getDataSourceState,
|
|
7107
7151
|
componentState: { notifyScrollStop }
|
|
7108
7152
|
} = useDataSourceContextValue();
|
|
7109
|
-
const onScrollStop = (0,
|
|
7153
|
+
const onScrollStop = (0, import_react36.useCallback)((param) => {
|
|
7110
7154
|
onScrollStopFromProps == null ? void 0 : onScrollStopFromProps(param);
|
|
7111
7155
|
notifyScrollStop(param);
|
|
7112
7156
|
}, [onScrollStopFromProps, notifyScrollStop]);
|
|
7113
|
-
const timeoutIdRef = (0,
|
|
7114
|
-
const scrollingRef = (0,
|
|
7115
|
-
const scrollTopMaxRef = (0,
|
|
7116
|
-
(0,
|
|
7157
|
+
const timeoutIdRef = (0, import_react36.useRef)(0);
|
|
7158
|
+
const scrollingRef = (0, import_react36.useRef)(false);
|
|
7159
|
+
const scrollTopMaxRef = (0, import_react36.useRef)(0);
|
|
7160
|
+
(0, import_react36.useEffect)(() => {
|
|
7117
7161
|
const { current: node } = scrollerDOMRef;
|
|
7118
7162
|
scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
|
|
7119
7163
|
}, [reservedContentHeight, bodySize.height]);
|
|
7120
|
-
const setScrolling = (0,
|
|
7164
|
+
const setScrolling = (0, import_react36.useCallback)((scrolling) => {
|
|
7121
7165
|
var _a;
|
|
7122
7166
|
const prevScrolling = scrollingRef.current;
|
|
7123
7167
|
scrollingRef.current = scrolling;
|
|
@@ -7139,7 +7183,7 @@ var useOnContainerScroll = ({
|
|
|
7139
7183
|
lastVisibleRowIndex: range.renderEndIndex
|
|
7140
7184
|
});
|
|
7141
7185
|
}
|
|
7142
|
-
const classList = (_a =
|
|
7186
|
+
const classList = (_a = scrollerDOMRef.current) == null ? void 0 : _a.classList;
|
|
7143
7187
|
if (!classList) {
|
|
7144
7188
|
return;
|
|
7145
7189
|
}
|
|
@@ -7150,25 +7194,25 @@ var useOnContainerScroll = ({
|
|
|
7150
7194
|
}
|
|
7151
7195
|
}
|
|
7152
7196
|
}, [scrollStopDelay, onScrollStop]);
|
|
7153
|
-
const onContainerScroll = (0,
|
|
7197
|
+
const onContainerScroll = (0, import_react36.useCallback)((scrollInfo) => {
|
|
7154
7198
|
verticalVirtualBrain.setScrollPosition(scrollInfo);
|
|
7155
7199
|
horizontalVirtualBrain.setScrollPosition(scrollInfo);
|
|
7156
7200
|
setScrolling(true);
|
|
7157
7201
|
}, [
|
|
7158
7202
|
horizontalVirtualBrain,
|
|
7159
7203
|
verticalVirtualBrain,
|
|
7160
|
-
|
|
7204
|
+
scrollerDOMRef.current,
|
|
7161
7205
|
setScrolling
|
|
7162
7206
|
]);
|
|
7163
|
-
const scrollPositionRef = (0,
|
|
7207
|
+
const scrollPositionRef = (0, import_react36.useRef)({
|
|
7164
7208
|
scrollLeft: 0,
|
|
7165
7209
|
scrollTop: 0
|
|
7166
7210
|
});
|
|
7167
|
-
const applyScrollHorizontal = (0,
|
|
7211
|
+
const applyScrollHorizontal = (0, import_react36.useCallback)(({ scrollLeft }) => {
|
|
7168
7212
|
scrollPositionRef.current.scrollLeft = scrollLeft;
|
|
7169
7213
|
onContainerScroll(scrollPositionRef.current);
|
|
7170
7214
|
}, [onContainerScroll]);
|
|
7171
|
-
const applyScrollVertical = (0,
|
|
7215
|
+
const applyScrollVertical = (0, import_react36.useCallback)(({ scrollTop }) => {
|
|
7172
7216
|
scrollPositionRef.current.scrollTop = scrollTop;
|
|
7173
7217
|
onContainerScroll(scrollPositionRef.current);
|
|
7174
7218
|
if (scrollTop === 0) {
|
|
@@ -7190,17 +7234,17 @@ var useOnContainerScroll = ({
|
|
|
7190
7234
|
};
|
|
7191
7235
|
|
|
7192
7236
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
7193
|
-
var
|
|
7194
|
-
var
|
|
7237
|
+
var React30 = __toModule(require("react"));
|
|
7238
|
+
var import_react39 = __toModule(require("react"));
|
|
7195
7239
|
|
|
7196
7240
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
7197
|
-
var
|
|
7198
|
-
var
|
|
7241
|
+
var React29 = __toModule(require("react"));
|
|
7242
|
+
var import_react38 = __toModule(require("react"));
|
|
7199
7243
|
|
|
7200
7244
|
// src/components/hooks/useOnMount.ts
|
|
7201
|
-
var
|
|
7245
|
+
var import_react37 = __toModule(require("react"));
|
|
7202
7246
|
function useOnMount(domRef, props) {
|
|
7203
|
-
(0,
|
|
7247
|
+
(0, import_react37.useEffect)(() => {
|
|
7204
7248
|
const { onMount, onUnmount } = props;
|
|
7205
7249
|
const node = domRef == null ? void 0 : domRef.current;
|
|
7206
7250
|
onMount == null ? void 0 : onMount(node);
|
|
@@ -7231,8 +7275,8 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7231
7275
|
onMount,
|
|
7232
7276
|
onUnmount
|
|
7233
7277
|
} = props;
|
|
7234
|
-
const domRef = (0,
|
|
7235
|
-
const renderItem = (0,
|
|
7278
|
+
const domRef = (0, import_react38.useRef)(null);
|
|
7279
|
+
const renderItem = (0, import_react38.useCallback)((renderProps) => renderRow({
|
|
7236
7280
|
domRef: renderProps.domRef,
|
|
7237
7281
|
rowHeight: renderProps.itemSize,
|
|
7238
7282
|
rowIndex: renderProps.itemIndex
|
|
@@ -7241,7 +7285,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7241
7285
|
onMount,
|
|
7242
7286
|
onUnmount
|
|
7243
7287
|
});
|
|
7244
|
-
(0,
|
|
7288
|
+
(0, import_react38.useEffect)(() => {
|
|
7245
7289
|
const onScroll = (scrollPosition) => {
|
|
7246
7290
|
const node = domRef.current;
|
|
7247
7291
|
if (node) {
|
|
@@ -7270,7 +7314,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7270
7314
|
if (true) {
|
|
7271
7315
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
7272
7316
|
}
|
|
7273
|
-
return /* @__PURE__ */
|
|
7317
|
+
return /* @__PURE__ */ React29.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React29.createElement(RawList, {
|
|
7274
7318
|
brain,
|
|
7275
7319
|
renderItem,
|
|
7276
7320
|
repaintId
|
|
@@ -7293,7 +7337,7 @@ function PinnedRowsContainer(props) {
|
|
|
7293
7337
|
brain,
|
|
7294
7338
|
renderRow
|
|
7295
7339
|
} = props;
|
|
7296
|
-
const style =
|
|
7340
|
+
const style = React30.useMemo(() => {
|
|
7297
7341
|
const result = pinning === "end" ? {
|
|
7298
7342
|
width: rowWidth,
|
|
7299
7343
|
height,
|
|
@@ -7308,7 +7352,7 @@ function PinnedRowsContainer(props) {
|
|
|
7308
7352
|
}
|
|
7309
7353
|
return result;
|
|
7310
7354
|
}, [height, rowWidth, pinning, hasOverflow]);
|
|
7311
|
-
const updateScroll = (0,
|
|
7355
|
+
const updateScroll = (0, import_react39.useCallback)((node, scrollPosition) => {
|
|
7312
7356
|
UPDATE_SCROLL3(node, scrollPosition, hasOverflow ? pinnedScrollListener.getScrollPosition() : void 0);
|
|
7313
7357
|
}, [hasOverflow, pinnedScrollListener]);
|
|
7314
7358
|
const rowListProps = {
|
|
@@ -7319,7 +7363,7 @@ function PinnedRowsContainer(props) {
|
|
|
7319
7363
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
7320
7364
|
};
|
|
7321
7365
|
if (hasOverflow) {
|
|
7322
|
-
return /* @__PURE__ */
|
|
7366
|
+
return /* @__PURE__ */ React30.createElement(VirtualScrollContainer, {
|
|
7323
7367
|
scrollable: {
|
|
7324
7368
|
horizontal: true,
|
|
7325
7369
|
vertical: false
|
|
@@ -7335,23 +7379,23 @@ function PinnedRowsContainer(props) {
|
|
|
7335
7379
|
className: join(PinnedRowsContainerClsVariants({
|
|
7336
7380
|
pinned: pinning
|
|
7337
7381
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
7338
|
-
}, /* @__PURE__ */
|
|
7382
|
+
}, /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
7339
7383
|
onMount: (node) => {
|
|
7340
7384
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
7341
7385
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
7342
7386
|
});
|
|
7343
7387
|
}
|
|
7344
|
-
})), /* @__PURE__ */
|
|
7388
|
+
})), /* @__PURE__ */ React30.createElement(SpacePlaceholder, {
|
|
7345
7389
|
width: rowWidth,
|
|
7346
7390
|
height: 1
|
|
7347
7391
|
}));
|
|
7348
7392
|
}
|
|
7349
|
-
return /* @__PURE__ */
|
|
7393
|
+
return /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
7350
7394
|
}
|
|
7351
7395
|
function useRenderPinnedRow(params) {
|
|
7352
7396
|
const { getData, getState, columnsWidth, columns, rowSpan, verticalBrain } = params;
|
|
7353
7397
|
const dataArray = getData();
|
|
7354
|
-
const renderPinnedRow = (0,
|
|
7398
|
+
const renderPinnedRow = (0, import_react39.useCallback)((rowParams) => {
|
|
7355
7399
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
7356
7400
|
const { showZebraRows, showHoverRows } = getState();
|
|
7357
7401
|
const rowProps = __spreadValues({
|
|
@@ -7367,7 +7411,7 @@ function useRenderPinnedRow(params) {
|
|
|
7367
7411
|
rowWidth: columnsWidth,
|
|
7368
7412
|
columns
|
|
7369
7413
|
}, rowParams);
|
|
7370
|
-
return /* @__PURE__ */
|
|
7414
|
+
return /* @__PURE__ */ React30.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
7371
7415
|
}, [columnsWidth, columns, verticalBrain, dataArray]);
|
|
7372
7416
|
return renderPinnedRow;
|
|
7373
7417
|
}
|
|
@@ -7413,7 +7457,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7413
7457
|
columns,
|
|
7414
7458
|
columnsWidth
|
|
7415
7459
|
});
|
|
7416
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
7460
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React30.createElement(PinnedRowsContainer, {
|
|
7417
7461
|
pinning: side,
|
|
7418
7462
|
pinnedScrollListener,
|
|
7419
7463
|
hasOverflow,
|
|
@@ -7426,7 +7470,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7426
7470
|
brain: verticalVirtualBrain,
|
|
7427
7471
|
renderRow: renderRowPinned
|
|
7428
7472
|
}) : null;
|
|
7429
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
7473
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React30.createElement(HorizontalScrollbarPlaceholder, {
|
|
7430
7474
|
style: side === "end" ? {
|
|
7431
7475
|
width: columnsWidth,
|
|
7432
7476
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -7468,13 +7512,13 @@ function usePinnedStartRendering(params) {
|
|
|
7468
7512
|
}
|
|
7469
7513
|
|
|
7470
7514
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
7471
|
-
var
|
|
7515
|
+
var import_react41 = __toModule(require("react"));
|
|
7472
7516
|
|
|
7473
7517
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
7474
|
-
var
|
|
7518
|
+
var import_react40 = __toModule(require("react"));
|
|
7475
7519
|
var debug5 = dbg("useColumnSizeFn");
|
|
7476
7520
|
function useColumnSizeFn(computedUnpinnedColumns) {
|
|
7477
|
-
const columnSize = (0,
|
|
7521
|
+
const columnSize = (0, import_react40.useCallback)((index) => {
|
|
7478
7522
|
const column = computedUnpinnedColumns[index];
|
|
7479
7523
|
if (!column) {
|
|
7480
7524
|
debug5("cannot find column at index", index, computedUnpinnedColumns);
|
|
@@ -7504,13 +7548,13 @@ function useYourBrain(param) {
|
|
|
7504
7548
|
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
7505
7549
|
globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
|
|
7506
7550
|
}
|
|
7507
|
-
(0,
|
|
7551
|
+
(0, import_react41.useEffect)(() => {
|
|
7508
7552
|
verticalVirtualBrain.setAvailableSize({
|
|
7509
7553
|
height: bodySize.height,
|
|
7510
7554
|
width: 0
|
|
7511
7555
|
});
|
|
7512
7556
|
}, [bodySize, verticalVirtualBrain]);
|
|
7513
|
-
(0,
|
|
7557
|
+
(0, import_react41.useEffect)(() => {
|
|
7514
7558
|
horizontalVirtualBrain.setAvailableSize({
|
|
7515
7559
|
height: 0,
|
|
7516
7560
|
width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
|
|
@@ -7551,7 +7595,7 @@ function useListRendering(param) {
|
|
|
7551
7595
|
horizontalVirtualBrain
|
|
7552
7596
|
} = componentState;
|
|
7553
7597
|
const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
|
|
7554
|
-
const repaintIdRef = (0,
|
|
7598
|
+
const repaintIdRef = (0, import_react42.useRef)(0);
|
|
7555
7599
|
if (prevDataSourceTimestamp !== dataSourceState.updatedAt || !shallowEqualObjects(prevComputed, computed)) {
|
|
7556
7600
|
repaintIdRef.current++;
|
|
7557
7601
|
}
|
|
@@ -7570,11 +7614,11 @@ function useListRendering(param) {
|
|
|
7570
7614
|
const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
|
|
7571
7615
|
const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
|
|
7572
7616
|
const hasVerticalScrollbar = bodySize.height > 0 && bodySize.height < reservedContentHeight;
|
|
7573
|
-
const scrollbars = (0,
|
|
7617
|
+
const scrollbars = (0, import_react42.useMemo)(() => ({
|
|
7574
7618
|
vertical: hasVerticalScrollbar,
|
|
7575
7619
|
horizontal: hasHorizontalScrollbar
|
|
7576
7620
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
7577
|
-
(0,
|
|
7621
|
+
(0, import_react42.useEffect)(() => {
|
|
7578
7622
|
if (!bodySize.height) {
|
|
7579
7623
|
return;
|
|
7580
7624
|
}
|
|
@@ -7630,7 +7674,7 @@ function useListRendering(param) {
|
|
|
7630
7674
|
computedUnpinnedColumns
|
|
7631
7675
|
});
|
|
7632
7676
|
const [, rerender] = useRerender();
|
|
7633
|
-
(0,
|
|
7677
|
+
(0, import_react42.useEffect)(() => {
|
|
7634
7678
|
rerender();
|
|
7635
7679
|
}, [dataSourceState]);
|
|
7636
7680
|
const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
|
|
@@ -7653,8 +7697,8 @@ function useListRendering(param) {
|
|
|
7653
7697
|
}
|
|
7654
7698
|
|
|
7655
7699
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7656
|
-
var
|
|
7657
|
-
var
|
|
7700
|
+
var React31 = __toModule(require("react"));
|
|
7701
|
+
var import_react43 = __toModule(require("react"));
|
|
7658
7702
|
|
|
7659
7703
|
// src/components/utils/decamelize.ts
|
|
7660
7704
|
function decamelize(str, options) {
|
|
@@ -7689,10 +7733,10 @@ var enforceStyle = (node, style) => {
|
|
|
7689
7733
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
7690
7734
|
}
|
|
7691
7735
|
};
|
|
7692
|
-
var InfiniteTableLicenseFooter =
|
|
7736
|
+
var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7693
7737
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7694
|
-
const domRef =
|
|
7695
|
-
const domCallback =
|
|
7738
|
+
const domRef = React31.useRef(null);
|
|
7739
|
+
const domCallback = React31.useCallback((node) => {
|
|
7696
7740
|
domRef.current = node;
|
|
7697
7741
|
if (!ref) {
|
|
7698
7742
|
return;
|
|
@@ -7703,7 +7747,7 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7703
7747
|
ref.current = node;
|
|
7704
7748
|
}
|
|
7705
7749
|
}, []);
|
|
7706
|
-
(0,
|
|
7750
|
+
(0, import_react43.useEffect)(() => {
|
|
7707
7751
|
const forceStyle = () => {
|
|
7708
7752
|
requestAnimationFrame(() => {
|
|
7709
7753
|
var _a;
|
|
@@ -7717,12 +7761,12 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7717
7761
|
clearInterval(intervalId);
|
|
7718
7762
|
};
|
|
7719
7763
|
}, []);
|
|
7720
|
-
return /* @__PURE__ */
|
|
7764
|
+
return /* @__PURE__ */ React31.createElement("div", __spreadProps(__spreadValues({
|
|
7721
7765
|
ref: domCallback
|
|
7722
7766
|
}, props), {
|
|
7723
7767
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7724
7768
|
style: defaultStyle2
|
|
7725
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7769
|
+
}), "Powered by", " ", /* @__PURE__ */ React31.createElement("a", {
|
|
7726
7770
|
href: "https://infinite-table.com",
|
|
7727
7771
|
rel: "noopener noreferrer",
|
|
7728
7772
|
role: "link",
|
|
@@ -7731,7 +7775,7 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7731
7775
|
});
|
|
7732
7776
|
|
|
7733
7777
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
7734
|
-
var
|
|
7778
|
+
var import_react44 = __toModule(require("react"));
|
|
7735
7779
|
|
|
7736
7780
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
7737
7781
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -7889,10 +7933,10 @@ var isInsideSandbox = () => {
|
|
|
7889
7933
|
};
|
|
7890
7934
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
7891
7935
|
var useLicense = (licenseKey = "") => {
|
|
7892
|
-
const valid = (0,
|
|
7936
|
+
const valid = (0, import_react44.useMemo)(() => {
|
|
7893
7937
|
let valid2 = isValidLicense(licenseKey, {
|
|
7894
7938
|
publishedAt: 1624970570587,
|
|
7895
|
-
version: "0.2.
|
|
7939
|
+
version: "0.2.18"
|
|
7896
7940
|
});
|
|
7897
7941
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
7898
7942
|
return true;
|
|
@@ -7903,8 +7947,8 @@ var useLicense = (licenseKey = "") => {
|
|
|
7903
7947
|
};
|
|
7904
7948
|
|
|
7905
7949
|
// src/components/CSSVariableWatch.tsx
|
|
7906
|
-
var
|
|
7907
|
-
var
|
|
7950
|
+
var React32 = __toModule(require("react"));
|
|
7951
|
+
var import_react45 = __toModule(require("react"));
|
|
7908
7952
|
var error = err("CSSVariableWatch");
|
|
7909
7953
|
var debug6 = dbg("CSSVariableWatch");
|
|
7910
7954
|
var WRAPPER_STYLE = {
|
|
@@ -7917,15 +7961,15 @@ var WRAPPER_STYLE = {
|
|
|
7917
7961
|
overflow: "hidden"
|
|
7918
7962
|
};
|
|
7919
7963
|
var useCSSVariableWatch = (params) => {
|
|
7920
|
-
const lastValueRef = (0,
|
|
7921
|
-
const onResize =
|
|
7964
|
+
const lastValueRef = (0, import_react45.useRef)(0);
|
|
7965
|
+
const onResize = React32.useCallback(({ height }) => {
|
|
7922
7966
|
if (height && height !== lastValueRef.current) {
|
|
7923
7967
|
lastValueRef.current = height;
|
|
7924
7968
|
params.onChange(height);
|
|
7925
7969
|
}
|
|
7926
7970
|
}, [params.onChange]);
|
|
7927
7971
|
useResizeObserver(params.ref, onResize, { earlyAttach: true });
|
|
7928
|
-
|
|
7972
|
+
React32.useLayoutEffect(() => {
|
|
7929
7973
|
const value = params.ref.current.getBoundingClientRect().height;
|
|
7930
7974
|
if (value) {
|
|
7931
7975
|
lastValueRef.current = value;
|
|
@@ -7937,15 +7981,15 @@ var useCSSVariableWatch = (params) => {
|
|
|
7937
7981
|
}, []);
|
|
7938
7982
|
};
|
|
7939
7983
|
var CSSVariableWatch = (props) => {
|
|
7940
|
-
const domRef = (0,
|
|
7984
|
+
const domRef = (0, import_react45.useRef)(null);
|
|
7941
7985
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7942
7986
|
ref: domRef
|
|
7943
7987
|
}));
|
|
7944
|
-
return /* @__PURE__ */
|
|
7988
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
7945
7989
|
"data-name": "css-variable-watcher",
|
|
7946
7990
|
"data-var": props.varName,
|
|
7947
7991
|
style: WRAPPER_STYLE
|
|
7948
|
-
}, /* @__PURE__ */
|
|
7992
|
+
}, /* @__PURE__ */ React32.createElement("div", {
|
|
7949
7993
|
ref: domRef,
|
|
7950
7994
|
style: {
|
|
7951
7995
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -8038,7 +8082,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
8038
8082
|
}
|
|
8039
8083
|
|
|
8040
8084
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
8041
|
-
var
|
|
8085
|
+
var React33 = __toModule(require("react"));
|
|
8042
8086
|
|
|
8043
8087
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
8044
8088
|
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
@@ -8050,18 +8094,18 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
8050
8094
|
var baseCls = `${rootClassName11}-LoadMask`;
|
|
8051
8095
|
function LoadMaskFn(props) {
|
|
8052
8096
|
const { visible, children = "Loading" } = props;
|
|
8053
|
-
return /* @__PURE__ */
|
|
8097
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
8054
8098
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls}`
|
|
8055
|
-
}, /* @__PURE__ */
|
|
8099
|
+
}, /* @__PURE__ */ React33.createElement("div", {
|
|
8056
8100
|
className: `${LoadMaskOverlayCls} ${baseCls}-Overlay`
|
|
8057
|
-
}), /* @__PURE__ */
|
|
8101
|
+
}), /* @__PURE__ */ React33.createElement("div", {
|
|
8058
8102
|
className: `${LoadMaskTextCls} ${baseCls}-Text`
|
|
8059
8103
|
}, children));
|
|
8060
8104
|
}
|
|
8061
|
-
var LoadMask =
|
|
8105
|
+
var LoadMask = React33.memo(LoadMaskFn);
|
|
8062
8106
|
|
|
8063
8107
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
8064
|
-
var
|
|
8108
|
+
var import_react46 = __toModule(require("react"));
|
|
8065
8109
|
var OFFSET = 10;
|
|
8066
8110
|
function getColumnContentMaxWidths(domRef, options) {
|
|
8067
8111
|
var _a;
|
|
@@ -8126,11 +8170,11 @@ function useAutoSizeColumns() {
|
|
|
8126
8170
|
horizontalVirtualBrain
|
|
8127
8171
|
}
|
|
8128
8172
|
} = useComponentState();
|
|
8129
|
-
const [refreshId, setRefreshId] = (0,
|
|
8173
|
+
const [refreshId, setRefreshId] = (0, import_react46.useState)(0);
|
|
8130
8174
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
8131
8175
|
const getTheKey = useLatest(theKey);
|
|
8132
|
-
const lastExecutedIdentifierRef = (0,
|
|
8133
|
-
(0,
|
|
8176
|
+
const lastExecutedIdentifierRef = (0, import_react46.useRef)(null);
|
|
8177
|
+
(0, import_react46.useEffect)(() => {
|
|
8134
8178
|
const key = getTheKey();
|
|
8135
8179
|
if (key == null) {
|
|
8136
8180
|
return;
|
|
@@ -8148,7 +8192,7 @@ function useAutoSizeColumns() {
|
|
|
8148
8192
|
removeHorizontal();
|
|
8149
8193
|
};
|
|
8150
8194
|
}, [verticalVirtualBrain, horizontalVirtualBrain]);
|
|
8151
|
-
(0,
|
|
8195
|
+
(0, import_react46.useEffect)(() => {
|
|
8152
8196
|
var _a;
|
|
8153
8197
|
if (theKey == null) {
|
|
8154
8198
|
return;
|
|
@@ -8209,7 +8253,7 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
8209
8253
|
getParentState: () => useDataSource(),
|
|
8210
8254
|
debugName: "InfiniteTable"
|
|
8211
8255
|
});
|
|
8212
|
-
var InfiniteTableComponent =
|
|
8256
|
+
var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
|
|
8213
8257
|
var _a;
|
|
8214
8258
|
const {
|
|
8215
8259
|
componentState,
|
|
@@ -8256,7 +8300,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
8256
8300
|
bodySize,
|
|
8257
8301
|
computed
|
|
8258
8302
|
});
|
|
8259
|
-
|
|
8303
|
+
React34.useEffect(() => {
|
|
8260
8304
|
const dataSourceState = getDataSourceState();
|
|
8261
8305
|
const onChange = debounce((renderRange) => {
|
|
8262
8306
|
dataSourceState.notifyRenderRangeChange(renderRange);
|
|
@@ -8266,7 +8310,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
8266
8310
|
const licenseValid = useLicense(licenseKey);
|
|
8267
8311
|
const domProps = useDOMProps(componentState.domProps);
|
|
8268
8312
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
8269
|
-
|
|
8313
|
+
React34.useLayoutEffect(() => {
|
|
8270
8314
|
const dataSourceState = getDataSourceState();
|
|
8271
8315
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
8272
8316
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -8275,35 +8319,35 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
8275
8319
|
}
|
|
8276
8320
|
notifyScrollbarsChange(scrollbars);
|
|
8277
8321
|
}, [scrollbars]);
|
|
8278
|
-
|
|
8322
|
+
React34.useEffect(() => {
|
|
8279
8323
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
8280
8324
|
}, [scrollStopDelay]);
|
|
8281
8325
|
useAutoSizeColumns();
|
|
8282
|
-
return /* @__PURE__ */
|
|
8326
|
+
return /* @__PURE__ */ React34.createElement("div", __spreadValues({
|
|
8283
8327
|
ref: domRef
|
|
8284
|
-
}, domProps), header ? /* @__PURE__ */
|
|
8328
|
+
}, domProps), header ? /* @__PURE__ */ React34.createElement(TableHeaderWrapper, {
|
|
8285
8329
|
brain: horizontalVirtualBrain,
|
|
8286
8330
|
repaintId,
|
|
8287
8331
|
scrollbars
|
|
8288
|
-
}) : null, /* @__PURE__ */
|
|
8332
|
+
}) : null, /* @__PURE__ */ React34.createElement(InfiniteTableBody, null, /* @__PURE__ */ React34.createElement(VirtualScrollContainer, {
|
|
8289
8333
|
ref: scrollerDOMRef,
|
|
8290
8334
|
onContainerScroll: applyScrollVertical,
|
|
8291
8335
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
8292
|
-
}, /* @__PURE__ */
|
|
8336
|
+
}, /* @__PURE__ */ React34.createElement("div", {
|
|
8293
8337
|
className: display.flex
|
|
8294
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
8338
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React34.createElement(SpacePlaceholder, {
|
|
8295
8339
|
count: dataArray.length,
|
|
8296
8340
|
width: 0,
|
|
8297
8341
|
height: reservedContentHeight
|
|
8298
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
8342
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React34.createElement(LoadMaskCmp, {
|
|
8299
8343
|
visible: loading
|
|
8300
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
8344
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ React34.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React34.createElement("div", {
|
|
8301
8345
|
ref: portalDOMRef,
|
|
8302
8346
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
8303
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
8347
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
|
|
8304
8348
|
varName: rowHeightCSSVar,
|
|
8305
8349
|
onChange: onRowHeightCSSVarChange
|
|
8306
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
8350
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
|
|
8307
8351
|
varName: headerHeightCSSVar,
|
|
8308
8352
|
onChange: onHeaderHeightCSSVarChange
|
|
8309
8353
|
}) : null);
|
|
@@ -8339,25 +8383,25 @@ function InfiniteTableContextProvider() {
|
|
|
8339
8383
|
}
|
|
8340
8384
|
componentActions.bodySize = bodySize;
|
|
8341
8385
|
}, { earlyAttach: true });
|
|
8342
|
-
|
|
8386
|
+
React34.useEffect(() => {
|
|
8343
8387
|
return () => {
|
|
8344
8388
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
8345
8389
|
componentState.onHeaderHeightCSSVarChange.destroy();
|
|
8346
8390
|
};
|
|
8347
8391
|
}, []);
|
|
8348
|
-
|
|
8392
|
+
React34.useEffect(() => {
|
|
8349
8393
|
if (scrollerDOMRef.current) {
|
|
8350
8394
|
scrollerDOMRef.current.scrollTop = 0;
|
|
8351
8395
|
}
|
|
8352
8396
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
8353
8397
|
const TableContext2 = getInfiniteTableContext();
|
|
8354
|
-
return /* @__PURE__ */
|
|
8398
|
+
return /* @__PURE__ */ React34.createElement(TableContext2.Provider, {
|
|
8355
8399
|
value: contextValue
|
|
8356
|
-
}, /* @__PURE__ */
|
|
8400
|
+
}, /* @__PURE__ */ React34.createElement(InfiniteTableComponent, null));
|
|
8357
8401
|
}
|
|
8358
8402
|
function InfiniteTable(props) {
|
|
8359
|
-
const table = /* @__PURE__ */
|
|
8360
|
-
return /* @__PURE__ */
|
|
8403
|
+
const table = /* @__PURE__ */ React34.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React34.createElement(InfiniteTableContextProvider, null));
|
|
8404
|
+
return /* @__PURE__ */ React34.createElement(React34.StrictMode, null, table);
|
|
8361
8405
|
}
|
|
8362
8406
|
InfiniteTable.defaultProps = {
|
|
8363
8407
|
rowHeight: 40,
|