@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.esm.js
CHANGED
|
@@ -619,7 +619,7 @@ var require_binary_search = __commonJS({
|
|
|
619
619
|
// src/components/InfiniteTable/index.tsx
|
|
620
620
|
import {
|
|
621
621
|
StrictMode,
|
|
622
|
-
createElement as
|
|
622
|
+
createElement as createElement32,
|
|
623
623
|
memo as memo13,
|
|
624
624
|
useEffect as useEffect24,
|
|
625
625
|
useLayoutEffect as useLayoutEffect5
|
|
@@ -768,7 +768,6 @@ function initSetupState() {
|
|
|
768
768
|
draggingColumnId: null,
|
|
769
769
|
pinnedStartScrollListener: new ScrollListener(),
|
|
770
770
|
pinnedEndScrollListener: new ScrollListener(),
|
|
771
|
-
computedPivotColumns: void 0,
|
|
772
771
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
773
772
|
};
|
|
774
773
|
}
|
|
@@ -799,7 +798,6 @@ var forwardProps = (setupState) => {
|
|
|
799
798
|
pinnedStartMaxWidth: 1,
|
|
800
799
|
pinnedEndMaxWidth: 1,
|
|
801
800
|
pivotColumn: 1,
|
|
802
|
-
pivotRowLabelsColumn: 1,
|
|
803
801
|
pivotColumnGroups: 1,
|
|
804
802
|
onScrollbarsChange: 1,
|
|
805
803
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 100,
|
|
@@ -856,8 +854,9 @@ var mapPropsToState = (params) => {
|
|
|
856
854
|
groupBy,
|
|
857
855
|
groupColumn: props.groupColumn
|
|
858
856
|
});
|
|
859
|
-
const computedColumns = state.
|
|
857
|
+
const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
860
858
|
return {
|
|
859
|
+
controlledColumnVisibility: !!props.columnVisibility,
|
|
861
860
|
groupRenderStrategy,
|
|
862
861
|
groupBy,
|
|
863
862
|
computedColumns,
|
|
@@ -1391,6 +1390,7 @@ var getComputedVisibleColumns = ({
|
|
|
1391
1390
|
const result2 = __spreadProps(__spreadValues({
|
|
1392
1391
|
align: colType.align,
|
|
1393
1392
|
verticalAlign: colType.verticalAlign,
|
|
1393
|
+
defaultHiddenWhenGrouped: colType.defaultHiddenWhenGrouped,
|
|
1394
1394
|
valueGetter: colType.valueGetter,
|
|
1395
1395
|
renderValue: colType.renderValue,
|
|
1396
1396
|
render: colType.render
|
|
@@ -2050,7 +2050,7 @@ function useColumnGroups() {
|
|
|
2050
2050
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2051
2051
|
import { useEffect as useEffect9, useMemo as useMemo5 } from "react";
|
|
2052
2052
|
|
|
2053
|
-
// src/components/InfiniteTable/
|
|
2053
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2054
2054
|
import {
|
|
2055
2055
|
createElement as createElement4
|
|
2056
2056
|
} from "react";
|
|
@@ -2126,93 +2126,15 @@ var userSelect = { none: "_16lm1iwm" };
|
|
|
2126
2126
|
var willChange = { transform: "_16lm1iw19" };
|
|
2127
2127
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2128
2128
|
|
|
2129
|
-
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
2130
|
-
function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
|
|
2131
|
-
if (!pivotColumns) {
|
|
2132
|
-
return void 0;
|
|
2133
|
-
}
|
|
2134
|
-
const {
|
|
2135
|
-
pivotColumn,
|
|
2136
|
-
pivotRowLabelsColumn,
|
|
2137
|
-
pivotBy,
|
|
2138
|
-
groupBy,
|
|
2139
|
-
pivotTotalColumnPosition,
|
|
2140
|
-
toggleGroupRow
|
|
2141
|
-
} = params;
|
|
2142
|
-
const computedPivotColumns = new Map();
|
|
2143
|
-
pivotColumns.forEach((col, key) => {
|
|
2144
|
-
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
2145
|
-
return;
|
|
2146
|
-
}
|
|
2147
|
-
let column = __spreadValues({}, col);
|
|
2148
|
-
const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
|
|
2149
|
-
if (!isPivotRowLabelsColumn) {
|
|
2150
|
-
if (pivotColumn) {
|
|
2151
|
-
if (typeof pivotColumn === "function") {
|
|
2152
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2153
|
-
column,
|
|
2154
|
-
pivotBy,
|
|
2155
|
-
groupBy
|
|
2156
|
-
}));
|
|
2157
|
-
} else {
|
|
2158
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
} else {
|
|
2162
|
-
if (pivotRowLabelsColumn) {
|
|
2163
|
-
if (typeof pivotRowLabelsColumn === "function") {
|
|
2164
|
-
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
|
|
2165
|
-
column,
|
|
2166
|
-
pivotBy,
|
|
2167
|
-
groupBy
|
|
2168
|
-
}));
|
|
2169
|
-
} else {
|
|
2170
|
-
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
if (!column.render) {
|
|
2174
|
-
column.render = (renderOptions) => {
|
|
2175
|
-
var _a;
|
|
2176
|
-
let { value, rowInfo, column: column2, groupBy: groupBy2 } = renderOptions;
|
|
2177
|
-
if (column2.renderValue) {
|
|
2178
|
-
value = column2.renderValue(renderOptions);
|
|
2179
|
-
}
|
|
2180
|
-
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupBy2.length;
|
|
2181
|
-
return /* @__PURE__ */ createElement4("div", {
|
|
2182
|
-
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2183
|
-
}, showExpanderIcon ? /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2184
|
-
expanded: !rowInfo.collapsed,
|
|
2185
|
-
onChange: () => {
|
|
2186
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2187
|
-
}
|
|
2188
|
-
}) : null, /* @__PURE__ */ createElement4("div", {
|
|
2189
|
-
className: cssEllipsisClassName
|
|
2190
|
-
}, value != null ? value : null));
|
|
2191
|
-
};
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
if (!column.render && column.renderValue) {
|
|
2195
|
-
column.render = (renderOptions) => {
|
|
2196
|
-
return column.renderValue(renderOptions);
|
|
2197
|
-
};
|
|
2198
|
-
}
|
|
2199
|
-
computedPivotColumns.set(key, column);
|
|
2200
|
-
});
|
|
2201
|
-
return computedPivotColumns;
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
2129
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2205
|
-
import {
|
|
2206
|
-
createElement as createElement5
|
|
2207
|
-
} from "react";
|
|
2208
2130
|
function getGroupColumnRender({
|
|
2209
2131
|
groupIndexForColumn,
|
|
2210
2132
|
groupRenderStrategy,
|
|
2211
2133
|
toggleGroupRow
|
|
2212
2134
|
}) {
|
|
2213
2135
|
return (renderOptions) => {
|
|
2214
|
-
var _a;
|
|
2215
|
-
let { value, rowInfo, column } = renderOptions;
|
|
2136
|
+
var _a, _b, _c;
|
|
2137
|
+
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2216
2138
|
if (column.renderValue) {
|
|
2217
2139
|
value = column.renderValue(renderOptions);
|
|
2218
2140
|
}
|
|
@@ -2237,14 +2159,20 @@ function getGroupColumnRender({
|
|
|
2237
2159
|
return null;
|
|
2238
2160
|
}
|
|
2239
2161
|
}
|
|
2240
|
-
|
|
2162
|
+
let icon = null;
|
|
2163
|
+
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);
|
|
2164
|
+
if (showExpanderIcon) {
|
|
2165
|
+
const defaultIcon = /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2166
|
+
expanded: !collapsed,
|
|
2167
|
+
onChange: () => {
|
|
2168
|
+
toggleGroupRow(groupKeys);
|
|
2169
|
+
}
|
|
2170
|
+
});
|
|
2171
|
+
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2172
|
+
}
|
|
2173
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2241
2174
|
className: join(display.flex, alignItems.center)
|
|
2242
|
-
}, /* @__PURE__ */
|
|
2243
|
-
expanded: !collapsed,
|
|
2244
|
-
onChange: () => {
|
|
2245
|
-
toggleGroupRow(groupKeys);
|
|
2246
|
-
}
|
|
2247
|
-
}), /* @__PURE__ */ createElement5("div", {
|
|
2175
|
+
}, icon, /* @__PURE__ */ createElement4("div", {
|
|
2248
2176
|
className: cssEllipsisClassName
|
|
2249
2177
|
}, value != null ? value : null));
|
|
2250
2178
|
};
|
|
@@ -2280,21 +2208,29 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2280
2208
|
groupByField: options.groupBy.map((g) => g.field),
|
|
2281
2209
|
sortable: false,
|
|
2282
2210
|
render: (renderOptions) => {
|
|
2283
|
-
|
|
2211
|
+
var _a, _b;
|
|
2212
|
+
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2284
2213
|
if (!rowInfo.isGroupRow) {
|
|
2285
2214
|
return null;
|
|
2286
2215
|
}
|
|
2287
2216
|
if (column.renderValue) {
|
|
2288
2217
|
value = column.renderValue(renderOptions);
|
|
2289
2218
|
}
|
|
2290
|
-
|
|
2219
|
+
const collapsed = rowInfo.collapsed;
|
|
2220
|
+
let icon = null;
|
|
2221
|
+
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);
|
|
2222
|
+
if (showExpanderIcon) {
|
|
2223
|
+
const defaultIcon = /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2224
|
+
expanded: !collapsed,
|
|
2225
|
+
onChange: () => {
|
|
2226
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
2227
|
+
}
|
|
2228
|
+
});
|
|
2229
|
+
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2230
|
+
}
|
|
2231
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2291
2232
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2292
|
-
}, /* @__PURE__ */
|
|
2293
|
-
expanded: !rowInfo.collapsed,
|
|
2294
|
-
onChange: () => {
|
|
2295
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2296
|
-
}
|
|
2297
|
-
}), /* @__PURE__ */ createElement5("div", {
|
|
2233
|
+
}, icon, /* @__PURE__ */ createElement4("div", {
|
|
2298
2234
|
className: cssEllipsisClassName
|
|
2299
2235
|
}, value != null ? value : null));
|
|
2300
2236
|
}
|
|
@@ -2315,7 +2251,7 @@ import { useCallback as useCallback4 } from "react";
|
|
|
2315
2251
|
// src/components/DataSource/index.tsx
|
|
2316
2252
|
import {
|
|
2317
2253
|
Fragment,
|
|
2318
|
-
createElement as
|
|
2254
|
+
createElement as createElement5
|
|
2319
2255
|
} from "react";
|
|
2320
2256
|
|
|
2321
2257
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -2664,6 +2600,7 @@ var DeepMap = class {
|
|
|
2664
2600
|
|
|
2665
2601
|
// src/utils/groupAndPivot/index.ts
|
|
2666
2602
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
2603
|
+
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
2667
2604
|
function DEFAULT_TO_KEY(value) {
|
|
2668
2605
|
return value;
|
|
2669
2606
|
}
|
|
@@ -2727,13 +2664,23 @@ function lazyGroup(groupParams, rootData) {
|
|
|
2727
2664
|
rootData.visitDepthFirst((lazyGroupRowInfo, keys, _index, next) => {
|
|
2728
2665
|
const [_rootKey, ...currentGroupKeys] = keys;
|
|
2729
2666
|
const dataArray = lazyGroupRowInfo.items;
|
|
2667
|
+
if (currentGroupKeys.length == groupBy.length) {
|
|
2668
|
+
const deepMapGroupValue = deepMap.get(currentGroupKeys);
|
|
2669
|
+
if (deepMapGroupValue) {
|
|
2670
|
+
deepMapGroupValue.items = dataArray;
|
|
2671
|
+
}
|
|
2672
|
+
return next == null ? void 0 : next();
|
|
2673
|
+
}
|
|
2730
2674
|
for (let i = 0, len = dataArray.length; i < len; i++) {
|
|
2731
2675
|
if (!dataArray[i]) {
|
|
2732
2676
|
const deepMapGroupValue2 = {
|
|
2733
2677
|
items: [],
|
|
2734
2678
|
reducerResults: {}
|
|
2735
2679
|
};
|
|
2736
|
-
deepMap.set([
|
|
2680
|
+
deepMap.set([
|
|
2681
|
+
...currentGroupKeys,
|
|
2682
|
+
`${NOT_LOADED_YET_KEY_PREFIX}${i}`
|
|
2683
|
+
], deepMapGroupValue2);
|
|
2737
2684
|
continue;
|
|
2738
2685
|
}
|
|
2739
2686
|
const dataObject = dataArray[i].data;
|
|
@@ -2744,6 +2691,7 @@ function lazyGroup(groupParams, rootData) {
|
|
|
2744
2691
|
currentGroupKeys.push(key);
|
|
2745
2692
|
const deepMapGroupValue = {
|
|
2746
2693
|
items: [],
|
|
2694
|
+
commonData: dataObject,
|
|
2747
2695
|
reducerResults: dataArray[i].aggregations || {}
|
|
2748
2696
|
};
|
|
2749
2697
|
deepMap.set(currentGroupKeys, deepMapGroupValue);
|
|
@@ -2879,10 +2827,15 @@ function flatten(groupResult) {
|
|
|
2879
2827
|
function getEnhancedGroupData(options, deepMapValue) {
|
|
2880
2828
|
const { groupBy, groupKeys, collapsed, parents, reducers } = options;
|
|
2881
2829
|
const groupNesting = groupKeys.length;
|
|
2882
|
-
const {
|
|
2830
|
+
const {
|
|
2831
|
+
items: groupItems,
|
|
2832
|
+
reducerResults,
|
|
2833
|
+
pivotDeepMap,
|
|
2834
|
+
commonData
|
|
2835
|
+
} = deepMapValue;
|
|
2883
2836
|
let data = null;
|
|
2884
2837
|
if (Object.keys(reducerResults).length > 0) {
|
|
2885
|
-
data = {};
|
|
2838
|
+
data = commonData || {};
|
|
2886
2839
|
for (let key in reducers)
|
|
2887
2840
|
if (reducers.hasOwnProperty(key)) {
|
|
2888
2841
|
const reducer = reducers[key];
|
|
@@ -2892,12 +2845,16 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2892
2845
|
}
|
|
2893
2846
|
}
|
|
2894
2847
|
}
|
|
2848
|
+
let theValue = groupKeys[groupKeys.length - 1];
|
|
2849
|
+
if (typeof theValue === "string" && theValue.startsWith(NOT_LOADED_YET_KEY_PREFIX)) {
|
|
2850
|
+
theValue = null;
|
|
2851
|
+
}
|
|
2895
2852
|
const enhancedGroupData = {
|
|
2896
2853
|
data,
|
|
2897
2854
|
groupCount: groupItems.length,
|
|
2898
2855
|
groupData: groupItems,
|
|
2899
2856
|
groupKeys,
|
|
2900
|
-
id: groupKeys
|
|
2857
|
+
id: `${groupKeys}`,
|
|
2901
2858
|
collapsed,
|
|
2902
2859
|
parents,
|
|
2903
2860
|
collapsedChildrenCount: 0,
|
|
@@ -2905,7 +2862,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2905
2862
|
indexInParentGroups: options.indexInParentGroups,
|
|
2906
2863
|
indexInGroup: options.indexInGroup,
|
|
2907
2864
|
indexInAll: options.indexInAll,
|
|
2908
|
-
value:
|
|
2865
|
+
value: theValue,
|
|
2909
2866
|
rootGroupBy: groupBy,
|
|
2910
2867
|
groupBy: groupNesting === groupBy.length ? groupBy : groupBy.slice(0, groupNesting),
|
|
2911
2868
|
isGroupRow: true,
|
|
@@ -2974,7 +2931,7 @@ function enhancedFlatten(param) {
|
|
|
2974
2931
|
const startIndex = result.length;
|
|
2975
2932
|
result.push(...items.map((item, index) => {
|
|
2976
2933
|
return {
|
|
2977
|
-
id: toPrimaryKey(item)
|
|
2934
|
+
id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
|
|
2978
2935
|
data: item,
|
|
2979
2936
|
isGroupRow: false,
|
|
2980
2937
|
collapsed: false,
|
|
@@ -3070,7 +3027,7 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
3070
3027
|
dataSourceParams.livePaginationCursor = componentState.livePaginationCursor;
|
|
3071
3028
|
dataSourceParams.cursorId = componentState.cursorId;
|
|
3072
3029
|
}
|
|
3073
|
-
if (componentState.
|
|
3030
|
+
if (componentState.lazyLoad) {
|
|
3074
3031
|
if (componentState.lazyLoadBatchSize != null && componentState.lazyLoadBatchSize > 0) {
|
|
3075
3032
|
dataSourceParams.lazyLoadBatchSize = componentState.lazyLoadBatchSize;
|
|
3076
3033
|
dataSourceParams.lazyLoadStartIndex = 0;
|
|
@@ -3095,15 +3052,34 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
3095
3052
|
}
|
|
3096
3053
|
function loadData(data, componentState, actions, overrides) {
|
|
3097
3054
|
const dataParams = buildDataSourceDataParams(componentState, overrides);
|
|
3055
|
+
if (componentState.lazyLoad) {
|
|
3056
|
+
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3057
|
+
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
|
|
3058
|
+
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3059
|
+
if (existingGroupRowInfo && existingGroupRowInfo.cache) {
|
|
3060
|
+
const items = existingGroupRowInfo.items;
|
|
3061
|
+
const len = items.length;
|
|
3062
|
+
let allLoaded = true;
|
|
3063
|
+
for (let i = 0; i < len; i++) {
|
|
3064
|
+
if (items[i] == null) {
|
|
3065
|
+
allLoaded = false;
|
|
3066
|
+
break;
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
if (allLoaded) {
|
|
3070
|
+
return Promise.resolve(true);
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3098
3074
|
if (typeof data === "function") {
|
|
3099
3075
|
data = data(dataParams);
|
|
3100
3076
|
}
|
|
3101
3077
|
const dataIsPromise = typeof data === "object" && typeof data.then === "function";
|
|
3102
|
-
if (dataIsPromise && !componentState.
|
|
3078
|
+
if (dataIsPromise && !componentState.lazyLoad) {
|
|
3103
3079
|
actions.loading = true;
|
|
3104
3080
|
}
|
|
3105
3081
|
return Promise.resolve(data).then((dataParam) => {
|
|
3106
|
-
var _a, _b, _c;
|
|
3082
|
+
var _a, _b, _c, _d;
|
|
3107
3083
|
let dataArray = [];
|
|
3108
3084
|
let skipAssign = false;
|
|
3109
3085
|
if (Array.isArray(dataParam.data)) {
|
|
@@ -3115,10 +3091,11 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3115
3091
|
if (remoteData.mappings) {
|
|
3116
3092
|
actions.pivotMappings = remoteData.mappings;
|
|
3117
3093
|
}
|
|
3118
|
-
if (componentState.
|
|
3094
|
+
if (componentState.lazyLoad) {
|
|
3119
3095
|
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3120
|
-
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys];
|
|
3096
|
+
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
|
|
3121
3097
|
const newGroupRowInfo = {
|
|
3098
|
+
cache: !!remoteData.cache,
|
|
3122
3099
|
totalCount: (_a = remoteData.totalCount) != null ? _a : dataArray.length,
|
|
3123
3100
|
items: dataArray
|
|
3124
3101
|
};
|
|
@@ -3126,11 +3103,15 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3126
3103
|
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3127
3104
|
const currentGroupRowInfo = existingGroupRowInfo != null ? existingGroupRowInfo : {
|
|
3128
3105
|
items: [],
|
|
3129
|
-
totalCount: newGroupRowInfo.totalCount
|
|
3106
|
+
totalCount: newGroupRowInfo.totalCount,
|
|
3107
|
+
cache: (_b = newGroupRowInfo.cache) != null ? _b : true
|
|
3130
3108
|
};
|
|
3109
|
+
if (existingGroupRowInfo) {
|
|
3110
|
+
existingGroupRowInfo.cache = newGroupRowInfo.cache;
|
|
3111
|
+
}
|
|
3131
3112
|
currentGroupRowInfo.items.length = currentGroupRowInfo.totalCount;
|
|
3132
|
-
const start = (
|
|
3133
|
-
const end = Math.min((
|
|
3113
|
+
const start = (_c = dataParams.lazyLoadStartIndex) != null ? _c : 0;
|
|
3114
|
+
const end = Math.min((_d = remoteData.totalCount) != null ? _d : start + dataParams.lazyLoadBatchSize);
|
|
3134
3115
|
for (let i = start; i < end; i++) {
|
|
3135
3116
|
currentGroupRowInfo.items[i] = newGroupRowInfo.items[i - start];
|
|
3136
3117
|
}
|
|
@@ -3142,6 +3123,10 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3142
3123
|
}
|
|
3143
3124
|
skipAssign = true;
|
|
3144
3125
|
actions.originalLazyGroupDataChangeDetect = getChangeDetect();
|
|
3126
|
+
if (!dataParams.groupKeys || !dataParams.groupKeys.length) {
|
|
3127
|
+
const topLevelItems = lazyGroupData.get([LAZY_ROOT_KEY_FOR_GROUPS]);
|
|
3128
|
+
actions.originalDataArray = [...topLevelItems.items];
|
|
3129
|
+
}
|
|
3145
3130
|
}
|
|
3146
3131
|
} else {
|
|
3147
3132
|
dataArray = dataParam;
|
|
@@ -3149,7 +3134,7 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3149
3134
|
if (!skipAssign) {
|
|
3150
3135
|
actions.originalDataArray = dataArray;
|
|
3151
3136
|
}
|
|
3152
|
-
if (dataIsPromise && !componentState.
|
|
3137
|
+
if (dataIsPromise && !componentState.lazyLoad) {
|
|
3153
3138
|
actions.loading = false;
|
|
3154
3139
|
}
|
|
3155
3140
|
});
|
|
@@ -3300,34 +3285,34 @@ function lazyLoadRange(options, cache) {
|
|
|
3300
3285
|
continue;
|
|
3301
3286
|
}
|
|
3302
3287
|
const rowLoaded = rowInfo.data != null;
|
|
3303
|
-
const
|
|
3304
|
-
if (rowInfo.groupKeys) {
|
|
3305
|
-
|
|
3288
|
+
const theGroupKeys = rowInfo.groupKeys ? [...rowInfo.groupKeys] : [];
|
|
3289
|
+
if (rowInfo.groupKeys && rowInfo.isGroupRow) {
|
|
3290
|
+
theGroupKeys.pop();
|
|
3306
3291
|
}
|
|
3307
|
-
const cacheKeys =
|
|
3292
|
+
const cacheKeys = theGroupKeys.length ? theGroupKeys : rootGroupKeys;
|
|
3308
3293
|
const indexInGroup = rowInfo.indexInGroup;
|
|
3309
3294
|
if (!rowLoaded) {
|
|
3310
|
-
let
|
|
3295
|
+
let cachedFnCalls = perGroupFnCalls.get(cacheKeys);
|
|
3311
3296
|
const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
|
|
3312
3297
|
const offset = rowInfo.indexInGroup - batchStartIndexInGroup;
|
|
3313
3298
|
const absoluteIndexOfBatchStart = dataArray[rowInfo.indexInAll - offset].indexInAll;
|
|
3314
3299
|
const batchStartRowLoaded = isRowLoaded(absoluteIndexOfBatchStart);
|
|
3315
3300
|
const batchStartRowId = dataArray[absoluteIndexOfBatchStart].id;
|
|
3316
|
-
if (batchStartRowLoaded || (
|
|
3301
|
+
if (batchStartRowLoaded || (cachedFnCalls == null ? void 0 : cachedFnCalls[batchStartRowId])) {
|
|
3317
3302
|
continue;
|
|
3318
3303
|
}
|
|
3319
|
-
const shouldSetFnCalls = !
|
|
3320
|
-
|
|
3304
|
+
const shouldSetFnCalls = !cachedFnCalls;
|
|
3305
|
+
cachedFnCalls = cachedFnCalls || {};
|
|
3321
3306
|
const currentFnCall = {
|
|
3322
3307
|
lazyLoadStartIndex: batchStartIndexInGroup,
|
|
3323
3308
|
lazyLoadBatchSize,
|
|
3324
|
-
groupKeys:
|
|
3309
|
+
groupKeys: theGroupKeys
|
|
3325
3310
|
};
|
|
3326
|
-
if (!
|
|
3327
|
-
|
|
3311
|
+
if (!cachedFnCalls[batchStartRowId]) {
|
|
3312
|
+
cachedFnCalls[batchStartRowId] = currentFnCall;
|
|
3328
3313
|
}
|
|
3329
3314
|
if (shouldSetFnCalls) {
|
|
3330
|
-
perGroupFnCalls.set(cacheKeys,
|
|
3315
|
+
perGroupFnCalls.set(cacheKeys, cachedFnCalls);
|
|
3331
3316
|
}
|
|
3332
3317
|
}
|
|
3333
3318
|
}
|
|
@@ -3584,12 +3569,11 @@ function getCompareObjectForDataParams(dataParams) {
|
|
|
3584
3569
|
var forwardProps3 = (setupState) => {
|
|
3585
3570
|
return {
|
|
3586
3571
|
onDataParamsChange: (fn) => fn ? discardCallsWithEqualArg(fn, 100, getCompareObjectForDataParams) : void 0,
|
|
3587
|
-
|
|
3572
|
+
lazyLoad: (lazyLoad) => !!lazyLoad,
|
|
3588
3573
|
data: 1,
|
|
3589
3574
|
pivotBy: 1,
|
|
3590
3575
|
primaryKey: 1,
|
|
3591
3576
|
livePagination: 1,
|
|
3592
|
-
lazyLoadBatchSize: (lazyLoadBatchSize) => lazyLoadBatchSize != null ? lazyLoadBatchSize : -1,
|
|
3593
3577
|
aggregationReducers: 1,
|
|
3594
3578
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
|
|
3595
3579
|
loading: (loading) => loading != null ? loading : false,
|
|
@@ -3616,7 +3600,8 @@ function mapPropsToState2(params) {
|
|
|
3616
3600
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
3617
3601
|
const result = {
|
|
3618
3602
|
controlledSort,
|
|
3619
|
-
multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo)
|
|
3603
|
+
multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo),
|
|
3604
|
+
lazyLoadBatchSize: typeof props.lazyLoad === "object" ? props.lazyLoad.batchSize : void 0
|
|
3620
3605
|
};
|
|
3621
3606
|
if (props.livePagination) {
|
|
3622
3607
|
const dataArrayChanged = !oldState || oldState.originalDataArray !== state.originalDataArray;
|
|
@@ -3629,7 +3614,7 @@ var debugFullLazyLoad = dbg("DataSource:fullLazyLoad");
|
|
|
3629
3614
|
function onPropChange(params, props, actions) {
|
|
3630
3615
|
const { name, newValue } = params;
|
|
3631
3616
|
if (name === "data" && typeof newValue === "function" && !props.groupRowsState) {
|
|
3632
|
-
if (props.
|
|
3617
|
+
if (props.lazyLoad) {
|
|
3633
3618
|
debugFullLazyLoad(`"data" function prop has changed`);
|
|
3634
3619
|
}
|
|
3635
3620
|
if (props.collapseGroupRowsOnDataFunctionChange !== false) {
|
|
@@ -3738,23 +3723,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
3738
3723
|
const aggregationReducers = Object.keys(reducers).map((key) => {
|
|
3739
3724
|
return __spreadProps(__spreadValues({}, reducers[key]), { id: key });
|
|
3740
3725
|
});
|
|
3741
|
-
const columns = new Map([
|
|
3742
|
-
[
|
|
3743
|
-
"labels",
|
|
3744
|
-
{
|
|
3745
|
-
header: "Row labels",
|
|
3746
|
-
pivotBy,
|
|
3747
|
-
valueGetter: (params) => {
|
|
3748
|
-
var _a;
|
|
3749
|
-
const { rowInfo } = params;
|
|
3750
|
-
if (!rowInfo.data) {
|
|
3751
|
-
return "Loading ...";
|
|
3752
|
-
}
|
|
3753
|
-
return rowInfo.groupKeys ? rowInfo.groupKeys[((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) - 1] : null;
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
]
|
|
3757
|
-
]);
|
|
3726
|
+
const columns = new Map([]);
|
|
3758
3727
|
const columnGroups = new Map();
|
|
3759
3728
|
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
3760
3729
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
@@ -3912,17 +3881,29 @@ function concludeReducer(params) {
|
|
|
3912
3881
|
var _a;
|
|
3913
3882
|
const { state, previousState } = params;
|
|
3914
3883
|
const sortInfo = state.sortInfo;
|
|
3915
|
-
|
|
3916
|
-
|
|
3884
|
+
let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
|
|
3885
|
+
if (state.lazyLoad || state.livePagination) {
|
|
3886
|
+
shouldSort = false;
|
|
3887
|
+
}
|
|
3888
|
+
let originalDataArrayChanged = haveDepsChanged(previousState, state, [
|
|
3917
3889
|
"originalDataArray"
|
|
3918
3890
|
]);
|
|
3891
|
+
const dataSourceChange = previousState && state.data !== previousState.data;
|
|
3892
|
+
let lazyLoadGroupDataChange = state.lazyLoad && previousState && (previousState.groupBy !== state.groupBy || previousState.sortInfo !== state.sortInfo);
|
|
3893
|
+
if (dataSourceChange) {
|
|
3894
|
+
lazyLoadGroupDataChange = true;
|
|
3895
|
+
}
|
|
3896
|
+
if (lazyLoadGroupDataChange) {
|
|
3897
|
+
state.originalLazyGroupData = new DeepMap();
|
|
3898
|
+
originalDataArrayChanged = true;
|
|
3899
|
+
}
|
|
3919
3900
|
const sortInfoChanged = haveDepsChanged(previousState, state, ["sortInfo"]);
|
|
3920
3901
|
const sortDepsChanged = originalDataArrayChanged || sortInfoChanged;
|
|
3921
3902
|
const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray);
|
|
3922
3903
|
const groupBy = state.groupBy;
|
|
3923
3904
|
const pivotBy = state.pivotBy;
|
|
3924
3905
|
const shouldGroup = groupBy.length || pivotBy;
|
|
3925
|
-
const groupsDepsChanged = haveDepsChanged(previousState, state, [
|
|
3906
|
+
const groupsDepsChanged = originalDataArrayChanged || haveDepsChanged(previousState, state, [
|
|
3926
3907
|
"generateGroupRows",
|
|
3927
3908
|
"originalDataArray",
|
|
3928
3909
|
"originalLazyGroupData",
|
|
@@ -3947,11 +3928,15 @@ function concludeReducer(params) {
|
|
|
3947
3928
|
state.postSortDataArray = dataArray;
|
|
3948
3929
|
state.groupDeepMap = void 0;
|
|
3949
3930
|
const toPrimaryKey = (data) => {
|
|
3950
|
-
|
|
3931
|
+
const pk = data[state.primaryKey];
|
|
3932
|
+
if (Array.isArray(pk)) {
|
|
3933
|
+
debugger;
|
|
3934
|
+
}
|
|
3935
|
+
return pk;
|
|
3951
3936
|
};
|
|
3952
3937
|
if (shouldGroup) {
|
|
3953
3938
|
if (shouldGroupAgain) {
|
|
3954
|
-
const groupResult = state.
|
|
3939
|
+
const groupResult = state.lazyLoad ? lazyGroup({
|
|
3955
3940
|
groupBy,
|
|
3956
3941
|
pivot: pivotBy,
|
|
3957
3942
|
mappings: state.pivotMappings,
|
|
@@ -3989,7 +3974,7 @@ function concludeReducer(params) {
|
|
|
3989
3974
|
state.pivotColumns = void 0;
|
|
3990
3975
|
const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
|
|
3991
3976
|
if (arrayDifferentAfterSortStep) {
|
|
3992
|
-
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, toPrimaryKey(data), index));
|
|
3977
|
+
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
|
|
3993
3978
|
}
|
|
3994
3979
|
}
|
|
3995
3980
|
state.postGroupDataArray = rowInfoDataArray;
|
|
@@ -4017,7 +4002,7 @@ function DataSourceWithContext(props) {
|
|
|
4017
4002
|
if (typeof children === "function") {
|
|
4018
4003
|
children = children(computedValues);
|
|
4019
4004
|
}
|
|
4020
|
-
return /* @__PURE__ */
|
|
4005
|
+
return /* @__PURE__ */ createElement5(Fragment, null, children);
|
|
4021
4006
|
}
|
|
4022
4007
|
var DataSourceRoot = getComponentStateRoot({
|
|
4023
4008
|
initSetupState: initSetupState2,
|
|
@@ -4040,14 +4025,14 @@ function DataSourceCmp({ children }) {
|
|
|
4040
4025
|
globalThis.getDataSourceState = getState;
|
|
4041
4026
|
}
|
|
4042
4027
|
useLoadData();
|
|
4043
|
-
return /* @__PURE__ */
|
|
4028
|
+
return /* @__PURE__ */ createElement5(DataSourceContext.Provider, {
|
|
4044
4029
|
value: contextValue
|
|
4045
|
-
}, /* @__PURE__ */
|
|
4030
|
+
}, /* @__PURE__ */ createElement5(DataSourceWithContext, {
|
|
4046
4031
|
children
|
|
4047
4032
|
}));
|
|
4048
4033
|
}
|
|
4049
4034
|
function DataSource(props) {
|
|
4050
|
-
return /* @__PURE__ */
|
|
4035
|
+
return /* @__PURE__ */ createElement5(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement5(DataSourceCmp, {
|
|
4051
4036
|
children: props.children
|
|
4052
4037
|
}));
|
|
4053
4038
|
}
|
|
@@ -4060,7 +4045,7 @@ function useToggleGroupRow() {
|
|
|
4060
4045
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
4061
4046
|
newState.toggleGroupRow(groupKeys);
|
|
4062
4047
|
dataSourceActions.groupRowsState = newState;
|
|
4063
|
-
if (state.
|
|
4048
|
+
if (state.lazyLoad && newState.isGroupRowExpanded(groupKeys)) {
|
|
4064
4049
|
loadData(state.data, state, dataSourceActions, {
|
|
4065
4050
|
groupKeys
|
|
4066
4051
|
});
|
|
@@ -4098,9 +4083,9 @@ function useColumnsWhen() {
|
|
|
4098
4083
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
4099
4084
|
}, [pivotTotalColumnPosition]);
|
|
4100
4085
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4086
|
+
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4087
|
+
useHideColumns();
|
|
4088
|
+
return { toggleGroupRow };
|
|
4104
4089
|
}
|
|
4105
4090
|
function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
4106
4091
|
const toggleGroupRow = useToggleGroupRow();
|
|
@@ -4110,6 +4095,9 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4110
4095
|
} = useComponentState();
|
|
4111
4096
|
function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
|
|
4112
4097
|
const computedColumns = new Map();
|
|
4098
|
+
if (groupRenderStrategy2 !== "inline") {
|
|
4099
|
+
return;
|
|
4100
|
+
}
|
|
4113
4101
|
columns2.forEach((column, id) => {
|
|
4114
4102
|
let base = {};
|
|
4115
4103
|
const groupByForColumn = groupByMap2.get(column.field);
|
|
@@ -4169,51 +4157,32 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4169
4157
|
});
|
|
4170
4158
|
}, [columns, groupByMap, groupRenderStrategy, toggleGroupRow]);
|
|
4171
4159
|
}
|
|
4172
|
-
function
|
|
4160
|
+
function useColumnsWhenGrouping() {
|
|
4173
4161
|
const {
|
|
4174
4162
|
componentState: { groupBy, pivotBy }
|
|
4175
4163
|
} = useDataSourceContextValue();
|
|
4176
4164
|
const {
|
|
4177
4165
|
componentActions,
|
|
4178
4166
|
componentState: {
|
|
4167
|
+
columns,
|
|
4168
|
+
groupColumn,
|
|
4169
|
+
groupRenderStrategy,
|
|
4179
4170
|
pivotColumns,
|
|
4180
4171
|
pivotColumn,
|
|
4181
|
-
pivotRowLabelsColumn,
|
|
4182
4172
|
pivotTotalColumnPosition
|
|
4183
4173
|
}
|
|
4184
4174
|
} = useComponentState();
|
|
4185
4175
|
const toggleGroupRow = useToggleGroupRow();
|
|
4186
4176
|
useEffect9(() => {
|
|
4187
|
-
const computedPivotColumns = getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, {
|
|
4188
|
-
pivotColumn,
|
|
4189
|
-
pivotRowLabelsColumn,
|
|
4190
|
-
pivotTotalColumnPosition,
|
|
4191
|
-
pivotBy,
|
|
4192
|
-
groupBy,
|
|
4193
|
-
toggleGroupRow
|
|
4194
|
-
});
|
|
4195
|
-
componentActions.computedPivotColumns = computedPivotColumns;
|
|
4196
|
-
}, [pivotColumns, pivotColumn, pivotRowLabelsColumn]);
|
|
4197
|
-
}
|
|
4198
|
-
function useColumnsWhenGrouping() {
|
|
4199
|
-
const {
|
|
4200
|
-
componentState: { groupBy }
|
|
4201
|
-
} = useDataSourceContextValue();
|
|
4202
|
-
const {
|
|
4203
|
-
componentActions,
|
|
4204
|
-
componentState: { columns, groupColumn, groupRenderStrategy, pivotColumns }
|
|
4205
|
-
} = useComponentState();
|
|
4206
|
-
const toggleGroupRow = useToggleGroupRow();
|
|
4207
|
-
useEffect9(() => {
|
|
4208
|
-
if (pivotColumns) {
|
|
4209
|
-
return;
|
|
4210
|
-
}
|
|
4211
4177
|
const update = () => {
|
|
4212
4178
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
4213
4179
|
columns,
|
|
4214
4180
|
groupColumn,
|
|
4215
|
-
|
|
4181
|
+
pivotColumn,
|
|
4182
|
+
pivotTotalColumnPosition,
|
|
4183
|
+
groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
|
|
4216
4184
|
groupBy,
|
|
4185
|
+
pivotBy,
|
|
4217
4186
|
pivotColumns,
|
|
4218
4187
|
toggleGroupRow
|
|
4219
4188
|
});
|
|
@@ -4225,29 +4194,45 @@ function useColumnsWhenGrouping() {
|
|
|
4225
4194
|
delete: update,
|
|
4226
4195
|
clear: update
|
|
4227
4196
|
});
|
|
4228
|
-
}, [
|
|
4197
|
+
}, [
|
|
4198
|
+
columns,
|
|
4199
|
+
groupBy,
|
|
4200
|
+
pivotBy,
|
|
4201
|
+
groupColumn,
|
|
4202
|
+
groupRenderStrategy,
|
|
4203
|
+
pivotColumns,
|
|
4204
|
+
pivotTotalColumnPosition,
|
|
4205
|
+
pivotColumn
|
|
4206
|
+
]);
|
|
4207
|
+
return { toggleGroupRow };
|
|
4229
4208
|
}
|
|
4230
|
-
function
|
|
4209
|
+
function useHideColumns() {
|
|
4231
4210
|
const {
|
|
4232
|
-
componentState: {
|
|
4211
|
+
componentState: {
|
|
4212
|
+
dataArray,
|
|
4213
|
+
groupBy,
|
|
4214
|
+
groupRowsState,
|
|
4215
|
+
originalLazyGroupDataChangeDetect
|
|
4216
|
+
},
|
|
4233
4217
|
getState: getDataSourceState
|
|
4234
4218
|
} = useDataSourceContextValue();
|
|
4235
4219
|
const {
|
|
4236
4220
|
getComponentState,
|
|
4237
4221
|
componentActions,
|
|
4238
4222
|
componentState: {
|
|
4223
|
+
columnTypes,
|
|
4224
|
+
computedColumns,
|
|
4239
4225
|
columnsWhenGrouping: generatedColumns,
|
|
4240
4226
|
hideEmptyGroupColumns,
|
|
4241
4227
|
groupRenderStrategy
|
|
4242
4228
|
}
|
|
4243
4229
|
} = useComponentState();
|
|
4244
4230
|
useEffect9(() => {
|
|
4245
|
-
if (groupRenderStrategy !== "multi-column") {
|
|
4231
|
+
if (groupRenderStrategy !== "multi-column" || !hideEmptyGroupColumns) {
|
|
4246
4232
|
return;
|
|
4247
4233
|
}
|
|
4248
4234
|
const groupsLength = groupBy.length;
|
|
4249
4235
|
let expandedGroupsLevel = 0;
|
|
4250
|
-
const { dataArray } = getDataSourceState();
|
|
4251
4236
|
const len = dataArray.length;
|
|
4252
4237
|
for (let i = 0; i < len; i++) {
|
|
4253
4238
|
const data = dataArray[i];
|
|
@@ -4257,10 +4242,10 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
4257
4242
|
}
|
|
4258
4243
|
}
|
|
4259
4244
|
const currentState = getComponentState();
|
|
4260
|
-
const { computedColumns } = currentState;
|
|
4245
|
+
const { computedColumns: computedColumns2 } = currentState;
|
|
4261
4246
|
let updated = false;
|
|
4262
4247
|
const columnVisibility = __spreadValues({}, currentState.columnVisibility);
|
|
4263
|
-
const cols =
|
|
4248
|
+
const cols = computedColumns2;
|
|
4264
4249
|
groupBy.forEach(({ field, column: groupColumn }, index) => {
|
|
4265
4250
|
const colId = (groupColumn == null ? void 0 : groupColumn.id) || `group-by-${field}`;
|
|
4266
4251
|
let col = cols.get(colId);
|
|
@@ -4282,24 +4267,51 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
4282
4267
|
getDataSourceState,
|
|
4283
4268
|
groupRenderStrategy,
|
|
4284
4269
|
generatedColumns,
|
|
4270
|
+
originalLazyGroupDataChangeDetect,
|
|
4285
4271
|
groupBy,
|
|
4286
|
-
|
|
4272
|
+
hideEmptyGroupColumns ? dataArray : null,
|
|
4287
4273
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4288
4274
|
hideEmptyGroupColumns
|
|
4289
4275
|
]);
|
|
4276
|
+
useEffect9(() => {
|
|
4277
|
+
const isGrouped = groupBy.length > 0;
|
|
4278
|
+
const currentState = getComponentState();
|
|
4279
|
+
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
4280
|
+
if (controlledColumnVisibility) {
|
|
4281
|
+
return;
|
|
4282
|
+
}
|
|
4283
|
+
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
4284
|
+
let updated = false;
|
|
4285
|
+
computedColumns.forEach((col, id) => {
|
|
4286
|
+
if (col.defaultHiddenWhenGrouped) {
|
|
4287
|
+
const nowHidden = columnVisibility[id] === false;
|
|
4288
|
+
if (!nowHidden && isGrouped) {
|
|
4289
|
+
updated = true;
|
|
4290
|
+
newColumnVisibility[id] = false;
|
|
4291
|
+
}
|
|
4292
|
+
if (nowHidden && !isGrouped) {
|
|
4293
|
+
updated = true;
|
|
4294
|
+
delete newColumnVisibility[id];
|
|
4295
|
+
}
|
|
4296
|
+
}
|
|
4297
|
+
});
|
|
4298
|
+
if (updated) {
|
|
4299
|
+
componentActions.columnVisibility = newColumnVisibility;
|
|
4300
|
+
}
|
|
4301
|
+
}, [computedColumns, columnTypes, groupBy]);
|
|
4290
4302
|
}
|
|
4291
4303
|
function getColumnsWhenGrouping(params) {
|
|
4292
4304
|
const {
|
|
4293
4305
|
pivotColumns,
|
|
4294
4306
|
groupBy,
|
|
4307
|
+
pivotBy,
|
|
4295
4308
|
groupColumn,
|
|
4309
|
+
pivotTotalColumnPosition,
|
|
4310
|
+
pivotColumn,
|
|
4296
4311
|
groupRenderStrategy,
|
|
4297
4312
|
toggleGroupRow,
|
|
4298
4313
|
columns
|
|
4299
4314
|
} = params;
|
|
4300
|
-
if (pivotColumns) {
|
|
4301
|
-
return void 0;
|
|
4302
|
-
}
|
|
4303
4315
|
if (groupRenderStrategy === "inline") {
|
|
4304
4316
|
return void 0;
|
|
4305
4317
|
}
|
|
@@ -4309,6 +4321,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4309
4321
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
4310
4322
|
groupByForColumn,
|
|
4311
4323
|
groupBy,
|
|
4324
|
+
pivotBy,
|
|
4312
4325
|
groupIndexForColumn,
|
|
4313
4326
|
groupCount: arr.length,
|
|
4314
4327
|
groupRenderStrategy
|
|
@@ -4319,13 +4332,40 @@ function getColumnsWhenGrouping(params) {
|
|
|
4319
4332
|
const singleGroupColumn = getSingleGroupColumn({
|
|
4320
4333
|
groupCount: groupBy.length,
|
|
4321
4334
|
groupBy,
|
|
4335
|
+
pivotBy,
|
|
4322
4336
|
groupRenderStrategy
|
|
4323
4337
|
}, toggleGroupRow, groupColumn);
|
|
4324
4338
|
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
4325
4339
|
}
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4340
|
+
if (pivotColumns) {
|
|
4341
|
+
pivotColumns.forEach((col, key) => {
|
|
4342
|
+
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
4343
|
+
return;
|
|
4344
|
+
}
|
|
4345
|
+
let column = __spreadValues({}, col);
|
|
4346
|
+
if (pivotColumn) {
|
|
4347
|
+
if (typeof pivotColumn === "function") {
|
|
4348
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
4349
|
+
column,
|
|
4350
|
+
pivotBy,
|
|
4351
|
+
groupBy
|
|
4352
|
+
}));
|
|
4353
|
+
} else {
|
|
4354
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
4355
|
+
}
|
|
4356
|
+
}
|
|
4357
|
+
if (!column.render && column.renderValue) {
|
|
4358
|
+
column.render = (renderOptions) => {
|
|
4359
|
+
return column.renderValue(renderOptions);
|
|
4360
|
+
};
|
|
4361
|
+
}
|
|
4362
|
+
computedColumns.set(key, column);
|
|
4363
|
+
});
|
|
4364
|
+
} else {
|
|
4365
|
+
columns.forEach((col, colId) => {
|
|
4366
|
+
computedColumns.set(colId, col);
|
|
4367
|
+
});
|
|
4368
|
+
}
|
|
4329
4369
|
return computedColumns.size ? computedColumns : void 0;
|
|
4330
4370
|
}
|
|
4331
4371
|
|
|
@@ -4364,7 +4404,7 @@ function useComputed() {
|
|
|
4364
4404
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
4365
4405
|
const { multiSort } = dataSourceState;
|
|
4366
4406
|
useColumnGroups();
|
|
4367
|
-
useColumnsWhen();
|
|
4407
|
+
const { toggleGroupRow } = useColumnsWhen();
|
|
4368
4408
|
const setSortInfo = useCallback5((sortInfo) => {
|
|
4369
4409
|
var _a2;
|
|
4370
4410
|
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
@@ -4433,6 +4473,7 @@ function useComputed() {
|
|
|
4433
4473
|
const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
|
|
4434
4474
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
4435
4475
|
return {
|
|
4476
|
+
toggleGroupRow,
|
|
4436
4477
|
computedPinnedStartOverflow,
|
|
4437
4478
|
computedPinnedEndOverflow,
|
|
4438
4479
|
computedPinnedStartWidth,
|
|
@@ -4457,7 +4498,7 @@ function useComputed() {
|
|
|
4457
4498
|
|
|
4458
4499
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4459
4500
|
import {
|
|
4460
|
-
createElement as
|
|
4501
|
+
createElement as createElement6,
|
|
4461
4502
|
forwardRef
|
|
4462
4503
|
} from "react";
|
|
4463
4504
|
|
|
@@ -4469,7 +4510,7 @@ var useInternalProps = () => {
|
|
|
4469
4510
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4470
4511
|
var InfiniteTableBody = forwardRef(function InfiniteTableBody2(props, ref) {
|
|
4471
4512
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
4472
|
-
return /* @__PURE__ */
|
|
4513
|
+
return /* @__PURE__ */ createElement6("div", __spreadProps(__spreadValues({
|
|
4473
4514
|
ref
|
|
4474
4515
|
}, props), {
|
|
4475
4516
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -4478,12 +4519,12 @@ var InfiniteTableBody = forwardRef(function InfiniteTableBody2(props, ref) {
|
|
|
4478
4519
|
|
|
4479
4520
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
4480
4521
|
import {
|
|
4481
|
-
createElement as
|
|
4522
|
+
createElement as createElement18
|
|
4482
4523
|
} from "react";
|
|
4483
4524
|
|
|
4484
4525
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
4485
4526
|
import {
|
|
4486
|
-
createElement as
|
|
4527
|
+
createElement as createElement7,
|
|
4487
4528
|
memo as memo2
|
|
4488
4529
|
} from "react";
|
|
4489
4530
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
@@ -4491,7 +4532,7 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
4491
4532
|
if (!scrollbarWidth2) {
|
|
4492
4533
|
return null;
|
|
4493
4534
|
}
|
|
4494
|
-
return /* @__PURE__ */
|
|
4535
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
4495
4536
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
4496
4537
|
style: __spreadValues({
|
|
4497
4538
|
position: "absolute",
|
|
@@ -4507,7 +4548,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
4507
4548
|
if (!scrollbarWidth2) {
|
|
4508
4549
|
return null;
|
|
4509
4550
|
}
|
|
4510
|
-
return /* @__PURE__ */
|
|
4551
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
4511
4552
|
"data-name": "vertical-scrollbar-placeholder",
|
|
4512
4553
|
style: __spreadValues({
|
|
4513
4554
|
position: "absolute",
|
|
@@ -4533,7 +4574,7 @@ var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
|
4533
4574
|
|
|
4534
4575
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4535
4576
|
import {
|
|
4536
|
-
createElement as
|
|
4577
|
+
createElement as createElement14,
|
|
4537
4578
|
memo as memo6
|
|
4538
4579
|
} from "react";
|
|
4539
4580
|
import { useCallback as useCallback8, useEffect as useEffect14, useRef as useRef9 } from "react";
|
|
@@ -4541,13 +4582,13 @@ import { useCallback as useCallback8, useEffect as useEffect14, useRef as useRef
|
|
|
4541
4582
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
4542
4583
|
import {
|
|
4543
4584
|
Fragment as Fragment2,
|
|
4544
|
-
createElement as
|
|
4585
|
+
createElement as createElement10
|
|
4545
4586
|
} from "react";
|
|
4546
4587
|
import { useCallback as useCallback7, useEffect as useEffect12, useRef as useRef8 } from "react";
|
|
4547
4588
|
|
|
4548
4589
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4549
4590
|
import {
|
|
4550
|
-
createElement as
|
|
4591
|
+
createElement as createElement8,
|
|
4551
4592
|
memo as memo3
|
|
4552
4593
|
} from "react";
|
|
4553
4594
|
|
|
@@ -4608,12 +4649,12 @@ function InfiniteTableCellFn(props) {
|
|
|
4608
4649
|
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4609
4650
|
}
|
|
4610
4651
|
}
|
|
4611
|
-
return /* @__PURE__ */
|
|
4652
|
+
return /* @__PURE__ */ createElement8("div", __spreadProps(__spreadValues({}, domProps), {
|
|
4612
4653
|
ref: domRef,
|
|
4613
4654
|
style,
|
|
4614
4655
|
"data-name": `Cell`,
|
|
4615
4656
|
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}` : "")
|
|
4616
|
-
}), beforeChildren, cssEllipsis ? /* @__PURE__ */
|
|
4657
|
+
}), beforeChildren, cssEllipsis ? /* @__PURE__ */ createElement8("div", {
|
|
4617
4658
|
className: `${rootClassName2}Cell_content ${cssEllipsisClassName}`
|
|
4618
4659
|
}, children) : children, afterChildren);
|
|
4619
4660
|
}
|
|
@@ -4818,7 +4859,7 @@ import { createPortal } from "react-dom";
|
|
|
4818
4859
|
|
|
4819
4860
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4820
4861
|
import {
|
|
4821
|
-
createElement as
|
|
4862
|
+
createElement as createElement9
|
|
4822
4863
|
} from "react";
|
|
4823
4864
|
import { useEffect as useEffect11, useState as useState7 } from "react";
|
|
4824
4865
|
var defaultLineStyle = {
|
|
@@ -4873,18 +4914,18 @@ function SortIcon(props) {
|
|
|
4873
4914
|
if (direction === -1) {
|
|
4874
4915
|
indexStyle.top = "100%";
|
|
4875
4916
|
}
|
|
4876
|
-
return /* @__PURE__ */
|
|
4917
|
+
return /* @__PURE__ */ createElement9("div", {
|
|
4877
4918
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
4878
4919
|
className: join(className, "ITableIcon", "ITableIcon-sort")
|
|
4879
|
-
}, showIndex ? /* @__PURE__ */
|
|
4920
|
+
}, showIndex ? /* @__PURE__ */ createElement9("div", {
|
|
4880
4921
|
"data-name": "index",
|
|
4881
4922
|
style: indexStyle
|
|
4882
|
-
}, index) : null, /* @__PURE__ */
|
|
4923
|
+
}, index) : null, /* @__PURE__ */ createElement9("div", {
|
|
4883
4924
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
4884
4925
|
onTransitionEnd
|
|
4885
|
-
}), /* @__PURE__ */
|
|
4926
|
+
}), /* @__PURE__ */ createElement9("div", {
|
|
4886
4927
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
4887
|
-
}), /* @__PURE__ */
|
|
4928
|
+
}), /* @__PURE__ */ createElement9("div", {
|
|
4888
4929
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
4889
4930
|
}));
|
|
4890
4931
|
}
|
|
@@ -4915,7 +4956,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4915
4956
|
});
|
|
4916
4957
|
}
|
|
4917
4958
|
header = header != null ? header : column.name;
|
|
4918
|
-
const sortTool = /* @__PURE__ */
|
|
4959
|
+
const sortTool = /* @__PURE__ */ createElement10(SortIcon, {
|
|
4919
4960
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
4920
4961
|
className: `${baseCls}__sort-icon ${HeaderSortIconCls}`,
|
|
4921
4962
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
@@ -4953,7 +4994,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4953
4994
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
4954
4995
|
let draggingProxy = null;
|
|
4955
4996
|
if (dragging) {
|
|
4956
|
-
draggingProxy = /* @__PURE__ */
|
|
4997
|
+
draggingProxy = /* @__PURE__ */ createElement10("div", {
|
|
4957
4998
|
className: `${baseCls}Proxy ${HeaderCellProxy}`,
|
|
4958
4999
|
style: {
|
|
4959
5000
|
position: "absolute",
|
|
@@ -4966,7 +5007,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4966
5007
|
}, header);
|
|
4967
5008
|
draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
|
|
4968
5009
|
}
|
|
4969
|
-
return /* @__PURE__ */
|
|
5010
|
+
return /* @__PURE__ */ createElement10(Fragment2, null, /* @__PURE__ */ createElement10(InfiniteTableCell, {
|
|
4970
5011
|
domRef: ref,
|
|
4971
5012
|
column,
|
|
4972
5013
|
"data-name": `HeaderCell`,
|
|
@@ -4983,7 +5024,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4983
5024
|
|
|
4984
5025
|
// src/components/RawList/index.tsx
|
|
4985
5026
|
import {
|
|
4986
|
-
createElement as
|
|
5027
|
+
createElement as createElement13,
|
|
4987
5028
|
memo as memo5
|
|
4988
5029
|
} from "react";
|
|
4989
5030
|
import { useEffect as useEffect13 } from "react";
|
|
@@ -4991,7 +5032,7 @@ import { useEffect as useEffect13 } from "react";
|
|
|
4991
5032
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
4992
5033
|
import {
|
|
4993
5034
|
Fragment as Fragment3,
|
|
4994
|
-
createElement as
|
|
5035
|
+
createElement as createElement11,
|
|
4995
5036
|
memo as memo4
|
|
4996
5037
|
} from "react";
|
|
4997
5038
|
import { useLayoutEffect as useLayoutEffect3, useState as useState8 } from "react";
|
|
@@ -5003,7 +5044,7 @@ function AvoidReactDiffFn(props) {
|
|
|
5003
5044
|
});
|
|
5004
5045
|
return remove;
|
|
5005
5046
|
}, [props.updater]);
|
|
5006
|
-
return /* @__PURE__ */
|
|
5047
|
+
return /* @__PURE__ */ createElement11(Fragment3, null, children);
|
|
5007
5048
|
}
|
|
5008
5049
|
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
5009
5050
|
|
|
@@ -5012,7 +5053,7 @@ import { useMemo as useMemo7 } from "react";
|
|
|
5012
5053
|
|
|
5013
5054
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
5014
5055
|
import {
|
|
5015
|
-
createElement as
|
|
5056
|
+
createElement as createElement12
|
|
5016
5057
|
} from "react";
|
|
5017
5058
|
|
|
5018
5059
|
// src/components/RawList/MappedItems.ts
|
|
@@ -5258,7 +5299,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5258
5299
|
};
|
|
5259
5300
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5260
5301
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5261
|
-
const item = /* @__PURE__ */
|
|
5302
|
+
const item = /* @__PURE__ */ createElement12(AvoidReactDiff, {
|
|
5262
5303
|
key: elementIndex,
|
|
5263
5304
|
name: `${elementIndex}`,
|
|
5264
5305
|
updater: this.updaters[elementIndex]
|
|
@@ -5355,7 +5396,7 @@ function RawListFn(props) {
|
|
|
5355
5396
|
});
|
|
5356
5397
|
return remove;
|
|
5357
5398
|
}, [brain, onRenderUpdater]);
|
|
5358
|
-
return /* @__PURE__ */
|
|
5399
|
+
return /* @__PURE__ */ createElement13(AvoidReactDiff, {
|
|
5359
5400
|
updater: onRenderUpdater
|
|
5360
5401
|
});
|
|
5361
5402
|
}
|
|
@@ -5380,7 +5421,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5380
5421
|
}
|
|
5381
5422
|
return null;
|
|
5382
5423
|
}
|
|
5383
|
-
return /* @__PURE__ */
|
|
5424
|
+
return /* @__PURE__ */ createElement14(InfiniteTableHeaderCell, {
|
|
5384
5425
|
domRef: domRef2,
|
|
5385
5426
|
column,
|
|
5386
5427
|
headerHeight,
|
|
@@ -5405,7 +5446,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5405
5446
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
5406
5447
|
style
|
|
5407
5448
|
};
|
|
5408
|
-
return /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ createElement14("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement14(RawList, {
|
|
5409
5450
|
brain,
|
|
5410
5451
|
renderItem: renderColumn
|
|
5411
5452
|
}));
|
|
@@ -5414,7 +5455,7 @@ var InfiniteTableHeader = memo6(InfiniteTableHeaderFn);
|
|
|
5414
5455
|
|
|
5415
5456
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
5416
5457
|
import {
|
|
5417
|
-
createElement as
|
|
5458
|
+
createElement as createElement17,
|
|
5418
5459
|
memo as memo7,
|
|
5419
5460
|
useMemo as useMemo8,
|
|
5420
5461
|
useRef as useRef10
|
|
@@ -5422,7 +5463,7 @@ import {
|
|
|
5422
5463
|
|
|
5423
5464
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
5424
5465
|
import {
|
|
5425
|
-
createElement as
|
|
5466
|
+
createElement as createElement16
|
|
5426
5467
|
} from "react";
|
|
5427
5468
|
|
|
5428
5469
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
@@ -5514,7 +5555,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
5514
5555
|
|
|
5515
5556
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5516
5557
|
import {
|
|
5517
|
-
createElement as
|
|
5558
|
+
createElement as createElement15
|
|
5518
5559
|
} from "react";
|
|
5519
5560
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
5520
5561
|
function InfiniteTableHeaderGroup(props) {
|
|
@@ -5529,16 +5570,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5529
5570
|
width: columnGroup.computedWidth,
|
|
5530
5571
|
height
|
|
5531
5572
|
};
|
|
5532
|
-
return /* @__PURE__ */
|
|
5573
|
+
return /* @__PURE__ */ createElement15("div", {
|
|
5533
5574
|
"data-group-id": columnGroup.id,
|
|
5534
5575
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
5535
5576
|
style
|
|
5536
|
-
}, /* @__PURE__ */
|
|
5577
|
+
}, /* @__PURE__ */ createElement15("div", {
|
|
5537
5578
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
5538
5579
|
style: { height: headerHeight }
|
|
5539
|
-
}, /* @__PURE__ */
|
|
5580
|
+
}, /* @__PURE__ */ createElement15("div", {
|
|
5540
5581
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
5541
|
-
}, header)), /* @__PURE__ */
|
|
5582
|
+
}, header)), /* @__PURE__ */ createElement15("div", {
|
|
5542
5583
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
5543
5584
|
}, props.children));
|
|
5544
5585
|
}
|
|
@@ -5561,7 +5602,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5561
5602
|
return items2.map((colGroupItem) => {
|
|
5562
5603
|
if (colGroupItem.type === "column") {
|
|
5563
5604
|
const col = colGroupItem.ref;
|
|
5564
|
-
return /* @__PURE__ */
|
|
5605
|
+
return /* @__PURE__ */ createElement16(InfiniteTableHeaderCell, {
|
|
5565
5606
|
key: col.id,
|
|
5566
5607
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
5567
5608
|
column: col,
|
|
@@ -5575,7 +5616,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5575
5616
|
colIds.push(col.id);
|
|
5576
5617
|
return col;
|
|
5577
5618
|
});
|
|
5578
|
-
return /* @__PURE__ */
|
|
5619
|
+
return /* @__PURE__ */ createElement16(InfiniteTableHeaderGroup, {
|
|
5579
5620
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
5580
5621
|
columns: columns2,
|
|
5581
5622
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -5649,7 +5690,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5649
5690
|
columnGroupsMaxDepth
|
|
5650
5691
|
]);
|
|
5651
5692
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
5652
|
-
return /* @__PURE__ */
|
|
5693
|
+
return /* @__PURE__ */ createElement17(InfiniteTableHeaderCell, {
|
|
5653
5694
|
key: c.id,
|
|
5654
5695
|
headerHeight,
|
|
5655
5696
|
column: c,
|
|
@@ -5672,14 +5713,14 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5672
5713
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
5673
5714
|
return removeOnScroll;
|
|
5674
5715
|
}, [brain, scrollListener]);
|
|
5675
|
-
return /* @__PURE__ */
|
|
5716
|
+
return /* @__PURE__ */ createElement17("div", __spreadProps(__spreadValues({}, domProps), {
|
|
5676
5717
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
5677
5718
|
pinned: pinning,
|
|
5678
5719
|
virtualized: false,
|
|
5679
5720
|
overflow: scrollable
|
|
5680
5721
|
})),
|
|
5681
5722
|
style
|
|
5682
|
-
}), /* @__PURE__ */
|
|
5723
|
+
}), /* @__PURE__ */ createElement17("div", {
|
|
5683
5724
|
style: { width: totalWidth },
|
|
5684
5725
|
className: join(flexFlow.row, display.flex),
|
|
5685
5726
|
ref: domRef
|
|
@@ -5718,7 +5759,7 @@ function TableHeaderWrapper(props) {
|
|
|
5718
5759
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
5719
5760
|
left: computedPinnedStartWidth
|
|
5720
5761
|
} : void 0;
|
|
5721
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
5762
|
+
const header = virtualizeHeader ? /* @__PURE__ */ createElement18(InfiniteTableHeader, {
|
|
5722
5763
|
columns: computedUnpinnedColumns,
|
|
5723
5764
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
5724
5765
|
brain,
|
|
@@ -5731,7 +5772,7 @@ function TableHeaderWrapper(props) {
|
|
|
5731
5772
|
},
|
|
5732
5773
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5733
5774
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5734
|
-
}) : /* @__PURE__ */
|
|
5775
|
+
}) : /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
5735
5776
|
style: unvirtualizedStyle,
|
|
5736
5777
|
brain,
|
|
5737
5778
|
scrollable: true,
|
|
@@ -5740,12 +5781,12 @@ function TableHeaderWrapper(props) {
|
|
|
5740
5781
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5741
5782
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5742
5783
|
});
|
|
5743
|
-
return /* @__PURE__ */
|
|
5784
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
5744
5785
|
className: HeaderWrapperCls,
|
|
5745
5786
|
style: {
|
|
5746
5787
|
height: virtualizeHeader ? height : void 0
|
|
5747
5788
|
}
|
|
5748
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
5789
|
+
}, hasPinnedStart ? /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
5749
5790
|
style: {
|
|
5750
5791
|
left: 0,
|
|
5751
5792
|
position: "absolute",
|
|
@@ -5757,7 +5798,7 @@ function TableHeaderWrapper(props) {
|
|
|
5757
5798
|
scrollable: computedPinnedStartOverflow,
|
|
5758
5799
|
pinning: "start",
|
|
5759
5800
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
5760
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
5801
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
5761
5802
|
style: {
|
|
5762
5803
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
5763
5804
|
position: "absolute",
|
|
@@ -5769,7 +5810,7 @@ function TableHeaderWrapper(props) {
|
|
|
5769
5810
|
scrollable: computedPinnedEndOverflow,
|
|
5770
5811
|
pinning: "end",
|
|
5771
5812
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
5772
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
5813
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ createElement18(VerticalScrollbarPlaceholder, {
|
|
5773
5814
|
style: {
|
|
5774
5815
|
height: "100%",
|
|
5775
5816
|
right: 0
|
|
@@ -5779,7 +5820,7 @@ function TableHeaderWrapper(props) {
|
|
|
5779
5820
|
|
|
5780
5821
|
// src/components/VirtualScrollContainer/index.tsx
|
|
5781
5822
|
import {
|
|
5782
|
-
createElement as
|
|
5823
|
+
createElement as createElement19,
|
|
5783
5824
|
forwardRef as forwardRef2
|
|
5784
5825
|
} from "react";
|
|
5785
5826
|
import { useRef as useRef11 } from "react";
|
|
@@ -5835,7 +5876,7 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
|
|
|
5835
5876
|
} = props;
|
|
5836
5877
|
const domRef = ref != null ? ref : useRef11(null);
|
|
5837
5878
|
useOnScroll(domRef, onContainerScroll);
|
|
5838
|
-
return /* @__PURE__ */
|
|
5879
|
+
return /* @__PURE__ */ createElement19("div", {
|
|
5839
5880
|
ref: domRef,
|
|
5840
5881
|
style,
|
|
5841
5882
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -5844,7 +5885,7 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
|
|
|
5844
5885
|
|
|
5845
5886
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
5846
5887
|
import {
|
|
5847
|
-
createElement as
|
|
5888
|
+
createElement as createElement20,
|
|
5848
5889
|
memo as memo8
|
|
5849
5890
|
} from "react";
|
|
5850
5891
|
function SpacePlaceholderFn(props) {
|
|
@@ -5856,7 +5897,7 @@ function SpacePlaceholderFn(props) {
|
|
|
5856
5897
|
opacity: 0,
|
|
5857
5898
|
pointerEvents: "none"
|
|
5858
5899
|
};
|
|
5859
|
-
return /* @__PURE__ */
|
|
5900
|
+
return /* @__PURE__ */ createElement20("div", {
|
|
5860
5901
|
"data-count": count,
|
|
5861
5902
|
"data-placeholder-width": true ? width : void 0,
|
|
5862
5903
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -5867,24 +5908,24 @@ function SpacePlaceholderFn(props) {
|
|
|
5867
5908
|
var SpacePlaceholder = memo8(SpacePlaceholderFn);
|
|
5868
5909
|
|
|
5869
5910
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
5870
|
-
import {
|
|
5911
|
+
import { useEffect as useEffect22, useMemo as useMemo11, useRef as useRef17 } from "react";
|
|
5871
5912
|
|
|
5872
5913
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
5873
5914
|
import {
|
|
5874
|
-
createElement as
|
|
5915
|
+
createElement as createElement26
|
|
5875
5916
|
} from "react";
|
|
5876
5917
|
import { useCallback as useCallback12 } from "react";
|
|
5877
5918
|
|
|
5878
5919
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
5879
5920
|
import {
|
|
5880
|
-
createElement as
|
|
5921
|
+
createElement as createElement22,
|
|
5881
5922
|
useCallback as useCallback9
|
|
5882
5923
|
} from "react";
|
|
5883
5924
|
|
|
5884
5925
|
// src/components/VirtualList/VirtualList.tsx
|
|
5885
5926
|
import {
|
|
5886
5927
|
Fragment as Fragment4,
|
|
5887
|
-
createElement as
|
|
5928
|
+
createElement as createElement21
|
|
5888
5929
|
} from "react";
|
|
5889
5930
|
import { useRef as useRef12, useEffect as useEffect17, useState as useState9 } from "react";
|
|
5890
5931
|
|
|
@@ -5967,19 +6008,19 @@ var VirtualList = (props) => {
|
|
|
5967
6008
|
if (true) {
|
|
5968
6009
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
5969
6010
|
}
|
|
5970
|
-
return /* @__PURE__ */
|
|
6011
|
+
return /* @__PURE__ */ createElement21(Fragment4, null, /* @__PURE__ */ createElement21("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement21(VirtualScrollContainer, {
|
|
5971
6012
|
scrollable,
|
|
5972
6013
|
onContainerScroll
|
|
5973
|
-
}, /* @__PURE__ */
|
|
6014
|
+
}, /* @__PURE__ */ createElement21("div", {
|
|
5974
6015
|
ref: domRef,
|
|
5975
6016
|
className: scrollTransformTargetCls,
|
|
5976
6017
|
"data-name": "scroll-transform-target"
|
|
5977
|
-
}, /* @__PURE__ */
|
|
6018
|
+
}, /* @__PURE__ */ createElement21(RawList, {
|
|
5978
6019
|
brain: virtualBrain,
|
|
5979
6020
|
renderItem,
|
|
5980
6021
|
repaintId,
|
|
5981
6022
|
debugChannel: "VirtualList-" + mainAxis
|
|
5982
|
-
})), children, /* @__PURE__ */
|
|
6023
|
+
})), children, /* @__PURE__ */ createElement21(SpacePlaceholder, {
|
|
5983
6024
|
count,
|
|
5984
6025
|
width,
|
|
5985
6026
|
height
|
|
@@ -5996,7 +6037,7 @@ var VirtualRowList = (props) => {
|
|
|
5996
6037
|
rowIndex: renderProps.itemIndex
|
|
5997
6038
|
});
|
|
5998
6039
|
}, [renderRow]);
|
|
5999
|
-
return /* @__PURE__ */
|
|
6040
|
+
return /* @__PURE__ */ createElement22(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
6000
6041
|
renderItem,
|
|
6001
6042
|
mainAxis: "vertical",
|
|
6002
6043
|
itemMainAxisSize: rowHeight,
|
|
@@ -6006,7 +6047,7 @@ var VirtualRowList = (props) => {
|
|
|
6006
6047
|
|
|
6007
6048
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
6008
6049
|
import {
|
|
6009
|
-
createElement as
|
|
6050
|
+
createElement as createElement24,
|
|
6010
6051
|
memo as memo10,
|
|
6011
6052
|
useCallback as useCallback11
|
|
6012
6053
|
} from "react";
|
|
@@ -6014,7 +6055,7 @@ import { useRef as useRef14 } from "react";
|
|
|
6014
6055
|
|
|
6015
6056
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
6016
6057
|
import {
|
|
6017
|
-
createElement as
|
|
6058
|
+
createElement as createElement23,
|
|
6018
6059
|
memo as memo9
|
|
6019
6060
|
} from "react";
|
|
6020
6061
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
@@ -6041,9 +6082,6 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6041
6082
|
}
|
|
6042
6083
|
const { data, isGroupRow, groupBy } = rowInfo;
|
|
6043
6084
|
const groupRowInfo = null;
|
|
6044
|
-
if (rowInfo.indexInAll === 0 && column.groupByField && column.groupByField === "stack") {
|
|
6045
|
-
debugger;
|
|
6046
|
-
}
|
|
6047
6085
|
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
6048
6086
|
if (column.valueGetter) {
|
|
6049
6087
|
value = column.valueGetter(isGroupRow ? {
|
|
@@ -6076,7 +6114,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6076
6114
|
rowIndex,
|
|
6077
6115
|
toggleGroupRow,
|
|
6078
6116
|
toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
|
|
6079
|
-
groupBy: computedDataSource.groupBy
|
|
6117
|
+
groupBy: computedDataSource.groupBy,
|
|
6118
|
+
pivotBy: computedDataSource.pivotBy
|
|
6080
6119
|
});
|
|
6081
6120
|
if (column.render) {
|
|
6082
6121
|
renderValue = column.render(renderParam);
|
|
@@ -6112,7 +6151,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6112
6151
|
}
|
|
6113
6152
|
}
|
|
6114
6153
|
}
|
|
6115
|
-
return /* @__PURE__ */
|
|
6154
|
+
return /* @__PURE__ */ createElement23(InfiniteTableCell, __spreadProps(__spreadValues({
|
|
6116
6155
|
domRef,
|
|
6117
6156
|
offsetProperty
|
|
6118
6157
|
}, dataset), {
|
|
@@ -6262,7 +6301,7 @@ function InfiniteTableRowFn(props) {
|
|
|
6262
6301
|
if (!column) {
|
|
6263
6302
|
}
|
|
6264
6303
|
const hidden = false;
|
|
6265
|
-
return /* @__PURE__ */
|
|
6304
|
+
return /* @__PURE__ */ createElement24(InfiniteTableColumnCell, {
|
|
6266
6305
|
getData,
|
|
6267
6306
|
rowInfo,
|
|
6268
6307
|
groupRenderStrategy,
|
|
@@ -6289,9 +6328,9 @@ function InfiniteTableRowFn(props) {
|
|
|
6289
6328
|
if (true) {
|
|
6290
6329
|
domProps["data-cmp-name"] = "ITableRow";
|
|
6291
6330
|
}
|
|
6292
|
-
return /* @__PURE__ */
|
|
6331
|
+
return /* @__PURE__ */ createElement24("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6293
6332
|
style
|
|
6294
|
-
}), /* @__PURE__ */
|
|
6333
|
+
}), /* @__PURE__ */ createElement24(RawList, {
|
|
6295
6334
|
brain,
|
|
6296
6335
|
renderItem: renderCell,
|
|
6297
6336
|
debugChannel: `${rowIndex}`
|
|
@@ -6301,7 +6340,7 @@ var InfiniteTableRow = memo10(InfiniteTableRowFn);
|
|
|
6301
6340
|
|
|
6302
6341
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
6303
6342
|
import {
|
|
6304
|
-
createElement as
|
|
6343
|
+
createElement as createElement25,
|
|
6305
6344
|
memo as memo11
|
|
6306
6345
|
} from "react";
|
|
6307
6346
|
function TableRowUnvirtualizedFn(props) {
|
|
@@ -6324,7 +6363,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6324
6363
|
}, domProps.style);
|
|
6325
6364
|
const children = columns.map((col) => {
|
|
6326
6365
|
const hidden = false;
|
|
6327
|
-
return /* @__PURE__ */
|
|
6366
|
+
return /* @__PURE__ */ createElement25(InfiniteTableColumnCell, {
|
|
6328
6367
|
key: col.id,
|
|
6329
6368
|
virtualized: false,
|
|
6330
6369
|
rowHeight,
|
|
@@ -6337,7 +6376,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6337
6376
|
column: col
|
|
6338
6377
|
});
|
|
6339
6378
|
});
|
|
6340
|
-
return /* @__PURE__ */
|
|
6379
|
+
return /* @__PURE__ */ createElement25("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6341
6380
|
style
|
|
6342
6381
|
}), children);
|
|
6343
6382
|
}
|
|
@@ -6384,7 +6423,7 @@ function useUnpinnedRendering(params) {
|
|
|
6384
6423
|
rowProps.repaintId = repaintId;
|
|
6385
6424
|
}
|
|
6386
6425
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
6387
|
-
return /* @__PURE__ */
|
|
6426
|
+
return /* @__PURE__ */ createElement26(TableRowComponent, __spreadValues({}, rowProps));
|
|
6388
6427
|
}, [
|
|
6389
6428
|
repaintId,
|
|
6390
6429
|
rowHeight,
|
|
@@ -6394,7 +6433,7 @@ function useUnpinnedRendering(params) {
|
|
|
6394
6433
|
horizontalVirtualBrain,
|
|
6395
6434
|
verticalVirtualBrain
|
|
6396
6435
|
]);
|
|
6397
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
6436
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ createElement26("div", {
|
|
6398
6437
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
6399
6438
|
style: {
|
|
6400
6439
|
position: "absolute",
|
|
@@ -6405,10 +6444,10 @@ function useUnpinnedRendering(params) {
|
|
|
6405
6444
|
overflow: "auto",
|
|
6406
6445
|
visibility: columnShifts ? "visible" : "hidden"
|
|
6407
6446
|
}
|
|
6408
|
-
}, /* @__PURE__ */
|
|
6447
|
+
}, /* @__PURE__ */ createElement26("div", {
|
|
6409
6448
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
6410
6449
|
})) : null;
|
|
6411
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
6450
|
+
return rowHeight != 0 ? /* @__PURE__ */ createElement26(VirtualRowList, {
|
|
6412
6451
|
repaintId: `${repaintId}-unpinned-`,
|
|
6413
6452
|
brain: verticalVirtualBrain,
|
|
6414
6453
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -6552,14 +6591,14 @@ var useOnContainerScroll = ({
|
|
|
6552
6591
|
|
|
6553
6592
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
6554
6593
|
import {
|
|
6555
|
-
createElement as
|
|
6594
|
+
createElement as createElement28,
|
|
6556
6595
|
useMemo as useMemo9
|
|
6557
6596
|
} from "react";
|
|
6558
6597
|
import { useCallback as useCallback15 } from "react";
|
|
6559
6598
|
|
|
6560
6599
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
6561
6600
|
import {
|
|
6562
|
-
createElement as
|
|
6601
|
+
createElement as createElement27
|
|
6563
6602
|
} from "react";
|
|
6564
6603
|
import { useEffect as useEffect20, useCallback as useCallback14, useRef as useRef16 } from "react";
|
|
6565
6604
|
|
|
@@ -6636,7 +6675,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
6636
6675
|
if (true) {
|
|
6637
6676
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
6638
6677
|
}
|
|
6639
|
-
return /* @__PURE__ */
|
|
6678
|
+
return /* @__PURE__ */ createElement27("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement27(RawList, {
|
|
6640
6679
|
brain,
|
|
6641
6680
|
renderItem,
|
|
6642
6681
|
repaintId
|
|
@@ -6685,7 +6724,7 @@ function PinnedRowsContainer(props) {
|
|
|
6685
6724
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
6686
6725
|
};
|
|
6687
6726
|
if (hasOverflow) {
|
|
6688
|
-
return /* @__PURE__ */
|
|
6727
|
+
return /* @__PURE__ */ createElement28(VirtualScrollContainer, {
|
|
6689
6728
|
scrollable: {
|
|
6690
6729
|
horizontal: true,
|
|
6691
6730
|
vertical: false
|
|
@@ -6701,18 +6740,18 @@ function PinnedRowsContainer(props) {
|
|
|
6701
6740
|
className: join(PinnedRowsContainerClsVariants({
|
|
6702
6741
|
pinned: pinning
|
|
6703
6742
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
6704
|
-
}, /* @__PURE__ */
|
|
6743
|
+
}, /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
6705
6744
|
onMount: (node) => {
|
|
6706
6745
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
6707
6746
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
6708
6747
|
});
|
|
6709
6748
|
}
|
|
6710
|
-
})), /* @__PURE__ */
|
|
6749
|
+
})), /* @__PURE__ */ createElement28(SpacePlaceholder, {
|
|
6711
6750
|
width: rowWidth,
|
|
6712
6751
|
height: 1
|
|
6713
6752
|
}));
|
|
6714
6753
|
}
|
|
6715
|
-
return /* @__PURE__ */
|
|
6754
|
+
return /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
6716
6755
|
}
|
|
6717
6756
|
function useRenderPinnedRow(params) {
|
|
6718
6757
|
const { getData, getState, columnsWidth, columns, verticalBrain } = params;
|
|
@@ -6732,7 +6771,7 @@ function useRenderPinnedRow(params) {
|
|
|
6732
6771
|
rowWidth: columnsWidth,
|
|
6733
6772
|
columns
|
|
6734
6773
|
}, rowParams);
|
|
6735
|
-
return /* @__PURE__ */
|
|
6774
|
+
return /* @__PURE__ */ createElement28(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
6736
6775
|
}, [columnsWidth, columns, verticalBrain]);
|
|
6737
6776
|
return renderPinnedRow;
|
|
6738
6777
|
}
|
|
@@ -6775,7 +6814,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6775
6814
|
columns,
|
|
6776
6815
|
columnsWidth
|
|
6777
6816
|
});
|
|
6778
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
6817
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ createElement28(PinnedRowsContainer, {
|
|
6779
6818
|
pinning: side,
|
|
6780
6819
|
pinnedScrollListener,
|
|
6781
6820
|
hasOverflow,
|
|
@@ -6788,7 +6827,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6788
6827
|
brain: verticalVirtualBrain,
|
|
6789
6828
|
renderRow: renderRowPinned
|
|
6790
6829
|
}) : null;
|
|
6791
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
6830
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ createElement28(HorizontalScrollbarPlaceholder, {
|
|
6792
6831
|
style: side === "end" ? {
|
|
6793
6832
|
width: columnsWidth,
|
|
6794
6833
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -7357,7 +7396,8 @@ function useListRendering(param) {
|
|
|
7357
7396
|
computedUnpinnedColumnsWidth,
|
|
7358
7397
|
computedPinnedStartOverflow,
|
|
7359
7398
|
computedPinnedEndOverflow,
|
|
7360
|
-
computedVisibleColumns
|
|
7399
|
+
computedVisibleColumns,
|
|
7400
|
+
toggleGroupRow
|
|
7361
7401
|
} = computed;
|
|
7362
7402
|
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
7363
7403
|
const { dataArray } = dataSourceState;
|
|
@@ -7441,12 +7481,6 @@ function useListRendering(param) {
|
|
|
7441
7481
|
horizontalVirtualBrain,
|
|
7442
7482
|
reservedContentHeight
|
|
7443
7483
|
});
|
|
7444
|
-
const { componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
7445
|
-
const toggleGroupRow = useCallback17((groupKeys) => {
|
|
7446
|
-
const newState = new GroupRowsState(getDataSourceState().groupRowsState);
|
|
7447
|
-
newState.toggleGroupRow(groupKeys);
|
|
7448
|
-
dataSourceActions.groupRowsState = newState;
|
|
7449
|
-
}, []);
|
|
7450
7484
|
const pinnedRenderingParams = {
|
|
7451
7485
|
bodySize,
|
|
7452
7486
|
scrollbars,
|
|
@@ -7501,9 +7535,9 @@ function useListRendering(param) {
|
|
|
7501
7535
|
|
|
7502
7536
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7503
7537
|
import {
|
|
7504
|
-
createElement as
|
|
7538
|
+
createElement as createElement29,
|
|
7505
7539
|
forwardRef as forwardRef3,
|
|
7506
|
-
useCallback as
|
|
7540
|
+
useCallback as useCallback17,
|
|
7507
7541
|
useRef as useRef18
|
|
7508
7542
|
} from "react";
|
|
7509
7543
|
import { useEffect as useEffect23 } from "react";
|
|
@@ -7544,7 +7578,7 @@ var enforceStyle = (node, style) => {
|
|
|
7544
7578
|
var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7545
7579
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7546
7580
|
const domRef = useRef18(null);
|
|
7547
|
-
const domCallback =
|
|
7581
|
+
const domCallback = useCallback17((node) => {
|
|
7548
7582
|
domRef.current = node;
|
|
7549
7583
|
if (!ref) {
|
|
7550
7584
|
return;
|
|
@@ -7569,12 +7603,12 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
7569
7603
|
clearInterval(intervalId);
|
|
7570
7604
|
};
|
|
7571
7605
|
}, []);
|
|
7572
|
-
return /* @__PURE__ */
|
|
7606
|
+
return /* @__PURE__ */ createElement29("div", __spreadProps(__spreadValues({
|
|
7573
7607
|
ref: domCallback
|
|
7574
7608
|
}, props), {
|
|
7575
7609
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7576
7610
|
style: defaultStyle2
|
|
7577
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7611
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement29("a", {
|
|
7578
7612
|
href: "https://infinite-table.com",
|
|
7579
7613
|
rel: "noopener noreferrer",
|
|
7580
7614
|
role: "link",
|
|
@@ -7736,7 +7770,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7736
7770
|
const valid = useMemo12(() => {
|
|
7737
7771
|
let valid2 = isValidLicense(licenseKey, {
|
|
7738
7772
|
publishedAt: 1624970570587,
|
|
7739
|
-
version: "0.2.
|
|
7773
|
+
version: "0.2.5"
|
|
7740
7774
|
});
|
|
7741
7775
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
7742
7776
|
return true;
|
|
@@ -7748,8 +7782,8 @@ var useLicense = (licenseKey = "") => {
|
|
|
7748
7782
|
|
|
7749
7783
|
// src/components/CSSVariableWatch.tsx
|
|
7750
7784
|
import {
|
|
7751
|
-
createElement as
|
|
7752
|
-
useCallback as
|
|
7785
|
+
createElement as createElement30,
|
|
7786
|
+
useCallback as useCallback18,
|
|
7753
7787
|
useLayoutEffect as useLayoutEffect4
|
|
7754
7788
|
} from "react";
|
|
7755
7789
|
import { useRef as useRef19 } from "react";
|
|
@@ -7766,7 +7800,7 @@ var WRAPPER_STYLE = {
|
|
|
7766
7800
|
};
|
|
7767
7801
|
var useCSSVariableWatch = (params) => {
|
|
7768
7802
|
const lastValueRef = useRef19(0);
|
|
7769
|
-
const onResize =
|
|
7803
|
+
const onResize = useCallback18(({ height }) => {
|
|
7770
7804
|
if (height && height !== lastValueRef.current) {
|
|
7771
7805
|
lastValueRef.current = height;
|
|
7772
7806
|
params.onChange(height);
|
|
@@ -7789,11 +7823,11 @@ var CSSVariableWatch = (props) => {
|
|
|
7789
7823
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7790
7824
|
ref: domRef
|
|
7791
7825
|
}));
|
|
7792
|
-
return /* @__PURE__ */
|
|
7826
|
+
return /* @__PURE__ */ createElement30("div", {
|
|
7793
7827
|
"data-name": "css-variable-watcher",
|
|
7794
7828
|
"data-var": props.varName,
|
|
7795
7829
|
style: WRAPPER_STYLE
|
|
7796
|
-
}, /* @__PURE__ */
|
|
7830
|
+
}, /* @__PURE__ */ createElement30("div", {
|
|
7797
7831
|
ref: domRef,
|
|
7798
7832
|
style: {
|
|
7799
7833
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -7887,7 +7921,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
7887
7921
|
|
|
7888
7922
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7889
7923
|
import {
|
|
7890
|
-
createElement as
|
|
7924
|
+
createElement as createElement31,
|
|
7891
7925
|
memo as memo12
|
|
7892
7926
|
} from "react";
|
|
7893
7927
|
|
|
@@ -7901,11 +7935,11 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
7901
7935
|
var baseCls2 = `${rootClassName11}-LoadMask`;
|
|
7902
7936
|
function LoadMaskFn(props) {
|
|
7903
7937
|
const { visible, children = "Loading" } = props;
|
|
7904
|
-
return /* @__PURE__ */
|
|
7938
|
+
return /* @__PURE__ */ createElement31("div", {
|
|
7905
7939
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls2}`
|
|
7906
|
-
}, /* @__PURE__ */
|
|
7940
|
+
}, /* @__PURE__ */ createElement31("div", {
|
|
7907
7941
|
className: `${LoadMaskOverlayCls} ${baseCls2}-Overlay`
|
|
7908
|
-
}), /* @__PURE__ */
|
|
7942
|
+
}), /* @__PURE__ */ createElement31("div", {
|
|
7909
7943
|
className: `${LoadMaskTextCls} ${baseCls2}-Text`
|
|
7910
7944
|
}, children));
|
|
7911
7945
|
}
|
|
@@ -7997,31 +8031,31 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
7997
8031
|
useEffect24(() => {
|
|
7998
8032
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
7999
8033
|
}, [scrollStopDelay]);
|
|
8000
|
-
return /* @__PURE__ */
|
|
8034
|
+
return /* @__PURE__ */ createElement32("div", __spreadValues({
|
|
8001
8035
|
ref: domRef
|
|
8002
|
-
}, domProps), header ? /* @__PURE__ */
|
|
8036
|
+
}, domProps), header ? /* @__PURE__ */ createElement32(TableHeaderWrapper, {
|
|
8003
8037
|
brain: horizontalVirtualBrain,
|
|
8004
8038
|
repaintId,
|
|
8005
8039
|
scrollbars
|
|
8006
|
-
}) : null, /* @__PURE__ */
|
|
8040
|
+
}) : null, /* @__PURE__ */ createElement32(InfiniteTableBody, null, /* @__PURE__ */ createElement32(VirtualScrollContainer, {
|
|
8007
8041
|
ref: scrollerDOMRef,
|
|
8008
8042
|
onContainerScroll: applyScrollVertical,
|
|
8009
8043
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
8010
|
-
}, /* @__PURE__ */
|
|
8044
|
+
}, /* @__PURE__ */ createElement32("div", {
|
|
8011
8045
|
className: display.flex
|
|
8012
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
8046
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ createElement32(SpacePlaceholder, {
|
|
8013
8047
|
count: dataArray.length,
|
|
8014
8048
|
width: 0,
|
|
8015
8049
|
height: reservedContentHeight
|
|
8016
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
8050
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ createElement32(LoadMaskCmp, {
|
|
8017
8051
|
visible: loading
|
|
8018
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
8052
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ createElement32(InfiniteTableLicenseFooter, null), /* @__PURE__ */ createElement32("div", {
|
|
8019
8053
|
ref: portalDOMRef,
|
|
8020
8054
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
8021
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
8055
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ createElement32(CSSVariableWatch, {
|
|
8022
8056
|
varName: rowHeightCSSVar,
|
|
8023
8057
|
onChange: onRowHeightCSSVarChange
|
|
8024
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
8058
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ createElement32(CSSVariableWatch, {
|
|
8025
8059
|
varName: headerHeightCSSVar,
|
|
8026
8060
|
onChange: onHeaderHeightCSSVarChange
|
|
8027
8061
|
}) : null);
|
|
@@ -8069,13 +8103,13 @@ function InfiniteTableContextProvider() {
|
|
|
8069
8103
|
}
|
|
8070
8104
|
}, [scrollTopId, scrollerDOMRef]);
|
|
8071
8105
|
const TableContext2 = getInfiniteTableContext();
|
|
8072
|
-
return /* @__PURE__ */
|
|
8106
|
+
return /* @__PURE__ */ createElement32(TableContext2.Provider, {
|
|
8073
8107
|
value: contextValue
|
|
8074
|
-
}, /* @__PURE__ */
|
|
8108
|
+
}, /* @__PURE__ */ createElement32(InfiniteTableComponent, null));
|
|
8075
8109
|
}
|
|
8076
8110
|
function InfiniteTable(props) {
|
|
8077
|
-
const table = /* @__PURE__ */
|
|
8078
|
-
return /* @__PURE__ */
|
|
8111
|
+
const table = /* @__PURE__ */ createElement32(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement32(InfiniteTableContextProvider, null));
|
|
8112
|
+
return /* @__PURE__ */ createElement32(StrictMode, null, table);
|
|
8079
8113
|
}
|
|
8080
8114
|
InfiniteTable.defaultProps = {
|
|
8081
8115
|
rowHeight: 40,
|