@infinite-table/infinite-react 0.1.4 → 0.2.3

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.
Files changed (4) hide show
  1. package/index.d.ts +142 -130
  2. package/index.esm.js +471 -349
  3. package/index.js +476 -352
  4. package/package.json +2 -2
package/index.js CHANGED
@@ -640,7 +640,7 @@ __export(exports, {
640
640
  });
641
641
 
642
642
  // src/components/InfiniteTable/index.tsx
643
- var React35 = __toModule(require("react"));
643
+ var React34 = __toModule(require("react"));
644
644
 
645
645
  // src/components/InfiniteTable/internalProps.ts
646
646
  var rootClassName = "Infinite";
@@ -785,7 +785,6 @@ function initSetupState() {
785
785
  draggingColumnId: null,
786
786
  pinnedStartScrollListener: new ScrollListener(),
787
787
  pinnedEndScrollListener: new ScrollListener(),
788
- computedPivotColumns: void 0,
789
788
  columnsWhenInlineGroupRenderStrategy: void 0
790
789
  };
791
790
  }
@@ -816,7 +815,6 @@ var forwardProps = (setupState) => {
816
815
  pinnedStartMaxWidth: 1,
817
816
  pinnedEndMaxWidth: 1,
818
817
  pivotColumn: 1,
819
- pivotRowLabelsColumn: 1,
820
818
  pivotColumnGroups: 1,
821
819
  onScrollbarsChange: 1,
822
820
  scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 100,
@@ -873,7 +871,7 @@ var mapPropsToState = (params) => {
873
871
  groupBy,
874
872
  groupColumn: props.groupColumn
875
873
  });
