@infinite-table/infinite-react 0.2.12 → 0.2.15
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 +263 -228
- package/index.esm.js +367 -239
- package/index.js +438 -315
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -637,7 +637,9 @@ __export(exports, {
|
|
|
637
637
|
multisort: () => multisort,
|
|
638
638
|
useComponentState: () => useComponentState,
|
|
639
639
|
useDataSource: () => useDataSource,
|
|
640
|
-
useEffectWithChanges: () => useEffectWithChanges
|
|
640
|
+
useEffectWithChanges: () => useEffectWithChanges,
|
|
641
|
+
useInfiniteColumnCell: () => useInfiniteColumnCell,
|
|
642
|
+
useInfiniteHeaderCell: () => useInfiniteHeaderCell
|
|
641
643
|
});
|
|
642
644
|
|
|
643
645
|
// src/components/utils/debounce.ts
|
|
@@ -655,7 +657,7 @@ function debounce(fn, { wait }) {
|
|
|
655
657
|
}
|
|
656
658
|
|
|
657
659
|
// src/components/InfiniteTable/index.tsx
|
|
658
|
-
var
|
|
660
|
+
var React35 = __toModule(require("react"));
|
|
659
661
|
|
|
660
662
|
// src/components/InfiniteTable/internalProps.ts
|
|
661
663
|
var rootClassName = "Infinite";
|
|
@@ -1484,7 +1486,7 @@ var useInfiniteTable = () => {
|
|
|
1484
1486
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
1485
1487
|
var import_react8 = __toModule(require("react"));
|
|
1486
1488
|
|
|
1487
|
-
// src/components/flexbox/index.
|
|
1489
|
+
// src/components/flexbox/index.ts
|
|
1488
1490
|
var computeFlex = (params) => {
|
|
1489
1491
|
const {
|
|
1490
1492
|
availableSize,
|
|
@@ -2154,7 +2156,7 @@ var sortAscending = (a, b) => a - b;
|
|
|
2154
2156
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
2155
2157
|
var import_react18 = __toModule(require("react"));
|
|
2156
2158
|
|
|
2157
|
-
// src/components/hooks/useComponentState.tsx
|
|
2159
|
+
// src/components/hooks/useComponentState/index.tsx
|
|
2158
2160
|
var React2 = __toModule(require("react"));
|
|
2159
2161
|
var import_react11 = __toModule(require("react"));
|
|
2160
2162
|
|
|
@@ -2216,7 +2218,7 @@ var usePrevious = (value, initialValue) => {
|
|
|
2216
2218
|
return ref.current;
|
|
2217
2219
|
};
|
|
2218
2220
|
|
|
2219
|
-
// src/components/hooks/useComponentState.tsx
|
|
2221
|
+
// src/components/hooks/useComponentState/index.tsx
|
|
2220
2222
|
var notifyChange = (props, propName, newValue) => {
|
|
2221
2223
|
const upperPropName = toUpperFirst(propName);
|
|
2222
2224
|
const callbackPropName = `on${upperPropName}Change`;
|
|
@@ -2539,7 +2541,7 @@ function useColumnGroups() {
|
|
|
2539
2541
|
var import_react17 = __toModule(require("react"));
|
|
2540
2542
|
|
|
2541
2543
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2542
|
-
var
|
|
2544
|
+
var React7 = __toModule(require("react"));
|
|
2543
2545
|
|
|
2544
2546
|
// src/utils/join.ts
|
|
2545
2547
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -2610,6 +2612,12 @@ var userSelect = { none: "_16lm1iwm" };
|
|
|
2610
2612
|
var willChange = { transform: "_16lm1iw19" };
|
|
2611
2613
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2612
2614
|
|
|
2615
|
+
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
2616
|
+
var React6 = __toModule(require("react"));
|
|
2617
|
+
function RenderHookComponent(props) {
|
|
2618
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, props.render(props.renderParam));
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2613
2621
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2614
2622
|
function getGroupColumnRender({
|
|
2615
2623
|
groupIndexForColumn,
|
|
@@ -2620,7 +2628,10 @@ function getGroupColumnRender({
|
|
|
2620
2628
|
var _a, _b, _c;
|
|
2621
2629
|
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2622
2630
|
if (column.renderValue) {
|
|
2623
|
-
value =
|
|
2631
|
+
value = /* @__PURE__ */ React7.createElement(RenderHookComponent, {
|
|
2632
|
+
render: column.renderValue,
|
|
2633
|
+
renderParam: renderOptions
|
|
2634
|
+
});
|
|
2624
2635
|
}
|
|
2625
2636
|
let groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
2626
2637
|
if (!groupRowInfo) {
|
|
@@ -2646,17 +2657,20 @@ function getGroupColumnRender({
|
|
|
2646
2657
|
let icon = null;
|
|
2647
2658
|
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);
|
|
2648
2659
|
if (showExpanderIcon) {
|
|
2649
|
-
const defaultIcon = /* @__PURE__ */
|
|
2660
|
+
const defaultIcon = /* @__PURE__ */ React7.createElement(ExpanderIcon, {
|
|
2650
2661
|
expanded: !collapsed,
|
|
2651
2662
|
onChange: () => {
|
|
2652
2663
|
toggleGroupRow(groupKeys);
|
|
2653
2664
|
}
|
|
2654
2665
|
});
|
|
2655
|
-
icon = column.renderGroupIcon ?
|
|
2666
|
+
icon = column.renderGroupIcon ? /* @__PURE__ */ React7.createElement(RenderHookComponent, {
|
|
2667
|
+
render: column.renderGroupIcon,
|
|
2668
|
+
renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
|
|
2669
|
+
}) : defaultIcon;
|
|
2656
2670
|
}
|
|
2657
|
-
return /* @__PURE__ */
|
|
2671
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
2658
2672
|
className: join(display.flex, alignItems.center)
|
|
2659
|
-
}, icon, /* @__PURE__ */
|
|
2673
|
+
}, icon, /* @__PURE__ */ React7.createElement("div", {
|
|
2660
2674
|
className: cssEllipsisClassName
|
|
2661
2675
|
}, value != null ? value : null));
|
|
2662
2676
|
};
|
|
@@ -2704,7 +2718,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2704
2718
|
let icon = null;
|
|
2705
2719
|
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);
|
|
2706
2720
|
if (showExpanderIcon) {
|
|
2707
|
-
const defaultIcon = /* @__PURE__ */
|
|
2721
|
+
const defaultIcon = /* @__PURE__ */ React7.createElement(ExpanderIcon, {
|
|
2708
2722
|
expanded: !collapsed,
|
|
2709
2723
|
onChange: () => {
|
|
2710
2724
|
toggleGroupRow(rowInfo.groupKeys);
|
|
@@ -2712,9 +2726,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2712
2726
|
});
|
|
2713
2727
|
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2714
2728
|
}
|
|
2715
|
-
return /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
2716
2730
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2717
|
-
}, icon, /* @__PURE__ */
|
|
2731
|
+
}, icon, /* @__PURE__ */ React7.createElement("div", {
|
|
2718
2732
|
className: cssEllipsisClassName
|
|
2719
2733
|
}, value != null ? value : null));
|
|
2720
2734
|
}
|
|
@@ -2733,7 +2747,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2733
2747
|
var import_react16 = __toModule(require("react"));
|
|
2734
2748
|
|
|
2735
2749
|
// src/components/DataSource/index.tsx
|
|
2736
|
-
var
|
|
2750
|
+
var React8 = __toModule(require("react"));
|
|
2737
2751
|
|
|
2738
2752
|
// src/utils/multisort/sortTypes.ts
|
|
2739
2753
|
var numberComparator = function(first, second) {
|
|
@@ -2834,6 +2848,7 @@ var DeepMap = class {
|
|
|
2834
2848
|
this.map = new Map();
|
|
2835
2849
|
this.length = 0;
|
|
2836
2850
|
this.revision = 0;
|
|
2851
|
+
this.emptyKey = Symbol("emptyKey");
|
|
2837
2852
|
this.visit = (fn) => {
|
|
2838
2853
|
this.map.forEach((_, k) => this.visitKey(k, this.map, [], fn));
|
|
2839
2854
|
};
|
|
@@ -2845,13 +2860,19 @@ var DeepMap = class {
|
|
|
2845
2860
|
return;
|
|
2846
2861
|
}
|
|
2847
2862
|
let i = 0;
|
|
2848
|
-
currentMap.
|
|
2863
|
+
const hasEmptyKey = currentMap.has(this.emptyKey);
|
|
2864
|
+
let allowEmptyKey = true;
|
|
2865
|
+
const iterator = (_, key) => {
|
|
2849
2866
|
const pair = currentMap.get(key);
|
|
2850
2867
|
if (!pair) {
|
|
2851
2868
|
return;
|
|
2852
2869
|
}
|
|
2853
2870
|
const { map: map2 } = pair;
|
|
2854
|
-
const
|
|
2871
|
+
const isEmptyKey = key === this.emptyKey;
|
|
2872
|
+
if (isEmptyKey && !allowEmptyKey) {
|
|
2873
|
+
return;
|
|
2874
|
+
}
|
|
2875
|
+
const keys = isEmptyKey ? [] : [...parentKeys, key];
|
|
2855
2876
|
const next = map2 ? () => this.visitWithNext(keys, fn, map2) : void 0;
|
|
2856
2877
|
if (pair.hasOwnProperty("value")) {
|
|
2857
2878
|
fn(pair.value, keys, i, next);
|
|
@@ -2859,7 +2880,13 @@ var DeepMap = class {
|
|
|
2859
2880
|
} else {
|
|
2860
2881
|
next == null ? void 0 : next();
|
|
2861
2882
|
}
|
|
2862
|
-
}
|
|
2883
|
+
};
|
|
2884
|
+
if (hasEmptyKey) {
|
|
2885
|
+
iterator(void 0, this.emptyKey);
|
|
2886
|
+
allowEmptyKey = false;
|
|
2887
|
+
i = 0;
|
|
2888
|
+
}
|
|
2889
|
+
currentMap.forEach(iterator);
|
|
2863
2890
|
};
|
|
2864
2891
|
if (initial) {
|
|
2865
2892
|
initial.forEach((entry) => {
|
|
@@ -2878,7 +2905,7 @@ var DeepMap = class {
|
|
|
2878
2905
|
set(keys, value) {
|
|
2879
2906
|
let currentMap = this.map;
|
|
2880
2907
|
if (!keys.length) {
|
|
2881
|
-
|
|
2908
|
+
keys = [this.emptyKey];
|
|
2882
2909
|
}
|
|
2883
2910
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2884
2911
|
const key = keys[i];
|
|
@@ -2904,7 +2931,7 @@ var DeepMap = class {
|
|
|
2904
2931
|
var _a;
|
|
2905
2932
|
let currentMap = this.map;
|
|
2906
2933
|
if (!keys.length) {
|
|
2907
|
-
|
|
2934
|
+
keys = [this.emptyKey];
|
|
2908
2935
|
}
|
|
2909
2936
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
2910
2937
|
const key = keys[i];
|
|
@@ -2939,10 +2966,11 @@ var DeepMap = class {
|
|
|
2939
2966
|
this.revision = 0;
|
|
2940
2967
|
}
|
|
2941
2968
|
delete(keys) {
|
|
2942
|
-
keys = [...keys];
|
|
2943
2969
|
let currentMap = this.map;
|
|
2944
2970
|
if (!keys.length) {
|
|
2945
|
-
|
|
2971
|
+
keys = [this.emptyKey];
|
|
2972
|
+
} else {
|
|
2973
|
+
keys = [...keys];
|
|
2946
2974
|
}
|
|
2947
2975
|
let maps = [currentMap];
|
|
2948
2976
|
let result = false;
|
|
@@ -2995,7 +3023,7 @@ var DeepMap = class {
|
|
|
2995
3023
|
has(keys) {
|
|
2996
3024
|
let currentMap = this.map;
|
|
2997
3025
|
if (!keys.length) {
|
|
2998
|
-
|
|
3026
|
+
keys = [this.emptyKey];
|
|
2999
3027
|
}
|
|
3000
3028
|
for (let i = 0, len = keys.length; i < len; i++) {
|
|
3001
3029
|
const key = keys[i];
|
|
@@ -3019,7 +3047,7 @@ var DeepMap = class {
|
|
|
3019
3047
|
return;
|
|
3020
3048
|
}
|
|
3021
3049
|
const { map: map2 } = pair;
|
|
3022
|
-
const keys = [...parentKeys, key];
|
|
3050
|
+
const keys = key === this.emptyKey ? [] : [...parentKeys, key];
|
|
3023
3051
|
const next = once(() => {
|
|
3024
3052
|
if (map2) {
|
|
3025
3053
|
map2.forEach((_, k) => {
|
|
@@ -3035,7 +3063,12 @@ var DeepMap = class {
|
|
|
3035
3063
|
getArray(fn) {
|
|
3036
3064
|
const result = [];
|
|
3037
3065
|
this.visit((pair, keys) => {
|
|
3038
|
-
|
|
3066
|
+
const res = fn(__spreadProps(__spreadValues({}, pair), { keys }));
|
|
3067
|
+
if (keys.length === 0) {
|
|
3068
|
+
result.splice(0, 0, res);
|
|
3069
|
+
} else {
|
|
3070
|
+
result.push(res);
|
|
3071
|
+
}
|
|
3039
3072
|
});
|
|
3040
3073
|
return result;
|
|
3041
3074
|
}
|
|
@@ -3121,7 +3154,7 @@ function lazyGroup(groupParams, rootData) {
|
|
|
3121
3154
|
} = groupParams;
|
|
3122
3155
|
const deepMap = new DeepMap();
|
|
3123
3156
|
function traverseValues(pivotDeepMap, container, pivot2, pivotIndex = 0, currentPivotKeys2 = []) {
|
|
3124
|
-
const last = pivotIndex === pivot2.length - 1;
|
|
3157
|
+
const last = !pivot2.length || pivotIndex === pivot2.length - 1;
|
|
3125
3158
|
const values = container[(mappings == null ? void 0 : mappings.values) || "values"] || {};
|
|
3126
3159
|
for (var k in values)
|
|
3127
3160
|
if (values.hasOwnProperty(k)) {
|
|
@@ -3145,7 +3178,7 @@ function lazyGroup(groupParams, rootData) {
|
|
|
3145
3178
|
rootData.visitDepthFirst((lazyGroupRowInfo, keys, _index, next) => {
|
|
3146
3179
|
const [_rootKey, ...currentGroupKeys] = keys;
|
|
3147
3180
|
const dataArray = lazyGroupRowInfo.items;
|
|
3148
|
-
if (currentGroupKeys.length == groupBy.length) {
|
|
3181
|
+
if (currentGroupKeys.length == groupBy.length && groupBy.length) {
|
|
3149
3182
|
const deepMapGroupValue = deepMap.get(currentGroupKeys);
|
|
3150
3183
|
if (deepMapGroupValue) {
|
|
3151
3184
|
deepMapGroupValue.items = dataArray;
|
|
@@ -3167,9 +3200,11 @@ function lazyGroup(groupParams, rootData) {
|
|
|
3167
3200
|
const dataObject = dataArray[i].data;
|
|
3168
3201
|
const dataKeys = dataArray[i].keys;
|
|
3169
3202
|
let item = dataObject;
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3203
|
+
if (dataKeys.length) {
|
|
3204
|
+
const { field: groupByProperty } = groupBy[dataKeys.length - 1];
|
|
3205
|
+
const key = item[groupByProperty];
|
|
3206
|
+
currentGroupKeys.push(key);
|
|
3207
|
+
}
|
|
3173
3208
|
const deepMapGroupValue = {
|
|
3174
3209
|
items: [],
|
|
3175
3210
|
commonData: dataObject,
|
|
@@ -3181,7 +3216,9 @@ function lazyGroup(groupParams, rootData) {
|
|
|
3181
3216
|
const pivotContainer = dataArray[i].pivot;
|
|
3182
3217
|
traverseValues(pivotDeepMap, pivotContainer, pivot, 0, currentPivotKeys);
|
|
3183
3218
|
}
|
|
3184
|
-
|
|
3219
|
+
if (dataKeys.length) {
|
|
3220
|
+
currentGroupKeys.pop();
|
|
3221
|
+
}
|
|
3185
3222
|
}
|
|
3186
3223
|
next == null ? void 0 : next();
|
|
3187
3224
|
});
|
|
@@ -3197,6 +3234,37 @@ function lazyGroup(groupParams, rootData) {
|
|
|
3197
3234
|
}
|
|
3198
3235
|
return result;
|
|
3199
3236
|
}
|
|
3237
|
+
function processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, pivot, reducers, topLevelPivotColumns, initialReducerValue, defaultToKey = DEFAULT_TO_KEY) {
|
|
3238
|
+
const {
|
|
3239
|
+
items: currentGroupItems,
|
|
3240
|
+
reducerResults,
|
|
3241
|
+
pivotDeepMap
|
|
3242
|
+
} = deepMap.get(currentGroupKeys);
|
|
3243
|
+
currentGroupItems.push(item);
|
|
3244
|
+
if (reducers) {
|
|
3245
|
+
computeReducersFor(item, reducers, reducerResults);
|
|
3246
|
+
}
|
|
3247
|
+
if (pivot) {
|
|
3248
|
+
for (let pivotIndex = 0, pivotLength = pivot.length; pivotIndex < pivotLength; pivotIndex++) {
|
|
3249
|
+
const { field: pivotField, toKey: pivotToKey } = pivot[pivotIndex];
|
|
3250
|
+
const pivotKey = (pivotToKey || defaultToKey)(item[pivotField], item);
|
|
3251
|
+
currentPivotKeys.push(pivotKey);
|
|
3252
|
+
if (!pivotDeepMap.has(currentPivotKeys)) {
|
|
3253
|
+
topLevelPivotColumns.set(currentPivotKeys, true);
|
|
3254
|
+
pivotDeepMap == null ? void 0 : pivotDeepMap.set(currentPivotKeys, {
|
|
3255
|
+
reducerResults: __spreadValues({}, initialReducerValue),
|
|
3256
|
+
items: []
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3259
|
+
const { reducerResults: pivotReducerResults, items: pivotGroupItems } = pivotDeepMap.get(currentPivotKeys);
|
|
3260
|
+
pivotGroupItems.push(item);
|
|
3261
|
+
if (reducers) {
|
|
3262
|
+
computeReducersFor(item, reducers, pivotReducerResults);
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
currentPivotKeys.length = 0;
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3200
3268
|
function group(groupParams, data) {
|
|
3201
3269
|
const {
|
|
3202
3270
|
groupBy,
|
|
@@ -3211,6 +3279,16 @@ function group(groupParams, data) {
|
|
|
3211
3279
|
let currentPivotKeys = [];
|
|
3212
3280
|
const initialReducerValue = initReducers(reducers);
|
|
3213
3281
|
const globalReducerResults = __spreadValues({}, initialReducerValue);
|
|
3282
|
+
if (!groupByLength) {
|
|
3283
|
+
const deepMapGroupValue = {
|
|
3284
|
+
items: [],
|
|
3285
|
+
reducerResults: __spreadValues({}, initialReducerValue)
|
|
3286
|
+
};
|
|
3287
|
+
if (pivot) {
|
|
3288
|
+
deepMapGroupValue.pivotDeepMap = new DeepMap();
|
|
3289
|
+
}
|
|
3290
|
+
deepMap.set(currentGroupKeys, deepMapGroupValue);
|
|
3291
|
+
}
|
|
3214
3292
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
3215
3293
|
let item = data[i];
|
|
3216
3294
|
for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
|
|
@@ -3227,38 +3305,10 @@ function group(groupParams, data) {
|
|
|
3227
3305
|
}
|
|
3228
3306
|
deepMap.set(currentGroupKeys, deepMapGroupValue);
|
|
3229
3307
|
}
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
} = deepMap.get(currentGroupKeys);
|
|
3235
|
-
currentGroupItems.push(item);
|
|
3236
|
-
if (reducers) {
|
|
3237
|
-
computeReducersFor(item, reducers, reducerResults);
|
|
3238
|
-
}
|
|
3239
|
-
if (pivot) {
|
|
3240
|
-
for (let pivotIndex = 0, pivotLength = pivot.length; pivotIndex < pivotLength; pivotIndex++) {
|
|
3241
|
-
const { field: pivotField, toKey: pivotToKey } = pivot[pivotIndex];
|
|
3242
|
-
const pivotKey = (pivotToKey || defaultToKey)(item[pivotField], item);
|
|
3243
|
-
currentPivotKeys.push(pivotKey);
|
|
3244
|
-
if (!pivotDeepMap.has(currentPivotKeys)) {
|
|
3245
|
-
topLevelPivotColumns.set(currentPivotKeys, true);
|
|
3246
|
-
pivotDeepMap == null ? void 0 : pivotDeepMap.set(currentPivotKeys, {
|
|
3247
|
-
reducerResults: __spreadValues({}, initialReducerValue),
|
|
3248
|
-
items: []
|
|
3249
|
-
});
|
|
3250
|
-
}
|
|
3251
|
-
const {
|
|
3252
|
-
reducerResults: pivotReducerResults,
|
|
3253
|
-
items: pivotGroupItems
|
|
3254
|
-
} = pivotDeepMap.get(currentPivotKeys);
|
|
3255
|
-
pivotGroupItems.push(item);
|
|
3256
|
-
if (reducers) {
|
|
3257
|
-
computeReducersFor(item, reducers, pivotReducerResults);
|
|
3258
|
-
}
|
|
3259
|
-
}
|
|
3260
|
-
currentPivotKeys.length = 0;
|
|
3261
|
-
}
|
|
3308
|
+
processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, pivot, reducers, topLevelPivotColumns, initialReducerValue, defaultToKey);
|
|
3309
|
+
}
|
|
3310
|
+
if (!groupByLength) {
|
|
3311
|
+
processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, pivot, reducers, topLevelPivotColumns, initialReducerValue, defaultToKey);
|
|
3262
3312
|
}
|
|
3263
3313
|
if (reducers) {
|
|
3264
3314
|
computeReducersFor(item, reducers, globalReducerResults);
|
|
@@ -3502,7 +3552,7 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
3502
3552
|
};
|
|
3503
3553
|
if (componentState.livePagination !== void 0) {
|
|
3504
3554
|
dataSourceParams.livePaginationCursor = componentState.livePaginationCursor;
|
|
3505
|
-
dataSourceParams.
|
|
3555
|
+
dataSourceParams.__cursorId = componentState.cursorId;
|
|
3506
3556
|
}
|
|
3507
3557
|
if (componentState.lazyLoad) {
|
|
3508
3558
|
if (componentState.lazyLoadBatchSize != null && componentState.lazyLoadBatchSize > 0) {
|
|
@@ -3533,7 +3583,7 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3533
3583
|
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3534
3584
|
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
|
|
3535
3585
|
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3536
|
-
if (existingGroupRowInfo && existingGroupRowInfo.cache) {
|
|
3586
|
+
if (existingGroupRowInfo && existingGroupRowInfo.cache && key.length > 1) {
|
|
3537
3587
|
const items = existingGroupRowInfo.items;
|
|
3538
3588
|
const len = items.length;
|
|
3539
3589
|
let allLoaded = true;
|
|
@@ -3599,10 +3649,14 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3599
3649
|
lazyGroupData.set(key, newGroupRowInfo);
|
|
3600
3650
|
}
|
|
3601
3651
|
skipAssign = true;
|
|
3602
|
-
|
|
3652
|
+
let skipTriggerChangeAsAlreadyOriginalArrayWasUpdated = false;
|
|
3603
3653
|
if (!dataParams.groupKeys || !dataParams.groupKeys.length) {
|
|
3604
3654
|
const topLevelItems = lazyGroupData.get([LAZY_ROOT_KEY_FOR_GROUPS]);
|
|
3605
3655
|
actions.originalDataArray = [...topLevelItems.items];
|
|
3656
|
+
skipTriggerChangeAsAlreadyOriginalArrayWasUpdated = true;
|
|
3657
|
+
}
|
|
3658
|
+
if (!skipTriggerChangeAsAlreadyOriginalArrayWasUpdated) {
|
|
3659
|
+
actions.originalLazyGroupDataChangeDetect = getChangeDetect();
|
|
3606
3660
|
}
|
|
3607
3661
|
}
|
|
3608
3662
|
} else {
|
|
@@ -3688,7 +3742,8 @@ function useLoadData() {
|
|
|
3688
3742
|
const componentState2 = getComponentState();
|
|
3689
3743
|
if (initialRef.current) {
|
|
3690
3744
|
initialRef.current = false;
|
|
3691
|
-
|
|
3745
|
+
const dataParams = buildDataSourceDataParams(componentState2);
|
|
3746
|
+
actions.dataParams = dataParams;
|
|
3692
3747
|
}
|
|
3693
3748
|
}, depsObject);
|
|
3694
3749
|
}
|
|
@@ -3701,7 +3756,6 @@ function useLazyLoadRange() {
|
|
|
3701
3756
|
const loadingCache = (0, import_react15.useMemo)(() => {
|
|
3702
3757
|
return new Map();
|
|
3703
3758
|
}, [componentState.data]);
|
|
3704
|
-
globalThis.loadingCache = loadingCache;
|
|
3705
3759
|
const {
|
|
3706
3760
|
lazyLoadBatchSize,
|
|
3707
3761
|
notifyRenderRangeChange,
|
|
@@ -3709,13 +3763,13 @@ function useLazyLoadRange() {
|
|
|
3709
3763
|
scrollStopDelayUpdatedByTable
|
|
3710
3764
|
} = componentState;
|
|
3711
3765
|
const latestRenderRangeRef = (0, import_react15.useRef)(null);
|
|
3712
|
-
const loadRange = (
|
|
3766
|
+
const loadRange = (renderRange, cache = loadingCache) => {
|
|
3713
3767
|
const componentState2 = getComponentState();
|
|
3714
|
-
|
|
3715
|
-
if (!
|
|
3768
|
+
renderRange = renderRange || latestRenderRangeRef.current;
|
|
3769
|
+
if (!renderRange) {
|
|
3716
3770
|
return;
|
|
3717
3771
|
}
|
|
3718
|
-
const { renderStartIndex: startIndex, renderEndIndex: endIndex } =
|
|
3772
|
+
const { renderStartIndex: startIndex, renderEndIndex: endIndex } = renderRange;
|
|
3719
3773
|
if (!lazyLoadBatchSize || lazyLoadBatchSize <= 0) {
|
|
3720
3774
|
return;
|
|
3721
3775
|
}
|
|
@@ -3730,9 +3784,9 @@ function useLazyLoadRange() {
|
|
|
3730
3784
|
const debouncedLoadRange = (0, import_react15.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
3731
3785
|
(0, import_react15.useEffect)(() => {
|
|
3732
3786
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3733
|
-
return notifyRenderRangeChange.onChange((
|
|
3734
|
-
latestRenderRangeRef.current =
|
|
3735
|
-
loadRange(
|
|
3787
|
+
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
3788
|
+
latestRenderRangeRef.current = renderRange;
|
|
3789
|
+
loadRange(renderRange, loadingCache);
|
|
3736
3790
|
});
|
|
3737
3791
|
}
|
|
3738
3792
|
return;
|
|
@@ -4143,7 +4197,7 @@ function getInterceptActions() {
|
|
|
4143
4197
|
},
|
|
4144
4198
|
cursorId: (cursorId, { actions, state }) => {
|
|
4145
4199
|
const dataParams = buildDataSourceDataParams(state, {
|
|
4146
|
-
cursorId
|
|
4200
|
+
__cursorId: cursorId
|
|
4147
4201
|
});
|
|
4148
4202
|
actions.dataParams = dataParams;
|
|
4149
4203
|
},
|
|
@@ -4168,7 +4222,7 @@ function getInterceptActions() {
|
|
|
4168
4222
|
|
|
4169
4223
|
// src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts
|
|
4170
4224
|
function prepareColumn(column) {
|
|
4171
|
-
const { pivotByAtIndex: pivotByForColumn } = column;
|
|
4225
|
+
const { pivotByAtIndex: pivotByForColumn, pivotAggregator } = column;
|
|
4172
4226
|
if (pivotByForColumn == null ? void 0 : pivotByForColumn.column) {
|
|
4173
4227
|
if (typeof pivotByForColumn.column === "function") {
|
|
4174
4228
|
Object.assign(column, pivotByForColumn.column({ column }));
|
|
@@ -4176,6 +4230,13 @@ function prepareColumn(column) {
|
|
|
4176
4230
|
Object.assign(column, pivotByForColumn.column);
|
|
4177
4231
|
}
|
|
4178
4232
|
}
|
|
4233
|
+
if (pivotAggregator == null ? void 0 : pivotAggregator.pivotColumn) {
|
|
4234
|
+
if (typeof pivotAggregator.pivotColumn === "function") {
|
|
4235
|
+
Object.assign(column, pivotAggregator.pivotColumn({ column }));
|
|
4236
|
+
} else {
|
|
4237
|
+
Object.assign(column, pivotAggregator.pivotColumn);
|
|
4238
|
+
}
|
|
4239
|
+
}
|
|
4179
4240
|
return column;
|
|
4180
4241
|
}
|
|
4181
4242
|
function prepareColumnGroup(columnGroup) {
|
|
@@ -4306,7 +4367,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
4306
4367
|
next == null ? void 0 : next();
|
|
4307
4368
|
}
|
|
4308
4369
|
});
|
|
4309
|
-
if (
|
|
4370
|
+
if (!pivotLength) {
|
|
4310
4371
|
aggregationReducers.forEach((reducer, index) => {
|
|
4311
4372
|
columns.set(`total:${reducer.id}`, prepareColumn({
|
|
4312
4373
|
header: `${reducer.name || reducer.id} total`,
|
|
@@ -4479,7 +4540,7 @@ function DataSourceWithContext(props) {
|
|
|
4479
4540
|
if (typeof children === "function") {
|
|
4480
4541
|
children = children(computedValues);
|
|
4481
4542
|
}
|
|
4482
|
-
return /* @__PURE__ */
|
|
4543
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
4483
4544
|
}
|
|
4484
4545
|
var DataSourceRoot = getComponentStateRoot({
|
|
4485
4546
|
initSetupState: initSetupState2,
|
|
@@ -4502,14 +4563,14 @@ function DataSourceCmp({ children }) {
|
|
|
4502
4563
|
globalThis.getDataSourceState = getState;
|
|
4503
4564
|
}
|
|
4504
4565
|
useLoadData();
|
|
4505
|
-
return /* @__PURE__ */
|
|
4566
|
+
return /* @__PURE__ */ React8.createElement(DataSourceContext.Provider, {
|
|
4506
4567
|
value: contextValue
|
|
4507
|
-
}, /* @__PURE__ */
|
|
4568
|
+
}, /* @__PURE__ */ React8.createElement(DataSourceWithContext, {
|
|
4508
4569
|
children
|
|
4509
4570
|
}));
|
|
4510
4571
|
}
|
|
4511
4572
|
function DataSource(props) {
|
|
4512
|
-
return /* @__PURE__ */
|
|
4573
|
+
return /* @__PURE__ */ React8.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React8.createElement(DataSourceCmp, {
|
|
4513
4574
|
children: props.children
|
|
4514
4575
|
}));
|
|
4515
4576
|
}
|
|
@@ -4838,7 +4899,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4838
4899
|
}, toggleGroupRow, groupColumn);
|
|
4839
4900
|
computedColumns.set(generatedGroupColumn.id || `group-by-${groupByForColumn.field}`, generatedGroupColumn);
|
|
4840
4901
|
});
|
|
4841
|
-
} else if (groupRenderStrategy === "single-column") {
|
|
4902
|
+
} else if (groupRenderStrategy === "single-column" && groupBy.length) {
|
|
4842
4903
|
const singleGroupColumn = getSingleGroupColumn({
|
|
4843
4904
|
groupCount: groupBy.length,
|
|
4844
4905
|
groupBy,
|
|
@@ -4848,7 +4909,14 @@ function getColumnsWhenGrouping(params) {
|
|
|
4848
4909
|
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
4849
4910
|
}
|
|
4850
4911
|
if (pivotColumns) {
|
|
4912
|
+
const columnsByField = {};
|
|
4913
|
+
columns.forEach((col) => {
|
|
4914
|
+
if (col.field) {
|
|
4915
|
+
columnsByField[col.field] = col;
|
|
4916
|
+
}
|
|
4917
|
+
});
|
|
4851
4918
|
pivotColumns.forEach((col, key) => {
|
|
4919
|
+
var _a, _b;
|
|
4852
4920
|
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
4853
4921
|
return;
|
|
4854
4922
|
}
|
|
@@ -4864,6 +4932,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
4864
4932
|
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
4865
4933
|
}
|
|
4866
4934
|
}
|
|
4935
|
+
if (column.inheritFromColumn !== false) {
|
|
4936
|
+
const colToInheritFrom = typeof column.inheritFromColumn === "string" ? columns.get(column.inheritFromColumn) : ((_a = column.pivotAggregator) == null ? void 0 : _a.field) ? columnsByField[(_b = column.pivotAggregator) == null ? void 0 : _b.field] : void 0;
|
|
4937
|
+
column = __spreadValues(__spreadValues({}, colToInheritFrom), column);
|
|
4938
|
+
}
|
|
4867
4939
|
if (!column.render && column.renderValue) {
|
|
4868
4940
|
column.render = (renderOptions) => {
|
|
4869
4941
|
return column.renderValue(renderOptions);
|
|
@@ -5035,7 +5107,7 @@ function useComputed() {
|
|
|
5035
5107
|
}
|
|
5036
5108
|
|
|
5037
5109
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5038
|
-
var
|
|
5110
|
+
var React9 = __toModule(require("react"));
|
|
5039
5111
|
|
|
5040
5112
|
// src/components/InfiniteTable/hooks/useInternalProps.ts
|
|
5041
5113
|
var useInternalProps = () => {
|
|
@@ -5043,9 +5115,9 @@ var useInternalProps = () => {
|
|
|
5043
5115
|
};
|
|
5044
5116
|
|
|
5045
5117
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
5046
|
-
var InfiniteTableBody =
|
|
5118
|
+
var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
5047
5119
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
5048
|
-
return /* @__PURE__ */
|
|
5120
|
+
return /* @__PURE__ */ React9.createElement("div", __spreadProps(__spreadValues({
|
|
5049
5121
|
ref
|
|
5050
5122
|
}, props), {
|
|
5051
5123
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -5053,16 +5125,16 @@ var InfiniteTableBody = React8.forwardRef(function InfiniteTableBody2(props, ref
|
|
|
5053
5125
|
});
|
|
5054
5126
|
|
|
5055
5127
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
5056
|
-
var
|
|
5128
|
+
var React21 = __toModule(require("react"));
|
|
5057
5129
|
|
|
5058
5130
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
5059
|
-
var
|
|
5131
|
+
var React10 = __toModule(require("react"));
|
|
5060
5132
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
5061
5133
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
5062
5134
|
if (!scrollbarWidth2) {
|
|
5063
5135
|
return null;
|
|
5064
5136
|
}
|
|
5065
|
-
return /* @__PURE__ */
|
|
5137
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
5066
5138
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
5067
5139
|
style: __spreadValues({
|
|
5068
5140
|
position: "absolute",
|
|
@@ -5072,13 +5144,13 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
5072
5144
|
}, props.style)
|
|
5073
5145
|
});
|
|
5074
5146
|
}
|
|
5075
|
-
var HorizontalScrollbarPlaceholder =
|
|
5147
|
+
var HorizontalScrollbarPlaceholder = React10.memo(HorizontalScrollbarPlaceholderFn);
|
|
5076
5148
|
function VerticalScrollbarPlaceholderFn(props) {
|
|
5077
5149
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
5078
5150
|
if (!scrollbarWidth2) {
|
|
5079
5151
|
return null;
|
|
5080
5152
|
}
|
|
5081
|
-
return /* @__PURE__ */
|
|
5153
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
5082
5154
|
"data-name": "vertical-scrollbar-placeholder",
|
|
5083
5155
|
style: __spreadValues({
|
|
5084
5156
|
position: "absolute",
|
|
@@ -5088,7 +5160,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
5088
5160
|
}, props.style)
|
|
5089
5161
|
});
|
|
5090
5162
|
}
|
|
5091
|
-
var VerticalScrollbarPlaceholder =
|
|
5163
|
+
var VerticalScrollbarPlaceholder = React10.memo(VerticalScrollbarPlaceholderFn);
|
|
5092
5164
|
|
|
5093
5165
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5094
5166
|
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -5103,15 +5175,15 @@ var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
|
5103
5175
|
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
5104
5176
|
|
|
5105
5177
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5106
|
-
var
|
|
5178
|
+
var React17 = __toModule(require("react"));
|
|
5107
5179
|
var import_react26 = __toModule(require("react"));
|
|
5108
5180
|
|
|
5109
5181
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5110
|
-
var
|
|
5182
|
+
var React13 = __toModule(require("react"));
|
|
5111
5183
|
var import_react22 = __toModule(require("react"));
|
|
5112
5184
|
|
|
5113
5185
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5114
|
-
var
|
|
5186
|
+
var React11 = __toModule(require("react"));
|
|
5115
5187
|
|
|
5116
5188
|
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
5117
5189
|
var import_react19 = __toModule(require("react"));
|
|
@@ -5133,7 +5205,7 @@ var { rootClassName: rootClassName2 } = internalProps;
|
|
|
5133
5205
|
var InfiniteTableCellClassName = `${rootClassName2}Cell`;
|
|
5134
5206
|
var InfiniteTableCellContentClassName = `${rootClassName2}Cell_content`;
|
|
5135
5207
|
function InfiniteTableCellFn(props) {
|
|
5136
|
-
var _b, _c;
|
|
5208
|
+
var _b, _c, _d, _e;
|
|
5137
5209
|
const _a = props, {
|
|
5138
5210
|
cssEllipsis = true,
|
|
5139
5211
|
virtualized = true,
|
|
@@ -5141,10 +5213,12 @@ function InfiniteTableCellFn(props) {
|
|
|
5141
5213
|
offsetProperty = "left",
|
|
5142
5214
|
column,
|
|
5143
5215
|
domRef,
|
|
5144
|
-
children,
|
|
5145
5216
|
afterChildren,
|
|
5146
5217
|
beforeChildren,
|
|
5147
|
-
offset
|
|
5218
|
+
offset,
|
|
5219
|
+
cellType,
|
|
5220
|
+
cssPosition: _cssPosition,
|
|
5221
|
+
renderChildren
|
|
5148
5222
|
} = _a, domProps = __objRest(_a, [
|
|
5149
5223
|
"cssEllipsis",
|
|
5150
5224
|
"virtualized",
|
|
@@ -5152,11 +5226,14 @@ function InfiniteTableCellFn(props) {
|
|
|
5152
5226
|
"offsetProperty",
|
|
5153
5227
|
"column",
|
|
5154
5228
|
"domRef",
|
|
5155
|
-
"children",
|
|
5156
5229
|
"afterChildren",
|
|
5157
5230
|
"beforeChildren",
|
|
5158
|
-
"offset"
|
|
5231
|
+
"offset",
|
|
5232
|
+
"cellType",
|
|
5233
|
+
"cssPosition",
|
|
5234
|
+
"renderChildren"
|
|
5159
5235
|
]);
|
|
5236
|
+
const children = renderChildren();
|
|
5160
5237
|
const { columnShifts } = useInfiniteTableState();
|
|
5161
5238
|
const shifting = !!columnShifts;
|
|
5162
5239
|
const style = __spreadValues({
|
|
@@ -5171,16 +5248,23 @@ function InfiniteTableCellFn(props) {
|
|
|
5171
5248
|
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
5172
5249
|
}
|
|
5173
5250
|
}
|
|
5174
|
-
|
|
5175
|
-
ref: domRef,
|
|
5251
|
+
const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
|
|
5176
5252
|
style,
|
|
5177
|
-
"data-name":
|
|
5178
|
-
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}` : "")
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5253
|
+
"data-name": "Cell",
|
|
5254
|
+
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__ */ React11.createElement(React11.Fragment, null, beforeChildren, /* @__PURE__ */ React11.createElement("div", {
|
|
5256
|
+
className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
|
|
5257
|
+
}, children), afterChildren)
|
|
5258
|
+
});
|
|
5259
|
+
const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
|
|
5260
|
+
if (RenderComponent) {
|
|
5261
|
+
return /* @__PURE__ */ React11.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5262
|
+
}
|
|
5263
|
+
return /* @__PURE__ */ React11.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5264
|
+
ref: domRef
|
|
5265
|
+
}));
|
|
5182
5266
|
}
|
|
5183
|
-
var InfiniteTableCell =
|
|
5267
|
+
var InfiniteTableCell = React11.memo(InfiniteTableCellFn);
|
|
5184
5268
|
|
|
5185
5269
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
5186
5270
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
@@ -5375,7 +5459,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
5375
5459
|
var import_react_dom = __toModule(require("react-dom"));
|
|
5376
5460
|
|
|
5377
5461
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5378
|
-
var
|
|
5462
|
+
var React12 = __toModule(require("react"));
|
|
5379
5463
|
var import_react21 = __toModule(require("react"));
|
|
5380
5464
|
var defaultLineStyle = {
|
|
5381
5465
|
marginTop: 2,
|
|
@@ -5430,23 +5514,24 @@ function SortIcon(props) {
|
|
|
5430
5514
|
if (direction === -1) {
|
|
5431
5515
|
indexStyle.top = "100%";
|
|
5432
5516
|
}
|
|
5433
|
-
return /* @__PURE__ */
|
|
5517
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
5434
5518
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5435
5519
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5436
|
-
}, showIndex ? /* @__PURE__ */
|
|
5520
|
+
}, showIndex ? /* @__PURE__ */ React12.createElement("div", {
|
|
5437
5521
|
"data-name": "index",
|
|
5438
5522
|
style: indexStyle
|
|
5439
|
-
}, index) : null, /* @__PURE__ */
|
|
5523
|
+
}, index) : null, /* @__PURE__ */ React12.createElement("div", {
|
|
5440
5524
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5441
5525
|
onTransitionEnd
|
|
5442
|
-
}), /* @__PURE__ */
|
|
5526
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
5443
5527
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5444
|
-
}), /* @__PURE__ */
|
|
5528
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
5445
5529
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5446
5530
|
}));
|
|
5447
5531
|
}
|
|
5448
5532
|
|
|
5449
5533
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
5534
|
+
var InfiniteTableHeaderCellContext = React13.createContext(null);
|
|
5450
5535
|
var defaultStyle = {
|
|
5451
5536
|
position: "absolute",
|
|
5452
5537
|
top: 0
|
|
@@ -5465,24 +5550,33 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5465
5550
|
}
|
|
5466
5551
|
const sortInfo = column.computedSortInfo;
|
|
5467
5552
|
let header = column.header;
|
|
5468
|
-
if (header instanceof Function) {
|
|
5469
|
-
header = header({
|
|
5470
|
-
column,
|
|
5471
|
-
columnSortInfo: sortInfo
|
|
5472
|
-
});
|
|
5473
|
-
}
|
|
5474
|
-
header = header != null ? header : column.name;
|
|
5475
|
-
const sortTool = /* @__PURE__ */ React12.createElement(SortIcon, {
|
|
5476
|
-
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
5477
|
-
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
|
|
5478
|
-
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
5479
|
-
});
|
|
5480
|
-
const domRef = (0, import_react22.useRef)(null);
|
|
5481
5553
|
const ref = (0, import_react22.useCallback)((node) => {
|
|
5482
5554
|
var _a2;
|
|
5483
5555
|
domRef.current = node;
|
|
5484
5556
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
5485
5557
|
}, [props.domRef]);
|
|
5558
|
+
const sortTool = /* @__PURE__ */ React13.createElement(SortIcon, {
|
|
5559
|
+
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
5560
|
+
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
|
|
5561
|
+
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
5562
|
+
});
|
|
5563
|
+
const renderParam = {
|
|
5564
|
+
domRef: ref,
|
|
5565
|
+
column,
|
|
5566
|
+
columnSortInfo: sortInfo,
|
|
5567
|
+
sortTool
|
|
5568
|
+
};
|
|
5569
|
+
const renderChildren = () => {
|
|
5570
|
+
if (header instanceof Function) {
|
|
5571
|
+
header = /* @__PURE__ */ React13.createElement(RenderHookComponent, {
|
|
5572
|
+
render: header,
|
|
5573
|
+
renderParam
|
|
5574
|
+
});
|
|
5575
|
+
}
|
|
5576
|
+
header = header != null ? header : column.name;
|
|
5577
|
+
return header;
|
|
5578
|
+
};
|
|
5579
|
+
const domRef = (0, import_react22.useRef)(null);
|
|
5486
5580
|
const {
|
|
5487
5581
|
computed: { computedRemainingSpace },
|
|
5488
5582
|
componentState: { portalDOMRef }
|
|
@@ -5510,7 +5604,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5510
5604
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
5511
5605
|
let draggingProxy = null;
|
|
5512
5606
|
if (dragging) {
|
|
5513
|
-
draggingProxy = /* @__PURE__ */
|
|
5607
|
+
draggingProxy = /* @__PURE__ */ React13.createElement("div", {
|
|
5514
5608
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
5515
5609
|
style: {
|
|
5516
5610
|
position: "absolute",
|
|
@@ -5523,8 +5617,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5523
5617
|
}, header);
|
|
5524
5618
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
5525
5619
|
}
|
|
5526
|
-
|
|
5620
|
+
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5621
|
+
return /* @__PURE__ */ React13.createElement(ContextProvider, {
|
|
5622
|
+
value: renderParam
|
|
5623
|
+
}, /* @__PURE__ */ React13.createElement(InfiniteTableCell, {
|
|
5527
5624
|
domRef: ref,
|
|
5625
|
+
cellType: "header",
|
|
5528
5626
|
column,
|
|
5529
5627
|
"data-name": `HeaderCell`,
|
|
5530
5628
|
"data-column-id": column.id,
|
|
@@ -5534,16 +5632,21 @@ function InfiniteTableHeaderCell(props) {
|
|
|
5534
5632
|
onPointerUp,
|
|
5535
5633
|
className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging }), CellCls),
|
|
5536
5634
|
cssEllipsis: (_d = (_c = column.headerCssEllipsis) != null ? _c : column.cssEllipsis) != null ? _d : true,
|
|
5537
|
-
afterChildren: sortTool
|
|
5538
|
-
|
|
5635
|
+
afterChildren: sortTool,
|
|
5636
|
+
renderChildren
|
|
5637
|
+
}), draggingProxy);
|
|
5638
|
+
}
|
|
5639
|
+
function useInfiniteHeaderCell() {
|
|
5640
|
+
const result = (0, import_react22.useContext)(InfiniteTableHeaderCellContext);
|
|
5641
|
+
return result;
|
|
5539
5642
|
}
|
|
5540
5643
|
|
|
5541
5644
|
// src/components/RawList/index.tsx
|
|
5542
|
-
var
|
|
5645
|
+
var React16 = __toModule(require("react"));
|
|
5543
5646
|
var import_react25 = __toModule(require("react"));
|
|
5544
5647
|
|
|
5545
5648
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
5546
|
-
var
|
|
5649
|
+
var React14 = __toModule(require("react"));
|
|
5547
5650
|
var import_react23 = __toModule(require("react"));
|
|
5548
5651
|
function AvoidReactDiffFn(props) {
|
|
5549
5652
|
const [children, setChildren] = (0, import_react23.useState)(props.updater.get());
|
|
@@ -5553,15 +5656,15 @@ function AvoidReactDiffFn(props) {
|
|
|
5553
5656
|
});
|
|
5554
5657
|
return remove;
|
|
5555
5658
|
}, [props.updater]);
|
|
5556
|
-
return /* @__PURE__ */
|
|
5659
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, children);
|
|
5557
5660
|
}
|
|
5558
|
-
var AvoidReactDiff =
|
|
5661
|
+
var AvoidReactDiff = React14.memo(AvoidReactDiffFn);
|
|
5559
5662
|
|
|
5560
5663
|
// src/components/RawList/useVirtualRenderer.ts
|
|
5561
5664
|
var import_react24 = __toModule(require("react"));
|
|
5562
5665
|
|
|
5563
5666
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
5564
|
-
var
|
|
5667
|
+
var React15 = __toModule(require("react"));
|
|
5565
5668
|
|
|
5566
5669
|
// src/components/RawList/MappedItems.ts
|
|
5567
5670
|
var MappedItems = class extends Logger {
|
|
@@ -5806,7 +5909,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5806
5909
|
};
|
|
5807
5910
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5808
5911
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5809
|
-
const item = /* @__PURE__ */
|
|
5912
|
+
const item = /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
|
|
5810
5913
|
key: elementIndex,
|
|
5811
5914
|
name: `${elementIndex}`,
|
|
5812
5915
|
updater: this.updaters[elementIndex]
|
|
@@ -5903,11 +6006,11 @@ function RawListFn(props) {
|
|
|
5903
6006
|
});
|
|
5904
6007
|
return remove;
|
|
5905
6008
|
}, [brain, onRenderUpdater]);
|
|
5906
|
-
return /* @__PURE__ */
|
|
6009
|
+
return /* @__PURE__ */ React16.createElement(AvoidReactDiff, {
|
|
5907
6010
|
updater: onRenderUpdater
|
|
5908
6011
|
});
|
|
5909
6012
|
}
|
|
5910
|
-
var RawList =
|
|
6013
|
+
var RawList = React16.memo(RawListFn);
|
|
5911
6014
|
|
|
5912
6015
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5913
6016
|
var debug3 = dbg("Header");
|
|
@@ -5928,7 +6031,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5928
6031
|
}
|
|
5929
6032
|
return null;
|
|
5930
6033
|
}
|
|
5931
|
-
return /* @__PURE__ */
|
|
6034
|
+
return /* @__PURE__ */ React17.createElement(InfiniteTableHeaderCell, {
|
|
5932
6035
|
domRef: domRef2,
|
|
5933
6036
|
column,
|
|
5934
6037
|
headerHeight,
|
|
@@ -5955,18 +6058,18 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5955
6058
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
5956
6059
|
style
|
|
5957
6060
|
};
|
|
5958
|
-
return /* @__PURE__ */
|
|
6061
|
+
return /* @__PURE__ */ React17.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React17.createElement(RawList, {
|
|
5959
6062
|
brain,
|
|
5960
6063
|
renderItem: renderColumn
|
|
5961
6064
|
}));
|
|
5962
6065
|
}
|
|
5963
|
-
var InfiniteTableHeader =
|
|
6066
|
+
var InfiniteTableHeader = React17.memo(InfiniteTableHeaderFn);
|
|
5964
6067
|
|
|
5965
6068
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
5966
|
-
var
|
|
6069
|
+
var React20 = __toModule(require("react"));
|
|
5967
6070
|
|
|
5968
6071
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
5969
|
-
var
|
|
6072
|
+
var React19 = __toModule(require("react"));
|
|
5970
6073
|
|
|
5971
6074
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
5972
6075
|
function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap) {
|
|
@@ -6056,7 +6159,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6056
6159
|
}
|
|
6057
6160
|
|
|
6058
6161
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6059
|
-
var
|
|
6162
|
+
var React18 = __toModule(require("react"));
|
|
6060
6163
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
6061
6164
|
function InfiniteTableHeaderGroup(props) {
|
|
6062
6165
|
const { columnGroup, height, headerHeight } = props;
|
|
@@ -6070,16 +6173,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6070
6173
|
width: columnGroup.computedWidth,
|
|
6071
6174
|
height
|
|
6072
6175
|
};
|
|
6073
|
-
return /* @__PURE__ */
|
|
6176
|
+
return /* @__PURE__ */ React18.createElement("div", {
|
|
6074
6177
|
"data-group-id": columnGroup.id,
|
|
6075
6178
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
6076
6179
|
style
|
|
6077
|
-
}, /* @__PURE__ */
|
|
6180
|
+
}, /* @__PURE__ */ React18.createElement("div", {
|
|
6078
6181
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
6079
6182
|
style: { height: headerHeight }
|
|
6080
|
-
}, /* @__PURE__ */
|
|
6183
|
+
}, /* @__PURE__ */ React18.createElement("div", {
|
|
6081
6184
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6082
|
-
}, header)), /* @__PURE__ */
|
|
6185
|
+
}, header)), /* @__PURE__ */ React18.createElement("div", {
|
|
6083
6186
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
6084
6187
|
}, props.children));
|
|
6085
6188
|
}
|
|
@@ -6102,7 +6205,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6102
6205
|
return items2.map((colGroupItem) => {
|
|
6103
6206
|
if (colGroupItem.type === "column") {
|
|
6104
6207
|
const col = colGroupItem.ref;
|
|
6105
|
-
return /* @__PURE__ */
|
|
6208
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
|
|
6106
6209
|
key: col.id,
|
|
6107
6210
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
6108
6211
|
column: col,
|
|
@@ -6116,7 +6219,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
6116
6219
|
colIds.push(col.id);
|
|
6117
6220
|
return col;
|
|
6118
6221
|
});
|
|
6119
|
-
return /* @__PURE__ */
|
|
6222
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderGroup, {
|
|
6120
6223
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
6121
6224
|
columns: columns2,
|
|
6122
6225
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -6169,9 +6272,9 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6169
6272
|
},
|
|
6170
6273
|
computed: { computedVisibleColumnsMap: columnsMap }
|
|
6171
6274
|
} = useInfiniteTable();
|
|
6172
|
-
const domRef =
|
|
6275
|
+
const domRef = React20.useRef(null);
|
|
6173
6276
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
6174
|
-
const columnHeaderGroups =
|
|
6277
|
+
const columnHeaderGroups = React20.useMemo(() => {
|
|
6175
6278
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
6176
6279
|
columnGroups: computedColumnGroups,
|
|
6177
6280
|
columnGroupsDepthsMap,
|
|
@@ -6190,7 +6293,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6190
6293
|
columnGroupsMaxDepth
|
|
6191
6294
|
]);
|
|
6192
6295
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
6193
|
-
return /* @__PURE__ */
|
|
6296
|
+
return /* @__PURE__ */ React20.createElement(InfiniteTableHeaderCell, {
|
|
6194
6297
|
key: c.id,
|
|
6195
6298
|
headerHeight,
|
|
6196
6299
|
column: c,
|
|
@@ -6215,20 +6318,20 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
6215
6318
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
6216
6319
|
return removeOnScroll;
|
|
6217
6320
|
}, [brain, scrollListener]);
|
|
6218
|
-
return /* @__PURE__ */
|
|
6321
|
+
return /* @__PURE__ */ React20.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6219
6322
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
6220
6323
|
pinned: pinning,
|
|
6221
6324
|
virtualized: false,
|
|
6222
6325
|
overflow: scrollable
|
|
6223
6326
|
})),
|
|
6224
6327
|
style
|
|
6225
|
-
}), /* @__PURE__ */
|
|
6328
|
+
}), /* @__PURE__ */ React20.createElement("div", {
|
|
6226
6329
|
style: { width: totalWidth },
|
|
6227
6330
|
className: join(flexFlow.row, display.flex),
|
|
6228
6331
|
ref: domRef
|
|
6229
6332
|
}, children));
|
|
6230
6333
|
}
|
|
6231
|
-
var InfiniteTableHeaderUnvirtualized =
|
|
6334
|
+
var InfiniteTableHeaderUnvirtualized = React20.memo(InfiniteTableHeaderUnvirtualizedFn);
|
|
6232
6335
|
|
|
6233
6336
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6234
6337
|
function TableHeaderWrapper(props) {
|
|
@@ -6261,7 +6364,7 @@ function TableHeaderWrapper(props) {
|
|
|
6261
6364
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
6262
6365
|
left: computedPinnedStartWidth
|
|
6263
6366
|
} : void 0;
|
|
6264
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
6367
|
+
const header = virtualizeHeader ? /* @__PURE__ */ React21.createElement(InfiniteTableHeader, {
|
|
6265
6368
|
columns: computedUnpinnedColumns,
|
|
6266
6369
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
6267
6370
|
brain,
|
|
@@ -6274,7 +6377,7 @@ function TableHeaderWrapper(props) {
|
|
|
6274
6377
|
},
|
|
6275
6378
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6276
6379
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6277
|
-
}) : /* @__PURE__ */
|
|
6380
|
+
}) : /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6278
6381
|
style: unvirtualizedStyle,
|
|
6279
6382
|
brain,
|
|
6280
6383
|
scrollable: true,
|
|
@@ -6283,12 +6386,12 @@ function TableHeaderWrapper(props) {
|
|
|
6283
6386
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
6284
6387
|
totalWidth: computedUnpinnedColumnsWidth
|
|
6285
6388
|
});
|
|
6286
|
-
return /* @__PURE__ */
|
|
6389
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
6287
6390
|
className: HeaderWrapperCls,
|
|
6288
6391
|
style: {
|
|
6289
6392
|
height: virtualizeHeader ? height : void 0
|
|
6290
6393
|
}
|
|
6291
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
6394
|
+
}, hasPinnedStart ? /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6292
6395
|
style: {
|
|
6293
6396
|
left: 0,
|
|
6294
6397
|
position: "absolute",
|
|
@@ -6300,7 +6403,7 @@ function TableHeaderWrapper(props) {
|
|
|
6300
6403
|
scrollable: computedPinnedStartOverflow,
|
|
6301
6404
|
pinning: "start",
|
|
6302
6405
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
6303
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
6406
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
6304
6407
|
style: {
|
|
6305
6408
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
6306
6409
|
position: "absolute",
|
|
@@ -6312,7 +6415,7 @@ function TableHeaderWrapper(props) {
|
|
|
6312
6415
|
scrollable: computedPinnedEndOverflow,
|
|
6313
6416
|
pinning: "end",
|
|
6314
6417
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
6315
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
6418
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ React21.createElement(VerticalScrollbarPlaceholder, {
|
|
6316
6419
|
style: {
|
|
6317
6420
|
height: "100%",
|
|
6318
6421
|
right: 0
|
|
@@ -6321,7 +6424,7 @@ function TableHeaderWrapper(props) {
|
|
|
6321
6424
|
}
|
|
6322
6425
|
|
|
6323
6426
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6324
|
-
var
|
|
6427
|
+
var React22 = __toModule(require("react"));
|
|
6325
6428
|
var import_react29 = __toModule(require("react"));
|
|
6326
6429
|
|
|
6327
6430
|
// src/components/hooks/useOnScroll.ts
|
|
@@ -6365,7 +6468,7 @@ var getScrollableClassName = (scrollable) => {
|
|
|
6365
6468
|
|
|
6366
6469
|
// src/components/VirtualScrollContainer/index.tsx
|
|
6367
6470
|
var rootClassName6 = "InfiniteVirtualScrollContainer";
|
|
6368
|
-
var VirtualScrollContainer =
|
|
6471
|
+
var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2(props, ref) {
|
|
6369
6472
|
const {
|
|
6370
6473
|
children,
|
|
6371
6474
|
scrollable = true,
|
|
@@ -6375,7 +6478,7 @@ var VirtualScrollContainer = React21.forwardRef(function VirtualScrollContainer2
|
|
|
6375
6478
|
} = props;
|
|
6376
6479
|
const domRef = ref != null ? ref : (0, import_react29.useRef)(null);
|
|
6377
6480
|
useOnScroll(domRef, onContainerScroll);
|
|
6378
|
-
return /* @__PURE__ */
|
|
6481
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
6379
6482
|
ref: domRef,
|
|
6380
6483
|
style,
|
|
6381
6484
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -6383,7 +6486,7 @@ var VirtualScrollContainer = React21.forwardRef(function VirtualScrollContainer2
|
|
|
6383
6486
|
});
|
|
6384
6487
|
|
|
6385
6488
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
6386
|
-
var
|
|
6489
|
+
var React23 = __toModule(require("react"));
|
|
6387
6490
|
function SpacePlaceholderFn(props) {
|
|
6388
6491
|
const { height, width, count } = props;
|
|
6389
6492
|
const style = {
|
|
@@ -6393,7 +6496,7 @@ function SpacePlaceholderFn(props) {
|
|
|
6393
6496
|
opacity: 0,
|
|
6394
6497
|
pointerEvents: "none"
|
|
6395
6498
|
};
|
|
6396
|
-
return /* @__PURE__ */
|
|
6499
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
6397
6500
|
"data-count": count,
|
|
6398
6501
|
"data-placeholder-width": true ? width : void 0,
|
|
6399
6502
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -6401,20 +6504,20 @@ function SpacePlaceholderFn(props) {
|
|
|
6401
6504
|
style
|
|
6402
6505
|
});
|
|
6403
6506
|
}
|
|
6404
|
-
var SpacePlaceholder =
|
|
6507
|
+
var SpacePlaceholder = React23.memo(SpacePlaceholderFn);
|
|
6405
6508
|
|
|
6406
6509
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
6407
|
-
var
|
|
6510
|
+
var import_react41 = __toModule(require("react"));
|
|
6408
6511
|
|
|
6409
6512
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6410
|
-
var
|
|
6411
|
-
var
|
|
6513
|
+
var React29 = __toModule(require("react"));
|
|
6514
|
+
var import_react34 = __toModule(require("react"));
|
|
6412
6515
|
|
|
6413
6516
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6414
|
-
var
|
|
6517
|
+
var React25 = __toModule(require("react"));
|
|
6415
6518
|
|
|
6416
6519
|
// src/components/VirtualList/VirtualList.tsx
|
|
6417
|
-
var
|
|
6520
|
+
var React24 = __toModule(require("react"));
|
|
6418
6521
|
var import_react30 = __toModule(require("react"));
|
|
6419
6522
|
|
|
6420
6523
|
// src/components/VirtualList/VirtualList.css.ts
|
|
@@ -6496,19 +6599,19 @@ var VirtualList = (props) => {
|
|
|
6496
6599
|
if (true) {
|
|
6497
6600
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
6498
6601
|
}
|
|
6499
|
-
return /* @__PURE__ */
|
|
6602
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React24.createElement(VirtualScrollContainer, {
|
|
6500
6603
|
scrollable,
|
|
6501
6604
|
onContainerScroll
|
|
6502
|
-
}, /* @__PURE__ */
|
|
6605
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
6503
6606
|
ref: domRef,
|
|
6504
6607
|
className: scrollTransformTargetCls,
|
|
6505
6608
|
"data-name": "scroll-transform-target"
|
|
6506
|
-
}, /* @__PURE__ */
|
|
6609
|
+
}, /* @__PURE__ */ React24.createElement(RawList, {
|
|
6507
6610
|
brain: virtualBrain,
|
|
6508
6611
|
renderItem,
|
|
6509
6612
|
repaintId,
|
|
6510
6613
|
debugChannel: "VirtualList-" + mainAxis
|
|
6511
|
-
})), children, /* @__PURE__ */
|
|
6614
|
+
})), children, /* @__PURE__ */ React24.createElement(SpacePlaceholder, {
|
|
6512
6615
|
count,
|
|
6513
6616
|
width,
|
|
6514
6617
|
height
|
|
@@ -6518,14 +6621,14 @@ var VirtualList = (props) => {
|
|
|
6518
6621
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
6519
6622
|
var VirtualRowList = (props) => {
|
|
6520
6623
|
const _a = props, { rowWidth, rowHeight, renderRow } = _a, listProps = __objRest(_a, ["rowWidth", "rowHeight", "renderRow"]);
|
|
6521
|
-
const renderItem =
|
|
6624
|
+
const renderItem = React25.useCallback((renderProps) => {
|
|
6522
6625
|
return renderRow({
|
|
6523
6626
|
domRef: renderProps.domRef,
|
|
6524
6627
|
rowHeight: renderProps.itemSize,
|
|
6525
6628
|
rowIndex: renderProps.itemIndex
|
|
6526
6629
|
});
|
|
6527
6630
|
}, [renderRow]);
|
|
6528
|
-
return /* @__PURE__ */
|
|
6631
|
+
return /* @__PURE__ */ React25.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
6529
6632
|
renderItem,
|
|
6530
6633
|
mainAxis: "vertical",
|
|
6531
6634
|
itemMainAxisSize: rowHeight,
|
|
@@ -6534,12 +6637,14 @@ var VirtualRowList = (props) => {
|
|
|
6534
6637
|
};
|
|
6535
6638
|
|
|
6536
6639
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
6537
|
-
var
|
|
6538
|
-
var
|
|
6640
|
+
var React27 = __toModule(require("react"));
|
|
6641
|
+
var import_react33 = __toModule(require("react"));
|
|
6539
6642
|
|
|
6540
6643
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
6541
|
-
var
|
|
6644
|
+
var React26 = __toModule(require("react"));
|
|
6645
|
+
var import_react31 = __toModule(require("react"));
|
|
6542
6646
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6647
|
+
var InfiniteTableColumnCellContext = React26.createContext(null);
|
|
6543
6648
|
var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
|
|
6544
6649
|
function isColumnWithField(c) {
|
|
6545
6650
|
return typeof c.field === "string";
|
|
@@ -6586,24 +6691,31 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6586
6691
|
column
|
|
6587
6692
|
}, rest);
|
|
6588
6693
|
let renderValue = value;
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
renderValue = column.renderValue(renderParam);
|
|
6694
|
+
const renderParam = __spreadProps(__spreadValues({
|
|
6695
|
+
value,
|
|
6696
|
+
column,
|
|
6697
|
+
domRef,
|
|
6698
|
+
groupRowInfo
|
|
6699
|
+
}, rest), {
|
|
6700
|
+
rowIndex,
|
|
6701
|
+
toggleGroupRow,
|
|
6702
|
+
toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
|
|
6703
|
+
groupBy: computedDataSource.groupBy,
|
|
6704
|
+
pivotBy: computedDataSource.pivotBy
|
|
6705
|
+
});
|
|
6706
|
+
const renderChildren = () => {
|
|
6707
|
+
if (hidden) {
|
|
6708
|
+
return null;
|
|
6605
6709
|
}
|
|
6606
|
-
|
|
6710
|
+
const renderFn = column.render || column.renderValue;
|
|
6711
|
+
if (renderFn) {
|
|
6712
|
+
return /* @__PURE__ */ React26.createElement(RenderHookComponent, {
|
|
6713
|
+
render: renderFn,
|
|
6714
|
+
renderParam
|
|
6715
|
+
});
|
|
6716
|
+
}
|
|
6717
|
+
return renderValue;
|
|
6718
|
+
};
|
|
6607
6719
|
const colClassName = column.className ? typeof column.className === "function" ? column.className(stylingRenderParam) : column.className : void 0;
|
|
6608
6720
|
const colStyle = column.style ? typeof column.style === "function" ? column.style(stylingRenderParam) : column.style : void 0;
|
|
6609
6721
|
const style = colStyle ? __spreadProps(__spreadValues({}, colStyle), {
|
|
@@ -6631,21 +6743,31 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6631
6743
|
}
|
|
6632
6744
|
}
|
|
6633
6745
|
}
|
|
6634
|
-
|
|
6746
|
+
const cellProps = __spreadProps(__spreadValues({
|
|
6635
6747
|
domRef,
|
|
6636
6748
|
offsetProperty
|
|
6637
6749
|
}, dataset), {
|
|
6750
|
+
cellType: "body",
|
|
6638
6751
|
column,
|
|
6639
6752
|
offset: virtualized ? 0 : column.computedPinningOffset,
|
|
6640
6753
|
style,
|
|
6641
6754
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
6642
|
-
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName)
|
|
6643
|
-
|
|
6755
|
+
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName),
|
|
6756
|
+
renderChildren
|
|
6757
|
+
});
|
|
6758
|
+
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
6759
|
+
return /* @__PURE__ */ React26.createElement(ContextProvider, {
|
|
6760
|
+
value: renderParam
|
|
6761
|
+
}, /* @__PURE__ */ React26.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
6762
|
+
}
|
|
6763
|
+
var InfiniteTableColumnCell = React26.memo(InfiniteTableColumnCellFn);
|
|
6764
|
+
function useInfiniteColumnCell() {
|
|
6765
|
+
const result = (0, import_react31.useContext)(InfiniteTableColumnCellContext);
|
|
6766
|
+
return result;
|
|
6644
6767
|
}
|
|
6645
|
-
var InfiniteTableColumnCell = React25.memo(InfiniteTableColumnCellFn);
|
|
6646
6768
|
|
|
6647
6769
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
|
|
6648
|
-
var
|
|
6770
|
+
var import_react32 = __toModule(require("react"));
|
|
6649
6771
|
|
|
6650
6772
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
|
|
6651
6773
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
@@ -6671,8 +6793,8 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6671
6793
|
rowInfo,
|
|
6672
6794
|
rowSpan
|
|
6673
6795
|
} = props;
|
|
6674
|
-
const domRef = (0,
|
|
6675
|
-
const rowDOMRef = (0,
|
|
6796
|
+
const domRef = (0, import_react32.useRef)(null);
|
|
6797
|
+
const rowDOMRef = (0, import_react32.useCallback)((node) => {
|
|
6676
6798
|
domRefFromProps(node);
|
|
6677
6799
|
domRef.current = node;
|
|
6678
6800
|
}, []);
|
|
@@ -6703,7 +6825,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6703
6825
|
}), `${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);
|
|
6704
6826
|
const initialMouseEnter = rowProps == null ? void 0 : rowProps.onMouseEnter;
|
|
6705
6827
|
const initialMouseLeave = rowProps == null ? void 0 : rowProps.onMouseLeave;
|
|
6706
|
-
const onMouseEnter = (0,
|
|
6828
|
+
const onMouseEnter = (0, import_react32.useCallback)((event) => {
|
|
6707
6829
|
var _a;
|
|
6708
6830
|
initialMouseEnter == null ? void 0 : initialMouseEnter(event);
|
|
6709
6831
|
const rowIndex2 = ((_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex) * 1;
|
|
@@ -6717,7 +6839,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6717
6839
|
const rows = parentNode.querySelectorAll(hoverSelector.join(","));
|
|
6718
6840
|
rows.forEach((row) => row.classList.add(InfiniteTableRowClassName__hover, RowHoverCls));
|
|
6719
6841
|
}, [initialMouseEnter, showHoverRows]);
|
|
6720
|
-
const onMouseLeave = (0,
|
|
6842
|
+
const onMouseLeave = (0, import_react32.useCallback)((event) => {
|
|
6721
6843
|
var _a;
|
|
6722
6844
|
initialMouseLeave == null ? void 0 : initialMouseLeave(event);
|
|
6723
6845
|
const rowIndex2 = (_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex;
|
|
@@ -6773,13 +6895,13 @@ function InfiniteTableRowFn(props) {
|
|
|
6773
6895
|
width: rowWidth,
|
|
6774
6896
|
height: rowHeight
|
|
6775
6897
|
}, domProps.style);
|
|
6776
|
-
const renderCellRef = (0,
|
|
6777
|
-
const renderCell =
|
|
6898
|
+
const renderCellRef = (0, import_react33.useRef)(null);
|
|
6899
|
+
const renderCell = React27.useCallback(({ domRef, itemIndex }) => {
|
|
6778
6900
|
const column = columns[itemIndex];
|
|
6779
6901
|
if (!column) {
|
|
6780
6902
|
}
|
|
6781
6903
|
const hidden = false;
|
|
6782
|
-
return /* @__PURE__ */
|
|
6904
|
+
return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
|
|
6783
6905
|
getData,
|
|
6784
6906
|
rowInfo,
|
|
6785
6907
|
groupRenderStrategy,
|
|
@@ -6806,18 +6928,18 @@ function InfiniteTableRowFn(props) {
|
|
|
6806
6928
|
if (true) {
|
|
6807
6929
|
domProps["data-cmp-name"] = "ITableRow";
|
|
6808
6930
|
}
|
|
6809
|
-
return /* @__PURE__ */
|
|
6931
|
+
return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6810
6932
|
style
|
|
6811
|
-
}), /* @__PURE__ */
|
|
6933
|
+
}), /* @__PURE__ */ React27.createElement(RawList, {
|
|
6812
6934
|
brain,
|
|
6813
6935
|
renderItem: renderCell,
|
|
6814
6936
|
debugChannel: `${rowIndex}`
|
|
6815
6937
|
}));
|
|
6816
6938
|
}
|
|
6817
|
-
var InfiniteTableRow =
|
|
6939
|
+
var InfiniteTableRow = React27.memo(InfiniteTableRowFn);
|
|
6818
6940
|
|
|
6819
6941
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
6820
|
-
var
|
|
6942
|
+
var React28 = __toModule(require("react"));
|
|
6821
6943
|
function TableRowUnvirtualizedFn(props) {
|
|
6822
6944
|
const {
|
|
6823
6945
|
rowHeight,
|
|
@@ -6838,7 +6960,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6838
6960
|
}, domProps.style);
|
|
6839
6961
|
const children = columns.map((col) => {
|
|
6840
6962
|
const hidden = false;
|
|
6841
|
-
return /* @__PURE__ */
|
|
6963
|
+
return /* @__PURE__ */ React28.createElement(InfiniteTableColumnCell, {
|
|
6842
6964
|
key: col.id,
|
|
6843
6965
|
virtualized: false,
|
|
6844
6966
|
rowHeight,
|
|
@@ -6851,11 +6973,11 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6851
6973
|
column: col
|
|
6852
6974
|
});
|
|
6853
6975
|
});
|
|
6854
|
-
return /* @__PURE__ */
|
|
6976
|
+
return /* @__PURE__ */ React28.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6855
6977
|
style
|
|
6856
6978
|
}), children);
|
|
6857
6979
|
}
|
|
6858
|
-
var TableRowUnvirtualized =
|
|
6980
|
+
var TableRowUnvirtualized = React28.memo(TableRowUnvirtualizedFn);
|
|
6859
6981
|
|
|
6860
6982
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6861
6983
|
function useUnpinnedRendering(params) {
|
|
@@ -6878,7 +7000,7 @@ function useUnpinnedRendering(params) {
|
|
|
6878
7000
|
} = params;
|
|
6879
7001
|
const { virtualizeColumns } = getState();
|
|
6880
7002
|
const shouldVirtualizeColumns = typeof virtualizeColumns === "function" ? virtualizeColumns(computedUnpinnedColumns) : virtualizeColumns != null ? virtualizeColumns : true;
|
|
6881
|
-
const renderRowUnpinned = (0,
|
|
7003
|
+
const renderRowUnpinned = (0, import_react34.useCallback)((rowParams) => {
|
|
6882
7004
|
const dataArray = getData();
|
|
6883
7005
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
6884
7006
|
const { showZebraRows, showHoverRows } = getState();
|
|
@@ -6900,7 +7022,7 @@ function useUnpinnedRendering(params) {
|
|
|
6900
7022
|
rowProps.repaintId = repaintId;
|
|
6901
7023
|
}
|
|
6902
7024
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
6903
|
-
return /* @__PURE__ */
|
|
7025
|
+
return /* @__PURE__ */ React29.createElement(TableRowComponent, __spreadValues({}, rowProps));
|
|
6904
7026
|
}, [
|
|
6905
7027
|
repaintId,
|
|
6906
7028
|
rowHeight,
|
|
@@ -6911,7 +7033,7 @@ function useUnpinnedRendering(params) {
|
|
|
6911
7033
|
horizontalVirtualBrain,
|
|
6912
7034
|
verticalVirtualBrain
|
|
6913
7035
|
]);
|
|
6914
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
7036
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React29.createElement("div", {
|
|
6915
7037
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
6916
7038
|
style: {
|
|
6917
7039
|
position: "absolute",
|
|
@@ -6922,10 +7044,10 @@ function useUnpinnedRendering(params) {
|
|
|
6922
7044
|
overflow: "auto",
|
|
6923
7045
|
visibility: columnShifts ? "visible" : "hidden"
|
|
6924
7046
|
}
|
|
6925
|
-
}, /* @__PURE__ */
|
|
7047
|
+
}, /* @__PURE__ */ React29.createElement("div", {
|
|
6926
7048
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
6927
7049
|
})) : null;
|
|
6928
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
7050
|
+
return rowHeight != 0 ? /* @__PURE__ */ React29.createElement(VirtualRowList, {
|
|
6929
7051
|
repaintId: `${repaintId}-unpinned-`,
|
|
6930
7052
|
brain: verticalVirtualBrain,
|
|
6931
7053
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -6946,7 +7068,7 @@ function useUnpinnedRendering(params) {
|
|
|
6946
7068
|
}
|
|
6947
7069
|
|
|
6948
7070
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
6949
|
-
var
|
|
7071
|
+
var import_react35 = __toModule(require("react"));
|
|
6950
7072
|
|
|
6951
7073
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
6952
7074
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -6984,18 +7106,18 @@ var useOnContainerScroll = ({
|
|
|
6984
7106
|
getState: getDataSourceState,
|
|
6985
7107
|
componentState: { notifyScrollStop }
|
|
6986
7108
|
} = useDataSourceContextValue();
|
|
6987
|
-
const onScrollStop = (0,
|
|
7109
|
+
const onScrollStop = (0, import_react35.useCallback)((param) => {
|
|
6988
7110
|
onScrollStopFromProps == null ? void 0 : onScrollStopFromProps(param);
|
|
6989
7111
|
notifyScrollStop(param);
|
|
6990
7112
|
}, [onScrollStopFromProps, notifyScrollStop]);
|
|
6991
|
-
const timeoutIdRef = (0,
|
|
6992
|
-
const scrollingRef = (0,
|
|
6993
|
-
const scrollTopMaxRef = (0,
|
|
6994
|
-
(0,
|
|
7113
|
+
const timeoutIdRef = (0, import_react35.useRef)(0);
|
|
7114
|
+
const scrollingRef = (0, import_react35.useRef)(false);
|
|
7115
|
+
const scrollTopMaxRef = (0, import_react35.useRef)(0);
|
|
7116
|
+
(0, import_react35.useEffect)(() => {
|
|
6995
7117
|
const { current: node } = scrollerDOMRef;
|
|
6996
7118
|
scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
|
|
6997
7119
|
}, [reservedContentHeight, bodySize.height]);
|
|
6998
|
-
const setScrolling = (0,
|
|
7120
|
+
const setScrolling = (0, import_react35.useCallback)((scrolling) => {
|
|
6999
7121
|
var _a;
|
|
7000
7122
|
const prevScrolling = scrollingRef.current;
|
|
7001
7123
|
scrollingRef.current = scrolling;
|
|
@@ -7028,7 +7150,7 @@ var useOnContainerScroll = ({
|
|
|
7028
7150
|
}
|
|
7029
7151
|
}
|
|
7030
7152
|
}, [scrollStopDelay, onScrollStop]);
|
|
7031
|
-
const onContainerScroll = (0,
|
|
7153
|
+
const onContainerScroll = (0, import_react35.useCallback)((scrollInfo) => {
|
|
7032
7154
|
verticalVirtualBrain.setScrollPosition(scrollInfo);
|
|
7033
7155
|
horizontalVirtualBrain.setScrollPosition(scrollInfo);
|
|
7034
7156
|
setScrolling(true);
|
|
@@ -7038,15 +7160,15 @@ var useOnContainerScroll = ({
|
|
|
7038
7160
|
domRef.current,
|
|
7039
7161
|
setScrolling
|
|
7040
7162
|
]);
|
|
7041
|
-
const scrollPositionRef = (0,
|
|
7163
|
+
const scrollPositionRef = (0, import_react35.useRef)({
|
|
7042
7164
|
scrollLeft: 0,
|
|
7043
7165
|
scrollTop: 0
|
|
7044
7166
|
});
|
|
7045
|
-
const applyScrollHorizontal = (0,
|
|
7167
|
+
const applyScrollHorizontal = (0, import_react35.useCallback)(({ scrollLeft }) => {
|
|
7046
7168
|
scrollPositionRef.current.scrollLeft = scrollLeft;
|
|
7047
7169
|
onContainerScroll(scrollPositionRef.current);
|
|
7048
7170
|
}, [onContainerScroll]);
|
|
7049
|
-
const applyScrollVertical = (0,
|
|
7171
|
+
const applyScrollVertical = (0, import_react35.useCallback)(({ scrollTop }) => {
|
|
7050
7172
|
scrollPositionRef.current.scrollTop = scrollTop;
|
|
7051
7173
|
onContainerScroll(scrollPositionRef.current);
|
|
7052
7174
|
if (scrollTop === 0) {
|
|
@@ -7068,17 +7190,17 @@ var useOnContainerScroll = ({
|
|
|
7068
7190
|
};
|
|
7069
7191
|
|
|
7070
7192
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
7071
|
-
var
|
|
7072
|
-
var
|
|
7193
|
+
var React31 = __toModule(require("react"));
|
|
7194
|
+
var import_react38 = __toModule(require("react"));
|
|
7073
7195
|
|
|
7074
7196
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
7075
|
-
var
|
|
7076
|
-
var
|
|
7197
|
+
var React30 = __toModule(require("react"));
|
|
7198
|
+
var import_react37 = __toModule(require("react"));
|
|
7077
7199
|
|
|
7078
7200
|
// src/components/hooks/useOnMount.ts
|
|
7079
|
-
var
|
|
7201
|
+
var import_react36 = __toModule(require("react"));
|
|
7080
7202
|
function useOnMount(domRef, props) {
|
|
7081
|
-
(0,
|
|
7203
|
+
(0, import_react36.useEffect)(() => {
|
|
7082
7204
|
const { onMount, onUnmount } = props;
|
|
7083
7205
|
const node = domRef == null ? void 0 : domRef.current;
|
|
7084
7206
|
onMount == null ? void 0 : onMount(node);
|
|
@@ -7109,8 +7231,8 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7109
7231
|
onMount,
|
|
7110
7232
|
onUnmount
|
|
7111
7233
|
} = props;
|
|
7112
|
-
const domRef = (0,
|
|
7113
|
-
const renderItem = (0,
|
|
7234
|
+
const domRef = (0, import_react37.useRef)(null);
|
|
7235
|
+
const renderItem = (0, import_react37.useCallback)((renderProps) => renderRow({
|
|
7114
7236
|
domRef: renderProps.domRef,
|
|
7115
7237
|
rowHeight: renderProps.itemSize,
|
|
7116
7238
|
rowIndex: renderProps.itemIndex
|
|
@@ -7119,7 +7241,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7119
7241
|
onMount,
|
|
7120
7242
|
onUnmount
|
|
7121
7243
|
});
|
|
7122
|
-
(0,
|
|
7244
|
+
(0, import_react37.useEffect)(() => {
|
|
7123
7245
|
const onScroll = (scrollPosition) => {
|
|
7124
7246
|
const node = domRef.current;
|
|
7125
7247
|
if (node) {
|
|
@@ -7148,7 +7270,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
7148
7270
|
if (true) {
|
|
7149
7271
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
7150
7272
|
}
|
|
7151
|
-
return /* @__PURE__ */
|
|
7273
|
+
return /* @__PURE__ */ React30.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React30.createElement(RawList, {
|
|
7152
7274
|
brain,
|
|
7153
7275
|
renderItem,
|
|
7154
7276
|
repaintId
|
|
@@ -7171,7 +7293,7 @@ function PinnedRowsContainer(props) {
|
|
|
7171
7293
|
brain,
|
|
7172
7294
|
renderRow
|
|
7173
7295
|
} = props;
|
|
7174
|
-
const style =
|
|
7296
|
+
const style = React31.useMemo(() => {
|
|
7175
7297
|
const result = pinning === "end" ? {
|
|
7176
7298
|
width: rowWidth,
|
|
7177
7299
|
height,
|
|
@@ -7186,7 +7308,7 @@ function PinnedRowsContainer(props) {
|
|
|
7186
7308
|
}
|
|
7187
7309
|
return result;
|
|
7188
7310
|
}, [height, rowWidth, pinning, hasOverflow]);
|
|
7189
|
-
const updateScroll = (0,
|
|
7311
|
+
const updateScroll = (0, import_react38.useCallback)((node, scrollPosition) => {
|
|
7190
7312
|
UPDATE_SCROLL3(node, scrollPosition, hasOverflow ? pinnedScrollListener.getScrollPosition() : void 0);
|
|
7191
7313
|
}, [hasOverflow, pinnedScrollListener]);
|
|
7192
7314
|
const rowListProps = {
|
|
@@ -7197,7 +7319,7 @@ function PinnedRowsContainer(props) {
|
|
|
7197
7319
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
7198
7320
|
};
|
|
7199
7321
|
if (hasOverflow) {
|
|
7200
|
-
return /* @__PURE__ */
|
|
7322
|
+
return /* @__PURE__ */ React31.createElement(VirtualScrollContainer, {
|
|
7201
7323
|
scrollable: {
|
|
7202
7324
|
horizontal: true,
|
|
7203
7325
|
vertical: false
|
|
@@ -7213,23 +7335,23 @@ function PinnedRowsContainer(props) {
|
|
|
7213
7335
|
className: join(PinnedRowsContainerClsVariants({
|
|
7214
7336
|
pinned: pinning
|
|
7215
7337
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
7216
|
-
}, /* @__PURE__ */
|
|
7338
|
+
}, /* @__PURE__ */ React31.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
7217
7339
|
onMount: (node) => {
|
|
7218
7340
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
7219
7341
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
7220
7342
|
});
|
|
7221
7343
|
}
|
|
7222
|
-
})), /* @__PURE__ */
|
|
7344
|
+
})), /* @__PURE__ */ React31.createElement(SpacePlaceholder, {
|
|
7223
7345
|
width: rowWidth,
|
|
7224
7346
|
height: 1
|
|
7225
7347
|
}));
|
|
7226
7348
|
}
|
|
7227
|
-
return /* @__PURE__ */
|
|
7349
|
+
return /* @__PURE__ */ React31.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
7228
7350
|
}
|
|
7229
7351
|
function useRenderPinnedRow(params) {
|
|
7230
7352
|
const { getData, getState, columnsWidth, columns, rowSpan, verticalBrain } = params;
|
|
7231
|
-
const
|
|
7232
|
-
|
|
7353
|
+
const dataArray = getData();
|
|
7354
|
+
const renderPinnedRow = (0, import_react38.useCallback)((rowParams) => {
|
|
7233
7355
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
7234
7356
|
const { showZebraRows, showHoverRows } = getState();
|
|
7235
7357
|
const rowProps = __spreadValues({
|
|
@@ -7245,8 +7367,8 @@ function useRenderPinnedRow(params) {
|
|
|
7245
7367
|
rowWidth: columnsWidth,
|
|
7246
7368
|
columns
|
|
7247
7369
|
}, rowParams);
|
|
7248
|
-
return /* @__PURE__ */
|
|
7249
|
-
}, [columnsWidth, columns, verticalBrain]);
|
|
7370
|
+
return /* @__PURE__ */ React31.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
7371
|
+
}, [columnsWidth, columns, verticalBrain, dataArray]);
|
|
7250
7372
|
return renderPinnedRow;
|
|
7251
7373
|
}
|
|
7252
7374
|
function usePinnedRenderingForSide(side, params) {
|
|
@@ -7284,13 +7406,14 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7284
7406
|
const renderRowPinned = useRenderPinnedRow({
|
|
7285
7407
|
getData,
|
|
7286
7408
|
getState,
|
|
7409
|
+
repaintId,
|
|
7287
7410
|
toggleGroupRow,
|
|
7288
7411
|
rowSpan,
|
|
7289
7412
|
verticalBrain: verticalVirtualBrain,
|
|
7290
7413
|
columns,
|
|
7291
7414
|
columnsWidth
|
|
7292
7415
|
});
|
|
7293
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
7416
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React31.createElement(PinnedRowsContainer, {
|
|
7294
7417
|
pinning: side,
|
|
7295
7418
|
pinnedScrollListener,
|
|
7296
7419
|
hasOverflow,
|
|
@@ -7303,7 +7426,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
7303
7426
|
brain: verticalVirtualBrain,
|
|
7304
7427
|
renderRow: renderRowPinned
|
|
7305
7428
|
}) : null;
|
|
7306
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
7429
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React31.createElement(HorizontalScrollbarPlaceholder, {
|
|
7307
7430
|
style: side === "end" ? {
|
|
7308
7431
|
width: columnsWidth,
|
|
7309
7432
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -7345,13 +7468,13 @@ function usePinnedStartRendering(params) {
|
|
|
7345
7468
|
}
|
|
7346
7469
|
|
|
7347
7470
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
7348
|
-
var
|
|
7471
|
+
var import_react40 = __toModule(require("react"));
|
|
7349
7472
|
|
|
7350
7473
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
7351
|
-
var
|
|
7474
|
+
var import_react39 = __toModule(require("react"));
|
|
7352
7475
|
var debug5 = dbg("useColumnSizeFn");
|
|
7353
7476
|
function useColumnSizeFn(computedUnpinnedColumns) {
|
|
7354
|
-
const columnSize = (0,
|
|
7477
|
+
const columnSize = (0, import_react39.useCallback)((index) => {
|
|
7355
7478
|
const column = computedUnpinnedColumns[index];
|
|
7356
7479
|
if (!column) {
|
|
7357
7480
|
debug5("cannot find column at index", index, computedUnpinnedColumns);
|
|
@@ -7381,13 +7504,13 @@ function useYourBrain(param) {
|
|
|
7381
7504
|
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
7382
7505
|
globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
|
|
7383
7506
|
}
|
|
7384
|
-
(0,
|
|
7507
|
+
(0, import_react40.useEffect)(() => {
|
|
7385
7508
|
verticalVirtualBrain.setAvailableSize({
|
|
7386
7509
|
height: bodySize.height,
|
|
7387
7510
|
width: 0
|
|
7388
7511
|
});
|
|
7389
7512
|
}, [bodySize, verticalVirtualBrain]);
|
|
7390
|
-
(0,
|
|
7513
|
+
(0, import_react40.useEffect)(() => {
|
|
7391
7514
|
horizontalVirtualBrain.setAvailableSize({
|
|
7392
7515
|
height: 0,
|
|
7393
7516
|
width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
|
|
@@ -7428,8 +7551,8 @@ function useListRendering(param) {
|
|
|
7428
7551
|
horizontalVirtualBrain
|
|
7429
7552
|
} = componentState;
|
|
7430
7553
|
const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
|
|
7431
|
-
const repaintIdRef = (0,
|
|
7432
|
-
if (!shallowEqualObjects(prevComputed, computed)
|
|
7554
|
+
const repaintIdRef = (0, import_react41.useRef)(0);
|
|
7555
|
+
if (prevDataSourceTimestamp !== dataSourceState.updatedAt || !shallowEqualObjects(prevComputed, computed)) {
|
|
7433
7556
|
repaintIdRef.current++;
|
|
7434
7557
|
}
|
|
7435
7558
|
const repaintId = repaintIdRef.current;
|
|
@@ -7447,11 +7570,11 @@ function useListRendering(param) {
|
|
|
7447
7570
|
const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
|
|
7448
7571
|
const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
|
|
7449
7572
|
const hasVerticalScrollbar = bodySize.height > 0 && bodySize.height < reservedContentHeight;
|
|
7450
|
-
const scrollbars = (0,
|
|
7573
|
+
const scrollbars = (0, import_react41.useMemo)(() => ({
|
|
7451
7574
|
vertical: hasVerticalScrollbar,
|
|
7452
7575
|
horizontal: hasHorizontalScrollbar
|
|
7453
7576
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
7454
|
-
(0,
|
|
7577
|
+
(0, import_react41.useEffect)(() => {
|
|
7455
7578
|
if (!bodySize.height) {
|
|
7456
7579
|
return;
|
|
7457
7580
|
}
|
|
@@ -7507,7 +7630,7 @@ function useListRendering(param) {
|
|
|
7507
7630
|
computedUnpinnedColumns
|
|
7508
7631
|
});
|
|
7509
7632
|
const [, rerender] = useRerender();
|
|
7510
|
-
(0,
|
|
7633
|
+
(0, import_react41.useEffect)(() => {
|
|
7511
7634
|
rerender();
|
|
7512
7635
|
}, [dataSourceState]);
|
|
7513
7636
|
const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
|
|
@@ -7530,8 +7653,8 @@ function useListRendering(param) {
|
|
|
7530
7653
|
}
|
|
7531
7654
|
|
|
7532
7655
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7533
|
-
var
|
|
7534
|
-
var
|
|
7656
|
+
var React32 = __toModule(require("react"));
|
|
7657
|
+
var import_react42 = __toModule(require("react"));
|
|
7535
7658
|
|
|
7536
7659
|
// src/components/utils/decamelize.ts
|
|
7537
7660
|
function decamelize(str, options) {
|
|
@@ -7566,10 +7689,10 @@ var enforceStyle = (node, style) => {
|
|
|
7566
7689
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
7567
7690
|
}
|
|
7568
7691
|
};
|
|
7569
|
-
var InfiniteTableLicenseFooter =
|
|
7692
|
+
var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7570
7693
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7571
|
-
const domRef =
|
|
7572
|
-
const domCallback =
|
|
7694
|
+
const domRef = React32.useRef(null);
|
|
7695
|
+
const domCallback = React32.useCallback((node) => {
|
|
7573
7696
|
domRef.current = node;
|
|
7574
7697
|
if (!ref) {
|
|
7575
7698
|
return;
|
|
@@ -7580,7 +7703,7 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
|
|
|
7580
7703
|
ref.current = node;
|
|
7581
7704
|
}
|
|
7582
7705
|
}, []);
|
|
7583
|
-
(0,
|
|
7706
|
+
(0, import_react42.useEffect)(() => {
|
|
7584
7707
|
const forceStyle = () => {
|
|
7585
7708
|
requestAnimationFrame(() => {
|
|
7586
7709
|
var _a;
|
|
@@ -7594,12 +7717,12 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
|
|
|
7594
7717
|
clearInterval(intervalId);
|
|
7595
7718
|
};
|
|
7596
7719
|
}, []);
|
|
7597
|
-
return /* @__PURE__ */
|
|
7720
|
+
return /* @__PURE__ */ React32.createElement("div", __spreadProps(__spreadValues({
|
|
7598
7721
|
ref: domCallback
|
|
7599
7722
|
}, props), {
|
|
7600
7723
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7601
7724
|
style: defaultStyle2
|
|
7602
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7725
|
+
}), "Powered by", " ", /* @__PURE__ */ React32.createElement("a", {
|
|
7603
7726
|
href: "https://infinite-table.com",
|
|
7604
7727
|
rel: "noopener noreferrer",
|
|
7605
7728
|
role: "link",
|
|
@@ -7608,7 +7731,7 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
|
|
|
7608
7731
|
});
|
|
7609
7732
|
|
|
7610
7733
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
7611
|
-
var
|
|
7734
|
+
var import_react43 = __toModule(require("react"));
|
|
7612
7735
|
|
|
7613
7736
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
7614
7737
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -7766,10 +7889,10 @@ var isInsideSandbox = () => {
|
|
|
7766
7889
|
};
|
|
7767
7890
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
7768
7891
|
var useLicense = (licenseKey = "") => {
|
|
7769
|
-
const valid = (0,
|
|
7892
|
+
const valid = (0, import_react43.useMemo)(() => {
|
|
7770
7893
|
let valid2 = isValidLicense(licenseKey, {
|
|
7771
7894
|
publishedAt: 1624970570587,
|
|
7772
|
-
version: "0.2.
|
|
7895
|
+
version: "0.2.15"
|
|
7773
7896
|
});
|
|
7774
7897
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
7775
7898
|
return true;
|
|
@@ -7780,8 +7903,8 @@ var useLicense = (licenseKey = "") => {
|
|
|
7780
7903
|
};
|
|
7781
7904
|
|
|
7782
7905
|
// src/components/CSSVariableWatch.tsx
|
|
7783
|
-
var
|
|
7784
|
-
var
|
|
7906
|
+
var React33 = __toModule(require("react"));
|
|
7907
|
+
var import_react44 = __toModule(require("react"));
|
|
7785
7908
|
var error = err("CSSVariableWatch");
|
|
7786
7909
|
var debug6 = dbg("CSSVariableWatch");
|
|
7787
7910
|
var WRAPPER_STYLE = {
|
|
@@ -7794,15 +7917,15 @@ var WRAPPER_STYLE = {
|
|
|
7794
7917
|
overflow: "hidden"
|
|
7795
7918
|
};
|
|
7796
7919
|
var useCSSVariableWatch = (params) => {
|
|
7797
|
-
const lastValueRef = (0,
|
|
7798
|
-
const onResize =
|
|
7920
|
+
const lastValueRef = (0, import_react44.useRef)(0);
|
|
7921
|
+
const onResize = React33.useCallback(({ height }) => {
|
|
7799
7922
|
if (height && height !== lastValueRef.current) {
|
|
7800
7923
|
lastValueRef.current = height;
|
|
7801
7924
|
params.onChange(height);
|
|
7802
7925
|
}
|
|
7803
7926
|
}, [params.onChange]);
|
|
7804
7927
|
useResizeObserver(params.ref, onResize, { earlyAttach: true });
|
|
7805
|
-
|
|
7928
|
+
React33.useLayoutEffect(() => {
|
|
7806
7929
|
const value = params.ref.current.getBoundingClientRect().height;
|
|
7807
7930
|
if (value) {
|
|
7808
7931
|
lastValueRef.current = value;
|
|
@@ -7814,15 +7937,15 @@ var useCSSVariableWatch = (params) => {
|
|
|
7814
7937
|
}, []);
|
|
7815
7938
|
};
|
|
7816
7939
|
var CSSVariableWatch = (props) => {
|
|
7817
|
-
const domRef = (0,
|
|
7940
|
+
const domRef = (0, import_react44.useRef)(null);
|
|
7818
7941
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7819
7942
|
ref: domRef
|
|
7820
7943
|
}));
|
|
7821
|
-
return /* @__PURE__ */
|
|
7944
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
7822
7945
|
"data-name": "css-variable-watcher",
|
|
7823
7946
|
"data-var": props.varName,
|
|
7824
7947
|
style: WRAPPER_STYLE
|
|
7825
|
-
}, /* @__PURE__ */
|
|
7948
|
+
}, /* @__PURE__ */ React33.createElement("div", {
|
|
7826
7949
|
ref: domRef,
|
|
7827
7950
|
style: {
|
|
7828
7951
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -7915,7 +8038,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
7915
8038
|
}
|
|
7916
8039
|
|
|
7917
8040
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7918
|
-
var
|
|
8041
|
+
var React34 = __toModule(require("react"));
|
|
7919
8042
|
|
|
7920
8043
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
7921
8044
|
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
@@ -7927,18 +8050,18 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
7927
8050
|
var baseCls = `${rootClassName11}-LoadMask`;
|
|
7928
8051
|
function LoadMaskFn(props) {
|
|
7929
8052
|
const { visible, children = "Loading" } = props;
|
|
7930
|
-
return /* @__PURE__ */
|
|
8053
|
+
return /* @__PURE__ */ React34.createElement("div", {
|
|
7931
8054
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls}`
|
|
7932
|
-
}, /* @__PURE__ */
|
|
8055
|
+
}, /* @__PURE__ */ React34.createElement("div", {
|
|
7933
8056
|
className: `${LoadMaskOverlayCls} ${baseCls}-Overlay`
|
|
7934
|
-
}), /* @__PURE__ */
|
|
8057
|
+
}), /* @__PURE__ */ React34.createElement("div", {
|
|
7935
8058
|
className: `${LoadMaskTextCls} ${baseCls}-Text`
|
|
7936
8059
|
}, children));
|
|
7937
8060
|
}
|
|
7938
|
-
var LoadMask =
|
|
8061
|
+
var LoadMask = React34.memo(LoadMaskFn);
|
|
7939
8062
|
|
|
7940
8063
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
7941
|
-
var
|
|
8064
|
+
var import_react45 = __toModule(require("react"));
|
|
7942
8065
|
var OFFSET = 10;
|
|
7943
8066
|
function getColumnContentMaxWidths(domRef, options) {
|
|
7944
8067
|
var _a;
|
|
@@ -8003,11 +8126,11 @@ function useAutoSizeColumns() {
|
|
|
8003
8126
|
horizontalVirtualBrain
|
|
8004
8127
|
}
|
|
8005
8128
|
} = useComponentState();
|
|
8006
|
-
const [refreshId, setRefreshId] = (0,
|
|
8129
|
+
const [refreshId, setRefreshId] = (0, import_react45.useState)(0);
|
|
8007
8130
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
8008
8131
|
const getTheKey = useLatest(theKey);
|
|
8009
|
-
const lastExecutedIdentifierRef = (0,
|
|
8010
|
-
(0,
|
|
8132
|
+
const lastExecutedIdentifierRef = (0, import_react45.useRef)(null);
|
|
8133
|
+
(0, import_react45.useEffect)(() => {
|
|
8011
8134
|
const key = getTheKey();
|
|
8012
8135
|
if (key == null) {
|
|
8013
8136
|
return;
|
|
@@ -8025,7 +8148,7 @@ function useAutoSizeColumns() {
|
|
|
8025
8148
|
removeHorizontal();
|
|
8026
8149
|
};
|
|
8027
8150
|
}, [verticalVirtualBrain, horizontalVirtualBrain]);
|
|
8028
|
-
(0,
|
|
8151
|
+
(0, import_react45.useEffect)(() => {
|
|
8029
8152
|
var _a;
|
|
8030
8153
|
if (theKey == null) {
|
|
8031
8154
|
return;
|
|
@@ -8086,7 +8209,7 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
8086
8209
|
getParentState: () => useDataSource(),
|
|
8087
8210
|
debugName: "InfiniteTable"
|
|
8088
8211
|
});
|
|
8089
|
-
var InfiniteTableComponent =
|
|
8212
|
+
var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
8090
8213
|
var _a;
|
|
8091
8214
|
const {
|
|
8092
8215
|
componentState,
|
|
@@ -8133,7 +8256,7 @@ var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
|
|
|
8133
8256
|
bodySize,
|
|
8134
8257
|
computed
|
|
8135
8258
|
});
|
|
8136
|
-
|
|
8259
|
+
React35.useEffect(() => {
|
|
8137
8260
|
const dataSourceState = getDataSourceState();
|
|
8138
8261
|
const onChange = debounce((renderRange) => {
|
|
8139
8262
|
dataSourceState.notifyRenderRangeChange(renderRange);
|
|
@@ -8143,7 +8266,7 @@ var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
|
|
|
8143
8266
|
const licenseValid = useLicense(licenseKey);
|
|
8144
8267
|
const domProps = useDOMProps(componentState.domProps);
|
|
8145
8268
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
8146
|
-
|
|
8269
|
+
React35.useLayoutEffect(() => {
|
|
8147
8270
|
const dataSourceState = getDataSourceState();
|
|
8148
8271
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
8149
8272
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -8152,35 +8275,35 @@ var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
|
|
|
8152
8275
|
}
|
|
8153
8276
|
notifyScrollbarsChange(scrollbars);
|
|
8154
8277
|
}, [scrollbars]);
|
|
8155
|
-
|
|
8278
|
+
React35.useEffect(() => {
|
|
8156
8279
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
8157
8280
|
}, [scrollStopDelay]);
|
|
8158
8281
|
useAutoSizeColumns();
|
|
8159
|
-
return /* @__PURE__ */
|
|
8282
|
+
return /* @__PURE__ */ React35.createElement("div", __spreadValues({
|
|
8160
8283
|
ref: domRef
|
|
8161
|
-
}, domProps), header ? /* @__PURE__ */
|
|
8284
|
+
}, domProps), header ? /* @__PURE__ */ React35.createElement(TableHeaderWrapper, {
|
|
8162
8285
|
brain: horizontalVirtualBrain,
|
|
8163
8286
|
repaintId,
|
|
8164
8287
|
scrollbars
|
|
8165
|
-
}) : null, /* @__PURE__ */
|
|
8288
|
+
}) : null, /* @__PURE__ */ React35.createElement(InfiniteTableBody, null, /* @__PURE__ */ React35.createElement(VirtualScrollContainer, {
|
|
8166
8289
|
ref: scrollerDOMRef,
|
|
8167
8290
|
onContainerScroll: applyScrollVertical,
|
|
8168
8291
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
8169
|
-
}, /* @__PURE__ */
|
|
8292
|
+
}, /* @__PURE__ */ React35.createElement("div", {
|
|
8170
8293
|
className: display.flex
|
|
8171
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
8294
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React35.createElement(SpacePlaceholder, {
|
|
8172
8295
|
count: dataArray.length,
|
|
8173
8296
|
width: 0,
|
|
8174
8297
|
height: reservedContentHeight
|
|
8175
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
8298
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React35.createElement(LoadMaskCmp, {
|
|
8176
8299
|
visible: loading
|
|
8177
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
8300
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ React35.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React35.createElement("div", {
|
|
8178
8301
|
ref: portalDOMRef,
|
|
8179
8302
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
8180
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
8303
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ React35.createElement(CSSVariableWatch, {
|
|
8181
8304
|
varName: rowHeightCSSVar,
|
|
8182
8305
|
onChange: onRowHeightCSSVarChange
|
|
8183
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
8306
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ React35.createElement(CSSVariableWatch, {
|
|
8184
8307
|
varName: headerHeightCSSVar,
|
|
8185
8308
|
onChange: onHeaderHeightCSSVarChange
|
|
8186
8309
|
}) : null);
|
|
@@ -8216,25 +8339,25 @@ function InfiniteTableContextProvider() {
|
|
|
8216
8339
|
}
|
|
8217
8340
|
componentActions.bodySize = bodySize;
|
|
8218
8341
|
}, { earlyAttach: true });
|
|
8219
|
-
|
|
8342
|
+
React35.useEffect(() => {
|
|
8220
8343
|
return () => {
|
|
8221
8344
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
8222
8345
|
componentState.onHeaderHeightCSSVarChange.destroy();
|
|
8223
8346
|
};
|
|
8224
8347
|
}, []);
|
|
8225
|
-
|
|
8348
|
+
React35.useEffect(() => {
|
|
8226
8349
|
if (scrollerDOMRef.current) {
|
|
8227
8350
|
scrollerDOMRef.current.scrollTop = 0;
|
|
8228
8351
|
}
|
|
8229
8352
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
8230
8353
|
const TableContext2 = getInfiniteTableContext();
|
|
8231
|
-
return /* @__PURE__ */
|
|
8354
|
+
return /* @__PURE__ */ React35.createElement(TableContext2.Provider, {
|
|
8232
8355
|
value: contextValue
|
|
8233
|
-
}, /* @__PURE__ */
|
|
8356
|
+
}, /* @__PURE__ */ React35.createElement(InfiniteTableComponent, null));
|
|
8234
8357
|
}
|
|
8235
8358
|
function InfiniteTable(props) {
|
|
8236
|
-
const table = /* @__PURE__ */
|
|
8237
|
-
return /* @__PURE__ */
|
|
8359
|
+
const table = /* @__PURE__ */ React35.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React35.createElement(InfiniteTableContextProvider, null));
|
|
8360
|
+
return /* @__PURE__ */ React35.createElement(React35.StrictMode, null, table);
|
|
8238
8361
|
}
|
|
8239
8362
|
InfiniteTable.defaultProps = {
|
|
8240
8363
|
rowHeight: 40,
|