@infinite-table/infinite-react 0.1.3 → 0.2.2
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 +141 -130
- package/index.esm.js +440 -340
- package/index.js +445 -343
- 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,7 +854,7 @@ 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 {
|
|
861
859
|
groupRenderStrategy,
|
|
862
860
|
groupBy,
|
|
@@ -1247,7 +1245,6 @@ var getComputedVisibleColumns = ({
|
|
|
1247
1245
|
return false;
|
|
1248
1246
|
}
|
|
1249
1247
|
const result2 = isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
|
|
1250
|
-
console.log(columnVisibility, colId, result2);
|
|
1251
1248
|
return result2;
|
|
1252
1249
|
});
|
|
1253
1250
|
const columnsArray = visibleColumnOrder.map((columnId) => columns.get(columnId)).filter(Boolean);
|
|
@@ -2049,9 +2046,9 @@ function useColumnGroups() {
|
|
|
2049
2046
|
}
|
|
2050
2047
|
|
|
2051
2048
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2052
|
-
import { useEffect as useEffect9, useMemo as
|
|
2049
|
+
import { useEffect as useEffect9, useMemo as useMemo5 } from "react";
|
|
2053
2050
|
|
|
2054
|
-
// src/components/InfiniteTable/
|
|
2051
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2055
2052
|
import {
|
|
2056
2053
|
createElement as createElement4
|
|
2057
2054
|
} from "react";
|
|
@@ -2127,93 +2124,15 @@ var userSelect = { none: "_16lm1iwm" };
|
|
|
2127
2124
|
var willChange = { transform: "_16lm1iw19" };
|
|
2128
2125
|
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2129
2126
|
|
|
2130
|
-
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
2131
|
-
function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
|
|
2132
|
-
if (!pivotColumns) {
|
|
2133
|
-
return void 0;
|
|
2134
|
-
}
|
|
2135
|
-
const {
|
|
2136
|
-
pivotColumn,
|
|
2137
|
-
pivotRowLabelsColumn,
|
|
2138
|
-
pivotBy,
|
|
2139
|
-
groupBy,
|
|
2140
|
-
pivotTotalColumnPosition,
|
|
2141
|
-
toggleGroupRow
|
|
2142
|
-
} = params;
|
|
2143
|
-
const computedPivotColumns = new Map();
|
|
2144
|
-
pivotColumns.forEach((col, key) => {
|
|
2145
|
-
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
2146
|
-
return;
|
|
2147
|
-
}
|
|
2148
|
-
let column = __spreadValues({}, col);
|
|
2149
|
-
const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
|
|
2150
|
-
if (!isPivotRowLabelsColumn) {
|
|
2151
|
-
if (pivotColumn) {
|
|
2152
|
-
if (typeof pivotColumn === "function") {
|
|
2153
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2154
|
-
column,
|
|
2155
|
-
pivotBy,
|
|
2156
|
-
groupBy
|
|
2157
|
-
}));
|
|
2158
|
-
} else {
|
|
2159
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
} else {
|
|
2163
|
-
if (pivotRowLabelsColumn) {
|
|
2164
|
-
if (typeof pivotRowLabelsColumn === "function") {
|
|
2165
|
-
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
|
|
2166
|
-
column,
|
|
2167
|
-
pivotBy,
|
|
2168
|
-
groupBy
|
|
2169
|
-
}));
|
|
2170
|
-
} else {
|
|
2171
|
-
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
if (!column.render) {
|
|
2175
|
-
column.render = (renderOptions) => {
|
|
2176
|
-
var _a;
|
|
2177
|
-
let { value, rowInfo, column: column2, groupBy: groupBy2 } = renderOptions;
|
|
2178
|
-
if (column2.renderValue) {
|
|
2179
|
-
value = column2.renderValue(renderOptions);
|
|
2180
|
-
}
|
|
2181
|
-
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupBy2.length;
|
|
2182
|
-
return /* @__PURE__ */ createElement4("div", {
|
|
2183
|
-
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2184
|
-
}, showExpanderIcon ? /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2185
|
-
expanded: !rowInfo.collapsed,
|
|
2186
|
-
onChange: () => {
|
|
2187
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2188
|
-
}
|
|
2189
|
-
}) : null, /* @__PURE__ */ createElement4("div", {
|
|
2190
|
-
className: cssEllipsisClassName
|
|
2191
|
-
}, value != null ? value : null));
|
|
2192
|
-
};
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
if (!column.render && column.renderValue) {
|
|
2196
|
-
column.render = (renderOptions) => {
|
|
2197
|
-
return column.renderValue(renderOptions);
|
|
2198
|
-
};
|
|
2199
|
-
}
|
|
2200
|
-
computedPivotColumns.set(key, column);
|
|
2201
|
-
});
|
|
2202
|
-
return computedPivotColumns;
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
2127
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2206
|
-
import {
|
|
2207
|
-
createElement as createElement5
|
|
2208
|
-
} from "react";
|
|
2209
2128
|
function getGroupColumnRender({
|
|
2210
2129
|
groupIndexForColumn,
|
|
2211
2130
|
groupRenderStrategy,
|
|
2212
2131
|
toggleGroupRow
|
|
2213
2132
|
}) {
|
|
2214
2133
|
return (renderOptions) => {
|
|
2215
|
-
var _a;
|
|
2216
|
-
let { value, rowInfo, column } = renderOptions;
|
|
2134
|
+
var _a, _b, _c;
|
|
2135
|
+
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2217
2136
|
if (column.renderValue) {
|
|
2218
2137
|
value = column.renderValue(renderOptions);
|
|
2219
2138
|
}
|
|
@@ -2238,14 +2157,20 @@ function getGroupColumnRender({
|
|
|
2238
2157
|
return null;
|
|
2239
2158
|
}
|
|
2240
2159
|
}
|
|
2241
|
-
|
|
2160
|
+
let icon = null;
|
|
2161
|
+
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);
|
|
2162
|
+
if (showExpanderIcon) {
|
|
2163
|
+
const defaultIcon = /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2164
|
+
expanded: !collapsed,
|
|
2165
|
+
onChange: () => {
|
|
2166
|
+
toggleGroupRow(groupKeys);
|
|
2167
|
+
}
|
|
2168
|
+
});
|
|
2169
|
+
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2170
|
+
}
|
|
2171
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2242
2172
|
className: join(display.flex, alignItems.center)
|
|
2243
|
-
}, /* @__PURE__ */
|
|
2244
|
-
expanded: !collapsed,
|
|
2245
|
-
onChange: () => {
|
|
2246
|
-
toggleGroupRow(groupKeys);
|
|
2247
|
-
}
|
|
2248
|
-
}), /* @__PURE__ */ createElement5("div", {
|
|
2173
|
+
}, icon, /* @__PURE__ */ createElement4("div", {
|
|
2249
2174
|
className: cssEllipsisClassName
|
|
2250
2175
|
}, value != null ? value : null));
|
|
2251
2176
|
};
|
|
@@ -2281,21 +2206,29 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2281
2206
|
groupByField: options.groupBy.map((g) => g.field),
|
|
2282
2207
|
sortable: false,
|
|
2283
2208
|
render: (renderOptions) => {
|
|
2284
|
-
|
|
2209
|
+
var _a, _b;
|
|
2210
|
+
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
2285
2211
|
if (!rowInfo.isGroupRow) {
|
|
2286
2212
|
return null;
|
|
2287
2213
|
}
|
|
2288
2214
|
if (column.renderValue) {
|
|
2289
2215
|
value = column.renderValue(renderOptions);
|
|
2290
2216
|
}
|
|
2291
|
-
|
|
2217
|
+
const collapsed = rowInfo.collapsed;
|
|
2218
|
+
let icon = null;
|
|
2219
|
+
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);
|
|
2220
|
+
if (showExpanderIcon) {
|
|
2221
|
+
const defaultIcon = /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2222
|
+
expanded: !collapsed,
|
|
2223
|
+
onChange: () => {
|
|
2224
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
2225
|
+
}
|
|
2226
|
+
});
|
|
2227
|
+
icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
|
|
2228
|
+
}
|
|
2229
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2292
2230
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2293
|
-
}, /* @__PURE__ */
|
|
2294
|
-
expanded: !rowInfo.collapsed,
|
|
2295
|
-
onChange: () => {
|
|
2296
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2297
|
-
}
|
|
2298
|
-
}), /* @__PURE__ */ createElement5("div", {
|
|
2231
|
+
}, icon, /* @__PURE__ */ createElement4("div", {
|
|
2299
2232
|
className: cssEllipsisClassName
|
|
2300
2233
|
}, value != null ? value : null));
|
|
2301
2234
|
}
|
|
@@ -2316,7 +2249,7 @@ import { useCallback as useCallback4 } from "react";
|
|
|
2316
2249
|
// src/components/DataSource/index.tsx
|
|
2317
2250
|
import {
|
|
2318
2251
|
Fragment,
|
|
2319
|
-
createElement as
|
|
2252
|
+
createElement as createElement5
|
|
2320
2253
|
} from "react";
|
|
2321
2254
|
|
|
2322
2255
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -2394,7 +2327,7 @@ var getMultisortFunction = (sortInfo, get) => {
|
|
|
2394
2327
|
};
|
|
2395
2328
|
|
|
2396
2329
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
2397
|
-
import { useEffect as useEffect8, useRef as useRef6, useState as useState4 } from "react";
|
|
2330
|
+
import { useEffect as useEffect8, useMemo as useMemo4, useRef as useRef6, useState as useState4 } from "react";
|
|
2398
2331
|
|
|
2399
2332
|
// src/utils/DeepMap/once.ts
|
|
2400
2333
|
function once(fn) {
|
|
@@ -2665,6 +2598,7 @@ var DeepMap = class {
|
|
|
2665
2598
|
|
|
2666
2599
|
// src/utils/groupAndPivot/index.ts
|
|
2667
2600
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
2601
|
+
var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
|
|
2668
2602
|
function DEFAULT_TO_KEY(value) {
|
|
2669
2603
|
return value;
|
|
2670
2604
|
}
|
|
@@ -2734,7 +2668,10 @@ function lazyGroup(groupParams, rootData) {
|
|
|
2734
2668
|
items: [],
|
|
2735
2669
|
reducerResults: {}
|
|
2736
2670
|
};
|
|
2737
|
-
deepMap.set([
|
|
2671
|
+
deepMap.set([
|
|
2672
|
+
...currentGroupKeys,
|
|
2673
|
+
`${NOT_LOADED_YET_KEY_PREFIX}${i}`
|
|
2674
|
+
], deepMapGroupValue2);
|
|
2738
2675
|
continue;
|
|
2739
2676
|
}
|
|
2740
2677
|
const dataObject = dataArray[i].data;
|
|
@@ -2893,6 +2830,10 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2893
2830
|
}
|
|
2894
2831
|
}
|
|
2895
2832
|
}
|
|
2833
|
+
let theValue = groupKeys[groupKeys.length - 1];
|
|
2834
|
+
if (typeof theValue === "string" && theValue.startsWith(NOT_LOADED_YET_KEY_PREFIX)) {
|
|
2835
|
+
theValue = null;
|
|
2836
|
+
}
|
|
2896
2837
|
const enhancedGroupData = {
|
|
2897
2838
|
data,
|
|
2898
2839
|
groupCount: groupItems.length,
|
|
@@ -2906,8 +2847,9 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2906
2847
|
indexInParentGroups: options.indexInParentGroups,
|
|
2907
2848
|
indexInGroup: options.indexInGroup,
|
|
2908
2849
|
indexInAll: options.indexInAll,
|
|
2909
|
-
value:
|
|
2910
|
-
|
|
2850
|
+
value: theValue,
|
|
2851
|
+
rootGroupBy: groupBy,
|
|
2852
|
+
groupBy: groupNesting === groupBy.length ? groupBy : groupBy.slice(0, groupNesting),
|
|
2911
2853
|
isGroupRow: true,
|
|
2912
2854
|
pivotValuesMap: pivotDeepMap,
|
|
2913
2855
|
groupNesting,
|
|
@@ -3029,11 +2971,33 @@ function useEffectWithChanges(fn, deps) {
|
|
|
3029
2971
|
}, useEffectDeps);
|
|
3030
2972
|
}
|
|
3031
2973
|
|
|
2974
|
+
// src/components/utils/debounce.ts
|
|
2975
|
+
function debounce(fn, { wait }) {
|
|
2976
|
+
let timeout = null;
|
|
2977
|
+
return function(...args) {
|
|
2978
|
+
const context = this;
|
|
2979
|
+
if (timeout !== null) {
|
|
2980
|
+
clearTimeout(timeout);
|
|
2981
|
+
}
|
|
2982
|
+
timeout = setTimeout(() => {
|
|
2983
|
+
fn.apply(context, args);
|
|
2984
|
+
}, wait);
|
|
2985
|
+
};
|
|
2986
|
+
}
|
|
2987
|
+
|
|
3032
2988
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
2989
|
+
var getRafPromise = () => new Promise((resolve) => {
|
|
2990
|
+
requestAnimationFrame(resolve);
|
|
2991
|
+
});
|
|
3033
2992
|
var SKIP_DATA_CHANGES_KEYS = {
|
|
3034
2993
|
originalDataArray: true,
|
|
3035
2994
|
changes: true
|
|
3036
2995
|
};
|
|
2996
|
+
function getChangeDetect() {
|
|
2997
|
+
var _a;
|
|
2998
|
+
const perfNow = (_a = getGlobal().performance) == null ? void 0 : _a.now();
|
|
2999
|
+
return `${Date.now()}:${perfNow}`;
|
|
3000
|
+
}
|
|
3037
3001
|
function buildDataSourceDataParams(componentState, overrides) {
|
|
3038
3002
|
var _a, _b;
|
|
3039
3003
|
const sortInfo = componentState.multiSort ? componentState.sortInfo : (_b = (_a = componentState.sortInfo) == null ? void 0 : _a[0]) != null ? _b : null;
|
|
@@ -3073,15 +3037,34 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
3073
3037
|
}
|
|
3074
3038
|
function loadData(data, componentState, actions, overrides) {
|
|
3075
3039
|
const dataParams = buildDataSourceDataParams(componentState, overrides);
|
|
3040
|
+
if (componentState.fullLazyLoad && dataParams.groupKeys) {
|
|
3041
|
+
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3042
|
+
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys];
|
|
3043
|
+
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3044
|
+
if (existingGroupRowInfo && existingGroupRowInfo.cache) {
|
|
3045
|
+
const items = existingGroupRowInfo.items;
|
|
3046
|
+
const len = items.length;
|
|
3047
|
+
let allLoaded = true;
|
|
3048
|
+
for (let i = 0; i < len; i++) {
|
|
3049
|
+
if (items[i] == null) {
|
|
3050
|
+
allLoaded = false;
|
|
3051
|
+
break;
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
if (allLoaded) {
|
|
3055
|
+
return Promise.resolve(true);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3076
3059
|
if (typeof data === "function") {
|
|
3077
3060
|
data = data(dataParams);
|
|
3078
3061
|
}
|
|
3079
3062
|
const dataIsPromise = typeof data === "object" && typeof data.then === "function";
|
|
3080
|
-
if (dataIsPromise) {
|
|
3063
|
+
if (dataIsPromise && !componentState.fullLazyLoad) {
|
|
3081
3064
|
actions.loading = true;
|
|
3082
3065
|
}
|
|
3083
|
-
Promise.resolve(data).then((dataParam) => {
|
|
3084
|
-
var _a, _b, _c;
|
|
3066
|
+
return Promise.resolve(data).then((dataParam) => {
|
|
3067
|
+
var _a, _b, _c, _d;
|
|
3085
3068
|
let dataArray = [];
|
|
3086
3069
|
let skipAssign = false;
|
|
3087
3070
|
if (Array.isArray(dataParam.data)) {
|
|
@@ -3094,9 +3077,10 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3094
3077
|
actions.pivotMappings = remoteData.mappings;
|
|
3095
3078
|
}
|
|
3096
3079
|
if (componentState.fullLazyLoad && dataParams.groupKeys) {
|
|
3097
|
-
const lazyGroupData =
|
|
3080
|
+
const lazyGroupData = componentState.originalLazyGroupData;
|
|
3098
3081
|
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys];
|
|
3099
3082
|
const newGroupRowInfo = {
|
|
3083
|
+
cache: !!remoteData.cache,
|
|
3100
3084
|
totalCount: (_a = remoteData.totalCount) != null ? _a : dataArray.length,
|
|
3101
3085
|
items: dataArray
|
|
3102
3086
|
};
|
|
@@ -3104,11 +3088,15 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3104
3088
|
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
3105
3089
|
const currentGroupRowInfo = existingGroupRowInfo != null ? existingGroupRowInfo : {
|
|
3106
3090
|
items: [],
|
|
3107
|
-
totalCount: newGroupRowInfo.totalCount
|
|
3091
|
+
totalCount: newGroupRowInfo.totalCount,
|
|
3092
|
+
cache: (_b = newGroupRowInfo.cache) != null ? _b : true
|
|
3108
3093
|
};
|
|
3094
|
+
if (existingGroupRowInfo) {
|
|
3095
|
+
existingGroupRowInfo.cache = newGroupRowInfo.cache;
|
|
3096
|
+
}
|
|
3109
3097
|
currentGroupRowInfo.items.length = currentGroupRowInfo.totalCount;
|
|
3110
|
-
const start = (
|
|
3111
|
-
const end =
|
|
3098
|
+
const start = (_c = dataParams.lazyLoadStartIndex) != null ? _c : 0;
|
|
3099
|
+
const end = Math.min((_d = remoteData.totalCount) != null ? _d : start + dataParams.lazyLoadBatchSize);
|
|
3112
3100
|
for (let i = start; i < end; i++) {
|
|
3113
3101
|
currentGroupRowInfo.items[i] = newGroupRowInfo.items[i - start];
|
|
3114
3102
|
}
|
|
@@ -3119,7 +3107,7 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3119
3107
|
lazyGroupData.set(key, newGroupRowInfo);
|
|
3120
3108
|
}
|
|
3121
3109
|
skipAssign = true;
|
|
3122
|
-
actions.
|
|
3110
|
+
actions.originalLazyGroupDataChangeDetect = getChangeDetect();
|
|
3123
3111
|
}
|
|
3124
3112
|
} else {
|
|
3125
3113
|
dataArray = dataParam;
|
|
@@ -3127,7 +3115,7 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
3127
3115
|
if (!skipAssign) {
|
|
3128
3116
|
actions.originalDataArray = dataArray;
|
|
3129
3117
|
}
|
|
3130
|
-
if (dataIsPromise) {
|
|
3118
|
+
if (dataIsPromise && !componentState.fullLazyLoad) {
|
|
3131
3119
|
actions.loading = false;
|
|
3132
3120
|
}
|
|
3133
3121
|
});
|
|
@@ -3146,9 +3134,7 @@ function useLoadData() {
|
|
|
3146
3134
|
pivotBy,
|
|
3147
3135
|
livePagination,
|
|
3148
3136
|
livePaginationCursor,
|
|
3149
|
-
cursorId: stateCursorId
|
|
3150
|
-
lazyLoadBatchSize,
|
|
3151
|
-
notifyScrollStop
|
|
3137
|
+
cursorId: stateCursorId
|
|
3152
3138
|
} = componentState;
|
|
3153
3139
|
const [scrollbars, setScrollbars] = useState4({
|
|
3154
3140
|
vertical: false,
|
|
@@ -3189,33 +3175,7 @@ function useLoadData() {
|
|
|
3189
3175
|
cursorId: livePagination ? stateCursorId : null
|
|
3190
3176
|
};
|
|
3191
3177
|
const initialRef = useRef6(true);
|
|
3192
|
-
|
|
3193
|
-
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3194
|
-
return notifyScrollStop.onChange((param) => {
|
|
3195
|
-
console.log("scroll stop", param);
|
|
3196
|
-
if (!param) {
|
|
3197
|
-
return;
|
|
3198
|
-
}
|
|
3199
|
-
const componentState2 = getComponentState();
|
|
3200
|
-
const {
|
|
3201
|
-
firstVisibleRowIndex: startIndex,
|
|
3202
|
-
lastVisibleRowIndex: endIndex
|
|
3203
|
-
} = param;
|
|
3204
|
-
const firstBatchStart = Math.floor(startIndex / lazyLoadBatchSize) * lazyLoadBatchSize;
|
|
3205
|
-
const lastBatchStart = Math.floor(endIndex / lazyLoadBatchSize) * lazyLoadBatchSize;
|
|
3206
|
-
const isRowLoaded = (index) => componentState2.dataArray[index].data != null;
|
|
3207
|
-
for (let batchStartIndex = firstBatchStart; batchStartIndex <= lastBatchStart; batchStartIndex = batchStartIndex + lazyLoadBatchSize) {
|
|
3208
|
-
if (!isRowLoaded(batchStartIndex)) {
|
|
3209
|
-
loadData(componentState2.data, componentState2, actions, {
|
|
3210
|
-
lazyLoadBatchSize,
|
|
3211
|
-
lazyLoadStartIndex: batchStartIndex
|
|
3212
|
-
});
|
|
3213
|
-
}
|
|
3214
|
-
}
|
|
3215
|
-
});
|
|
3216
|
-
}
|
|
3217
|
-
return;
|
|
3218
|
-
}, [lazyLoadBatchSize]);
|
|
3178
|
+
useLazyLoadRange();
|
|
3219
3179
|
useEffectWithChanges(() => {
|
|
3220
3180
|
const componentState2 = getComponentState();
|
|
3221
3181
|
if (typeof componentState2.data !== "function") {
|
|
@@ -3236,6 +3196,126 @@ function useLoadData() {
|
|
|
3236
3196
|
}
|
|
3237
3197
|
}, depsObject);
|
|
3238
3198
|
}
|
|
3199
|
+
function useLazyLoadRange() {
|
|
3200
|
+
const {
|
|
3201
|
+
getComponentState,
|
|
3202
|
+
componentActions: actions,
|
|
3203
|
+
componentState
|
|
3204
|
+
} = useComponentState();
|
|
3205
|
+
const loadingCache = useMemo4(() => {
|
|
3206
|
+
return new Map();
|
|
3207
|
+
}, [componentState.data]);
|
|
3208
|
+
globalThis.loadingCache = loadingCache;
|
|
3209
|
+
const {
|
|
3210
|
+
lazyLoadBatchSize,
|
|
3211
|
+
notifyRenderRangeChange,
|
|
3212
|
+
dataArray,
|
|
3213
|
+
scrollStopDelayUpdatedByTable
|
|
3214
|
+
} = componentState;
|
|
3215
|
+
const latestRenderRangeRef = useRef6(null);
|
|
3216
|
+
const loadRange = (param, cache = loadingCache) => {
|
|
3217
|
+
const componentState2 = getComponentState();
|
|
3218
|
+
param = param || latestRenderRangeRef.current;
|
|
3219
|
+
if (!param) {
|
|
3220
|
+
return;
|
|
3221
|
+
}
|
|
3222
|
+
const { renderStartIndex: startIndex, renderEndIndex: endIndex } = param;
|
|
3223
|
+
if (!lazyLoadBatchSize || lazyLoadBatchSize <= 0) {
|
|
3224
|
+
return;
|
|
3225
|
+
}
|
|
3226
|
+
lazyLoadRange({
|
|
3227
|
+
startIndex,
|
|
3228
|
+
endIndex,
|
|
3229
|
+
lazyLoadBatchSize,
|
|
3230
|
+
componentState: componentState2,
|
|
3231
|
+
componentActions: actions
|
|
3232
|
+
}, cache);
|
|
3233
|
+
};
|
|
3234
|
+
const debouncedLoadRange = useMemo4(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
3235
|
+
useEffect8(() => {
|
|
3236
|
+
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3237
|
+
return notifyRenderRangeChange.onChange((param) => {
|
|
3238
|
+
latestRenderRangeRef.current = param;
|
|
3239
|
+
loadRange(param, loadingCache);
|
|
3240
|
+
});
|
|
3241
|
+
}
|
|
3242
|
+
return;
|
|
3243
|
+
}, [lazyLoadBatchSize, loadingCache]);
|
|
3244
|
+
useEffect8(() => {
|
|
3245
|
+
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
3246
|
+
debouncedLoadRange();
|
|
3247
|
+
}
|
|
3248
|
+
return;
|
|
3249
|
+
}, [dataArray]);
|
|
3250
|
+
}
|
|
3251
|
+
function lazyLoadRange(options, cache) {
|
|
3252
|
+
const {
|
|
3253
|
+
startIndex,
|
|
3254
|
+
endIndex,
|
|
3255
|
+
lazyLoadBatchSize,
|
|
3256
|
+
componentState,
|
|
3257
|
+
componentActions
|
|
3258
|
+
} = options;
|
|
3259
|
+
const { dataArray } = componentState;
|
|
3260
|
+
const isRowLoaded = (index) => dataArray[index].data != null;
|
|
3261
|
+
const perGroupFnCalls = new DeepMap();
|
|
3262
|
+
const rootGroupKeys = ["_______xxx______"];
|
|
3263
|
+
for (let i = startIndex; i <= endIndex; i++) {
|
|
3264
|
+
const rowInfo = dataArray[i];
|
|
3265
|
+
if (!rowInfo) {
|
|
3266
|
+
continue;
|
|
3267
|
+
}
|
|
3268
|
+
const rowLoaded = rowInfo.data != null;
|
|
3269
|
+
const parentGroupKeys = rowInfo.groupKeys ? [...rowInfo.groupKeys] : [];
|
|
3270
|
+
if (rowInfo.groupKeys) {
|
|
3271
|
+
parentGroupKeys.pop();
|
|
3272
|
+
}
|
|
3273
|
+
const cacheKeys = parentGroupKeys.length ? parentGroupKeys : rootGroupKeys;
|
|
3274
|
+
const indexInGroup = rowInfo.indexInGroup;
|
|
3275
|
+
if (!rowLoaded) {
|
|
3276
|
+
let fnCalls = perGroupFnCalls.get(cacheKeys);
|
|
3277
|
+
const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
|
|
3278
|
+
const offset = rowInfo.indexInGroup - batchStartIndexInGroup;
|
|
3279
|
+
const absoluteIndexOfBatchStart = dataArray[rowInfo.indexInAll - offset].indexInAll;
|
|
3280
|
+
const batchStartRowLoaded = isRowLoaded(absoluteIndexOfBatchStart);
|
|
3281
|
+
const batchStartRowId = dataArray[absoluteIndexOfBatchStart].id;
|
|
3282
|
+
if (batchStartRowLoaded || (fnCalls == null ? void 0 : fnCalls[batchStartRowId])) {
|
|
3283
|
+
continue;
|
|
3284
|
+
}
|
|
3285
|
+
const shouldSetFnCalls = !fnCalls;
|
|
3286
|
+
fnCalls = fnCalls || {};
|
|
3287
|
+
const currentFnCall = {
|
|
3288
|
+
lazyLoadStartIndex: batchStartIndexInGroup,
|
|
3289
|
+
lazyLoadBatchSize,
|
|
3290
|
+
groupKeys: parentGroupKeys
|
|
3291
|
+
};
|
|
3292
|
+
if (!fnCalls[batchStartRowId]) {
|
|
3293
|
+
fnCalls[batchStartRowId] = currentFnCall;
|
|
3294
|
+
}
|
|
3295
|
+
if (shouldSetFnCalls) {
|
|
3296
|
+
perGroupFnCalls.set(cacheKeys, fnCalls);
|
|
3297
|
+
}
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
let initialPromise = Promise.resolve(true);
|
|
3301
|
+
const allFnCalls = [];
|
|
3302
|
+
perGroupFnCalls.topDownValues().forEach((record) => {
|
|
3303
|
+
allFnCalls.push(...Object.values(record));
|
|
3304
|
+
});
|
|
3305
|
+
allFnCalls.reduce((promise, fnCall) => {
|
|
3306
|
+
const cacheKey = `${fnCall.groupKeys.join("-")}:${fnCall.lazyLoadStartIndex}`;
|
|
3307
|
+
if (cache && cache.has(cacheKey)) {
|
|
3308
|
+
return promise;
|
|
3309
|
+
}
|
|
3310
|
+
cache == null ? void 0 : cache.set(cacheKey, true);
|
|
3311
|
+
const args = [componentState.data, componentState, componentActions, fnCall];
|
|
3312
|
+
return promise.then(() => getRafPromise()).then(() => loadData(...args)).then(() => {
|
|
3313
|
+
requestAnimationFrame(() => {
|
|
3314
|
+
cache == null ? void 0 : cache.delete(cacheKey);
|
|
3315
|
+
});
|
|
3316
|
+
});
|
|
3317
|
+
}, initialPromise);
|
|
3318
|
+
}
|
|
3239
3319
|
|
|
3240
3320
|
// src/components/DataSource/state/normalizeSortInfo.ts
|
|
3241
3321
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
@@ -3435,8 +3515,11 @@ function initSetupState2() {
|
|
|
3435
3515
|
dataParams: void 0,
|
|
3436
3516
|
notifyScrollbarsChange: buildSubscriptionCallback(),
|
|
3437
3517
|
notifyScrollStop: buildSubscriptionCallback(),
|
|
3518
|
+
notifyRenderRangeChange: buildSubscriptionCallback(),
|
|
3438
3519
|
pivotTotalColumnPosition: "end",
|
|
3520
|
+
scrollStopDelayUpdatedByTable: 100,
|
|
3439
3521
|
originalLazyGroupData,
|
|
3522
|
+
originalLazyGroupDataChangeDetect: 0,
|
|
3440
3523
|
originalDataArray,
|
|
3441
3524
|
cursorId: defaultCursorId,
|
|
3442
3525
|
showSeparatePivotColumnForSingleAggregation: false,
|
|
@@ -3621,23 +3704,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
3621
3704
|
const aggregationReducers = Object.keys(reducers).map((key) => {
|
|
3622
3705
|
return __spreadProps(__spreadValues({}, reducers[key]), { id: key });
|
|
3623
3706
|
});
|
|
3624
|
-
const columns = new Map([
|
|
3625
|
-
[
|
|
3626
|
-
"labels",
|
|
3627
|
-
{
|
|
3628
|
-
header: "Row labels",
|
|
3629
|
-
pivotBy,
|
|
3630
|
-
valueGetter: (params) => {
|
|
3631
|
-
var _a;
|
|
3632
|
-
const { rowInfo } = params;
|
|
3633
|
-
if (!rowInfo.data) {
|
|
3634
|
-
return "Loading ... TODO replace this with a loading indicator";
|
|
3635
|
-
}
|
|
3636
|
-
return rowInfo.groupKeys ? rowInfo.groupKeys[((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) - 1] : null;
|
|
3637
|
-
}
|
|
3638
|
-
}
|
|
3639
|
-
]
|
|
3640
|
-
]);
|
|
3707
|
+
const columns = new Map([]);
|
|
3641
3708
|
const columnGroups = new Map();
|
|
3642
3709
|
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
3643
3710
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
@@ -3809,6 +3876,7 @@ function concludeReducer(params) {
|
|
|
3809
3876
|
"generateGroupRows",
|
|
3810
3877
|
"originalDataArray",
|
|
3811
3878
|
"originalLazyGroupData",
|
|
3879
|
+
"originalLazyGroupDataChangeDetect",
|
|
3812
3880
|
"groupBy",
|
|
3813
3881
|
"groupRowsState",
|
|
3814
3882
|
"pivotBy",
|
|
@@ -3899,7 +3967,7 @@ function DataSourceWithContext(props) {
|
|
|
3899
3967
|
if (typeof children === "function") {
|
|
3900
3968
|
children = children(computedValues);
|
|
3901
3969
|
}
|
|
3902
|
-
return /* @__PURE__ */
|
|
3970
|
+
return /* @__PURE__ */ createElement5(Fragment, null, children);
|
|
3903
3971
|
}
|
|
3904
3972
|
var DataSourceRoot = getComponentStateRoot({
|
|
3905
3973
|
initSetupState: initSetupState2,
|
|
@@ -3922,14 +3990,14 @@ function DataSourceCmp({ children }) {
|
|
|
3922
3990
|
globalThis.getDataSourceState = getState;
|
|
3923
3991
|
}
|
|
3924
3992
|
useLoadData();
|
|
3925
|
-
return /* @__PURE__ */
|
|
3993
|
+
return /* @__PURE__ */ createElement5(DataSourceContext.Provider, {
|
|
3926
3994
|
value: contextValue
|
|
3927
|
-
}, /* @__PURE__ */
|
|
3995
|
+
}, /* @__PURE__ */ createElement5(DataSourceWithContext, {
|
|
3928
3996
|
children
|
|
3929
3997
|
}));
|
|
3930
3998
|
}
|
|
3931
3999
|
function DataSource(props) {
|
|
3932
|
-
return /* @__PURE__ */
|
|
4000
|
+
return /* @__PURE__ */ createElement5(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement5(DataSourceCmp, {
|
|
3933
4001
|
children: props.children
|
|
3934
4002
|
}));
|
|
3935
4003
|
}
|
|
@@ -3953,7 +4021,7 @@ function useToggleGroupRow() {
|
|
|
3953
4021
|
|
|
3954
4022
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
3955
4023
|
function useGroupByMap(groupBy) {
|
|
3956
|
-
const groupByMap =
|
|
4024
|
+
const groupByMap = useMemo5(() => {
|
|
3957
4025
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
3958
4026
|
acc.set(groupBy2.field, {
|
|
3959
4027
|
groupBy: groupBy2,
|
|
@@ -3980,9 +4048,9 @@ function useColumnsWhen() {
|
|
|
3980
4048
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
3981
4049
|
}, [pivotTotalColumnPosition]);
|
|
3982
4050
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
3983
|
-
|
|
3984
|
-
useColumnsWhenGrouping();
|
|
4051
|
+
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
3985
4052
|
useHideEmptyGroupColumns(groupByMap);
|
|
4053
|
+
return { toggleGroupRow };
|
|
3986
4054
|
}
|
|
3987
4055
|
function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
3988
4056
|
const toggleGroupRow = useToggleGroupRow();
|
|
@@ -3992,6 +4060,9 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
3992
4060
|
} = useComponentState();
|
|
3993
4061
|
function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
|
|
3994
4062
|
const computedColumns = new Map();
|
|
4063
|
+
if (groupRenderStrategy2 !== "inline") {
|
|
4064
|
+
return;
|
|
4065
|
+
}
|
|
3995
4066
|
columns2.forEach((column, id) => {
|
|
3996
4067
|
let base = {};
|
|
3997
4068
|
const groupByForColumn = groupByMap2.get(column.field);
|
|
@@ -4051,51 +4122,32 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
4051
4122
|
});
|
|
4052
4123
|
}, [columns, groupByMap, groupRenderStrategy, toggleGroupRow]);
|
|
4053
4124
|
}
|
|
4054
|
-
function
|
|
4125
|
+
function useColumnsWhenGrouping() {
|
|
4055
4126
|
const {
|
|
4056
4127
|
componentState: { groupBy, pivotBy }
|
|
4057
4128
|
} = useDataSourceContextValue();
|
|
4058
4129
|
const {
|
|
4059
4130
|
componentActions,
|
|
4060
4131
|
componentState: {
|
|
4132
|
+
columns,
|
|
4133
|
+
groupColumn,
|
|
4134
|
+
groupRenderStrategy,
|
|
4061
4135
|
pivotColumns,
|
|
4062
4136
|
pivotColumn,
|
|
4063
|
-
pivotRowLabelsColumn,
|
|
4064
4137
|
pivotTotalColumnPosition
|
|
4065
4138
|
}
|
|
4066
4139
|
} = useComponentState();
|
|
4067
4140
|
const toggleGroupRow = useToggleGroupRow();
|
|
4068
4141
|
useEffect9(() => {
|
|
4069
|
-
const computedPivotColumns = getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, {
|
|
4070
|
-
pivotColumn,
|
|
4071
|
-
pivotRowLabelsColumn,
|
|
4072
|
-
pivotTotalColumnPosition,
|
|
4073
|
-
pivotBy,
|
|
4074
|
-
groupBy,
|
|
4075
|
-
toggleGroupRow
|
|
4076
|
-
});
|
|
4077
|
-
componentActions.computedPivotColumns = computedPivotColumns;
|
|
4078
|
-
}, [pivotColumns, pivotColumn, pivotRowLabelsColumn]);
|
|
4079
|
-
}
|
|
4080
|
-
function useColumnsWhenGrouping() {
|
|
4081
|
-
const {
|
|
4082
|
-
componentState: { groupBy }
|
|
4083
|
-
} = useDataSourceContextValue();
|
|
4084
|
-
const {
|
|
4085
|
-
componentActions,
|
|
4086
|
-
componentState: { columns, groupColumn, groupRenderStrategy, pivotColumns }
|
|
4087
|
-
} = useComponentState();
|
|
4088
|
-
const toggleGroupRow = useToggleGroupRow();
|
|
4089
|
-
useEffect9(() => {
|
|
4090
|
-
if (pivotColumns) {
|
|
4091
|
-
return;
|
|
4092
|
-
}
|
|
4093
4142
|
const update = () => {
|
|
4094
4143
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
4095
4144
|
columns,
|
|
4096
4145
|
groupColumn,
|
|
4097
|
-
|
|
4146
|
+
pivotColumn,
|
|
4147
|
+
pivotTotalColumnPosition,
|
|
4148
|
+
groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
|
|
4098
4149
|
groupBy,
|
|
4150
|
+
pivotBy,
|
|
4099
4151
|
pivotColumns,
|
|
4100
4152
|
toggleGroupRow
|
|
4101
4153
|
});
|
|
@@ -4107,7 +4159,17 @@ function useColumnsWhenGrouping() {
|
|
|
4107
4159
|
delete: update,
|
|
4108
4160
|
clear: update
|
|
4109
4161
|
});
|
|
4110
|
-
}, [
|
|
4162
|
+
}, [
|
|
4163
|
+
columns,
|
|
4164
|
+
groupBy,
|
|
4165
|
+
pivotBy,
|
|
4166
|
+
groupColumn,
|
|
4167
|
+
groupRenderStrategy,
|
|
4168
|
+
pivotColumns,
|
|
4169
|
+
pivotTotalColumnPosition,
|
|
4170
|
+
pivotColumn
|
|
4171
|
+
]);
|
|
4172
|
+
return { toggleGroupRow };
|
|
4111
4173
|
}
|
|
4112
4174
|
function useHideEmptyGroupColumns(groupRowsMap) {
|
|
4113
4175
|
const {
|
|
@@ -4174,14 +4236,14 @@ function getColumnsWhenGrouping(params) {
|
|
|
4174
4236
|
const {
|
|
4175
4237
|
pivotColumns,
|
|
4176
4238
|
groupBy,
|
|
4239
|
+
pivotBy,
|
|
4177
4240
|
groupColumn,
|
|
4241
|
+
pivotTotalColumnPosition,
|
|
4242
|
+
pivotColumn,
|
|
4178
4243
|
groupRenderStrategy,
|
|
4179
4244
|
toggleGroupRow,
|
|
4180
4245
|
columns
|
|
4181
4246
|
} = params;
|
|
4182
|
-
if (pivotColumns) {
|
|
4183
|
-
return void 0;
|
|
4184
|
-
}
|
|
4185
4247
|
if (groupRenderStrategy === "inline") {
|
|
4186
4248
|
return void 0;
|
|
4187
4249
|
}
|
|
@@ -4191,6 +4253,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
4191
4253
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
4192
4254
|
groupByForColumn,
|
|
4193
4255
|
groupBy,
|
|
4256
|
+
pivotBy,
|
|
4194
4257
|
groupIndexForColumn,
|
|
4195
4258
|
groupCount: arr.length,
|
|
4196
4259
|
groupRenderStrategy
|
|
@@ -4201,13 +4264,40 @@ function getColumnsWhenGrouping(params) {
|
|
|
4201
4264
|
const singleGroupColumn = getSingleGroupColumn({
|
|
4202
4265
|
groupCount: groupBy.length,
|
|
4203
4266
|
groupBy,
|
|
4267
|
+
pivotBy,
|
|
4204
4268
|
groupRenderStrategy
|
|
4205
4269
|
}, toggleGroupRow, groupColumn);
|
|
4206
4270
|
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
4207
4271
|
}
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4272
|
+
if (pivotColumns) {
|
|
4273
|
+
pivotColumns.forEach((col, key) => {
|
|
4274
|
+
if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
|
|
4275
|
+
return;
|
|
4276
|
+
}
|
|
4277
|
+
let column = __spreadValues({}, col);
|
|
4278
|
+
if (pivotColumn) {
|
|
4279
|
+
if (typeof pivotColumn === "function") {
|
|
4280
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
4281
|
+
column,
|
|
4282
|
+
pivotBy,
|
|
4283
|
+
groupBy
|
|
4284
|
+
}));
|
|
4285
|
+
} else {
|
|
4286
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
if (!column.render && column.renderValue) {
|
|
4290
|
+
column.render = (renderOptions) => {
|
|
4291
|
+
return column.renderValue(renderOptions);
|
|
4292
|
+
};
|
|
4293
|
+
}
|
|
4294
|
+
computedColumns.set(key, column);
|
|
4295
|
+
});
|
|
4296
|
+
} else {
|
|
4297
|
+
columns.forEach((col, colId) => {
|
|
4298
|
+
computedColumns.set(colId, col);
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4211
4301
|
return computedColumns.size ? computedColumns : void 0;
|
|
4212
4302
|
}
|
|
4213
4303
|
|
|
@@ -4246,7 +4336,7 @@ function useComputed() {
|
|
|
4246
4336
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
4247
4337
|
const { multiSort } = dataSourceState;
|
|
4248
4338
|
useColumnGroups();
|
|
4249
|
-
useColumnsWhen();
|
|
4339
|
+
const { toggleGroupRow } = useColumnsWhen();
|
|
4250
4340
|
const setSortInfo = useCallback5((sortInfo) => {
|
|
4251
4341
|
var _a2;
|
|
4252
4342
|
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
@@ -4315,6 +4405,7 @@ function useComputed() {
|
|
|
4315
4405
|
const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
|
|
4316
4406
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
4317
4407
|
return {
|
|
4408
|
+
toggleGroupRow,
|
|
4318
4409
|
computedPinnedStartOverflow,
|
|
4319
4410
|
computedPinnedEndOverflow,
|
|
4320
4411
|
computedPinnedStartWidth,
|
|
@@ -4339,7 +4430,7 @@ function useComputed() {
|
|
|
4339
4430
|
|
|
4340
4431
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4341
4432
|
import {
|
|
4342
|
-
createElement as
|
|
4433
|
+
createElement as createElement6,
|
|
4343
4434
|
forwardRef
|
|
4344
4435
|
} from "react";
|
|
4345
4436
|
|
|
@@ -4351,7 +4442,7 @@ var useInternalProps = () => {
|
|
|
4351
4442
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
4352
4443
|
var InfiniteTableBody = forwardRef(function InfiniteTableBody2(props, ref) {
|
|
4353
4444
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
4354
|
-
return /* @__PURE__ */
|
|
4445
|
+
return /* @__PURE__ */ createElement6("div", __spreadProps(__spreadValues({
|
|
4355
4446
|
ref
|
|
4356
4447
|
}, props), {
|
|
4357
4448
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -4360,12 +4451,12 @@ var InfiniteTableBody = forwardRef(function InfiniteTableBody2(props, ref) {
|
|
|
4360
4451
|
|
|
4361
4452
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
4362
4453
|
import {
|
|
4363
|
-
createElement as
|
|
4454
|
+
createElement as createElement18
|
|
4364
4455
|
} from "react";
|
|
4365
4456
|
|
|
4366
4457
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
4367
4458
|
import {
|
|
4368
|
-
createElement as
|
|
4459
|
+
createElement as createElement7,
|
|
4369
4460
|
memo as memo2
|
|
4370
4461
|
} from "react";
|
|
4371
4462
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
@@ -4373,7 +4464,7 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
4373
4464
|
if (!scrollbarWidth2) {
|
|
4374
4465
|
return null;
|
|
4375
4466
|
}
|
|
4376
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
4377
4468
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
4378
4469
|
style: __spreadValues({
|
|
4379
4470
|
position: "absolute",
|
|
@@ -4389,7 +4480,7 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
4389
4480
|
if (!scrollbarWidth2) {
|
|
4390
4481
|
return null;
|
|
4391
4482
|
}
|
|
4392
|
-
return /* @__PURE__ */
|
|
4483
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
4393
4484
|
"data-name": "vertical-scrollbar-placeholder",
|
|
4394
4485
|
style: __spreadValues({
|
|
4395
4486
|
position: "absolute",
|
|
@@ -4415,7 +4506,7 @@ var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
|
4415
4506
|
|
|
4416
4507
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4417
4508
|
import {
|
|
4418
|
-
createElement as
|
|
4509
|
+
createElement as createElement14,
|
|
4419
4510
|
memo as memo6
|
|
4420
4511
|
} from "react";
|
|
4421
4512
|
import { useCallback as useCallback8, useEffect as useEffect14, useRef as useRef9 } from "react";
|
|
@@ -4423,13 +4514,13 @@ import { useCallback as useCallback8, useEffect as useEffect14, useRef as useRef
|
|
|
4423
4514
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
4424
4515
|
import {
|
|
4425
4516
|
Fragment as Fragment2,
|
|
4426
|
-
createElement as
|
|
4517
|
+
createElement as createElement10
|
|
4427
4518
|
} from "react";
|
|
4428
4519
|
import { useCallback as useCallback7, useEffect as useEffect12, useRef as useRef8 } from "react";
|
|
4429
4520
|
|
|
4430
4521
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4431
4522
|
import {
|
|
4432
|
-
createElement as
|
|
4523
|
+
createElement as createElement8,
|
|
4433
4524
|
memo as memo3
|
|
4434
4525
|
} from "react";
|
|
4435
4526
|
|
|
@@ -4490,12 +4581,12 @@ function InfiniteTableCellFn(props) {
|
|
|
4490
4581
|
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4491
4582
|
}
|
|
4492
4583
|
}
|
|
4493
|
-
return /* @__PURE__ */
|
|
4584
|
+
return /* @__PURE__ */ createElement8("div", __spreadProps(__spreadValues({}, domProps), {
|
|
4494
4585
|
ref: domRef,
|
|
4495
4586
|
style,
|
|
4496
4587
|
"data-name": `Cell`,
|
|
4497
4588
|
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}` : "")
|
|
4498
|
-
}), beforeChildren, cssEllipsis ? /* @__PURE__ */
|
|
4589
|
+
}), beforeChildren, cssEllipsis ? /* @__PURE__ */ createElement8("div", {
|
|
4499
4590
|
className: `${rootClassName2}Cell_content ${cssEllipsisClassName}`
|
|
4500
4591
|
}, children) : children, afterChildren);
|
|
4501
4592
|
}
|
|
@@ -4505,7 +4596,7 @@ var InfiniteTableCell = memo3(InfiniteTableCellFn);
|
|
|
4505
4596
|
var import_binary_search = __toModule(require_binary_search());
|
|
4506
4597
|
import {
|
|
4507
4598
|
useCallback as useCallback6,
|
|
4508
|
-
useMemo as
|
|
4599
|
+
useMemo as useMemo6,
|
|
4509
4600
|
useRef as useRef7,
|
|
4510
4601
|
useState as useState6
|
|
4511
4602
|
} from "react";
|
|
@@ -4552,8 +4643,8 @@ var useColumnPointerEvents = ({
|
|
|
4552
4643
|
const dragging = draggingDiff != null;
|
|
4553
4644
|
const { componentActions, computed } = useInfiniteTable();
|
|
4554
4645
|
const { computedColumnOrder } = computed;
|
|
4555
|
-
const column =
|
|
4556
|
-
const { columnIndex, columnWidth, columnsArray } =
|
|
4646
|
+
const column = useMemo6(() => columns.get(columnId), [columnId, columns]);
|
|
4647
|
+
const { columnIndex, columnWidth, columnsArray } = useMemo6(() => {
|
|
4557
4648
|
const columnsArray2 = Array.from(columns.values());
|
|
4558
4649
|
return {
|
|
4559
4650
|
columnsArray: columnsArray2,
|
|
@@ -4700,7 +4791,7 @@ import { createPortal } from "react-dom";
|
|
|
4700
4791
|
|
|
4701
4792
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4702
4793
|
import {
|
|
4703
|
-
createElement as
|
|
4794
|
+
createElement as createElement9
|
|
4704
4795
|
} from "react";
|
|
4705
4796
|
import { useEffect as useEffect11, useState as useState7 } from "react";
|
|
4706
4797
|
var defaultLineStyle = {
|
|
@@ -4755,18 +4846,18 @@ function SortIcon(props) {
|
|
|
4755
4846
|
if (direction === -1) {
|
|
4756
4847
|
indexStyle.top = "100%";
|
|
4757
4848
|
}
|
|
4758
|
-
return /* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ createElement9("div", {
|
|
4759
4850
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
4760
4851
|
className: join(className, "ITableIcon", "ITableIcon-sort")
|
|
4761
|
-
}, showIndex ? /* @__PURE__ */
|
|
4852
|
+
}, showIndex ? /* @__PURE__ */ createElement9("div", {
|
|
4762
4853
|
"data-name": "index",
|
|
4763
4854
|
style: indexStyle
|
|
4764
|
-
}, index) : null, /* @__PURE__ */
|
|
4855
|
+
}, index) : null, /* @__PURE__ */ createElement9("div", {
|
|
4765
4856
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
4766
4857
|
onTransitionEnd
|
|
4767
|
-
}), /* @__PURE__ */
|
|
4858
|
+
}), /* @__PURE__ */ createElement9("div", {
|
|
4768
4859
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
4769
|
-
}), /* @__PURE__ */
|
|
4860
|
+
}), /* @__PURE__ */ createElement9("div", {
|
|
4770
4861
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
4771
4862
|
}));
|
|
4772
4863
|
}
|
|
@@ -4797,7 +4888,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4797
4888
|
});
|
|
4798
4889
|
}
|
|
4799
4890
|
header = header != null ? header : column.name;
|
|
4800
|
-
const sortTool = /* @__PURE__ */
|
|
4891
|
+
const sortTool = /* @__PURE__ */ createElement10(SortIcon, {
|
|
4801
4892
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
4802
4893
|
className: `${baseCls}__sort-icon ${HeaderSortIconCls}`,
|
|
4803
4894
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
@@ -4835,7 +4926,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4835
4926
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
4836
4927
|
let draggingProxy = null;
|
|
4837
4928
|
if (dragging) {
|
|
4838
|
-
draggingProxy = /* @__PURE__ */
|
|
4929
|
+
draggingProxy = /* @__PURE__ */ createElement10("div", {
|
|
4839
4930
|
className: `${baseCls}Proxy ${HeaderCellProxy}`,
|
|
4840
4931
|
style: {
|
|
4841
4932
|
position: "absolute",
|
|
@@ -4848,7 +4939,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4848
4939
|
}, header);
|
|
4849
4940
|
draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
|
|
4850
4941
|
}
|
|
4851
|
-
return /* @__PURE__ */
|
|
4942
|
+
return /* @__PURE__ */ createElement10(Fragment2, null, /* @__PURE__ */ createElement10(InfiniteTableCell, {
|
|
4852
4943
|
domRef: ref,
|
|
4853
4944
|
column,
|
|
4854
4945
|
"data-name": `HeaderCell`,
|
|
@@ -4865,7 +4956,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4865
4956
|
|
|
4866
4957
|
// src/components/RawList/index.tsx
|
|
4867
4958
|
import {
|
|
4868
|
-
createElement as
|
|
4959
|
+
createElement as createElement13,
|
|
4869
4960
|
memo as memo5
|
|
4870
4961
|
} from "react";
|
|
4871
4962
|
import { useEffect as useEffect13 } from "react";
|
|
@@ -4873,7 +4964,7 @@ import { useEffect as useEffect13 } from "react";
|
|
|
4873
4964
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
4874
4965
|
import {
|
|
4875
4966
|
Fragment as Fragment3,
|
|
4876
|
-
createElement as
|
|
4967
|
+
createElement as createElement11,
|
|
4877
4968
|
memo as memo4
|
|
4878
4969
|
} from "react";
|
|
4879
4970
|
import { useLayoutEffect as useLayoutEffect3, useState as useState8 } from "react";
|
|
@@ -4885,16 +4976,16 @@ function AvoidReactDiffFn(props) {
|
|
|
4885
4976
|
});
|
|
4886
4977
|
return remove;
|
|
4887
4978
|
}, [props.updater]);
|
|
4888
|
-
return /* @__PURE__ */
|
|
4979
|
+
return /* @__PURE__ */ createElement11(Fragment3, null, children);
|
|
4889
4980
|
}
|
|
4890
4981
|
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
4891
4982
|
|
|
4892
4983
|
// src/components/RawList/useVirtualRenderer.ts
|
|
4893
|
-
import { useMemo as
|
|
4984
|
+
import { useMemo as useMemo7 } from "react";
|
|
4894
4985
|
|
|
4895
4986
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4896
4987
|
import {
|
|
4897
|
-
createElement as
|
|
4988
|
+
createElement as createElement12
|
|
4898
4989
|
} from "react";
|
|
4899
4990
|
|
|
4900
4991
|
// src/components/RawList/MappedItems.ts
|
|
@@ -5140,7 +5231,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
5140
5231
|
};
|
|
5141
5232
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
5142
5233
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
5143
|
-
const item = /* @__PURE__ */
|
|
5234
|
+
const item = /* @__PURE__ */ createElement12(AvoidReactDiff, {
|
|
5144
5235
|
key: elementIndex,
|
|
5145
5236
|
name: `${elementIndex}`,
|
|
5146
5237
|
updater: this.updaters[elementIndex]
|
|
@@ -5206,7 +5297,7 @@ function createRenderer(brain) {
|
|
|
5206
5297
|
function useVirtualRenderer({
|
|
5207
5298
|
brain
|
|
5208
5299
|
}) {
|
|
5209
|
-
return
|
|
5300
|
+
return useMemo7(() => {
|
|
5210
5301
|
return createRenderer(brain);
|
|
5211
5302
|
}, [brain]);
|
|
5212
5303
|
}
|
|
@@ -5237,7 +5328,7 @@ function RawListFn(props) {
|
|
|
5237
5328
|
});
|
|
5238
5329
|
return remove;
|
|
5239
5330
|
}, [brain, onRenderUpdater]);
|
|
5240
|
-
return /* @__PURE__ */
|
|
5331
|
+
return /* @__PURE__ */ createElement13(AvoidReactDiff, {
|
|
5241
5332
|
updater: onRenderUpdater
|
|
5242
5333
|
});
|
|
5243
5334
|
}
|
|
@@ -5262,7 +5353,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5262
5353
|
}
|
|
5263
5354
|
return null;
|
|
5264
5355
|
}
|
|
5265
|
-
return /* @__PURE__ */
|
|
5356
|
+
return /* @__PURE__ */ createElement14(InfiniteTableHeaderCell, {
|
|
5266
5357
|
domRef: domRef2,
|
|
5267
5358
|
column,
|
|
5268
5359
|
headerHeight,
|
|
@@ -5287,7 +5378,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
5287
5378
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
5288
5379
|
style
|
|
5289
5380
|
};
|
|
5290
|
-
return /* @__PURE__ */
|
|
5381
|
+
return /* @__PURE__ */ createElement14("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement14(RawList, {
|
|
5291
5382
|
brain,
|
|
5292
5383
|
renderItem: renderColumn
|
|
5293
5384
|
}));
|
|
@@ -5296,15 +5387,15 @@ var InfiniteTableHeader = memo6(InfiniteTableHeaderFn);
|
|
|
5296
5387
|
|
|
5297
5388
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
5298
5389
|
import {
|
|
5299
|
-
createElement as
|
|
5390
|
+
createElement as createElement17,
|
|
5300
5391
|
memo as memo7,
|
|
5301
|
-
useMemo as
|
|
5392
|
+
useMemo as useMemo8,
|
|
5302
5393
|
useRef as useRef10
|
|
5303
5394
|
} from "react";
|
|
5304
5395
|
|
|
5305
5396
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
5306
5397
|
import {
|
|
5307
|
-
createElement as
|
|
5398
|
+
createElement as createElement16
|
|
5308
5399
|
} from "react";
|
|
5309
5400
|
|
|
5310
5401
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
@@ -5396,7 +5487,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
5396
5487
|
|
|
5397
5488
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
5398
5489
|
import {
|
|
5399
|
-
createElement as
|
|
5490
|
+
createElement as createElement15
|
|
5400
5491
|
} from "react";
|
|
5401
5492
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
5402
5493
|
function InfiniteTableHeaderGroup(props) {
|
|
@@ -5411,16 +5502,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
5411
5502
|
width: columnGroup.computedWidth,
|
|
5412
5503
|
height
|
|
5413
5504
|
};
|
|
5414
|
-
return /* @__PURE__ */
|
|
5505
|
+
return /* @__PURE__ */ createElement15("div", {
|
|
5415
5506
|
"data-group-id": columnGroup.id,
|
|
5416
5507
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
5417
5508
|
style
|
|
5418
|
-
}, /* @__PURE__ */
|
|
5509
|
+
}, /* @__PURE__ */ createElement15("div", {
|
|
5419
5510
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
5420
5511
|
style: { height: headerHeight }
|
|
5421
|
-
}, /* @__PURE__ */
|
|
5512
|
+
}, /* @__PURE__ */ createElement15("div", {
|
|
5422
5513
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
5423
|
-
}, header)), /* @__PURE__ */
|
|
5514
|
+
}, header)), /* @__PURE__ */ createElement15("div", {
|
|
5424
5515
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
5425
5516
|
}, props.children));
|
|
5426
5517
|
}
|
|
@@ -5443,7 +5534,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5443
5534
|
return items2.map((colGroupItem) => {
|
|
5444
5535
|
if (colGroupItem.type === "column") {
|
|
5445
5536
|
const col = colGroupItem.ref;
|
|
5446
|
-
return /* @__PURE__ */
|
|
5537
|
+
return /* @__PURE__ */ createElement16(InfiniteTableHeaderCell, {
|
|
5447
5538
|
key: col.id,
|
|
5448
5539
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
5449
5540
|
column: col,
|
|
@@ -5457,7 +5548,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5457
5548
|
colIds.push(col.id);
|
|
5458
5549
|
return col;
|
|
5459
5550
|
});
|
|
5460
|
-
return /* @__PURE__ */
|
|
5551
|
+
return /* @__PURE__ */ createElement16(InfiniteTableHeaderGroup, {
|
|
5461
5552
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
5462
5553
|
columns: columns2,
|
|
5463
5554
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -5512,7 +5603,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5512
5603
|
} = useInfiniteTable();
|
|
5513
5604
|
const domRef = useRef10(null);
|
|
5514
5605
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
5515
|
-
const columnHeaderGroups =
|
|
5606
|
+
const columnHeaderGroups = useMemo8(() => {
|
|
5516
5607
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
5517
5608
|
columnGroups: computedColumnGroups,
|
|
5518
5609
|
columnGroupsDepthsMap,
|
|
@@ -5531,7 +5622,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5531
5622
|
columnGroupsMaxDepth
|
|
5532
5623
|
]);
|
|
5533
5624
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
5534
|
-
return /* @__PURE__ */
|
|
5625
|
+
return /* @__PURE__ */ createElement17(InfiniteTableHeaderCell, {
|
|
5535
5626
|
key: c.id,
|
|
5536
5627
|
headerHeight,
|
|
5537
5628
|
column: c,
|
|
@@ -5554,14 +5645,14 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5554
5645
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
5555
5646
|
return removeOnScroll;
|
|
5556
5647
|
}, [brain, scrollListener]);
|
|
5557
|
-
return /* @__PURE__ */
|
|
5648
|
+
return /* @__PURE__ */ createElement17("div", __spreadProps(__spreadValues({}, domProps), {
|
|
5558
5649
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
5559
5650
|
pinned: pinning,
|
|
5560
5651
|
virtualized: false,
|
|
5561
5652
|
overflow: scrollable
|
|
5562
5653
|
})),
|
|
5563
5654
|
style
|
|
5564
|
-
}), /* @__PURE__ */
|
|
5655
|
+
}), /* @__PURE__ */ createElement17("div", {
|
|
5565
5656
|
style: { width: totalWidth },
|
|
5566
5657
|
className: join(flexFlow.row, display.flex),
|
|
5567
5658
|
ref: domRef
|
|
@@ -5600,7 +5691,7 @@ function TableHeaderWrapper(props) {
|
|
|
5600
5691
|
const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
|
|
5601
5692
|
left: computedPinnedStartWidth
|
|
5602
5693
|
} : void 0;
|
|
5603
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
5694
|
+
const header = virtualizeHeader ? /* @__PURE__ */ createElement18(InfiniteTableHeader, {
|
|
5604
5695
|
columns: computedUnpinnedColumns,
|
|
5605
5696
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
5606
5697
|
brain,
|
|
@@ -5613,7 +5704,7 @@ function TableHeaderWrapper(props) {
|
|
|
5613
5704
|
},
|
|
5614
5705
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5615
5706
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5616
|
-
}) : /* @__PURE__ */
|
|
5707
|
+
}) : /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
5617
5708
|
style: unvirtualizedStyle,
|
|
5618
5709
|
brain,
|
|
5619
5710
|
scrollable: true,
|
|
@@ -5622,12 +5713,12 @@ function TableHeaderWrapper(props) {
|
|
|
5622
5713
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5623
5714
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5624
5715
|
});
|
|
5625
|
-
return /* @__PURE__ */
|
|
5716
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
5626
5717
|
className: HeaderWrapperCls,
|
|
5627
5718
|
style: {
|
|
5628
5719
|
height: virtualizeHeader ? height : void 0
|
|
5629
5720
|
}
|
|
5630
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
5721
|
+
}, hasPinnedStart ? /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
5631
5722
|
style: {
|
|
5632
5723
|
left: 0,
|
|
5633
5724
|
position: "absolute",
|
|
@@ -5639,7 +5730,7 @@ function TableHeaderWrapper(props) {
|
|
|
5639
5730
|
scrollable: computedPinnedStartOverflow,
|
|
5640
5731
|
pinning: "start",
|
|
5641
5732
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
5642
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
5733
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ createElement18(InfiniteTableHeaderUnvirtualized, {
|
|
5643
5734
|
style: {
|
|
5644
5735
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
5645
5736
|
position: "absolute",
|
|
@@ -5651,7 +5742,7 @@ function TableHeaderWrapper(props) {
|
|
|
5651
5742
|
scrollable: computedPinnedEndOverflow,
|
|
5652
5743
|
pinning: "end",
|
|
5653
5744
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
5654
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
5745
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ createElement18(VerticalScrollbarPlaceholder, {
|
|
5655
5746
|
style: {
|
|
5656
5747
|
height: "100%",
|
|
5657
5748
|
right: 0
|
|
@@ -5661,7 +5752,7 @@ function TableHeaderWrapper(props) {
|
|
|
5661
5752
|
|
|
5662
5753
|
// src/components/VirtualScrollContainer/index.tsx
|
|
5663
5754
|
import {
|
|
5664
|
-
createElement as
|
|
5755
|
+
createElement as createElement19,
|
|
5665
5756
|
forwardRef as forwardRef2
|
|
5666
5757
|
} from "react";
|
|
5667
5758
|
import { useRef as useRef11 } from "react";
|
|
@@ -5717,7 +5808,7 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
|
|
|
5717
5808
|
} = props;
|
|
5718
5809
|
const domRef = ref != null ? ref : useRef11(null);
|
|
5719
5810
|
useOnScroll(domRef, onContainerScroll);
|
|
5720
|
-
return /* @__PURE__ */
|
|
5811
|
+
return /* @__PURE__ */ createElement19("div", {
|
|
5721
5812
|
ref: domRef,
|
|
5722
5813
|
style,
|
|
5723
5814
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -5726,7 +5817,7 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
|
|
|
5726
5817
|
|
|
5727
5818
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
5728
5819
|
import {
|
|
5729
|
-
createElement as
|
|
5820
|
+
createElement as createElement20,
|
|
5730
5821
|
memo as memo8
|
|
5731
5822
|
} from "react";
|
|
5732
5823
|
function SpacePlaceholderFn(props) {
|
|
@@ -5738,7 +5829,7 @@ function SpacePlaceholderFn(props) {
|
|
|
5738
5829
|
opacity: 0,
|
|
5739
5830
|
pointerEvents: "none"
|
|
5740
5831
|
};
|
|
5741
|
-
return /* @__PURE__ */
|
|
5832
|
+
return /* @__PURE__ */ createElement20("div", {
|
|
5742
5833
|
"data-count": count,
|
|
5743
5834
|
"data-placeholder-width": true ? width : void 0,
|
|
5744
5835
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -5749,24 +5840,24 @@ function SpacePlaceholderFn(props) {
|
|
|
5749
5840
|
var SpacePlaceholder = memo8(SpacePlaceholderFn);
|
|
5750
5841
|
|
|
5751
5842
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
5752
|
-
import {
|
|
5843
|
+
import { useEffect as useEffect22, useMemo as useMemo11, useRef as useRef17 } from "react";
|
|
5753
5844
|
|
|
5754
5845
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
5755
5846
|
import {
|
|
5756
|
-
createElement as
|
|
5847
|
+
createElement as createElement26
|
|
5757
5848
|
} from "react";
|
|
5758
5849
|
import { useCallback as useCallback12 } from "react";
|
|
5759
5850
|
|
|
5760
5851
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
5761
5852
|
import {
|
|
5762
|
-
createElement as
|
|
5853
|
+
createElement as createElement22,
|
|
5763
5854
|
useCallback as useCallback9
|
|
5764
5855
|
} from "react";
|
|
5765
5856
|
|
|
5766
5857
|
// src/components/VirtualList/VirtualList.tsx
|
|
5767
5858
|
import {
|
|
5768
5859
|
Fragment as Fragment4,
|
|
5769
|
-
createElement as
|
|
5860
|
+
createElement as createElement21
|
|
5770
5861
|
} from "react";
|
|
5771
5862
|
import { useRef as useRef12, useEffect as useEffect17, useState as useState9 } from "react";
|
|
5772
5863
|
|
|
@@ -5849,19 +5940,19 @@ var VirtualList = (props) => {
|
|
|
5849
5940
|
if (true) {
|
|
5850
5941
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
5851
5942
|
}
|
|
5852
|
-
return /* @__PURE__ */
|
|
5943
|
+
return /* @__PURE__ */ createElement21(Fragment4, null, /* @__PURE__ */ createElement21("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement21(VirtualScrollContainer, {
|
|
5853
5944
|
scrollable,
|
|
5854
5945
|
onContainerScroll
|
|
5855
|
-
}, /* @__PURE__ */
|
|
5946
|
+
}, /* @__PURE__ */ createElement21("div", {
|
|
5856
5947
|
ref: domRef,
|
|
5857
5948
|
className: scrollTransformTargetCls,
|
|
5858
5949
|
"data-name": "scroll-transform-target"
|
|
5859
|
-
}, /* @__PURE__ */
|
|
5950
|
+
}, /* @__PURE__ */ createElement21(RawList, {
|
|
5860
5951
|
brain: virtualBrain,
|
|
5861
5952
|
renderItem,
|
|
5862
5953
|
repaintId,
|
|
5863
5954
|
debugChannel: "VirtualList-" + mainAxis
|
|
5864
|
-
})), children, /* @__PURE__ */
|
|
5955
|
+
})), children, /* @__PURE__ */ createElement21(SpacePlaceholder, {
|
|
5865
5956
|
count,
|
|
5866
5957
|
width,
|
|
5867
5958
|
height
|
|
@@ -5878,7 +5969,7 @@ var VirtualRowList = (props) => {
|
|
|
5878
5969
|
rowIndex: renderProps.itemIndex
|
|
5879
5970
|
});
|
|
5880
5971
|
}, [renderRow]);
|
|
5881
|
-
return /* @__PURE__ */
|
|
5972
|
+
return /* @__PURE__ */ createElement22(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
5882
5973
|
renderItem,
|
|
5883
5974
|
mainAxis: "vertical",
|
|
5884
5975
|
itemMainAxisSize: rowHeight,
|
|
@@ -5888,7 +5979,7 @@ var VirtualRowList = (props) => {
|
|
|
5888
5979
|
|
|
5889
5980
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
5890
5981
|
import {
|
|
5891
|
-
createElement as
|
|
5982
|
+
createElement as createElement24,
|
|
5892
5983
|
memo as memo10,
|
|
5893
5984
|
useCallback as useCallback11
|
|
5894
5985
|
} from "react";
|
|
@@ -5896,7 +5987,7 @@ import { useRef as useRef14 } from "react";
|
|
|
5896
5987
|
|
|
5897
5988
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5898
5989
|
import {
|
|
5899
|
-
createElement as
|
|
5990
|
+
createElement as createElement23,
|
|
5900
5991
|
memo as memo9
|
|
5901
5992
|
} from "react";
|
|
5902
5993
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
@@ -5955,7 +6046,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5955
6046
|
rowIndex,
|
|
5956
6047
|
toggleGroupRow,
|
|
5957
6048
|
toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
|
|
5958
|
-
groupBy: computedDataSource.groupBy
|
|
6049
|
+
groupBy: computedDataSource.groupBy,
|
|
6050
|
+
pivotBy: computedDataSource.pivotBy
|
|
5959
6051
|
});
|
|
5960
6052
|
if (column.render) {
|
|
5961
6053
|
renderValue = column.render(renderParam);
|
|
@@ -5991,7 +6083,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5991
6083
|
}
|
|
5992
6084
|
}
|
|
5993
6085
|
}
|
|
5994
|
-
return /* @__PURE__ */
|
|
6086
|
+
return /* @__PURE__ */ createElement23(InfiniteTableCell, __spreadProps(__spreadValues({
|
|
5995
6087
|
domRef,
|
|
5996
6088
|
offsetProperty
|
|
5997
6089
|
}, dataset), {
|
|
@@ -6141,7 +6233,7 @@ function InfiniteTableRowFn(props) {
|
|
|
6141
6233
|
if (!column) {
|
|
6142
6234
|
}
|
|
6143
6235
|
const hidden = false;
|
|
6144
|
-
return /* @__PURE__ */
|
|
6236
|
+
return /* @__PURE__ */ createElement24(InfiniteTableColumnCell, {
|
|
6145
6237
|
getData,
|
|
6146
6238
|
rowInfo,
|
|
6147
6239
|
groupRenderStrategy,
|
|
@@ -6168,9 +6260,9 @@ function InfiniteTableRowFn(props) {
|
|
|
6168
6260
|
if (true) {
|
|
6169
6261
|
domProps["data-cmp-name"] = "ITableRow";
|
|
6170
6262
|
}
|
|
6171
|
-
return /* @__PURE__ */
|
|
6263
|
+
return /* @__PURE__ */ createElement24("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6172
6264
|
style
|
|
6173
|
-
}), /* @__PURE__ */
|
|
6265
|
+
}), /* @__PURE__ */ createElement24(RawList, {
|
|
6174
6266
|
brain,
|
|
6175
6267
|
renderItem: renderCell,
|
|
6176
6268
|
debugChannel: `${rowIndex}`
|
|
@@ -6180,7 +6272,7 @@ var InfiniteTableRow = memo10(InfiniteTableRowFn);
|
|
|
6180
6272
|
|
|
6181
6273
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
6182
6274
|
import {
|
|
6183
|
-
createElement as
|
|
6275
|
+
createElement as createElement25,
|
|
6184
6276
|
memo as memo11
|
|
6185
6277
|
} from "react";
|
|
6186
6278
|
function TableRowUnvirtualizedFn(props) {
|
|
@@ -6203,7 +6295,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6203
6295
|
}, domProps.style);
|
|
6204
6296
|
const children = columns.map((col) => {
|
|
6205
6297
|
const hidden = false;
|
|
6206
|
-
return /* @__PURE__ */
|
|
6298
|
+
return /* @__PURE__ */ createElement25(InfiniteTableColumnCell, {
|
|
6207
6299
|
key: col.id,
|
|
6208
6300
|
virtualized: false,
|
|
6209
6301
|
rowHeight,
|
|
@@ -6216,7 +6308,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
6216
6308
|
column: col
|
|
6217
6309
|
});
|
|
6218
6310
|
});
|
|
6219
|
-
return /* @__PURE__ */
|
|
6311
|
+
return /* @__PURE__ */ createElement25("div", __spreadProps(__spreadValues({}, domProps), {
|
|
6220
6312
|
style
|
|
6221
6313
|
}), children);
|
|
6222
6314
|
}
|
|
@@ -6263,7 +6355,7 @@ function useUnpinnedRendering(params) {
|
|
|
6263
6355
|
rowProps.repaintId = repaintId;
|
|
6264
6356
|
}
|
|
6265
6357
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
6266
|
-
return /* @__PURE__ */
|
|
6358
|
+
return /* @__PURE__ */ createElement26(TableRowComponent, __spreadValues({}, rowProps));
|
|
6267
6359
|
}, [
|
|
6268
6360
|
repaintId,
|
|
6269
6361
|
rowHeight,
|
|
@@ -6273,7 +6365,7 @@ function useUnpinnedRendering(params) {
|
|
|
6273
6365
|
horizontalVirtualBrain,
|
|
6274
6366
|
verticalVirtualBrain
|
|
6275
6367
|
]);
|
|
6276
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
6368
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ createElement26("div", {
|
|
6277
6369
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
6278
6370
|
style: {
|
|
6279
6371
|
position: "absolute",
|
|
@@ -6284,10 +6376,10 @@ function useUnpinnedRendering(params) {
|
|
|
6284
6376
|
overflow: "auto",
|
|
6285
6377
|
visibility: columnShifts ? "visible" : "hidden"
|
|
6286
6378
|
}
|
|
6287
|
-
}, /* @__PURE__ */
|
|
6379
|
+
}, /* @__PURE__ */ createElement26("div", {
|
|
6288
6380
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
6289
6381
|
})) : null;
|
|
6290
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
6382
|
+
return rowHeight != 0 ? /* @__PURE__ */ createElement26(VirtualRowList, {
|
|
6291
6383
|
repaintId: `${repaintId}-unpinned-`,
|
|
6292
6384
|
brain: verticalVirtualBrain,
|
|
6293
6385
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -6431,14 +6523,14 @@ var useOnContainerScroll = ({
|
|
|
6431
6523
|
|
|
6432
6524
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
6433
6525
|
import {
|
|
6434
|
-
createElement as
|
|
6435
|
-
useMemo as
|
|
6526
|
+
createElement as createElement28,
|
|
6527
|
+
useMemo as useMemo9
|
|
6436
6528
|
} from "react";
|
|
6437
6529
|
import { useCallback as useCallback15 } from "react";
|
|
6438
6530
|
|
|
6439
6531
|
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
6440
6532
|
import {
|
|
6441
|
-
createElement as
|
|
6533
|
+
createElement as createElement27
|
|
6442
6534
|
} from "react";
|
|
6443
6535
|
import { useEffect as useEffect20, useCallback as useCallback14, useRef as useRef16 } from "react";
|
|
6444
6536
|
|
|
@@ -6515,7 +6607,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
6515
6607
|
if (true) {
|
|
6516
6608
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
6517
6609
|
}
|
|
6518
|
-
return /* @__PURE__ */
|
|
6610
|
+
return /* @__PURE__ */ createElement27("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement27(RawList, {
|
|
6519
6611
|
brain,
|
|
6520
6612
|
renderItem,
|
|
6521
6613
|
repaintId
|
|
@@ -6538,7 +6630,7 @@ function PinnedRowsContainer(props) {
|
|
|
6538
6630
|
brain,
|
|
6539
6631
|
renderRow
|
|
6540
6632
|
} = props;
|
|
6541
|
-
const style =
|
|
6633
|
+
const style = useMemo9(() => {
|
|
6542
6634
|
const result = pinning === "end" ? {
|
|
6543
6635
|
width: rowWidth,
|
|
6544
6636
|
height,
|
|
@@ -6564,7 +6656,7 @@ function PinnedRowsContainer(props) {
|
|
|
6564
6656
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
6565
6657
|
};
|
|
6566
6658
|
if (hasOverflow) {
|
|
6567
|
-
return /* @__PURE__ */
|
|
6659
|
+
return /* @__PURE__ */ createElement28(VirtualScrollContainer, {
|
|
6568
6660
|
scrollable: {
|
|
6569
6661
|
horizontal: true,
|
|
6570
6662
|
vertical: false
|
|
@@ -6580,18 +6672,18 @@ function PinnedRowsContainer(props) {
|
|
|
6580
6672
|
className: join(PinnedRowsContainerClsVariants({
|
|
6581
6673
|
pinned: pinning
|
|
6582
6674
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
6583
|
-
}, /* @__PURE__ */
|
|
6675
|
+
}, /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
6584
6676
|
onMount: (node) => {
|
|
6585
6677
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
6586
6678
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
6587
6679
|
});
|
|
6588
6680
|
}
|
|
6589
|
-
})), /* @__PURE__ */
|
|
6681
|
+
})), /* @__PURE__ */ createElement28(SpacePlaceholder, {
|
|
6590
6682
|
width: rowWidth,
|
|
6591
6683
|
height: 1
|
|
6592
6684
|
}));
|
|
6593
6685
|
}
|
|
6594
|
-
return /* @__PURE__ */
|
|
6686
|
+
return /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
6595
6687
|
}
|
|
6596
6688
|
function useRenderPinnedRow(params) {
|
|
6597
6689
|
const { getData, getState, columnsWidth, columns, verticalBrain } = params;
|
|
@@ -6611,7 +6703,7 @@ function useRenderPinnedRow(params) {
|
|
|
6611
6703
|
rowWidth: columnsWidth,
|
|
6612
6704
|
columns
|
|
6613
6705
|
}, rowParams);
|
|
6614
|
-
return /* @__PURE__ */
|
|
6706
|
+
return /* @__PURE__ */ createElement28(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
6615
6707
|
}, [columnsWidth, columns, verticalBrain]);
|
|
6616
6708
|
return renderPinnedRow;
|
|
6617
6709
|
}
|
|
@@ -6654,7 +6746,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6654
6746
|
columns,
|
|
6655
6747
|
columnsWidth
|
|
6656
6748
|
});
|
|
6657
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
6749
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ createElement28(PinnedRowsContainer, {
|
|
6658
6750
|
pinning: side,
|
|
6659
6751
|
pinnedScrollListener,
|
|
6660
6752
|
hasOverflow,
|
|
@@ -6667,7 +6759,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6667
6759
|
brain: verticalVirtualBrain,
|
|
6668
6760
|
renderRow: renderRowPinned
|
|
6669
6761
|
}) : null;
|
|
6670
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
6762
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ createElement28(HorizontalScrollbarPlaceholder, {
|
|
6671
6763
|
style: side === "end" ? {
|
|
6672
6764
|
width: columnsWidth,
|
|
6673
6765
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -6712,9 +6804,9 @@ function usePinnedStartRendering(params) {
|
|
|
6712
6804
|
import { useEffect as useEffect21 } from "react";
|
|
6713
6805
|
|
|
6714
6806
|
// src/components/hooks/useOnce.ts
|
|
6715
|
-
import { useMemo as
|
|
6807
|
+
import { useMemo as useMemo10 } from "react";
|
|
6716
6808
|
function useOnce(fn) {
|
|
6717
|
-
const onceFn =
|
|
6809
|
+
const onceFn = useMemo10(() => {
|
|
6718
6810
|
return once(fn);
|
|
6719
6811
|
}, []);
|
|
6720
6812
|
return onceFn();
|
|
@@ -7236,7 +7328,8 @@ function useListRendering(param) {
|
|
|
7236
7328
|
computedUnpinnedColumnsWidth,
|
|
7237
7329
|
computedPinnedStartOverflow,
|
|
7238
7330
|
computedPinnedEndOverflow,
|
|
7239
|
-
computedVisibleColumns
|
|
7331
|
+
computedVisibleColumns,
|
|
7332
|
+
toggleGroupRow
|
|
7240
7333
|
} = computed;
|
|
7241
7334
|
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
7242
7335
|
const { dataArray } = dataSourceState;
|
|
@@ -7254,7 +7347,7 @@ function useListRendering(param) {
|
|
|
7254
7347
|
repaintIdRef.current++;
|
|
7255
7348
|
}
|
|
7256
7349
|
const repaintId = repaintIdRef.current;
|
|
7257
|
-
const rowSpan =
|
|
7350
|
+
const rowSpan = useMemo11(() => {
|
|
7258
7351
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
7259
7352
|
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
7260
7353
|
let maxSpan = 1;
|
|
@@ -7292,7 +7385,7 @@ function useListRendering(param) {
|
|
|
7292
7385
|
const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
|
|
7293
7386
|
const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
|
|
7294
7387
|
const hasVerticalScrollbar = bodySize.height > 0 && bodySize.height < reservedContentHeight;
|
|
7295
|
-
const scrollbars =
|
|
7388
|
+
const scrollbars = useMemo11(() => ({
|
|
7296
7389
|
vertical: hasVerticalScrollbar,
|
|
7297
7390
|
horizontal: hasHorizontalScrollbar
|
|
7298
7391
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
@@ -7320,12 +7413,6 @@ function useListRendering(param) {
|
|
|
7320
7413
|
horizontalVirtualBrain,
|
|
7321
7414
|
reservedContentHeight
|
|
7322
7415
|
});
|
|
7323
|
-
const { componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
7324
|
-
const toggleGroupRow = useCallback17((groupKeys) => {
|
|
7325
|
-
const newState = new GroupRowsState(getDataSourceState().groupRowsState);
|
|
7326
|
-
newState.toggleGroupRow(groupKeys);
|
|
7327
|
-
dataSourceActions.groupRowsState = newState;
|
|
7328
|
-
}, []);
|
|
7329
7416
|
const pinnedRenderingParams = {
|
|
7330
7417
|
bodySize,
|
|
7331
7418
|
scrollbars,
|
|
@@ -7380,9 +7467,9 @@ function useListRendering(param) {
|
|
|
7380
7467
|
|
|
7381
7468
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7382
7469
|
import {
|
|
7383
|
-
createElement as
|
|
7470
|
+
createElement as createElement29,
|
|
7384
7471
|
forwardRef as forwardRef3,
|
|
7385
|
-
useCallback as
|
|
7472
|
+
useCallback as useCallback17,
|
|
7386
7473
|
useRef as useRef18
|
|
7387
7474
|
} from "react";
|
|
7388
7475
|
import { useEffect as useEffect23 } from "react";
|
|
@@ -7423,7 +7510,7 @@ var enforceStyle = (node, style) => {
|
|
|
7423
7510
|
var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7424
7511
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
7425
7512
|
const domRef = useRef18(null);
|
|
7426
|
-
const domCallback =
|
|
7513
|
+
const domCallback = useCallback17((node) => {
|
|
7427
7514
|
domRef.current = node;
|
|
7428
7515
|
if (!ref) {
|
|
7429
7516
|
return;
|
|
@@ -7448,12 +7535,12 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
7448
7535
|
clearInterval(intervalId);
|
|
7449
7536
|
};
|
|
7450
7537
|
}, []);
|
|
7451
|
-
return /* @__PURE__ */
|
|
7538
|
+
return /* @__PURE__ */ createElement29("div", __spreadProps(__spreadValues({
|
|
7452
7539
|
ref: domCallback
|
|
7453
7540
|
}, props), {
|
|
7454
7541
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
7455
7542
|
style: defaultStyle2
|
|
7456
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7543
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement29("a", {
|
|
7457
7544
|
href: "https://infinite-table.com",
|
|
7458
7545
|
rel: "noopener noreferrer",
|
|
7459
7546
|
role: "link",
|
|
@@ -7462,7 +7549,7 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
7462
7549
|
});
|
|
7463
7550
|
|
|
7464
7551
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
7465
|
-
import { useMemo as
|
|
7552
|
+
import { useMemo as useMemo12 } from "react";
|
|
7466
7553
|
|
|
7467
7554
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
7468
7555
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -7612,10 +7699,10 @@ var origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
|
7612
7699
|
var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
|
|
7613
7700
|
var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
|
|
7614
7701
|
var useLicense = (licenseKey = "") => {
|
|
7615
|
-
const valid =
|
|
7702
|
+
const valid = useMemo12(() => {
|
|
7616
7703
|
let valid2 = isValidLicense(licenseKey, {
|
|
7617
7704
|
publishedAt: 1624970570587,
|
|
7618
|
-
version: "0.
|
|
7705
|
+
version: "0.2.2"
|
|
7619
7706
|
});
|
|
7620
7707
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
7621
7708
|
return true;
|
|
@@ -7627,8 +7714,8 @@ var useLicense = (licenseKey = "") => {
|
|
|
7627
7714
|
|
|
7628
7715
|
// src/components/CSSVariableWatch.tsx
|
|
7629
7716
|
import {
|
|
7630
|
-
createElement as
|
|
7631
|
-
useCallback as
|
|
7717
|
+
createElement as createElement30,
|
|
7718
|
+
useCallback as useCallback18,
|
|
7632
7719
|
useLayoutEffect as useLayoutEffect4
|
|
7633
7720
|
} from "react";
|
|
7634
7721
|
import { useRef as useRef19 } from "react";
|
|
@@ -7645,7 +7732,7 @@ var WRAPPER_STYLE = {
|
|
|
7645
7732
|
};
|
|
7646
7733
|
var useCSSVariableWatch = (params) => {
|
|
7647
7734
|
const lastValueRef = useRef19(0);
|
|
7648
|
-
const onResize =
|
|
7735
|
+
const onResize = useCallback18(({ height }) => {
|
|
7649
7736
|
if (height && height !== lastValueRef.current) {
|
|
7650
7737
|
lastValueRef.current = height;
|
|
7651
7738
|
params.onChange(height);
|
|
@@ -7668,11 +7755,11 @@ var CSSVariableWatch = (props) => {
|
|
|
7668
7755
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7669
7756
|
ref: domRef
|
|
7670
7757
|
}));
|
|
7671
|
-
return /* @__PURE__ */
|
|
7758
|
+
return /* @__PURE__ */ createElement30("div", {
|
|
7672
7759
|
"data-name": "css-variable-watcher",
|
|
7673
7760
|
"data-var": props.varName,
|
|
7674
7761
|
style: WRAPPER_STYLE
|
|
7675
|
-
}, /* @__PURE__ */
|
|
7762
|
+
}, /* @__PURE__ */ createElement30("div", {
|
|
7676
7763
|
ref: domRef,
|
|
7677
7764
|
style: {
|
|
7678
7765
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -7766,7 +7853,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
7766
7853
|
|
|
7767
7854
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7768
7855
|
import {
|
|
7769
|
-
createElement as
|
|
7856
|
+
createElement as createElement31,
|
|
7770
7857
|
memo as memo12
|
|
7771
7858
|
} from "react";
|
|
7772
7859
|
|
|
@@ -7780,11 +7867,11 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
7780
7867
|
var baseCls2 = `${rootClassName11}-LoadMask`;
|
|
7781
7868
|
function LoadMaskFn(props) {
|
|
7782
7869
|
const { visible, children = "Loading" } = props;
|
|
7783
|
-
return /* @__PURE__ */
|
|
7870
|
+
return /* @__PURE__ */ createElement31("div", {
|
|
7784
7871
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls2}`
|
|
7785
|
-
}, /* @__PURE__ */
|
|
7872
|
+
}, /* @__PURE__ */ createElement31("div", {
|
|
7786
7873
|
className: `${LoadMaskOverlayCls} ${baseCls2}-Overlay`
|
|
7787
|
-
}), /* @__PURE__ */
|
|
7874
|
+
}), /* @__PURE__ */ createElement31("div", {
|
|
7788
7875
|
className: `${LoadMaskTextCls} ${baseCls2}-Text`
|
|
7789
7876
|
}, children));
|
|
7790
7877
|
}
|
|
@@ -7817,7 +7904,8 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
7817
7904
|
} = useInfiniteTable();
|
|
7818
7905
|
const {
|
|
7819
7906
|
componentState: { dataArray, loading },
|
|
7820
|
-
getState: getDataSourceState
|
|
7907
|
+
getState: getDataSourceState,
|
|
7908
|
+
componentActions: dataSourceActions
|
|
7821
7909
|
} = useDataSourceContextValue();
|
|
7822
7910
|
const {
|
|
7823
7911
|
domRef,
|
|
@@ -7830,7 +7918,8 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
7830
7918
|
onHeaderHeightCSSVarChange,
|
|
7831
7919
|
rowHeightCSSVar,
|
|
7832
7920
|
headerHeightCSSVar,
|
|
7833
|
-
components
|
|
7921
|
+
components,
|
|
7922
|
+
scrollStopDelay
|
|
7834
7923
|
} = componentState;
|
|
7835
7924
|
const { columnShifts, bodySize } = componentState;
|
|
7836
7925
|
const {
|
|
@@ -7843,6 +7932,7 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
7843
7932
|
scrollbars,
|
|
7844
7933
|
applyScrollVertical,
|
|
7845
7934
|
horizontalVirtualBrain,
|
|
7935
|
+
verticalVirtualBrain,
|
|
7846
7936
|
reservedContentHeight
|
|
7847
7937
|
} = useListRendering({
|
|
7848
7938
|
getComputed,
|
|
@@ -7851,6 +7941,13 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
7851
7941
|
bodySize,
|
|
7852
7942
|
computed
|
|
7853
7943
|
});
|
|
7944
|
+
useEffect24(() => {
|
|
7945
|
+
const dataSourceState = getDataSourceState();
|
|
7946
|
+
const onChange = debounce((renderRange) => {
|
|
7947
|
+
dataSourceState.notifyRenderRangeChange(renderRange);
|
|
7948
|
+
}, { wait: scrollStopDelay });
|
|
7949
|
+
return verticalVirtualBrain.onRenderRangeChange(onChange);
|
|
7950
|
+
}, [verticalVirtualBrain, scrollStopDelay]);
|
|
7854
7951
|
const licenseValid = useLicense(licenseKey);
|
|
7855
7952
|
const domProps = useDOMProps(componentState.domProps);
|
|
7856
7953
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
@@ -7863,31 +7960,34 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
|
|
|
7863
7960
|
}
|
|
7864
7961
|
notifyScrollbarsChange(scrollbars);
|
|
7865
7962
|
}, [scrollbars]);
|
|
7866
|
-
|
|
7963
|
+
useEffect24(() => {
|
|
7964
|
+
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
7965
|
+
}, [scrollStopDelay]);
|
|
7966
|
+
return /* @__PURE__ */ createElement32("div", __spreadValues({
|
|
7867
7967
|
ref: domRef
|
|
7868
|
-
}, domProps), header ? /* @__PURE__ */
|
|
7968
|
+
}, domProps), header ? /* @__PURE__ */ createElement32(TableHeaderWrapper, {
|
|
7869
7969
|
brain: horizontalVirtualBrain,
|
|
7870
7970
|
repaintId,
|
|
7871
7971
|
scrollbars
|
|
7872
|
-
}) : null, /* @__PURE__ */
|
|
7972
|
+
}) : null, /* @__PURE__ */ createElement32(InfiniteTableBody, null, /* @__PURE__ */ createElement32(VirtualScrollContainer, {
|
|
7873
7973
|
ref: scrollerDOMRef,
|
|
7874
7974
|
onContainerScroll: applyScrollVertical,
|
|
7875
7975
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
7876
|
-
}, /* @__PURE__ */
|
|
7976
|
+
}, /* @__PURE__ */ createElement32("div", {
|
|
7877
7977
|
className: display.flex
|
|
7878
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
7978
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ createElement32(SpacePlaceholder, {
|
|
7879
7979
|
count: dataArray.length,
|
|
7880
7980
|
width: 0,
|
|
7881
7981
|
height: reservedContentHeight
|
|
7882
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
7982
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ createElement32(LoadMaskCmp, {
|
|
7883
7983
|
visible: loading
|
|
7884
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
7984
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ createElement32(InfiniteTableLicenseFooter, null), /* @__PURE__ */ createElement32("div", {
|
|
7885
7985
|
ref: portalDOMRef,
|
|
7886
7986
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
7887
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
7987
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ createElement32(CSSVariableWatch, {
|
|
7888
7988
|
varName: rowHeightCSSVar,
|
|
7889
7989
|
onChange: onRowHeightCSSVarChange
|
|
7890
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
7990
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ createElement32(CSSVariableWatch, {
|
|
7891
7991
|
varName: headerHeightCSSVar,
|
|
7892
7992
|
onChange: onHeaderHeightCSSVarChange
|
|
7893
7993
|
}) : null);
|
|
@@ -7935,13 +8035,13 @@ function InfiniteTableContextProvider() {
|
|
|
7935
8035
|
}
|
|
7936
8036
|
}, [scrollTopId, scrollerDOMRef]);
|
|
7937
8037
|
const TableContext2 = getInfiniteTableContext();
|
|
7938
|
-
return /* @__PURE__ */
|
|
8038
|
+
return /* @__PURE__ */ createElement32(TableContext2.Provider, {
|
|
7939
8039
|
value: contextValue
|
|
7940
|
-
}, /* @__PURE__ */
|
|
8040
|
+
}, /* @__PURE__ */ createElement32(InfiniteTableComponent, null));
|
|
7941
8041
|
}
|
|
7942
8042
|
function InfiniteTable(props) {
|
|
7943
|
-
const table = /* @__PURE__ */
|
|
7944
|
-
return /* @__PURE__ */
|
|
8043
|
+
const table = /* @__PURE__ */ createElement32(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement32(InfiniteTableContextProvider, null));
|
|
8044
|
+
return /* @__PURE__ */ createElement32(StrictMode, null, table);
|
|
7945
8045
|
}
|
|
7946
8046
|
InfiniteTable.defaultProps = {
|
|
7947
8047
|
rowHeight: 40,
|