876
- const computedColumns = state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
874
+ const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
877
875
  return {
878
876
  groupRenderStrategy,
879
877
  groupBy,
@@ -2044,7 +2042,7 @@ function useColumnGroups() {
2044
2042
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
2045
2043
  var import_react17 = __toModule(require("react"));
2046
2044
 
2047
- // src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
2045
+ // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
2048
2046
  var React6 = __toModule(require("react"));
2049
2047
 
2050
2048
  // src/utils/join.ts
@@ -2115,91 +2113,15 @@ var userSelect = { none: "_16lm1iwm" };
2115
2113
  var willChange = { transform: "_16lm1iw19" };
2116
2114
  var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
2117
2115
 
2118
- // src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
2119
- function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
2120
- if (!pivotColumns) {
2121
- return void 0;
2122
- }
2123
- const {
2124
- pivotColumn,
2125
- pivotRowLabelsColumn,
2126
- pivotBy,
2127
- groupBy,
2128
- pivotTotalColumnPosition,
2129
- toggleGroupRow
2130
- } = params;
2131
- const computedPivotColumns = new Map();
2132
- pivotColumns.forEach((col, key) => {
2133
- if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
2134
- return;
2135
- }
2136
- let column = __spreadValues({}, col);
2137
- const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
2138
- if (!isPivotRowLabelsColumn) {
2139
- if (pivotColumn) {
2140
- if (typeof pivotColumn === "function") {
2141
- column = __spreadValues(__spreadValues({}, column), pivotColumn({
2142
- column,
2143
- pivotBy,
2144
- groupBy
2145
- }));
2146
- } else {
2147
- column = __spreadValues(__spreadValues({}, column), pivotColumn);
2148
- }
2149
- }
2150
- } else {
2151
- if (pivotRowLabelsColumn) {
2152
- if (typeof pivotRowLabelsColumn === "function") {
2153
- column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
2154
- column,
2155
- pivotBy,
2156
- groupBy
2157
- }));
2158
- } else {
2159
- column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
2160
- }
2161
- }
2162
- if (!column.render) {
2163
- column.render = (renderOptions) => {
2164
- var _a;
2165
- let { value, rowInfo, column: column2, groupBy: groupBy2 } = renderOptions;
2166
- if (column2.renderValue) {
2167
- value = column2.renderValue(renderOptions);
2168
- }
2169
- const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupBy2.length;
2170
- return /* @__PURE__ */ React6.createElement("div", {
2171
- className: join(display.flex, alignItems.center, GroupRowExpanderCls)
2172
- }, showExpanderIcon ? /* @__PURE__ */ React6.createElement(ExpanderIcon, {
2173
- expanded: !rowInfo.collapsed,
2174
- onChange: () => {
2175
- toggleGroupRow(rowInfo.groupKeys);
2176
- }
2177
- }) : null, /* @__PURE__ */ React6.createElement("div", {
2178
- className: cssEllipsisClassName
2179
- }, value != null ? value : null));
2180
- };
2181
- }
2182
- }
2183
- if (!column.render && column.renderValue) {
2184
- column.render = (renderOptions) => {
2185
- return column.renderValue(renderOptions);
2186
- };
2187
- }
2188
- computedPivotColumns.set(key, column);
2189
- });
2190
- return computedPivotColumns;
2191
- }
2192
-
2193
2116
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
2194
- var React7 = __toModule(require("react"));
2195
2117
  function getGroupColumnRender({
2196
2118
  groupIndexForColumn,
2197
2119
  groupRenderStrategy,
2198
2120
  toggleGroupRow
2199
2121
  }) {
2200
2122
  return (renderOptions) => {
2201
- var _a;
2202
- let { value, rowInfo, column } = renderOptions;
2123
+ var _a, _b, _c;
2124
+ let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
2203
2125
  if (column.renderValue) {
2204
2126
  value = column.renderValue(renderOptions);
2205
2127
  }
@@ -2224,14 +2146,20 @@ function getGroupColumnRender({
2224
2146
  return null;
2225
2147
  }
2226
2148
  }
2227
- return /* @__PURE__ */ React7.createElement("div", {
2149
+ let icon = null;
2150
+ 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);
2151
+ if (showExpanderIcon) {
2152
+ const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
2153
+ expanded: !collapsed,
2154
+ onChange: () => {
2155
+ toggleGroupRow(groupKeys);
2156
+ }
2157
+ });
2158
+ icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
2159
+ }
2160
+ return /* @__PURE__ */ React6.createElement("div", {
2228
2161
  className: join(display.flex, alignItems.center)
2229
- }, /* @__PURE__ */ React7.createElement(ExpanderIcon, {
2230
- expanded: !collapsed,
2231
- onChange: () => {
2232
- toggleGroupRow(groupKeys);
2233
- }
2234
- }), /* @__PURE__ */ React7.createElement("div", {
2162
+ }, icon, /* @__PURE__ */ React6.createElement("div", {
2235
2163
  className: cssEllipsisClassName
2236
2164
  }, value != null ? value : null));
2237
2165
  };
@@ -2267,21 +2195,29 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
2267
2195
  groupByField: options.groupBy.map((g) => g.field),
2268
2196
  sortable: false,
2269
2197
  render: (renderOptions) => {
2270
- let { value, rowInfo, column } = renderOptions;
2198
+ var _a, _b;
2199
+ let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
2271
2200
  if (!rowInfo.isGroupRow) {
2272
2201
  return null;
2273
2202
  }
2274
2203
  if (column.renderValue) {
2275
2204
  value = column.renderValue(renderOptions);
2276
2205
  }
2277
- return /* @__PURE__ */ React7.createElement("div", {
2206
+ const collapsed = rowInfo.collapsed;
2207
+ let icon = null;
2208
+ 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);
2209
+ if (showExpanderIcon) {
2210
+ const defaultIcon = /* @__PURE__ */ React6.createElement(ExpanderIcon, {
2211
+ expanded: !collapsed,
2212
+ onChange: () => {
2213
+ toggleGroupRow(rowInfo.groupKeys);
2214
+ }
2215
+ });
2216
+ icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
2217
+ }
2218
+ return /* @__PURE__ */ React6.createElement("div", {
2278
2219
  className: join(display.flex, alignItems.center, GroupRowExpanderCls)
2279
- }, /* @__PURE__ */ React7.createElement(ExpanderIcon, {
2280
- expanded: !rowInfo.collapsed,
2281
- onChange: () => {
2282
- toggleGroupRow(rowInfo.groupKeys);
2283
- }
2284
- }), /* @__PURE__ */ React7.createElement("div", {
2220
+ }, icon, /* @__PURE__ */ React6.createElement("div", {
2285
2221
  className: cssEllipsisClassName
2286
2222
  }, value != null ? value : null));
2287
2223
  }
@@ -2300,7 +2236,7 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
2300
2236
  var import_react16 = __toModule(require("react"));
2301
2237
 
2302
2238
  // src/components/DataSource/index.tsx
2303
- var React8 = __toModule(require("react"));
2239
+ var React7 = __toModule(require("react"));
2304
2240
 
2305
2241
  // src/utils/multisort/sortTypes.ts
2306
2242
  var numberComparator = function(first, second) {
@@ -2648,6 +2584,7 @@ var DeepMap = class {
2648
2584
 
2649
2585
  // src/utils/groupAndPivot/index.ts
2650
2586
  var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
2587
+ var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
2651
2588
  function DEFAULT_TO_KEY(value) {
2652
2589
  return value;
2653
2590
  }
@@ -2711,13 +2648,23 @@ function lazyGroup(groupParams, rootData) {
2711
2648
  rootData.visitDepthFirst((lazyGroupRowInfo, keys, _index, next) => {
2712
2649
  const [_rootKey, ...currentGroupKeys] = keys;
2713
2650
  const dataArray = lazyGroupRowInfo.items;
2651
+ if (currentGroupKeys.length == groupBy.length) {
2652
+ const deepMapGroupValue = deepMap.get(currentGroupKeys);
2653
+ if (deepMapGroupValue) {
2654
+ deepMapGroupValue.items = dataArray;
2655
+ }
2656
+ return next == null ? void 0 : next();
2657
+ }
2714
2658
  for (let i = 0, len = dataArray.length; i < len; i++) {
2715
2659
  if (!dataArray[i]) {
2716
2660
  const deepMapGroupValue2 = {
2717
2661
  items: [],
2718
2662
  reducerResults: {}
2719
2663
  };
2720
- deepMap.set([...currentGroupKeys, `not-loaded-yet-${i}`], deepMapGroupValue2);
2664
+ deepMap.set([
2665
+ ...currentGroupKeys,
2666
+ `${NOT_LOADED_YET_KEY_PREFIX}${i}`
2667
+ ], deepMapGroupValue2);
2721
2668
  continue;
2722
2669
  }
2723
2670
  const dataObject = dataArray[i].data;
@@ -2728,6 +2675,7 @@ function lazyGroup(groupParams, rootData) {
2728
2675
  currentGroupKeys.push(key);
2729
2676
  const deepMapGroupValue = {
2730
2677
  items: [],
2678
+ commonData: dataObject,
2731
2679
  reducerResults: dataArray[i].aggregations || {}
2732
2680
  };
2733
2681
  deepMap.set(currentGroupKeys, deepMapGroupValue);
@@ -2863,10 +2811,15 @@ function flatten(groupResult) {
2863
2811
  function getEnhancedGroupData(options, deepMapValue) {
2864
2812
  const { groupBy, groupKeys, collapsed, parents, reducers } = options;
2865
2813
  const groupNesting = groupKeys.length;
2866
- const { items: groupItems, reducerResults, pivotDeepMap } = deepMapValue;
2814
+ const {
2815
+ items: groupItems,
2816
+ reducerResults,
2817
+ pivotDeepMap,
2818
+ commonData
2819
+ } = deepMapValue;
2867
2820
  let data = null;
2868
2821
  if (Object.keys(reducerResults).length > 0) {
2869
- data = {};
2822
+ data = commonData || {};
2870
2823
  for (let key in reducers)
2871
2824
  if (reducers.hasOwnProperty(key)) {
2872
2825
  const reducer = reducers[key];
@@ -2876,12 +2829,16 @@ function getEnhancedGroupData(options, deepMapValue) {
2876
2829
  }
2877
2830
  }
2878
2831
  }
2832
+ let theValue = groupKeys[groupKeys.length - 1];
2833
+ if (typeof theValue === "string" && theValue.startsWith(NOT_LOADED_YET_KEY_PREFIX)) {
2834
+ theValue = null;
2835
+ }
2879
2836
  const enhancedGroupData = {
2880
2837
  data,
2881
2838
  groupCount: groupItems.length,
2882
2839
  groupData: groupItems,
2883
2840
  groupKeys,
2884
- id: groupKeys,
2841
+ id: `${groupKeys}`,
2885
2842
  collapsed,
2886
2843
  parents,
2887
2844
  collapsedChildrenCount: 0,
@@ -2889,8 +2846,9 @@ function getEnhancedGroupData(options, deepMapValue) {
2889
2846
  indexInParentGroups: options.indexInParentGroups,
2890
2847
  indexInGroup: options.indexInGroup,
2891
2848
  indexInAll: options.indexInAll,
2892
- value: groupKeys[groupKeys.length - 1],
2893
- groupBy: groupBy.slice(0, groupNesting),
2849
+ value: theValue,
2850
+ rootGroupBy: groupBy,
2851
+ groupBy: groupNesting === groupBy.length ? groupBy : groupBy.slice(0, groupNesting),
2894
2852
  isGroupRow: true,
2895
2853
  pivotValuesMap: pivotDeepMap,
2896
2854
  groupNesting,
@@ -2957,7 +2915,7 @@ function enhancedFlatten(param) {
2957
2915
  const startIndex = result.length;
2958
2916
  result.push(...items.map((item, index) => {
2959
2917
  return {
2960
- id: toPrimaryKey(item),
2918
+ id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
2961
2919
  data: item,
2962
2920
  isGroupRow: false,
2963
2921
  collapsed: false,
@@ -3012,11 +2970,33 @@ function useEffectWithChanges(fn, deps) {
3012
2970
  }, useEffectDeps);
3013
2971
  }
3014
2972
 
2973
+ // src/components/utils/debounce.ts
2974
+ function debounce(fn, { wait }) {
2975
+ let timeout = null;
2976
+ return function(...args) {
2977
+ const context = this;
2978
+ if (timeout !== null) {
2979
+ clearTimeout(timeout);
2980
+ }
2981
+ timeout = setTimeout(() => {
2982
+ fn.apply(context, args);
2983
+ }, wait);
2984
+ };
2985
+ }
2986
+
3015
2987
  // src/components/DataSource/privateHooks/useLoadData.ts
2988
+ var getRafPromise = () => new Promise((resolve) => {
2989
+ requestAnimationFrame(resolve);
2990
+ });
3016
2991
  var SKIP_DATA_CHANGES_KEYS = {
3017
2992
  originalDataArray: true,
3018
2993
  changes: true
3019
2994
  };
2995
+ function getChangeDetect() {
2996
+ var _a;
2997
+ const perfNow = (_a = getGlobal().performance) == null ? void 0 : _a.now();
2998
+ return `${Date.now()}:${perfNow}`;
2999
+ }
3020
3000
  function buildDataSourceDataParams(componentState, overrides) {
3021
3001
  var _a, _b;
3022
3002
  const sortInfo = componentState.multiSort ? componentState.sortInfo : (_b = (_a = componentState.sortInfo) == null ? void 0 : _a[0]) != null ? _b : null;
@@ -3056,15 +3036,34 @@ function buildDataSourceDataParams(componentState, overrides) {
3056
3036
  }
3057
3037
  function loadData(data, componentState, actions, overrides) {
3058
3038
  const dataParams = buildDataSourceDataParams(componentState, overrides);
3039
+ if (componentState.fullLazyLoad && dataParams.groupKeys) {
3040
+ const lazyGroupData = componentState.originalLazyGroupData;
3041
+ const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys];
3042
+ const existingGroupRowInfo = lazyGroupData.get(key);
3043
+ if (existingGroupRowInfo && existingGroupRowInfo.cache) {
3044
+ const items = existingGroupRowInfo.items;
3045
+ const len = items.length;
3046
+ let allLoaded = true;
3047
+ for (let i = 0; i < len; i++) {
3048
+ if (items[i] == null) {
3049
+ allLoaded = false;
3050
+ break;
3051
+ }
3052
+ }
3053
+ if (allLoaded) {
3054
+ return Promise.resolve(true);
3055
+ }
3056
+ }
3057
+ }
3059
3058
  if (typeof data === "function") {
3060
3059
  data = data(dataParams);
3061
3060
  }
3062
3061
  const dataIsPromise = typeof data === "object" && typeof data.then === "function";
3063
- if (dataIsPromise) {
3062
+ if (dataIsPromise && !componentState.fullLazyLoad) {
3064
3063
  actions.loading = true;
3065
3064
  }
3066
- Promise.resolve(data).then((dataParam) => {
3067
- var _a, _b, _c;
3065
+ return Promise.resolve(data).then((dataParam) => {
3066
+ var _a, _b, _c, _d;
3068
3067
  let dataArray = [];
3069
3068
  let skipAssign = false;
3070
3069
  if (Array.isArray(dataParam.data)) {
@@ -3077,9 +3076,10 @@ function loadData(data, componentState, actions, overrides) {
3077
3076
  actions.pivotMappings = remoteData.mappings;
3078
3077
  }
3079
3078
  if (componentState.fullLazyLoad && dataParams.groupKeys) {
3080
- const lazyGroupData = DeepMap.clone(componentState.originalLazyGroupData);
3079
+ const lazyGroupData = componentState.originalLazyGroupData;
3081
3080
  const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys];
3082
3081
  const newGroupRowInfo = {
3082
+ cache: !!remoteData.cache,
3083
3083
  totalCount: (_a = remoteData.totalCount) != null ? _a : dataArray.length,
3084
3084
  items: dataArray
3085
3085
  };
@@ -3087,11 +3087,15 @@ function loadData(data, componentState, actions, overrides) {
3087
3087
  const existingGroupRowInfo = lazyGroupData.get(key);
3088
3088
  const currentGroupRowInfo = existingGroupRowInfo != null ? existingGroupRowInfo : {
3089
3089
  items: [],
3090
- totalCount: newGroupRowInfo.totalCount
3090
+ totalCount: newGroupRowInfo.totalCount,
3091
+ cache: (_b = newGroupRowInfo.cache) != null ? _b : true
3091
3092
  };
3093
+ if (existingGroupRowInfo) {
3094
+ existingGroupRowInfo.cache = newGroupRowInfo.cache;
3095
+ }
3092
3096
  currentGroupRowInfo.items.length = currentGroupRowInfo.totalCount;
3093
- const start = (_b = dataParams.lazyLoadStartIndex) != null ? _b : 0;
3094
- const end = start + ((_c = dataParams.lazyLoadBatchSize) != null ? _c : dataArray.length);
3097
+ const start = (_c = dataParams.lazyLoadStartIndex) != null ? _c : 0;
3098
+ const end = Math.min((_d = remoteData.totalCount) != null ? _d : start + dataParams.lazyLoadBatchSize);
3095
3099
  for (let i = start; i < end; i++) {
3096
3100
  currentGroupRowInfo.items[i] = newGroupRowInfo.items[i - start];
3097
3101
  }
@@ -3102,7 +3106,7 @@ function loadData(data, componentState, actions, overrides) {
3102
3106
  lazyGroupData.set(key, newGroupRowInfo);
3103
3107
  }
3104
3108
  skipAssign = true;
3105
- actions.originalLazyGroupData = lazyGroupData;
3109
+ actions.originalLazyGroupDataChangeDetect = getChangeDetect();
3106
3110
  }
3107
3111
  } else {
3108
3112
  dataArray = dataParam;
@@ -3110,7 +3114,7 @@ function loadData(data, componentState, actions, overrides) {
3110
3114
  if (!skipAssign) {
3111
3115
  actions.originalDataArray = dataArray;
3112
3116
  }
3113
- if (dataIsPromise) {
3117
+ if (dataIsPromise && !componentState.fullLazyLoad) {
3114
3118
  actions.loading = false;
3115
3119
  }
3116
3120
  });
@@ -3129,9 +3133,7 @@ function useLoadData() {
3129
3133
  pivotBy,
3130
3134
  livePagination,
3131
3135
  livePaginationCursor,
3132
- cursorId: stateCursorId,
3133
- lazyLoadBatchSize,
3134
- notifyScrollStop
3136
+ cursorId: stateCursorId
3135
3137
  } = componentState;
3136
3138
  const [scrollbars, setScrollbars] = (0, import_react15.useState)({
3137
3139
  vertical: false,
@@ -3172,33 +3174,7 @@ function useLoadData() {
3172
3174
  cursorId: livePagination ? stateCursorId : null
3173
3175
  };
3174
3176
  const initialRef = (0, import_react15.useRef)(true);
3175
- (0, import_react15.useEffect)(() => {
3176
- if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
3177
- return notifyScrollStop.onChange((param) => {
3178
- console.log("scroll stop", param);
3179
- if (!param) {
3180
- return;
3181
- }
3182
- const componentState2 = getComponentState();
3183
- const {
3184
- firstVisibleRowIndex: startIndex,
3185
- lastVisibleRowIndex: endIndex
3186
- } = param;
3187
- const firstBatchStart = Math.floor(startIndex / lazyLoadBatchSize) * lazyLoadBatchSize;
3188
- const lastBatchStart = Math.floor(endIndex / lazyLoadBatchSize) * lazyLoadBatchSize;
3189
- const isRowLoaded = (index) => componentState2.dataArray[index].data != null;
3190
- for (let batchStartIndex = firstBatchStart; batchStartIndex <= lastBatchStart; batchStartIndex = batchStartIndex + lazyLoadBatchSize) {
3191
- if (!isRowLoaded(batchStartIndex)) {
3192
- loadData(componentState2.data, componentState2, actions, {
3193
- lazyLoadBatchSize,
3194
- lazyLoadStartIndex: batchStartIndex
3195
- });
3196
- }
3197
- }
3198
- });
3199
- }
3200
- return;
3201
- }, [lazyLoadBatchSize]);
3177
+ useLazyLoadRange();
3202
3178
  useEffectWithChanges(() => {
3203
3179
  const componentState2 = getComponentState();
3204
3180
  if (typeof componentState2.data !== "function") {
@@ -3219,6 +3195,126 @@ function useLoadData() {
3219
3195
  }
3220
3196
  }, depsObject);
3221
3197
  }
3198
+ function useLazyLoadRange() {
3199
+ const {
3200
+ getComponentState,
3201
+ componentActions: actions,
3202
+ componentState
3203
+ } = useComponentState();
3204
+ const loadingCache = (0, import_react15.useMemo)(() => {
3205
+ return new Map();
3206
+ }, [componentState.data]);
3207
+ globalThis.loadingCache = loadingCache;
3208
+ const {
3209
+ lazyLoadBatchSize,
3210
+ notifyRenderRangeChange,
3211
+ dataArray,
3212
+ scrollStopDelayUpdatedByTable
3213
+ } = componentState;
3214
+ const latestRenderRangeRef = (0, import_react15.useRef)(null);
3215
+ const loadRange = (param, cache = loadingCache) => {
3216
+ const componentState2 = getComponentState();
3217
+ param = param || latestRenderRangeRef.current;
3218
+ if (!param) {
3219
+ return;
3220
+ }
3221
+ const { renderStartIndex: startIndex, renderEndIndex: endIndex } = param;
3222
+ if (!lazyLoadBatchSize || lazyLoadBatchSize <= 0) {
3223
+ return;
3224
+ }
3225
+ lazyLoadRange({
3226
+ startIndex,
3227
+ endIndex,
3228
+ lazyLoadBatchSize,
3229
+ componentState: componentState2,
3230
+ componentActions: actions
3231
+ }, cache);
3232
+ };
3233
+ const debouncedLoadRange = (0, import_react15.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
3234
+ (0, import_react15.useEffect)(() => {
3235
+ if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
3236
+ return notifyRenderRangeChange.onChange((param) => {
3237
+ latestRenderRangeRef.current = param;
3238
+ loadRange(param, loadingCache);
3239
+ });
3240
+ }
3241
+ return;
3242
+ }, [lazyLoadBatchSize, loadingCache]);
3243
+ (0, import_react15.useEffect)(() => {
3244
+ if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
3245
+ debouncedLoadRange();
3246
+ }
3247
+ return;
3248
+ }, [dataArray]);
3249
+ }
3250
+ function lazyLoadRange(options, cache) {
3251
+ const {
3252
+ startIndex,
3253
+ endIndex,
3254
+ lazyLoadBatchSize,
3255
+ componentState,
3256
+ componentActions
3257
+ } = options;
3258
+ const { dataArray } = componentState;
3259
+ const isRowLoaded = (index) => dataArray[index].data != null;
3260
+ const perGroupFnCalls = new DeepMap();
3261
+ const rootGroupKeys = ["_______xxx______"];
3262
+ for (let i = startIndex; i <= endIndex; i++) {
3263
+ const rowInfo = dataArray[i];
3264
+ if (!rowInfo) {
3265
+ continue;
3266
+ }
3267
+ const rowLoaded = rowInfo.data != null;
3268
+ const theGroupKeys = rowInfo.groupKeys ? [...rowInfo.groupKeys] : [];
3269
+ if (rowInfo.groupKeys && rowInfo.isGroupRow) {
3270
+ theGroupKeys.pop();
3271
+ }
3272
+ const cacheKeys = theGroupKeys.length ? theGroupKeys : rootGroupKeys;
3273
+ const indexInGroup = rowInfo.indexInGroup;
3274
+ if (!rowLoaded) {
3275
+ let fnCalls = perGroupFnCalls.get(cacheKeys);
3276
+ const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
3277
+ const offset = rowInfo.indexInGroup - batchStartIndexInGroup;
3278
+ const absoluteIndexOfBatchStart = dataArray[rowInfo.indexInAll - offset].indexInAll;
3279
+ const batchStartRowLoaded = isRowLoaded(absoluteIndexOfBatchStart);
3280
+ const batchStartRowId = dataArray[absoluteIndexOfBatchStart].id;
3281
+ if (batchStartRowLoaded || (fnCalls == null ? void 0 : fnCalls[batchStartRowId])) {
3282
+ continue;
3283
+ }
3284
+ const shouldSetFnCalls = !fnCalls;
3285
+ fnCalls = fnCalls || {};
3286
+ const currentFnCall = {
3287
+ lazyLoadStartIndex: batchStartIndexInGroup,
3288
+ lazyLoadBatchSize,
3289
+ groupKeys: theGroupKeys
3290
+ };
3291
+ if (!fnCalls[batchStartRowId]) {
3292
+ fnCalls[batchStartRowId] = currentFnCall;
3293
+ }
3294
+ if (shouldSetFnCalls) {
3295
+ perGroupFnCalls.set(cacheKeys, fnCalls);
3296
+ }
3297
+ }
3298
+ }
3299
+ let initialPromise = Promise.resolve(true);
3300
+ const allFnCalls = [];
3301
+ perGroupFnCalls.topDownValues().forEach((record) => {
3302
+ allFnCalls.push(...Object.values(record));
3303
+ });
3304
+ allFnCalls.reduce((promise, fnCall) => {
3305
+ const cacheKey = `${fnCall.groupKeys.join("-")}:${fnCall.lazyLoadStartIndex}`;
3306
+ if (cache && cache.has(cacheKey)) {
3307
+ return promise;
3308
+ }
3309
+ cache == null ? void 0 : cache.set(cacheKey, true);
3310
+ const args = [componentState.data, componentState, componentActions, fnCall];
3311
+ return promise.then(() => getRafPromise()).then(() => loadData(...args)).then(() => {
3312
+ requestAnimationFrame(() => {
3313
+ cache == null ? void 0 : cache.delete(cacheKey);
3314
+ });
3315
+ });
3316
+ }, initialPromise);
3317
+ }
3222
3318
 
3223
3319
  // src/components/DataSource/state/normalizeSortInfo.ts
3224
3320
  var EMPTY_ARRAY = Object.freeze([]);
@@ -3418,8 +3514,11 @@ function initSetupState2() {
3418
3514
  dataParams: void 0,
3419
3515
  notifyScrollbarsChange: buildSubscriptionCallback(),
3420
3516
  notifyScrollStop: buildSubscriptionCallback(),
3517
+ notifyRenderRangeChange: buildSubscriptionCallback(),
3421
3518
  pivotTotalColumnPosition: "end",
3519
+ scrollStopDelayUpdatedByTable: 100,
3422
3520
  originalLazyGroupData,
3521
+ originalLazyGroupDataChangeDetect: 0,
3423
3522
  originalDataArray,
3424
3523
  cursorId: defaultCursorId,
3425
3524
  showSeparatePivotColumnForSingleAggregation: false,
@@ -3604,23 +3703,7 @@ function getPivotColumnsAndColumnGroups({
3604
3703
  const aggregationReducers = Object.keys(reducers).map((key) => {
3605
3704
  return __spreadProps(__spreadValues({}, reducers[key]), { id: key });
3606
3705
  });
3607
- const columns = new Map([
3608
- [
3609
- "labels",
3610
- {
3611
- header: "Row labels",
3612
- pivotBy,
3613
- valueGetter: (params) => {
3614
- var _a;
3615
- const { rowInfo } = params;
3616
- if (!rowInfo.data) {
3617
- return "Loading ... TODO replace this with a loading indicator";
3618
- }
3619
- return rowInfo.groupKeys ? rowInfo.groupKeys[((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) - 1] : null;
3620
- }
3621
- }
3622
- ]
3623
- ]);
3706
+ const columns = new Map([]);
3624
3707
  const columnGroups = new Map();
3625
3708
  const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
3626
3709
  deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
@@ -3792,6 +3875,7 @@ function concludeReducer(params) {
3792
3875
  "generateGroupRows",
3793
3876
  "originalDataArray",
3794
3877
  "originalLazyGroupData",
3878
+ "originalLazyGroupDataChangeDetect",
3795
3879
  "groupBy",
3796
3880
  "groupRowsState",
3797
3881
  "pivotBy",
@@ -3812,7 +3896,11 @@ function concludeReducer(params) {
3812
3896
  state.postSortDataArray = dataArray;
3813
3897
  state.groupDeepMap = void 0;
3814
3898
  const toPrimaryKey = (data) => {
3815
- return data[state.primaryKey];
3899
+ const pk = data[state.primaryKey];
3900
+ if (Array.isArray(pk)) {
3901
+ debugger;
3902
+ }
3903
+ return pk;
3816
3904
  };
3817
3905
  if (shouldGroup) {
3818
3906
  if (shouldGroupAgain) {
@@ -3854,7 +3942,7 @@ function concludeReducer(params) {
3854
3942
  state.pivotColumns = void 0;
3855
3943
  const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
3856
3944
  if (arrayDifferentAfterSortStep) {
3857
- rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, toPrimaryKey(data), index));
3945
+ rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
3858
3946
  }
3859
3947
  }
3860
3948
  state.postGroupDataArray = rowInfoDataArray;
@@ -3882,7 +3970,7 @@ function DataSourceWithContext(props) {
3882
3970
  if (typeof children === "function") {
3883
3971
  children = children(computedValues);
3884
3972
  }
3885
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
3973
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children);
3886
3974
  }
3887
3975
  var DataSourceRoot = getComponentStateRoot({
3888
3976
  initSetupState: initSetupState2,
@@ -3905,14 +3993,14 @@ function DataSourceCmp({ children }) {
3905
3993
  globalThis.getDataSourceState = getState;
3906
3994
  }
3907
3995
  useLoadData();
3908
- return /* @__PURE__ */ React8.createElement(DataSourceContext.Provider, {
3996
+ return /* @__PURE__ */ React7.createElement(DataSourceContext.Provider, {
3909
3997
  value: contextValue
3910
- }, /* @__PURE__ */ React8.createElement(DataSourceWithContext, {
3998
+ }, /* @__PURE__ */ React7.createElement(DataSourceWithContext, {
3911
3999
  children
3912
4000
  }));
3913
4001
  }
3914
4002
  function DataSource(props) {
3915
- return /* @__PURE__ */ React8.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React8.createElement(DataSourceCmp, {
4003
+ return /* @__PURE__ */ React7.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React7.createElement(DataSourceCmp, {
3916
4004
  children: props.children
3917
4005
  }));
3918
4006
  }
@@ -3963,9 +4051,9 @@ function useColumnsWhen() {
3963
4051
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
3964
4052
  }, [pivotTotalColumnPosition]);
3965
4053
  useColumnsWhenInlineGroupRenderStrategy(groupByMap);
3966
- useColumnsWhenPivoting();
3967
- useColumnsWhenGrouping();
3968
- useHideEmptyGroupColumns(groupByMap);
4054
+ const { toggleGroupRow } = useColumnsWhenGrouping();
4055
+ useHideEmptyGroupColumns();
4056
+ return { toggleGroupRow };
3969
4057
  }
3970
4058
  function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
3971
4059
  const toggleGroupRow = useToggleGroupRow();
@@ -3975,6 +4063,9 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
3975
4063
  } = useComponentState();
3976
4064
  function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
3977
4065
  const computedColumns = new Map();
4066
+ if (groupRenderStrategy2 !== "inline") {
4067
+ return;
4068
+ }
3978
4069
  columns2.forEach((column, id) => {
3979
4070
  let base = {};
3980
4071
  const groupByForColumn = groupByMap2.get(column.field);
@@ -4034,51 +4125,32 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
4034
4125
  });
4035
4126
  }, [columns, groupByMap, groupRenderStrategy, toggleGroupRow]);
4036
4127
  }
4037
- function useColumnsWhenPivoting() {
4128
+ function useColumnsWhenGrouping() {
4038
4129
  const {
4039
4130
  componentState: { groupBy, pivotBy }
4040
4131
  } = useDataSourceContextValue();
4041
4132
  const {
4042
4133
  componentActions,
4043
4134
  componentState: {
4135
+ columns,
4136
+ groupColumn,
4137
+ groupRenderStrategy,
4044
4138
  pivotColumns,
4045
4139
  pivotColumn,
4046
- pivotRowLabelsColumn,
4047
4140
  pivotTotalColumnPosition
4048
4141
  }
4049
4142
  } = useComponentState();
4050
4143
  const toggleGroupRow = useToggleGroupRow();
4051
4144
  (0, import_react17.useEffect)(() => {
4052
- const computedPivotColumns = getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, {
4053
- pivotColumn,
4054
- pivotRowLabelsColumn,
4055
- pivotTotalColumnPosition,
4056
- pivotBy,
4057
- groupBy,
4058
- toggleGroupRow
4059
- });
4060
- componentActions.computedPivotColumns = computedPivotColumns;
4061
- }, [pivotColumns, pivotColumn, pivotRowLabelsColumn]);
4062
- }
4063
- function useColumnsWhenGrouping() {
4064
- const {
4065
- componentState: { groupBy }
4066
- } = useDataSourceContextValue();
4067
- const {
4068
- componentActions,
4069
- componentState: { columns, groupColumn, groupRenderStrategy, pivotColumns }
4070
- } = useComponentState();
4071
- const toggleGroupRow = useToggleGroupRow();
4072
- (0, import_react17.useEffect)(() => {
4073
- if (pivotColumns) {
4074
- return;
4075
- }
4076
4145
  const update = () => {
4077
4146
  const columnsWhenGrouping = getColumnsWhenGrouping({
4078
4147
  columns,
4079
4148
  groupColumn,
4080
- groupRenderStrategy,
4149
+ pivotColumn,
4150
+ pivotTotalColumnPosition,
4151
+ groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
4081
4152
  groupBy,
4153
+ pivotBy,
4082
4154
  pivotColumns,
4083
4155
  toggleGroupRow
4084
4156
  });
@@ -4090,11 +4162,25 @@ function useColumnsWhenGrouping() {
4090
4162
  delete: update,
4091
4163
  clear: update
4092
4164
  });
4093
- }, [columns, groupBy, groupColumn, groupRenderStrategy, pivotColumns]);
4165
+ }, [
4166
+ columns,
4167
+ groupBy,
4168
+ pivotBy,
4169
+ groupColumn,
4170
+ groupRenderStrategy,
4171
+ pivotColumns,
4172
+ pivotTotalColumnPosition,
4173
+ pivotColumn
4174
+ ]);
4175
+ return { toggleGroupRow };
4094
4176
  }
4095
- function useHideEmptyGroupColumns(groupRowsMap) {
4177
+ function useHideEmptyGroupColumns() {
4096
4178
  const {
4097
- componentState: { groupBy, groupRowsState },
4179
+ componentState: {
4180
+ groupBy,
4181
+ groupRowsState,
4182
+ originalLazyGroupDataChangeDetect
4183
+ },
4098
4184
  getState: getDataSourceState
4099
4185
  } = useDataSourceContextValue();
4100
4186
  const {
@@ -4147,8 +4233,8 @@ function useHideEmptyGroupColumns(groupRowsMap) {
4147
4233
  getDataSourceState,
4148
4234
  groupRenderStrategy,
4149
4235
  generatedColumns,
4236
+ originalLazyGroupDataChangeDetect,
4150
4237
  groupBy,
4151
- groupRowsMap,
4152
4238
  hideEmptyGroupColumns ? groupRowsState : null,
4153
4239
  hideEmptyGroupColumns
4154
4240
  ]);
@@ -4157,14 +4243,14 @@ function getColumnsWhenGrouping(params) {
4157
4243
  const {
4158
4244
  pivotColumns,
4159
4245
  groupBy,
4246
+ pivotBy,
4160
4247
  groupColumn,
4248
+ pivotTotalColumnPosition,
4249
+ pivotColumn,
4161
4250
  groupRenderStrategy,
4162
4251
  toggleGroupRow,
4163
4252
  columns
4164
4253
  } = params;
4165
- if (pivotColumns) {
4166
- return void 0;
4167
- }
4168
4254
  if (groupRenderStrategy === "inline") {
4169
4255
  return void 0;
4170
4256
  }
@@ -4174,6 +4260,7 @@ function getColumnsWhenGrouping(params) {
4174
4260
  const generatedGroupColumn = getColumnForGroupBy({
4175
4261
  groupByForColumn,
4176
4262
  groupBy,
4263
+ pivotBy,
4177
4264
  groupIndexForColumn,
4178
4265
  groupCount: arr.length,
4179
4266
  groupRenderStrategy
@@ -4184,13 +4271,40 @@ function getColumnsWhenGrouping(params) {
4184
4271
  const singleGroupColumn = getSingleGroupColumn({
4185
4272
  groupCount: groupBy.length,
4186
4273
  groupBy,
4274
+ pivotBy,
4187
4275
  groupRenderStrategy
4188
4276
  }, toggleGroupRow, groupColumn);
4189
4277
  computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
4190
4278
  }
4191
- columns.forEach((col, colId) => {
4192
- computedColumns.set(colId, col);
4193
- });
4279
+ if (pivotColumns) {
4280
+ pivotColumns.forEach((col, key) => {
4281
+ if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
4282
+ return;
4283
+ }
4284
+ let column = __spreadValues({}, col);
4285
+ if (pivotColumn) {
4286
+ if (typeof pivotColumn === "function") {
4287
+ column = __spreadValues(__spreadValues({}, column), pivotColumn({
4288
+ column,
4289
+ pivotBy,
4290
+ groupBy
4291
+ }));
4292
+ } else {
4293
+ column = __spreadValues(__spreadValues({}, column), pivotColumn);
4294
+ }
4295
+ }
4296
+ if (!column.render && column.renderValue) {
4297
+ column.render = (renderOptions) => {
4298
+ return column.renderValue(renderOptions);
4299
+ };
4300
+ }
4301
+ computedColumns.set(key, column);
4302
+ });
4303
+ } else {
4304
+ columns.forEach((col, colId) => {
4305
+ computedColumns.set(colId, col);
4306
+ });
4307
+ }
4194
4308
  return computedColumns.size ? computedColumns : void 0;
4195
4309
  }
4196
4310
 
@@ -4229,7 +4343,7 @@ function useComputed() {
4229
4343
  }, [showSeparatePivotColumnForSingleAggregation]);
4230
4344
  const { multiSort } = dataSourceState;
4231
4345
  useColumnGroups();
4232
- useColumnsWhen();
4346
+ const { toggleGroupRow } = useColumnsWhen();
4233
4347
  const setSortInfo = (0, import_react18.useCallback)((sortInfo) => {
4234
4348
  var _a2;
4235
4349
  const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
@@ -4298,6 +4412,7 @@ function useComputed() {
4298
4412
  const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
4299
4413
  const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
4300
4414
  return {
4415
+ toggleGroupRow,
4301
4416
  computedPinnedStartOverflow,
4302
4417
  computedPinnedEndOverflow,
4303
4418
  computedPinnedStartWidth,
@@ -4321,7 +4436,7 @@ function useComputed() {
4321
4436
  }
4322
4437
 
4323
4438
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
4324
- var React9 = __toModule(require("react"));
4439
+ var React8 = __toModule(require("react"));
4325
4440
 
4326
4441
  // src/components/InfiniteTable/hooks/useInternalProps.ts
4327
4442
  var useInternalProps = () => {
@@ -4329,9 +4444,9 @@ var useInternalProps = () => {
4329
4444
  };
4330
4445
 
4331
4446
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
4332
- var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref) {
4447
+ var InfiniteTableBody = React8.forwardRef(function InfiniteTableBody2(props, ref) {
4333
4448
  const { rootClassName: rootClassName12 } = useInternalProps();
4334
- return /* @__PURE__ */ React9.createElement("div", __spreadProps(__spreadValues({
4449
+ return /* @__PURE__ */ React8.createElement("div", __spreadProps(__spreadValues({
4335
4450
  ref
4336
4451
  }, props), {
4337
4452
  className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
@@ -4339,16 +4454,16 @@ var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref
4339
4454
  });
4340
4455
 
4341
4456
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4342
- var React21 = __toModule(require("react"));
4457
+ var React20 = __toModule(require("react"));
4343
4458
 
4344
4459
  // src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
4345
- var React10 = __toModule(require("react"));
4460
+ var React9 = __toModule(require("react"));
4346
4461
  function HorizontalScrollbarPlaceholderFn(props) {
4347
4462
  const scrollbarWidth2 = getScrollbarWidth();
4348
4463
  if (!scrollbarWidth2) {
4349
4464
  return null;
4350
4465
  }
4351
- return /* @__PURE__ */ React10.createElement("div", {
4466
+ return /* @__PURE__ */ React9.createElement("div", {
4352
4467
  "data-name": "horizontal-scrollbar-placeholder",
4353
4468
  style: __spreadValues({
4354
4469
  position: "absolute",
@@ -4358,13 +4473,13 @@ function HorizontalScrollbarPlaceholderFn(props) {
4358
4473
  }, props.style)
4359
4474
  });
4360
4475
  }
4361
- var HorizontalScrollbarPlaceholder = React10.memo(HorizontalScrollbarPlaceholderFn);
4476
+ var HorizontalScrollbarPlaceholder = React9.memo(HorizontalScrollbarPlaceholderFn);
4362
4477
  function VerticalScrollbarPlaceholderFn(props) {
4363
4478
  const scrollbarWidth2 = getScrollbarWidth();
4364
4479
  if (!scrollbarWidth2) {
4365
4480
  return null;
4366
4481
  }
4367
- return /* @__PURE__ */ React10.createElement("div", {
4482
+ return /* @__PURE__ */ React9.createElement("div", {
4368
4483
  "data-name": "vertical-scrollbar-placeholder",
4369
4484
  style: __spreadValues({
4370
4485
  position: "absolute",
@@ -4374,7 +4489,7 @@ function VerticalScrollbarPlaceholderFn(props) {
4374
4489
  }, props.style)
4375
4490
  });
4376
4491
  }
4377
- var VerticalScrollbarPlaceholder = React10.memo(VerticalScrollbarPlaceholderFn);
4492
+ var VerticalScrollbarPlaceholder = React9.memo(VerticalScrollbarPlaceholderFn);
4378
4493
 
4379
4494
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
4380
4495
  var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -4389,15 +4504,15 @@ var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
4389
4504
  var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
4390
4505
 
4391
4506
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4392
- var React17 = __toModule(require("react"));
4507
+ var React16 = __toModule(require("react"));
4393
4508
  var import_react26 = __toModule(require("react"));
4394
4509
 
4395
4510
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
4396
- var React13 = __toModule(require("react"));
4511
+ var React12 = __toModule(require("react"));
4397
4512
  var import_react22 = __toModule(require("react"));
4398
4513
 
4399
4514
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
4400
- var React11 = __toModule(require("react"));
4515
+ var React10 = __toModule(require("react"));
4401
4516
 
4402
4517
  // src/components/InfiniteTable/hooks/useInfiniteTableState.ts
4403
4518
  var import_react19 = __toModule(require("react"));
@@ -4456,16 +4571,16 @@ function InfiniteTableCellFn(props) {
4456
4571
  style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
4457
4572
  }
4458
4573
  }
4459
- return /* @__PURE__ */ React11.createElement("div", __spreadProps(__spreadValues({}, domProps), {
4574
+ return /* @__PURE__ */ React10.createElement("div", __spreadProps(__spreadValues({}, domProps), {
4460
4575
  ref: domRef,
4461
4576
  style,
4462
4577
  "data-name": `Cell`,
4463
4578
  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}` : "")
4464
- }), beforeChildren, cssEllipsis ? /* @__PURE__ */ React11.createElement("div", {
4579
+ }), beforeChildren, cssEllipsis ? /* @__PURE__ */ React10.createElement("div", {
4465
4580
  className: `${rootClassName2}Cell_content ${cssEllipsisClassName}`
4466
4581
  }, children) : children, afterChildren);
4467
4582
  }
4468
- var InfiniteTableCell = React11.memo(InfiniteTableCellFn);
4583
+ var InfiniteTableCell = React10.memo(InfiniteTableCellFn);
4469
4584
 
4470
4585
  // src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
4471
4586
  var import_binary_search = __toModule(require_binary_search());
@@ -4660,7 +4775,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
4660
4775
  var import_react_dom = __toModule(require("react-dom"));
4661
4776
 
4662
4777
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
4663
- var React12 = __toModule(require("react"));
4778
+ var React11 = __toModule(require("react"));
4664
4779
  var import_react21 = __toModule(require("react"));
4665
4780
  var defaultLineStyle = {
4666
4781
  marginTop: 2,
@@ -4714,18 +4829,18 @@ function SortIcon(props) {
4714
4829
  if (direction === -1) {
4715
4830
  indexStyle.top = "100%";
4716
4831
  }
4717
- return /* @__PURE__ */ React12.createElement("div", {
4832
+ return /* @__PURE__ */ React11.createElement("div", {
4718
4833
  style: __spreadProps(__spreadValues({}, style), { width: size }),
4719
4834
  className: join(className, "ITableIcon", "ITableIcon-sort")
4720
- }, showIndex ? /* @__PURE__ */ React12.createElement("div", {
4835
+ }, showIndex ? /* @__PURE__ */ React11.createElement("div", {
4721
4836
  "data-name": "index",
4722
4837
  style: indexStyle
4723
- }, index) : null, /* @__PURE__ */ React12.createElement("div", {
4838
+ }, index) : null, /* @__PURE__ */ React11.createElement("div", {
4724
4839
  style: __spreadValues({ width: sizes[0] }, lineStyle),
4725
4840
  onTransitionEnd
4726
- }), /* @__PURE__ */ React12.createElement("div", {
4841
+ }), /* @__PURE__ */ React11.createElement("div", {
4727
4842
  style: __spreadValues({ width: sizes[1] }, lineStyle)
4728
- }), /* @__PURE__ */ React12.createElement("div", {
4843
+ }), /* @__PURE__ */ React11.createElement("div", {
4729
4844
  style: __spreadValues({ width: sizes[2] }, lineStyle)
4730
4845
  }));
4731
4846
  }
@@ -4756,7 +4871,7 @@ function InfiniteTableHeaderCell(props) {
4756
4871
  });
4757
4872
  }
4758
4873
  header = header != null ? header : column.name;
4759
- const sortTool = /* @__PURE__ */ React13.createElement(SortIcon, {
4874
+ const sortTool = /* @__PURE__ */ React12.createElement(SortIcon, {
4760
4875
  index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
4761
4876
  className: `${baseCls}__sort-icon ${HeaderSortIconCls}`,
4762
4877
  direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
@@ -4794,7 +4909,7 @@ function InfiniteTableHeaderCell(props) {
4794
4909
  let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
4795
4910
  let draggingProxy = null;
4796
4911
  if (dragging) {
4797
- draggingProxy = /* @__PURE__ */ React13.createElement("div", {
4912
+ draggingProxy = /* @__PURE__ */ React12.createElement("div", {
4798
4913
  className: `${baseCls}Proxy ${HeaderCellProxy}`,
4799
4914
  style: {
4800
4915
  position: "absolute",
@@ -4807,7 +4922,7 @@ function InfiniteTableHeaderCell(props) {
4807
4922
  }, header);
4808
4923
  draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
4809
4924
  }
4810
- return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(InfiniteTableCell, {
4925
+ return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(InfiniteTableCell, {
4811
4926
  domRef: ref,
4812
4927
  column,
4813
4928
  "data-name": `HeaderCell`,
@@ -4823,11 +4938,11 @@ function InfiniteTableHeaderCell(props) {
4823
4938
  }
4824
4939
 
4825
4940
  // src/components/RawList/index.tsx
4826
- var React16 = __toModule(require("react"));
4941
+ var React15 = __toModule(require("react"));
4827
4942
  var import_react25 = __toModule(require("react"));
4828
4943
 
4829
4944
  // src/components/RawList/AvoidReactDiff.tsx
4830
- var React14 = __toModule(require("react"));
4945
+ var React13 = __toModule(require("react"));
4831
4946
  var import_react23 = __toModule(require("react"));
4832
4947
  function AvoidReactDiffFn(props) {
4833
4948
  const [children, setChildren] = (0, import_react23.useState)(props.updater.get());
@@ -4837,15 +4952,15 @@ function AvoidReactDiffFn(props) {
4837
4952
  });
4838
4953
  return remove;
4839
4954
  }, [props.updater]);
4840
- return /* @__PURE__ */ React14.createElement(React14.Fragment, null, children);
4955
+ return /* @__PURE__ */ React13.createElement(React13.Fragment, null, children);
4841
4956
  }
4842
- var AvoidReactDiff = React14.memo(AvoidReactDiffFn);
4957
+ var AvoidReactDiff = React13.memo(AvoidReactDiffFn);
4843
4958
 
4844
4959
  // src/components/RawList/useVirtualRenderer.ts
4845
4960
  var import_react24 = __toModule(require("react"));
4846
4961
 
4847
4962
  // src/components/RawList/ReactVirtualRenderer.tsx
4848
- var React15 = __toModule(require("react"));
4963
+ var React14 = __toModule(require("react"));
4849
4964
 
4850
4965
  // src/components/RawList/MappedItems.ts
4851
4966
  var MappedItems = class extends Logger {
@@ -5090,7 +5205,7 @@ var ReactVirtualRenderer = class extends Logger {
5090
5205
  };
5091
5206
  this.itemDOMRefs[elementIndex] = domRef;
5092
5207
  this.updaters[elementIndex] = buildSubscriptionCallback();
5093
- const item = /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
5208
+ const item = /* @__PURE__ */ React14.createElement(AvoidReactDiff, {
5094
5209
  key: elementIndex,
5095
5210
  name: `${elementIndex}`,
5096
5211
  updater: this.updaters[elementIndex]
@@ -5187,11 +5302,11 @@ function RawListFn(props) {
5187
5302
  });
5188
5303
  return remove;
5189
5304
  }, [brain, onRenderUpdater]);
5190
- return /* @__PURE__ */ React16.createElement(AvoidReactDiff, {
5305
+ return /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
5191
5306
  updater: onRenderUpdater
5192
5307
  });
5193
5308
  }
5194
- var RawList = React16.memo(RawListFn);
5309
+ var RawList = React15.memo(RawListFn);
5195
5310
 
5196
5311
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
5197
5312
  var debug3 = dbg("Header");
@@ -5212,7 +5327,7 @@ function InfiniteTableHeaderFn(props) {
5212
5327
  }
5213
5328
  return null;
5214
5329
  }
5215
- return /* @__PURE__ */ React17.createElement(InfiniteTableHeaderCell, {
5330
+ return /* @__PURE__ */ React16.createElement(InfiniteTableHeaderCell, {
5216
5331
  domRef: domRef2,
5217
5332
  column,
5218
5333
  headerHeight,
@@ -5237,18 +5352,18 @@ function InfiniteTableHeaderFn(props) {
5237
5352
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
5238
5353
  style
5239
5354
  };
5240
- return /* @__PURE__ */ React17.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React17.createElement(RawList, {
5355
+ return /* @__PURE__ */ React16.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React16.createElement(RawList, {
5241
5356
  brain,
5242
5357
  renderItem: renderColumn
5243
5358
  }));
5244
5359
  }
5245
- var InfiniteTableHeader = React17.memo(InfiniteTableHeaderFn);
5360
+ var InfiniteTableHeader = React16.memo(InfiniteTableHeaderFn);
5246
5361
 
5247
5362
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
5248
- var React20 = __toModule(require("react"));
5363
+ var React19 = __toModule(require("react"));
5249
5364
 
5250
5365
  // src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
5251
- var React19 = __toModule(require("react"));
5366
+ var React18 = __toModule(require("react"));
5252
5367
 
5253
5368
  // src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
5254
5369
  function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap) {
@@ -5338,7 +5453,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
5338
5453
  }
5339
5454
 
5340
5455
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
5341
- var React18 = __toModule(require("react"));
5456
+ var React17 = __toModule(require("react"));
5342
5457
  var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
5343
5458
  function InfiniteTableHeaderGroup(props) {
5344
5459
  const { columnGroup, height, headerHeight } = props;
@@ -5352,16 +5467,16 @@ function InfiniteTableHeaderGroup(props) {
5352
5467
  width: columnGroup.computedWidth,
5353
5468
  height
5354
5469
  };
5355
- return /* @__PURE__ */ React18.createElement("div", {
5470
+ return /* @__PURE__ */ React17.createElement("div", {
5356
5471
  "data-group-id": columnGroup.id,
5357
5472
  className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
5358
5473
  style
5359
- }, /* @__PURE__ */ React18.createElement("div", {
5474
+ }, /* @__PURE__ */ React17.createElement("div", {
5360
5475
  className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
5361
5476
  style: { height: headerHeight }
5362
- }, /* @__PURE__ */ React18.createElement("div", {
5477
+ }, /* @__PURE__ */ React17.createElement("div", {
5363
5478
  className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
5364
- }, header)), /* @__PURE__ */ React18.createElement("div", {
5479
+ }, header)), /* @__PURE__ */ React17.createElement("div", {
5365
5480
  className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
5366
5481
  }, props.children));
5367
5482
  }
@@ -5384,7 +5499,7 @@ function renderColumnHeaderGroups(config) {
5384
5499
  return items2.map((colGroupItem) => {
5385
5500
  if (colGroupItem.type === "column") {
5386
5501
  const col = colGroupItem.ref;
5387
- return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
5502
+ return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderCell, {
5388
5503
  key: col.id,
5389
5504
  headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
5390
5505
  column: col,
@@ -5398,7 +5513,7 @@ function renderColumnHeaderGroups(config) {
5398
5513
  colIds.push(col.id);
5399
5514
  return col;
5400
5515
  });
5401
- return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderGroup, {
5516
+ return /* @__PURE__ */ React18.createElement(InfiniteTableHeaderGroup, {
5402
5517
  key: `${colGroupItem.uniqueGroupId.join("/")}`,
5403
5518
  columns: columns2,
5404
5519
  height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
@@ -5451,9 +5566,9 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
5451
5566
  },
5452
5567
  computed: { computedVisibleColumnsMap: columnsMap }
5453
5568
  } = useInfiniteTable();
5454
- const domRef = React20.useRef(null);
5569
+ const domRef = React19.useRef(null);
5455
5570
  const hasColumnGroups = computedColumnGroups.size > 0;
5456
- const columnHeaderGroups = React20.useMemo(() => {
5571
+ const columnHeaderGroups = React19.useMemo(() => {
5457
5572
  return hasColumnGroups ? renderColumnHeaderGroups({
5458
5573
  columnGroups: computedColumnGroups,
5459
5574
  columnGroupsDepthsMap,
@@ -5472,7 +5587,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
5472
5587
  columnGroupsMaxDepth
5473
5588
  ]);
5474
5589
  const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
5475
- return /* @__PURE__ */ React20.createElement(InfiniteTableHeaderCell, {
5590
+ return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
5476
5591
  key: c.id,
5477
5592
  headerHeight,
5478
5593
  column: c,
@@ -5495,20 +5610,20 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
5495
5610
  const removeOnScroll = scroller.onScroll(onScroll);
5496
5611
  return removeOnScroll;
5497
5612
  }, [brain, scrollListener]);
5498
- return /* @__PURE__ */ React20.createElement("div", __spreadProps(__spreadValues({}, domProps), {
5613
+ return /* @__PURE__ */ React19.createElement("div", __spreadProps(__spreadValues({}, domProps), {
5499
5614
  className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
5500
5615
  pinned: pinning,
5501
5616
  virtualized: false,
5502
5617
  overflow: scrollable
5503
5618
  })),
5504
5619
  style
5505
- }), /* @__PURE__ */ React20.createElement("div", {
5620
+ }), /* @__PURE__ */ React19.createElement("div", {
5506
5621
  style: { width: totalWidth },
5507
5622
  className: join(flexFlow.row, display.flex),
5508
5623
  ref: domRef
5509
5624
  }, children));
5510
5625
  }
5511
- var InfiniteTableHeaderUnvirtualized = React20.memo(InfiniteTableHeaderUnvirtualizedFn);
5626
+ var InfiniteTableHeaderUnvirtualized = React19.memo(InfiniteTableHeaderUnvirtualizedFn);
5512
5627
 
5513
5628
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
5514
5629
  function TableHeaderWrapper(props) {
@@ -5541,7 +5656,7 @@ function TableHeaderWrapper(props) {
5541
5656
  const unvirtualizedStyle = !virtualizeHeader && computedPinnedStartColumnsWidth ? {
5542
5657
  left: computedPinnedStartWidth
5543
5658
  } : void 0;
5544
- const header = virtualizeHeader ? /* @__PURE__ */ React21.createElement(InfiniteTableHeader, {
5659
+ const header = virtualizeHeader ? /* @__PURE__ */ React20.createElement(InfiniteTableHeader, {
5545
5660
  columns: computedUnpinnedColumns,
5546
5661
  repaintId: virtualizeHeader ? repaintId : void 0,
5547
5662
  brain,
@@ -5554,7 +5669,7 @@ function TableHeaderWrapper(props) {
5554
5669
  },
5555
5670
  availableWidth: computedUnpinnedColumnsWidth,
5556
5671
  totalWidth: computedUnpinnedColumnsWidth
5557
- }) : /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
5672
+ }) : /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
5558
5673
  style: unvirtualizedStyle,
5559
5674
  brain,
5560
5675
  scrollable: true,
@@ -5563,12 +5678,12 @@ function TableHeaderWrapper(props) {
5563
5678
  availableWidth: computedUnpinnedColumnsWidth,
5564
5679
  totalWidth: computedUnpinnedColumnsWidth
5565
5680
  });
5566
- return /* @__PURE__ */ React21.createElement("div", {
5681
+ return /* @__PURE__ */ React20.createElement("div", {
5567
5682
  className: HeaderWrapperCls,
5568
5683
  style: {
5569
5684
  height: virtualizeHeader ? height : void 0
5570
5685
  }
5571
- }, hasPinnedStart ? /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
5686
+ }, hasPinnedStart ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
5572
5687
  style: {
5573
5688
  left: 0,
5574
5689
  position: "absolute",
@@ -5580,7 +5695,7 @@ function TableHeaderWrapper(props) {
5580
5695
  scrollable: computedPinnedStartOverflow,
5581
5696
  pinning: "start",
5582
5697
  scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
5583
- }) : null, header, hasPinnedEnd ? /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
5698
+ }) : null, header, hasPinnedEnd ? /* @__PURE__ */ React20.createElement(InfiniteTableHeaderUnvirtualized, {
5584
5699
  style: {
5585
5700
  right: scrollbars.vertical ? getScrollbarWidth() : 0,
5586
5701
  position: "absolute",
@@ -5592,7 +5707,7 @@ function TableHeaderWrapper(props) {
5592
5707
  scrollable: computedPinnedEndOverflow,
5593
5708
  pinning: "end",
5594
5709
  scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
5595
- }) : null, scrollbars.vertical ? /* @__PURE__ */ React21.createElement(VerticalScrollbarPlaceholder, {
5710
+ }) : null, scrollbars.vertical ? /* @__PURE__ */ React20.createElement(VerticalScrollbarPlaceholder, {
5596
5711
  style: {
5597
5712
  height: "100%",
5598
5713
  right: 0
@@ -5601,7 +5716,7 @@ function TableHeaderWrapper(props) {
5601
5716
  }
5602
5717
 
5603
5718
  // src/components/VirtualScrollContainer/index.tsx
5604
- var React22 = __toModule(require("react"));
5719
+ var React21 = __toModule(require("react"));
5605
5720
  var import_react29 = __toModule(require("react"));
5606
5721
 
5607
5722
  // src/components/hooks/useOnScroll.ts
@@ -5645,7 +5760,7 @@ var getScrollableClassName = (scrollable) => {
5645
5760
 
5646
5761
  // src/components/VirtualScrollContainer/index.tsx
5647
5762
  var rootClassName6 = "InfiniteVirtualScrollContainer";
5648
- var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2(props, ref) {
5763
+ var VirtualScrollContainer = React21.forwardRef(function VirtualScrollContainer2(props, ref) {
5649
5764
  const {
5650
5765
  children,
5651
5766
  scrollable = true,
@@ -5655,7 +5770,7 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
5655
5770
  } = props;
5656
5771
  const domRef = ref != null ? ref : (0, import_react29.useRef)(null);
5657
5772
  useOnScroll(domRef, onContainerScroll);
5658
- return /* @__PURE__ */ React22.createElement("div", {
5773
+ return /* @__PURE__ */ React21.createElement("div", {
5659
5774
  ref: domRef,
5660
5775
  style,
5661
5776
  className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
@@ -5663,7 +5778,7 @@ var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2
5663
5778
  });
5664
5779
 
5665
5780
  // src/components/VirtualList/SpacePlaceholder.tsx
5666
- var React23 = __toModule(require("react"));
5781
+ var React22 = __toModule(require("react"));
5667
5782
  function SpacePlaceholderFn(props) {
5668
5783
  const { height, width, count } = props;
5669
5784
  const style = {
@@ -5673,7 +5788,7 @@ function SpacePlaceholderFn(props) {
5673
5788
  opacity: 0,
5674
5789
  pointerEvents: "none"
5675
5790
  };
5676
- return /* @__PURE__ */ React23.createElement("div", {
5791
+ return /* @__PURE__ */ React22.createElement("div", {
5677
5792
  "data-count": count,
5678
5793
  "data-placeholder-width": true ? width : void 0,
5679
5794
  "data-placeholder-height": true ? height : void 0,
@@ -5681,20 +5796,20 @@ function SpacePlaceholderFn(props) {
5681
5796
  style
5682
5797
  });
5683
5798
  }
5684
- var SpacePlaceholder = React23.memo(SpacePlaceholderFn);
5799
+ var SpacePlaceholder = React22.memo(SpacePlaceholderFn);
5685
5800
 
5686
5801
  // src/components/InfiniteTable/hooks/useListRendering.tsx
5687
5802
  var import_react41 = __toModule(require("react"));
5688
5803
 
5689
5804
  // src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
5690
- var React29 = __toModule(require("react"));
5805
+ var React28 = __toModule(require("react"));
5691
5806
  var import_react33 = __toModule(require("react"));
5692
5807
 
5693
5808
  // src/components/VirtualList/VirtualRowList.tsx
5694
- var React25 = __toModule(require("react"));
5809
+ var React24 = __toModule(require("react"));
5695
5810
 
5696
5811
  // src/components/VirtualList/VirtualList.tsx
5697
- var React24 = __toModule(require("react"));
5812
+ var React23 = __toModule(require("react"));
5698
5813
  var import_react30 = __toModule(require("react"));
5699
5814
 
5700
5815
  // src/components/VirtualList/VirtualList.css.ts
@@ -5776,19 +5891,19 @@ var VirtualList = (props) => {
5776
5891
  if (true) {
5777
5892
  domProps["data-cmp-name"] = `VirtualList`;
5778
5893
  }
5779
- return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React24.createElement(VirtualScrollContainer, {
5894
+ return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React23.createElement(VirtualScrollContainer, {
5780
5895
  scrollable,
5781
5896
  onContainerScroll
5782
- }, /* @__PURE__ */ React24.createElement("div", {
5897
+ }, /* @__PURE__ */ React23.createElement("div", {
5783
5898
  ref: domRef,
5784
5899
  className: scrollTransformTargetCls,
5785
5900
  "data-name": "scroll-transform-target"
5786
- }, /* @__PURE__ */ React24.createElement(RawList, {
5901
+ }, /* @__PURE__ */ React23.createElement(RawList, {
5787
5902
  brain: virtualBrain,
5788
5903
  renderItem,
5789
5904
  repaintId,
5790
5905
  debugChannel: "VirtualList-" + mainAxis
5791
- })), children, /* @__PURE__ */ React24.createElement(SpacePlaceholder, {
5906
+ })), children, /* @__PURE__ */ React23.createElement(SpacePlaceholder, {
5792
5907
  count,
5793
5908
  width,
5794
5909
  height
@@ -5798,14 +5913,14 @@ var VirtualList = (props) => {
5798
5913
  // src/components/VirtualList/VirtualRowList.tsx
5799
5914
  var VirtualRowList = (props) => {
5800
5915
  const _a = props, { rowWidth, rowHeight, renderRow } = _a, listProps = __objRest(_a, ["rowWidth", "rowHeight", "renderRow"]);
5801
- const renderItem = React25.useCallback((renderProps) => {
5916
+ const renderItem = React24.useCallback((renderProps) => {
5802
5917
  return renderRow({
5803
5918
  domRef: renderProps.domRef,
5804
5919
  rowHeight: renderProps.itemSize,
5805
5920
  rowIndex: renderProps.itemIndex
5806
5921
  });
5807
5922
  }, [renderRow]);
5808
- return /* @__PURE__ */ React25.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
5923
+ return /* @__PURE__ */ React24.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
5809
5924
  renderItem,
5810
5925
  mainAxis: "vertical",
5811
5926
  itemMainAxisSize: rowHeight,
@@ -5814,11 +5929,11 @@ var VirtualRowList = (props) => {
5814
5929
  };
5815
5930
 
5816
5931
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
5817
- var React27 = __toModule(require("react"));
5932
+ var React26 = __toModule(require("react"));
5818
5933
  var import_react32 = __toModule(require("react"));
5819
5934
 
5820
5935
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5821
- var React26 = __toModule(require("react"));
5936
+ var React25 = __toModule(require("react"));
5822
5937
  var { rootClassName: rootClassName8 } = internalProps;
5823
5938
  var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
5824
5939
  function isColumnWithField(c) {
@@ -5875,7 +5990,8 @@ function InfiniteTableColumnCellFn(props) {
5875
5990
  rowIndex,
5876
5991
  toggleGroupRow,
5877
5992
  toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
5878
- groupBy: computedDataSource.groupBy
5993
+ groupBy: computedDataSource.groupBy,
5994
+ pivotBy: computedDataSource.pivotBy
5879
5995
  });
5880
5996
  if (column.render) {
5881
5997
  renderValue = column.render(renderParam);
@@ -5911,7 +6027,7 @@ function InfiniteTableColumnCellFn(props) {
5911
6027
  }
5912
6028
  }
5913
6029
  }
5914
- return /* @__PURE__ */ React26.createElement(InfiniteTableCell, __spreadProps(__spreadValues({
6030
+ return /* @__PURE__ */ React25.createElement(InfiniteTableCell, __spreadProps(__spreadValues({
5915
6031
  domRef,
5916
6032
  offsetProperty
5917
6033
  }, dataset), {
@@ -5922,7 +6038,7 @@ function InfiniteTableColumnCellFn(props) {
5922
6038
  className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName)
5923
6039
  }), hidden ? null : renderValue);
5924
6040
  }
5925
- var InfiniteTableColumnCell = React26.memo(InfiniteTableColumnCellFn);
6041
+ var InfiniteTableColumnCell = React25.memo(InfiniteTableColumnCellFn);
5926
6042
 
5927
6043
  // src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
5928
6044
  var import_react31 = __toModule(require("react"));
@@ -6053,12 +6169,12 @@ function InfiniteTableRowFn(props) {
6053
6169
  height: rowHeight
6054
6170
  }, domProps.style);
6055
6171
  const renderCellRef = (0, import_react32.useRef)(null);
6056
- const renderCell = React27.useCallback(({ domRef, itemIndex }) => {
6172
+ const renderCell = React26.useCallback(({ domRef, itemIndex }) => {
6057
6173
  const column = columns[itemIndex];
6058
6174
  if (!column) {
6059
6175
  }
6060
6176
  const hidden = false;
6061
- return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
6177
+ return /* @__PURE__ */ React26.createElement(InfiniteTableColumnCell, {
6062
6178
  getData,
6063
6179
  rowInfo,
6064
6180
  groupRenderStrategy,
@@ -6085,18 +6201,18 @@ function InfiniteTableRowFn(props) {
6085
6201
  if (true) {
6086
6202
  domProps["data-cmp-name"] = "ITableRow";
6087
6203
  }
6088
- return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
6204
+ return /* @__PURE__ */ React26.createElement("div", __spreadProps(__spreadValues({}, domProps), {
6089
6205
  style
6090
- }), /* @__PURE__ */ React27.createElement(RawList, {
6206
+ }), /* @__PURE__ */ React26.createElement(RawList, {
6091
6207
  brain,
6092
6208
  renderItem: renderCell,
6093
6209
  debugChannel: `${rowIndex}`
6094
6210
  }));
6095
6211
  }
6096
- var InfiniteTableRow = React27.memo(InfiniteTableRowFn);
6212
+ var InfiniteTableRow = React26.memo(InfiniteTableRowFn);
6097
6213
 
6098
6214
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
6099
- var React28 = __toModule(require("react"));
6215
+ var React27 = __toModule(require("react"));
6100
6216
  function TableRowUnvirtualizedFn(props) {
6101
6217
  const {
6102
6218
  rowHeight,
@@ -6117,7 +6233,7 @@ function TableRowUnvirtualizedFn(props) {
6117
6233
  }, domProps.style);
6118
6234
  const children = columns.map((col) => {
6119
6235
  const hidden = false;
6120
- return /* @__PURE__ */ React28.createElement(InfiniteTableColumnCell, {
6236
+ return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
6121
6237
  key: col.id,
6122
6238
  virtualized: false,
6123
6239
  rowHeight,
@@ -6130,11 +6246,11 @@ function TableRowUnvirtualizedFn(props) {
6130
6246
  column: col
6131
6247
  });
6132
6248
  });
6133
- return /* @__PURE__ */ React28.createElement("div", __spreadProps(__spreadValues({}, domProps), {
6249
+ return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
6134
6250
  style
6135
6251
  }), children);
6136
6252
  }
6137
- var TableRowUnvirtualized = React28.memo(TableRowUnvirtualizedFn);
6253
+ var TableRowUnvirtualized = React27.memo(TableRowUnvirtualizedFn);
6138
6254
 
6139
6255
  // src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
6140
6256
  function useUnpinnedRendering(params) {
@@ -6177,7 +6293,7 @@ function useUnpinnedRendering(params) {
6177
6293
  rowProps.repaintId = repaintId;
6178
6294
  }
6179
6295
  const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
6180
- return /* @__PURE__ */ React29.createElement(TableRowComponent, __spreadValues({}, rowProps));
6296
+ return /* @__PURE__ */ React28.createElement(TableRowComponent, __spreadValues({}, rowProps));
6181
6297
  }, [
6182
6298
  repaintId,
6183
6299
  rowHeight,
@@ -6187,7 +6303,7 @@ function useUnpinnedRendering(params) {
6187
6303
  horizontalVirtualBrain,
6188
6304
  verticalVirtualBrain
6189
6305
  ]);
6190
- const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React29.createElement("div", {
6306
+ const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React28.createElement("div", {
6191
6307
  "data-name": "horizontal-scrollbar-placeholder--fake",
6192
6308
  style: {
6193
6309
  position: "absolute",
@@ -6198,10 +6314,10 @@ function useUnpinnedRendering(params) {
6198
6314
  overflow: "auto",
6199
6315
  visibility: columnShifts ? "visible" : "hidden"
6200
6316
  }
6201
- }, /* @__PURE__ */ React29.createElement("div", {
6317
+ }, /* @__PURE__ */ React28.createElement("div", {
6202
6318
  style: { height: "100%", width: computedUnpinnedColumnsWidth }
6203
6319
  })) : null;
6204
- return rowHeight != 0 ? /* @__PURE__ */ React29.createElement(VirtualRowList, {
6320
+ return rowHeight != 0 ? /* @__PURE__ */ React28.createElement(VirtualRowList, {
6205
6321
  repaintId: `${repaintId}-unpinned-`,
6206
6322
  brain: verticalVirtualBrain,
6207
6323
  onContainerScroll: applyScrollHorizontal,
@@ -6344,11 +6460,11 @@ var useOnContainerScroll = ({
6344
6460
  };
6345
6461
 
6346
6462
  // src/components/InfiniteTable/hooks/usePinnedRendering.tsx
6347
- var React31 = __toModule(require("react"));
6463
+ var React30 = __toModule(require("react"));
6348
6464
  var import_react37 = __toModule(require("react"));
6349
6465
 
6350
6466
  // src/components/VirtualList/RowListWithExternalScrolling.tsx
6351
- var React30 = __toModule(require("react"));
6467
+ var React29 = __toModule(require("react"));
6352
6468
  var import_react36 = __toModule(require("react"));
6353
6469
 
6354
6470
  // src/components/hooks/useOnMount.ts
@@ -6424,7 +6540,7 @@ var RowListWithExternalScrolling = (props) => {
6424
6540
  if (true) {
6425
6541
  domProps["data-cmp-name"] = "RowListWithExternalScrolling";
6426
6542
  }
6427
- return /* @__PURE__ */ React30.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React30.createElement(RawList, {
6543
+ return /* @__PURE__ */ React29.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React29.createElement(RawList, {
6428
6544
  brain,
6429
6545
  renderItem,
6430
6546
  repaintId
@@ -6447,7 +6563,7 @@ function PinnedRowsContainer(props) {
6447
6563
  brain,
6448
6564
  renderRow
6449
6565
  } = props;
6450
- const style = React31.useMemo(() => {
6566
+ const style = React30.useMemo(() => {
6451
6567
  const result = pinning === "end" ? {
6452
6568
  width: rowWidth,
6453
6569
  height,
@@ -6473,7 +6589,7 @@ function PinnedRowsContainer(props) {
6473
6589
  className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
6474
6590
  };
6475
6591
  if (hasOverflow) {
6476
- return /* @__PURE__ */ React31.createElement(VirtualScrollContainer, {
6592
+ return /* @__PURE__ */ React30.createElement(VirtualScrollContainer, {
6477
6593
  scrollable: {
6478
6594
  horizontal: true,
6479
6595
  vertical: false
@@ -6489,18 +6605,18 @@ function PinnedRowsContainer(props) {
6489
6605
  className: join(PinnedRowsContainerClsVariants({
6490
6606
  pinned: pinning
6491
6607
  }), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
6492
- }, /* @__PURE__ */ React31.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
6608
+ }, /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
6493
6609
  onMount: (node) => {
6494
6610
  pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
6495
6611
  updateScroll(node, brain.getScrollPosition(), scrollPosition);
6496
6612
  });
6497
6613
  }
6498
- })), /* @__PURE__ */ React31.createElement(SpacePlaceholder, {
6614
+ })), /* @__PURE__ */ React30.createElement(SpacePlaceholder, {
6499
6615
  width: rowWidth,
6500
6616
  height: 1
6501
6617
  }));
6502
6618
  }
6503
- return /* @__PURE__ */ React31.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
6619
+ return /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
6504
6620
  }
6505
6621
  function useRenderPinnedRow(params) {
6506
6622
  const { getData, getState, columnsWidth, columns, verticalBrain } = params;
@@ -6520,7 +6636,7 @@ function useRenderPinnedRow(params) {
6520
6636
  rowWidth: columnsWidth,
6521
6637
  columns
6522
6638
  }, rowParams);
6523
- return /* @__PURE__ */ React31.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
6639
+ return /* @__PURE__ */ React30.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
6524
6640
  }, [columnsWidth, columns, verticalBrain]);
6525
6641
  return renderPinnedRow;
6526
6642
  }
@@ -6563,7 +6679,7 @@ function usePinnedRenderingForSide(side, params) {
6563
6679
  columns,
6564
6680
  columnsWidth
6565
6681
  });
6566
- const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React31.createElement(PinnedRowsContainer, {
6682
+ const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React30.createElement(PinnedRowsContainer, {
6567
6683
  pinning: side,
6568
6684
  pinnedScrollListener,
6569
6685
  hasOverflow,
@@ -6576,7 +6692,7 @@ function usePinnedRenderingForSide(side, params) {
6576
6692
  brain: verticalVirtualBrain,
6577
6693
  renderRow: renderRowPinned
6578
6694
  }) : null;
6579
- const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React31.createElement(HorizontalScrollbarPlaceholder, {
6695
+ const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React30.createElement(HorizontalScrollbarPlaceholder, {
6580
6696
  style: side === "end" ? {
6581
6697
  width: columnsWidth,
6582
6698
  right: hasVerticalScrollbar ? getScrollbarWidth() : 0
@@ -7145,7 +7261,8 @@ function useListRendering(param) {
7145
7261
  computedUnpinnedColumnsWidth,
7146
7262
  computedPinnedStartOverflow,
7147
7263
  computedPinnedEndOverflow,
7148
- computedVisibleColumns
7264
+ computedVisibleColumns,
7265
+ toggleGroupRow
7149
7266
  } = computed;
7150
7267
  const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
7151
7268
  const { dataArray } = dataSourceState;
@@ -7229,12 +7346,6 @@ function useListRendering(param) {
7229
7346
  horizontalVirtualBrain,
7230
7347
  reservedContentHeight
7231
7348
  });
7232
- const { componentActions: dataSourceActions } = useDataSourceContextValue();
7233
- const toggleGroupRow = (0, import_react41.useCallback)((groupKeys) => {
7234
- const newState = new GroupRowsState(getDataSourceState().groupRowsState);
7235
- newState.toggleGroupRow(groupKeys);
7236
- dataSourceActions.groupRowsState = newState;
7237
- }, []);
7238
7349
  const pinnedRenderingParams = {
7239
7350
  bodySize,
7240
7351
  scrollbars,
@@ -7288,7 +7399,7 @@ function useListRendering(param) {
7288
7399
  }
7289
7400
 
7290
7401
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
7291
- var React32 = __toModule(require("react"));
7402
+ var React31 = __toModule(require("react"));
7292
7403
  var import_react42 = __toModule(require("react"));
7293
7404
 
7294
7405
  // src/components/utils/decamelize.ts
@@ -7324,10 +7435,10 @@ var enforceStyle = (node, style) => {
7324
7435
  node.style.setProperty(decamelize(propertyName), propertyValue, "important");
7325
7436
  }
7326
7437
  };
7327
- var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
7438
+ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
7328
7439
  const { rootClassName: rootClassName12 } = useInternalProps();
7329
- const domRef = React32.useRef(null);
7330
- const domCallback = React32.useCallback((node) => {
7440
+ const domRef = React31.useRef(null);
7441
+ const domCallback = React31.useCallback((node) => {
7331
7442
  domRef.current = node;
7332
7443
  if (!ref) {
7333
7444
  return;
@@ -7352,12 +7463,12 @@ var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicens
7352
7463
  clearInterval(intervalId);
7353
7464
  };
7354
7465
  }, []);
7355
- return /* @__PURE__ */ React32.createElement("div", __spreadProps(__spreadValues({
7466
+ return /* @__PURE__ */ React31.createElement("div", __spreadProps(__spreadValues({
7356
7467
  ref: domCallback
7357
7468
  }, props), {
7358
7469
  className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
7359
7470
  style: defaultStyle2
7360
- }), "Powered by", " ", /* @__PURE__ */ React32.createElement("a", {
7471
+ }), "Powered by", " ", /* @__PURE__ */ React31.createElement("a", {
7361
7472
  href: "https://infinite-table.com",
7362
7473
  rel: "noopener noreferrer",
7363
7474
  role: "link",
@@ -7519,7 +7630,7 @@ var useLicense = (licenseKey = "") => {
7519
7630
  const valid = (0, import_react43.useMemo)(() => {
7520
7631
  let valid2 = isValidLicense(licenseKey, {
7521
7632
  publishedAt: 1624970570587,
7522
- version: "0.1.4"
7633
+ version: "0.2.3"
7523
7634
  });
7524
7635
  if (!licenseKey && !valid2 && isInsideSandbox) {
7525
7636
  return true;
@@ -7530,7 +7641,7 @@ var useLicense = (licenseKey = "") => {
7530
7641
  };
7531
7642
 
7532
7643
  // src/components/CSSVariableWatch.tsx
7533
- var React33 = __toModule(require("react"));
7644
+ var React32 = __toModule(require("react"));
7534
7645
  var import_react44 = __toModule(require("react"));
7535
7646
  var error = err("CSSVariableWatch");
7536
7647
  var debug5 = dbg("CSSVariableWatch");
@@ -7545,14 +7656,14 @@ var WRAPPER_STYLE = {
7545
7656
  };
7546
7657
  var useCSSVariableWatch = (params) => {
7547
7658
  const lastValueRef = (0, import_react44.useRef)(0);
7548
- const onResize = React33.useCallback(({ height }) => {
7659
+ const onResize = React32.useCallback(({ height }) => {
7549
7660
  if (height && height !== lastValueRef.current) {
7550
7661
  lastValueRef.current = height;
7551
7662
  params.onChange(height);
7552
7663
  }
7553
7664
  }, [params.onChange]);
7554
7665
  useResizeObserver(params.ref, onResize, { earlyAttach: true });
7555
- React33.useLayoutEffect(() => {
7666
+ React32.useLayoutEffect(() => {
7556
7667
  const value = params.ref.current.getBoundingClientRect().height;
7557
7668
  if (value) {
7558
7669
  lastValueRef.current = value;
@@ -7568,11 +7679,11 @@ var CSSVariableWatch = (props) => {
7568
7679
  useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
7569
7680
  ref: domRef
7570
7681
  }));
7571
- return /* @__PURE__ */ React33.createElement("div", {
7682
+ return /* @__PURE__ */ React32.createElement("div", {
7572
7683
  "data-name": "css-variable-watcher",
7573
7684
  "data-var": props.varName,
7574
7685
  style: WRAPPER_STYLE
7575
- }, /* @__PURE__ */ React33.createElement("div", {
7686
+ }, /* @__PURE__ */ React32.createElement("div", {
7576
7687
  ref: domRef,
7577
7688
  style: {
7578
7689
  height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
@@ -7665,7 +7776,7 @@ function useDOMProps(initialDOMProps) {
7665
7776
  }
7666
7777
 
7667
7778
  // src/components/InfiniteTable/components/LoadMask.tsx
7668
- var React34 = __toModule(require("react"));
7779
+ var React33 = __toModule(require("react"));
7669
7780
 
7670
7781
  // src/components/InfiniteTable/components/LoadMask.css.ts
7671
7782
  var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
@@ -7677,15 +7788,15 @@ var { rootClassName: rootClassName11 } = internalProps;
7677
7788
  var baseCls2 = `${rootClassName11}-LoadMask`;
7678
7789
  function LoadMaskFn(props) {
7679
7790
  const { visible, children = "Loading" } = props;
7680
- return /* @__PURE__ */ React34.createElement("div", {
7791
+ return /* @__PURE__ */ React33.createElement("div", {
7681
7792
  className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls2}`
7682
- }, /* @__PURE__ */ React34.createElement("div", {
7793
+ }, /* @__PURE__ */ React33.createElement("div", {
7683
7794
  className: `${LoadMaskOverlayCls} ${baseCls2}-Overlay`
7684
- }), /* @__PURE__ */ React34.createElement("div", {
7795
+ }), /* @__PURE__ */ React33.createElement("div", {
7685
7796
  className: `${LoadMaskTextCls} ${baseCls2}-Text`
7686
7797
  }, children));
7687
7798
  }
7688
- var LoadMask = React34.memo(LoadMaskFn);
7799
+ var LoadMask = React33.memo(LoadMaskFn);
7689
7800
 
7690
7801
  // src/components/InfiniteTable/index.tsx
7691
7802
  var InfiniteTableClassName = internalProps.rootClassName;
@@ -7704,7 +7815,7 @@ var InfiniteTableRoot = getComponentStateRoot({
7704
7815
  getParentState: () => useDataSource(),
7705
7816
  debugName: "InfiniteTable"
7706
7817
  });
7707
- var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
7818
+ var InfiniteTableComponent = React34.memo(function InfiniteTableComponent2() {
7708
7819
  var _a;
7709
7820
  const {
7710
7821
  componentState,
@@ -7714,7 +7825,8 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
7714
7825
  } = useInfiniteTable();
7715
7826
  const {
7716
7827
  componentState: { dataArray, loading },
7717
- getState: getDataSourceState
7828
+ getState: getDataSourceState,
7829
+ componentActions: dataSourceActions
7718
7830
  } = useDataSourceContextValue();
7719
7831
  const {
7720
7832
  domRef,
@@ -7727,7 +7839,8 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
7727
7839
  onHeaderHeightCSSVarChange,
7728
7840
  rowHeightCSSVar,
7729
7841
  headerHeightCSSVar,
7730
- components
7842
+ components,
7843
+ scrollStopDelay
7731
7844
  } = componentState;
7732
7845
  const { columnShifts, bodySize } = componentState;
7733
7846
  const {
@@ -7740,6 +7853,7 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
7740
7853
  scrollbars,
7741
7854
  applyScrollVertical,
7742
7855
  horizontalVirtualBrain,
7856
+ verticalVirtualBrain,
7743
7857
  reservedContentHeight
7744
7858
  } = useListRendering({
7745
7859
  getComputed,
@@ -7748,10 +7862,17 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
7748
7862
  bodySize,
7749
7863
  computed
7750
7864
  });
7865
+ React34.useEffect(() => {
7866
+ const dataSourceState = getDataSourceState();
7867
+ const onChange = debounce((renderRange) => {
7868
+ dataSourceState.notifyRenderRangeChange(renderRange);
7869
+ }, { wait: scrollStopDelay });
7870
+ return verticalVirtualBrain.onRenderRangeChange(onChange);
7871
+ }, [verticalVirtualBrain, scrollStopDelay]);
7751
7872
  const licenseValid = useLicense(licenseKey);
7752
7873
  const domProps = useDOMProps(componentState.domProps);
7753
7874
  const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
7754
- React35.useLayoutEffect(() => {
7875
+ React34.useLayoutEffect(() => {
7755
7876
  const dataSourceState = getDataSourceState();
7756
7877
  const { onScrollbarsChange } = getInfiniteTableState();
7757
7878
  const { notifyScrollbarsChange } = dataSourceState;
@@ -7760,31 +7881,34 @@ var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
7760
7881
  }
7761
7882
  notifyScrollbarsChange(scrollbars);
7762
7883
  }, [scrollbars]);
7763
- return /* @__PURE__ */ React35.createElement("div", __spreadValues({
7884
+ React34.useEffect(() => {
7885
+ dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
7886
+ }, [scrollStopDelay]);
7887
+ return /* @__PURE__ */ React34.createElement("div", __spreadValues({
7764
7888
  ref: domRef
7765
- }, domProps), header ? /* @__PURE__ */ React35.createElement(TableHeaderWrapper, {
7889
+ }, domProps), header ? /* @__PURE__ */ React34.createElement(TableHeaderWrapper, {
7766
7890
  brain: horizontalVirtualBrain,
7767
7891
  repaintId,
7768
7892
  scrollbars
7769
- }) : null, /* @__PURE__ */ React35.createElement(InfiniteTableBody, null, /* @__PURE__ */ React35.createElement(VirtualScrollContainer, {
7893
+ }) : null, /* @__PURE__ */ React34.createElement(InfiniteTableBody, null, /* @__PURE__ */ React34.createElement(VirtualScrollContainer, {
7770
7894
  ref: scrollerDOMRef,
7771
7895
  onContainerScroll: applyScrollVertical,
7772
7896
  scrollable: ONLY_VERTICAL_SCROLLBAR
7773
- }, /* @__PURE__ */ React35.createElement("div", {
7897
+ }, /* @__PURE__ */ React34.createElement("div", {
7774
7898
  className: display.flex
7775
- }, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React35.createElement(SpacePlaceholder, {
7899
+ }, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React34.createElement(SpacePlaceholder, {
7776
7900
  count: dataArray.length,
7777
7901
  width: 0,
7778
7902
  height: reservedContentHeight
7779
- })), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React35.createElement(LoadMaskCmp, {
7903
+ })), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React34.createElement(LoadMaskCmp, {
7780
7904
  visible: loading
7781
- }, loadingText)), licenseValid ? null : /* @__PURE__ */ React35.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React35.createElement("div", {
7905
+ }, loadingText)), licenseValid ? null : /* @__PURE__ */ React34.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React34.createElement("div", {
7782
7906
  ref: portalDOMRef,
7783
7907
  className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
7784
- }), rowHeightCSSVar ? /* @__PURE__ */ React35.createElement(CSSVariableWatch, {
7908
+ }), rowHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
7785
7909
  varName: rowHeightCSSVar,
7786
7910
  onChange: onRowHeightCSSVarChange
7787
- }) : null, headerHeightCSSVar ? /* @__PURE__ */ React35.createElement(CSSVariableWatch, {
7911
+ }) : null, headerHeightCSSVar ? /* @__PURE__ */ React34.createElement(CSSVariableWatch, {
7788
7912
  varName: headerHeightCSSVar,
7789
7913
  onChange: onHeaderHeightCSSVarChange
7790
7914
  }) : null);
@@ -7820,25 +7944,25 @@ function InfiniteTableContextProvider() {
7820
7944
  }
7821
7945
  componentActions.bodySize = bodySize;
7822
7946
  }, { earlyAttach: true });
7823
- React35.useEffect(() => {
7947
+ React34.useEffect(() => {
7824
7948
  return () => {
7825
7949
  componentState.onRowHeightCSSVarChange.destroy();
7826
7950
  componentState.onHeaderHeightCSSVarChange.destroy();
7827
7951
  };
7828
7952
  }, []);
7829
- React35.useEffect(() => {
7953
+ React34.useEffect(() => {
7830
7954
  if (scrollerDOMRef.current) {
7831
7955
  scrollerDOMRef.current.scrollTop = 0;
7832
7956
  }
7833
7957
  }, [scrollTopId, scrollerDOMRef]);
7834
7958
  const TableContext2 = getInfiniteTableContext();
7835
- return /* @__PURE__ */ React35.createElement(TableContext2.Provider, {
7959
+ return /* @__PURE__ */ React34.createElement(TableContext2.Provider, {
7836
7960
  value: contextValue
7837
- }, /* @__PURE__ */ React35.createElement(InfiniteTableComponent, null));
7961
+ }, /* @__PURE__ */ React34.createElement(InfiniteTableComponent, null));
7838
7962
  }
7839
7963
  function InfiniteTable(props) {
7840
- const table = /* @__PURE__ */ React35.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React35.createElement(InfiniteTableContextProvider, null));
7841
- return /* @__PURE__ */ React35.createElement(React35.StrictMode, null, table);
7964
+ const table = /* @__PURE__ */ React34.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React34.createElement(InfiniteTableContextProvider, null));
7965
+ return /* @__PURE__ */ React34.createElement(React34.StrictMode, null, table);
7842
7966
  }
7843
7967
  InfiniteTable.defaultProps = {
7844
7968
  rowHeight: 40,