@infinite-table/infinite-react 0.0.10 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -71,6 +71,7 @@ declare module "utils/DeepMap" {
71
71
  private map;
72
72
  private length;
73
73
  private revision;
74
+ static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
74
75
  constructor(initial?: [KeyType[], ValueType][]);
75
76
  set(keys: KeyType[] & {
76
77
  length: Omit<number, 0>;
@@ -198,7 +199,7 @@ declare module "components/DataSource/types" {
198
199
  import * as React from 'react';
199
200
  import { MultisortInfo } from "utils/multisort/index";
200
201
  import { DeepMap } from "utils/DeepMap";
201
- import { AggregationReducer, DeepMapGroupValueType, GroupBy, GroupKeyType, PivotBy } from "utils/groupAndPivot/index";
202
+ import { DeepMapGroupValueType, GroupBy, GroupKeyType, PivotBy } from "utils/groupAndPivot/index";
202
203
  import { InfiniteTableColumn, InfiniteTableColumnGroup, InfiniteTableRowInfo, Scrollbars } from "components/InfiniteTable/index";
203
204
  import { ComponentStateActions } from "components/hooks/useComponentState";
204
205
  import { GroupRowsState } from "components/DataSource/GroupRowsState";
@@ -208,7 +209,7 @@ declare module "components/DataSource/types" {
208
209
  export interface DataSourceDataParams<T> {
209
210
  originalDataArray: T[];
210
211
  sortInfo?: DataSourceSortInfo<T>;
211
- groupRowsBy?: DataSourcePropGroupRowsBy<T>;
212
+ groupBy?: DataSourcePropGroupBy<T>;
212
213
  pivotBy?: DataSourcePropPivotBy<T>;
213
214
  livePaginationCursor?: DataSourceLivePaginationCursorValue;
214
215
  }
@@ -216,35 +217,43 @@ declare module "components/DataSource/types" {
216
217
  field?: keyof T;
217
218
  id?: string;
218
219
  };
219
- export type DataSourceGroupRowsBy<T> = GroupBy<T, any>;
220
+ export type DataSourceGroupBy<T> = GroupBy<T, any>;
220
221
  export type DataSourcePivotBy<T> = PivotBy<T, any>;
221
222
  export type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
222
223
  export type DataSourceRemoteData<T> = {
223
224
  data: T[];
224
225
  livePaginationCursor?: DataSourceLivePaginationCursorValue;
225
226
  };
226
- export type DataSourceData<T> = T[] | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
227
+ export type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
227
228
  export type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
228
229
  export type DataSourceExpandedAndCollapsedGroupRows<KeyType> = {
229
230
  expandedRows: DataSourceGroupRowsList<KeyType>;
230
231
  collapsedRows: DataSourceGroupRowsList<KeyType>;
231
232
  };
232
- export type DataSourcePropGroupRowsBy<T> = DataSourceGroupRowsBy<T>[];
233
+ export type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
233
234
  export type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
234
235
  export interface DataSourceMappedState<T> {
236
+ aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
235
237
  livePagination: DataSourceProps<T>['livePagination'];
236
238
  livePaginationCursor: DataSourceProps<T>['livePaginationCursor'];
237
- remoteCount: DataSourceProps<T>['remoteCount'];
238
239
  onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
239
240
  data: DataSourceProps<T>['data'];
240
241
  primaryKey: DataSourceProps<T>['primaryKey'];
241
- groupRowsBy: NonUndefined<DataSourceProps<T>['groupRowsBy']>;
242
+ groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
242
243
  groupRowsState: NonUndefined<DataSourceProps<T>['groupRowsState']>;
243
244
  pivotBy: DataSourceProps<T>['pivotBy'];
244
245
  loading: NonUndefined<DataSourceProps<T>['loading']>;
245
246
  sortInfo: DataSourceSingleSortInfo<T>[] | null;
246
247
  }
248
+ export type DataSourceAggregationReducer<T, AggregationResultType> = {
249
+ field?: keyof T;
250
+ initialValue: AggregationResultType;
251
+ getter?: (data: T) => any;
252
+ reducer: (accumulator: any, value: any, data: T) => AggregationResultType | any;
253
+ done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
254
+ };
247
255
  export interface DataSourceSetupState<T> {
256
+ showSeparatePivotColumnForSingleAggregation: boolean;
248
257
  dataParams?: DataSourceDataParams<T>;
249
258
  notifyScrollbarsChange: SubscriptionCallback<Scrollbars>;
250
259
  originalDataArray: T[];
@@ -259,17 +268,16 @@ declare module "components/DataSource/types" {
259
268
  groupedAt: number;
260
269
  sortedAt: number;
261
270
  generateGroupRows: boolean;
262
- aggregationReducers?: AggregationReducer<T, any>[];
263
271
  postSortDataArray?: T[];
264
272
  postGroupDataArray?: InfiniteTableRowInfo<T>[];
265
273
  pivotColumns?: Map<string, InfiniteTableColumn<T>>;
266
274
  pivotColumnGroups?: Map<string, InfiniteTableColumnGroup>;
267
275
  }
276
+ export type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
268
277
  export interface DataSourceProps<T> {
269
278
  children: React.ReactNode | ((contextData: DataSourceState<T>) => React.ReactNode);
270
279
  primaryKey: keyof T;
271
280
  fields?: (keyof T)[];
272
- remoteCount?: number;
273
281
  data: DataSourceData<T>;
274
282
  loading?: boolean;
275
283
  defaultLoading?: boolean;
@@ -277,9 +285,11 @@ declare module "components/DataSource/types" {
277
285
  pivotBy?: DataSourcePropPivotBy<T>;
278
286
  defaultPivotBy?: DataSourcePropPivotBy<T>;
279
287
  onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
280
- groupRowsBy?: DataSourcePropGroupRowsBy<T>;
281
- defaultGroupRowsBy?: DataSourcePropGroupRowsBy<T>;
282
- onGroupRowsByChange?: (groupBy: DataSourcePropGroupRowsBy<T>) => void;
288
+ aggregationReducers?: DataSourcePropAggregationReducers<T>;
289
+ defaultAggregationReducers?: DataSourcePropAggregationReducers<T>;
290
+ groupBy?: DataSourcePropGroupBy<T>;
291
+ defaultGroupBy?: DataSourcePropGroupBy<T>;
292
+ onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
283
293
  groupRowsState?: GroupRowsState;
284
294
  defaultGroupRowsState?: GroupRowsState;
285
295
  onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
@@ -359,12 +369,12 @@ declare module "components/DataSource/state/getInitialState" {
359
369
  export const forwardProps: <T>() => Partial<{
360
370
  data: 1 | ((value: import("components/DataSource").DataSourceData<T>) => import("components/DataSource").DataSourceData<T>);
361
371
  loading: 1 | ((value: boolean | undefined) => boolean);
372
+ aggregationReducers: 1 | ((value: import("components/DataSource").DataSourcePropAggregationReducers<T> | undefined) => import("components/DataSource").DataSourcePropAggregationReducers<T> | undefined);
362
373
  livePagination: 1 | ((value: boolean | undefined) => boolean | undefined);
363
374
  livePaginationCursor: 1 | ((value: import("components/DataSource").DataSourceLivePaginationCursorValue | undefined) => import("components/DataSource").DataSourceLivePaginationCursorValue | undefined);
364
- remoteCount: 1 | ((value: number | undefined) => number | undefined);
365
375
  onDataParamsChange: 1 | ((value: ((dataParamsChange: DataSourceDataParams<T>) => void) | undefined) => ((dataParamsChange: DataSourceDataParams<T>) => void) | undefined);
366
376
  primaryKey: 1 | ((value: keyof T) => keyof T);
367
- groupRowsBy: 1 | ((value: import("components/DataSource").DataSourcePropGroupRowsBy<T> | undefined) => import("components/DataSource").DataSourcePropGroupRowsBy<T>);
377
+ groupBy: 1 | ((value: import("components/DataSource").DataSourcePropGroupBy<T> | undefined) => import("components/DataSource").DataSourcePropGroupBy<T>);
368
378
  groupRowsState: 1 | ((value: GroupRowsState<any> | undefined) => GroupRowsState<any>);
369
379
  pivotBy: 1 | ((value: import("components/DataSource").DataSourcePropPivotBy<T> | undefined) => import("components/DataSource").DataSourcePropPivotBy<T> | undefined);
370
380
  sortInfo: 1 | ((value: import("components/DataSource").DataSourceSortInfo<T> | undefined) => import("components/DataSource").DataSourceSingleSortInfo<T>[] | null);
@@ -381,6 +391,7 @@ declare module "components/types/Renderable" {
381
391
  }
382
392
  declare module "components/InfiniteTable/types/Utility" {
383
393
  export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
394
+ export type MapOrRecord<K extends string, V> = Map<K, V> | Record<K, V>;
384
395
  export type RequireOnlyOneProperty<T, Keys extends keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
385
396
  [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
386
397
  }[Keys];
@@ -400,26 +411,30 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
400
411
  import type { Renderable } from "components/types/Renderable";
401
412
  import type { DataSourcePivotBy, DataSourceSingleSortInfo, DataSourceState } from "components/DataSource/types";
402
413
  import type { DiscriminatedUnion, RequireAtLeastOne } from "components/InfiniteTable/types/Utility";
403
- import type { InfiniteTableRowInfo } from "components/InfiniteTable/types/index";
414
+ import type { InfiniteTableColumnGroup, InfiniteTableRowInfo } from "components/InfiniteTable/types/index";
404
415
  import { CSSProperties } from 'react';
405
- import { PivotBy } from "utils/groupAndPivot/index";
416
+ import { AggregationReducer, InfiniteTableRowInfoGroup, InfiniteTableRowInfoNormal, PivotBy } from "utils/groupAndPivot/index";
406
417
  export type { DiscriminatedUnion, RequireAtLeastOne };
407
418
  export type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
408
- export interface InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> {
419
+ export type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
409
420
  value: string | number | Renderable;
410
- data: DATA_TYPE | null;
411
- rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
412
421
  groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
413
422
  rowIndex: number;
414
423
  column: COL_TYPE;
415
424
  toggleCurrentGroupRow: () => void;
416
425
  toggleGroupRow: InfiniteTableToggleGroupRowFn;
417
- groupRowsBy: DataSourceState<DATA_TYPE>['groupRowsBy'];
418
- }
426
+ groupBy: DataSourceState<DATA_TYPE>['groupBy'];
427
+ } & ({
428
+ rowInfo: InfiniteTableRowInfoNormal<DATA_TYPE>;
429
+ data: DATA_TYPE;
430
+ } | {
431
+ rowInfo: InfiniteTableRowInfoGroup<DATA_TYPE>;
432
+ data: Partial<DATA_TYPE> | null;
433
+ });
419
434
  export type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
420
435
  export type InfiniteTableColumnRowspanFnParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
421
- data: DATA_TYPE | null;
422
436
  rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
437
+ data: DATA_TYPE | Partial<DATA_TYPE> | null;
423
438
  groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
424
439
  dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
425
440
  rowIndex: number;
@@ -430,7 +445,7 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
430
445
  columnSortInfo: DataSourceSingleSortInfo<T> | null | undefined;
431
446
  }
432
447
  export type InfiniteTableColumnPinned = 'start' | 'end' | false;
433
- export type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, rowInfo, groupRowsBy, }: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
448
+ export type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, rowInfo, groupBy, }: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
434
449
  export type InfiniteTableColumnRenderValueFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE>;
435
450
  export type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderRenderParams<T>) => Renderable;
436
451
  export type InfiniteTableColumnWithField<T> = {
@@ -453,19 +468,25 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
453
468
  valueGetter?: InfiniteTableColumnValueGetter<T>;
454
469
  }, 'render' | 'renderValue' | 'field' | 'valueGetter'>;
455
470
  export type InfiniteTableColumnStyleFnParams<T> = {
456
- data: T | null;
457
471
  value: Renderable;
458
- rowInfo: InfiniteTableRowInfo<T>;
459
472
  column: InfiniteTableColumn<T>;
460
- };
473
+ } & ({
474
+ data: T;
475
+ rowInfo: InfiniteTableRowInfoNormal<T>;
476
+ } | {
477
+ data: Partial<T> | null;
478
+ rowInfo: InfiniteTableRowInfoGroup<T>;
479
+ });
461
480
  export type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
462
481
  export type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
463
482
  export type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
464
483
  export type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
465
484
  export type InfiniteTableColumnValueGetterParams<T> = {
466
- data: T | null;
467
- rowInfo: InfiniteTableRowInfo<T>;
468
- groupRowInfo: InfiniteTableRowInfo<T> | null;
485
+ data: T;
486
+ rowInfo: InfiniteTableRowInfoNormal<T>;
487
+ } | {
488
+ data: Partial<T> | null;
489
+ rowInfo: InfiniteTableRowInfoGroup<T>;
469
490
  };
470
491
  export type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = Renderable> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
471
492
  export type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanFnParams<T>) => number;
@@ -475,6 +496,7 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
475
496
  draggable?: boolean;
476
497
  resizable?: boolean;
477
498
  comparer?: InfiniteTableColumnComparer<T>;
499
+ hiddenWhenGrouped?: boolean;
478
500
  align?: InfiniteTableColumnAlign;
479
501
  verticalAlign?: InfiniteTableColumnVerticalAlign;
480
502
  columnGroup?: string;
@@ -490,24 +512,28 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
490
512
  };
491
513
  export type InfiniteTableColumn<T> = {} & InfiniteTableBaseColumn<T> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T>;
492
514
  export type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
493
- groupByField?: string | string[];
515
+ groupByField: string | string[];
494
516
  id?: string;
495
517
  };
496
- export type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & {
497
- pivotBy?: DataSourcePivotBy<T>[];
498
- pivotColumn?: true;
499
- pivotTotalColumn?: true;
500
- pivotGroupKeys?: any[];
501
- pivotByForColumn?: DataSourcePivotBy<T>;
502
- pivotIndexForColumn?: number;
503
- pivotGroupKeyForColumn?: any;
518
+ export type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & Partial<InfiniteTablePivotFinalColumn<T, any>>;
519
+ export type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
520
+ pivotBy: DataSourcePivotBy<DataType>[];
521
+ pivotTotalColumnGroup?: true;
522
+ pivotGroupKeys: KeyType[];
523
+ pivotByAtIndex: PivotBy<DataType, KeyType>;
524
+ pivotGroupKey: KeyType;
525
+ pivotIndex: number;
504
526
  };
505
- export type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTablePivotColumn<DataType> & {
527
+ export type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
506
528
  pivotBy: DataSourcePivotBy<DataType>[];
529
+ pivotColumn: true;
530
+ pivotTotalColumn: boolean;
531
+ pivotAggregator: AggregationReducer<DataType, any>;
532
+ pivotAggregatorIndex: number;
507
533
  pivotGroupKeys: KeyType[];
508
- pivotByForColumn: PivotBy<DataType, KeyType>;
509
- pivotIndexForColumn: number;
510
- pivotGroupKeyForColumn: KeyType;
534
+ pivotByAtIndex: PivotBy<DataType, KeyType>;
535
+ pivotIndex: number;
536
+ pivotGroupKey: KeyType;
511
537
  };
512
538
  type InfiniteTableComputedColumnBase<T> = {
513
539
  computedWidth: number;
@@ -531,10 +557,11 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
531
557
  toggleSort: () => void;
532
558
  id: string;
533
559
  };
534
- export type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & InfiniteTablePivotColumn<T> & InfiniteTableGeneratedGroupColumn<T>;
560
+ export type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
561
+ export type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
535
562
  }
536
563
  declare module "utils/groupAndPivot/getPivotColumnsAndColumnGroups" {
537
- import type { DataSourcePivotBy } from "components/DataSource/index";
564
+ import type { DataSourceAggregationReducer, DataSourcePivotBy } from "components/DataSource/index";
538
565
  import type { InfiniteTablePropColumnGroups, InfiniteTablePropColumnsMap } from "components/InfiniteTable/index";
539
566
  import type { InfiniteTablePivotColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
540
567
  import type { InfiniteTablePropPivotTotalColumnPosition } from "components/InfiniteTable/types/InfiniteTableState";
@@ -543,7 +570,13 @@ declare module "utils/groupAndPivot/getPivotColumnsAndColumnGroups" {
543
570
  columns: InfiniteTablePropColumnsMap<DataType, InfiniteTablePivotColumn<DataType>>;
544
571
  columnGroups: InfiniteTablePropColumnGroups;
545
572
  };
546
- export function getPivotColumnsAndColumnGroups<DataType, KeyType = any>(deepMap: DeepMap<KeyType, boolean>, pivotBy: DataSourcePivotBy<DataType>[], pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition): ComputedColumnsAndGroups<DataType>;
573
+ export function getPivotColumnsAndColumnGroups<DataType, KeyType = any>({ deepMap, pivotBy, pivotTotalColumnPosition, reducers, showSeparatePivotColumnForSingleAggregation, }: {
574
+ deepMap: DeepMap<KeyType, boolean>;
575
+ pivotBy: DataSourcePivotBy<DataType>[];
576
+ pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
577
+ reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
578
+ showSeparatePivotColumnForSingleAggregation?: boolean;
579
+ }): ComputedColumnsAndGroups<DataType>;
547
580
  }
548
581
  declare module "components/DataSource/state/reducer" {
549
582
  import type { DataSourceState, DataSourceDerivedState } from "components/DataSource/types";
@@ -587,22 +620,33 @@ declare module "components/DataSource/GroupRowsState" {
587
620
  }
588
621
  }
589
622
  declare module "utils/groupAndPivot/index" {
623
+ import { DataSourceAggregationReducer } from "@infinite-table/infinite-react";
590
624
  import { GroupRowsState } from "components/DataSource/GroupRowsState";
591
- import { InfiniteTablePivotColumn, InfiniteTablePivotFinalColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
592
- import { InfiniteTableGroupColumnBase } from "components/InfiniteTable/types/InfiniteTableProps";
625
+ import { InfiniteTableColumn, InfiniteTablePivotColumn, InfiniteTablePivotFinalColumn, InfiniteTablePivotFinalColumnGroup } from "components/InfiniteTable/types/InfiniteTableColumn";
626
+ import { InfiniteTableColumnGroup, InfiniteTableGroupColumnBase } from "components/InfiniteTable/types/InfiniteTableProps";
593
627
  import { DeepMap } from "utils/DeepMap";
594
- export type AggregationReducer<T, AggregationResultType> = {
595
- initialValue: AggregationResultType;
596
- getter: (data: T) => any;
597
- reducer: (accumulator: any, value: any, data: T) => AggregationResultType | any;
598
- done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
628
+ export type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
629
+ id: string;
630
+ };
631
+ export type AggregationReducerResult<AggregationResultType extends any = any> = {
632
+ value: AggregationResultType;
633
+ id: string;
634
+ };
635
+ export type InfiniteTableRowInfoNormalType<DataType> = {
636
+ data: DataType;
637
+ isGroupRow: false;
638
+ };
639
+ export type InfiniteTableRowInfoGroupType<DataType> = {
640
+ data: Partial<DataType> | null;
641
+ isGroupRow: true;
599
642
  };
600
- export interface InfiniteTableRowInfo<T> {
643
+ export type InfiniteTableRowInfoNormal<T> = InfiniteTableRowInfoBase<T> & InfiniteTableRowInfoNormalType<T>;
644
+ export type InfiniteTableRowInfoGroup<T> = InfiniteTableRowInfoBase<T> & InfiniteTableRowInfoGroupType<T>;
645
+ export type InfiniteTableRowInfo<T> = InfiniteTableRowInfoNormal<T> | InfiniteTableRowInfoGroup<T>;
646
+ export type InfiniteTableRowInfoBase<T> = {
601
647
  id: any;
602
- data: T | null;
603
- groupData?: T[];
604
648
  value?: any;
605
- isGroupRow?: boolean;
649
+ groupData?: T[];
606
650
  collapsed: boolean;
607
651
  collapsedChildrenCount?: number;
608
652
  collapsedGroupsCount?: number;
@@ -615,10 +659,10 @@ declare module "utils/groupAndPivot/index" {
615
659
  groupCount?: number;
616
660
  groupBy?: (keyof T)[];
617
661
  pivotValuesMap?: PivotValuesDeepMap<T, any>;
618
- reducerResults?: any[];
619
- }
620
- export interface InfiniteTableEnhancedGroupInfo<T> extends InfiniteTableRowInfo<T> {
621
- data: null;
662
+ reducerResults?: Record<string, AggregationReducerResult>;
663
+ };
664
+ export type InfiniteTableEnhancedGroupInfo<T> = InfiniteTableRowInfo<T> & {
665
+ data: Partial<T> | null;
622
666
  groupData: T[];
623
667
  value: any;
624
668
  isGroupRow: true;
@@ -629,9 +673,9 @@ declare module "utils/groupAndPivot/index" {
629
673
  groupCount: number;
630
674
  groupBy: (keyof T)[];
631
675
  pivotValuesMap?: PivotValuesDeepMap<T, any>;
632
- }
676
+ };
633
677
  export type GroupKeyType<T extends any = any> = T;
634
- type PivotReducerResults<T = any> = T[];
678
+ type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
635
679
  type PivotGroupValueType<DataType, KeyType> = {
636
680
  reducerResults: PivotReducerResults<KeyType>;
637
681
  items: DataType[];
@@ -639,7 +683,7 @@ declare module "utils/groupAndPivot/index" {
639
683
  export type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
640
684
  export type DeepMapGroupValueType<DataType, KeyType> = {
641
685
  items: DataType[];
642
- reducerResults: any[];
686
+ reducerResults: Record<string, AggregationReducerResult>;
643
687
  pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
644
688
  };
645
689
  export type GroupBy<DataType, KeyType> = {
@@ -648,21 +692,24 @@ declare module "utils/groupAndPivot/index" {
648
692
  column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
649
693
  };
650
694
  export type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
651
- column?: InfiniteTablePivotColumn<DataType> | (({ column, }: {
695
+ column?: InfiniteTableColumn<DataType> | (({ column, }: {
652
696
  column: InfiniteTablePivotFinalColumn<DataType, KeyType>;
653
697
  }) => Partial<InfiniteTablePivotColumn<DataType>>);
698
+ columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
699
+ columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
700
+ }) => Partial<InfiniteTablePivotFinalColumnGroup<DataType>>);
654
701
  };
655
702
  type GroupParams<DataType, KeyType> = {
656
703
  groupBy: GroupBy<DataType, KeyType>[];
657
704
  defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
658
705
  pivot?: PivotBy<DataType, KeyType>[];
659
- reducers?: AggregationReducer<DataType, any>[];
706
+ reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
660
707
  };
661
708
  export type DataGroupResult<DataType, KeyType extends any> = {
662
709
  deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
663
710
  groupParams: GroupParams<DataType, KeyType>;
664
711
  initialData: DataType[];
665
- reducerResults?: any[];
712
+ reducerResults?: Record<string, AggregationReducerResult>;
666
713
  topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
667
714
  pivot?: PivotBy<DataType, KeyType>[];
668
715
  };
@@ -672,6 +719,7 @@ declare module "utils/groupAndPivot/index" {
672
719
  groupResult: DataGroupResult<DataType, KeyType>;
673
720
  toPrimaryKey: (data: DataType) => any;
674
721
  groupRowsState?: GroupRowsState;
722
+ reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
675
723
  generateGroupRows: boolean;
676
724
  };
677
725
  export function enhancedFlatten<DataType, KeyType = any>(param: EnhancedFlattenParam<DataType, KeyType>): {
@@ -859,30 +907,34 @@ declare module "components/InfiniteTable/components/LoadMask" {
859
907
  declare module "components/InfiniteTable/types/InfiniteTableProps" {
860
908
  import * as React from 'react';
861
909
  import { InfiniteTableState } from "components/InfiniteTable/types/index";
862
- import { AggregationReducer, InfiniteTableRowInfo } from "utils/groupAndPivot/index";
863
- import { DataSourceGroupRowsBy, DataSourcePropGroupRowsBy, DataSourcePropPivotBy, DataSourceState } from "components/DataSource/index";
910
+ import { AggregationReducer, InfiniteTableRowInfoGroup, InfiniteTableRowInfoNormal } from "utils/groupAndPivot/index";
911
+ import { DataSourceGroupBy, DataSourcePropGroupBy, DataSourcePropPivotBy, DataSourceState } from "components/DataSource/index";
864
912
  import { Renderable } from "components/types/Renderable";
865
913
  import { LoadMaskProps } from "components/InfiniteTable/components/LoadMask";
866
- import type { InfiniteTableBaseColumn, InfiniteTableColumn, InfiniteTableColumnRenderFunction, InfiniteTableComputedColumn, InfiniteTablePivotColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
914
+ import type { InfiniteTableBaseColumn, InfiniteTableColumn, InfiniteTableColumnRenderFunction, InfiniteTableComputedColumn, InfiniteTableComputedPivotFinalColumn, InfiniteTablePivotColumn, InfiniteTablePivotFinalColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
867
915
  import { InfiniteTablePropPivotTotalColumnPosition } from "components/InfiniteTable/types/InfiniteTableState";
868
916
  export type InfiniteTablePropColumnOrderNormalized = string[];
869
917
  export type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
870
918
  export type InfiniteTablePropColumnVisibility = Map<string, false>;
871
919
  export type InfiniteTablePropColumnPinning = Map<string, true | 'start' | 'end'>;
872
920
  export type InfiniteTableRowStyleFnParams<T> = {
873
- data: T | null;
874
- rowInfo: InfiniteTableRowInfo<T>;
875
921
  rowIndex: number;
876
- groupRowsBy?: (keyof T)[];
877
- };
922
+ groupBy?: (keyof T)[];
923
+ } & ({
924
+ data: T;
925
+ rowInfo: InfiniteTableRowInfoNormal<T>;
926
+ } | {
927
+ data: Partial<T> | null;
928
+ rowInfo: InfiniteTableRowInfoGroup<T>;
929
+ });
878
930
  export type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React.CSSProperties;
879
931
  export type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
880
932
  export type InfiniteTablePropRowStyle<T> = React.CSSProperties | InfiniteTableRowStyleFn<T>;
881
933
  export type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
882
- export type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter'> & {
934
+ export type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
883
935
  getter?: AggregationReducer<T, AggregationResultType>['getter'];
936
+ field?: keyof T;
884
937
  };
885
- export type InfiniteTablePropColumnAggregations<T> = Map<string, InfiniteTableColumnAggregator<T, any>>;
886
938
  export type InfiniteTableColumnType<T> = {
887
939
  minWidth?: number;
888
940
  maxWidth?: number;
@@ -911,7 +963,6 @@ declare module "components/InfiniteTable/types/InfiniteTableProps" {
911
963
  export type InfiniteTableImperativeApi<T> = {
912
964
  setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
913
965
  setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
914
- setColumnAggregations: (columnAggregations: InfiniteTablePropColumnAggregations<T>) => void;
915
966
  x?: T;
916
967
  getState: () => InfiniteTableState<T>;
917
968
  getDataSourceState: () => DataSourceState<T>;
@@ -949,14 +1000,14 @@ declare module "components/InfiniteTable/types/InfiniteTableProps" {
949
1000
  };
950
1001
  export type InfiniteTableGroupColumnGetterOptions<T> = {
951
1002
  groupIndexForColumn?: number;
952
- groupByForColumn?: DataSourceGroupRowsBy<T>;
1003
+ groupByForColumn?: DataSourceGroupBy<T>;
953
1004
  groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
954
1005
  groupCount: number;
955
- groupRowsBy: DataSourceGroupRowsBy<T>[];
1006
+ groupBy: DataSourceGroupBy<T>[];
956
1007
  };
957
- export type InfiniteTablePivotColumnGetterOptions<T> = {
958
- column: InfiniteTablePivotColumn<T>;
959
- groupRowsBy: DataSourcePropGroupRowsBy<T>;
1008
+ export type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
1009
+ column: COL_TYPE;
1010
+ groupBy: DataSourcePropGroupBy<T>;
960
1011
  pivotBy: DataSourcePropPivotBy<T>;
961
1012
  };
962
1013
  export type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
@@ -965,12 +1016,11 @@ declare module "components/InfiniteTable/types/InfiniteTableProps" {
965
1016
  id?: string;
966
1017
  };
967
1018
  export type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
968
- renderValue?: InfiniteTableColumnRenderFunction<T>;
969
- id?: string;
1019
+ renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
970
1020
  };
971
1021
  export type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
972
1022
  export type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => InfiniteTableGroupColumnBase<T>;
973
- export type InfiniteTablePropPivotColumn<T> = InfiniteTablePivotColumnBase<T> | ((options: InfiniteTablePivotColumnGetterOptions<T>) => InfiniteTablePivotColumnBase<T>);
1023
+ export type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
974
1024
  export type InfiniteTablePropPivotRowLabelsColumn<T> = InfiniteTablePropPivotColumn<T>;
975
1025
  export type InfiniteTablePropComponents = {
976
1026
  LoadMask?: React.FC<LoadMaskProps>;
@@ -981,20 +1031,18 @@ declare module "components/InfiniteTable/types/InfiniteTableProps" {
981
1031
  loadingText?: Renderable;
982
1032
  components?: InfiniteTablePropComponents;
983
1033
  viewportReservedWidth?: number;
984
- pivotColumn?: Partial<InfiniteTablePropPivotColumn<T>>;
985
- pivotRowLabelsColumn?: Partial<InfiniteTablePropPivotRowLabelsColumn<T>>;
1034
+ pivotColumn?: InfiniteTablePropPivotColumn<T, InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>>;
1035
+ pivotRowLabelsColumn?: InfiniteTablePropPivotRowLabelsColumn<T>;
986
1036
  pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
987
1037
  groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
988
1038
  groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
989
1039
  hideEmptyGroupColumns?: boolean;
990
1040
  columnVisibility?: InfiniteTablePropColumnVisibility;
991
1041
  defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
992
- columnPinning?: InfiniteTablePropColumnPinning;
993
1042
  pinnedStartMaxWidth?: number;
994
1043
  pinnedEndMaxWidth?: number;
1044
+ columnPinning?: InfiniteTablePropColumnPinning;
995
1045
  defaultColumnPinning?: InfiniteTablePropColumnPinning;
996
- defaultColumnAggregations?: InfiniteTablePropColumnAggregations<T>;
997
- columnAggregations?: InfiniteTablePropColumnAggregations<T>;
998
1046
  columnSizing?: InfiniteTablePropColumnSizing;
999
1047
  defaultColumnSizing?: InfiniteTablePropColumnSizing;
1000
1048
  pivotColumnGroups?: InfiniteTablePropColumnGroups;
@@ -1005,6 +1053,7 @@ declare module "components/InfiniteTable/types/InfiniteTableProps" {
1005
1053
  onScrollbarsChange?: (scrollbars: Scrollbars) => void;
1006
1054
  onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
1007
1055
  columnTypes?: InfiniteTablePropColumnTypes<T>;
1056
+ showSeparatePivotColumnForSingleAggregation?: boolean;
1008
1057
  rowHeight: number | string;
1009
1058
  rowStyle?: InfiniteTablePropRowStyle<T>;
1010
1059
  rowClassName?: InfiniteTablePropRowClassName<T>;
@@ -1079,9 +1128,9 @@ declare module "components/InfiniteTable/types/InfiniteTableState" {
1079
1128
  import { NonUndefined } from "components/types/NonUndefined";
1080
1129
  import { InfiniteTableColumn, InfiniteTablePivotColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
1081
1130
  import { ComponentStateActions } from "components/hooks/useComponentState";
1082
- import { DataSourceGroupRowsBy, DataSourceProps } from "components/DataSource/types";
1083
- export type GroupRowsMap<T> = Map<keyof T, {
1084
- groupBy: DataSourceGroupRowsBy<T>;
1131
+ import { DataSourceGroupBy, DataSourceProps } from "components/DataSource/types";
1132
+ export type GroupByMap<T> = Map<keyof T, {
1133
+ groupBy: DataSourceGroupBy<T>;
1085
1134
  groupIndex: number;
1086
1135
  }>;
1087
1136
  export interface InfiniteTableSetupState<T> {
@@ -1128,6 +1177,7 @@ declare module "components/InfiniteTable/types/InfiniteTableState" {
1128
1177
  focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
1129
1178
  focusedStyle: InfiniteTableProps<T>['focusedStyle'];
1130
1179
  focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
1180
+ showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
1131
1181
  domProps: InfiniteTableProps<T>['domProps'];
1132
1182
  rowStyle: InfiniteTableProps<T>['rowStyle'];
1133
1183
  rowProps: InfiniteTableProps<T>['rowProps'];
@@ -1156,13 +1206,12 @@ declare module "components/InfiniteTable/types/InfiniteTableState" {
1156
1206
  columnPinning: NonUndefined<InfiniteTableProps<T>['columnPinning']>;
1157
1207
  columnSizing: InfiniteTablePropColumnSizingMap;
1158
1208
  columnTypes: InfiniteTablePropColumnTypesMap<T>;
1159
- columnAggregations: NonUndefined<InfiniteTableProps<T>['columnAggregations']>;
1160
1209
  columnGroups: NonUndefined<InfiniteTableProps<T>['columnGroups']>;
1161
1210
  collapsedColumnGroups: NonUndefined<InfiniteTableProps<T>['collapsedColumnGroups']>;
1162
1211
  pivotTotalColumnPosition: NonUndefined<InfiniteTableProps<T>['pivotTotalColumnPosition']>;
1163
1212
  }
1164
1213
  export interface InfiniteTableDerivedState<T> {
1165
- groupRowsBy: DataSourceProps<T>['groupRowsBy'];
1214
+ groupBy: DataSourceProps<T>['groupBy'];
1166
1215
  computedColumns: Map<string, InfiniteTableColumn<T>>;
1167
1216
  virtualizeHeader: boolean;
1168
1217
  groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
@@ -1236,17 +1285,20 @@ declare module "components/InfiniteTable/types/index" {
1236
1285
  import type { InfiniteTableState } from "components/InfiniteTable/types/InfiniteTableState";
1237
1286
  import type { InfiniteTableAction } from "components/InfiniteTable/types/InfiniteTableAction";
1238
1287
  import type { InfiniteTableActionType } from "components/InfiniteTable/types/InfiniteTableActionType";
1239
- import type { InfiniteTableProps, InfiniteTableImperativeApi, InfiniteTablePropColumnOrder, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnAggregator, InfiniteTableColumnGroup, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnAggregations, InfiniteTablePropColumnGroups, InfiniteTablePropRowStyle, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTablePropRowClassName, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePropColumnSizingMap, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableColumnSizingOptions, Scrollbars } from "components/InfiniteTable/types/InfiniteTableProps";
1288
+ import type { InfiniteTableProps, InfiniteTableImperativeApi, InfiniteTablePropColumnOrder, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnAggregator, InfiniteTableColumnGroup, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnGroups, InfiniteTablePropRowStyle, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTablePropRowClassName, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePropColumnSizingMap, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableColumnSizingOptions, Scrollbars } from "components/InfiniteTable/types/InfiniteTableProps";
1240
1289
  import type { InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam } from "components/InfiniteTable/types/InfiniteTableColumn";
1241
1290
  import type { InfiniteTableComputedValues } from "components/InfiniteTable/types/InfiniteTableComputedValues";
1242
1291
  import type { InfiniteTableContextValue } from "components/InfiniteTable/types/InfiniteTableContextValue";
1243
1292
  import type { InfiniteTableRowInfo } from "utils/groupAndPivot/index";
1244
- export type { Scrollbars, InfiniteTableColumnAggregator, InfiniteTableComputedValues, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTableRowInfo, InfiniteTableGroupColumnFunction, InfiniteTablePropColumnOrder, InfiniteTablePropComponents, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnGroup, InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableContextValue, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnAggregations, InfiniteTablePropColumnGroups, InfiniteTablePropColumnSizing, InfiniteTablePropColumnSizingMap, InfiniteTableColumnSizingOptions, InfiniteTableState, InfiniteTableAction, InfiniteTableProps, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableImperativeApi, InfiniteTableActionType, InfiniteTablePropRowStyle, InfiniteTablePropRowClassName, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTableGroupColumnGetterOptions, };
1293
+ export type { Scrollbars, InfiniteTableColumnAggregator, InfiniteTableComputedValues, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTableRowInfo, InfiniteTableGroupColumnFunction, InfiniteTablePropColumnOrder, InfiniteTablePropComponents, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnGroup, InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableContextValue, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnGroups, InfiniteTablePropColumnSizing, InfiniteTablePropColumnSizingMap, InfiniteTableColumnSizingOptions, InfiniteTableState, InfiniteTableAction, InfiniteTableProps, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableImperativeApi, InfiniteTableActionType, InfiniteTablePropRowStyle, InfiniteTablePropRowClassName, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTableGroupColumnGetterOptions, };
1245
1294
  }
1246
1295
  declare module "components/InfiniteTable/InfiniteTableContext" {
1247
1296
  import { InfiniteTableContextValue } from "components/InfiniteTable/types/InfiniteTableContextValue";
1248
1297
  export function getInfiniteTableContext<T>(): React.Context<InfiniteTableContextValue<T>>;
1249
1298
  }
1299
+ declare module "components/InfiniteTable/utils/toMap" {
1300
+ export function toMap<K extends string, V>(mapOrObject?: Map<K, V> | Record<K, V>): Map<K, V>;
1301
+ }
1250
1302
  declare module "components/InfiniteTable/state/computeColumnGroupsDepths" {
1251
1303
  import type { InfiniteTablePropColumnGroups } from "components/InfiniteTable/types/InfiniteTableProps";
1252
1304
  import type { InfiniteTableColumnGroupsDepthsMap } from "components/InfiniteTable/types/InfiniteTableState";
@@ -1266,11 +1318,12 @@ declare module "components/InfiniteTable/state/getInitialState" {
1266
1318
  export const forwardProps: <T>() => Partial<{
1267
1319
  columns: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumns<T, import("components/InfiniteTable/types").InfiniteTableColumn<T>>) => import("components/InfiniteTable/types").InfiniteTablePropColumnsMap<T, import("components/InfiniteTable/types").InfiniteTableColumn<T>>);
1268
1320
  header: 1 | ((value: boolean | undefined) => boolean);
1321
+ showSeparatePivotColumnForSingleAggregation: 1 | ((value: boolean | undefined) => boolean);
1269
1322
  pivotTotalColumnPosition: 1 | ((value: import("components/InfiniteTable/types/InfiniteTableState").InfiniteTablePropPivotTotalColumnPosition | undefined) => import("components/InfiniteTable/types/InfiniteTableState").InfiniteTablePropPivotTotalColumnPosition);
1270
1323
  pivotColumns: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnsMap<T, import("components/InfiniteTable/types/InfiniteTableColumn").InfiniteTablePivotColumn<T>> | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnsMap<T, import("components/InfiniteTable/types/InfiniteTableColumn").InfiniteTablePivotColumn<T>> | undefined);
1271
1324
  pivotColumnGroups: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnGroups | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnGroups | undefined);
1272
- pivotColumn: 1 | ((value: Partial<import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotColumn<T>> | undefined) => Partial<import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotColumn<T>> | undefined);
1273
1325
  sortable: 1 | ((value: boolean | undefined) => boolean);
1326
+ pivotColumn: 1 | ((value: import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotColumn<T, import("components/InfiniteTable/types").InfiniteTableColumn<T> & import("components/InfiniteTable/types/InfiniteTableColumn").InfiniteTablePivotFinalColumn<T, any>> | undefined) => import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotColumn<T, import("components/InfiniteTable/types").InfiniteTableColumn<T> & import("components/InfiniteTable/types/InfiniteTableColumn").InfiniteTablePivotFinalColumn<T, any>> | undefined);
1274
1327
  components: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropComponents | undefined) => import("components/InfiniteTable/types").InfiniteTablePropComponents | undefined);
1275
1328
  scrollTopId: 1 | ((value: string | number | undefined) => string | number | undefined);
1276
1329
  viewportReservedWidth: 1 | ((value: number | undefined) => number | undefined);
@@ -1295,7 +1348,7 @@ declare module "components/InfiniteTable/state/getInitialState" {
1295
1348
  rowClassName: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropRowClassName<T> | undefined) => import("components/InfiniteTable/types").InfiniteTablePropRowClassName<T> | undefined);
1296
1349
  pinnedStartMaxWidth: 1 | ((value: number | undefined) => number | undefined);
1297
1350
  pinnedEndMaxWidth: 1 | ((value: number | undefined) => number | undefined);
1298
- pivotRowLabelsColumn: 1 | ((value: Partial<import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotRowLabelsColumn<T>> | undefined) => Partial<import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotRowLabelsColumn<T>> | undefined);
1351
+ pivotRowLabelsColumn: 1 | ((value: import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotRowLabelsColumn<T> | undefined) => import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropPivotRowLabelsColumn<T> | undefined);
1299
1352
  activeIndex: 1 | ((value: number | undefined) => number);
1300
1353
  columnMinWidth: 1 | ((value: number | undefined) => number);
1301
1354
  columnMaxWidth: 1 | ((value: number | undefined) => number);
@@ -1309,7 +1362,6 @@ declare module "components/InfiniteTable/state/getInitialState" {
1309
1362
  licenseKey: 1 | ((value: string | undefined) => string);
1310
1363
  columnVisibility: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnVisibility | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnVisibility);
1311
1364
  columnPinning: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnPinning | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnPinning);
1312
- columnAggregations: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnAggregations<T> | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnAggregations<T>);
1313
1365
  columnGroups: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnGroups | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnGroups);
1314
1366
  collapsedColumnGroups: 1 | ((value: import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropCollapsedColumnGroups | undefined) => import("components/InfiniteTable/types/InfiniteTableProps").InfiniteTablePropCollapsedColumnGroups);
1315
1367
  columnSizing: 1 | ((value: import("components/InfiniteTable/types").InfiniteTablePropColumnSizing | undefined) => import("components/InfiniteTable/types").InfiniteTablePropColumnSizingMap);
@@ -1532,13 +1584,6 @@ declare module "components/InfiniteTable/hooks/useComputedVisibleColumns" {
1532
1584
  };
1533
1585
  export const useComputedVisibleColumns: <T extends unknown>({ columns, bodySize, columnMinWidth, columnMaxWidth, columnDefaultWidth, sortable, draggableColumns, sortInfo, multiSort, setSortInfo, columnOrder, columnPinning, columnTypes, pinnedEndMaxWidth, pinnedStartMaxWidth, viewportReservedWidth, columnVisibility, columnVisibilityAssumeVisible, columnSizing, }: UseComputedVisibleColumnsParam<T>) => UseComputedVisibleColumnsResult<T>;
1534
1586
  }
1535
- declare module "components/DataSource/publicHooks/useDataSourceActions" {
1536
- import { DataSourceComponentActions } from "components/DataSource/types";
1537
- export default function useDataSourceActions<T>(): DataSourceComponentActions<T>;
1538
- }
1539
- declare module "components/InfiniteTable/hooks/useColumnAggregations" {
1540
- export function useColumnAggregations<T>(): void;
1541
- }
1542
1587
  declare module "components/InfiniteTable/hooks/useColumnGroups" {
1543
1588
  export function useColumnGroups<T>(): void;
1544
1589
  }
@@ -1546,6 +1591,15 @@ declare module "utils/join" {
1546
1591
  const join: (...args: (string | number | void | null)[]) => string;
1547
1592
  export { join };
1548
1593
  }
1594
+ declare module "components/InfiniteTable/components/icons/ExpanderIcon.css" {
1595
+ export const ExpanderIconCls: string;
1596
+ export const ExpanderIconClsVariants: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
1597
+ expanded: {
1598
+ true: string;
1599
+ false: {};
1600
+ };
1601
+ }>;
1602
+ }
1549
1603
  declare module "components/InfiniteTable/components/icons/ExpanderIcon" {
1550
1604
  import * as React from 'react';
1551
1605
  type ExpanderIconProps = {
@@ -1590,7 +1644,7 @@ declare module "components/InfiniteTable/components/InfiniteTableRow/row.css" {
1590
1644
  export const GroupRowExpanderCls: string;
1591
1645
  }
1592
1646
  declare module "components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns" {
1593
- import { DataSourcePropGroupRowsBy, DataSourcePropPivotBy } from "components/DataSource/index";
1647
+ import { DataSourcePropGroupBy, DataSourcePropPivotBy } from "components/DataSource/index";
1594
1648
  import { InfiniteTableProps } from "components/InfiniteTable/types/index";
1595
1649
  import { InfiniteTableState } from "components/InfiniteTable/types/InfiniteTableState";
1596
1650
  export function getComputedPivotColumnsFromDataSourcePivotColumns<T>(pivotColumns: InfiniteTableProps<T>['pivotColumns'], params: {
@@ -1599,13 +1653,13 @@ declare module "components/InfiniteTable/state/getComputedPivotColumnsFromDataSo
1599
1653
  pivotRowLabelsColumn: InfiniteTableProps<T>['pivotRowLabelsColumn'];
1600
1654
  pivotTotalColumnPosition: InfiniteTableState<T>['pivotTotalColumnPosition'];
1601
1655
  pivotBy: DataSourcePropPivotBy<T>;
1602
- groupRowsBy: DataSourcePropGroupRowsBy<T>;
1656
+ groupBy: DataSourcePropGroupBy<T>;
1603
1657
  }): InfiniteTableProps<T>['pivotColumns'];
1604
1658
  }
1605
1659
  declare module "components/InfiniteTable/utils/getColumnForGroupBy" {
1606
1660
  import * as React from 'react';
1607
1661
  import { InfiniteTableColumnRenderParam } from "components/InfiniteTable/index";
1608
- import { DataSourceGroupRowsBy } from "components/DataSource/index";
1662
+ import { DataSourceGroupBy } from "components/DataSource/index";
1609
1663
  import { InfiniteTableGeneratedGroupColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
1610
1664
  import { InfiniteTableGroupColumnGetterOptions, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy } from "components/InfiniteTable/types/InfiniteTableProps";
1611
1665
  export function getGroupColumnRender<T>({ groupIndexForColumn, groupRenderStrategy, toggleGroupRow, }: {
@@ -1615,7 +1669,7 @@ declare module "components/InfiniteTable/utils/getColumnForGroupBy" {
1615
1669
  }): (renderOptions: InfiniteTableColumnRenderParam<T>) => React.ReactNode;
1616
1670
  export function getColumnForGroupBy<T>(options: InfiniteTableGroupColumnGetterOptions<T> & {
1617
1671
  groupIndexForColumn: number;
1618
- groupByForColumn: DataSourceGroupRowsBy<T>;
1672
+ groupByForColumn: DataSourceGroupBy<T>;
1619
1673
  }, toggleGroupRow: (groupRowKeys: any[]) => void, groupColumnFromProps?: InfiniteTablePropGroupColumn<T>): InfiniteTableGeneratedGroupColumn<T>;
1620
1674
  export function getSingleGroupColumn<T>(options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupRowKeys: any[]) => void, groupColumnFromProps?: InfiniteTablePropGroupColumn<T>): InfiniteTableGeneratedGroupColumn<T>;
1621
1675
  }
@@ -1625,12 +1679,12 @@ declare module "components/InfiniteTable/hooks/useToggleGroupRow" {
1625
1679
  }
1626
1680
  declare module "components/InfiniteTable/hooks/useColumnsWhen" {
1627
1681
  import type { InfiniteTableColumn } from "components/InfiniteTable/index";
1628
- import type { DataSourceGroupRowsBy } from "components/DataSource/index";
1682
+ import type { DataSourceGroupBy } from "components/DataSource/index";
1629
1683
  import type { InfiniteTablePropGroupRenderStrategy, InfiniteTableProps } from "components/InfiniteTable/types/InfiniteTableProps";
1630
1684
  export function useColumnsWhen<T>(): void;
1631
1685
  export function getColumnsWhenGrouping<T>(params: {
1632
1686
  columns: Map<string, InfiniteTableColumn<T>>;
1633
- groupRowsBy: DataSourceGroupRowsBy<T>[];
1687
+ groupBy: DataSourceGroupBy<T>[];
1634
1688
  toggleGroupRow: (groupKeys: any[]) => void;
1635
1689
  groupColumn: InfiniteTableProps<T>['groupColumn'];
1636
1690
  groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;