@infinite-table/infinite-react 0.2.1 → 0.2.5
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 +44 -37
- package/index.esm.js +360 -326
- package/index.js +385 -349
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -640,7 +640,7 @@ __export(exports, {
|
|
|
640
640
|
});
|
|
641
641
|
|
|
642
642
|
// src/components/InfiniteTable/index.tsx
|
|
643
|
-
var
|
|
643
|
+
var React34 = __toModule(require("react"));
|
|
644
644
|
|
|
645
645
|
// src/components/InfiniteTable/internalProps.ts
|
|
646
646
|
var rootClassName = "Infinite";
|
|
@@ -785,7 +785,6 @@ function initSetupState() {
|
|
|
785
785
|
draggingColumnId: null,
|
|
786
786
|
pinnedStartScrollListener: new ScrollListener(),
|
|
787
787
|
pinnedEndScrollListener: new ScrollListener(),
|
|
788
|
-
computedPivotColumns: void 0,
|
|
789
788
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
790
789
|
};
|
|
791
790
|
}
|
|
@@ -816,7 +815,6 @@ var forwardProps = (setupState) => {
|
|
|
816
815
|
pinnedStartMaxWidth: 1,
|
|
817
816
|
pinnedEndMaxWidth: 1,
|
|
818
817
|
pivotColumn: 1,
|
|
819
|
-
pivotRowLabelsColumn: 1,
|
|
820
818
|
pivotColumnGroups: 1,
|
|
821
819
|
onScrollbarsChange: 1,
|
|
822
820
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 100,
|
|
@@ -873,8 +871,9 @@ var mapPropsToState = (params) => {
|
|
|
873
871
|
groupBy,
|
|
874
872
|
groupColumn: props.groupColumn
|
|
875
873
|
});
|
|
876
|
-
const computedColumns = state.
|
|
874
|
+
const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
877
875
|
return {
|
|
876
|
+
controlledColumnVisibility: !!props.columnVisibility,
|
|
878
877
|
groupRenderStrategy,
|
|
879
878
|
groupBy,
|
|
880
879
|
computedColumns,
|
|
@@ -1400,6 +1399,7 @@ var getComputedVisibleColumns = ({
|
|
|
1400
1399
|
const result2 = __spreadProps(__spreadValues({
|
|
1401
1400
|
align: colType.align,
|
|
1402
1401
|
verticalAlign: colType.verticalAlign,
|
|
1402
|
+
defaultHiddenWhenGrouped: colType.defaultHiddenWhenGrouped,
|
|
1403
1403
|
valueGetter: colType.valueGetter,
|
|
1404
1404
|
renderValue: colType.renderValue,
|
|
1405
1405
|
render: colType.render
|
|
@@ -2044,7 +2044,7 @@ function useColumnGroups() {
|
|
|
2044
2044
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2045
2045
|
var import_react17 = __toModule(require("react"));
|
|
2046
2046
|
|
|
2047
|
-
// src/components/InfiniteTable/
|
|
2047
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2048
2048
|
var React6 = __toModule(require("react"));
|
|
2049
2049
|
|
|
2050
2050
|
// src/utils/join.ts
|
|
@@ -2115,91 +2115,15 @@ var userSelect = { none: "_16lm1iwm" };
|
|
|
2115
2115
|
var willChange = { transform: "_16lm1iw19" };
|
|
2116
2116
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2117
2117
|
|
|
2118
|
-
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
2119
|
-
function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
|
|
2120
|
-
if (!pivotColumns) {
|
|
2121
|
-
return void 0;
|
|
2122
|
-
}
|
|
2123
|
-
const {
|
|
2124
|
-
pivotColumn,
|
|
2125
|
-
pivotRowLabelsColumn,
|
|
2126
|
-
pivotBy,
|
|
2127
|
-
groupBy,
|
|
2128
|
-
pivotTotalColumnPosition,
|
|
2129
|
-
toggleGroupRow
|
|
2130
|
-
} = params;
|
|
2131
|
-
const computedPivotColumns = new Map();
|
|
2132
|
-
pivotColumns.forEach((col, key) => {
|
|
2133
|
-
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
2134
|
-
return;
|
|
2135
|
-
}
|
|
2136
|
-
let column = __spreadValues({}, col);
|
|
2137
|
-
const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
|
|
2138
|
-
if (!isPivotRowLabelsColumn) {
|
|
2139
|
-
if (pivotColumn) {
|
|
2140
|
-
if (typeof pivotColumn === "function") {
|
|
2141
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2142
|
-
column,
|
|
2143
|
-
pivotBy,
|
|
2144
|
-
groupBy
|
|
2145
|
-
}));
|
|
2146
|
-
} else {
|
|
2147
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
} else {
|
|
2151
|
-
if (pivotRowLabelsColumn) {
|
|
2152
|
-
if (typeof pivotRowLabelsColumn === "function") {
|
|
2153
|
-
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
|
|
2154
|
-
column,
|
|
2155
|
-
pivotBy,
|
|
2156
|
-
groupBy
|
|
2157
|
-
}));
|
|
2158
|
-
} else {
|
|
2159
|
-
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
if (!column.render) {
|
|
2163
|
-
column.render = (renderOptions) => {
|
|
2164
|
-
var _a;
|
|
2165
|
-
let { value, rowInfo, column: column2, groupBy: groupBy2 } = renderOptions;
|
|
2166
|
-
if (column2.renderValue) {
|
|
2167
|
-
value = column2.renderValue(renderOptions);
|
|
2168
|
-
}
|
|
2169
|
-
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupBy2.length;
|
|
2170
|
-
return /* @__PURE__ */ React6.createElement("div", {
|
|
2171
|
-
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2172
|
-
}, showExpanderIcon ? /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2173
|
-
expanded: !rowInfo.collapsed,
|
|
2174
|
-
onChange: () => {
|
|
2175
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2176
|
-
}
|
|
2177
|
-
}) : null, /* @__PURE__ */ React6.createElement("div", {
|
|
2178
|
-
className: cssEllipsisClassName
|
|
2179
|
-
}, value != null ? value : null));
|
|
2180
|
-
};
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
if (!column.render && column.renderValue) {
|
|
2184
|
-
column.render = (renderOptions) => {
|
|
2185
|
-
return column.renderValue(renderOptions);
|
|
2186
|
-
};
|
|
2187
|
-
}
|
|
2188
|
-
computedPivotColumns.set(key, column);
|
|
2189
|
-
});
|
|
2190
|
-
return computedPivotColumns;
|
|
2191
|
-
}
|
|
2192
|
-
|
|
2193
2118
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2194
|
-
var React7 = __toModule(require("react"));
|
|
2195
2119
|
function getGroupColumnRender({
|
|
2196
2120
|
groupIndexForColumn,
|
|
2197
2121
|
groupRenderStrategy,
|
|
2198
2122
|
toggleGroupRow
|
|
2199
2123
|
}) {
|
|
2200
2124
|
return (renderOptions) => {
|
|
2201
|
-
var _a;
|
|
2202
|
-
let { value, rowInfo, column } = renderOptions;
|
|
2125
|
+
var _a, _b, _c;
|
|
2126
|
+
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2203
2127
|
if (column.renderValue) {
|
|
2204
2128
|
value = column.renderValue(renderOptions);
|
|
2205
2129
|
}
|
|
@@ -2224,14 +2148,20 @@ function getGroupColumnRender({
|
|
|
2224
2148
|
return null;
|
|
2225
2149
|
}
|
|
2226
2150
|
}
|
|
2227
|
-
|
|
2151
|
+
let icon = null;
|
|
2152
|
+
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);
|
|
2153
|
+
if (showExpanderIcon) {
|
|
2154
|
+
const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2155
|
+
expanded: !collapsed,
|
|
2156
|
+
onChange: () => {
|
|
2157
|
+
toggleGroupRow(groupKeys);
|
|
2158
|
+
}
|
|
2159
|
+
});
|
|
2160
|
+
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2161
|
+
}
|
|
2162
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2228
2163
|
className: join(display.flex, alignItems.center)
|
|
2229
|
-
}, /* @__PURE__ */
|
|
2230
|
-
expanded: !collapsed,
|
|
2231
|
-
onChange: () => {
|
|
2232
|
-
toggleGroupRow(groupKeys);
|
|
2233
|
-
}
|
|
2234
|
-
}), /* @__PURE__ */ React7.createElement("div", {
|
|
2164
|
+
}, icon, /* @__PURE__ */ React6.createElement("div", {
|
|
2235
2165
|
className: cssEllipsisClassName
|
|
2236
2166
|
}, value != null ? value : null));
|
|
2237
2167
|
};
|
|
@@ -2267,21 +2197,29 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2267
2197
|
groupByField: options.groupBy.map((g) => g.field),
|
|
2268
2198
|
sortable: false,
|
|
2269
2199
|
render: (renderOptions) => {
|
|
2270
|
-
|
|
2200
|
+
var _a, _b;
|
|
2201
|
+
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2271
2202
|
if (!rowInfo.isGroupRow) {
|
|
2272
2203
|
return null;
|
|
2273
2204
|
}
|
|
2274
2205
|
if (column.renderValue) {
|
|
2275
2206
|
value = column.renderValue(renderOptions);
|
|
2276
2207
|
}
|
|
2277
|
-
|
|
2208
|
+
const collapsed = rowInfo.collapsed;
|
|
2209
|
+
let icon = null;
|
|
2210
|
+
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);
|
|
2211
|
+
if (showExpanderIcon) {
|
|
2212
|
+
const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2213
|
+
expanded: !collapsed,
|
|
2214
|
+
onChange: () => {
|
|
2215
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
2216
|
+
}
|
|
2217
|
+
});
|
|
2218
|
+
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2219
|
+
}
|
|
2220
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2278
2221
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2279
|
-
}, /* @__PURE__ */
|
|
2280
|
-
expanded: !rowInfo.collapsed,
|
|
2281
|
-
onChange: () => {
|
|
2282
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2283
|
-
}
|
|
2284
|
-
}), /* @__PURE__ */ React7.createElement("div", {
|
|
2222
|
+
}, icon, /* @__PURE__ */ React6.createElement("div", {
|
|
2285
2223
|
className: cssEllipsisClassName
|
|
2286
2224
|
}, value != null ? value : null));
|
|
2287
2225
|
}
|
|
@@ -2300,7 +2238,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2300
2238
|
var import_react16 = __toModule(require("react"));
|
|
2301
2239
|
|
|
2302
2240
|
// src/components/DataSource/index.tsx
|
|
2303
|
-
var
|
|
2241
|
+
var React7 = __toModule(require("react"));
|
|
2304
2242
|
|
|
2305
2243
|
// src/utils/multisort/sortTypes.ts
|
|
2306
2244
|
var numberComparator = function(first, second) {
|
|
@@ -2648,6 +2586,7 @@ var DeepMap = class {
|
|
|
2648
2586
|
|
|
2649
2587
|
// src/utils/groupAndPivot/index.ts
|
|
2650
2588
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
2589
|
+
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
2651
2590
|
function DEFAULT_TO_KEY(value) {
|
|
2652
2591
|
return value;
|
|
2653
2592
|
}
|
|
@@ -2711,13 +2650,23 @@ function lazyGroup(groupParams, rootData) {
|
|
|
2711
2650
|
rootData.visitDepthFirst((lazyGroupRowInfo, keys, _index, next) => {
|
|
2712
2651
|
const [_rootKey, ...currentGroupKeys] = keys;
|
|
2713
2652
|
const dataArray = lazyGroupRowInfo.items;
|
|
2653
|
+
if (currentGroupKeys.length == groupBy.length) {
|
|
2654
|
+
const deepMapGroupValue = deepMap.get(currentGroupKeys);
|
|
2655
|
+
if (deepMapGroupValue) {
|
|
2656
|
+
deepMapGroupValue.items = dataArray;
|
|
2657
|
+
}
|
|
2658
|
+
return next == null ? void 0 : next();
|
|
2659
|
+
}
|
|
2714
2660
|
for (let i = 0, len = dataArray.length; i < len; i++) {
|
|
2715
2661
|
if (!dataArray[i]) {
|
|
2716
2662
|
const deepMapGroupValue2 = {
|
|
2717
2663
|
items: [],
|
|
2718
2664
|
reducerResults: {}
|
|
2719
2665
|
};
|
|
2720
|
-
deepMap.set([
|
|
2666
|
+
deepMap.set([
|
|
2667
|
+
...currentGroupKeys,
|
|
2668
|
+
`${NOT_LOADED_YET_KEY_PREFIX}${i}`
|
|
2669
|
+
], deepMapGroupValue2);
|
|
2721
2670
|
continue;
|
|
2722
2671
|
}
|
|
2723
2672
|
const dataObject = dataArray[i].data;
|
|
@@ -2728,6 +2677,7 @@ function lazyGroup(groupParams, rootData) {
|
|
|
2728
2677
|
currentGroupKeys.push(key);
|
|
2729
2678
|
const deepMapGroupValue = {
|
|
2730
2679
|
items: [],
|
|
2680
|
+
commonData: dataObject,
|
|
2731
2681
|
reducerResults: dataArray[i].aggregations || {}
|
|
2732
2682
|
};
|
|
2733
2683
|
deepMap.set(currentGroupKeys, deepMapGroupValue);
|
|
@@ -2863,10 +2813,15 @@ function flatten(groupResult) {
|
|
|
2863
2813
|
function getEnhancedGroupData(options, deepMapValue) {
|
|
2864
2814
|
const { groupBy, groupKeys, collapsed, parents, reducers } = options;
|
|
2865
2815
|
const groupNesting = groupKeys.length;
|
|
2866
|
-
const {
|
|
2816
|
+
const {
|
|
2817
|
+
items: groupItems,
|
|
2818
|
+
reducerResults,
|
|
2819
|
+
pivotDeepMap,
|
|
2820
|
+
commonData
|
|
2821
|
+
} = deepMapValue;
|
|
2867
2822
|
let data = null;
|
|
2868
2823
|
if (Object.keys(reducerResults).length > 0) {
|
|
2869
|
-
data = {};
|
|
2824
|
+
data = commonData || {};
|
|
2870
2825
|
for (let key in reducers)
|
|
2871
2826
|
if (reducers.hasOwnProperty(key)) {
|
|
2872
2827
|
const reducer = reducers[key];
|
|
@@ -2876,12 +2831,16 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2876
2831
|
}
|
|
2877
2832
|
}
|
|
2878
2833
|
}
|
|
2834
|
+
let theValue = groupKeys[groupKeys.length - 1];
|
|
2835
|
+
if (typeof theValue === "string" && theValue.startsWith(NOT_LOADED_YET_KEY_PREFIX)) {
|
|
2836
|
+
theValue = null;
|
|
2837
|
+
}
|
|
2879
2838
|
const enhancedGroupData = {
|
|
2880
2839
|
data,
|
|
2881
2840
|
groupCount: groupItems.length,
|
|
2882
2841
|
groupData: groupItems,
|
|
2883
2842
|
groupKeys,
|
|
2884
|
-
id: groupKeys
|
|
2843
|
+
id: `${groupKeys}`,
|
|
2885
2844
|
collapsed,
|
|
2886
2845
|
parents,
|
|
2887
2846
|
collapsedChildrenCount: 0,
|
|
@@ -2889,7 +2848,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2889
2848
|
indexInParentGroups: options.indexInParentGroups,
|
|
2890
2849
|
indexInGroup: options.indexInGroup,
|
|
2891
2850
|
indexInAll: options.indexInAll,
|
|
2892
|
-
value:
|
|
2851
|
+
value: theValue,
|
|
2893
2852
|
rootGroupBy: groupBy,
|
|
2894
2853
|
groupBy: groupNesting === groupBy.length ? groupBy : groupBy.slice(0, groupNesting),
|
|
2895
2854
|
isGroupRow: true,
|
|
@@ -2958,7 +2917,7 @@ function enhancedFlatten(param) {
|
|
|
2958
2917
|
const startIndex = result.length;
|
|
2959
2918
|
result.push(...items.map((item, index) => {
|
|
2960
2919
|
return {
|
|
2961
|
-
id: toPrimaryKey(item)
|
|
2920
|
+
id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
|
|
2962
2921
|
data: item,
|
|
2963
2922
|
isGroupRow: false,
|
|
2964
2923
|
collapsed: false,
|
|
@@ -3054,7 +3013,7 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
3054
3013
|
dataSourceParams.livePaginationCursor = componentState.livePaginationCursor;
|
|
3055
3014
|
dataSourceParams.cursorId = componentState.cursorId;
|
|
3056
3015
|
}
|
|
3057
|
-
if (componentState.
|
|
3016
|
+
if (componentState.lazyLoad) {
|
|
3058
3017
|
if (componentState.lazyLoadBatchSize != null && componentState.lazyLoadBatchSize > 0) {
|
|
3059
3018
|
dataSourceParams.lazyLoadBatchSize = componentState.lazyLoadBatchSize;
|
|
3060
3019
|
dataSourceParams.lazyLoadStartIndex = 0;
|
|
@@ -3079,15 +3038,34 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
3079
3038
|
}
|
|
3080
3039
|
function loadData(data, componentState, actions, overrides) {
|
|
3081
3040
|
const dataParams = buildDataSourceDataParams(componentState, overrides);
|
|
3041
|
+
if (componentState.lazyLoad) {
|
|
3042
|
+
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3043
|
+
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
|
|
3044
|
+
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3045
|
+
if (existingGroupRowInfo && existingGroupRowInfo.cache) {
|
|
3046
|
+
const items = existingGroupRowInfo.items;
|
|
3047
|
+
const len = items.length;
|
|
3048
|
+
let allLoaded = true;
|
|
3049
|
+
for (let i = 0; i < len; i++) {
|
|
3050
|
+
if (items[i] == null) {
|
|
3051
|
+
allLoaded = false;
|
|
3052
|
+
break;
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
if (allLoaded) {
|
|
3056
|
+
return Promise.resolve(true);
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3082
3060
|
if (typeof data === "function") {
|
|
3083
3061
|
data = data(dataParams);
|
|
3084
3062
|
}
|
|
3085
3063
|
const dataIsPromise = typeof data === "object" && typeof data.then === "function";
|
|
3086
|
-
if (dataIsPromise && !componentState.
|
|
3064
|
+
if (dataIsPromise && !componentState.lazyLoad) {
|
|
3087
3065
|
actions.loading = true;
|
|
3088
3066
|
}
|
|
3089
3067
|
return Promise.resolve(data).then((dataParam) => {
|
|
3090
|
-
var _a, _b, _c;
|
|
3068
|
+
var _a, _b, _c, _d;
|
|
3091
3069
|
let dataArray = [];
|
|
3092
3070
|
let skipAssign = false;
|
|
3093
3071
|
if (Array.isArray(dataParam.data)) {
|
|
@@ -3099,10 +3077,11 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3099
3077
|
if (remoteData.mappings) {
|
|
3100
3078
|
actions.pivotMappings = remoteData.mappings;
|
|
3101
3079
|
}
|
|
3102
|
-
if (componentState.
|
|
3080
|
+
if (componentState.lazyLoad) {
|
|
3103
3081
|
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3104
|
-
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys];
|
|
3082
|
+
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
|
|
3105
3083
|
const newGroupRowInfo = {
|
|
3084
|
+
cache: !!remoteData.cache,
|
|
3106
3085
|
totalCount: (_a = remoteData.totalCount) != null ? _a : dataArray.length,
|
|
3107
3086
|
items: dataArray
|
|
3108
3087
|
};
|
|
@@ -3110,11 +3089,15 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3110
3089
|
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3111
3090
|
const currentGroupRowInfo = existingGroupRowInfo != null ? existingGroupRowInfo : {
|
|
3112
3091
|
items: [],
|
|
3113
|
-
totalCount: newGroupRowInfo.totalCount
|
|
3092
|
+
totalCount: newGroupRowInfo.totalCount,
|
|
3093
|
+
cache: (_b = newGroupRowInfo.cache) != null ? _b : true
|
|
3114
3094
|
};
|
|
3095
|
+
if (existingGroupRowInfo) {
|
|
3096
|
+
existingGroupRowInfo.cache = newGroupRowInfo.cache;
|
|
3097
|
+
}
|
|
3115
3098
|
currentGroupRowInfo.items.length = currentGroupRowInfo.totalCount;
|
|
3116
|
-
const start = (
|
|
3117
|
-
const end = Math.min((
|
|
3099
|
+
const start = (_c = dataParams.lazyLoadStartIndex) != null ? _c : 0;
|
|
3100
|
+
const end = Math.min((_d = remoteData.totalCount) != null ? _d : start + dataParams.lazyLoadBatchSize);
|
|
3118
3101
|
for (let i = start; i < end; i++) {
|
|
3119
3102
|
currentGroupRowInfo.items[i] = newGroupRowInfo.items[i - start];
|
|
3120
3103
|
}
|
|
@@ -3126,6 +3109,10 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3126
3109
|
}
|
|
3127
3110
|
skipAssign = true;
|
|
3128
3111
|
actions.originalLazyGroupDataChangeDetect = getChangeDetect();
|
|
3112
|
+
if (!dataParams.groupKeys || !dataParams.groupKeys.length) {
|
|
3113
|
+
const topLevelItems = lazyGroupData.get([LAZY_ROOT_KEY_FOR_GROUPS]);
|
|
3114
|
+
actions.originalDataArray = [...topLevelItems.items];
|
|
3115
|
+
}
|
|
3129
3116
|
}
|
|
3130
3117
|
} else {
|
|
3131
3118
|
dataArray = dataParam;
|
|
@@ -3133,7 +3120,7 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3133
3120
|
if (!skipAssign) {
|
|
3134
3121
|
actions.originalDataArray = dataArray;
|
|
3135
3122
|
}
|
|
3136
|
-
if (dataIsPromise && !componentState.
|
|
3123
|
+
if (dataIsPromise && !componentState.lazyLoad) {
|
|
3137
3124
|
actions.loading = false;
|
|
3138
3125
|
}
|
|
3139
3126
|
});
|
|
@@ -3284,34 +3271,34 @@ function lazyLoadRange(options, cache) {
|
|
|
3284
3271
|
continue;
|
|
3285
3272
|
}
|
|
3286
3273
|
const rowLoaded = rowInfo.data != null;
|
|
3287
|
-
const
|
|
3288
|
-
if (rowInfo.groupKeys) {
|
|
3289
|
-
|
|
3274
|
+
const theGroupKeys = rowInfo.groupKeys ? [...rowInfo.groupKeys] : [];
|
|
3275
|
+
if (rowInfo.groupKeys && rowInfo.isGroupRow) {
|
|
3276
|
+
theGroupKeys.pop();
|
|
3290
3277
|
}
|
|
3291
|
-
const cacheKeys =
|
|
3278
|
+
const cacheKeys = theGroupKeys.length ? theGroupKeys : rootGroupKeys;
|
|
3292
3279
|
const indexInGroup = rowInfo.indexInGroup;
|
|
3293
3280
|
if (!rowLoaded) {
|
|
3294
|
-
let
|
|
3281
|
+
let cachedFnCalls = perGroupFnCalls.get(cacheKeys);
|
|
3295
3282
|
const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
|
|
3296
3283
|
const offset = rowInfo.indexInGroup - batchStartIndexInGroup;
|
|
3297
3284
|
const absoluteIndexOfBatchStart = dataArray[rowInfo.indexInAll - offset].indexInAll;
|
|
3298
3285
|
const batchStartRowLoaded = isRowLoaded(absoluteIndexOfBatchStart);
|
|
3299
3286
|
const batchStartRowId = dataArray[absoluteIndexOfBatchStart].id;
|
|
3300
|
-
if (batchStartRowLoaded || (
|
|
3287
|
+
if (batchStartRowLoaded || (cachedFnCalls == null ? void 0 : cachedFnCalls[batchStartRowId])) {
|
|
3301
3288
|
continue;
|
|
3302
3289
|
}
|
|
3303
|
-
const shouldSetFnCalls = !
|
|
3304
|
-
|
|
3290
|
+
const shouldSetFnCalls = !cachedFnCalls;
|
|
3291
|
+
cachedFnCalls = cachedFnCalls || {};
|
|
3305
3292
|
const currentFnCall = {
|
|
3306
3293
|
lazyLoadStartIndex: batchStartIndexInGroup,
|
|
3307
3294
|
lazyLoadBatchSize,
|
|
3308
|
-
groupKeys:
|
|
3295
|
+
groupKeys: theGroupKeys
|
|
3309
3296
|
};
|
|
3310
|
-
if (!
|
|
3311
|
-
|
|
3297
|
+
if (!cachedFnCalls[batchStartRowId]) {
|
|
3298
|
+
cachedFnCalls[batchStartRowId] = currentFnCall;
|
|
3312
3299
|
}
|
|
3313
3300
|
if (shouldSetFnCalls) {
|
|
3314
|
-
perGroupFnCalls.set(cacheKeys,
|
|
3301
|
+
perGroupFnCalls.set(cacheKeys, cachedFnCalls);
|
|
3315
3302
|
}
|
|
3316
3303
|
}
|
|
3317
3304
|
}
|
|
@@ -3568,12 +3555,11 @@ function getCompareObjectForDataParams(dataParams) {
|
|
|
3568
3555
|
var forwardProps3 = (setupState) => {
|
|
3569
3556
|
return {
|
|
3570
3557
|
onDataParamsChange: (fn) => fn ? discardCallsWithEqualArg(fn, 100, getCompareObjectForDataParams) : void 0,
|
|
3571
|
-
|
|
3558
|
+
lazyLoad: (lazyLoad) => !!lazyLoad,
|
|
3572
3559
|
data: 1,
|
|
3573
3560
|
pivotBy: 1,
|
|
3574
3561
|
primaryKey: 1,
|
|
3575
3562
|
livePagination: 1,
|
|
3576
|
-
lazyLoadBatchSize: (lazyLoadBatchSize) => lazyLoadBatchSize != null ? lazyLoadBatchSize : -1,
|
|
3577
3563
|
aggregationReducers: 1,
|
|
3578
3564
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
|
|
3579
3565
|
loading: (loading) => loading != null ? loading : false,
|
|
@@ -3600,7 +3586,8 @@ function mapPropsToState2(params) {
|
|
|
3600
3586
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
3601
3587
|
const result = {
|
|
3602
3588
|
controlledSort,
|
|
3603
|
-
multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo)
|
|
3589
|
+
multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo),
|
|
3590
|
+
lazyLoadBatchSize: typeof props.lazyLoad === "object" ? props.lazyLoad.batchSize : void 0
|
|
3604
3591
|
};
|
|
3605
3592
|
if (props.livePagination) {
|
|
3606
3593
|
const dataArrayChanged = !oldState || oldState.originalDataArray !== state.originalDataArray;
|
|
@@ -3613,7 +3600,7 @@ var debugFullLazyLoad = dbg("DataSource:fullLazyLoad");
|
|
|
3613
3600
|
function onPropChange(params, props, actions) {
|
|
3614
3601
|
const { name, newValue } = params;
|
|
3615
3602
|
if (name === "data" && typeof newValue === "function" && !props.groupRowsState) {
|
|
3616
|
-
if (props.
|
|
3603
|
+
if (props.lazyLoad) {
|
|
3617
3604
|
debugFullLazyLoad(`"data" function prop has changed`);
|
|
3618
3605
|
}
|
|
3619
3606
|
if (props.collapseGroupRowsOnDataFunctionChange !== false) {
|
|
@@ -3722,23 +3709,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
3722
3709
|
const aggregationReducers = Object.keys(reducers).map((key) => {
|
|
3723
3710
|
return __spreadProps(__spreadValues({}, reducers[key]), { id: key });
|
|
3724
3711
|
});
|
|
3725
|
-
const columns = new Map([
|
|
3726
|
-
[
|
|
3727
|
-
"labels",
|
|
3728
|
-
{
|
|
3729
|
-
header: "Row labels",
|
|
3730
|
-
pivotBy,
|
|
3731
|
-
valueGetter: (params) => {
|
|
3732
|
-
var _a;
|
|
3733
|
-
const { rowInfo } = params;
|
|
3734
|
-
if (!rowInfo.data) {
|
|
3735
|
-
return "Loading ...";
|
|
3736
|
-
}
|
|
3737
|
-
return rowInfo.groupKeys ? rowInfo.groupKeys[((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) - 1] : null;
|
|
3738
|
-
}
|
|
3739
|
-
}
|
|
3740
|
-
]
|
|
3741
|
-
]);
|
|
3712
|
+
const columns = new Map([]);
|
|
3742
3713
|
const columnGroups = new Map();
|
|
3743
3714
|
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
3744
3715
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
@@ -3896,17 +3867,29 @@ function concludeReducer(params) {
|
|
|
3896
3867
|
var _a;
|
|
3897
3868
|
const { state, previousState } = params;
|
|
3898
3869
|
const sortInfo = state.sortInfo;
|
|
3899
|
-
|
|
3900
|
-
|
|
3870
|
+
let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
|
|
3871
|
+
if (state.lazyLoad || state.livePagination) {
|
|
3872
|
+
shouldSort = false;
|
|
3873
|
+
}
|
|
3874
|
+
let originalDataArrayChanged = haveDepsChanged(previousState, state, [
|
|
3901
3875
|
"originalDataArray"
|
|
3902
3876
|
]);
|
|
3877
|
+
const dataSourceChange = previousState && state.data !== previousState.data;
|
|
3878
|
+
let lazyLoadGroupDataChange = state.lazyLoad && previousState && (previousState.groupBy !== state.groupBy || previousState.sortInfo !== state.sortInfo);
|
|
3879
|
+
if (dataSourceChange) {
|
|
3880
|
+
lazyLoadGroupDataChange = true;
|
|
3881
|
+
}
|
|
3882
|
+
if (lazyLoadGroupDataChange) {
|
|
3883
|
+
state.originalLazyGroupData = new DeepMap();
|
|
3884
|
+
originalDataArrayChanged = true;
|
|
3885
|
+
}
|
|
3903
3886
|
const sortInfoChanged = haveDepsChanged(previousState, state, ["sortInfo"]);
|
|
3904
3887
|
const sortDepsChanged = originalDataArrayChanged || sortInfoChanged;
|
|
3905
3888
|
const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray);
|
|
3906
3889
|
const groupBy = state.groupBy;
|
|
3907
3890
|
const pivotBy = state.pivotBy;
|
|
3908
3891
|
const shouldGroup = groupBy.length || pivotBy;
|
|
3909
|
-
const groupsDepsChanged = haveDepsChanged(previousState, state, [
|
|
3892
|
+
const groupsDepsChanged = originalDataArrayChanged || haveDepsChanged(previousState, state, [
|
|
3910
3893
|
"generateGroupRows",
|
|
3911
3894
|
"originalDataArray",
|
|
3912
3895
|
"originalLazyGroupData",
|
|
@@ -3931,11 +3914,15 @@ function concludeReducer(params) {
|
|
|
3931
3914
|
state.postSortDataArray = dataArray;
|
|
3932
3915
|
state.groupDeepMap = void 0;
|
|
3933
3916
|
const toPrimaryKey = (data) => {
|
|
3934
|
-
|
|
3917
|
+
const pk = data[state.primaryKey];
|
|
3918
|
+
if (Array.isArray(pk)) {
|
|
3919
|
+
debugger;
|
|
3920
|
+
}
|
|
3921
|
+
return pk;
|
|
3935
3922
|
};
|
|
3936
3923
|
if (shouldGroup) {
|
|
3937
3924
|
if (shouldGroupAgain) {
|
|
3938
|
-
const groupResult = state.
|
|
3925
|
+
const groupResult = state.lazyLoad ? lazyGroup({
|
|
3939
3926
|
groupBy,
|
|
3940
3927
|
pivot: pivotBy,
|
|
3941
3928
|
mappings: state.pivotMappings,
|
|
@@ -3973,7 +3960,7 @@ function concludeReducer(params) {
|
|
|
3973
3960
|
state.pivotColumns = void 0;
|
|
3974
3961
|
const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
|
|
3975
3962
|
if (arrayDifferentAfterSortStep) {
|
|
3976
|
-
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, toPrimaryKey(data), index));
|
|
3963
|
+
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
|
|
3977
3964
|
}
|
|
3978
3965
|
}
|
|
3979
3966
|
state.postGroupDataArray = rowInfoDataArray;
|
|
@@ -4001,7 +3988,7 @@ function DataSourceWithContext(props) {
|
|
|
4001
3988
|
if (typeof children === "function") {
|
|
4002
3989
|
children = children(computedValues);
|
|
4003
3990
|
}
|
|
4004
|
-
return /* @__PURE__ */
|
|
3991
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children);
|
|
4005
3992
|
}
|
|
4006
3993
|
var DataSourceRoot = getComponentStateRoot({
|
|
4007
3994
|
initSetupState: initSetupState2,
|
|
@@ -4024,14 +4011,14 @@ function DataSourceCmp({ children }) {
|
|
|
4024
4011
|
globalThis.getDataSourceState = getState;
|
|
4025
4012
|
}
|
|
4026
4013
|
useLoadData();
|
|
4027
|
-
return /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ React7.createElement(DataSourceContext.Provider, {
|
|
4028
4015
|
value: contextValue
|
|
4029
|
-
}, /* @__PURE__ */
|
|
4016
|
+
}, /* @__PURE__ */ React7.createElement(DataSourceWithContext, {
|
|
4030
4017
|
children
|
|
4031
4018
|
}));
|
|
4032
4019
|
}
|
|
4033
4020
|
function DataSource(props) {
|
|
4034
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ React7.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React7.createElement(DataSourceCmp, {
|
|
4035
4022
|
children: props.children
|
|
4036
4023
|
}));
|
|
4037
4024
|
}
|
|
@@ -4044,7 +4031,7 @@ function useToggleGroupRow() {
|
|
|
4044
4031
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
4045
4032
|
newState.toggleGroupRow(groupKeys);
|
|
4046
4033
|
dataSourceActions.groupRowsState = newState;
|
|
4047
|
-
if (state.
|
|
4034
|
+
if (state.lazyLoad && newState.isGroupRowExpanded(groupKeys)) {
|
|
4048
4035
|
loadData(state.data, state, dataSourceActions, {
|
|
4049
4036
|
groupKeys
|
|
4050
4037
|
});
|
|
@@ -4082,9 +4069,9 @@ function useColumnsWhen() {
|
|
|
4082
4069
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
4083
4070
|
}, [pivotTotalColumnPosition]);
|
|
4084
4071
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4072
|
+
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4073
|
+
useHideColumns();
|
|
4074
|
+
return { toggleGroupRow };
|
|
4088
4075
|
}
|
|
4089
4076
|
function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
4090
4077
|
const toggleGroupRow = useToggleGroupRow();
|
|
@@ -4094,6 +4081,9 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4094
4081
|
} = useComponentState();
|
|
4095
4082
|
function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
|
|
4096
4083
|
const computedColumns = new Map();
|
|
4084
|
+
if (groupRenderStrategy2 !== "inline") {
|
|
4085
|
+
return;
|
|
4086
|
+
}
|
|
4097
4087
|
columns2.forEach((column, id) => {
|
|
4098
4088
|
let base = {};
|
|
4099
4089
|
const groupByForColumn = groupByMap2.get(column.field);
|
|
@@ -4153,51 +4143,32 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4153
4143
|
});
|
|
4154
4144
|
}, [columns, groupByMap, groupRenderStrategy, toggleGroupRow]);
|
|
4155
4145
|
}
|
|
4156
|
-
function
|
|
4146
|
+
function useColumnsWhenGrouping() {
|
|
4157
4147
|
const {
|
|
4158
4148
|
componentState: { groupBy, pivotBy }
|
|
4159
4149
|
} = useDataSourceContextValue();
|
|
4160
4150
|
const {
|
|
4161
4151
|
componentActions,
|
|
4162
4152
|
componentState: {
|
|
4153
|
+
columns,
|
|
4154
|
+
groupColumn,
|
|
4155
|
+
groupRenderStrategy,
|
|
4163
4156
|
pivotColumns,
|
|
4164
4157
|
pivotColumn,
|
|
4165
|
-
pivotRowLabelsColumn,
|
|
4166
4158
|
pivotTotalColumnPosition
|
|
4167
4159
|
}
|
|
4168
4160
|
} = useComponentState();
|
|
4169
4161
|
const toggleGroupRow = useToggleGroupRow();
|
|
4170
4162
|
(0, import_react17.useEffect)(() => {
|
|
4171
|
-
const computedPivotColumns = getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, {
|
|
4172
|
-
pivotColumn,
|
|
4173
|
-
pivotRowLabelsColumn,
|
|
4174
|
-
pivotTotalColumnPosition,
|
|
4175
|
-
pivotBy,
|
|
4176
|
-
groupBy,
|
|
4177
|
-
toggleGroupRow
|
|
4178
|
-
});
|
|
4179
|
-
componentActions.computedPivotColumns = computedPivotColumns;
|
|
4180
|
-
}, [pivotColumns, pivotColumn, pivotRowLabelsColumn]);
|
|
4181
|
-
}
|
|
4182
|
-
function useColumnsWhenGrouping() {
|
|
4183
|
-
const {
|
|
4184
|
-
componentState: { groupBy }
|
|
4185
|
-
} = useDataSourceContextValue();
|
|
4186
|
-
const {
|
|
4187
|
-
componentActions,
|
|
4188
|
-
componentState: { columns, groupColumn, groupRenderStrategy, pivotColumns }
|
|
4189
|
-
} = useComponentState();
|
|
4190
|
-
const toggleGroupRow = useToggleGroupRow();
|
|
4191
|
-
(0, import_react17.useEffect)(() => {
|
|
4192
|
-
if (pivotColumns) {
|
|
4193
|
-
return;
|
|
4194
|
-
}
|
|
4195
4163
|
const update = () => {
|
|
4196
4164
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
4197
4165
|
columns,
|
|
4198
4166
|
groupColumn,
|
|
4199
|
-
|
|
4167
|
+
pivotColumn,
|
|
4168
|
+
pivotTotalColumnPosition,
|
|
4169
|
+
groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
|
|
4200
4170
|
groupBy,
|
|
4171
|
+
pivotBy,
|
|
4201
4172
|
pivotColumns,
|
|
4202
4173
|
toggleGroupRow
|
|
4203
4174
|
});
|
|
@@ -4209,29 +4180,45 @@ function useColumnsWhenGrouping() {
|
|
|
4209
4180
|
delete: update,
|
|
4210
4181
|
clear: update
|
|
4211
4182
|
});
|
|
4212
|
-
}, [
|
|
4183
|
+
}, [
|
|
4184
|
+
columns,
|
|
4185
|
+
groupBy,
|
|
4186
|
+
pivotBy,
|
|
4187
|
+
groupColumn,
|
|
4188
|
+
groupRenderStrategy,
|
|
4189
|
+
pivotColumns,
|
|
4190
|
+
pivotTotalColumnPosition,
|
|
4191
|
+
pivotColumn
|
|
4192
|
+
]);
|
|
4193
|
+
return { toggleGroupRow };
|
|
4213
4194
|
}
|
|
4214
|
-
function
|
|
4195
|
+
function useHideColumns() {
|
|
4215
4196
|
const {
|
|
4216
|
-
componentState: {
|
|
4197
|
+
componentState: {
|
|
4198
|
+
dataArray,
|
|
4199
|
+
groupBy,
|
|
4200
|
+
groupRowsState,
|
|
4201
|
+
originalLazyGroupDataChangeDetect
|
|
4202
|
+
},
|
|
4217
4203
|
getState: getDataSourceState
|
|
4218
4204
|
} = useDataSourceContextValue();
|
|
4219
4205
|
const {
|
|
4220
4206
|
getComponentState,
|
|
4221
4207
|
componentActions,
|
|
4222
4208
|
componentState: {
|
|
4209
|
+
columnTypes,
|
|
4210
|
+
computedColumns,
|
|
4223
4211
|
columnsWhenGrouping: generatedColumns,
|
|
4224
4212
|
hideEmptyGroupColumns,
|
|
4225
4213
|
groupRenderStrategy
|
|
4226
4214
|
}
|
|
4227
4215
|
} = useComponentState();
|
|
4228
4216
|
(0, import_react17.useEffect)(() => {
|
|
4229
|
-
if (groupRenderStrategy !== "multi-column") {
|
|
4217
|
+
if (groupRenderStrategy !== "multi-column" || !hideEmptyGroupColumns) {
|
|
4230
4218
|
return;
|
|
4231
4219
|
}
|
|
4232
4220
|
const groupsLength = groupBy.length;
|
|
4233
4221
|
let expandedGroupsLevel = 0;
|
|
4234
|
-
const { dataArray } = getDataSourceState();
|
|
4235
4222
|
const len = dataArray.length;
|
|
4236
4223
|
for (let i = 0; i < len; i++) {
|
|
4237
4224
|
const data = dataArray[i];
|
|
@@ -4241,10 +4228,10 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
4241
4228
|
}
|
|
4242
4229
|
}
|
|
4243
4230
|
const currentState = getComponentState();
|
|
4244
|
-
const { computedColumns } = currentState;
|
|
4231
|
+
const { computedColumns: computedColumns2 } = currentState;
|
|
4245
4232
|
let updated = false;
|
|
4246
4233
|
const columnVisibility = __spreadValues({}, currentState.columnVisibility);
|
|
4247
|
-
const cols =
|
|
4234
|
+
const cols = computedColumns2;
|
|
4248
4235
|
groupBy.forEach(({ field, column: groupColumn }, index) => {
|
|
4249
4236
|
const colId = (groupColumn == null ? void 0 : groupColumn.id) || `group-by-${field}`;
|
|
4250
4237
|
let col = cols.get(colId);
|
|
@@ -4266,24 +4253,51 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
4266
4253
|
getDataSourceState,
|
|
4267
4254
|
groupRenderStrategy,
|
|
4268
4255
|
generatedColumns,
|
|
4256
|
+
originalLazyGroupDataChangeDetect,
|
|
4269
4257
|
groupBy,
|
|
4270
|
-
|
|
4258
|
+
hideEmptyGroupColumns ? dataArray : null,
|
|
4271
4259
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4272
4260
|
hideEmptyGroupColumns
|
|
4273
4261
|
]);
|
|
4262
|
+
(0, import_react17.useEffect)(() => {
|
|
4263
|
+
const isGrouped = groupBy.length > 0;
|
|
4264
|
+
const currentState = getComponentState();
|
|
4265
|
+
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
4266
|
+
if (controlledColumnVisibility) {
|
|
4267
|
+
return;
|
|
4268
|
+
}
|
|
4269
|
+
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
4270
|
+
let updated = false;
|
|
4271
|
+
computedColumns.forEach((col, id) => {
|
|
4272
|
+
if (col.defaultHiddenWhenGrouped) {
|
|
4273
|
+
const nowHidden = columnVisibility[id] === false;
|
|
4274
|
+
if (!nowHidden && isGrouped) {
|
|
4275
|
+
updated = true;
|
|
4276
|
+
newColumnVisibility[id] = false;
|
|
4277
|
+
}
|
|
4278
|
+
if (nowHidden && !isGrouped) {
|
|
4279
|
+
updated = true;
|
|
4280
|
+
delete newColumnVisibility[id];
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
});
|
|
4284
|
+
if (updated) {
|
|
4285
|
+
componentActions.columnVisibility = newColumnVisibility;
|
|
4286
|
+
}
|
|
4287
|
+
}, [computedColumns, columnTypes, groupBy]);
|
|
4274
4288
|
}
|
|
4275
4289
|
function getColumnsWhenGrouping(params) {
|
|
4276
4290
|
const {
|
|
4277
4291
|
pivotColumns,
|
|
4278
4292
|
groupBy,
|
|
4293
|
+
pivotBy,
|
|
4279
4294
|
groupColumn,
|
|
4295
|
+
pivotTotalColumnPosition,
|
|
4296
|
+
pivotColumn,
|
|
4280
4297
|
groupRenderStrategy,
|
|
4281
4298
|
toggleGroupRow,
|
|
4282
4299
|
columns
|
|
4283
4300
|
} = params;
|
|
4284
|
-
if (pivotColumns) {
|
|
4285
|
-
return void 0;
|
|
4286
|
-
}
|
|
4287
4301
|
if (groupRenderStrategy === "inline") {
|
|
4288
4302
|
return void 0;
|
|
4289
4303
|
}
|
|
@@ -4293,6 +4307,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4293
4307
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
4294
4308
|
groupByForColumn,
|
|
4295
4309
|
groupBy,
|
|
4310
|
+
pivotBy,
|
|
4296
4311
|
groupIndexForColumn,
|
|
4297
4312
|
groupCount: arr.length,
|
|
4298
4313
|
groupRenderStrategy
|
|
@@ -4303,13 +4318,40 @@ function getColumnsWhenGrouping(params) {
|
|
|
4303
4318
|
const singleGroupColumn = getSingleGroupColumn({
|
|
4304
4319
|
groupCount: groupBy.length,
|
|
4305
4320
|
groupBy,
|
|
4321
|
+
pivotBy,
|
|
4306
4322
|
groupRenderStrategy
|
|
4307
4323
|
}, toggleGroupRow, groupColumn);
|
|
4308
4324
|
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
4309
4325
|
}
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4326
|
+
if (pivotColumns) {
|
|
4327
|
+
pivotColumns.forEach((col, key) => {
|
|
4328
|
+
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
4329
|
+
return;
|
|
4330
|
+
}
|
|
4331
|
+
let column = __spreadValues({}, col);
|
|
4332
|
+
if (pivotColumn) {
|
|
4333
|
+
if (typeof pivotColumn === "function") {
|
|
4334
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
4335
|
+
column,
|
|
4336
|
+
pivotBy,
|
|
4337
|
+
groupBy
|
|
4338
|
+
}));
|
|
4339
|
+
} else {
|
|
4340
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4343
|
+
if (!column.render && column.renderValue) {
|
|
4344
|
+
column.render = (renderOptions) => {
|
|
4345
|
+
return column.renderValue(renderOptions);
|
|
4346
|
+
};
|
|
4347
|
+
}
|
|
4348
|
+
computedColumns.set(key, column);
|
|
4349
|
+
});
|
|
4350
|
+
} else {
|
|
4351
|
+
columns.forEach((col, colId) => {
|
|
4352
|
+
computedColumns.set(colId, col);
|
|
4353
|
+
});
|
|
4354
|
+
}
|
|
4313
4355
|
return computedColumns.size ? computedColumns : void 0;
|
|
4314
4356
|
}
|
|
4315
4357
|
|
|
@@ -4348,7 +4390,7 @@ function useComputed() {
|
|
|
4348
4390
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
4349
4391
|
const { multiSort } = dataSourceState;
|
|
4350
4392
|
useColumnGroups();
|
|
4351
|
-
useColumnsWhen();
|
|
4393
|
+
const { toggleGroupRow } = useColumnsWhen();
|
|
4352
4394
|
const setSortInfo = (0, import_react18.useCallback)((sortInfo) => {
|
|
4353
4395
|
var _a2;
|
|
4354
4396
|
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
@@ -4417,6 +4459,7 @@ function useComputed() {
|
|
|
4417
4459
|
const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
|
|
4418
4460
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
4419
4461
|
return {
|
|
4462
|
+
toggleGroupRow,
|
|
4420
4463
|
computedPinnedStartOverflow,
|
|
4421
4464
|
computedPinnedEndOverflow,
|
|
4422
4465
|
computedPinnedStartWidth,
|
|
@@ -4440,7 +4483,7 @@ function useComputed() {
|
|
|
4440
4483
|
}
|
|
4441
4484
|
|
|
4442
4485
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4443
|
-
var
|
|
4486
|
+
var React8 = __toModule(require("react"));
|
|
4444
4487
|
|
|
4445
4488
|
// src/components/InfiniteTable/hooks/useInternalProps.ts
|
|
4446
4489
|
var useInternalProps = () => {
|
|
@@ -4448,9 +4491,9 @@ var useInternalProps = () => {
|
|
|
4448
4491
|
};
|
|
4449
4492
|
|
|
4450
4493
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4451
|
-
var InfiniteTableBody =
|
|
4494
|
+
var InfiniteTableBody = React8.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
4452
4495
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
4453
|
-
return /* @__PURE__ */
|
|
4496
|
+
return /* @__PURE__ */ React8.createElement("div", __spreadProps(__spreadValues({
|
|
4454
4497
|
ref
|
|
4455
4498
|
}, props), {
|
|
4456
4499
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -4458,16 +4501,16 @@ var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref
|
|
|
4458
4501
|
});
|
|
4459
4502
|
|
|
4460
4503
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
4461
|
-
var
|
|
4504
|
+
var React20 = __toModule(require("react"));
|
|
4462
4505
|
|
|
4463
4506
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
4464
|
-
var
|
|
4507
|
+
var React9 = __toModule(require("react"));
|
|
4465
4508
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
4466
4509
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
4467
4510
|
if (!scrollbarWidth2) {
|
|
4468
4511
|
return null;
|
|
4469
4512
|
}
|
|
4470
|
-
return /* @__PURE__ */
|
|
4513
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
4471
4514
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
4472
4515
|
style: __spreadValues({
|
|
4473
4516
|
position: "absolute",
|
|
@@ -4477,13 +4520,13 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
4477
4520
|
}, props.style)
|
|
4478
4521
|
});
|
|
4479
4522
|
}
|
|
4480
|
-
var HorizontalScrollbarPlaceholder =
|
|
4523
|
+
var HorizontalScrollbarPlaceholder = React9.memo(HorizontalScrollbarPlaceholderFn);
|
|
4481
4524
|
function VerticalScrollbarPlaceholderFn(props) {
|
|
4482
4525
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
4483
4526
|
if (!scrollbarWidth2) {
|
|
4484
4527
|
return null;
|
|
4485
4528
|
}
|
|
4486
|
-
return /* @__PURE__ */
|
|
4529
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
4487
4530
|
"data-name": "vertical-scrollbar-placeholder",
|
|
4488
4531
|
style: __spreadValues({
|
|
4489
4532
|
position: "absolute",
|
|
@@ -4493,7 +4536,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
4493
4536
|
}, props.style)
|
|
4494
4537
|
});
|
|
4495
4538
|
}
|
|
4496
|
-
var VerticalScrollbarPlaceholder =
|
|
4539
|
+
var VerticalScrollbarPlaceholder = React9.memo(VerticalScrollbarPlaceholderFn);
|
|
4497
4540
|
|
|
4498
4541
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
4499
4542
|
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -4508,15 +4551,15 @@ var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
|
4508
4551
|
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
4509
4552
|
|
|
4510
4553
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4511
|
-
var
|
|
4554
|
+
var React16 = __toModule(require("react"));
|
|
4512
4555
|
var import_react26 = __toModule(require("react"));
|
|
4513
4556
|
|
|
4514
4557
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
4515
|
-
var
|
|
4558
|
+
var React12 = __toModule(require("react"));
|
|
4516
4559
|
var import_react22 = __toModule(require("react"));
|
|
4517
4560
|
|
|
4518
4561
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4519
|
-
var
|
|
4562
|
+
var React10 = __toModule(require("react"));
|
|
4520
4563
|
|
|
4521
4564
|
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
4522
4565
|
var import_react19 = __toModule(require("react"));
|
|
@@ -4575,16 +4618,16 @@ function InfiniteTableCellFn(props) {
|
|
|
4575
4618
|
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4576
4619
|
}
|
|
4577
4620
|
}
|
|
4578
|
-
return /* @__PURE__ */
|
|
4621
|
+
return /* @__PURE__ */ React10.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
4579
4622
|
ref: domRef,
|
|
4580
4623
|
style,
|
|
4581
4624
|
"data-name": `Cell`,
|
|
4582
4625
|
className: join(domProps.className, columnAlignCellStyle[(_b = column.align) != null ? _b : "start"], justifyContent[(_c = column.align) != null ? _c : "start"], InfiniteTableCellClassName, CellCls2, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : "")
|
|
4583
|
-
}), beforeChildren, cssEllipsis ? /* @__PURE__ */
|
|
4626
|
+
}), beforeChildren, cssEllipsis ? /* @__PURE__ */ React10.createElement("div", {
|
|
4584
4627
|
className: `${rootClassName2}Cell_content ${cssEllipsisClassName}`
|
|
4585
4628
|
}, children) : children, afterChildren);
|
|
4586
4629
|
}
|
|
4587
|
-
var InfiniteTableCell =
|
|
4630
|
+
var InfiniteTableCell = React10.memo(InfiniteTableCellFn);
|
|
4588
4631
|
|
|
4589
4632
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4590
4633
|
var import_binary_search = __toModule(require_binary_search());
|
|
@@ -4779,7 +4822,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4779
4822
|
var import_react_dom = __toModule(require("react-dom"));
|
|
4780
4823
|
|
|
4781
4824
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4782
|
-
var
|
|
4825
|
+
var React11 = __toModule(require("react"));
|
|
4783
4826
|
var import_react21 = __toModule(require("react"));
|
|
4784
4827
|
var defaultLineStyle = {
|
|
4785
4828
|
marginTop: 2,
|
|
@@ -4833,18 +4876,18 @@ function SortIcon(props) {
|
|
|
4833
4876
|
if (direction === -1) {
|
|
4834
4877
|
indexStyle.top = "100%";
|
|
4835
4878
|
}
|
|
4836
|
-
return /* @__PURE__ */
|
|
4879
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
4837
4880
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
4838
4881
|
className: join(className, "ITableIcon", "ITableIcon-sort")
|
|
4839
|
-
}, showIndex ? /* @__PURE__ */
|
|
4882
|
+
}, showIndex ? /* @__PURE__ */ React11.createElement("div", {
|
|
4840
4883
|
"data-name": "index",
|
|
4841
4884
|
style: indexStyle
|
|
4842
|
-
}, index) : null, /* @__PURE__ */
|
|
4885
|
+
}, index) : null, /* @__PURE__ */ React11.createElement("div", {
|
|
4843
4886
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
4844
4887
|
onTransitionEnd
|
|
4845
|
-
}), /* @__PURE__ */
|
|
4888
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
4846
4889
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
4847
|
-
}), /* @__PURE__ */
|
|
4890
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
4848
4891
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
4849
4892
|
}));
|
|
4850
4893
|
}
|
|
@@ -4875,7 +4918,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4875
4918
|
});
|
|
4876
4919
|
}
|
|
4877
4920
|
header = header != null ? header : column.name;
|
|
4878
|
-
const sortTool = /* @__PURE__ */
|
|
4921
|
+
const sortTool = /* @__PURE__ */ React12.createElement(SortIcon, {
|
|
4879
4922
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
4880
4923
|
className: `${baseCls}__sort-icon ${HeaderSortIconCls}`,
|
|
4881
4924
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
@@ -4913,7 +4956,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4913
4956
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
4914
4957
|
let draggingProxy = null;
|
|
4915
4958
|
if (dragging) {
|
|
4916
|
-
draggingProxy = /* @__PURE__ */
|
|
4959
|
+
draggingProxy = /* @__PURE__ */ React12.createElement("div", {
|
|
4917
4960
|
className: `${baseCls}Proxy ${HeaderCellProxy}`,
|
|
4918
4961
|
style: {
|
|
4919
4962
|
position: "absolute",
|
|
@@ -4926,7 +4969,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4926
4969
|
}, header);
|
|
4927
4970
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
4928
4971
|
}
|
|
4929
|
-
return /* @__PURE__ */
|
|
4972
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(InfiniteTableCell, {
|
|
4930
4973
|
domRef: ref,
|
|
4931
4974
|
column,
|
|
4932
4975
|
"data-name": `HeaderCell`,
|
|
@@ -4942,11 +4985,11 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4942
4985
|
}
|
|
4943
4986
|
|
|
4944
4987
|
// src/components/RawList/index.tsx
|
|
4945
|
-
var
|
|
4988
|
+
var React15 = __toModule(require("react"));
|
|
4946
4989
|
var import_react25 = __toModule(require("react"));
|
|
4947
4990
|
|
|
4948
4991
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
4949
|
-
var
|
|
4992
|
+
var React13 = __toModule(require("react"));
|
|
4950
4993
|
var import_react23 = __toModule(require("react"));
|
|
4951
4994
|
function AvoidReactDiffFn(props) {
|
|
4952
4995
|
const [children, setChildren] = (0, import_react23.useState)(props.updater.get());
|
|
@@ -4956,15 +4999,15 @@ function AvoidReactDiffFn(props) {
|
|
|
4956
4999
|
});
|
|
4957
5000
|
return remove;
|
|
4958
5001
|
}, [props.updater]);
|
|
4959
|
-
return /* @__PURE__ */
|
|
5002
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, children);
|
|
4960
5003
|
}
|
|
4961
|
-
var AvoidReactDiff =
|
|
5004
|
+
var AvoidReactDiff = React13.memo(AvoidReactDiffFn);
|
|
4962
5005
|
|
|
4963
5006
|
// src/components/RawList/useVirtualRenderer.ts
|
|
4964
5007
|
var import_react24 = __toModule(require("react"));
|
|
4965
5008
|
|
|
4966
5009
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4967
|
-
var
|
|
5010
|
+
var React14 = __toModule(require("react"));
|
|
4968
5011
|
|
|
4969
5012
|
// src/components/RawList/MappedItems.ts
|
|
4970
5013
|
var MappedItems = class extends Logger {
|
|
@@ -5209,7 +5252,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5209
5252
|
};
|
|
5210
5253
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5211
5254
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5212
|
-
const item = /* @__PURE__ */
|
|
5255
|
+
const item = /* @__PURE__ */ React14.createElement(AvoidReactDiff, {
|
|
5213
5256
|
key: elementIndex,
|
|
5214
5257
|
name: `${elementIndex}`,
|
|
5215
5258
|
updater: this.updaters[elementIndex]
|
|
@@ -5306,11 +5349,11 @@ function RawListFn(props) {
|
|
|
5306
5349
|
});
|
|
5307
5350
|
return remove;
|
|
5308
5351
|
}, [brain, onRenderUpdater]);
|
|
5309
|
-
return /* @__PURE__ */
|
|
5352
|
+
return /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
|
|
5310
5353
|
updater: onRenderUpdater
|
|
5311
5354
|
});
|
|
5312
5355
|
}
|
|
5313
|
-
var RawList =
|
|
5356
|
+
var RawList = React15.memo(RawListFn);
|
|
5314
5357
|
|
|
5315
5358
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
5316
5359
|
var debug3 = dbg("Header");
|
|
@@ -5331,7 +5374,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5331
5374
|
}
|
|
5332
5375
|
return null;
|
|
5333
5376
|
}
|
|
5334
|
-
return /* @__PURE__ */
|
|
5377
|
+
return /* @__PURE__ */ React16.createElement(InfiniteTableHeaderCell, {
|
|
5335
5378
|
domRef: domRef2,
|
|
5336
5379
|
column,
|
|
5337
5380
|
headerHeight,
|
|
@@ -5356,18 +5399,18 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5356
5399
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
5357
5400
|
style
|
|
5358
5401
|
};
|
|
5359
|
-
return /* @__PURE__ */
|
|
5402
|
+
return /* @__PURE__ */ React16.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React16.createElement(RawList, {
|
|
5360
5403
|
brain,
|
|
5361
5404
|
renderItem: renderColumn
|
|
5362
5405
|
}));
|
|
5363
5406
|
}
|
|
5364
|
-
var InfiniteTableHeader =
|
|
5407
|
+
var InfiniteTableHeader = React16.memo(InfiniteTableHeaderFn);
|
|
5365
5408
|
|
|
5366
5409
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
5367
|
-
var
|
|
5410
|
+
var React19 = __toModule(require("react"));
|
|
5368
5411
|
|
|
5369
5412
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
5370
|
-
var
|
|
5413
|
+
var React18 = __toModule(require("react"));
|
|
5371
5414
|
|
|
5372
5415
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
5373
5416
|
function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap) {
|
|
@@ -5457,7 +5500,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
5457
5500
|
}
|
|
5458
5501
|
|
|
5459
5502
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5460
|
-
var
|
|
5503
|
+
var React17 = __toModule(require("react"));
|
|
5461
5504
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
5462
5505
|
function InfiniteTableHeaderGroup(props) {
|
|
5463
5506
|
const { columnGroup, height, headerHeight } = props;
|
|
@@ -5471,16 +5514,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5471
5514
|
width: columnGroup.computedWidth,
|
|
5472
5515
|
height
|
|
5473
5516
|
};
|
|
5474
|
-
return /* @__PURE__ */
|
|
5517
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
5475
5518
|
"data-group-id": columnGroup.id,
|
|
5476
5519
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
5477
5520
|
style
|
|
5478
|
-
}, /* @__PURE__ */
|
|
5521
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
5479
5522
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
5480
5523
|
style: { height: headerHeight }
|
|
5481
|
-
}, /* @__PURE__ */
|
|
5524
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
5482
5525
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
5483
|
-
}, header)), /* @__PURE__ */
|
|
5526
|
+
}, header)), /* @__PURE__ */ React17.createElement("div", {
|
|
5484
5527
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
5485
5528
|
}, props.children));
|
|
5486
5529
|
}
|
|
@@ -5503,7 +5546,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5503
5546
|
return items2.map((colGroupItem) => {
|
|
5504
5547
|
if (colGroupItem.type === "column") {
|
|
5505
5548
|
const col = colGroupItem.ref;
|
|
5506
|
-
return /* @__PURE__ */
|
|
5549
|
+
return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderCell, {
|
|
5507
5550
|
key: col.id,
|
|
5508
5551
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
5509
5552
|
column: col,
|
|
@@ -5517,7 +5560,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5517
5560
|
colIds.push(col.id);
|
|
5518
5561
|
return col;
|
|
5519
5562
|
});
|
|
5520
|
-
return /* @__PURE__ */
|
|
5563
|
+
return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderGroup, {
|
|
5521
5564
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
5522
5565
|
columns: columns2,
|
|
5523
5566
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -5570,9 +5613,9 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5570
5613
|
},
|
|
5571
5614
|
computed: { computedVisibleColumnsMap: columnsMap }
|
|
5572
5615
|
} = useInfiniteTable();
|
|
5573
|
-
const domRef =
|
|
5616
|
+
const domRef = React19.useRef(null);
|
|
5574
5617
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
5575
|
-
const columnHeaderGroups =
|
|
5618
|
+
const columnHeaderGroups = React19.useMemo(() => {
|
|
5576
5619
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
5577
5620
|
columnGroups: computedColumnGroups,
|
|
5578
5621
|
columnGroupsDepthsMap,
|
|
@@ -5591,7 +5634,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5591
5634
|
columnGroupsMaxDepth
|
|
5592
5635
|
]);
|
|
5593
5636
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
5594
|
-
return /* @__PURE__ */
|
|
5637
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
|
|
5595
5638
|
key: c.id,
|
|
5596
5639
|
headerHeight,
|
|
5597
5640
|
column: c,
|
|
@@ -5614,20 +5657,20 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5614
5657
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
5615
5658
|
return removeOnScroll;
|
|
5616
5659
|
}, [brain, scrollListener]);
|
|
5617
|
-
return /* @__PURE__ */
|
|
5660
|
+
return /* @__PURE__ */ React19.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
5618
5661
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
5619
5662
|
pinned: pinning,
|
|
5620
5663
|
virtualized: false,
|
|
5621
5664
|
overflow: scrollable
|
|
5622
5665
|
})),
|
|
5623
5666
|
style
|
|
5624
|
-
}), /* @__PURE__ */
|
|
5667
|
+
}), /* @__PURE__ */ React19.createElement("div", {
|
|
5625
5668
|
style: { width: totalWidth },
|
|
5626
5669
|
className: join(flexFlow.row, display.flex),
|
|
5627
5670
|
ref: domRef
|
|
5628
5671
|
}, children));
|
|
5629
5672
|
}
|
|
5630
|
-
var InfiniteTableHeaderUnvirtualized =
|
|
5673
|
+
var InfiniteTableHeaderUnvirtualized = React19.memo(InfiniteTableHeaderUnvirtualizedFn);
|
|
5631
5674
|
|
|
5632
5675
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
5633
5676
|
function TableHeaderWrapper(props) {
|
|
@@ -5660,7 +5703,7 @@ function TableHeaderWrapper(props) {
|
|
|
5660
5703
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
5661
5704
|
left: computedPinnedStartWidth
|
|
5662
5705
|
} : void 0;
|
|
5663
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
5706
|
+
const header = virtualizeHeader ? /* @__PURE__ */ React20.createElement(InfiniteTableHeader, {
|
|
5664
5707
|
columns: computedUnpinnedColumns,
|
|
5665
5708
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
5666
5709
|
brain,
|
|
@@ -5673,7 +5716,7 @@ function TableHeaderWrapper(props) {
|
|
|
5673
5716
|
},
|
|
5674
5717
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5675
5718
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5676
|
-
}) : /* @__PURE__ */
|
|
5719
|
+
}) : /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
5677
5720
|
style: unvirtualizedStyle,
|
|
5678
5721
|
brain,
|
|
5679
5722
|
scrollable: true,
|
|
@@ -5682,12 +5725,12 @@ function TableHeaderWrapper(props) {
|
|
|
5682
5725
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5683
5726
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5684
5727
|
});
|
|
5685
|
-
return /* @__PURE__ */
|
|
5728
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
5686
5729
|
className: HeaderWrapperCls,
|
|
5687
5730
|
style: {
|
|
5688
5731
|
height: virtualizeHeader ? height : void 0
|
|
5689
5732
|
}
|
|
5690
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
5733
|
+
}, hasPinnedStart ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
5691
5734
|
style: {
|
|
5692
5735
|
left: 0,
|
|
5693
5736
|
position: "absolute",
|
|
@@ -5699,7 +5742,7 @@ function TableHeaderWrapper(props) {
|
|
|
5699
5742
|
scrollable: computedPinnedStartOverflow,
|
|
5700
5743
|
pinning: "start",
|
|
5701
5744
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
5702
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
5745
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
5703
5746
|
style: {
|
|
5704
5747
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
5705
5748
|
position: "absolute",
|
|
@@ -5711,7 +5754,7 @@ function TableHeaderWrapper(props) {
|
|
|
5711
5754
|
scrollable: computedPinnedEndOverflow,
|
|
5712
5755
|
pinning: "end",
|
|
5713
5756
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
5714
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
5757
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ React20.createElement(VerticalScrollbarPlaceholder, {
|
|
5715
5758
|
style: {
|
|
5716
5759
|
height: "100%",
|
|
5717
5760
|
right: 0
|
|
@@ -5720,7 +5763,7 @@ function TableHeaderWrapper(props) {
|
|
|
5720
5763
|
}
|
|
5721
5764
|
|
|
5722
5765
|
// src/components/VirtualScrollContainer/index.tsx
|
|
5723
|
-
var
|
|
5766
|
+
var React21 = __toModule(require("react"));
|
|
5724
5767
|
var import_react29 = __toModule(require("react"));
|
|
5725
5768
|
|
|
5726
5769
|
// src/components/hooks/useOnScroll.ts
|
|
@@ -5764,7 +5807,7 @@ var getScrollableClassName = (scrollable) => {
|
|
|
5764
5807
|
|
|
5765
5808
|
// src/components/VirtualScrollContainer/index.tsx
|
|
5766
5809
|
var rootClassName6 = "InfiniteVirtualScrollContainer";
|
|
5767
|
-
var VirtualScrollContainer =
|
|
5810
|
+
var VirtualScrollContainer = React21.forwardRef(function VirtualScrollContainer2(props, ref) {
|
|
5768
5811
|
const {
|
|
5769
5812
|
children,
|
|
5770
5813
|
scrollable = true,
|
|
@@ -5774,7 +5817,7 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
|
|
|
5774
5817
|
} = props;
|
|
5775
5818
|
const domRef = ref != null ? ref : (0, import_react29.useRef)(null);
|
|
5776
5819
|
useOnScroll(domRef, onContainerScroll);
|
|
5777
|
-
return /* @__PURE__ */
|
|
5820
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
5778
5821
|
ref: domRef,
|
|
5779
5822
|
style,
|
|
5780
5823
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -5782,7 +5825,7 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
|
|
|
5782
5825
|
});
|
|
5783
5826
|
|
|
5784
5827
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
5785
|
-
var
|
|
5828
|
+
var React22 = __toModule(require("react"));
|
|
5786
5829
|
function SpacePlaceholderFn(props) {
|
|
5787
5830
|
const { height, width, count } = props;
|
|
5788
5831
|
const style = {
|
|
@@ -5792,7 +5835,7 @@ function SpacePlaceholderFn(props) {
|
|
|
5792
5835
|
opacity: 0,
|
|
5793
5836
|
pointerEvents: "none"
|
|
5794
5837
|
};
|
|
5795
|
-
return /* @__PURE__ */
|
|
5838
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
5796
5839
|
"data-count": count,
|
|
5797
5840
|
"data-placeholder-width": true ? width : void 0,
|
|
5798
5841
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -5800,20 +5843,20 @@ function SpacePlaceholderFn(props) {
|
|
|
5800
5843
|
style
|
|
5801
5844
|
});
|
|
5802
5845
|
}
|
|
5803
|
-
var SpacePlaceholder =
|
|
5846
|
+
var SpacePlaceholder = React22.memo(SpacePlaceholderFn);
|
|
5804
5847
|
|
|
5805
5848
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
5806
5849
|
var import_react41 = __toModule(require("react"));
|
|
5807
5850
|
|
|
5808
5851
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
5809
|
-
var
|
|
5852
|
+
var React28 = __toModule(require("react"));
|
|
5810
5853
|
var import_react33 = __toModule(require("react"));
|
|
5811
5854
|
|
|
5812
5855
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
5813
|
-
var
|
|
5856
|
+
var React24 = __toModule(require("react"));
|
|
5814
5857
|
|
|
5815
5858
|
// src/components/VirtualList/VirtualList.tsx
|
|
5816
|
-
var
|
|
5859
|
+
var React23 = __toModule(require("react"));
|
|
5817
5860
|
var import_react30 = __toModule(require("react"));
|
|
5818
5861
|
|
|
5819
5862
|
// src/components/VirtualList/VirtualList.css.ts
|
|
@@ -5895,19 +5938,19 @@ var VirtualList = (props) => {
|
|
|
5895
5938
|
if (true) {
|
|
5896
5939
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
5897
5940
|
}
|
|
5898
|
-
return /* @__PURE__ */
|
|
5941
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React23.createElement(VirtualScrollContainer, {
|
|
5899
5942
|
scrollable,
|
|
5900
5943
|
onContainerScroll
|
|
5901
|
-
}, /* @__PURE__ */
|
|
5944
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
5902
5945
|
ref: domRef,
|
|
5903
5946
|
className: scrollTransformTargetCls,
|
|
5904
5947
|
"data-name": "scroll-transform-target"
|
|
5905
|
-
}, /* @__PURE__ */
|
|
5948
|
+
}, /* @__PURE__ */ React23.createElement(RawList, {
|
|
5906
5949
|
brain: virtualBrain,
|
|
5907
5950
|
renderItem,
|
|
5908
5951
|
repaintId,
|
|
5909
5952
|
debugChannel: "VirtualList-" + mainAxis
|
|
5910
|
-
})), children, /* @__PURE__ */
|
|
5953
|
+
})), children, /* @__PURE__ */ React23.createElement(SpacePlaceholder, {
|
|
5911
5954
|
count,
|
|
5912
5955
|
width,
|
|
5913
5956
|
height
|
|
@@ -5917,14 +5960,14 @@ var VirtualList = (props) => {
|
|
|
5917
5960
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
5918
5961
|
var VirtualRowList = (props) => {
|
|
5919
5962
|
const _a = props, { rowWidth, rowHeight, renderRow } = _a, listProps = __objRest(_a, ["rowWidth", "rowHeight", "renderRow"]);
|
|
5920
|
-
const renderItem =
|
|
5963
|
+
const renderItem = React24.useCallback((renderProps) => {
|
|
5921
5964
|
return renderRow({
|
|
5922
5965
|
domRef: renderProps.domRef,
|
|
5923
5966
|
rowHeight: renderProps.itemSize,
|
|
5924
5967
|
rowIndex: renderProps.itemIndex
|
|
5925
5968
|
});
|
|
5926
5969
|
}, [renderRow]);
|
|
5927
|
-
return /* @__PURE__ */
|
|
5970
|
+
return /* @__PURE__ */ React24.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
5928
5971
|
renderItem,
|
|
5929
5972
|
mainAxis: "vertical",
|
|
5930
5973
|
itemMainAxisSize: rowHeight,
|
|
@@ -5933,11 +5976,11 @@ var VirtualRowList = (props) => {
|
|
|
5933
5976
|
};
|
|
5934
5977
|
|
|
5935
5978
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
5936
|
-
var
|
|
5979
|
+
var React26 = __toModule(require("react"));
|
|
5937
5980
|
var import_react32 = __toModule(require("react"));
|
|
5938
5981
|
|
|
5939
5982
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5940
|
-
var
|
|
5983
|
+
var React25 = __toModule(require("react"));
|
|
5941
5984
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
5942
5985
|
var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
|
|
5943
5986
|
function isColumnWithField(c) {
|
|
@@ -5962,9 +6005,6 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5962
6005
|
}
|
|
5963
6006
|
const { data, isGroupRow, groupBy } = rowInfo;
|
|
5964
6007
|
const groupRowInfo = null;
|
|
5965
|
-
if (rowInfo.indexInAll === 0 && column.groupByField && column.groupByField === "stack") {
|
|
5966
|
-
debugger;
|
|
5967
|
-
}
|
|
5968
6008
|
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
5969
6009
|
if (column.valueGetter) {
|
|
5970
6010
|
value = column.valueGetter(isGroupRow ? {
|
|
@@ -5997,7 +6037,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5997
6037
|
rowIndex,
|
|
5998
6038
|
toggleGroupRow,
|
|
5999
6039
|
toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
|
|
6000
|
-
groupBy: computedDataSource.groupBy
|
|
6040
|
+
groupBy: computedDataSource.groupBy,
|
|
6041
|
+
pivotBy: computedDataSource.pivotBy
|
|
6001
6042
|
});
|
|
6002
6043
|
if (column.render) {
|
|
6003
6044
|
renderValue = column.render(renderParam);
|
|
@@ -6033,7 +6074,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6033
6074
|
}
|
|
6034
6075
|
}
|
|
6035
6076
|
}
|
|
6036
|
-
return /* @__PURE__ */
|
|
6077
|
+
return /* @__PURE__ */ React25.createElement(InfiniteTableCell, __spreadProps(__spreadValues({
|
|
6037
6078
|
domRef,
|
|
6038
6079
|
offsetProperty
|
|
6039
6080
|
}, dataset), {
|
|
@@ -6044,7 +6085,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6044
6085
|
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName)
|
|
6045
6086
|
}), hidden ? null : renderValue);
|
|
6046
6087
|
}
|
|
6047
|
-
var InfiniteTableColumnCell =
|
|
6088
|
+
var InfiniteTableColumnCell = React25.memo(InfiniteTableColumnCellFn);
|
|
6048
6089
|
|
|
6049
6090
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
|
|
6050
6091
|
var import_react31 = __toModule(require("react"));
|
|
@@ -6175,12 +6216,12 @@ function InfiniteTableRowFn(props) {
|
|
|
6175
6216
|
height: rowHeight
|
|
6176
6217
|
}, domProps.style);
|
|
6177
6218
|
const renderCellRef = (0, import_react32.useRef)(null);
|
|
6178
|
-
const renderCell =
|
|
6219
|
+
const renderCell = React26.useCallback(({ domRef, itemIndex }) => {
|
|
6179
6220
|
const column = columns[itemIndex];
|
|
6180
6221
|
if (!column) {
|
|
6181
6222
|
}
|
|
6182
6223
|
const hidden = false;
|
|
6183
|
-
return /* @__PURE__ */
|
|
6224
|
+
return /* @__PURE__ */ React26.createElement(InfiniteTableColumnCell, {
|
|
6184
6225
|
getData,
|
|
6185
6226
|
rowInfo,
|
|
6186
6227
|
groupRenderStrategy,
|
|
@@ -6207,18 +6248,18 @@ function InfiniteTableRowFn(props) {
|
|
|
6207
6248
|
if (true) {
|
|
6208
6249
|
domProps["data-cmp-name"] = "ITableRow";
|
|
6209
6250
|
}
|
|
6210
|
-
return /* @__PURE__ */
|
|
6251
|
+
return /* @__PURE__ */ React26.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6211
6252
|
style
|
|
6212
|
-
}), /* @__PURE__ */
|
|
6253
|
+
}), /* @__PURE__ */ React26.createElement(RawList, {
|
|
6213
6254
|
brain,
|
|
6214
6255
|
renderItem: renderCell,
|
|
6215
6256
|
debugChannel: `${rowIndex}`
|
|
6216
6257
|
}));
|
|
6217
6258
|
}
|
|
6218
|
-
var InfiniteTableRow =
|
|
6259
|
+
var InfiniteTableRow = React26.memo(InfiniteTableRowFn);
|
|
6219
6260
|
|
|
6220
6261
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
6221
|
-
var
|
|
6262
|
+
var React27 = __toModule(require("react"));
|
|
6222
6263
|
function TableRowUnvirtualizedFn(props) {
|
|
6223
6264
|
const {
|
|
6224
6265
|
rowHeight,
|
|
@@ -6239,7 +6280,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6239
6280
|
}, domProps.style);
|
|
6240
6281
|
const children = columns.map((col) => {
|
|
6241
6282
|
const hidden = false;
|
|
6242
|
-
return /* @__PURE__ */
|
|
6283
|
+
return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
|
|
6243
6284
|
key: col.id,
|
|
6244
6285
|
virtualized: false,
|
|
6245
6286
|
rowHeight,
|
|
@@ -6252,11 +6293,11 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6252
6293
|
column: col
|
|
6253
6294
|
});
|
|
6254
6295
|
});
|
|
6255
|
-
return /* @__PURE__ */
|
|
6296
|
+
return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6256
6297
|
style
|
|
6257
6298
|
}), children);
|
|
6258
6299
|
}
|
|
6259
|
-
var TableRowUnvirtualized =
|
|
6300
|
+
var TableRowUnvirtualized = React27.memo(TableRowUnvirtualizedFn);
|
|
6260
6301
|
|
|
6261
6302
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
6262
6303
|
function useUnpinnedRendering(params) {
|
|
@@ -6299,7 +6340,7 @@ function useUnpinnedRendering(params) {
|
|
|
6299
6340
|
rowProps.repaintId = repaintId;
|
|
6300
6341
|
}
|
|
6301
6342
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
6302
|
-
return /* @__PURE__ */
|
|
6343
|
+
return /* @__PURE__ */ React28.createElement(TableRowComponent, __spreadValues({}, rowProps));
|
|
6303
6344
|
}, [
|
|
6304
6345
|
repaintId,
|
|
6305
6346
|
rowHeight,
|
|
@@ -6309,7 +6350,7 @@ function useUnpinnedRendering(params) {
|
|
|
6309
6350
|
horizontalVirtualBrain,
|
|
6310
6351
|
verticalVirtualBrain
|
|
6311
6352
|
]);
|
|
6312
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
6353
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React28.createElement("div", {
|
|
6313
6354
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
6314
6355
|
style: {
|
|
6315
6356
|
position: "absolute",
|
|
@@ -6320,10 +6361,10 @@ function useUnpinnedRendering(params) {
|
|
|
6320
6361
|
overflow: "auto",
|
|
6321
6362
|
visibility: columnShifts ? "visible" : "hidden"
|
|
6322
6363
|
}
|
|
6323
|
-
}, /* @__PURE__ */
|
|
6364
|
+
}, /* @__PURE__ */ React28.createElement("div", {
|
|
6324
6365
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
6325
6366
|
})) : null;
|
|
6326
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
6367
|
+
return rowHeight != 0 ? /* @__PURE__ */ React28.createElement(VirtualRowList, {
|
|
6327
6368
|
repaintId: `${repaintId}-unpinned-`,
|
|
6328
6369
|
brain: verticalVirtualBrain,
|
|
6329
6370
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -6466,11 +6507,11 @@ var useOnContainerScroll = ({
|
|
|
6466
6507
|
};
|
|
6467
6508
|
|
|
6468
6509
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
6469
|
-
var
|
|
6510
|
+
var React30 = __toModule(require("react"));
|
|
6470
6511
|
var import_react37 = __toModule(require("react"));
|
|
6471
6512
|
|
|
6472
6513
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
6473
|
-
var
|
|
6514
|
+
var React29 = __toModule(require("react"));
|
|
6474
6515
|
var import_react36 = __toModule(require("react"));
|
|
6475
6516
|
|
|
6476
6517
|
// src/components/hooks/useOnMount.ts
|
|
@@ -6546,7 +6587,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
6546
6587
|
if (true) {
|
|
6547
6588
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
6548
6589
|
}
|
|
6549
|
-
return /* @__PURE__ */
|
|
6590
|
+
return /* @__PURE__ */ React29.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React29.createElement(RawList, {
|
|
6550
6591
|
brain,
|
|
6551
6592
|
renderItem,
|
|
6552
6593
|
repaintId
|
|
@@ -6569,7 +6610,7 @@ function PinnedRowsContainer(props) {
|
|
|
6569
6610
|
brain,
|
|
6570
6611
|
renderRow
|
|
6571
6612
|
} = props;
|
|
6572
|
-
const style =
|
|
6613
|
+
const style = React30.useMemo(() => {
|
|
6573
6614
|
const result = pinning === "end" ? {
|
|
6574
6615
|
width: rowWidth,
|
|
6575
6616
|
height,
|
|
@@ -6595,7 +6636,7 @@ function PinnedRowsContainer(props) {
|
|
|
6595
6636
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
6596
6637
|
};
|
|
6597
6638
|
if (hasOverflow) {
|
|
6598
|
-
return /* @__PURE__ */
|
|
6639
|
+
return /* @__PURE__ */ React30.createElement(VirtualScrollContainer, {
|
|
6599
6640
|
scrollable: {
|
|
6600
6641
|
horizontal: true,
|
|
6601
6642
|
vertical: false
|
|
@@ -6611,18 +6652,18 @@ function PinnedRowsContainer(props) {
|
|
|
6611
6652
|
className: join(PinnedRowsContainerClsVariants({
|
|
6612
6653
|
pinned: pinning
|
|
6613
6654
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
6614
|
-
}, /* @__PURE__ */
|
|
6655
|
+
}, /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
6615
6656
|
onMount: (node) => {
|
|
6616
6657
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
6617
6658
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
6618
6659
|
});
|
|
6619
6660
|
}
|
|
6620
|
-
})), /* @__PURE__ */
|
|
6661
|
+
})), /* @__PURE__ */ React30.createElement(SpacePlaceholder, {
|
|
6621
6662
|
width: rowWidth,
|
|
6622
6663
|
height: 1
|
|
6623
6664
|
}));
|
|
6624
6665
|
}
|
|
6625
|
-
return /* @__PURE__ */
|
|
6666
|
+
return /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
6626
6667
|
}
|
|
6627
6668
|
function useRenderPinnedRow(params) {
|
|
6628
6669
|
const { getData, getState, columnsWidth, columns, verticalBrain } = params;
|
|
@@ -6642,7 +6683,7 @@ function useRenderPinnedRow(params) {
|
|
|
6642
6683
|
rowWidth: columnsWidth,
|
|
6643
6684
|
columns
|
|
6644
6685
|
}, rowParams);
|
|
6645
|
-
return /* @__PURE__ */
|
|
6686
|
+
return /* @__PURE__ */ React30.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
6646
6687
|
}, [columnsWidth, columns, verticalBrain]);
|
|
6647
6688
|
return renderPinnedRow;
|
|
6648
6689
|
}
|
|
@@ -6685,7 +6726,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6685
6726
|
columns,
|
|
6686
6727
|
columnsWidth
|
|
6687
6728
|
});
|
|
6688
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
6729
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React30.createElement(PinnedRowsContainer, {
|
|
6689
6730
|
pinning: side,
|
|
6690
6731
|
pinnedScrollListener,
|
|
6691
6732
|
hasOverflow,
|
|
@@ -6698,7 +6739,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6698
6739
|
brain: verticalVirtualBrain,
|
|
6699
6740
|
renderRow: renderRowPinned
|
|
6700
6741
|
}) : null;
|
|
6701
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
6742
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React30.createElement(HorizontalScrollbarPlaceholder, {
|
|
6702
6743
|
style: side === "end" ? {
|
|
6703
6744
|
width: columnsWidth,
|
|
6704
6745
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -7267,7 +7308,8 @@ function useListRendering(param) {
|
|
|
7267
7308
|
computedUnpinnedColumnsWidth,
|
|
7268
7309
|
computedPinnedStartOverflow,
|
|
7269
7310
|
computedPinnedEndOverflow,
|
|
7270
|
-
computedVisibleColumns
|
|
7311
|
+
computedVisibleColumns,
|
|
7312
|
+
toggleGroupRow
|
|
7271
7313
|
} = computed;
|
|
7272
7314
|
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
7273
7315
|
const { dataArray } = dataSourceState;
|
|
@@ -7351,12 +7393,6 @@ function useListRendering(param) {
|
|
|
7351
7393
|
horizontalVirtualBrain,
|
|
7352
7394
|
reservedContentHeight
|
|
7353
7395
|
});
|
|
7354
|
-
const { componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
7355
|
-
const toggleGroupRow = (0, import_react41.useCallback)((groupKeys) => {
|
|
7356
|
-
const newState = new GroupRowsState(getDataSourceState().groupRowsState);
|
|
7357
|
-
newState.toggleGroupRow(groupKeys);
|
|
7358
|
-
dataSourceActions.groupRowsState = newState;
|
|
7359
|
-
}, []);
|
|
7360
7396
|
const pinnedRenderingParams = {
|
|
7361
7397
|
bodySize,
|
|
7362
7398
|
scrollbars,
|
|
@@ -7410,7 +7446,7 @@ function useListRendering(param) {
|
|
|
7410
7446
|
}
|
|
7411
7447
|
|
|
7412
7448
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7413
|
-
var
|
|
7449
|
+
var React31 = __toModule(require("react"));
|
|
7414
7450
|
var import_react42 = __toModule(require("react"));
|
|
7415
7451
|
|
|
7416
7452
|
// src/components/utils/decamelize.ts
|
|
@@ -7446,10 +7482,10 @@ var enforceStyle = (node, style) => {
|
|
|
7446
7482
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
7447
7483
|
}
|
|
7448
7484
|
};
|
|
7449
|
-
var InfiniteTableLicenseFooter =
|
|
7485
|
+
var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7450
7486
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7451
|
-
const domRef =
|
|
7452
|
-
const domCallback =
|
|
7487
|
+
const domRef = React31.useRef(null);
|
|
7488
|
+
const domCallback = React31.useCallback((node) => {
|
|
7453
7489
|
domRef.current = node;
|
|
7454
7490
|
if (!ref) {
|
|
7455
7491
|
return;
|
|
@@ -7474,12 +7510,12 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
|
|
|
7474
7510
|
clearInterval(intervalId);
|
|
7475
7511
|
};
|
|
7476
7512
|
}, []);
|
|
7477
|
-
return /* @__PURE__ */
|
|
7513
|
+
return /* @__PURE__ */ React31.createElement("div", __spreadProps(__spreadValues({
|
|
7478
7514
|
ref: domCallback
|
|
7479
7515
|
}, props), {
|
|
7480
7516
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7481
7517
|
style: defaultStyle2
|
|
7482
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7518
|
+
}), "Powered by", " ", /* @__PURE__ */ React31.createElement("a", {
|
|
7483
7519
|
href: "https://infinite-table.com",
|
|
7484
7520
|
rel: "noopener noreferrer",
|
|
7485
7521
|
role: "link",
|
|
@@ -7641,7 +7677,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7641
7677
|
const valid = (0, import_react43.useMemo)(() => {
|
|
7642
7678
|
let valid2 = isValidLicense(licenseKey, {
|
|
7643
7679
|
publishedAt: 1624970570587,
|
|
7644
|
-
version: "0.2.
|
|
7680
|
+
version: "0.2.5"
|
|
7645
7681
|
});
|
|
7646
7682
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
7647
7683
|
return true;
|
|
@@ -7652,7 +7688,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7652
7688
|
};
|
|
7653
7689
|
|
|
7654
7690
|
// src/components/CSSVariableWatch.tsx
|
|
7655
|
-
var
|
|
7691
|
+
var React32 = __toModule(require("react"));
|
|
7656
7692
|
var import_react44 = __toModule(require("react"));
|
|
7657
7693
|
var error = err("CSSVariableWatch");
|
|
7658
7694
|
var debug5 = dbg("CSSVariableWatch");
|
|
@@ -7667,14 +7703,14 @@ var WRAPPER_STYLE = {
|
|
|
7667
7703
|
};
|
|
7668
7704
|
var useCSSVariableWatch = (params) => {
|
|
7669
7705
|
const lastValueRef = (0, import_react44.useRef)(0);
|
|
7670
|
-
const onResize =
|
|
7706
|
+
const onResize = React32.useCallback(({ height }) => {
|
|
7671
7707
|
if (height && height !== lastValueRef.current) {
|
|
7672
7708
|
lastValueRef.current = height;
|
|
7673
7709
|
params.onChange(height);
|
|
7674
7710
|
}
|
|
7675
7711
|
}, [params.onChange]);
|
|
7676
7712
|
useResizeObserver(params.ref, onResize, { earlyAttach: true });
|
|
7677
|
-
|
|
7713
|
+
React32.useLayoutEffect(() => {
|
|
7678
7714
|
const value = params.ref.current.getBoundingClientRect().height;
|
|
7679
7715
|
if (value) {
|
|
7680
7716
|
lastValueRef.current = value;
|
|
@@ -7690,11 +7726,11 @@ var CSSVariableWatch = (props) => {
|
|
|
7690
7726
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7691
7727
|
ref: domRef
|
|
7692
7728
|
}));
|
|
7693
|
-
return /* @__PURE__ */
|
|
7729
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
7694
7730
|
"data-name": "css-variable-watcher",
|
|
7695
7731
|
"data-var": props.varName,
|
|
7696
7732
|
style: WRAPPER_STYLE
|
|
7697
|
-
}, /* @__PURE__ */
|
|
7733
|
+
}, /* @__PURE__ */ React32.createElement("div", {
|
|
7698
7734
|
ref: domRef,
|
|
7699
7735
|
style: {
|
|
7700
7736
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -7787,7 +7823,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
7787
7823
|
}
|
|
7788
7824
|
|
|
7789
7825
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7790
|
-
var
|
|
7826
|
+
var React33 = __toModule(require("react"));
|
|
7791
7827
|
|
|
7792
7828
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
7793
7829
|
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
@@ -7799,15 +7835,15 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
7799
7835
|
var baseCls2 = `${rootClassName11}-LoadMask`;
|
|
7800
7836
|
function LoadMaskFn(props) {
|
|
7801
7837
|
const { visible, children = "Loading" } = props;
|
|
7802
|
-
return /* @__PURE__ */
|
|
7838
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
7803
7839
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls2}`
|
|
7804
|
-
}, /* @__PURE__ */
|
|
7840
|
+
}, /* @__PURE__ */ React33.createElement("div", {
|
|
7805
7841
|
className: `${LoadMaskOverlayCls} ${baseCls2}-Overlay`
|
|
7806
|
-
}), /* @__PURE__ */
|
|
7842
|
+
}), /* @__PURE__ */ React33.createElement("div", {
|
|
7807
7843
|
className: `${LoadMaskTextCls} ${baseCls2}-Text`
|
|
7808
7844
|
}, children));
|
|
7809
7845
|
}
|
|
7810
|
-
var LoadMask =
|
|
7846
|
+
var LoadMask = React33.memo(LoadMaskFn);
|
|
7811
7847
|
|
|
7812
7848
|
// src/components/InfiniteTable/index.tsx
|
|
7813
7849
|
var InfiniteTableClassName = internalProps.rootClassName;
|
|
@@ -7826,7 +7862,7 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
7826
7862
|
getParentState: () => useDataSource(),
|
|
7827
7863
|
debugName: "InfiniteTable"
|
|
7828
7864
|
});
|
|
7829
|
-
var InfiniteTableComponent =
|
|
7865
|
+
var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
|
|
7830
7866
|
var _a;
|
|
7831
7867
|
const {
|
|
7832
7868
|
componentState,
|
|
@@ -7873,7 +7909,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
7873
7909
|
bodySize,
|
|
7874
7910
|
computed
|
|
7875
7911
|
});
|
|
7876
|
-
|
|
7912
|
+
React34.useEffect(() => {
|
|
7877
7913
|
const dataSourceState = getDataSourceState();
|
|
7878
7914
|
const onChange = debounce((renderRange) => {
|
|
7879
7915
|
dataSourceState.notifyRenderRangeChange(renderRange);
|
|
@@ -7883,7 +7919,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
7883
7919
|
const licenseValid = useLicense(licenseKey);
|
|
7884
7920
|
const domProps = useDOMProps(componentState.domProps);
|
|
7885
7921
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
7886
|
-
|
|
7922
|
+
React34.useLayoutEffect(() => {
|
|
7887
7923
|
const dataSourceState = getDataSourceState();
|
|
7888
7924
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
7889
7925
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -7892,34 +7928,34 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
|
7892
7928
|
}
|
|
7893
7929
|
notifyScrollbarsChange(scrollbars);
|
|
7894
7930
|
}, [scrollbars]);
|
|
7895
|
-
|
|
7931
|
+
React34.useEffect(() => {
|
|
7896
7932
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
7897
7933
|
}, [scrollStopDelay]);
|
|
7898
|
-
return /* @__PURE__ */
|
|
7934
|
+
return /* @__PURE__ */ React34.createElement("div", __spreadValues({
|
|
7899
7935
|
ref: domRef
|
|
7900
|
-
}, domProps), header ? /* @__PURE__ */
|
|
7936
|
+
}, domProps), header ? /* @__PURE__ */ React34.createElement(TableHeaderWrapper, {
|
|
7901
7937
|
brain: horizontalVirtualBrain,
|
|
7902
7938
|
repaintId,
|
|
7903
7939
|
scrollbars
|
|
7904
|
-
}) : null, /* @__PURE__ */
|
|
7940
|
+
}) : null, /* @__PURE__ */ React34.createElement(InfiniteTableBody, null, /* @__PURE__ */ React34.createElement(VirtualScrollContainer, {
|
|
7905
7941
|
ref: scrollerDOMRef,
|
|
7906
7942
|
onContainerScroll: applyScrollVertical,
|
|
7907
7943
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
7908
|
-
}, /* @__PURE__ */
|
|
7944
|
+
}, /* @__PURE__ */ React34.createElement("div", {
|
|
7909
7945
|
className: display.flex
|
|
7910
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
7946
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React34.createElement(SpacePlaceholder, {
|
|
7911
7947
|
count: dataArray.length,
|
|
7912
7948
|
width: 0,
|
|
7913
7949
|
height: reservedContentHeight
|
|
7914
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
7950
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React34.createElement(LoadMaskCmp, {
|
|
7915
7951
|
visible: loading
|
|
7916
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
7952
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ React34.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React34.createElement("div", {
|
|
7917
7953
|
ref: portalDOMRef,
|
|
7918
7954
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
7919
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
7955
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
|
|
7920
7956
|
varName: rowHeightCSSVar,
|
|
7921
7957
|
onChange: onRowHeightCSSVarChange
|
|
7922
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
7958
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
|
|
7923
7959
|
varName: headerHeightCSSVar,
|
|
7924
7960
|
onChange: onHeaderHeightCSSVarChange
|
|
7925
7961
|
}) : null);
|
|
@@ -7955,25 +7991,25 @@ function InfiniteTableContextProvider() {
|
|
|
7955
7991
|
}
|
|
7956
7992
|
componentActions.bodySize = bodySize;
|
|
7957
7993
|
}, { earlyAttach: true });
|
|
7958
|
-
|
|
7994
|
+
React34.useEffect(() => {
|
|
7959
7995
|
return () => {
|
|
7960
7996
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
7961
7997
|
componentState.onHeaderHeightCSSVarChange.destroy();
|
|
7962
7998
|
};
|
|
7963
7999
|
}, []);
|
|
7964
|
-
|
|
8000
|
+
React34.useEffect(() => {
|
|
7965
8001
|
if (scrollerDOMRef.current) {
|
|
7966
8002
|
scrollerDOMRef.current.scrollTop = 0;
|
|
7967
8003
|
}
|
|
7968
8004
|
}, [scrollTopId, scrollerDOMRef]);
|
|
7969
8005
|
const TableContext2 = getInfiniteTableContext();
|
|
7970
|
-
return /* @__PURE__ */
|
|
8006
|
+
return /* @__PURE__ */ React34.createElement(TableContext2.Provider, {
|
|
7971
8007
|
value: contextValue
|
|
7972
|
-
}, /* @__PURE__ */
|
|
8008
|
+
}, /* @__PURE__ */ React34.createElement(InfiniteTableComponent, null));
|
|
7973
8009
|
}
|
|
7974
8010
|
function InfiniteTable(props) {
|
|
7975
|
-
const table = /* @__PURE__ */
|
|
7976
|
-
return /* @__PURE__ */
|
|
8011
|
+
const table = /* @__PURE__ */ React34.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React34.createElement(InfiniteTableContextProvider, null));
|
|
8012
|
+
return /* @__PURE__ */ React34.createElement(React34.StrictMode, null, table);
|
|
7977
8013
|
}
|
|
7978
8014
|
InfiniteTable.defaultProps = {
|
|
7979
8015
|
rowHeight: 40,
|