@infinite-table/infinite-react 0.2.16 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +4 -0
- package/index.esm.js +309 -273
- package/index.js +377 -338
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -633,9 +633,9 @@ function debounce(fn, { wait }) {
|
|
|
633
633
|
// src/components/InfiniteTable/index.tsx
|
|
634
634
|
import {
|
|
635
635
|
StrictMode,
|
|
636
|
-
createElement as
|
|
636
|
+
createElement as createElement32,
|
|
637
637
|
memo as memo13,
|
|
638
|
-
useEffect as
|
|
638
|
+
useEffect as useEffect26,
|
|
639
639
|
useLayoutEffect as useLayoutEffect5
|
|
640
640
|
} from "react";
|
|
641
641
|
|
|
@@ -1289,7 +1289,7 @@ var forwardProps = (setupState) => {
|
|
|
1289
1289
|
pivotColumnGroups: 1,
|
|
1290
1290
|
onScrollbarsChange: 1,
|
|
1291
1291
|
autoSizeColumnsKey: 1,
|
|
1292
|
-
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay :
|
|
1292
|
+
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
1293
1293
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
1294
1294
|
activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
|
|
1295
1295
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
@@ -1301,6 +1301,7 @@ var forwardProps = (setupState) => {
|
|
|
1301
1301
|
sortable: (sortable) => sortable != null ? sortable : true,
|
|
1302
1302
|
hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
|
|
1303
1303
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
1304
|
+
pivotGrandTotalColumnPosition: 1,
|
|
1304
1305
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
1305
1306
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
1306
1307
|
header: (header) => header != null ? header : true,
|
|
@@ -2143,7 +2144,7 @@ var useComputedVisibleColumns = ({
|
|
|
2143
2144
|
var sortAscending = (a, b) => a - b;
|
|
2144
2145
|
|
|
2145
2146
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
2146
|
-
import { useCallback as useCallback5, useEffect as
|
|
2147
|
+
import { useCallback as useCallback5, useEffect as useEffect11, useMemo as useMemo6, useState as useState5 } from "react";
|
|
2147
2148
|
|
|
2148
2149
|
// src/components/hooks/useComponentState/index.tsx
|
|
2149
2150
|
import {
|
|
@@ -2542,11 +2543,11 @@ function useColumnGroups() {
|
|
|
2542
2543
|
}
|
|
2543
2544
|
|
|
2544
2545
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2545
|
-
import { useEffect as
|
|
2546
|
+
import { useEffect as useEffect10, useMemo as useMemo5 } from "react";
|
|
2546
2547
|
|
|
2547
2548
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2548
2549
|
import {
|
|
2549
|
-
createElement as
|
|
2550
|
+
createElement as createElement4
|
|
2550
2551
|
} from "react";
|
|
2551
2552
|
|
|
2552
2553
|
// src/utils/join.ts
|
|
@@ -2622,12 +2623,8 @@ var willChange = { transform: "_16lm1iw19" };
|
|
|
2622
2623
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2623
2624
|
|
|
2624
2625
|
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
2625
|
-
import {
|
|
2626
|
-
Fragment,
|
|
2627
|
-
createElement as createElement4
|
|
2628
|
-
} from "react";
|
|
2629
2626
|
function RenderHookComponent(props) {
|
|
2630
|
-
return
|
|
2627
|
+
return props.render(props.renderParam);
|
|
2631
2628
|
}
|
|
2632
2629
|
|
|
2633
2630
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
@@ -2640,7 +2637,7 @@ function getGroupColumnRender({
|
|
|
2640
2637
|
var _a, _b, _c;
|
|
2641
2638
|
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2642
2639
|
if (column.renderValue) {
|
|
2643
|
-
value = /* @__PURE__ */
|
|
2640
|
+
value = /* @__PURE__ */ createElement4(RenderHookComponent, {
|
|
2644
2641
|
render: column.renderValue,
|
|
2645
2642
|
renderParam: renderOptions
|
|
2646
2643
|
});
|
|
@@ -2669,20 +2666,20 @@ function getGroupColumnRender({
|
|
|
2669
2666
|
let icon = null;
|
|
2670
2667
|
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);
|
|
2671
2668
|
if (showExpanderIcon) {
|
|
2672
|
-
const defaultIcon = /* @__PURE__ */
|
|
2669
|
+
const defaultIcon = /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2673
2670
|
expanded: !collapsed,
|
|
2674
2671
|
onChange: () => {
|
|
2675
2672
|
toggleGroupRow(groupKeys);
|
|
2676
2673
|
}
|
|
2677
2674
|
});
|
|
2678
|
-
icon = column.renderGroupIcon ? /* @__PURE__ */
|
|
2675
|
+
icon = column.renderGroupIcon ? /* @__PURE__ */ createElement4(RenderHookComponent, {
|
|
2679
2676
|
render: column.renderGroupIcon,
|
|
2680
2677
|
renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
|
|
2681
2678
|
}) : defaultIcon;
|
|
2682
2679
|
}
|
|
2683
|
-
return /* @__PURE__ */
|
|
2680
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2684
2681
|
className: join(display.flex, alignItems.center)
|
|
2685
|
-
}, icon, /* @__PURE__ */
|
|
2682
|
+
}, icon, /* @__PURE__ */ createElement4("div", {
|
|
2686
2683
|
className: cssEllipsisClassName
|
|
2687
2684
|
}, value != null ? value : null));
|
|
2688
2685
|
};
|
|
@@ -2730,7 +2727,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2730
2727
|
let icon = null;
|
|
2731
2728
|
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);
|
|
2732
2729
|
if (showExpanderIcon) {
|
|
2733
|
-
const defaultIcon = /* @__PURE__ */
|
|
2730
|
+
const defaultIcon = /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2734
2731
|
expanded: !collapsed,
|
|
2735
2732
|
onChange: () => {
|
|
2736
2733
|
toggleGroupRow(rowInfo.groupKeys);
|
|
@@ -2738,9 +2735,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2738
2735
|
});
|
|
2739
2736
|
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2740
2737
|
}
|
|
2741
|
-
return /* @__PURE__ */
|
|
2738
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2742
2739
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2743
|
-
}, icon, /* @__PURE__ */
|
|
2740
|
+
}, icon, /* @__PURE__ */ createElement4("div", {
|
|
2744
2741
|
className: cssEllipsisClassName
|
|
2745
2742
|
}, value != null ? value : null));
|
|
2746
2743
|
}
|
|
@@ -2755,13 +2752,34 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2755
2752
|
return generatedGroupColumn;
|
|
2756
2753
|
}
|
|
2757
2754
|
|
|
2755
|
+
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
2756
|
+
import { useEffect as useEffect7, useRef as useRef5 } from "react";
|
|
2757
|
+
function useEffectWithRaf(fn, deps) {
|
|
2758
|
+
const rafId = useRef5(0);
|
|
2759
|
+
const removeFnRaf = useRef5();
|
|
2760
|
+
useEffect7(() => {
|
|
2761
|
+
rafId.current = requestAnimationFrame(() => {
|
|
2762
|
+
removeFnRaf.current = fn();
|
|
2763
|
+
});
|
|
2764
|
+
return () => {
|
|
2765
|
+
if (rafId.current) {
|
|
2766
|
+
cancelAnimationFrame(rafId.current);
|
|
2767
|
+
}
|
|
2768
|
+
if (typeof removeFnRaf.current === "function") {
|
|
2769
|
+
removeFnRaf.current();
|
|
2770
|
+
removeFnRaf.current = void 0;
|
|
2771
|
+
}
|
|
2772
|
+
};
|
|
2773
|
+
}, deps);
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2758
2776
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
2759
2777
|
import { useCallback as useCallback4 } from "react";
|
|
2760
2778
|
|
|
2761
2779
|
// src/components/DataSource/index.tsx
|
|
2762
2780
|
import {
|
|
2763
|
-
Fragment
|
|
2764
|
-
createElement as
|
|
2781
|
+
Fragment,
|
|
2782
|
+
createElement as createElement5
|
|
2765
2783
|
} from "react";
|
|
2766
2784
|
|
|
2767
2785
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -2839,7 +2857,7 @@ var getMultisortFunction = (sortInfo, get) => {
|
|
|
2839
2857
|
};
|
|
2840
2858
|
|
|
2841
2859
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
2842
|
-
import { useEffect as
|
|
2860
|
+
import { useEffect as useEffect9, useMemo as useMemo4, useRef as useRef7, useState as useState4 } from "react";
|
|
2843
2861
|
|
|
2844
2862
|
// src/utils/DeepMap/once.ts
|
|
2845
2863
|
function once(fn) {
|
|
@@ -2925,14 +2943,13 @@ var DeepMap = class {
|
|
|
2925
2943
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2926
2944
|
const key = keys[i];
|
|
2927
2945
|
const last = i === len - 1;
|
|
2946
|
+
const pair = currentMap.get(key) || {};
|
|
2928
2947
|
if (last) {
|
|
2929
|
-
const pair = currentMap.has(key) ? currentMap.get(key) : {};
|
|
2930
2948
|
pair.revision = this.revision++;
|
|
2931
2949
|
pair.value = value;
|
|
2932
2950
|
currentMap.set(key, pair);
|
|
2933
2951
|
this.length++;
|
|
2934
2952
|
} else {
|
|
2935
|
-
const pair = currentMap.has(key) ? currentMap.get(key) : {};
|
|
2936
2953
|
if (!pair.map) {
|
|
2937
2954
|
pair.map = new Map();
|
|
2938
2955
|
currentMap.set(key, pair);
|
|
@@ -2943,7 +2960,6 @@ var DeepMap = class {
|
|
|
2943
2960
|
return this;
|
|
2944
2961
|
}
|
|
2945
2962
|
get(keys) {
|
|
2946
|
-
var _a;
|
|
2947
2963
|
let currentMap = this.map;
|
|
2948
2964
|
if (!keys.length) {
|
|
2949
2965
|
keys = [this.emptyKey];
|
|
@@ -2951,10 +2967,10 @@ var DeepMap = class {
|
|
|
2951
2967
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2952
2968
|
const key = keys[i];
|
|
2953
2969
|
const last = i === len - 1;
|
|
2970
|
+
const pair = currentMap.get(key);
|
|
2954
2971
|
if (last) {
|
|
2955
|
-
return
|
|
2972
|
+
return pair ? pair.value : void 0;
|
|
2956
2973
|
} else {
|
|
2957
|
-
const pair = currentMap.get(key);
|
|
2958
2974
|
if (!pair || !pair.map) {
|
|
2959
2975
|
return;
|
|
2960
2976
|
}
|
|
@@ -2992,8 +3008,8 @@ var DeepMap = class {
|
|
|
2992
3008
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2993
3009
|
const key = keys[i];
|
|
2994
3010
|
const last = i === len - 1;
|
|
3011
|
+
const pair = currentMap.get(key);
|
|
2995
3012
|
if (last) {
|
|
2996
|
-
const pair = currentMap.get(key);
|
|
2997
3013
|
if (pair) {
|
|
2998
3014
|
if (pair.hasOwnProperty("value")) {
|
|
2999
3015
|
delete pair.value;
|
|
@@ -3010,7 +3026,6 @@ var DeepMap = class {
|
|
|
3010
3026
|
}
|
|
3011
3027
|
break;
|
|
3012
3028
|
} else {
|
|
3013
|
-
const pair = currentMap.get(key);
|
|
3014
3029
|
if (!pair || !pair.map) {
|
|
3015
3030
|
result = false;
|
|
3016
3031
|
break;
|
|
@@ -3020,11 +3035,11 @@ var DeepMap = class {
|
|
|
3020
3035
|
}
|
|
3021
3036
|
}
|
|
3022
3037
|
while (maps.length) {
|
|
3023
|
-
|
|
3024
|
-
|
|
3038
|
+
const map2 = maps.pop();
|
|
3039
|
+
const key = keys.pop();
|
|
3025
3040
|
if (key && (map2 == null ? void 0 : map2.size) === 0) {
|
|
3026
|
-
|
|
3027
|
-
|
|
3041
|
+
const parentMap = maps[maps.length - 1];
|
|
3042
|
+
const pair = parentMap == null ? void 0 : parentMap.get(key);
|
|
3028
3043
|
if (pair) {
|
|
3029
3044
|
delete pair.map;
|
|
3030
3045
|
if (!pair.hasOwnProperty("value")) {
|
|
@@ -3043,11 +3058,10 @@ var DeepMap = class {
|
|
|
3043
3058
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
3044
3059
|
const key = keys[i];
|
|
3045
3060
|
const last = i === len - 1;
|
|
3061
|
+
const pair = currentMap.get(key);
|
|
3046
3062
|
if (last) {
|
|
3047
|
-
|
|
3048
|
-
return !!pair && pair.hasOwnProperty("value");
|
|
3063
|
+
return pair ? pair.hasOwnProperty("value") : false;
|
|
3049
3064
|
} else {
|
|
3050
|
-
const pair = currentMap.get(key);
|
|
3051
3065
|
if (!pair || !pair.map) {
|
|
3052
3066
|
return false;
|
|
3053
3067
|
}
|
|
@@ -3515,12 +3529,12 @@ function enhancedFlatten(param) {
|
|
|
3515
3529
|
}
|
|
3516
3530
|
|
|
3517
3531
|
// src/components/hooks/useEffectWithChanges.ts
|
|
3518
|
-
import { useEffect as
|
|
3532
|
+
import { useEffect as useEffect8, useRef as useRef6 } from "react";
|
|
3519
3533
|
function useEffectWithChanges(fn, deps) {
|
|
3520
|
-
const prevRef =
|
|
3521
|
-
const oldValuesRef =
|
|
3534
|
+
const prevRef = useRef6({});
|
|
3535
|
+
const oldValuesRef = useRef6({});
|
|
3522
3536
|
const oldValues = oldValuesRef.current;
|
|
3523
|
-
const changesRef =
|
|
3537
|
+
const changesRef = useRef6({});
|
|
3524
3538
|
const changes = changesRef.current;
|
|
3525
3539
|
const useEffectDeps = [];
|
|
3526
3540
|
for (let k in deps) {
|
|
@@ -3533,7 +3547,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
3533
3547
|
}
|
|
3534
3548
|
}
|
|
3535
3549
|
prevRef.current = deps;
|
|
3536
|
-
|
|
3550
|
+
useEffect8(() => {
|
|
3537
3551
|
const changes2 = changesRef.current;
|
|
3538
3552
|
const result = fn(changes2, oldValues);
|
|
3539
3553
|
changesRef.current = {};
|
|
@@ -3705,8 +3719,8 @@ function useLoadData() {
|
|
|
3705
3719
|
vertical: false,
|
|
3706
3720
|
horizontal: false
|
|
3707
3721
|
});
|
|
3708
|
-
const scrollbarsRef =
|
|
3709
|
-
|
|
3722
|
+
const scrollbarsRef = useRef7(scrollbars);
|
|
3723
|
+
useEffect9(() => {
|
|
3710
3724
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
3711
3725
|
if (!scrollbars2) {
|
|
3712
3726
|
return;
|
|
@@ -3716,7 +3730,7 @@ function useLoadData() {
|
|
|
3716
3730
|
});
|
|
3717
3731
|
return () => notifyScrollbarsChange.destroy();
|
|
3718
3732
|
}, [notifyScrollbarsChange]);
|
|
3719
|
-
|
|
3733
|
+
useEffect9(() => {
|
|
3720
3734
|
const frameId = requestAnimationFrame(() => {
|
|
3721
3735
|
var _a;
|
|
3722
3736
|
if (!((_a = scrollbarsRef.current) == null ? void 0 : _a.vertical) && livePaginationCursor) {
|
|
@@ -3725,7 +3739,7 @@ function useLoadData() {
|
|
|
3725
3739
|
});
|
|
3726
3740
|
return () => cancelAnimationFrame(frameId);
|
|
3727
3741
|
}, [livePaginationCursor]);
|
|
3728
|
-
|
|
3742
|
+
useEffect9(() => {
|
|
3729
3743
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2 } = getComponentState();
|
|
3730
3744
|
if (!scrollbars.vertical && livePagination2) {
|
|
3731
3745
|
if (livePaginationCursor2) {
|
|
@@ -3739,7 +3753,7 @@ function useLoadData() {
|
|
|
3739
3753
|
pivotBy,
|
|
3740
3754
|
cursorId: livePagination ? stateCursorId : null
|
|
3741
3755
|
};
|
|
3742
|
-
const initialRef =
|
|
3756
|
+
const initialRef = useRef7(true);
|
|
3743
3757
|
useLazyLoadRange();
|
|
3744
3758
|
useEffectWithChanges(() => {
|
|
3745
3759
|
const componentState2 = getComponentState();
|
|
@@ -3777,7 +3791,7 @@ function useLazyLoadRange() {
|
|
|
3777
3791
|
dataArray,
|
|
3778
3792
|
scrollStopDelayUpdatedByTable
|
|
3779
3793
|
} = componentState;
|
|
3780
|
-
const latestRenderRangeRef =
|
|
3794
|
+
const latestRenderRangeRef = useRef7(null);
|
|
3781
3795
|
const loadRange = (renderRange, cache = loadingCache) => {
|
|
3782
3796
|
const componentState2 = getComponentState();
|
|
3783
3797
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -3797,7 +3811,7 @@ function useLazyLoadRange() {
|
|
|
3797
3811
|
}, cache);
|
|
3798
3812
|
};
|
|
3799
3813
|
const debouncedLoadRange = useMemo4(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
3800
|
-
|
|
3814
|
+
useEffect9(() => {
|
|
3801
3815
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3802
3816
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
3803
3817
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -3806,7 +3820,7 @@ function useLazyLoadRange() {
|
|
|
3806
3820
|
}
|
|
3807
3821
|
return;
|
|
3808
3822
|
}, [lazyLoadBatchSize, loadingCache]);
|
|
3809
|
-
|
|
3823
|
+
useEffect9(() => {
|
|
3810
3824
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3811
3825
|
debouncedLoadRange();
|
|
3812
3826
|
}
|
|
@@ -3874,11 +3888,7 @@ function lazyLoadRange(options, cache) {
|
|
|
3874
3888
|
}
|
|
3875
3889
|
cache == null ? void 0 : cache.set(cacheKey, true);
|
|
3876
3890
|
const args = [componentState.data, componentState, componentActions, fnCall];
|
|
3877
|
-
return promise.then(() => getRafPromise()).then(() => loadData(...args))
|
|
3878
|
-
requestAnimationFrame(() => {
|
|
3879
|
-
cache == null ? void 0 : cache.delete(cacheKey);
|
|
3880
|
-
});
|
|
3881
|
-
});
|
|
3891
|
+
return promise.then(() => getRafPromise()).then(() => loadData(...args));
|
|
3882
3892
|
}, initialPromise);
|
|
3883
3893
|
}
|
|
3884
3894
|
|
|
@@ -4082,6 +4092,7 @@ function initSetupState2() {
|
|
|
4082
4092
|
notifyScrollStop: buildSubscriptionCallback(),
|
|
4083
4093
|
notifyRenderRangeChange: buildSubscriptionCallback(),
|
|
4084
4094
|
pivotTotalColumnPosition: "end",
|
|
4095
|
+
pivotGrandTotalColumnPosition: false,
|
|
4085
4096
|
scrollStopDelayUpdatedByTable: 100,
|
|
4086
4097
|
originalLazyGroupData,
|
|
4087
4098
|
originalLazyGroupDataChangeDetect: 0,
|
|
@@ -4269,6 +4280,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4269
4280
|
deepMap,
|
|
4270
4281
|
pivotBy,
|
|
4271
4282
|
pivotTotalColumnPosition,
|
|
4283
|
+
pivotGrandTotalColumnPosition,
|
|
4272
4284
|
reducers = {},
|
|
4273
4285
|
showSeparatePivotColumnForSingleAggregation = false
|
|
4274
4286
|
}) {
|
|
@@ -4278,6 +4290,28 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4278
4290
|
});
|
|
4279
4291
|
const columns = new Map([]);
|
|
4280
4292
|
const columnGroups = new Map();
|
|
4293
|
+
const addGrandTotalColumns = once(function() {
|
|
4294
|
+
aggregationReducers.forEach((reducer, index) => {
|
|
4295
|
+
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4296
|
+
header: `${reducer.name || reducer.id} total`,
|
|
4297
|
+
pivotBy,
|
|
4298
|
+
pivotColumn: true,
|
|
4299
|
+
pivotTotalColumn: true,
|
|
4300
|
+
pivotAggregator: reducer,
|
|
4301
|
+
pivotAggregatorIndex: index,
|
|
4302
|
+
pivotGroupKeys: [],
|
|
4303
|
+
pivotGroupKey: "",
|
|
4304
|
+
pivotIndex: -1,
|
|
4305
|
+
valueGetter: ({ rowInfo }) => {
|
|
4306
|
+
var _a;
|
|
4307
|
+
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
|
|
4308
|
+
}
|
|
4309
|
+
}));
|
|
4310
|
+
});
|
|
4311
|
+
});
|
|
4312
|
+
if (!pivotLength && pivotTotalColumnPosition === "start" || pivotGrandTotalColumnPosition === "start") {
|
|
4313
|
+
addGrandTotalColumns();
|
|
4314
|
+
}
|
|
4281
4315
|
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
4282
4316
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
4283
4317
|
keys = [...keys];
|
|
@@ -4382,24 +4416,8 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4382
4416
|
next == null ? void 0 : next();
|
|
4383
4417
|
}
|
|
4384
4418
|
});
|
|
4385
|
-
if (!pivotLength) {
|
|
4386
|
-
|
|
4387
|
-
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4388
|
-
header: `${reducer.name || reducer.id} total`,
|
|
4389
|
-
pivotBy,
|
|
4390
|
-
pivotColumn: true,
|
|
4391
|
-
pivotTotalColumn: true,
|
|
4392
|
-
pivotAggregator: reducer,
|
|
4393
|
-
pivotAggregatorIndex: index,
|
|
4394
|
-
pivotGroupKeys: [],
|
|
4395
|
-
pivotGroupKey: "",
|
|
4396
|
-
pivotIndex: -1,
|
|
4397
|
-
valueGetter: ({ rowInfo }) => {
|
|
4398
|
-
var _a;
|
|
4399
|
-
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
|
|
4400
|
-
}
|
|
4401
|
-
}));
|
|
4402
|
-
});
|
|
4419
|
+
if (!pivotLength && pivotTotalColumnPosition === "end" || pivotGrandTotalColumnPosition === "end") {
|
|
4420
|
+
addGrandTotalColumns();
|
|
4403
4421
|
}
|
|
4404
4422
|
const result = {
|
|
4405
4423
|
columns,
|
|
@@ -4431,7 +4449,7 @@ function toRowInfo(data, id, index) {
|
|
|
4431
4449
|
};
|
|
4432
4450
|
}
|
|
4433
4451
|
function concludeReducer(params) {
|
|
4434
|
-
var _a;
|
|
4452
|
+
var _a, _b;
|
|
4435
4453
|
const { state, previousState } = params;
|
|
4436
4454
|
const sortInfo = state.sortInfo;
|
|
4437
4455
|
let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
|
|
@@ -4466,6 +4484,7 @@ function concludeReducer(params) {
|
|
|
4466
4484
|
"pivotBy",
|
|
4467
4485
|
"aggregationReducers",
|
|
4468
4486
|
"pivotTotalColumnPosition",
|
|
4487
|
+
"pivotGrandTotalColumnPosition",
|
|
4469
4488
|
"showSeparatePivotColumnForSingleAggregation",
|
|
4470
4489
|
"sortInfo"
|
|
4471
4490
|
]);
|
|
@@ -4512,6 +4531,7 @@ function concludeReducer(params) {
|
|
|
4512
4531
|
deepMap: groupResult.topLevelPivotColumns,
|
|
4513
4532
|
pivotBy,
|
|
4514
4533
|
pivotTotalColumnPosition: (_a = state.pivotTotalColumnPosition) != null ? _a : "end",
|
|
4534
|
+
pivotGrandTotalColumnPosition: (_b = state.pivotGrandTotalColumnPosition) != null ? _b : false,
|
|
4515
4535
|
reducers: state.aggregationReducers,
|
|
4516
4536
|
showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
|
|
4517
4537
|
}) : void 0;
|
|
@@ -4555,7 +4575,7 @@ function DataSourceWithContext(props) {
|
|
|
4555
4575
|
if (typeof children === "function") {
|
|
4556
4576
|
children = children(computedValues);
|
|
4557
4577
|
}
|
|
4558
|
-
return /* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ createElement5(Fragment, null, children);
|
|
4559
4579
|
}
|
|
4560
4580
|
var DataSourceRoot = getComponentStateRoot({
|
|
4561
4581
|
initSetupState: initSetupState2,
|
|
@@ -4578,14 +4598,14 @@ function DataSourceCmp({ children }) {
|
|
|
4578
4598
|
globalThis.getDataSourceState = getState;
|
|
4579
4599
|
}
|
|
4580
4600
|
useLoadData();
|
|
4581
|
-
return /* @__PURE__ */
|
|
4601
|
+
return /* @__PURE__ */ createElement5(DataSourceContext.Provider, {
|
|
4582
4602
|
value: contextValue
|
|
4583
|
-
}, /* @__PURE__ */
|
|
4603
|
+
}, /* @__PURE__ */ createElement5(DataSourceWithContext, {
|
|
4584
4604
|
children
|
|
4585
4605
|
}));
|
|
4586
4606
|
}
|
|
4587
4607
|
function DataSource(props) {
|
|
4588
|
-
return /* @__PURE__ */
|
|
4608
|
+
return /* @__PURE__ */ createElement5(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement5(DataSourceCmp, {
|
|
4589
4609
|
children: props.children
|
|
4590
4610
|
}));
|
|
4591
4611
|
}
|
|
@@ -4626,15 +4646,24 @@ function useColumnsWhen() {
|
|
|
4626
4646
|
componentActions: dataSourceActions
|
|
4627
4647
|
} = useDataSourceContextValue();
|
|
4628
4648
|
const {
|
|
4629
|
-
componentState: {
|
|
4649
|
+
componentState: {
|
|
4650
|
+
groupRenderStrategy,
|
|
4651
|
+
pivotTotalColumnPosition,
|
|
4652
|
+
pivotGrandTotalColumnPosition
|
|
4653
|
+
}
|
|
4630
4654
|
} = useComponentState();
|
|
4631
4655
|
const groupByMap = useGroupByMap(groupBy);
|
|
4632
|
-
|
|
4656
|
+
useEffect10(() => {
|
|
4633
4657
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
4634
4658
|
}, [groupRenderStrategy]);
|
|
4635
|
-
|
|
4659
|
+
useEffect10(() => {
|
|
4636
4660
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
4637
4661
|
}, [pivotTotalColumnPosition]);
|
|
4662
|
+
useEffect10(() => {
|
|
4663
|
+
if (pivotGrandTotalColumnPosition != void 0) {
|
|
4664
|
+
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
4665
|
+
}
|
|
4666
|
+
}, [pivotGrandTotalColumnPosition]);
|
|
4638
4667
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4639
4668
|
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4640
4669
|
useHideColumns(groupByMap);
|
|
@@ -4698,7 +4727,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4698
4727
|
});
|
|
4699
4728
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
4700
4729
|
}
|
|
4701
|
-
|
|
4730
|
+
useEffect10(() => {
|
|
4702
4731
|
const update = () => {
|
|
4703
4732
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
4704
4733
|
};
|
|
@@ -4722,17 +4751,19 @@ function useColumnsWhenGrouping() {
|
|
|
4722
4751
|
groupRenderStrategy,
|
|
4723
4752
|
pivotColumns,
|
|
4724
4753
|
pivotColumn,
|
|
4725
|
-
pivotTotalColumnPosition
|
|
4754
|
+
pivotTotalColumnPosition,
|
|
4755
|
+
pivotGrandTotalColumnPosition
|
|
4726
4756
|
}
|
|
4727
4757
|
} = useComponentState();
|
|
4728
4758
|
const toggleGroupRow = useToggleGroupRow();
|
|
4729
|
-
|
|
4759
|
+
useEffect10(() => {
|
|
4730
4760
|
const update = () => {
|
|
4731
4761
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
4732
4762
|
columns,
|
|
4733
4763
|
groupColumn,
|
|
4734
4764
|
pivotColumn,
|
|
4735
4765
|
pivotTotalColumnPosition,
|
|
4766
|
+
pivotGrandTotalColumnPosition,
|
|
4736
4767
|
groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
|
|
4737
4768
|
groupBy,
|
|
4738
4769
|
pivotBy,
|
|
@@ -4780,7 +4811,7 @@ function useHideColumns(groupByMap) {
|
|
|
4780
4811
|
}
|
|
4781
4812
|
} = useComponentState();
|
|
4782
4813
|
const prevHideEmptyGroupColumns = usePrevious(hideEmptyGroupColumns);
|
|
4783
|
-
|
|
4814
|
+
useEffectWithRaf(() => {
|
|
4784
4815
|
if (groupRenderStrategy !== "multi-column") {
|
|
4785
4816
|
return;
|
|
4786
4817
|
}
|
|
@@ -4858,7 +4889,7 @@ function useHideColumns(groupByMap) {
|
|
|
4858
4889
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4859
4890
|
hideEmptyGroupColumns
|
|
4860
4891
|
]);
|
|
4861
|
-
|
|
4892
|
+
useEffect10(() => {
|
|
4862
4893
|
const isGrouped = groupBy.length > 0;
|
|
4863
4894
|
const currentState = getComponentState();
|
|
4864
4895
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -4893,6 +4924,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4893
4924
|
pivotBy,
|
|
4894
4925
|
groupColumn,
|
|
4895
4926
|
pivotTotalColumnPosition,
|
|
4927
|
+
pivotGrandTotalColumnPosition,
|
|
4896
4928
|
pivotColumn,
|
|
4897
4929
|
groupRenderStrategy,
|
|
4898
4930
|
toggleGroupRow,
|
|
@@ -4932,7 +4964,12 @@ function getColumnsWhenGrouping(params) {
|
|
|
4932
4964
|
});
|
|
4933
4965
|
pivotColumns.forEach((col, key) => {
|
|
4934
4966
|
var _a, _b;
|
|
4935
|
-
|
|
4967
|
+
const isSimpleTotalColumn = col.pivotTotalColumn && col.columnGroup;
|
|
4968
|
+
const isGrandTotalColumn = col.pivotTotalColumn && !col.columnGroup;
|
|
4969
|
+
if (isSimpleTotalColumn && pivotTotalColumnPosition === false) {
|
|
4970
|
+
return;
|
|
4971
|
+
}
|
|
4972
|
+
if (isGrandTotalColumn && pivotGrandTotalColumnPosition === false) {
|
|
4936
4973
|
return;
|
|
4937
4974
|
}
|
|
4938
4975
|
let column = __spreadValues({}, col);
|
|
@@ -4996,7 +5033,7 @@ function useComputed() {
|
|
|
4996
5033
|
}
|
|
4997
5034
|
});
|
|
4998
5035
|
});
|
|
4999
|
-
|
|
5036
|
+
useEffect11(() => {
|
|
5000
5037
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
5001
5038
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
5002
5039
|
const { multiSort } = dataSourceState;
|
|
@@ -5123,7 +5160,7 @@ function useComputed() {
|
|
|
5123
5160
|
|
|
5124
5161
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5125
5162
|
import {
|
|
5126
|
-
createElement as
|
|
5163
|
+
createElement as createElement6,
|
|
5127
5164
|
forwardRef
|
|
5128
5165
|
} from "react";
|
|
5129
5166
|
|
|
@@ -5135,7 +5172,7 @@ var useInternalProps = () => {
|
|
|
5135
5172
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5136
5173
|
var InfiniteTableBody = forwardRef(function InfiniteTableBody2(props, ref) {
|
|
5137
5174
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
5138
|
-
return /* @__PURE__ */
|
|
5175
|
+
return /* @__PURE__ */ createElement6("div", __spreadProps(__spreadValues({
|
|
5139
5176
|
ref
|
|
5140
5177
|
}, props), {
|
|
5141
5178
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -5144,12 +5181,12 @@ var InfiniteTableBody = forwardRef(function InfiniteTableBody2(props, ref) {
|
|
|
5144
5181
|
|
|
5145
5182
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
5146
5183
|
import {
|
|
5147
|
-
createElement as
|
|
5184
|
+
createElement as createElement18
|
|
5148
5185
|
} from "react";
|
|
5149
5186
|
|
|
5150
5187
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
5151
5188
|
import {
|
|
5152
|
-
createElement as
|
|
5189
|
+
createElement as createElement7,
|
|
5153
5190
|
memo as memo2
|
|
5154
5191
|
} from "react";
|
|
5155
5192
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
@@ -5157,7 +5194,7 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
5157
5194
|
if (!scrollbarWidth2) {
|
|
5158
5195
|
return null;
|
|
5159
5196
|
}
|
|
5160
|
-
return /* @__PURE__ */
|
|
5197
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
5161
5198
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
5162
5199
|
style: __spreadValues({
|
|
5163
5200
|
position: "absolute",
|
|
@@ -5173,7 +5210,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
5173
5210
|
if (!scrollbarWidth2) {
|
|
5174
5211
|
return null;
|
|
5175
5212
|
}
|
|
5176
|
-
return /* @__PURE__ */
|
|
5213
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
5177
5214
|
"data-name": "vertical-scrollbar-placeholder",
|
|
5178
5215
|
style: __spreadValues({
|
|
5179
5216
|
position: "absolute",
|
|
@@ -5199,22 +5236,22 @@ var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
|
5199
5236
|
|
|
5200
5237
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5201
5238
|
import {
|
|
5202
|
-
createElement as
|
|
5239
|
+
createElement as createElement14,
|
|
5203
5240
|
memo as memo6
|
|
5204
5241
|
} from "react";
|
|
5205
|
-
import { useCallback as useCallback8, useEffect as
|
|
5242
|
+
import { useCallback as useCallback8, useEffect as useEffect15, useRef as useRef10 } from "react";
|
|
5206
5243
|
|
|
5207
5244
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5208
5245
|
import {
|
|
5209
5246
|
createContext as createContext4,
|
|
5210
|
-
createElement as
|
|
5247
|
+
createElement as createElement10
|
|
5211
5248
|
} from "react";
|
|
5212
|
-
import { useCallback as useCallback7, useContext as useContext5, useEffect as
|
|
5249
|
+
import { useCallback as useCallback7, useContext as useContext5, useEffect as useEffect13, useRef as useRef9 } from "react";
|
|
5213
5250
|
|
|
5214
5251
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5215
5252
|
import {
|
|
5216
|
-
Fragment as
|
|
5217
|
-
createElement as
|
|
5253
|
+
Fragment as Fragment2,
|
|
5254
|
+
createElement as createElement8,
|
|
5218
5255
|
memo as memo3
|
|
5219
5256
|
} from "react";
|
|
5220
5257
|
|
|
@@ -5285,15 +5322,15 @@ function InfiniteTableCellFn(props) {
|
|
|
5285
5322
|
style,
|
|
5286
5323
|
"data-name": "Cell",
|
|
5287
5324
|
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}` : ""),
|
|
5288
|
-
children: /* @__PURE__ */
|
|
5325
|
+
children: /* @__PURE__ */ createElement8(Fragment2, null, beforeChildren, /* @__PURE__ */ createElement8("div", {
|
|
5289
5326
|
className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
|
|
5290
5327
|
}, children), afterChildren)
|
|
5291
5328
|
});
|
|
5292
5329
|
const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
|
|
5293
5330
|
if (RenderComponent) {
|
|
5294
|
-
return /* @__PURE__ */
|
|
5331
|
+
return /* @__PURE__ */ createElement8(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5295
5332
|
}
|
|
5296
|
-
return /* @__PURE__ */
|
|
5333
|
+
return /* @__PURE__ */ createElement8("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5297
5334
|
ref: domRef
|
|
5298
5335
|
}));
|
|
5299
5336
|
}
|
|
@@ -5304,7 +5341,7 @@ var import_binary_search2 = __toModule(require_binary_search());
|
|
|
5304
5341
|
import {
|
|
5305
5342
|
useCallback as useCallback6,
|
|
5306
5343
|
useMemo as useMemo7,
|
|
5307
|
-
useRef as
|
|
5344
|
+
useRef as useRef8,
|
|
5308
5345
|
useState as useState6
|
|
5309
5346
|
} from "react";
|
|
5310
5347
|
|
|
@@ -5342,11 +5379,11 @@ var useColumnPointerEvents = ({
|
|
|
5342
5379
|
}) => {
|
|
5343
5380
|
const [draggingDiff, setDraggingDiff] = useState6(null);
|
|
5344
5381
|
const [proxyOffset, setProxyOffset] = useState6(null);
|
|
5345
|
-
const breakpointsRef =
|
|
5346
|
-
const pointerMoveRef =
|
|
5347
|
-
const didDragRef =
|
|
5348
|
-
const initialClientPos =
|
|
5349
|
-
const currentDropIndexRef =
|
|
5382
|
+
const breakpointsRef = useRef8([]);
|
|
5383
|
+
const pointerMoveRef = useRef8(null);
|
|
5384
|
+
const didDragRef = useRef8(false);
|
|
5385
|
+
const initialClientPos = useRef8(null);
|
|
5386
|
+
const currentDropIndexRef = useRef8(null);
|
|
5350
5387
|
const dragging = draggingDiff != null;
|
|
5351
5388
|
const { componentActions, computed } = useInfiniteTable();
|
|
5352
5389
|
const { computedColumnOrder } = computed;
|
|
@@ -5359,7 +5396,7 @@ var useColumnPointerEvents = ({
|
|
|
5359
5396
|
columnWidth: column.computedWidth
|
|
5360
5397
|
};
|
|
5361
5398
|
}, [columns, columnId, column]);
|
|
5362
|
-
let cursorRef =
|
|
5399
|
+
let cursorRef = useRef8("auto");
|
|
5363
5400
|
const onPointerDown = useCallback6((e) => {
|
|
5364
5401
|
const target = domRef.current;
|
|
5365
5402
|
cursorRef.current = target.style.cursor;
|
|
@@ -5498,9 +5535,9 @@ import { createPortal } from "react-dom";
|
|
|
5498
5535
|
|
|
5499
5536
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5500
5537
|
import {
|
|
5501
|
-
createElement as
|
|
5538
|
+
createElement as createElement9
|
|
5502
5539
|
} from "react";
|
|
5503
|
-
import { useEffect as
|
|
5540
|
+
import { useEffect as useEffect12, useState as useState7 } from "react";
|
|
5504
5541
|
var defaultLineStyle = {
|
|
5505
5542
|
marginTop: 2,
|
|
5506
5543
|
marginBottom: 2,
|
|
@@ -5524,7 +5561,7 @@ function SortIcon(props) {
|
|
|
5524
5561
|
}), props.lineStyle), {
|
|
5525
5562
|
opacity
|
|
5526
5563
|
});
|
|
5527
|
-
|
|
5564
|
+
useEffect12(() => {
|
|
5528
5565
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
5529
5566
|
if (!rendered && newOpacity) {
|
|
5530
5567
|
setRendered(true);
|
|
@@ -5554,18 +5591,18 @@ function SortIcon(props) {
|
|
|
5554
5591
|
if (direction === -1) {
|
|
5555
5592
|
indexStyle.top = "100%";
|
|
5556
5593
|
}
|
|
5557
|
-
return /* @__PURE__ */
|
|
5594
|
+
return /* @__PURE__ */ createElement9("div", {
|
|
5558
5595
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5559
5596
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5560
|
-
}, showIndex ? /* @__PURE__ */
|
|
5597
|
+
}, showIndex ? /* @__PURE__ */ createElement9("div", {
|
|
5561
5598
|
"data-name": "index",
|
|
5562
5599
|
style: indexStyle
|
|
5563
|
-
}, index) : null, /* @__PURE__ */
|
|
5600
|
+
}, index) : null, /* @__PURE__ */ createElement9("div", {
|
|
5564
5601
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5565
5602
|
onTransitionEnd
|
|
5566
|
-
}), /* @__PURE__ */
|
|
5603
|
+
}), /* @__PURE__ */ createElement9("div", {
|
|
5567
5604
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5568
|
-
}), /* @__PURE__ */
|
|
5605
|
+
}), /* @__PURE__ */ createElement9("div", {
|
|
5569
5606
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5570
5607
|
}));
|
|
5571
5608
|
}
|
|
@@ -5595,7 +5632,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5595
5632
|
domRef.current = node;
|
|
5596
5633
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
5597
5634
|
}, [props.domRef]);
|
|
5598
|
-
const sortTool = /* @__PURE__ */
|
|
5635
|
+
const sortTool = /* @__PURE__ */ createElement10(SortIcon, {
|
|
5599
5636
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
5600
5637
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
|
|
5601
5638
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
@@ -5608,7 +5645,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5608
5645
|
};
|
|
5609
5646
|
const renderChildren = () => {
|
|
5610
5647
|
if (header instanceof Function) {
|
|
5611
|
-
header = /* @__PURE__ */
|
|
5648
|
+
header = /* @__PURE__ */ createElement10(RenderHookComponent, {
|
|
5612
5649
|
render: header,
|
|
5613
5650
|
renderParam
|
|
5614
5651
|
});
|
|
@@ -5616,12 +5653,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5616
5653
|
header = header != null ? header : column.name;
|
|
5617
5654
|
return header;
|
|
5618
5655
|
};
|
|
5619
|
-
const domRef =
|
|
5656
|
+
const domRef = useRef9(null);
|
|
5620
5657
|
const {
|
|
5621
5658
|
computed: { computedRemainingSpace },
|
|
5622
5659
|
componentState: { portalDOMRef }
|
|
5623
5660
|
} = useInfiniteTable();
|
|
5624
|
-
|
|
5661
|
+
useEffect13(() => {
|
|
5625
5662
|
let clearOnResize = null;
|
|
5626
5663
|
const node = domRef.current;
|
|
5627
5664
|
if (onResize && node) {
|
|
@@ -5644,7 +5681,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5644
5681
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
5645
5682
|
let draggingProxy = null;
|
|
5646
5683
|
if (dragging) {
|
|
5647
|
-
draggingProxy = /* @__PURE__ */
|
|
5684
|
+
draggingProxy = /* @__PURE__ */ createElement10("div", {
|
|
5648
5685
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
5649
5686
|
style: {
|
|
5650
5687
|
position: "absolute",
|
|
@@ -5658,9 +5695,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5658
5695
|
draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
|
|
5659
5696
|
}
|
|
5660
5697
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5661
|
-
return /* @__PURE__ */
|
|
5698
|
+
return /* @__PURE__ */ createElement10(ContextProvider, {
|
|
5662
5699
|
value: renderParam
|
|
5663
|
-
}, /* @__PURE__ */
|
|
5700
|
+
}, /* @__PURE__ */ createElement10(InfiniteTableCell, {
|
|
5664
5701
|
domRef: ref,
|
|
5665
5702
|
cellType: "header",
|
|
5666
5703
|
column,
|
|
@@ -5683,15 +5720,15 @@ function useInfiniteHeaderCell() {
|
|
|
5683
5720
|
|
|
5684
5721
|
// src/components/RawList/index.tsx
|
|
5685
5722
|
import {
|
|
5686
|
-
createElement as
|
|
5723
|
+
createElement as createElement13,
|
|
5687
5724
|
memo as memo5
|
|
5688
5725
|
} from "react";
|
|
5689
|
-
import { useEffect as
|
|
5726
|
+
import { useEffect as useEffect14 } from "react";
|
|
5690
5727
|
|
|
5691
5728
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
5692
5729
|
import {
|
|
5693
|
-
Fragment as
|
|
5694
|
-
createElement as
|
|
5730
|
+
Fragment as Fragment3,
|
|
5731
|
+
createElement as createElement11,
|
|
5695
5732
|
memo as memo4
|
|
5696
5733
|
} from "react";
|
|
5697
5734
|
import { useLayoutEffect as useLayoutEffect3, useState as useState8 } from "react";
|
|
@@ -5703,7 +5740,7 @@ function AvoidReactDiffFn(props) {
|
|
|
5703
5740
|
});
|
|
5704
5741
|
return remove;
|
|
5705
5742
|
}, [props.updater]);
|
|
5706
|
-
return /* @__PURE__ */
|
|
5743
|
+
return /* @__PURE__ */ createElement11(Fragment3, null, children);
|
|
5707
5744
|
}
|
|
5708
5745
|
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
5709
5746
|
|
|
@@ -5712,7 +5749,7 @@ import { useMemo as useMemo8 } from "react";
|
|
|
5712
5749
|
|
|
5713
5750
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
5714
5751
|
import {
|
|
5715
|
-
createElement as
|
|
5752
|
+
createElement as createElement12
|
|
5716
5753
|
} from "react";
|
|
5717
5754
|
|
|
5718
5755
|
// src/components/RawList/MappedItems.ts
|
|
@@ -5958,7 +5995,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5958
5995
|
};
|
|
5959
5996
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5960
5997
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5961
|
-
const item = /* @__PURE__ */
|
|
5998
|
+
const item = /* @__PURE__ */ createElement12(AvoidReactDiff, {
|
|
5962
5999
|
key: elementIndex,
|
|
5963
6000
|
name: `${elementIndex}`,
|
|
5964
6001
|
updater: this.updaters[elementIndex]
|
|
@@ -5994,7 +6031,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5994
6031
|
}
|
|
5995
6032
|
this.mappedItems.renderItemAtElement(itemIndex, elementIndex, renderedNode);
|
|
5996
6033
|
if (true) {
|
|
5997
|
-
this.
|
|
6034
|
+
dbg(`ReactVirtualRenderer:${this.brain.getOptions().mainAxis}`)(`Render item ${itemIndex} at element ${elementIndex}`);
|
|
5998
6035
|
}
|
|
5999
6036
|
itemUpdater(renderedNode);
|
|
6000
6037
|
this.updateElementPosition(elementIndex);
|
|
@@ -6037,7 +6074,7 @@ function RawListFn(props) {
|
|
|
6037
6074
|
debugChannel
|
|
6038
6075
|
});
|
|
6039
6076
|
const getRenderItem = useLatest(renderItem);
|
|
6040
|
-
|
|
6077
|
+
useEffect14(() => {
|
|
6041
6078
|
const renderRange = brain.getRenderRange();
|
|
6042
6079
|
renderer.renderRange(renderRange, {
|
|
6043
6080
|
renderItem,
|
|
@@ -6045,7 +6082,7 @@ function RawListFn(props) {
|
|
|
6045
6082
|
onRender: onRenderUpdater
|
|
6046
6083
|
});
|
|
6047
6084
|
}, [brain, renderItem, onRenderUpdater]);
|
|
6048
|
-
|
|
6085
|
+
useEffect14(() => {
|
|
6049
6086
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
6050
6087
|
renderer.renderRange(renderRange, {
|
|
6051
6088
|
force: false,
|
|
@@ -6055,7 +6092,7 @@ function RawListFn(props) {
|
|
|
6055
6092
|
});
|
|
6056
6093
|
return remove;
|
|
6057
6094
|
}, [brain, onRenderUpdater]);
|
|
6058
|
-
return /* @__PURE__ */
|
|
6095
|
+
return /* @__PURE__ */ createElement13(AvoidReactDiff, {
|
|
6059
6096
|
updater: onRenderUpdater
|
|
6060
6097
|
});
|
|
6061
6098
|
}
|
|
@@ -6080,14 +6117,14 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6080
6117
|
}
|
|
6081
6118
|
return null;
|
|
6082
6119
|
}
|
|
6083
|
-
return /* @__PURE__ */
|
|
6120
|
+
return /* @__PURE__ */ createElement14(InfiniteTableHeaderCell, {
|
|
6084
6121
|
domRef: domRef2,
|
|
6085
6122
|
column,
|
|
6086
6123
|
headerHeight,
|
|
6087
6124
|
columns: computedVisibleColumnsMap
|
|
6088
6125
|
});
|
|
6089
6126
|
}, [computedVisibleColumnsMap, columns, repaintId, headerHeight]);
|
|
6090
|
-
|
|
6127
|
+
useEffect15(() => {
|
|
6091
6128
|
const onScroll = (scrollPosition) => {
|
|
6092
6129
|
if (domRef.current) {
|
|
6093
6130
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -6096,7 +6133,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6096
6133
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
6097
6134
|
return removeOnScroll;
|
|
6098
6135
|
}, [brain]);
|
|
6099
|
-
const domRef =
|
|
6136
|
+
const domRef = useRef10(null);
|
|
6100
6137
|
const headerCls = HeaderClsRecipe({
|
|
6101
6138
|
pinned: pinning,
|
|
6102
6139
|
overflow: false,
|
|
@@ -6107,7 +6144,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6107
6144
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
6108
6145
|
style
|
|
6109
6146
|
};
|
|
6110
|
-
return /* @__PURE__ */
|
|
6147
|
+
return /* @__PURE__ */ createElement14("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement14(RawList, {
|
|
6111
6148
|
brain,
|
|
6112
6149
|
renderItem: renderColumn
|
|
6113
6150
|
}));
|
|
@@ -6116,15 +6153,15 @@ var InfiniteTableHeader = memo6(InfiniteTableHeaderFn);
|
|
|
6116
6153
|
|
|
6117
6154
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
6118
6155
|
import {
|
|
6119
|
-
createElement as
|
|
6156
|
+
createElement as createElement17,
|
|
6120
6157
|
memo as memo7,
|
|
6121
6158
|
useMemo as useMemo9,
|
|
6122
|
-
useRef as
|
|
6159
|
+
useRef as useRef11
|
|
6123
6160
|
} from "react";
|
|
6124
6161
|
|
|
6125
6162
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
6126
6163
|
import {
|
|
6127
|
-
createElement as
|
|
6164
|
+
createElement as createElement16
|
|
6128
6165
|
} from "react";
|
|
6129
6166
|
|
|
6130
6167
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
@@ -6216,7 +6253,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6216
6253
|
|
|
6217
6254
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6218
6255
|
import {
|
|
6219
|
-
createElement as
|
|
6256
|
+
createElement as createElement15
|
|
6220
6257
|
} from "react";
|
|
6221
6258
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
6222
6259
|
function InfiniteTableHeaderGroup(props) {
|
|
@@ -6231,16 +6268,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6231
6268
|
width: columnGroup.computedWidth,
|
|
6232
6269
|
height
|
|
6233
6270
|
};
|
|
6234
|
-
return /* @__PURE__ */
|
|
6271
|
+
return /* @__PURE__ */ createElement15("div", {
|
|
6235
6272
|
"data-group-id": columnGroup.id,
|
|
6236
6273
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
6237
6274
|
style
|
|
6238
|
-
}, /* @__PURE__ */
|
|
6275
|
+
}, /* @__PURE__ */ createElement15("div", {
|
|
6239
6276
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
6240
6277
|
style: { height: headerHeight }
|
|
6241
|
-
}, /* @__PURE__ */
|
|
6278
|
+
}, /* @__PURE__ */ createElement15("div", {
|
|
6242
6279
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6243
|
-
}, header)), /* @__PURE__ */
|
|
6280
|
+
}, header)), /* @__PURE__ */ createElement15("div", {
|
|
6244
6281
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
6245
6282
|
}, props.children));
|
|
6246
6283
|
}
|
|
@@ -6263,7 +6300,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6263
6300
|
return items2.map((colGroupItem) => {
|
|
6264
6301
|
if (colGroupItem.type === "column") {
|
|
6265
6302
|
const col = colGroupItem.ref;
|
|
6266
|
-
return /* @__PURE__ */
|
|
6303
|
+
return /* @__PURE__ */ createElement16(InfiniteTableHeaderCell, {
|
|
6267
6304
|
key: col.id,
|
|
6268
6305
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
6269
6306
|
column: col,
|
|
@@ -6277,7 +6314,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6277
6314
|
colIds.push(col.id);
|
|
6278
6315
|
return col;
|
|
6279
6316
|
});
|
|
6280
|
-
return /* @__PURE__ */
|
|
6317
|
+
return /* @__PURE__ */ createElement16(InfiniteTableHeaderGroup, {
|
|
6281
6318
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
6282
6319
|
columns: columns2,
|
|
6283
6320
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -6297,7 +6334,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6297
6334
|
}
|
|
6298
6335
|
|
|
6299
6336
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
6300
|
-
import { useEffect as
|
|
6337
|
+
import { useEffect as useEffect16 } from "react";
|
|
6301
6338
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
6302
6339
|
var TableHeaderClassName2 = `${rootClassName5}Header`;
|
|
6303
6340
|
var UPDATE_SCROLL = (node, scrollPosition) => {
|
|
@@ -6330,7 +6367,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6330
6367
|
},
|
|
6331
6368
|
computed: { computedVisibleColumnsMap: columnsMap }
|
|
6332
6369
|
} = useInfiniteTable();
|
|
6333
|
-
const domRef =
|
|
6370
|
+
const domRef = useRef11(null);
|
|
6334
6371
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
6335
6372
|
const columnHeaderGroups = useMemo9(() => {
|
|
6336
6373
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
@@ -6351,7 +6388,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6351
6388
|
columnGroupsMaxDepth
|
|
6352
6389
|
]);
|
|
6353
6390
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
6354
|
-
return /* @__PURE__ */
|
|
6391
|
+
return /* @__PURE__ */ createElement17(InfiniteTableHeaderCell, {
|
|
6355
6392
|
key: c.id,
|
|
6356
6393
|
headerHeight,
|
|
6357
6394
|
column: c,
|
|
@@ -6363,7 +6400,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6363
6400
|
if (totalWidth != null) {
|
|
6364
6401
|
style.width = availableWidth;
|
|
6365
6402
|
}
|
|
6366
|
-
|
|
6403
|
+
useEffect16(() => {
|
|
6367
6404
|
const scroller = brain || scrollListener;
|
|
6368
6405
|
if (!scroller || !scrollable) {
|
|
6369
6406
|
return;
|
|
@@ -6376,14 +6413,14 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6376
6413
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
6377
6414
|
return removeOnScroll;
|
|
6378
6415
|
}, [brain, scrollListener]);
|
|
6379
|
-
return /* @__PURE__ */
|
|
6416
|
+
return /* @__PURE__ */ createElement17("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6380
6417
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
6381
6418
|
pinned: pinning,
|
|
6382
6419
|
virtualized: false,
|
|
6383
6420
|
overflow: scrollable
|
|
6384
6421
|
})),
|
|
6385
6422
|
style
|
|
6386
|
-
}), /* @__PURE__ */
|
|
6423
|
+
}), /* @__PURE__ */ createElement17("div", {
|
|
6387
6424
|
style: { width: totalWidth },
|
|
6388
6425
|
className: join(flexFlow.row, display.flex),
|
|
6389
6426
|
ref: domRef
|
|
@@ -6422,7 +6459,7 @@ function TableHeaderWrapper(props) {
|
|
|
6422
6459
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
6423
6460
|
left: computedPinnedStartWidth
|
|
6424
6461
|
} : void 0;
|
|
6425
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
6462
|
+
const header = virtualizeHeader ? /* @__PURE__ */ createElement18(InfiniteTableHeader, {
|
|
6426
6463
|
columns: computedUnpinnedColumns,
|
|
6427
6464
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
6428
6465
|
brain,
|
|
@@ -6435,7 +6472,7 @@ function TableHeaderWrapper(props) {
|
|
|
6435
6472
|
},
|
|
6436
6473
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6437
6474
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6438
|
-
}) : /* @__PURE__ */
|
|
6475
|
+
}) : /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
6439
6476
|
style: unvirtualizedStyle,
|
|
6440
6477
|
brain,
|
|
6441
6478
|
scrollable: true,
|
|
@@ -6444,12 +6481,12 @@ function TableHeaderWrapper(props) {
|
|
|
6444
6481
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6445
6482
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6446
6483
|
});
|
|
6447
|
-
return /* @__PURE__ */
|
|
6484
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
6448
6485
|
className: HeaderWrapperCls,
|
|
6449
6486
|
style: {
|
|
6450
6487
|
height: virtualizeHeader ? height : void 0
|
|
6451
6488
|
}
|
|
6452
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
6489
|
+
}, hasPinnedStart ? /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
6453
6490
|
style: {
|
|
6454
6491
|
left: 0,
|
|
6455
6492
|
position: "absolute",
|
|
@@ -6461,7 +6498,7 @@ function TableHeaderWrapper(props) {
|
|
|
6461
6498
|
scrollable: computedPinnedStartOverflow,
|
|
6462
6499
|
pinning: "start",
|
|
6463
6500
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
6464
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
6501
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
6465
6502
|
style: {
|
|
6466
6503
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
6467
6504
|
position: "absolute",
|
|
@@ -6473,7 +6510,7 @@ function TableHeaderWrapper(props) {
|
|
|
6473
6510
|
scrollable: computedPinnedEndOverflow,
|
|
6474
6511
|
pinning: "end",
|
|
6475
6512
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
6476
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
6513
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ createElement18(VerticalScrollbarPlaceholder, {
|
|
6477
6514
|
style: {
|
|
6478
6515
|
height: "100%",
|
|
6479
6516
|
right: 0
|
|
@@ -6483,15 +6520,15 @@ function TableHeaderWrapper(props) {
|
|
|
6483
6520
|
|
|
6484
6521
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6485
6522
|
import {
|
|
6486
|
-
createElement as
|
|
6523
|
+
createElement as createElement19,
|
|
6487
6524
|
forwardRef as forwardRef2
|
|
6488
6525
|
} from "react";
|
|
6489
|
-
import { useRef as
|
|
6526
|
+
import { useRef as useRef12 } from "react";
|
|
6490
6527
|
|
|
6491
6528
|
// src/components/hooks/useOnScroll.ts
|
|
6492
|
-
import { useEffect as
|
|
6529
|
+
import { useEffect as useEffect17 } from "react";
|
|
6493
6530
|
var useOnScroll = (domRef, onScroll) => {
|
|
6494
|
-
|
|
6531
|
+
useEffect17(() => {
|
|
6495
6532
|
const domNode = domRef == null ? void 0 : domRef.current;
|
|
6496
6533
|
const scrollFn = (event) => {
|
|
6497
6534
|
const node = event.target;
|
|
@@ -6537,9 +6574,9 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
|
|
|
6537
6574
|
className,
|
|
6538
6575
|
style
|
|
6539
6576
|
} = props;
|
|
6540
|
-
const domRef = ref != null ? ref :
|
|
6577
|
+
const domRef = ref != null ? ref : useRef12(null);
|
|
6541
6578
|
useOnScroll(domRef, onContainerScroll);
|
|
6542
|
-
return /* @__PURE__ */
|
|
6579
|
+
return /* @__PURE__ */ createElement19("div", {
|
|
6543
6580
|
ref: domRef,
|
|
6544
6581
|
style,
|
|
6545
6582
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -6548,7 +6585,7 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
|
|
|
6548
6585
|
|
|
6549
6586
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
6550
6587
|
import {
|
|
6551
|
-
createElement as
|
|
6588
|
+
createElement as createElement20,
|
|
6552
6589
|
memo as memo8
|
|
6553
6590
|
} from "react";
|
|
6554
6591
|
function SpacePlaceholderFn(props) {
|
|
@@ -6560,7 +6597,7 @@ function SpacePlaceholderFn(props) {
|
|
|
6560
6597
|
opacity: 0,
|
|
6561
6598
|
pointerEvents: "none"
|
|
6562
6599
|
};
|
|
6563
|
-
return /* @__PURE__ */
|
|
6600
|
+
return /* @__PURE__ */ createElement20("div", {
|
|
6564
6601
|
"data-count": count,
|
|
6565
6602
|
"data-placeholder-width": true ? width : void 0,
|
|
6566
6603
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -6571,26 +6608,26 @@ function SpacePlaceholderFn(props) {
|
|
|
6571
6608
|
var SpacePlaceholder = memo8(SpacePlaceholderFn);
|
|
6572
6609
|
|
|
6573
6610
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
6574
|
-
import { useEffect as
|
|
6611
|
+
import { useEffect as useEffect23, useMemo as useMemo11, useRef as useRef18 } from "react";
|
|
6575
6612
|
|
|
6576
6613
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6577
6614
|
import {
|
|
6578
|
-
createElement as
|
|
6615
|
+
createElement as createElement26
|
|
6579
6616
|
} from "react";
|
|
6580
6617
|
import { useCallback as useCallback12 } from "react";
|
|
6581
6618
|
|
|
6582
6619
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6583
6620
|
import {
|
|
6584
|
-
createElement as
|
|
6621
|
+
createElement as createElement22,
|
|
6585
6622
|
useCallback as useCallback9
|
|
6586
6623
|
} from "react";
|
|
6587
6624
|
|
|
6588
6625
|
// src/components/VirtualList/VirtualList.tsx
|
|
6589
6626
|
import {
|
|
6590
|
-
Fragment as
|
|
6591
|
-
createElement as
|
|
6627
|
+
Fragment as Fragment4,
|
|
6628
|
+
createElement as createElement21
|
|
6592
6629
|
} from "react";
|
|
6593
|
-
import { useRef as
|
|
6630
|
+
import { useRef as useRef13, useEffect as useEffect18, useState as useState9 } from "react";
|
|
6594
6631
|
|
|
6595
6632
|
// src/components/VirtualList/VirtualList.css.ts
|
|
6596
6633
|
var VirtualListCls = "_16lm1iw1 _16lm1iw8 _16lm1iw0";
|
|
@@ -6633,11 +6670,11 @@ var VirtualList = (props) => {
|
|
|
6633
6670
|
"onContainerScroll",
|
|
6634
6671
|
"children"
|
|
6635
6672
|
]);
|
|
6636
|
-
const domRef =
|
|
6673
|
+
const domRef = useRef13(null);
|
|
6637
6674
|
const [, rerender] = useRerender();
|
|
6638
6675
|
const [totalSize, setTotalSize] = useState9(0);
|
|
6639
|
-
const renderCountRef =
|
|
6640
|
-
|
|
6676
|
+
const renderCountRef = useRef13(0);
|
|
6677
|
+
useEffect18(() => {
|
|
6641
6678
|
const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
|
|
6642
6679
|
renderCountRef.current = renderCount;
|
|
6643
6680
|
if (true) {
|
|
@@ -6656,7 +6693,7 @@ var VirtualList = (props) => {
|
|
|
6656
6693
|
removeOnTotalSizeChange();
|
|
6657
6694
|
};
|
|
6658
6695
|
}, [virtualBrain]);
|
|
6659
|
-
|
|
6696
|
+
useEffect18(() => {
|
|
6660
6697
|
const onScroll = (scrollPosition) => {
|
|
6661
6698
|
UPDATE_SCROLL2(domRef.current, scrollPosition);
|
|
6662
6699
|
};
|
|
@@ -6671,19 +6708,19 @@ var VirtualList = (props) => {
|
|
|
6671
6708
|
if (true) {
|
|
6672
6709
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
6673
6710
|
}
|
|
6674
|
-
return /* @__PURE__ */
|
|
6711
|
+
return /* @__PURE__ */ createElement21(Fragment4, null, /* @__PURE__ */ createElement21("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement21(VirtualScrollContainer, {
|
|
6675
6712
|
scrollable,
|
|
6676
6713
|
onContainerScroll
|
|
6677
|
-
}, /* @__PURE__ */
|
|
6714
|
+
}, /* @__PURE__ */ createElement21("div", {
|
|
6678
6715
|
ref: domRef,
|
|
6679
6716
|
className: scrollTransformTargetCls,
|
|
6680
6717
|
"data-name": "scroll-transform-target"
|
|
6681
|
-
}, /* @__PURE__ */
|
|
6718
|
+
}, /* @__PURE__ */ createElement21(RawList, {
|
|
6682
6719
|
brain: virtualBrain,
|
|
6683
6720
|
renderItem,
|
|
6684
6721
|
repaintId,
|
|
6685
6722
|
debugChannel: "VirtualList-" + mainAxis
|
|
6686
|
-
})), children, /* @__PURE__ */
|
|
6723
|
+
})), children, /* @__PURE__ */ createElement21(SpacePlaceholder, {
|
|
6687
6724
|
count,
|
|
6688
6725
|
width,
|
|
6689
6726
|
height
|
|
@@ -6700,7 +6737,7 @@ var VirtualRowList = (props) => {
|
|
|
6700
6737
|
rowIndex: renderProps.itemIndex
|
|
6701
6738
|
});
|
|
6702
6739
|
}, [renderRow]);
|
|
6703
|
-
return /* @__PURE__ */
|
|
6740
|
+
return /* @__PURE__ */ createElement22(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
6704
6741
|
renderItem,
|
|
6705
6742
|
mainAxis: "vertical",
|
|
6706
6743
|
itemMainAxisSize: rowHeight,
|
|
@@ -6710,16 +6747,16 @@ var VirtualRowList = (props) => {
|
|
|
6710
6747
|
|
|
6711
6748
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
6712
6749
|
import {
|
|
6713
|
-
createElement as
|
|
6750
|
+
createElement as createElement24,
|
|
6714
6751
|
memo as memo10,
|
|
6715
6752
|
useCallback as useCallback11
|
|
6716
6753
|
} from "react";
|
|
6717
|
-
import { useRef as
|
|
6754
|
+
import { useRef as useRef15 } from "react";
|
|
6718
6755
|
|
|
6719
6756
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
6720
6757
|
import {
|
|
6721
6758
|
createContext as createContext5,
|
|
6722
|
-
createElement as
|
|
6759
|
+
createElement as createElement23,
|
|
6723
6760
|
memo as memo9
|
|
6724
6761
|
} from "react";
|
|
6725
6762
|
import { useContext as useContext6 } from "react";
|
|
@@ -6789,7 +6826,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6789
6826
|
}
|
|
6790
6827
|
const renderFn = column.render || column.renderValue;
|
|
6791
6828
|
if (renderFn) {
|
|
6792
|
-
return /* @__PURE__ */
|
|
6829
|
+
return /* @__PURE__ */ createElement23(RenderHookComponent, {
|
|
6793
6830
|
render: renderFn,
|
|
6794
6831
|
renderParam
|
|
6795
6832
|
});
|
|
@@ -6836,9 +6873,9 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6836
6873
|
renderChildren
|
|
6837
6874
|
});
|
|
6838
6875
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
6839
|
-
return /* @__PURE__ */
|
|
6876
|
+
return /* @__PURE__ */ createElement23(ContextProvider, {
|
|
6840
6877
|
value: renderParam
|
|
6841
|
-
}, /* @__PURE__ */
|
|
6878
|
+
}, /* @__PURE__ */ createElement23(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
6842
6879
|
}
|
|
6843
6880
|
var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
|
|
6844
6881
|
function useInfiniteColumnCell() {
|
|
@@ -6849,7 +6886,7 @@ function useInfiniteColumnCell() {
|
|
|
6849
6886
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
|
|
6850
6887
|
import {
|
|
6851
6888
|
useCallback as useCallback10,
|
|
6852
|
-
useRef as
|
|
6889
|
+
useRef as useRef14
|
|
6853
6890
|
} from "react";
|
|
6854
6891
|
|
|
6855
6892
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
|
|
@@ -6876,7 +6913,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6876
6913
|
rowInfo,
|
|
6877
6914
|
rowSpan
|
|
6878
6915
|
} = props;
|
|
6879
|
-
const domRef =
|
|
6916
|
+
const domRef = useRef14(null);
|
|
6880
6917
|
const rowDOMRef = useCallback10((node) => {
|
|
6881
6918
|
domRefFromProps(node);
|
|
6882
6919
|
domRef.current = node;
|
|
@@ -6978,13 +7015,13 @@ function InfiniteTableRowFn(props) {
|
|
|
6978
7015
|
width: rowWidth,
|
|
6979
7016
|
height: rowHeight
|
|
6980
7017
|
}, domProps.style);
|
|
6981
|
-
const renderCellRef =
|
|
7018
|
+
const renderCellRef = useRef15(null);
|
|
6982
7019
|
const renderCell = useCallback11(({ domRef, itemIndex }) => {
|
|
6983
7020
|
const column = columns[itemIndex];
|
|
6984
7021
|
if (!column) {
|
|
6985
7022
|
}
|
|
6986
7023
|
const hidden = false;
|
|
6987
|
-
return /* @__PURE__ */
|
|
7024
|
+
return /* @__PURE__ */ createElement24(InfiniteTableColumnCell, {
|
|
6988
7025
|
getData,
|
|
6989
7026
|
rowInfo,
|
|
6990
7027
|
groupRenderStrategy,
|
|
@@ -7011,9 +7048,9 @@ function InfiniteTableRowFn(props) {
|
|
|
7011
7048
|
if (true) {
|
|
7012
7049
|
domProps["data-cmp-name"] = "ITableRow";
|
|
7013
7050
|
}
|
|
7014
|
-
return /* @__PURE__ */
|
|
7051
|
+
return /* @__PURE__ */ createElement24("div", __spreadProps(__spreadValues({}, domProps), {
|
|
7015
7052
|
style
|
|
7016
|
-
}), /* @__PURE__ */
|
|
7053
|
+
}), /* @__PURE__ */ createElement24(RawList, {
|
|
7017
7054
|
brain,
|
|
7018
7055
|
renderItem: renderCell,
|
|
7019
7056
|
debugChannel: `${rowIndex}`
|
|
@@ -7023,7 +7060,7 @@ var InfiniteTableRow = memo10(InfiniteTableRowFn);
|
|
|
7023
7060
|
|
|
7024
7061
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
7025
7062
|
import {
|
|
7026
|
-
createElement as
|
|
7063
|
+
createElement as createElement25,
|
|
7027
7064
|
memo as memo11
|
|
7028
7065
|
} from "react";
|
|
7029
7066
|
function TableRowUnvirtualizedFn(props) {
|
|
@@ -7046,7 +7083,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
7046
7083
|
}, domProps.style);
|
|
7047
7084
|
const children = columns.map((col) => {
|
|
7048
7085
|
const hidden = false;
|
|
7049
|
-
return /* @__PURE__ */
|
|
7086
|
+
return /* @__PURE__ */ createElement25(InfiniteTableColumnCell, {
|
|
7050
7087
|
key: col.id,
|
|
7051
7088
|
virtualized: false,
|
|
7052
7089
|
rowHeight,
|
|
@@ -7059,7 +7096,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
7059
7096
|
column: col
|
|
7060
7097
|
});
|
|
7061
7098
|
});
|
|
7062
|
-
return /* @__PURE__ */
|
|
7099
|
+
return /* @__PURE__ */ createElement25("div", __spreadProps(__spreadValues({}, domProps), {
|
|
7063
7100
|
style
|
|
7064
7101
|
}), children);
|
|
7065
7102
|
}
|
|
@@ -7108,7 +7145,7 @@ function useUnpinnedRendering(params) {
|
|
|
7108
7145
|
rowProps.repaintId = repaintId;
|
|
7109
7146
|
}
|
|
7110
7147
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
7111
|
-
return /* @__PURE__ */
|
|
7148
|
+
return /* @__PURE__ */ createElement26(TableRowComponent, __spreadValues({}, rowProps));
|
|
7112
7149
|
}, [
|
|
7113
7150
|
repaintId,
|
|
7114
7151
|
rowHeight,
|
|
@@ -7119,7 +7156,7 @@ function useUnpinnedRendering(params) {
|
|
|
7119
7156
|
horizontalVirtualBrain,
|
|
7120
7157
|
verticalVirtualBrain
|
|
7121
7158
|
]);
|
|
7122
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
7159
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ createElement26("div", {
|
|
7123
7160
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
7124
7161
|
style: {
|
|
7125
7162
|
position: "absolute",
|
|
@@ -7130,10 +7167,10 @@ function useUnpinnedRendering(params) {
|
|
|
7130
7167
|
overflow: "auto",
|
|
7131
7168
|
visibility: columnShifts ? "visible" : "hidden"
|
|
7132
7169
|
}
|
|
7133
|
-
}, /* @__PURE__ */
|
|
7170
|
+
}, /* @__PURE__ */ createElement26("div", {
|
|
7134
7171
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
7135
7172
|
})) : null;
|
|
7136
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
7173
|
+
return rowHeight != 0 ? /* @__PURE__ */ createElement26(VirtualRowList, {
|
|
7137
7174
|
repaintId: `${repaintId}-unpinned-`,
|
|
7138
7175
|
brain: verticalVirtualBrain,
|
|
7139
7176
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -7154,7 +7191,7 @@ function useUnpinnedRendering(params) {
|
|
|
7154
7191
|
}
|
|
7155
7192
|
|
|
7156
7193
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
7157
|
-
import { useCallback as useCallback13, useEffect as
|
|
7194
|
+
import { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef16 } from "react";
|
|
7158
7195
|
|
|
7159
7196
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
7160
7197
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -7179,7 +7216,6 @@ var useOnContainerScroll = ({
|
|
|
7179
7216
|
componentState: {
|
|
7180
7217
|
scrollStopDelay,
|
|
7181
7218
|
scrollerDOMRef,
|
|
7182
|
-
domRef,
|
|
7183
7219
|
scrollToBottomOffset,
|
|
7184
7220
|
onScrollToBottom,
|
|
7185
7221
|
onScrollToTop,
|
|
@@ -7196,10 +7232,10 @@ var useOnContainerScroll = ({
|
|
|
7196
7232
|
onScrollStopFromProps == null ? void 0 : onScrollStopFromProps(param);
|
|
7197
7233
|
notifyScrollStop(param);
|
|
7198
7234
|
}, [onScrollStopFromProps, notifyScrollStop]);
|
|
7199
|
-
const timeoutIdRef =
|
|
7200
|
-
const scrollingRef =
|
|
7201
|
-
const scrollTopMaxRef =
|
|
7202
|
-
|
|
7235
|
+
const timeoutIdRef = useRef16(0);
|
|
7236
|
+
const scrollingRef = useRef16(false);
|
|
7237
|
+
const scrollTopMaxRef = useRef16(0);
|
|
7238
|
+
useEffect19(() => {
|
|
7203
7239
|
const { current: node } = scrollerDOMRef;
|
|
7204
7240
|
scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
|
|
7205
7241
|
}, [reservedContentHeight, bodySize.height]);
|
|
@@ -7225,7 +7261,7 @@ var useOnContainerScroll = ({
|
|
|
7225
7261
|
lastVisibleRowIndex: range.renderEndIndex
|
|
7226
7262
|
});
|
|
7227
7263
|
}
|
|
7228
|
-
const classList = (_a =
|
|
7264
|
+
const classList = (_a = scrollerDOMRef.current) == null ? void 0 : _a.classList;
|
|
7229
7265
|
if (!classList) {
|
|
7230
7266
|
return;
|
|
7231
7267
|
}
|
|
@@ -7243,10 +7279,10 @@ var useOnContainerScroll = ({
|
|
|
7243
7279
|
}, [
|
|
7244
7280
|
horizontalVirtualBrain,
|
|
7245
7281
|
verticalVirtualBrain,
|
|
7246
|
-
|
|
7282
|
+
scrollerDOMRef.current,
|
|
7247
7283
|
setScrolling
|
|
7248
7284
|
]);
|
|
7249
|
-
const scrollPositionRef =
|
|
7285
|
+
const scrollPositionRef = useRef16({
|
|
7250
7286
|
scrollLeft: 0,
|
|
7251
7287
|
scrollTop: 0
|
|
7252
7288
|
});
|
|
@@ -7277,21 +7313,21 @@ var useOnContainerScroll = ({
|
|
|
7277
7313
|
|
|
7278
7314
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
7279
7315
|
import {
|
|
7280
|
-
createElement as
|
|
7316
|
+
createElement as createElement28,
|
|
7281
7317
|
useMemo as useMemo10
|
|
7282
7318
|
} from "react";
|
|
7283
7319
|
import { useCallback as useCallback15 } from "react";
|
|
7284
7320
|
|
|
7285
7321
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
7286
7322
|
import {
|
|
7287
|
-
createElement as
|
|
7323
|
+
createElement as createElement27
|
|
7288
7324
|
} from "react";
|
|
7289
|
-
import { useEffect as
|
|
7325
|
+
import { useEffect as useEffect21, useCallback as useCallback14, useRef as useRef17 } from "react";
|
|
7290
7326
|
|
|
7291
7327
|
// src/components/hooks/useOnMount.ts
|
|
7292
|
-
import { useEffect as
|
|
7328
|
+
import { useEffect as useEffect20 } from "react";
|
|
7293
7329
|
function useOnMount(domRef, props) {
|
|
7294
|
-
|
|
7330
|
+
useEffect20(() => {
|
|
7295
7331
|
const { onMount, onUnmount } = props;
|
|
7296
7332
|
const node = domRef == null ? void 0 : domRef.current;
|
|
7297
7333
|
onMount == null ? void 0 : onMount(node);
|
|
@@ -7322,7 +7358,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7322
7358
|
onMount,
|
|
7323
7359
|
onUnmount
|
|
7324
7360
|
} = props;
|
|
7325
|
-
const domRef =
|
|
7361
|
+
const domRef = useRef17(null);
|
|
7326
7362
|
const renderItem = useCallback14((renderProps) => renderRow({
|
|
7327
7363
|
domRef: renderProps.domRef,
|
|
7328
7364
|
rowHeight: renderProps.itemSize,
|
|
@@ -7332,7 +7368,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7332
7368
|
onMount,
|
|
7333
7369
|
onUnmount
|
|
7334
7370
|
});
|
|
7335
|
-
|
|
7371
|
+
useEffect21(() => {
|
|
7336
7372
|
const onScroll = (scrollPosition) => {
|
|
7337
7373
|
const node = domRef.current;
|
|
7338
7374
|
if (node) {
|
|
@@ -7361,7 +7397,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7361
7397
|
if (true) {
|
|
7362
7398
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
7363
7399
|
}
|
|
7364
|
-
return /* @__PURE__ */
|
|
7400
|
+
return /* @__PURE__ */ createElement27("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement27(RawList, {
|
|
7365
7401
|
brain,
|
|
7366
7402
|
renderItem,
|
|
7367
7403
|
repaintId
|
|
@@ -7410,7 +7446,7 @@ function PinnedRowsContainer(props) {
|
|
|
7410
7446
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
7411
7447
|
};
|
|
7412
7448
|
if (hasOverflow) {
|
|
7413
|
-
return /* @__PURE__ */
|
|
7449
|
+
return /* @__PURE__ */ createElement28(VirtualScrollContainer, {
|
|
7414
7450
|
scrollable: {
|
|
7415
7451
|
horizontal: true,
|
|
7416
7452
|
vertical: false
|
|
@@ -7426,18 +7462,18 @@ function PinnedRowsContainer(props) {
|
|
|
7426
7462
|
className: join(PinnedRowsContainerClsVariants({
|
|
7427
7463
|
pinned: pinning
|
|
7428
7464
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
7429
|
-
}, /* @__PURE__ */
|
|
7465
|
+
}, /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
7430
7466
|
onMount: (node) => {
|
|
7431
7467
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
7432
7468
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
7433
7469
|
});
|
|
7434
7470
|
}
|
|
7435
|
-
})), /* @__PURE__ */
|
|
7471
|
+
})), /* @__PURE__ */ createElement28(SpacePlaceholder, {
|
|
7436
7472
|
width: rowWidth,
|
|
7437
7473
|
height: 1
|
|
7438
7474
|
}));
|
|
7439
7475
|
}
|
|
7440
|
-
return /* @__PURE__ */
|
|
7476
|
+
return /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
7441
7477
|
}
|
|
7442
7478
|
function useRenderPinnedRow(params) {
|
|
7443
7479
|
const { getData, getState, columnsWidth, columns, rowSpan, verticalBrain } = params;
|
|
@@ -7458,7 +7494,7 @@ function useRenderPinnedRow(params) {
|
|
|
7458
7494
|
rowWidth: columnsWidth,
|
|
7459
7495
|
columns
|
|
7460
7496
|
}, rowParams);
|
|
7461
|
-
return /* @__PURE__ */
|
|
7497
|
+
return /* @__PURE__ */ createElement28(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
7462
7498
|
}, [columnsWidth, columns, verticalBrain, dataArray]);
|
|
7463
7499
|
return renderPinnedRow;
|
|
7464
7500
|
}
|
|
@@ -7504,7 +7540,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7504
7540
|
columns,
|
|
7505
7541
|
columnsWidth
|
|
7506
7542
|
});
|
|
7507
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
7543
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ createElement28(PinnedRowsContainer, {
|
|
7508
7544
|
pinning: side,
|
|
7509
7545
|
pinnedScrollListener,
|
|
7510
7546
|
hasOverflow,
|
|
@@ -7517,7 +7553,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7517
7553
|
brain: verticalVirtualBrain,
|
|
7518
7554
|
renderRow: renderRowPinned
|
|
7519
7555
|
}) : null;
|
|
7520
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
7556
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ createElement28(HorizontalScrollbarPlaceholder, {
|
|
7521
7557
|
style: side === "end" ? {
|
|
7522
7558
|
width: columnsWidth,
|
|
7523
7559
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -7559,7 +7595,7 @@ function usePinnedStartRendering(params) {
|
|
|
7559
7595
|
}
|
|
7560
7596
|
|
|
7561
7597
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
7562
|
-
import { useEffect as
|
|
7598
|
+
import { useEffect as useEffect22 } from "react";
|
|
7563
7599
|
|
|
7564
7600
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
7565
7601
|
import { useCallback as useCallback16 } from "react";
|
|
@@ -7595,13 +7631,13 @@ function useYourBrain(param) {
|
|
|
7595
7631
|
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
7596
7632
|
globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
|
|
7597
7633
|
}
|
|
7598
|
-
|
|
7634
|
+
useEffect22(() => {
|
|
7599
7635
|
verticalVirtualBrain.setAvailableSize({
|
|
7600
7636
|
height: bodySize.height,
|
|
7601
7637
|
width: 0
|
|
7602
7638
|
});
|
|
7603
7639
|
}, [bodySize, verticalVirtualBrain]);
|
|
7604
|
-
|
|
7640
|
+
useEffect22(() => {
|
|
7605
7641
|
horizontalVirtualBrain.setAvailableSize({
|
|
7606
7642
|
height: 0,
|
|
7607
7643
|
width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
|
|
@@ -7642,7 +7678,7 @@ function useListRendering(param) {
|
|
|
7642
7678
|
horizontalVirtualBrain
|
|
7643
7679
|
} = componentState;
|
|
7644
7680
|
const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
|
|
7645
|
-
const repaintIdRef =
|
|
7681
|
+
const repaintIdRef = useRef18(0);
|
|
7646
7682
|
if (prevDataSourceTimestamp !== dataSourceState.updatedAt || !shallowEqualObjects(prevComputed, computed)) {
|
|
7647
7683
|
repaintIdRef.current++;
|
|
7648
7684
|
}
|
|
@@ -7665,7 +7701,7 @@ function useListRendering(param) {
|
|
|
7665
7701
|
vertical: hasVerticalScrollbar,
|
|
7666
7702
|
horizontal: hasHorizontalScrollbar
|
|
7667
7703
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
7668
|
-
|
|
7704
|
+
useEffect23(() => {
|
|
7669
7705
|
if (!bodySize.height) {
|
|
7670
7706
|
return;
|
|
7671
7707
|
}
|
|
@@ -7721,7 +7757,7 @@ function useListRendering(param) {
|
|
|
7721
7757
|
computedUnpinnedColumns
|
|
7722
7758
|
});
|
|
7723
7759
|
const [, rerender] = useRerender();
|
|
7724
|
-
|
|
7760
|
+
useEffect23(() => {
|
|
7725
7761
|
rerender();
|
|
7726
7762
|
}, [dataSourceState]);
|
|
7727
7763
|
const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
|
|
@@ -7745,12 +7781,12 @@ function useListRendering(param) {
|
|
|
7745
7781
|
|
|
7746
7782
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7747
7783
|
import {
|
|
7748
|
-
createElement as
|
|
7784
|
+
createElement as createElement29,
|
|
7749
7785
|
forwardRef as forwardRef3,
|
|
7750
7786
|
useCallback as useCallback17,
|
|
7751
|
-
useRef as
|
|
7787
|
+
useRef as useRef19
|
|
7752
7788
|
} from "react";
|
|
7753
|
-
import { useEffect as
|
|
7789
|
+
import { useEffect as useEffect24 } from "react";
|
|
7754
7790
|
|
|
7755
7791
|
// src/components/utils/decamelize.ts
|
|
7756
7792
|
function decamelize(str, options) {
|
|
@@ -7787,7 +7823,7 @@ var enforceStyle = (node, style) => {
|
|
|
7787
7823
|
};
|
|
7788
7824
|
var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7789
7825
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7790
|
-
const domRef =
|
|
7826
|
+
const domRef = useRef19(null);
|
|
7791
7827
|
const domCallback = useCallback17((node) => {
|
|
7792
7828
|
domRef.current = node;
|
|
7793
7829
|
if (!ref) {
|
|
@@ -7799,7 +7835,7 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
7799
7835
|
ref.current = node;
|
|
7800
7836
|
}
|
|
7801
7837
|
}, []);
|
|
7802
|
-
|
|
7838
|
+
useEffect24(() => {
|
|
7803
7839
|
const forceStyle = () => {
|
|
7804
7840
|
requestAnimationFrame(() => {
|
|
7805
7841
|
var _a;
|
|
@@ -7813,12 +7849,12 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
7813
7849
|
clearInterval(intervalId);
|
|
7814
7850
|
};
|
|
7815
7851
|
}, []);
|
|
7816
|
-
return /* @__PURE__ */
|
|
7852
|
+
return /* @__PURE__ */ createElement29("div", __spreadProps(__spreadValues({
|
|
7817
7853
|
ref: domCallback
|
|
7818
7854
|
}, props), {
|
|
7819
7855
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7820
7856
|
style: defaultStyle2
|
|
7821
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7857
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement29("a", {
|
|
7822
7858
|
href: "https://infinite-table.com",
|
|
7823
7859
|
rel: "noopener noreferrer",
|
|
7824
7860
|
role: "link",
|
|
@@ -7988,7 +8024,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7988
8024
|
const valid = useMemo12(() => {
|
|
7989
8025
|
let valid2 = isValidLicense(licenseKey, {
|
|
7990
8026
|
publishedAt: 1624970570587,
|
|
7991
|
-
version: "0.2.
|
|
8027
|
+
version: "0.2.19"
|
|
7992
8028
|
});
|
|
7993
8029
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
7994
8030
|
return true;
|
|
@@ -8000,11 +8036,11 @@ var useLicense = (licenseKey = "") => {
|
|
|
8000
8036
|
|
|
8001
8037
|
// src/components/CSSVariableWatch.tsx
|
|
8002
8038
|
import {
|
|
8003
|
-
createElement as
|
|
8039
|
+
createElement as createElement30,
|
|
8004
8040
|
useCallback as useCallback18,
|
|
8005
8041
|
useLayoutEffect as useLayoutEffect4
|
|
8006
8042
|
} from "react";
|
|
8007
|
-
import { useRef as
|
|
8043
|
+
import { useRef as useRef20 } from "react";
|
|
8008
8044
|
var error = err("CSSVariableWatch");
|
|
8009
8045
|
var debug6 = dbg("CSSVariableWatch");
|
|
8010
8046
|
var WRAPPER_STYLE = {
|
|
@@ -8017,7 +8053,7 @@ var WRAPPER_STYLE = {
|
|
|
8017
8053
|
overflow: "hidden"
|
|
8018
8054
|
};
|
|
8019
8055
|
var useCSSVariableWatch = (params) => {
|
|
8020
|
-
const lastValueRef =
|
|
8056
|
+
const lastValueRef = useRef20(0);
|
|
8021
8057
|
const onResize = useCallback18(({ height }) => {
|
|
8022
8058
|
if (height && height !== lastValueRef.current) {
|
|
8023
8059
|
lastValueRef.current = height;
|
|
@@ -8037,15 +8073,15 @@ var useCSSVariableWatch = (params) => {
|
|
|
8037
8073
|
}, []);
|
|
8038
8074
|
};
|
|
8039
8075
|
var CSSVariableWatch = (props) => {
|
|
8040
|
-
const domRef =
|
|
8076
|
+
const domRef = useRef20(null);
|
|
8041
8077
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
8042
8078
|
ref: domRef
|
|
8043
8079
|
}));
|
|
8044
|
-
return /* @__PURE__ */
|
|
8080
|
+
return /* @__PURE__ */ createElement30("div", {
|
|
8045
8081
|
"data-name": "css-variable-watcher",
|
|
8046
8082
|
"data-var": props.varName,
|
|
8047
8083
|
style: WRAPPER_STYLE
|
|
8048
|
-
}, /* @__PURE__ */
|
|
8084
|
+
}, /* @__PURE__ */ createElement30("div", {
|
|
8049
8085
|
ref: domRef,
|
|
8050
8086
|
style: {
|
|
8051
8087
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -8139,7 +8175,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
8139
8175
|
|
|
8140
8176
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
8141
8177
|
import {
|
|
8142
|
-
createElement as
|
|
8178
|
+
createElement as createElement31,
|
|
8143
8179
|
memo as memo12
|
|
8144
8180
|
} from "react";
|
|
8145
8181
|
|
|
@@ -8153,11 +8189,11 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
8153
8189
|
var baseCls = `${rootClassName11}-LoadMask`;
|
|
8154
8190
|
function LoadMaskFn(props) {
|
|
8155
8191
|
const { visible, children = "Loading" } = props;
|
|
8156
|
-
return /* @__PURE__ */
|
|
8192
|
+
return /* @__PURE__ */ createElement31("div", {
|
|
8157
8193
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls}`
|
|
8158
|
-
}, /* @__PURE__ */
|
|
8194
|
+
}, /* @__PURE__ */ createElement31("div", {
|
|
8159
8195
|
className: `${LoadMaskOverlayCls} ${baseCls}-Overlay`
|
|
8160
|
-
}), /* @__PURE__ */
|
|
8196
|
+
}), /* @__PURE__ */ createElement31("div", {
|
|
8161
8197
|
className: `${LoadMaskTextCls} ${baseCls}-Text`
|
|
8162
8198
|
}, children));
|
|
8163
8199
|
}
|
|
@@ -8165,8 +8201,8 @@ var LoadMask = memo12(LoadMaskFn);
|
|
|
8165
8201
|
|
|
8166
8202
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
8167
8203
|
import {
|
|
8168
|
-
useEffect as
|
|
8169
|
-
useRef as
|
|
8204
|
+
useEffect as useEffect25,
|
|
8205
|
+
useRef as useRef21,
|
|
8170
8206
|
useState as useState10
|
|
8171
8207
|
} from "react";
|
|
8172
8208
|
var OFFSET = 10;
|
|
@@ -8236,8 +8272,8 @@ function useAutoSizeColumns() {
|
|
|
8236
8272
|
const [refreshId, setRefreshId] = useState10(0);
|
|
8237
8273
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
8238
8274
|
const getTheKey = useLatest(theKey);
|
|
8239
|
-
const lastExecutedIdentifierRef =
|
|
8240
|
-
|
|
8275
|
+
const lastExecutedIdentifierRef = useRef21(null);
|
|
8276
|
+
useEffect25(() => {
|
|
8241
8277
|
const key = getTheKey();
|
|
8242
8278
|
if (key == null) {
|
|
8243
8279
|
return;
|
|
@@ -8255,7 +8291,7 @@ function useAutoSizeColumns() {
|
|
|
8255
8291
|
removeHorizontal();
|
|
8256
8292
|
};
|
|
8257
8293
|
}, [verticalVirtualBrain, horizontalVirtualBrain]);
|
|
8258
|
-
|
|
8294
|
+
useEffect25(() => {
|
|
8259
8295
|
var _a;
|
|
8260
8296
|
if (theKey == null) {
|
|
8261
8297
|
return;
|
|
@@ -8363,7 +8399,7 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
8363
8399
|
bodySize,
|
|
8364
8400
|
computed
|
|
8365
8401
|
});
|
|
8366
|
-
|
|
8402
|
+
useEffect26(() => {
|
|
8367
8403
|
const dataSourceState = getDataSourceState();
|
|
8368
8404
|
const onChange = debounce((renderRange) => {
|
|
8369
8405
|
dataSourceState.notifyRenderRangeChange(renderRange);
|
|
@@ -8382,35 +8418,35 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
8382
8418
|
}
|
|
8383
8419
|
notifyScrollbarsChange(scrollbars);
|
|
8384
8420
|
}, [scrollbars]);
|
|
8385
|
-
|
|
8421
|
+
useEffect26(() => {
|
|
8386
8422
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
8387
8423
|
}, [scrollStopDelay]);
|
|
8388
8424
|
useAutoSizeColumns();
|
|
8389
|
-
return /* @__PURE__ */
|
|
8425
|
+
return /* @__PURE__ */ createElement32("div", __spreadValues({
|
|
8390
8426
|
ref: domRef
|
|
8391
|
-
}, domProps), header ? /* @__PURE__ */
|
|
8427
|
+
}, domProps), header ? /* @__PURE__ */ createElement32(TableHeaderWrapper, {
|
|
8392
8428
|
brain: horizontalVirtualBrain,
|
|
8393
8429
|
repaintId,
|
|
8394
8430
|
scrollbars
|
|
8395
|
-
}) : null, /* @__PURE__ */
|
|
8431
|
+
}) : null, /* @__PURE__ */ createElement32(InfiniteTableBody, null, /* @__PURE__ */ createElement32(VirtualScrollContainer, {
|
|
8396
8432
|
ref: scrollerDOMRef,
|
|
8397
8433
|
onContainerScroll: applyScrollVertical,
|
|
8398
8434
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
8399
|
-
}, /* @__PURE__ */
|
|
8435
|
+
}, /* @__PURE__ */ createElement32("div", {
|
|
8400
8436
|
className: display.flex
|
|
8401
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
8437
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ createElement32(SpacePlaceholder, {
|
|
8402
8438
|
count: dataArray.length,
|
|
8403
8439
|
width: 0,
|
|
8404
8440
|
height: reservedContentHeight
|
|
8405
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
8441
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ createElement32(LoadMaskCmp, {
|
|
8406
8442
|
visible: loading
|
|
8407
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
8443
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ createElement32(InfiniteTableLicenseFooter, null), /* @__PURE__ */ createElement32("div", {
|
|
8408
8444
|
ref: portalDOMRef,
|
|
8409
8445
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
8410
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
8446
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ createElement32(CSSVariableWatch, {
|
|
8411
8447
|
varName: rowHeightCSSVar,
|
|
8412
8448
|
onChange: onRowHeightCSSVarChange
|
|
8413
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
8449
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ createElement32(CSSVariableWatch, {
|
|
8414
8450
|
varName: headerHeightCSSVar,
|
|
8415
8451
|
onChange: onHeaderHeightCSSVarChange
|
|
8416
8452
|
}) : null);
|
|
@@ -8446,25 +8482,25 @@ function InfiniteTableContextProvider() {
|
|
|
8446
8482
|
}
|
|
8447
8483
|
componentActions.bodySize = bodySize;
|
|
8448
8484
|
}, { earlyAttach: true });
|
|
8449
|
-
|
|
8485
|
+
useEffect26(() => {
|
|
8450
8486
|
return () => {
|
|
8451
8487
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
8452
8488
|
componentState.onHeaderHeightCSSVarChange.destroy();
|
|
8453
8489
|
};
|
|
8454
8490
|
}, []);
|
|
8455
|
-
|
|
8491
|
+
useEffect26(() => {
|
|
8456
8492
|
if (scrollerDOMRef.current) {
|
|
8457
8493
|
scrollerDOMRef.current.scrollTop = 0;
|
|
8458
8494
|
}
|
|
8459
8495
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
8460
8496
|
const TableContext2 = getInfiniteTableContext();
|
|
8461
|
-
return /* @__PURE__ */
|
|
8497
|
+
return /* @__PURE__ */ createElement32(TableContext2.Provider, {
|
|
8462
8498
|
value: contextValue
|
|
8463
|
-
}, /* @__PURE__ */
|
|
8499
|
+
}, /* @__PURE__ */ createElement32(InfiniteTableComponent, null));
|
|
8464
8500
|
}
|
|
8465
8501
|
function InfiniteTable(props) {
|
|
8466
|
-
const table = /* @__PURE__ */
|
|
8467
|
-
return /* @__PURE__ */
|
|
8502
|
+
const table = /* @__PURE__ */ createElement32(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement32(InfiniteTableContextProvider, null));
|
|
8503
|
+
return /* @__PURE__ */ createElement32(StrictMode, null, table);
|
|
8468
8504
|
}
|
|
8469
8505
|
InfiniteTable.defaultProps = {
|
|
8470
8506
|
rowHeight: 40,
|