@infinite-table/infinite-react 0.2.14 → 0.2.17

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 +45 -13
  2. package/index.esm.js +295 -183
  3. package/index.js +328 -218
  4. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -635,7 +635,7 @@ import {
635
635
  StrictMode,
636
636
  createElement as createElement32,
637
637
  memo as memo13,
638
- useEffect as useEffect25,
638
+ useEffect as useEffect26,
639
639
  useLayoutEffect as useLayoutEffect5
640
640
  } from "react";
641
641
 
@@ -1301,6 +1301,7 @@ var forwardProps = (setupState) => {
1301
1301
  sortable: (sortable) => sortable != null ? sortable : true,
1302
1302
  hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
1303
1303
  pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
1304
+ pivotGrandTotalColumnPosition: 1,
1304
1305
  licenseKey: (licenseKey) => licenseKey || "",
1305
1306
  columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
1306
1307
  header: (header) => header != null ? header : true,
@@ -1882,7 +1883,8 @@ var getComputedVisibleColumns = ({
1882
1883
  valueGetter: colType.valueGetter,
1883
1884
  renderValue: colType.renderValue,
1884
1885
  render: colType.render,
1885
- style: colType.style
1886
+ style: colType.style,
1887
+ components: colType.components
1886
1888
  }, c), {
1887
1889
  cssEllipsis,
1888
1890
  headerCssEllipsis,
@@ -2142,7 +2144,7 @@ var useComputedVisibleColumns = ({
2142
2144
  var sortAscending = (a, b) => a - b;
2143
2145
 
2144
2146
  // src/components/InfiniteTable/hooks/useComputed.ts
2145
- import { useCallback as useCallback5, useEffect as useEffect10, useMemo as useMemo6, useState as useState5 } from "react";
2147
+ import { useCallback as useCallback5, useEffect as useEffect11, useMemo as useMemo6, useState as useState5 } from "react";
2146
2148
 
2147
2149
  // src/components/hooks/useComponentState/index.tsx
2148
2150
  import {
@@ -2541,7 +2543,7 @@ function useColumnGroups() {
2541
2543
  }
2542
2544
 
2543
2545
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
2544
- import { useEffect as useEffect9, useMemo as useMemo5 } from "react";
2546
+ import { useEffect as useEffect10, useMemo as useMemo5 } from "react";
2545
2547
 
2546
2548
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
2547
2549
  import {
@@ -2620,6 +2622,11 @@ var userSelect = { none: "_16lm1iwm" };
2620
2622
  var willChange = { transform: "_16lm1iw19" };
2621
2623
  var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
2622
2624
 
2625
+ // src/components/InfiniteTable/utils/RenderHookComponent.tsx
2626
+ function RenderHookComponent(props) {
2627
+ return props.render(props.renderParam);
2628
+ }
2629
+
2623
2630
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
2624
2631
  function getGroupColumnRender({
2625
2632
  groupIndexForColumn,
@@ -2630,7 +2637,10 @@ function getGroupColumnRender({
2630
2637
  var _a, _b, _c;
2631
2638
  let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
2632
2639
  if (column.renderValue) {
2633
- value = column.renderValue(renderOptions);
2640
+ value = /* @__PURE__ */ createElement4(RenderHookComponent, {
2641
+ render: column.renderValue,
2642
+ renderParam: renderOptions
2643
+ });
2634
2644
  }
2635
2645
  let groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
2636
2646
  if (!groupRowInfo) {
@@ -2662,7 +2672,10 @@ function getGroupColumnRender({
2662
2672
  toggleGroupRow(groupKeys);
2663
2673
  }
2664
2674
  });
2665
- icon = column.renderGroupIcon ? column.renderGroupIcon(Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)) : defaultIcon;
2675
+ icon = column.renderGroupIcon ? /* @__PURE__ */ createElement4(RenderHookComponent, {
2676
+ render: column.renderGroupIcon,
2677
+ renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
2678
+ }) : defaultIcon;
2666
2679
  }
2667
2680
  return /* @__PURE__ */ createElement4("div", {
2668
2681
  className: join(display.flex, alignItems.center)
@@ -2739,6 +2752,27 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
2739
2752
  return generatedGroupColumn;
2740
2753
  }
2741
2754
 
2755
+ // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
2756
+ import { useEffect as useEffect7, useRef as useRef5 } from "react";
2757
+ function useEffectWithRaf(fn, deps) {
2758
+ const rafId = useRef5(0);
2759
+ const removeFnRaf = useRef5();
2760
+ useEffect7(() => {
2761
+ rafId.current = requestAnimationFrame(() => {
2762
+ removeFnRaf.current = fn();
2763
+ });
2764
+ return () => {
2765
+ if (rafId.current) {
2766
+ cancelAnimationFrame(rafId.current);
2767
+ }
2768
+ if (typeof removeFnRaf.current === "function") {
2769
+ removeFnRaf.current();
2770
+ removeFnRaf.current = void 0;
2771
+ }
2772
+ };
2773
+ }, deps);
2774
+ }
2775
+
2742
2776
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
2743
2777
  import { useCallback as useCallback4 } from "react";
2744
2778
 
@@ -2823,7 +2857,7 @@ var getMultisortFunction = (sortInfo, get) => {
2823
2857
  };
2824
2858
 
2825
2859
  // src/components/DataSource/privateHooks/useLoadData.ts
2826
- import { useEffect as useEffect8, useMemo as useMemo4, useRef as useRef6, useState as useState4 } from "react";
2860
+ import { useEffect as useEffect9, useMemo as useMemo4, useRef as useRef7, useState as useState4 } from "react";
2827
2861
 
2828
2862
  // src/utils/DeepMap/once.ts
2829
2863
  function once(fn) {
@@ -2909,14 +2943,13 @@ var DeepMap = class {
2909
2943
  for (let i = 0, len = keys.length; i < len; i++) {
2910
2944
  const key = keys[i];
2911
2945
  const last = i === len - 1;
2946
+ const pair = currentMap.get(key) || {};
2912
2947
  if (last) {
2913
- const pair = currentMap.has(key) ? currentMap.get(key) : {};
2914
2948
  pair.revision = this.revision++;
2915
2949
  pair.value = value;
2916
2950
  currentMap.set(key, pair);
2917
2951
  this.length++;
2918
2952
  } else {
2919
- const pair = currentMap.has(key) ? currentMap.get(key) : {};
2920
2953
  if (!pair.map) {
2921
2954
  pair.map = new Map();
2922
2955
  currentMap.set(key, pair);
@@ -2927,7 +2960,6 @@ var DeepMap = class {
2927
2960
  return this;
2928
2961
  }
2929
2962
  get(keys) {
2930
- var _a;
2931
2963
  let currentMap = this.map;
2932
2964
  if (!keys.length) {
2933
2965
  keys = [this.emptyKey];
@@ -2935,10 +2967,10 @@ var DeepMap = class {
2935
2967
  for (let i = 0, len = keys.length; i < len; i++) {
2936
2968
  const key = keys[i];
2937
2969
  const last = i === len - 1;
2970
+ const pair = currentMap.get(key);
2938
2971
  if (last) {
2939
- return (_a = currentMap.get(key)) == null ? void 0 : _a.value;
2972
+ return pair ? pair.value : void 0;
2940
2973
  } else {
2941
- const pair = currentMap.get(key);
2942
2974
  if (!pair || !pair.map) {
2943
2975
  return;
2944
2976
  }
@@ -2976,8 +3008,8 @@ var DeepMap = class {
2976
3008
  for (let i = 0, len = keys.length; i < len; i++) {
2977
3009
  const key = keys[i];
2978
3010
  const last = i === len - 1;
3011
+ const pair = currentMap.get(key);
2979
3012
  if (last) {
2980
- const pair = currentMap.get(key);
2981
3013
  if (pair) {
2982
3014
  if (pair.hasOwnProperty("value")) {
2983
3015
  delete pair.value;
@@ -2994,7 +3026,6 @@ var DeepMap = class {
2994
3026
  }
2995
3027
  break;
2996
3028
  } else {
2997
- const pair = currentMap.get(key);
2998
3029
  if (!pair || !pair.map) {
2999
3030
  result = false;
3000
3031
  break;
@@ -3004,11 +3035,11 @@ var DeepMap = class {
3004
3035
  }
3005
3036
  }
3006
3037
  while (maps.length) {
3007
- let map2 = maps.pop();
3008
- let key = keys.pop();
3038
+ const map2 = maps.pop();
3039
+ const key = keys.pop();
3009
3040
  if (key && (map2 == null ? void 0 : map2.size) === 0) {
3010
- let parentMap = maps[maps.length - 1];
3011
- let pair = parentMap == null ? void 0 : parentMap.get(key);
3041
+ const parentMap = maps[maps.length - 1];
3042
+ const pair = parentMap == null ? void 0 : parentMap.get(key);
3012
3043
  if (pair) {
3013
3044
  delete pair.map;
3014
3045
  if (!pair.hasOwnProperty("value")) {
@@ -3027,11 +3058,10 @@ var DeepMap = class {
3027
3058
  for (let i = 0, len = keys.length; i < len; i++) {
3028
3059
  const key = keys[i];
3029
3060
  const last = i === len - 1;
3061
+ const pair = currentMap.get(key);
3030
3062
  if (last) {
3031
- const pair = currentMap.get(key);
3032
- return !!pair && pair.hasOwnProperty("value");
3063
+ return pair ? pair.hasOwnProperty("value") : false;
3033
3064
  } else {
3034
- const pair = currentMap.get(key);
3035
3065
  if (!pair || !pair.map) {
3036
3066
  return false;
3037
3067
  }
@@ -3499,12 +3529,12 @@ function enhancedFlatten(param) {
3499
3529
  }
3500
3530
 
3501
3531
  // src/components/hooks/useEffectWithChanges.ts
3502
- import { useEffect as useEffect7, useRef as useRef5 } from "react";
3532
+ import { useEffect as useEffect8, useRef as useRef6 } from "react";
3503
3533
  function useEffectWithChanges(fn, deps) {
3504
- const prevRef = useRef5({});
3505
- const oldValuesRef = useRef5({});
3534
+ const prevRef = useRef6({});
3535
+ const oldValuesRef = useRef6({});
3506
3536
  const oldValues = oldValuesRef.current;
3507
- const changesRef = useRef5({});
3537
+ const changesRef = useRef6({});
3508
3538
  const changes = changesRef.current;
3509
3539
  const useEffectDeps = [];
3510
3540
  for (let k in deps) {
@@ -3517,7 +3547,7 @@ function useEffectWithChanges(fn, deps) {
3517
3547
  }
3518
3548
  }
3519
3549
  prevRef.current = deps;
3520
- useEffect7(() => {
3550
+ useEffect8(() => {
3521
3551
  const changes2 = changesRef.current;
3522
3552
  const result = fn(changes2, oldValues);
3523
3553
  changesRef.current = {};
@@ -3689,8 +3719,8 @@ function useLoadData() {
3689
3719
  vertical: false,
3690
3720
  horizontal: false
3691
3721
  });
3692
- const scrollbarsRef = useRef6(scrollbars);
3693
- useEffect8(() => {
3722
+ const scrollbarsRef = useRef7(scrollbars);
3723
+ useEffect9(() => {
3694
3724
  notifyScrollbarsChange.onChange((scrollbars2) => {
3695
3725
  if (!scrollbars2) {
3696
3726
  return;
@@ -3700,7 +3730,7 @@ function useLoadData() {
3700
3730
  });
3701
3731
  return () => notifyScrollbarsChange.destroy();
3702
3732
  }, [notifyScrollbarsChange]);
3703
- useEffect8(() => {
3733
+ useEffect9(() => {
3704
3734
  const frameId = requestAnimationFrame(() => {
3705
3735
  var _a;
3706
3736
  if (!((_a = scrollbarsRef.current) == null ? void 0 : _a.vertical) && livePaginationCursor) {
@@ -3709,7 +3739,7 @@ function useLoadData() {
3709
3739
  });
3710
3740
  return () => cancelAnimationFrame(frameId);
3711
3741
  }, [livePaginationCursor]);
3712
- useEffect8(() => {
3742
+ useEffect9(() => {
3713
3743
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2 } = getComponentState();
3714
3744
  if (!scrollbars.vertical && livePagination2) {
3715
3745
  if (livePaginationCursor2) {
@@ -3723,7 +3753,7 @@ function useLoadData() {
3723
3753
  pivotBy,
3724
3754
  cursorId: livePagination ? stateCursorId : null
3725
3755
  };
3726
- const initialRef = useRef6(true);
3756
+ const initialRef = useRef7(true);
3727
3757
  useLazyLoadRange();
3728
3758
  useEffectWithChanges(() => {
3729
3759
  const componentState2 = getComponentState();
@@ -3761,7 +3791,7 @@ function useLazyLoadRange() {
3761
3791
  dataArray,
3762
3792
  scrollStopDelayUpdatedByTable
3763
3793
  } = componentState;
3764
- const latestRenderRangeRef = useRef6(null);
3794
+ const latestRenderRangeRef = useRef7(null);
3765
3795
  const loadRange = (renderRange, cache = loadingCache) => {
3766
3796
  const componentState2 = getComponentState();
3767
3797
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -3781,7 +3811,7 @@ function useLazyLoadRange() {
3781
3811
  }, cache);
3782
3812
  };
3783
3813
  const debouncedLoadRange = useMemo4(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
3784
- useEffect8(() => {
3814
+ useEffect9(() => {
3785
3815
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
3786
3816
  return notifyRenderRangeChange.onChange((renderRange) => {
3787
3817
  latestRenderRangeRef.current = renderRange;
@@ -3790,7 +3820,7 @@ function useLazyLoadRange() {
3790
3820
  }
3791
3821
  return;
3792
3822
  }, [lazyLoadBatchSize, loadingCache]);
3793
- useEffect8(() => {
3823
+ useEffect9(() => {
3794
3824
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
3795
3825
  debouncedLoadRange();
3796
3826
  }
@@ -4066,6 +4096,7 @@ function initSetupState2() {
4066
4096
  notifyScrollStop: buildSubscriptionCallback(),
4067
4097
  notifyRenderRangeChange: buildSubscriptionCallback(),
4068
4098
  pivotTotalColumnPosition: "end",
4099
+ pivotGrandTotalColumnPosition: false,
4069
4100
  scrollStopDelayUpdatedByTable: 100,
4070
4101
  originalLazyGroupData,
4071
4102
  originalLazyGroupDataChangeDetect: 0,
@@ -4253,6 +4284,7 @@ function getPivotColumnsAndColumnGroups({
4253
4284
  deepMap,
4254
4285
  pivotBy,
4255
4286
  pivotTotalColumnPosition,
4287
+ pivotGrandTotalColumnPosition,
4256
4288
  reducers = {},
4257
4289
  showSeparatePivotColumnForSingleAggregation = false
4258
4290
  }) {
@@ -4262,6 +4294,28 @@ function getPivotColumnsAndColumnGroups({
4262
4294
  });
4263
4295
  const columns = new Map([]);
4264
4296
  const columnGroups = new Map();
4297
+ const addGrandTotalColumns = once(function() {
4298
+ aggregationReducers.forEach((reducer, index) => {
4299
+ columns.set(`total:${reducer.id}`, prepareColumn({
4300
+ header: `${reducer.name || reducer.id} total`,
4301
+ pivotBy,
4302
+ pivotColumn: true,
4303
+ pivotTotalColumn: true,
4304
+ pivotAggregator: reducer,
4305
+ pivotAggregatorIndex: index,
4306
+ pivotGroupKeys: [],
4307
+ pivotGroupKey: "",
4308
+ pivotIndex: -1,
4309
+ valueGetter: ({ rowInfo }) => {
4310
+ var _a;
4311
+ return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
4312
+ }
4313
+ }));
4314
+ });
4315
+ });
4316
+ if (!pivotLength && pivotTotalColumnPosition === "start" || pivotGrandTotalColumnPosition === "start") {
4317
+ addGrandTotalColumns();
4318
+ }
4265
4319
  const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
4266
4320
  deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
4267
4321
  keys = [...keys];
@@ -4366,25 +4420,10 @@ function getPivotColumnsAndColumnGroups({
4366
4420
  next == null ? void 0 : next();
4367
4421
  }
4368
4422
  });
4369
- if (!pivotLength) {
4370
- aggregationReducers.forEach((reducer, index) => {
4371
- columns.set(`total:${reducer.id}`, prepareColumn({
4372
- header: `${reducer.name || reducer.id} total`,
4373
- pivotBy,
4374
- pivotColumn: true,
4375
- pivotTotalColumn: true,
4376
- pivotAggregator: reducer,
4377
- pivotAggregatorIndex: index,
4378
- pivotGroupKeys: [],
4379
- pivotGroupKey: "",
4380
- pivotIndex: -1,
4381
- valueGetter: ({ rowInfo }) => {
4382
- var _a;
4383
- return (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id];
4384
- }
4385
- }));
4386
- });
4423
+ if (!pivotLength && pivotTotalColumnPosition === "end" || pivotGrandTotalColumnPosition === "end") {
4424
+ addGrandTotalColumns();
4387
4425
  }
4426
+ console.log(columns.keys());
4388
4427
  const result = {
4389
4428
  columns,
4390
4429
  columnGroups
@@ -4415,7 +4454,7 @@ function toRowInfo(data, id, index) {
4415
4454
  };
4416
4455
  }
4417
4456
  function concludeReducer(params) {
4418
- var _a;
4457
+ var _a, _b;
4419
4458
  const { state, previousState } = params;
4420
4459
  const sortInfo = state.sortInfo;
4421
4460
  let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
@@ -4450,6 +4489,7 @@ function concludeReducer(params) {
4450
4489
  "pivotBy",
4451
4490
  "aggregationReducers",
4452
4491
  "pivotTotalColumnPosition",
4492
+ "pivotGrandTotalColumnPosition",
4453
4493
  "showSeparatePivotColumnForSingleAggregation",
4454
4494
  "sortInfo"
4455
4495
  ]);
@@ -4496,6 +4536,7 @@ function concludeReducer(params) {
4496
4536
  deepMap: groupResult.topLevelPivotColumns,
4497
4537
  pivotBy,
4498
4538
  pivotTotalColumnPosition: (_a = state.pivotTotalColumnPosition) != null ? _a : "end",
4539
+ pivotGrandTotalColumnPosition: (_b = state.pivotGrandTotalColumnPosition) != null ? _b : false,
4499
4540
  reducers: state.aggregationReducers,
4500
4541
  showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
4501
4542
  }) : void 0;
@@ -4610,15 +4651,24 @@ function useColumnsWhen() {
4610
4651
  componentActions: dataSourceActions
4611
4652
  } = useDataSourceContextValue();
4612
4653
  const {
4613
- componentState: { groupRenderStrategy, pivotTotalColumnPosition }
4654
+ componentState: {
4655
+ groupRenderStrategy,
4656
+ pivotTotalColumnPosition,
4657
+ pivotGrandTotalColumnPosition
4658
+ }
4614
4659
  } = useComponentState();
4615
4660
  const groupByMap = useGroupByMap(groupBy);
4616
- useEffect9(() => {
4661
+ useEffect10(() => {
4617
4662
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
4618
4663
  }, [groupRenderStrategy]);
4619
- useEffect9(() => {
4664
+ useEffect10(() => {
4620
4665
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
4621
4666
  }, [pivotTotalColumnPosition]);
4667
+ useEffect10(() => {
4668
+ if (pivotGrandTotalColumnPosition != void 0) {
4669
+ dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
4670
+ }
4671
+ }, [pivotGrandTotalColumnPosition]);
4622
4672
  useColumnsWhenInlineGroupRenderStrategy(groupByMap);
4623
4673
  const { toggleGroupRow } = useColumnsWhenGrouping();
4624
4674
  useHideColumns(groupByMap);
@@ -4682,7 +4732,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
4682
4732
  });
4683
4733
  return computedColumns.size === 0 ? void 0 : computedColumns;
4684
4734
  }
4685
- useEffect9(() => {
4735
+ useEffect10(() => {
4686
4736
  const update = () => {
4687
4737
  componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
4688
4738
  };
@@ -4706,17 +4756,19 @@ function useColumnsWhenGrouping() {
4706
4756
  groupRenderStrategy,
4707
4757
  pivotColumns,
4708
4758
  pivotColumn,
4709
- pivotTotalColumnPosition
4759
+ pivotTotalColumnPosition,
4760
+ pivotGrandTotalColumnPosition
4710
4761
  }
4711
4762
  } = useComponentState();
4712
4763
  const toggleGroupRow = useToggleGroupRow();
4713
- useEffect9(() => {
4764
+ useEffect10(() => {
4714
4765
  const update = () => {
4715
4766
  const columnsWhenGrouping = getColumnsWhenGrouping({
4716
4767
  columns,
4717
4768
  groupColumn,
4718
4769
  pivotColumn,
4719
4770
  pivotTotalColumnPosition,
4771
+ pivotGrandTotalColumnPosition,
4720
4772
  groupRenderStrategy: groupRenderStrategy === "inline" ? "single-column" : groupRenderStrategy,
4721
4773
  groupBy,
4722
4774
  pivotBy,
@@ -4764,7 +4816,7 @@ function useHideColumns(groupByMap) {
4764
4816
  }
4765
4817
  } = useComponentState();
4766
4818
  const prevHideEmptyGroupColumns = usePrevious(hideEmptyGroupColumns);
4767
- useEffect9(() => {
4819
+ useEffectWithRaf(() => {
4768
4820
  if (groupRenderStrategy !== "multi-column") {
4769
4821
  return;
4770
4822
  }
@@ -4842,7 +4894,7 @@ function useHideColumns(groupByMap) {
4842
4894
  hideEmptyGroupColumns ? groupRowsState : null,
4843
4895
  hideEmptyGroupColumns
4844
4896
  ]);
4845
- useEffect9(() => {
4897
+ useEffect10(() => {
4846
4898
  const isGrouped = groupBy.length > 0;
4847
4899
  const currentState = getComponentState();
4848
4900
  const { controlledColumnVisibility, columnVisibility } = currentState;
@@ -4877,6 +4929,7 @@ function getColumnsWhenGrouping(params) {
4877
4929
  pivotBy,
4878
4930
  groupColumn,
4879
4931
  pivotTotalColumnPosition,
4932
+ pivotGrandTotalColumnPosition,
4880
4933
  pivotColumn,
4881
4934
  groupRenderStrategy,
4882
4935
  toggleGroupRow,
@@ -4916,7 +4969,12 @@ function getColumnsWhenGrouping(params) {
4916
4969
  });
4917
4970
  pivotColumns.forEach((col, key) => {
4918
4971
  var _a, _b;
4919
- if (col.pivotTotalColumn && pivotTotalColumnPosition === false) {
4972
+ const isSimpleTotalColumn = col.pivotTotalColumn && col.columnGroup;
4973
+ const isGrandTotalColumn = col.pivotTotalColumn && !col.columnGroup;
4974
+ if (isSimpleTotalColumn && pivotTotalColumnPosition === false) {
4975
+ return;
4976
+ }
4977
+ if (isGrandTotalColumn && pivotGrandTotalColumnPosition === false) {
4920
4978
  return;
4921
4979
  }
4922
4980
  let column = __spreadValues({}, col);
@@ -4980,7 +5038,7 @@ function useComputed() {
4980
5038
  }
4981
5039
  });
4982
5040
  });
4983
- useEffect10(() => {
5041
+ useEffect11(() => {
4984
5042
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
4985
5043
  }, [showSeparatePivotColumnForSingleAggregation]);
4986
5044
  const { multiSort } = dataSourceState;
@@ -5186,17 +5244,18 @@ import {
5186
5244
  createElement as createElement14,
5187
5245
  memo as memo6
5188
5246
  } from "react";
5189
- import { useCallback as useCallback8, useEffect as useEffect14, useRef as useRef9 } from "react";
5247
+ import { useCallback as useCallback8, useEffect as useEffect15, useRef as useRef10 } from "react";
5190
5248
 
5191
5249
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
5192
5250
  import {
5193
- Fragment as Fragment2,
5251
+ createContext as createContext4,
5194
5252
  createElement as createElement10
5195
5253
  } from "react";
5196
- import { useCallback as useCallback7, useEffect as useEffect12, useRef as useRef8 } from "react";
5254
+ import { useCallback as useCallback7, useContext as useContext5, useEffect as useEffect13, useRef as useRef9 } from "react";
5197
5255
 
5198
5256
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
5199
5257
  import {
5258
+ Fragment as Fragment2,
5200
5259
  createElement as createElement8,
5201
5260
  memo as memo3
5202
5261
  } from "react";
@@ -5221,7 +5280,7 @@ var { rootClassName: rootClassName2 } = internalProps;
5221
5280
  var InfiniteTableCellClassName = `${rootClassName2}Cell`;
5222
5281
  var InfiniteTableCellContentClassName = `${rootClassName2}Cell_content`;
5223
5282
  function InfiniteTableCellFn(props) {
5224
- var _b, _c;
5283
+ var _b, _c, _d, _e;
5225
5284
  const _a = props, {
5226
5285
  cssEllipsis = true,
5227
5286
  virtualized = true,
@@ -5229,10 +5288,12 @@ function InfiniteTableCellFn(props) {
5229
5288
  offsetProperty = "left",
5230
5289
  column,
5231
5290
  domRef,
5232
- children,
5233
5291
  afterChildren,
5234
5292
  beforeChildren,
5235
- offset
5293
+ offset,
5294
+ cellType,
5295
+ cssPosition: _cssPosition,
5296
+ renderChildren
5236
5297
  } = _a, domProps = __objRest(_a, [
5237
5298
  "cssEllipsis",
5238
5299
  "virtualized",
@@ -5240,11 +5301,14 @@ function InfiniteTableCellFn(props) {
5240
5301
  "offsetProperty",
5241
5302
  "column",
5242
5303
  "domRef",
5243
- "children",
5244
5304
  "afterChildren",
5245
5305
  "beforeChildren",
5246
- "offset"
5306
+ "offset",
5307
+ "cellType",
5308
+ "cssPosition",
5309
+ "renderChildren"
5247
5310
  ]);
5311
+ const children = renderChildren();
5248
5312
  const { columnShifts } = useInfiniteTableState();
5249
5313
  const shifting = !!columnShifts;
5250
5314
  const style = __spreadValues({
@@ -5259,14 +5323,21 @@ function InfiniteTableCellFn(props) {
5259
5323
  style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
5260
5324
  }
5261
5325
  }
5262
- return /* @__PURE__ */ createElement8("div", __spreadProps(__spreadValues({}, domProps), {
5263
- ref: domRef,
5326
+ const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
5264
5327
  style,
5265
- "data-name": `Cell`,
5266
- className: join(domProps.className, columnAlignCellStyle[(_b = column.align) != null ? _b : "start"], justifyContent[(_c = column.align) != null ? _c : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : "")
5267
- }), beforeChildren, /* @__PURE__ */ createElement8("div", {
5268
- className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
5269
- }, children), afterChildren);
5328
+ "data-name": "Cell",
5329
+ className: join(domProps.className, columnAlignCellStyle[(_b = column.align) != null ? _b : "start"], justifyContent[(_c = column.align) != null ? _c : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
5330
+ children: /* @__PURE__ */ createElement8(Fragment2, null, beforeChildren, /* @__PURE__ */ createElement8("div", {
5331
+ className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
5332
+ }, children), afterChildren)
5333
+ });
5334
+ const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
5335
+ if (RenderComponent) {
5336
+ return /* @__PURE__ */ createElement8(RenderComponent, __spreadValues({}, finalDOMProps));
5337
+ }
5338
+ return /* @__PURE__ */ createElement8("div", __spreadProps(__spreadValues({}, finalDOMProps), {
5339
+ ref: domRef
5340
+ }));
5270
5341
  }
5271
5342
  var InfiniteTableCell = memo3(InfiniteTableCellFn);
5272
5343
 
@@ -5275,7 +5346,7 @@ var import_binary_search2 = __toModule(require_binary_search());
5275
5346
  import {
5276
5347
  useCallback as useCallback6,
5277
5348
  useMemo as useMemo7,
5278
- useRef as useRef7,
5349
+ useRef as useRef8,
5279
5350
  useState as useState6
5280
5351
  } from "react";
5281
5352
 
@@ -5313,11 +5384,11 @@ var useColumnPointerEvents = ({
5313
5384
  }) => {
5314
5385
  const [draggingDiff, setDraggingDiff] = useState6(null);
5315
5386
  const [proxyOffset, setProxyOffset] = useState6(null);
5316
- const breakpointsRef = useRef7([]);
5317
- const pointerMoveRef = useRef7(null);
5318
- const didDragRef = useRef7(false);
5319
- const initialClientPos = useRef7(null);
5320
- const currentDropIndexRef = useRef7(null);
5387
+ const breakpointsRef = useRef8([]);
5388
+ const pointerMoveRef = useRef8(null);
5389
+ const didDragRef = useRef8(false);
5390
+ const initialClientPos = useRef8(null);
5391
+ const currentDropIndexRef = useRef8(null);
5321
5392
  const dragging = draggingDiff != null;
5322
5393
  const { componentActions, computed } = useInfiniteTable();
5323
5394
  const { computedColumnOrder } = computed;
@@ -5330,7 +5401,7 @@ var useColumnPointerEvents = ({
5330
5401
  columnWidth: column.computedWidth
5331
5402
  };
5332
5403
  }, [columns, columnId, column]);
5333
- let cursorRef = useRef7("auto");
5404
+ let cursorRef = useRef8("auto");
5334
5405
  const onPointerDown = useCallback6((e) => {
5335
5406
  const target = domRef.current;
5336
5407
  cursorRef.current = target.style.cursor;
@@ -5471,7 +5542,7 @@ import { createPortal } from "react-dom";
5471
5542
  import {
5472
5543
  createElement as createElement9
5473
5544
  } from "react";
5474
- import { useEffect as useEffect11, useState as useState7 } from "react";
5545
+ import { useEffect as useEffect12, useState as useState7 } from "react";
5475
5546
  var defaultLineStyle = {
5476
5547
  marginTop: 2,
5477
5548
  marginBottom: 2,
@@ -5495,7 +5566,7 @@ function SortIcon(props) {
5495
5566
  }), props.lineStyle), {
5496
5567
  opacity
5497
5568
  });
5498
- useEffect11(() => {
5569
+ useEffect12(() => {
5499
5570
  const newOpacity = direction != 0 ? 1 : 0;
5500
5571
  if (!rendered && newOpacity) {
5501
5572
  setRendered(true);
@@ -5542,6 +5613,7 @@ function SortIcon(props) {
5542
5613
  }
5543
5614
 
5544
5615
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
5616
+ var InfiniteTableHeaderCellContext = createContext4(null);
5545
5617
  var defaultStyle = {
5546
5618
  position: "absolute",
5547
5619
  top: 0
@@ -5560,29 +5632,38 @@ function InfiniteTableHeaderCell(props) {
5560
5632
  }
5561
5633
  const sortInfo = column.computedSortInfo;
5562
5634
  let header = column.header;
5563
- if (header instanceof Function) {
5564
- header = header({
5565
- column,
5566
- columnSortInfo: sortInfo
5567
- });
5568
- }
5569
- header = header != null ? header : column.name;
5570
- const sortTool = /* @__PURE__ */ createElement10(SortIcon, {
5571
- index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
5572
- className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
5573
- direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
5574
- });
5575
- const domRef = useRef8(null);
5576
5635
  const ref = useCallback7((node) => {
5577
5636
  var _a2;
5578
5637
  domRef.current = node;
5579
5638
  (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
5580
5639
  }, [props.domRef]);
5640
+ const sortTool = /* @__PURE__ */ createElement10(SortIcon, {
5641
+ index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
5642
+ className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
5643
+ direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
5644
+ });
5645
+ const renderParam = {
5646
+ domRef: ref,
5647
+ column,
5648
+ columnSortInfo: sortInfo,
5649
+ sortTool
5650
+ };
5651
+ const renderChildren = () => {
5652
+ if (header instanceof Function) {
5653
+ header = /* @__PURE__ */ createElement10(RenderHookComponent, {
5654
+ render: header,
5655
+ renderParam
5656
+ });
5657
+ }
5658
+ header = header != null ? header : column.name;
5659
+ return header;
5660
+ };
5661
+ const domRef = useRef9(null);
5581
5662
  const {
5582
5663
  computed: { computedRemainingSpace },
5583
5664
  componentState: { portalDOMRef }
5584
5665
  } = useInfiniteTable();
5585
- useEffect12(() => {
5666
+ useEffect13(() => {
5586
5667
  let clearOnResize = null;
5587
5668
  const node = domRef.current;
5588
5669
  if (onResize && node) {
@@ -5618,8 +5699,12 @@ function InfiniteTableHeaderCell(props) {
5618
5699
  }, header);
5619
5700
  draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
5620
5701
  }
5621
- return /* @__PURE__ */ createElement10(Fragment2, null, /* @__PURE__ */ createElement10(InfiniteTableCell, {
5702
+ const ContextProvider = InfiniteTableHeaderCellContext.Provider;
5703
+ return /* @__PURE__ */ createElement10(ContextProvider, {
5704
+ value: renderParam
5705
+ }, /* @__PURE__ */ createElement10(InfiniteTableCell, {
5622
5706
  domRef: ref,
5707
+ cellType: "header",
5623
5708
  column,
5624
5709
  "data-name": `HeaderCell`,
5625
5710
  "data-column-id": column.id,
@@ -5629,8 +5714,13 @@ function InfiniteTableHeaderCell(props) {
5629
5714
  onPointerUp,
5630
5715
  className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging }), CellCls),
5631
5716
  cssEllipsis: (_d = (_c = column.headerCssEllipsis) != null ? _c : column.cssEllipsis) != null ? _d : true,
5632
- afterChildren: sortTool
5633
- }, header), draggingProxy);
5717
+ afterChildren: sortTool,
5718
+ renderChildren
5719
+ }), draggingProxy);
5720
+ }
5721
+ function useInfiniteHeaderCell() {
5722
+ const result = useContext5(InfiniteTableHeaderCellContext);
5723
+ return result;
5634
5724
  }
5635
5725
 
5636
5726
  // src/components/RawList/index.tsx
@@ -5638,7 +5728,7 @@ import {
5638
5728
  createElement as createElement13,
5639
5729
  memo as memo5
5640
5730
  } from "react";
5641
- import { useEffect as useEffect13 } from "react";
5731
+ import { useEffect as useEffect14 } from "react";
5642
5732
 
5643
5733
  // src/components/RawList/AvoidReactDiff.tsx
5644
5734
  import {
@@ -5946,7 +6036,7 @@ var ReactVirtualRenderer = class extends Logger {
5946
6036
  }
5947
6037
  this.mappedItems.renderItemAtElement(itemIndex, elementIndex, renderedNode);
5948
6038
  if (true) {
5949
- this.debug(`Render item ${itemIndex} at element ${elementIndex}`);
6039
+ dbg(`ReactVirtualRenderer:${this.brain.getOptions().mainAxis}`)(`Render item ${itemIndex} at element ${elementIndex}`);
5950
6040
  }
5951
6041
  itemUpdater(renderedNode);
5952
6042
  this.updateElementPosition(elementIndex);
@@ -5989,7 +6079,7 @@ function RawListFn(props) {
5989
6079
  debugChannel
5990
6080
  });
5991
6081
  const getRenderItem = useLatest(renderItem);
5992
- useEffect13(() => {
6082
+ useEffect14(() => {
5993
6083
  const renderRange = brain.getRenderRange();
5994
6084
  renderer.renderRange(renderRange, {
5995
6085
  renderItem,
@@ -5997,7 +6087,7 @@ function RawListFn(props) {
5997
6087
  onRender: onRenderUpdater
5998
6088
  });
5999
6089
  }, [brain, renderItem, onRenderUpdater]);
6000
- useEffect13(() => {
6090
+ useEffect14(() => {
6001
6091
  const remove = brain.onRenderRangeChange((renderRange) => {
6002
6092
  renderer.renderRange(renderRange, {
6003
6093
  force: false,
@@ -6039,7 +6129,7 @@ function InfiniteTableHeaderFn(props) {
6039
6129
  columns: computedVisibleColumnsMap
6040
6130
  });
6041
6131
  }, [computedVisibleColumnsMap, columns, repaintId, headerHeight]);
6042
- useEffect14(() => {
6132
+ useEffect15(() => {
6043
6133
  const onScroll = (scrollPosition) => {
6044
6134
  if (domRef.current) {
6045
6135
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
@@ -6048,7 +6138,7 @@ function InfiniteTableHeaderFn(props) {
6048
6138
  const removeOnScroll = brain.onScroll(onScroll);
6049
6139
  return removeOnScroll;
6050
6140
  }, [brain]);
6051
- const domRef = useRef9(null);
6141
+ const domRef = useRef10(null);
6052
6142
  const headerCls = HeaderClsRecipe({
6053
6143
  pinned: pinning,
6054
6144
  overflow: false,
@@ -6071,7 +6161,7 @@ import {
6071
6161
  createElement as createElement17,
6072
6162
  memo as memo7,
6073
6163
  useMemo as useMemo9,
6074
- useRef as useRef10
6164
+ useRef as useRef11
6075
6165
  } from "react";
6076
6166
 
6077
6167
  // src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
@@ -6249,7 +6339,7 @@ function renderColumnHeaderGroups(config) {
6249
6339
  }
6250
6340
 
6251
6341
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
6252
- import { useEffect as useEffect15 } from "react";
6342
+ import { useEffect as useEffect16 } from "react";
6253
6343
  var { rootClassName: rootClassName5 } = internalProps;
6254
6344
  var TableHeaderClassName2 = `${rootClassName5}Header`;
6255
6345
  var UPDATE_SCROLL = (node, scrollPosition) => {
@@ -6282,7 +6372,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
6282
6372
  },
6283
6373
  computed: { computedVisibleColumnsMap: columnsMap }
6284
6374
  } = useInfiniteTable();
6285
- const domRef = useRef10(null);
6375
+ const domRef = useRef11(null);
6286
6376
  const hasColumnGroups = computedColumnGroups.size > 0;
6287
6377
  const columnHeaderGroups = useMemo9(() => {
6288
6378
  return hasColumnGroups ? renderColumnHeaderGroups({
@@ -6315,7 +6405,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
6315
6405
  if (totalWidth != null) {
6316
6406
  style.width = availableWidth;
6317
6407
  }
6318
- useEffect15(() => {
6408
+ useEffect16(() => {
6319
6409
  const scroller = brain || scrollListener;
6320
6410
  if (!scroller || !scrollable) {
6321
6411
  return;
@@ -6438,12 +6528,12 @@ import {
6438
6528
  createElement as createElement19,
6439
6529
  forwardRef as forwardRef2
6440
6530
  } from "react";
6441
- import { useRef as useRef11 } from "react";
6531
+ import { useRef as useRef12 } from "react";
6442
6532
 
6443
6533
  // src/components/hooks/useOnScroll.ts
6444
- import { useEffect as useEffect16 } from "react";
6534
+ import { useEffect as useEffect17 } from "react";
6445
6535
  var useOnScroll = (domRef, onScroll) => {
6446
- useEffect16(() => {
6536
+ useEffect17(() => {
6447
6537
  const domNode = domRef == null ? void 0 : domRef.current;
6448
6538
  const scrollFn = (event) => {
6449
6539
  const node = event.target;
@@ -6489,7 +6579,7 @@ var VirtualScrollContainer = forwardRef2(function VirtualScrollContainer2(props,
6489
6579
  className,
6490
6580
  style
6491
6581
  } = props;
6492
- const domRef = ref != null ? ref : useRef11(null);
6582
+ const domRef = ref != null ? ref : useRef12(null);
6493
6583
  useOnScroll(domRef, onContainerScroll);
6494
6584
  return /* @__PURE__ */ createElement19("div", {
6495
6585
  ref: domRef,
@@ -6523,7 +6613,7 @@ function SpacePlaceholderFn(props) {
6523
6613
  var SpacePlaceholder = memo8(SpacePlaceholderFn);
6524
6614
 
6525
6615
  // src/components/InfiniteTable/hooks/useListRendering.tsx
6526
- import { useEffect as useEffect22, useMemo as useMemo11, useRef as useRef17 } from "react";
6616
+ import { useEffect as useEffect23, useMemo as useMemo11, useRef as useRef18 } from "react";
6527
6617
 
6528
6618
  // src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
6529
6619
  import {
@@ -6542,7 +6632,7 @@ import {
6542
6632
  Fragment as Fragment4,
6543
6633
  createElement as createElement21
6544
6634
  } from "react";
6545
- import { useRef as useRef12, useEffect as useEffect17, useState as useState9 } from "react";
6635
+ import { useRef as useRef13, useEffect as useEffect18, useState as useState9 } from "react";
6546
6636
 
6547
6637
  // src/components/VirtualList/VirtualList.css.ts
6548
6638
  var VirtualListCls = "_16lm1iw1 _16lm1iw8 _16lm1iw0";
@@ -6585,11 +6675,11 @@ var VirtualList = (props) => {
6585
6675
  "onContainerScroll",
6586
6676
  "children"
6587
6677
  ]);
6588
- const domRef = useRef12(null);
6678
+ const domRef = useRef13(null);
6589
6679
  const [, rerender] = useRerender();
6590
6680
  const [totalSize, setTotalSize] = useState9(0);
6591
- const renderCountRef = useRef12(0);
6592
- useEffect17(() => {
6681
+ const renderCountRef = useRef13(0);
6682
+ useEffect18(() => {
6593
6683
  const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
6594
6684
  renderCountRef.current = renderCount;
6595
6685
  if (true) {
@@ -6608,7 +6698,7 @@ var VirtualList = (props) => {
6608
6698
  removeOnTotalSizeChange();
6609
6699
  };
6610
6700
  }, [virtualBrain]);
6611
- useEffect17(() => {
6701
+ useEffect18(() => {
6612
6702
  const onScroll = (scrollPosition) => {
6613
6703
  UPDATE_SCROLL2(domRef.current, scrollPosition);
6614
6704
  };
@@ -6666,14 +6756,17 @@ import {
6666
6756
  memo as memo10,
6667
6757
  useCallback as useCallback11
6668
6758
  } from "react";
6669
- import { useRef as useRef14 } from "react";
6759
+ import { useRef as useRef15 } from "react";
6670
6760
 
6671
6761
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
6672
6762
  import {
6763
+ createContext as createContext5,
6673
6764
  createElement as createElement23,
6674
6765
  memo as memo9
6675
6766
  } from "react";
6767
+ import { useContext as useContext6 } from "react";
6676
6768
  var { rootClassName: rootClassName8 } = internalProps;
6769
+ var InfiniteTableColumnCellContext = createContext5(null);
6677
6770
  var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
6678
6771
  function isColumnWithField(c) {
6679
6772
  return typeof c.field === "string";
@@ -6720,24 +6813,31 @@ function InfiniteTableColumnCellFn(props) {
6720
6813
  column
6721
6814
  }, rest);
6722
6815
  let renderValue = value;
6723
- if (column.render || column.renderValue) {
6724
- const renderParam = __spreadProps(__spreadValues({
6725
- value,
6726
- column,
6727
- groupRowInfo
6728
- }, rest), {
6729
- rowIndex,
6730
- toggleGroupRow,
6731
- toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
6732
- groupBy: computedDataSource.groupBy,
6733
- pivotBy: computedDataSource.pivotBy
6734
- });
6735
- if (column.render) {
6736
- renderValue = column.render(renderParam);
6737
- } else if (column.renderValue) {
6738
- renderValue = column.renderValue(renderParam);
6816
+ const renderParam = __spreadProps(__spreadValues({
6817
+ value,
6818
+ column,
6819
+ domRef,
6820
+ groupRowInfo
6821
+ }, rest), {
6822
+ rowIndex,
6823
+ toggleGroupRow,
6824
+ toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
6825
+ groupBy: computedDataSource.groupBy,
6826
+ pivotBy: computedDataSource.pivotBy
6827
+ });
6828
+ const renderChildren = () => {
6829
+ if (hidden) {
6830
+ return null;
6739
6831
  }
6740
- }
6832
+ const renderFn = column.render || column.renderValue;
6833
+ if (renderFn) {
6834
+ return /* @__PURE__ */ createElement23(RenderHookComponent, {
6835
+ render: renderFn,
6836
+ renderParam
6837
+ });
6838
+ }
6839
+ return renderValue;
6840
+ };
6741
6841
  const colClassName = column.className ? typeof column.className === "function" ? column.className(stylingRenderParam) : column.className : void 0;
6742
6842
  const colStyle = column.style ? typeof column.style === "function" ? column.style(stylingRenderParam) : column.style : void 0;
6743
6843
  const style = colStyle ? __spreadProps(__spreadValues({}, colStyle), {
@@ -6765,23 +6865,33 @@ function InfiniteTableColumnCellFn(props) {
6765
6865
  }
6766
6866
  }
6767
6867
  }
6768
- return /* @__PURE__ */ createElement23(InfiniteTableCell, __spreadProps(__spreadValues({
6868
+ const cellProps = __spreadProps(__spreadValues({
6769
6869
  domRef,
6770
6870
  offsetProperty
6771
6871
  }, dataset), {
6872
+ cellType: "body",
6772
6873
  column,
6773
6874
  offset: virtualized ? 0 : column.computedPinningOffset,
6774
6875
  style,
6775
6876
  cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
6776
- className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName)
6777
- }), hidden ? null : renderValue);
6877
+ className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName),
6878
+ renderChildren
6879
+ });
6880
+ const ContextProvider = InfiniteTableColumnCellContext.Provider;
6881
+ return /* @__PURE__ */ createElement23(ContextProvider, {
6882
+ value: renderParam
6883
+ }, /* @__PURE__ */ createElement23(InfiniteTableCell, __spreadValues({}, cellProps)));
6778
6884
  }
6779
6885
  var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
6886
+ function useInfiniteColumnCell() {
6887
+ const result = useContext6(InfiniteTableColumnCellContext);
6888
+ return result;
6889
+ }
6780
6890
 
6781
6891
  // src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
6782
6892
  import {
6783
6893
  useCallback as useCallback10,
6784
- useRef as useRef13
6894
+ useRef as useRef14
6785
6895
  } from "react";
6786
6896
 
6787
6897
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
@@ -6808,7 +6918,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
6808
6918
  rowInfo,
6809
6919
  rowSpan
6810
6920
  } = props;
6811
- const domRef = useRef13(null);
6921
+ const domRef = useRef14(null);
6812
6922
  const rowDOMRef = useCallback10((node) => {
6813
6923
  domRefFromProps(node);
6814
6924
  domRef.current = node;
@@ -6910,7 +7020,7 @@ function InfiniteTableRowFn(props) {
6910
7020
  width: rowWidth,
6911
7021
  height: rowHeight
6912
7022
  }, domProps.style);
6913
- const renderCellRef = useRef14(null);
7023
+ const renderCellRef = useRef15(null);
6914
7024
  const renderCell = useCallback11(({ domRef, itemIndex }) => {
6915
7025
  const column = columns[itemIndex];
6916
7026
  if (!column) {
@@ -7086,7 +7196,7 @@ function useUnpinnedRendering(params) {
7086
7196
  }
7087
7197
 
7088
7198
  // src/components/InfiniteTable/hooks/useOnContainerScroll.ts
7089
- import { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef15 } from "react";
7199
+ import { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef16 } from "react";
7090
7200
 
7091
7201
  // src/components/InfiniteTable/InfiniteCls.css.ts
7092
7202
  var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -7128,10 +7238,10 @@ var useOnContainerScroll = ({
7128
7238
  onScrollStopFromProps == null ? void 0 : onScrollStopFromProps(param);
7129
7239
  notifyScrollStop(param);
7130
7240
  }, [onScrollStopFromProps, notifyScrollStop]);
7131
- const timeoutIdRef = useRef15(0);
7132
- const scrollingRef = useRef15(false);
7133
- const scrollTopMaxRef = useRef15(0);
7134
- useEffect18(() => {
7241
+ const timeoutIdRef = useRef16(0);
7242
+ const scrollingRef = useRef16(false);
7243
+ const scrollTopMaxRef = useRef16(0);
7244
+ useEffect19(() => {
7135
7245
  const { current: node } = scrollerDOMRef;
7136
7246
  scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
7137
7247
  }, [reservedContentHeight, bodySize.height]);
@@ -7178,7 +7288,7 @@ var useOnContainerScroll = ({
7178
7288
  domRef.current,
7179
7289
  setScrolling
7180
7290
  ]);
7181
- const scrollPositionRef = useRef15({
7291
+ const scrollPositionRef = useRef16({
7182
7292
  scrollLeft: 0,
7183
7293
  scrollTop: 0
7184
7294
  });
@@ -7218,12 +7328,12 @@ import { useCallback as useCallback15 } from "react";
7218
7328
  import {
7219
7329
  createElement as createElement27
7220
7330
  } from "react";
7221
- import { useEffect as useEffect20, useCallback as useCallback14, useRef as useRef16 } from "react";
7331
+ import { useEffect as useEffect21, useCallback as useCallback14, useRef as useRef17 } from "react";
7222
7332
 
7223
7333
  // src/components/hooks/useOnMount.ts
7224
- import { useEffect as useEffect19 } from "react";
7334
+ import { useEffect as useEffect20 } from "react";
7225
7335
  function useOnMount(domRef, props) {
7226
- useEffect19(() => {
7336
+ useEffect20(() => {
7227
7337
  const { onMount, onUnmount } = props;
7228
7338
  const node = domRef == null ? void 0 : domRef.current;
7229
7339
  onMount == null ? void 0 : onMount(node);
@@ -7254,7 +7364,7 @@ var RowListWithExternalScrolling = (props) => {
7254
7364
  onMount,
7255
7365
  onUnmount
7256
7366
  } = props;
7257
- const domRef = useRef16(null);
7367
+ const domRef = useRef17(null);
7258
7368
  const renderItem = useCallback14((renderProps) => renderRow({
7259
7369
  domRef: renderProps.domRef,
7260
7370
  rowHeight: renderProps.itemSize,
@@ -7264,7 +7374,7 @@ var RowListWithExternalScrolling = (props) => {
7264
7374
  onMount,
7265
7375
  onUnmount
7266
7376
  });
7267
- useEffect20(() => {
7377
+ useEffect21(() => {
7268
7378
  const onScroll = (scrollPosition) => {
7269
7379
  const node = domRef.current;
7270
7380
  if (node) {
@@ -7491,7 +7601,7 @@ function usePinnedStartRendering(params) {
7491
7601
  }
7492
7602
 
7493
7603
  // src/components/InfiniteTable/hooks/useYourBrain.ts
7494
- import { useEffect as useEffect21 } from "react";
7604
+ import { useEffect as useEffect22 } from "react";
7495
7605
 
7496
7606
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
7497
7607
  import { useCallback as useCallback16 } from "react";
@@ -7527,13 +7637,13 @@ function useYourBrain(param) {
7527
7637
  globalThis.verticalVirtualBrain = verticalVirtualBrain;
7528
7638
  globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
7529
7639
  }
7530
- useEffect21(() => {
7640
+ useEffect22(() => {
7531
7641
  verticalVirtualBrain.setAvailableSize({
7532
7642
  height: bodySize.height,
7533
7643
  width: 0
7534
7644
  });
7535
7645
  }, [bodySize, verticalVirtualBrain]);
7536
- useEffect21(() => {
7646
+ useEffect22(() => {
7537
7647
  horizontalVirtualBrain.setAvailableSize({
7538
7648
  height: 0,
7539
7649
  width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
@@ -7574,7 +7684,7 @@ function useListRendering(param) {
7574
7684
  horizontalVirtualBrain
7575
7685
  } = componentState;
7576
7686
  const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
7577
- const repaintIdRef = useRef17(0);
7687
+ const repaintIdRef = useRef18(0);
7578
7688
  if (prevDataSourceTimestamp !== dataSourceState.updatedAt || !shallowEqualObjects(prevComputed, computed)) {
7579
7689
  repaintIdRef.current++;
7580
7690
  }
@@ -7597,7 +7707,7 @@ function useListRendering(param) {
7597
7707
  vertical: hasVerticalScrollbar,
7598
7708
  horizontal: hasHorizontalScrollbar
7599
7709
  }), [hasVerticalScrollbar, hasHorizontalScrollbar]);
7600
- useEffect22(() => {
7710
+ useEffect23(() => {
7601
7711
  if (!bodySize.height) {
7602
7712
  return;
7603
7713
  }
@@ -7653,7 +7763,7 @@ function useListRendering(param) {
7653
7763
  computedUnpinnedColumns
7654
7764
  });
7655
7765
  const [, rerender] = useRerender();
7656
- useEffect22(() => {
7766
+ useEffect23(() => {
7657
7767
  rerender();
7658
7768
  }, [dataSourceState]);
7659
7769
  const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
@@ -7680,9 +7790,9 @@ import {
7680
7790
  createElement as createElement29,
7681
7791
  forwardRef as forwardRef3,
7682
7792
  useCallback as useCallback17,
7683
- useRef as useRef18
7793
+ useRef as useRef19
7684
7794
  } from "react";
7685
- import { useEffect as useEffect23 } from "react";
7795
+ import { useEffect as useEffect24 } from "react";
7686
7796
 
7687
7797
  // src/components/utils/decamelize.ts
7688
7798
  function decamelize(str, options) {
@@ -7719,7 +7829,7 @@ var enforceStyle = (node, style) => {
7719
7829
  };
7720
7830
  var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter2(props, ref) {
7721
7831
  const { rootClassName: rootClassName12 } = useInternalProps();
7722
- const domRef = useRef18(null);
7832
+ const domRef = useRef19(null);
7723
7833
  const domCallback = useCallback17((node) => {
7724
7834
  domRef.current = node;
7725
7835
  if (!ref) {
@@ -7731,7 +7841,7 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
7731
7841
  ref.current = node;
7732
7842
  }
7733
7843
  }, []);
7734
- useEffect23(() => {
7844
+ useEffect24(() => {
7735
7845
  const forceStyle = () => {
7736
7846
  requestAnimationFrame(() => {
7737
7847
  var _a;
@@ -7920,7 +8030,7 @@ var useLicense = (licenseKey = "") => {
7920
8030
  const valid = useMemo12(() => {
7921
8031
  let valid2 = isValidLicense(licenseKey, {
7922
8032
  publishedAt: 1624970570587,
7923
- version: "0.2.14"
8033
+ version: "0.2.17"
7924
8034
  });
7925
8035
  if (!licenseKey && !valid2 && isInsidePlayground) {
7926
8036
  return true;
@@ -7936,7 +8046,7 @@ import {
7936
8046
  useCallback as useCallback18,
7937
8047
  useLayoutEffect as useLayoutEffect4
7938
8048
  } from "react";
7939
- import { useRef as useRef19 } from "react";
8049
+ import { useRef as useRef20 } from "react";
7940
8050
  var error = err("CSSVariableWatch");
7941
8051
  var debug6 = dbg("CSSVariableWatch");
7942
8052
  var WRAPPER_STYLE = {
@@ -7949,7 +8059,7 @@ var WRAPPER_STYLE = {
7949
8059
  overflow: "hidden"
7950
8060
  };
7951
8061
  var useCSSVariableWatch = (params) => {
7952
- const lastValueRef = useRef19(0);
8062
+ const lastValueRef = useRef20(0);
7953
8063
  const onResize = useCallback18(({ height }) => {
7954
8064
  if (height && height !== lastValueRef.current) {
7955
8065
  lastValueRef.current = height;
@@ -7969,7 +8079,7 @@ var useCSSVariableWatch = (params) => {
7969
8079
  }, []);
7970
8080
  };
7971
8081
  var CSSVariableWatch = (props) => {
7972
- const domRef = useRef19(null);
8082
+ const domRef = useRef20(null);
7973
8083
  useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
7974
8084
  ref: domRef
7975
8085
  }));
@@ -8097,8 +8207,8 @@ var LoadMask = memo12(LoadMaskFn);
8097
8207
 
8098
8208
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
8099
8209
  import {
8100
- useEffect as useEffect24,
8101
- useRef as useRef20,
8210
+ useEffect as useEffect25,
8211
+ useRef as useRef21,
8102
8212
  useState as useState10
8103
8213
  } from "react";
8104
8214
  var OFFSET = 10;
@@ -8168,8 +8278,8 @@ function useAutoSizeColumns() {
8168
8278
  const [refreshId, setRefreshId] = useState10(0);
8169
8279
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
8170
8280
  const getTheKey = useLatest(theKey);
8171
- const lastExecutedIdentifierRef = useRef20(null);
8172
- useEffect24(() => {
8281
+ const lastExecutedIdentifierRef = useRef21(null);
8282
+ useEffect25(() => {
8173
8283
  const key = getTheKey();
8174
8284
  if (key == null) {
8175
8285
  return;
@@ -8187,7 +8297,7 @@ function useAutoSizeColumns() {
8187
8297
  removeHorizontal();
8188
8298
  };
8189
8299
  }, [verticalVirtualBrain, horizontalVirtualBrain]);
8190
- useEffect24(() => {
8300
+ useEffect25(() => {
8191
8301
  var _a;
8192
8302
  if (theKey == null) {
8193
8303
  return;
@@ -8295,7 +8405,7 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
8295
8405
  bodySize,
8296
8406
  computed
8297
8407
  });
8298
- useEffect25(() => {
8408
+ useEffect26(() => {
8299
8409
  const dataSourceState = getDataSourceState();
8300
8410
  const onChange = debounce((renderRange) => {
8301
8411
  dataSourceState.notifyRenderRangeChange(renderRange);
@@ -8314,7 +8424,7 @@ var InfiniteTableComponent = memo13(function InfiniteTableComponent2() {
8314
8424
  }
8315
8425
  notifyScrollbarsChange(scrollbars);
8316
8426
  }, [scrollbars]);
8317
- useEffect25(() => {
8427
+ useEffect26(() => {
8318
8428
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
8319
8429
  }, [scrollStopDelay]);
8320
8430
  useAutoSizeColumns();
@@ -8378,13 +8488,13 @@ function InfiniteTableContextProvider() {
8378
8488
  }
8379
8489
  componentActions.bodySize = bodySize;
8380
8490
  }, { earlyAttach: true });
8381
- useEffect25(() => {
8491
+ useEffect26(() => {
8382
8492
  return () => {
8383
8493
  componentState.onRowHeightCSSVarChange.destroy();
8384
8494
  componentState.onHeaderHeightCSSVarChange.destroy();
8385
8495
  };
8386
8496
  }, []);
8387
- useEffect25(() => {
8497
+ useEffect26(() => {
8388
8498
  if (scrollerDOMRef.current) {
8389
8499
  scrollerDOMRef.current.scrollTop = 0;
8390
8500
  }
@@ -8417,5 +8527,7 @@ export {
8417
8527
  multisort,
8418
8528
  useComponentState,
8419
8529
  useDataSource,
8420
- useEffectWithChanges
8530
+ useEffectWithChanges,
8531
+ useInfiniteColumnCell,
8532
+ useInfiniteHeaderCell
8421
8533
  };