@infinite-table/infinite-react 0.2.18 → 0.3.0-canary.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.
Files changed (6) hide show
  1. package/index.css +141 -129
  2. package/index.d.ts +886 -710
  3. package/index.esm.css +141 -129
  4. package/index.esm.js +7272 -7236
  5. package/index.js +6869 -6804
  6. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,16 +1,12 @@
1
1
  import * as _vanilla_extract_private from '@vanilla-extract/private';
2
2
  import * as React$1 from 'react';
3
- import { CSSProperties, HTMLProps, MutableRefObject } from 'react';
3
+ import { MutableRefObject, CSSProperties, HTMLProps } from 'react';
4
4
 
5
5
  declare function debounce(fn: Function, { wait }: {
6
6
  wait: number;
7
7
  }): (...args: any[]) => void;
8
8
 
9
- interface ScrollPosition {
10
- scrollTop: number;
11
- scrollLeft: number;
12
- }
13
- declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
9
+ declare type Renderable = React$1.ReactNode | JSX.Element;
14
10
 
15
11
  declare type SortDir = 1 | -1;
16
12
  declare type MultisortInfo<T> = {
@@ -50,6 +46,7 @@ declare class DeepMap<KeyType, ValueType> {
50
46
  private emptyKey;
51
47
  static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
52
48
  constructor(initial?: [KeyType[], ValueType][]);
49
+ getValuesStartingWith(keys: KeyType[]): ValueType[];
53
50
  set(keys: KeyType[] & {
54
51
  length: Omit<number, 0>;
55
52
  }, value: ValueType): this;
@@ -72,22 +69,6 @@ declare class DeepMap<KeyType, ValueType> {
72
69
  private sortedIterator;
73
70
  }
74
71
 
75
- declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
76
- getComponentState: () => T_STATE;
77
- componentState: T_STATE;
78
- componentActions: T_ACTIONS;
79
- };
80
- declare type ComponentStateGeneratedActions<T_STATE> = {
81
- [k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
82
- };
83
- declare type ComponentInterceptedActions<T_STATE> = {
84
- [k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
85
- actions: ComponentStateGeneratedActions<T_STATE>;
86
- state: T_STATE;
87
- }) => void | boolean;
88
- };
89
- declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
90
-
91
72
  declare class GroupRowsState<KeyType extends any = any> {
92
73
  private expandedMap?;
93
74
  private collapsedMap?;
@@ -110,7 +91,16 @@ declare class GroupRowsState<KeyType extends any = any> {
110
91
  toggleGroupRow(keys: KeyType[]): void;
111
92
  }
112
93
 
113
- declare type NonUndefined<T> = T extends undefined ? never : T;
94
+ interface ScrollPosition {
95
+ scrollTop: number;
96
+ scrollLeft: number;
97
+ }
98
+ declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
99
+
100
+ interface Size {
101
+ width: number;
102
+ height: number;
103
+ }
114
104
 
115
105
  declare type VoidFn = () => void;
116
106
 
@@ -122,6 +112,34 @@ interface SubscriptionCallback<T> {
122
112
  onChange: (fn: SubscriptionCallbackOnChangeFn<T>) => VoidFn;
123
113
  }
124
114
 
115
+ declare class ScrollListener {
116
+ private scrollPosition;
117
+ private onScrollFns;
118
+ getScrollPosition: () => ScrollPosition;
119
+ onScroll: (fn: OnScrollFn) => () => void;
120
+ setScrollPosition: (scrollPosition: ScrollPosition) => void;
121
+ private notifyScrollChange;
122
+ destroy: () => void;
123
+ }
124
+
125
+ declare type NonUndefined<T> = T extends undefined ? never : T;
126
+
127
+ declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
128
+ getComponentState: () => T_STATE;
129
+ componentState: T_STATE;
130
+ componentActions: T_ACTIONS;
131
+ };
132
+ declare type ComponentStateGeneratedActions<T_STATE> = {
133
+ [k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
134
+ };
135
+ declare type ComponentInterceptedActions<T_STATE> = {
136
+ [k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
137
+ actions: ComponentStateGeneratedActions<T_STATE>;
138
+ state: T_STATE;
139
+ }) => void | boolean;
140
+ };
141
+ declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
142
+
125
143
  interface LogFn {
126
144
  (...args: any[]): LogFn;
127
145
  extend: (channelName: string) => LogFn;
@@ -132,170 +150,419 @@ declare class Logger {
132
150
  constructor(channelName: string);
133
151
  }
134
152
 
135
- interface Size {
153
+ declare type FixedPosition = false | 'start' | 'end';
154
+ declare type SpanFunction = ({ rowIndex, colIndex, }: {
155
+ rowIndex: number;
156
+ colIndex: number;
157
+ }) => number;
158
+ declare type RenderRangeType = {
159
+ startIndex: number;
160
+ endIndex: number;
161
+ };
162
+ declare type ItemSizeFunction = (index: number) => number;
163
+ declare type MatrixBrainOptions = {
136
164
  width: number;
137
165
  height: number;
138
- }
139
-
140
- declare type MainAxisOptions = 'vertical' | 'horizontal';
141
- declare type VirtualBrainOptions = {
142
- mainAxis: MainAxisOptions;
143
- itemSize: MainAxisSize;
144
- itemSpan?: ({ itemIndex }: {
145
- itemIndex: number;
146
- }) => number;
147
- count: number;
148
- name?: string;
166
+ cols: number;
167
+ rows: number;
168
+ rowHeight: number | ItemSizeFunction;
169
+ colWidth: number | ItemSizeFunction;
170
+ rowspan?: SpanFunction;
171
+ colspan?: SpanFunction;
149
172
  };
150
- declare type MainAxisSize = number | ((itemIndex: number) => number);
151
- declare type OnRenderCountChangeFn = (renderCount: number) => void;
152
- declare type OnSizeChangeFn = (size: number) => void;
153
- declare type OnDestroyFn = () => void;
154
- declare type RenderRange = {
155
- renderStartIndex: number;
156
- renderEndIndex: number;
173
+ declare type TableRenderRange = {
174
+ start: [number, number];
175
+ end: [number, number];
176
+ rowFixed?: FixedPosition;
177
+ colFixed?: FixedPosition;
157
178
  };
158
- declare type OnRenderRangeChangeFn = (renderRange: RenderRange) => void;
159
- declare class VirtualBrain extends Logger {
179
+ declare type WhichDirection = {
180
+ horizontal?: boolean;
181
+ vertical?: boolean;
182
+ };
183
+ declare type FnOnRenderRangeChange = (range: TableRenderRange) => void;
184
+ declare type FnOnDirectionalRenderRangeChange = (range: [number, number]) => void;
185
+ declare type FnOnRenderCountChange = ({ horizontal, vertical, }: {
186
+ horizontal: number;
187
+ vertical: number;
188
+ }) => void;
189
+ declare type OnAvailableSizeChange = (size: Size) => void;
190
+ declare class MatrixBrain extends Logger {
191
+ private scrolling;
192
+ private width;
193
+ private height;
194
+ private cols;
195
+ private rows;
196
+ private rowHeight;
197
+ private colWidth;
198
+ private rowspan;
199
+ private colspan;
200
+ private rowspanParent;
201
+ private rowspanValue;
202
+ private rowHeightCache;
203
+ private rowOffsetCache;
204
+ private verticalTotalSize;
205
+ private colspanParent;
206
+ private colspanValue;
207
+ private colWidthCache;
208
+ private colOffsetCache;
209
+ private horizontalTotalSize;
210
+ private horizontalRenderCount?;
211
+ private verticalRenderCount?;
212
+ private horizontalRenderRange;
213
+ private verticalRenderRange;
214
+ private extraSpanCells;
160
215
  private scrollPosition;
161
- private scrollPositionOnMainAxis;
162
- private itemSpanParent;
163
- private itemSpanValue;
164
- private itemSizeCache;
165
- private itemOffsetCache;
166
- private options;
167
- private destroyed;
168
- private totalSize;
169
216
  private onScrollFns;
170
- private onTotalSizeChangeFns;
171
- private onRenderCountChangeFns;
172
217
  private onRenderRangeChangeFns;
218
+ private onVerticalRenderRangeChangeFns;
219
+ private onHorizontalRenderRangeChangeFns;
173
220
  private onDestroyFns;
174
- name: string | undefined;
175
- private renderCount;
176
- private renderRange;
177
- private availableSize;
178
- constructor(options: VirtualBrainOptions);
179
- setAvailableSize: (size: Size) => void;
180
- getOptions(): VirtualBrainOptions;
181
- private updateRenderCount;
182
- private computeRenderCount;
183
- private setRenderCount;
184
- private updateRenderRange;
185
- getRenderStartIndex(): number;
186
- getRenderCount: () => number;
187
- setScrollPosition: (scrollPosition: ScrollPosition) => void;
221
+ private destroyed;
222
+ private onRenderCountChangeFns;
223
+ private onAvailableSizeChangeFns;
224
+ private onScrollStartFns;
225
+ private onScrollStopFns;
226
+ private scrollTimeoutId;
227
+ private scrollStopDelay;
228
+ /**
229
+ * Number of columns that are fixed at the start
230
+ */
231
+ private fixedColsStart;
232
+ /**
233
+ * Number of columns that are fixed at the end
234
+ */
235
+ private fixedColsEnd;
236
+ /**
237
+ * Number of rows that are fixed at the start
238
+ */
239
+ private fixedRowsStart;
240
+ /**
241
+ * Number of rows that are fixed at the end
242
+ */
243
+ private fixedRowsEnd;
244
+ constructor();
245
+ private reset;
246
+ private resetVertical;
247
+ private resetHorizontal;
248
+ setScrollStopDelay: (scrollStopDelay: number) => void;
249
+ getRowCount: () => number;
250
+ getColCount: () => number;
251
+ update: (options: Partial<MatrixBrainOptions>) => void;
252
+ setRowAndColumnSizes({ rowHeight, colWidth, }: {
253
+ rowHeight: number | ItemSizeFunction;
254
+ colWidth: number | ItemSizeFunction;
255
+ }): void;
256
+ setRowsAndCols: ({ rows, cols }: {
257
+ rows: number;
258
+ cols: number;
259
+ }) => void;
260
+ setAvailableSize(size: Partial<Size>, config?: {
261
+ skipUpdateRenderCount?: boolean;
262
+ }): void;
263
+ updateRenderCount: (which?: WhichDirection) => void;
264
+ private doUpdateRenderCount;
265
+ get scrollTopMax(): number;
266
+ get scrollLeftMax(): number;
267
+ private setScrolling;
268
+ private notifyScrollStart;
269
+ private notifyScrollStop;
270
+ setScrollPosition: (scrollPosition: ScrollPosition, callback?: ((scrollPos: ScrollPosition) => void) | undefined) => void;
271
+ private notifyAvailableSizeChange;
272
+ private notifyRenderRangeChange;
273
+ private notifyVerticalRenderRangeChange;
274
+ private notifyHorizontalRenderRangeChange;
188
275
  private notifyScrollChange;
189
- private notifyDestroy;
190
- private notifyTotalSizeChange;
276
+ private computeDirectionalRenderCount;
277
+ getFixedSize(direction: 'horizontal' | 'vertical'): number;
278
+ getFixedStartSize(direction: 'horizontal' | 'vertical'): number;
279
+ getFixedEndSize(direction: 'horizontal' | 'vertical'): number;
280
+ getFixedEndColsWidth: () => number;
281
+ /**
282
+ * Returns an array of offsets for all cols fixed at the end
283
+ *
284
+ * The order in the array is from leftmost col to the rightmost col
285
+ * The reference for offset is the left side of the table.
286
+ * The offsets take into account the scroll position and return the correct position.
287
+ *
288
+ * The indexes in the returned array are the absolute indexes of the cols, so the returned array is an array with holes
289
+ *
290
+ */
291
+ getFixedEndColsOffsets: () => number[];
292
+ /**
293
+ * Returns an array of offsets for all rows fixed at the end
294
+ *
295
+ * The order in the array is from topmost row to the bottom-most row
296
+ * The reference for offset is the top side of the table.
297
+ * The offsets take into account the scroll position and return the correct position.
298
+ *
299
+ * The indexes in the returned array are the absolute indexes of the rows, so the returned array is an array with holes
300
+ *
301
+ */
302
+ getFixedEndRowsOffsets: () => number[];
303
+ getFixedStartColsWidth: () => number;
304
+ getFixedEndRowsHeight: () => number;
305
+ getFixedStartRowsHeight: () => number;
306
+ computeRenderCount: (which?: WhichDirection) => {
307
+ horizontal: number;
308
+ vertical: number;
309
+ };
310
+ setRenderCount: ({ horizontal, vertical, }: {
311
+ horizontal: number;
312
+ vertical: number;
313
+ }) => void;
191
314
  private notifyRenderCountChange;
192
- private notifyRenderRangeChange;
193
- getRenderRange: () => RenderRange;
194
- private setRenderRange;
195
- private computeRenderRange;
196
- getScrollPosition: () => ScrollPosition;
197
- onScroll: (fn: OnScrollFn) => () => void;
198
- onTotalSizeChange: (fn: OnSizeChangeFn) => () => void;
199
- onRenderCountChange: (fn: OnRenderCountChangeFn) => () => void;
200
- onRenderRangeChange: (fn: OnRenderRangeChangeFn) => () => void;
201
- onDestroy: (fn: OnDestroyFn) => () => void;
202
- update: (newCount: VirtualBrainOptions['count'], newItemSize: VirtualBrainOptions['itemSize'], newItemSpan?: VirtualBrainOptions['itemSpan']) => void;
203
- private reset;
204
- private computeItemSpanUpTo;
315
+ updateFixedCells: (config: {
316
+ fixedColsStart?: number;
317
+ fixedColsEnd?: number;
318
+ fixedRowsStart?: number;
319
+ fixedRowsEnd?: number;
320
+ }) => void;
321
+ getFixedCellInfo: () => {
322
+ fixedRowsStart: number;
323
+ fixedColsStart: number;
324
+ fixedRowsEnd: number;
325
+ fixedColsEnd: number;
326
+ };
327
+ updateRenderRange: (which?: WhichDirection) => void;
328
+ getExtraSpanCellsForRange: ({ horizontal, vertical, }: {
329
+ horizontal: RenderRangeType;
330
+ vertical: RenderRangeType;
331
+ }) => [number, number][];
332
+ computeRenderRange: (which?: WhichDirection) => {
333
+ horizontal: RenderRangeType;
334
+ vertical: RenderRangeType;
335
+ extraCells: [number, number][];
336
+ };
337
+ computeDirectionalRenderRange: (direction: 'horizontal' | 'vertical') => {
338
+ startIndex: number;
339
+ endIndex: number;
340
+ };
341
+ getItemAt: (scrollPos: number, direction: 'horizontal' | 'vertical') => number;
342
+ getCellOffset: (rowIndex: number, colIndex: number) => {
343
+ x: number;
344
+ y: number;
345
+ };
346
+ private getItemOffsetFor;
205
347
  private computeCacheFor;
206
348
  private getItemSizeCacheFor;
207
- getItemSpan: (itemIndex: number) => number;
208
- getItemSpanParent: (itemIndex: number) => number;
209
- getItemSizeWithSpan: (itemIndex: number, itemSpan: number) => number;
349
+ private computeItemSpanUpTo;
350
+ private getCellSpan;
351
+ getRowspan: (rowIndex: number, colIndex: number) => number;
352
+ getColspan: (rowIndex: number, colIndex: number) => number;
353
+ getRowspanParent: (rowIndex: number, colIndex: number) => number;
354
+ getColspanParent: (rowIndex: number, colIndex: number) => number;
355
+ getItemSpanParent: (rowIndex: number, colIndex: number, direction: 'horizontal' | 'vertical') => number;
356
+ getRowHeightWithSpan: (rowIndex: number, colIndex: number, rowspan: number) => number;
357
+ getColWidthWithSpan: (rowIndex: number, colIndex: number, colspan: number) => number;
358
+ private getItemSizeWithSpan;
359
+ getRowHeight: (rowIndex: number) => number;
360
+ getColWidth: (colIndex: number) => number;
210
361
  /**
211
- * For now, this doesn't take into account the itemspan, and it's okay not to
362
+ * For now, this doesn't take into account the row/colspan, and it's okay not to
212
363
  * @param itemIndex
213
364
  * @returns the size of the specified item
214
365
  */
215
- getItemSize: (itemIndex: number) => number;
216
- getTotalSize: () => number;
217
- getItemAt: (scrollPos: number) => number;
218
- getItemOffsetFor: (itemIndex: number) => number;
366
+ getItemSize: (itemIndex: number, direction: 'horizontal' | 'vertical') => number;
367
+ getTotalSize: () => {
368
+ height: number;
369
+ width: number;
370
+ };
371
+ getTotalSizeFor: (direction: 'horizontal' | 'vertical') => number;
372
+ setRenderRange: ({ horizontal, vertical, extraCells, }: {
373
+ horizontal: RenderRangeType;
374
+ vertical: RenderRangeType;
375
+ extraCells?: [number, number][] | undefined;
376
+ }) => void;
377
+ getRenderRangeCellCount: (range: TableRenderRange) => number;
378
+ getExtraCells: () => [
379
+ number,
380
+ number
381
+ ][];
382
+ getScrollPosition: () => ScrollPosition;
383
+ getRenderRange: () => TableRenderRange;
384
+ onScroll: (fn: OnScrollFn) => () => void;
385
+ onScrollStart: (fn: VoidFunction) => () => void;
386
+ onScrollStop: (fn: (scrollPos: ScrollPosition) => void) => () => void;
387
+ onRenderRangeChange: (fn: FnOnRenderRangeChange) => () => void;
388
+ onVerticalRenderRangeChange: (fn: FnOnDirectionalRenderRangeChange) => () => void;
389
+ onHorizontalRenderRangeChange: (fn: FnOnDirectionalRenderRangeChange) => () => void;
390
+ onRenderCountChange: (fn: FnOnRenderCountChange) => () => void;
391
+ onAvailableSizeChange: (fn: OnAvailableSizeChange) => () => void;
392
+ onDestroy: (fn: VoidFn) => () => void;
393
+ getAvailableSize: () => {
394
+ width: number;
395
+ height: number;
396
+ };
397
+ private notifyDestroy;
219
398
  destroy: () => void;
220
399
  }
221
400
 
222
- declare type Renderable = React$1.ReactNode | JSX.Element;
401
+ interface InfiniteTableSetupState<T> {
402
+ propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
403
+ columnsWhenInlineGroupRenderStrategy?: Map<string, InfiniteTableColumn<T>>;
404
+ domRef: MutableRefObject<HTMLDivElement | null>;
405
+ scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
406
+ portalDOMRef: MutableRefObject<HTMLDivElement | null>;
407
+ onRowHeightCSSVarChange: SubscriptionCallback<number>;
408
+ onHeaderHeightCSSVarChange: SubscriptionCallback<number>;
409
+ columnsWhenGrouping?: InfiniteTablePropColumnsMap<T>;
410
+ bodySize: Size;
411
+ brain: MatrixBrain;
412
+ headerBrain: MatrixBrain;
413
+ focused: boolean;
414
+ ready: boolean;
415
+ focusedWithin: boolean;
416
+ scrollPosition: ScrollPosition;
417
+ draggingColumnId: null | string;
418
+ pinnedStartScrollListener: ScrollListener;
419
+ pinnedEndScrollListener: ScrollListener;
420
+ columnShifts: number[] | null;
421
+ }
422
+ declare type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
423
+ declare type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
424
+ declare type InfiniteTablePropPivotGrandTotalColumnPosition = InfiniteTablePropPivotTotalColumnPosition;
425
+ interface InfiniteTableMappedState<T> {
426
+ scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
427
+ viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
428
+ groupColumn: InfiniteTableProps<T>['groupColumn'];
429
+ onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
430
+ loadingText: InfiniteTableProps<T>['loadingText'];
431
+ components: InfiniteTableProps<T>['components'];
432
+ columns: InfiniteTablePropColumnsMap<T>;
433
+ pivotColumns: InfiniteTableProps<T>['pivotColumns'];
434
+ onReady: InfiniteTableProps<T>['onReady'];
435
+ onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
436
+ onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
437
+ onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
438
+ onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
439
+ autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
440
+ scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
441
+ onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
442
+ onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
443
+ onScrollStop: InfiniteTableProps<T>['onScrollStop'];
444
+ scrollToBottomOffset: InfiniteTableProps<T>['scrollToBottomOffset'];
445
+ focusedClassName: InfiniteTableProps<T>['focusedClassName'];
446
+ focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
447
+ focusedStyle: InfiniteTableProps<T>['focusedStyle'];
448
+ focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
449
+ showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
450
+ domProps: InfiniteTableProps<T>['domProps'];
451
+ rowStyle: InfiniteTableProps<T>['rowStyle'];
452
+ rowProps: InfiniteTableProps<T>['rowProps'];
453
+ rowClassName: InfiniteTableProps<T>['rowClassName'];
454
+ pinnedStartMaxWidth: InfiniteTableProps<T>['pinnedStartMaxWidth'];
455
+ pinnedEndMaxWidth: InfiniteTableProps<T>['pinnedEndMaxWidth'];
456
+ pivotColumn: InfiniteTableProps<T>['pivotColumn'];
457
+ pivotColumnGroups: InfiniteTablePropColumnGroupsMap;
458
+ activeIndex: NonUndefined<InfiniteTableProps<T>['activeIndex']>;
459
+ columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
460
+ columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
461
+ columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
462
+ columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
463
+ draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
464
+ sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
465
+ hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
466
+ columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
467
+ showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
468
+ showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
469
+ header: NonUndefined<InfiniteTableProps<T>['header']>;
470
+ virtualizeColumns: NonUndefined<InfiniteTableProps<T>['virtualizeColumns']>;
471
+ rowHeight: number;
472
+ headerHeight: number;
473
+ licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
474
+ columnVisibility: InfiniteTablePropColumnVisibility;
475
+ columnPinning: InfiniteTablePropColumnPinningMap;
476
+ columnSizing: InfiniteTablePropColumnSizing;
477
+ columnTypes: InfiniteTablePropColumnTypes<T>;
478
+ columnGroups: InfiniteTablePropColumnGroupsMap;
479
+ collapsedColumnGroups: NonUndefined<InfiniteTableProps<T>['collapsedColumnGroups']>;
480
+ pivotTotalColumnPosition: NonUndefined<InfiniteTableProps<T>['pivotTotalColumnPosition']>;
481
+ pivotGrandTotalColumnPosition: InfiniteTableProps<T>['pivotGrandTotalColumnPosition'];
482
+ }
483
+ interface InfiniteTableDerivedState<T> {
484
+ groupBy: DataSourceProps<T>['groupBy'];
485
+ computedColumns: Map<string, InfiniteTableColumn<T>>;
486
+ groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
487
+ columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
488
+ columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
489
+ columnGroupsMaxDepth: number;
490
+ computedColumnGroups: InfiniteTablePropColumnGroupsMap;
491
+ rowHeightCSSVar: string;
492
+ headerHeightCSSVar: string;
493
+ controlledColumnVisibility: boolean;
494
+ }
495
+ declare type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
496
+ interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
497
+ }
223
498
 
224
- declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
225
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
226
- }[Keys];
499
+ declare enum InfiniteTableActionType {
500
+ SET_COLUMN_SIZE = 0,
501
+ SET_SCROLL_POSITION = 1,
502
+ SET_BODY_SIZE = 2,
503
+ SET_COLUMN_ORDER = 3,
504
+ SET_COLUMN_VISIBILITY = 4,
505
+ SET_COLUMN_SHIFTS = 5,
506
+ SET_COLUMN_PINNING = 6,
507
+ SET_COLUMN_AGGREGATIONS = 7,
508
+ SET_DRAGGING_COLUMN_ID = 8
509
+ }
227
510
 
228
- declare type InfiniteTableCellProps<T> = {
229
- column: InfiniteTableComputedColumn<T>;
230
- renderChildren: () => Renderable;
231
- cssEllipsis?: boolean;
232
- virtualized?: boolean;
233
- skipColumnShifting?: boolean;
234
- beforeChildren?: Renderable;
235
- afterChildren?: Renderable;
236
- offset?: number;
237
- offsetProperty?: 'left' | 'right';
238
- cssPosition?: CSSProperties['position'];
239
- domRef?: React.RefCallback<HTMLElement>;
240
- cellType: 'body' | 'header';
511
+ declare type InfiniteTableAction = {
512
+ type: InfiniteTableActionType;
513
+ payload?: any;
241
514
  };
242
515
 
243
- declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
244
- declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
245
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
246
- sortTool: JSX.Element;
247
- column: COL_TYPE;
248
- columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
249
- };
250
- declare type InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
251
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
252
- value: string | number | Renderable;
253
- groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
254
- rowIndex: number;
255
- column: COL_TYPE;
256
- toggleCurrentGroupRow: () => void;
257
- toggleGroupRow: InfiniteTableToggleGroupRowFn;
258
- groupBy: DataSourceState<DATA_TYPE>['groupBy'];
259
- pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
260
- } & ({
261
- rowInfo: InfiniteTableRowInfoNormal<DATA_TYPE>;
262
- data: DATA_TYPE;
263
- } | {
264
- rowInfo: InfiniteTableRowInfoGroup<DATA_TYPE>;
265
- data: Partial<DATA_TYPE> | null;
266
- });
267
- declare type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParams<DATA_TYPE> & {};
268
- declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE> & {
269
- collapsed: boolean;
270
- groupIcon: Renderable;
516
+ interface InfiniteTableComputedValues<T> {
517
+ scrollbars: {
518
+ vertical: boolean;
519
+ horizontal: boolean;
520
+ };
521
+ rowspan?: MatrixBrainOptions['rowspan'];
522
+ computedPinnedStartOverflow: boolean;
523
+ computedPinnedEndOverflow: boolean;
524
+ computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
525
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
526
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
527
+ computedVisibleColumns: InfiniteTableComputedColumn<T>[];
528
+ computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
529
+ computedColumnVisibility: InfiniteTablePropColumnVisibility;
530
+ computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
531
+ computedPinnedStartColumnsWidth: number;
532
+ computedPinnedStartWidth: number;
533
+ computedPinnedEndColumnsWidth: number;
534
+ computedPinnedEndWidth: number;
535
+ computedUnpinnedColumnsWidth: number;
536
+ computedUnpinnedOffset: number;
537
+ computedPinnedEndOffset: number;
538
+ computedRemainingSpace: number;
539
+ toggleGroupRow: (groupKeys: any[]) => void;
540
+ columnSize: (colIndex: number) => number;
541
+ }
542
+
543
+ interface InfiniteTableContextValue<T> {
544
+ componentState: InfiniteTableState<T>;
545
+ componentActions: InfiniteTableActions<T>;
546
+ computed: InfiniteTableComputedValues<T>;
547
+ getComputed: () => InfiniteTableComputedValues<T>;
548
+ getState: () => InfiniteTableState<T>;
549
+ }
550
+
551
+ declare type LoadMaskProps = {
552
+ visible: boolean;
553
+ children: Renderable;
271
554
  };
272
- declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE>;
273
- declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
274
- rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
275
- data: DATA_TYPE | Partial<DATA_TYPE> | null;
276
- dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
555
+
556
+ declare type InfiniteTablePropColumnOrderNormalized = string[];
557
+ declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
558
+ declare type InfiniteTablePropColumnVisibility = Record<string, false>;
559
+ declare type InfiniteTablePropColumnPinningMap = Map<string, true | 'start' | 'end'>;
560
+ declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
561
+ declare type InfiniteTablePropColumnPinningRecord = Record<string, true | 'start' | 'end'>;
562
+ declare type InfiniteTablePropColumnPinning = InfiniteTablePropColumnPinningRecord | InfiniteTablePropColumnPinningMap;
563
+ declare type InfiniteTableRowStyleFnParams<T> = {
277
564
  rowIndex: number;
278
- column: COL_TYPE;
279
- };
280
- declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, rowInfo, groupBy, pivotBy, }: InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE>) => Renderable | null;
281
- declare type InfiniteTableGroupColumnRenderIconFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (param: InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
282
- declare type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderParams<T>) => Renderable;
283
- declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
284
- declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
285
- declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
286
- declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
287
- declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> = RequireAtLeastOne<{
288
- /**
289
- * Determines the field property of the column.
290
- */
291
- field?: keyof T;
292
- render?: InfiniteTableColumnRenderFunction<T>;
293
- renderValue?: InfiniteTableColumnRenderFunction<T>;
294
- valueGetter?: InfiniteTableColumnValueGetter<T>;
295
- }, 'render' | 'renderValue' | 'field' | 'valueGetter'>;
296
- declare type InfiniteTableColumnStyleFnParams<T> = {
297
- value: Renderable;
298
- column: InfiniteTableColumn<T>;
565
+ groupBy?: (keyof T)[];
299
566
  } & ({
300
567
  data: T;
301
568
  rowInfo: InfiniteTableRowInfoNormal<T>;
@@ -303,127 +570,313 @@ declare type InfiniteTableColumnStyleFnParams<T> = {
303
570
  data: Partial<T> | null;
304
571
  rowInfo: InfiniteTableRowInfoGroup<T>;
305
572
  });
306
- declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
307
- declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
308
- declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
309
- declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
310
- declare type InfiniteTableColumnValueGetterParams<T> = {
311
- data: T;
312
- rowInfo: InfiniteTableRowInfoNormal<T>;
313
- } | {
314
- data: Partial<T> | null;
315
- rowInfo: InfiniteTableRowInfoGroup<T>;
573
+ declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
574
+ declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
575
+ declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
576
+ declare type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
577
+ declare type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
578
+ getter?: AggregationReducer<T, AggregationResultType>['getter'];
579
+ field?: keyof T;
316
580
  };
317
- declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
318
- declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
319
- declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
320
- declare type InfiniteTableBaseColumn<T> = {
321
- sortable?: boolean;
322
- draggable?: boolean;
323
- resizable?: boolean;
324
- comparer?: InfiniteTableColumnComparer<T>;
325
- defaultHiddenWhenGroupedBy?: '*' | keyof T | {
326
- [k in keyof Partial<T>]: true;
327
- };
328
- align?: InfiniteTableColumnAlign;
329
- verticalAlign?: InfiniteTableColumnVerticalAlign;
330
- columnGroup?: string;
331
- header?: InfiniteTableColumnHeader<T>;
332
- name?: Renderable;
333
- cssEllipsis?: boolean;
334
- headerCssEllipsis?: boolean;
335
- type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
336
- style?: InfiniteTableColumnStyle<T>;
337
- className?: InfiniteTableColumnClassName<T>;
338
- rowspan?: InfiniteTableColumnRowspanFn<T>;
339
- valueGetter?: InfiniteTableColumnValueGetter<T>;
581
+ declare type InfiniteTableColumnType<T> = {
582
+ minWidth?: number;
583
+ maxWidth?: number;
340
584
  defaultWidth?: number;
341
585
  defaultFlex?: number;
586
+ defaultPinned?: InfiniteTableColumnPinnedValues;
587
+ defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
588
+ header?: InfiniteTableColumn<T>['header'];
589
+ comparer?: InfiniteTableColumn<T>['comparer'];
590
+ draggable?: InfiniteTableColumn<T>['draggable'];
591
+ sortable?: InfiniteTableColumn<T>['sortable'];
592
+ resizable?: InfiniteTableColumn<T>['resizable'];
593
+ align?: InfiniteTableColumn<T>['align'];
594
+ verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
595
+ cssEllipsis?: boolean;
596
+ headerCssEllipsis?: boolean;
597
+ components?: InfiniteTableColumn<T>['components'];
598
+ renderValue?: InfiniteTableColumn<T>['renderValue'];
599
+ render?: InfiniteTableColumn<T>['render'];
600
+ valueGetter?: InfiniteTableColumn<T>['valueGetter'];
601
+ style?: InfiniteTableColumn<T>['style'];
602
+ };
603
+ declare type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
604
+ declare type InfiniteTableColumnSizingOptions = {
605
+ flex?: number;
606
+ width?: number;
342
607
  minWidth?: number;
343
608
  maxWidth?: number;
344
- components?: {
345
- ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
346
- HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
347
- };
348
609
  };
349
- /**
350
- * Defines a column in the table.
351
- *
352
- * @typeParam DATA_TYPE The type of the data in the table.
353
- *
354
- * Can be bound to a field which is a `keyof DATA_TYPE`.
355
- */
356
- declare type InfiniteTableColumn<DATA_TYPE> = {} & InfiniteTableBaseColumn<DATA_TYPE> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<DATA_TYPE>;
357
- declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
358
- groupByField: string | string[];
359
- id?: string;
610
+ declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
611
+ declare type InfiniteTableImperativeApi<T> = {
612
+ setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
613
+ setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
614
+ x?: T;
615
+ getState: () => InfiniteTableState<T>;
616
+ getDataSourceState: () => DataSourceState<T>;
360
617
  };
361
- declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
362
- declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
363
- pivotBy: DataSourcePivotBy<DataType>[];
364
- pivotTotalColumnGroup?: true;
365
- pivotGroupKeys: KeyType[];
366
- pivotByAtIndex: PivotBy<DataType, KeyType>;
367
- pivotGroupKey: KeyType;
368
- pivotIndex: number;
618
+ declare type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
619
+ declare type InfiniteTablePropColumnsMap<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
620
+ declare type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = InfiniteTablePropColumnsMap<T, ColumnType> | Record<string, ColumnType>;
621
+ declare type InfiniteTablePropColumnGroupsMap = Map<string, InfiniteTableColumnGroup>;
622
+ declare type InfiniteTablePropColumnGroupsRecord = Record<string, InfiniteTableColumnGroup>;
623
+ declare type InfiniteTablePropColumnGroups = InfiniteTablePropColumnGroupsRecord | InfiniteTablePropColumnGroupsMap;
624
+ declare type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
625
+ declare type InfiniteTableColumnGroupHeaderRenderParams = {
626
+ columnGroup: InfiniteTableComputedColumnGroup;
369
627
  };
370
- declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
371
- pivotBy: DataSourcePivotBy<DataType>[];
372
- pivotColumn: true;
373
- pivotTotalColumn: boolean;
374
- pivotAggregator: AggregationReducer<DataType, any>;
375
- pivotAggregatorIndex: number;
376
- pivotGroupKeys: KeyType[];
377
- pivotByAtIndex?: PivotBy<DataType, KeyType>;
378
- pivotIndex: number;
379
- pivotGroupKey: KeyType;
628
+ declare type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
629
+ declare type InfiniteTableColumnGroup = {
630
+ columnGroup?: string;
631
+ header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
380
632
  };
381
- declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
382
- declare type InfiniteTableComputedColumnBase<T> = {
383
- computedWidth: number;
384
- computedOffset: number;
385
- computedPinningOffset: number;
386
- computedAbsoluteOffset: number;
387
- computedSortable: boolean;
388
- computedSortInfo: DataSourceSingleSortInfo<T> | null;
389
- computedSorted: boolean;
390
- computedSortedAsc: boolean;
391
- computedSortedDesc: boolean;
392
- computedSortIndex: number;
393
- computedVisibleIndex: number;
394
- computedMultiSort: boolean;
395
- computedPinned: InfiniteTableColumnPinnedValues;
396
- computedDraggable: boolean;
397
- computedFirstInCategory: boolean;
398
- computedLastInCategory: boolean;
399
- computedFirst: boolean;
400
- computedLast: boolean;
401
- toggleSort: () => void;
633
+ declare type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
402
634
  id: string;
635
+ groupOffset: number;
636
+ computedWidth: number;
637
+ uniqueGroupId: string[];
638
+ columns: string[];
639
+ depth: number;
403
640
  };
404
- declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
405
- declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
406
-
407
- interface DataSourceDataParams<T> {
408
- originalDataArray: T[];
409
- sortInfo?: DataSourceSortInfo<T>;
410
- groupBy?: DataSourcePropGroupBy<T>;
411
- pivotBy?: DataSourcePropPivotBy<T>;
412
- lazyLoadBatchSize?: number;
413
- lazyLoadStartIndex?: number;
414
- groupKeys?: any[];
415
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
416
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
417
- __cursorId?: DataSourceSetupState<T>['cursorId'];
418
- changes?: DataSourceDataParamsChanges<T>;
419
- }
420
- declare type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
421
- declare type DataSourceSingleSortInfo<T> = MultisortInfo<T> & {
422
- field?: keyof T;
641
+ declare type InfiniteTableGroupColumnGetterOptions<T> = {
642
+ groupIndexForColumn?: number;
643
+ groupByForColumn?: DataSourceGroupBy<T>;
644
+ groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
645
+ groupCount: number;
646
+ groupBy: DataSourceGroupBy<T>[];
647
+ pivotBy?: DataSourcePivotBy<T>[];
648
+ };
649
+ declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
650
+ column: COL_TYPE;
651
+ groupBy: DataSourcePropGroupBy<T>;
652
+ pivotBy: DataSourcePropPivotBy<T>;
653
+ };
654
+ declare type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
655
+ declare type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
656
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
657
+ renderGroupIcon?: InfiniteTableGroupColumnRenderIconFunction<T>;
423
658
  id?: string;
424
659
  };
425
- declare type DataSourceGroupBy<T> = GroupBy<T, any>;
426
- declare type DataSourcePivotBy<T> = PivotBy<T, any>;
660
+ declare type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
661
+ renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
662
+ };
663
+ declare type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
664
+ declare type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => Partial<InfiniteTableGroupColumnBase<T>>;
665
+ declare type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
666
+ declare type InfiniteTablePropComponents = {
667
+ LoadMask?: React$1.FC<LoadMaskProps>;
668
+ };
669
+ declare type ScrollStopInfo = {
670
+ scrollTop: number;
671
+ firstVisibleRowIndex: number;
672
+ lastVisibleRowIndex: number;
673
+ };
674
+ interface InfiniteTableProps<T> {
675
+ columns: InfiniteTablePropColumns<T>;
676
+ pivotColumns?: InfiniteTablePropColumnsMap<T, InfiniteTablePivotColumn<T>>;
677
+ loadingText?: Renderable;
678
+ components?: InfiniteTablePropComponents;
679
+ viewportReservedWidth?: number;
680
+ pivotColumn?: InfiniteTablePropPivotColumn<T, InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>>;
681
+ pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
682
+ pivotGrandTotalColumnPosition?: InfiniteTablePropPivotGrandTotalColumnPosition;
683
+ groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
684
+ groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
685
+ hideEmptyGroupColumns?: boolean;
686
+ columnVisibility?: InfiniteTablePropColumnVisibility;
687
+ defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
688
+ pinnedStartMaxWidth?: number;
689
+ pinnedEndMaxWidth?: number;
690
+ columnPinning?: InfiniteTablePropColumnPinning;
691
+ defaultColumnPinning?: InfiniteTablePropColumnPinning;
692
+ columnSizing?: InfiniteTablePropColumnSizing;
693
+ defaultColumnSizing?: InfiniteTablePropColumnSizing;
694
+ onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
695
+ pivotColumnGroups?: InfiniteTablePropColumnGroups;
696
+ columnGroups?: InfiniteTablePropColumnGroups;
697
+ defaultColumnGroups?: InfiniteTablePropColumnGroups;
698
+ defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
699
+ collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
700
+ onScrollbarsChange?: (scrollbars: Scrollbars) => void;
701
+ onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
702
+ columnTypes?: InfiniteTablePropColumnTypes<T>;
703
+ showSeparatePivotColumnForSingleAggregation?: boolean;
704
+ rowHeight: number | string;
705
+ rowStyle?: InfiniteTablePropRowStyle<T>;
706
+ rowClassName?: InfiniteTablePropRowClassName<T>;
707
+ headerHeight: number | string;
708
+ domProps?: React$1.HTMLProps<HTMLDivElement>;
709
+ showZebraRows?: boolean;
710
+ showHoverRows?: boolean;
711
+ sortable?: boolean;
712
+ draggableColumns?: boolean;
713
+ header?: boolean;
714
+ focusedClassName?: string;
715
+ focusedWithinClassName?: string;
716
+ focusedStyle?: React$1.CSSProperties;
717
+ focusedWithinStyle?: React$1.CSSProperties;
718
+ columnCssEllipsis?: boolean;
719
+ columnHeaderCssEllipsis?: boolean;
720
+ columnDefaultWidth?: number;
721
+ columnMinWidth?: number;
722
+ columnMaxWidth?: number;
723
+ resizableColumns?: boolean;
724
+ virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
725
+ virtualizeRows?: boolean;
726
+ defaultActiveIndex?: number;
727
+ activeIndex?: number;
728
+ onSelfFocus?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
729
+ onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
730
+ onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
731
+ onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
732
+ onScrollToTop?: () => void;
733
+ onScrollToBottom?: () => void;
734
+ scrollStopDelay?: number;
735
+ onScrollStop?: (param: ScrollStopInfo) => void;
736
+ scrollToBottomOffset?: number;
737
+ defaultColumnOrder?: InfiniteTablePropColumnOrder;
738
+ columnOrder?: InfiniteTablePropColumnOrder;
739
+ onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrder) => void;
740
+ onRowHeightChange?: (rowHeight: number) => void;
741
+ onReady?: (api: InfiniteTableImperativeApi<T>) => void;
742
+ rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
743
+ licenseKey?: string;
744
+ scrollTopKey?: string | number;
745
+ autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
746
+ }
747
+ declare type InfiniteTablePropAutoSizeColumnsKey = string | number | {
748
+ key: string | number;
749
+ columnsToSkip?: string[];
750
+ columnsToResize?: string[];
751
+ includeHeader?: boolean;
752
+ };
753
+ declare type Scrollbars = {
754
+ vertical: boolean;
755
+ horizontal: boolean;
756
+ };
757
+
758
+ declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
759
+ id: string;
760
+ };
761
+ declare type AggregationReducerResult<AggregationResultType extends any = any> = {
762
+ value: AggregationResultType;
763
+ id: string;
764
+ };
765
+ declare type InfiniteTableRowInfoNormalType<DataType> = {
766
+ data: DataType;
767
+ isGroupRow: false;
768
+ };
769
+ declare type InfiniteTableRowInfoGroupType<DataType> = {
770
+ data: Partial<DataType> | null;
771
+ isGroupRow: true;
772
+ };
773
+ declare type InfiniteTableRowInfoNormal<T> = InfiniteTableRowInfoBase<T> & InfiniteTableRowInfoNormalType<T>;
774
+ declare type InfiniteTableRowInfoGroup<T> = InfiniteTableRowInfoBase<T> & InfiniteTableRowInfoGroupType<T>;
775
+ declare type InfiniteTableRowInfo<T> = InfiniteTableRowInfoNormal<T> | InfiniteTableRowInfoGroup<T>;
776
+ declare type InfiniteTableRowInfoBase<T> = {
777
+ id: any;
778
+ value?: any;
779
+ groupData?: T[];
780
+ collapsed: boolean;
781
+ collapsedChildrenCount?: number;
782
+ collapsedGroupsCount?: number;
783
+ groupNesting?: number;
784
+ groupKeys?: any[];
785
+ flatRowInfoList?: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
786
+ parents?: InfiniteTableEnhancedGroupInfo<T>[];
787
+ indexInParentGroups?: number[];
788
+ indexInGroup: number;
789
+ indexInAll: number;
790
+ groupCount?: number;
791
+ groupBy?: (keyof T)[];
792
+ rootGroupBy?: (keyof T)[];
793
+ pivotValuesMap?: PivotValuesDeepMap<T, any>;
794
+ reducerResults?: Record<string, AggregationReducerResult>;
795
+ };
796
+ declare type InfiniteTableEnhancedGroupInfo<T> = InfiniteTableRowInfo<T> & {
797
+ data: Partial<T> | null;
798
+ groupData: T[];
799
+ flatRowInfoList: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
800
+ value: any;
801
+ isGroupRow: true;
802
+ collapsedChildrenCount: number;
803
+ collapsedGroupsCount: number;
804
+ groupNesting: number;
805
+ groupKeys?: any[];
806
+ groupCount: number;
807
+ groupBy: (keyof T)[];
808
+ rootGroupBy: (keyof T)[];
809
+ pivotValuesMap?: PivotValuesDeepMap<T, any>;
810
+ };
811
+ declare type GroupKeyType<T extends any = any> = T;
812
+ declare type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
813
+ declare type PivotGroupValueType<DataType, KeyType> = {
814
+ reducerResults: PivotReducerResults<KeyType>;
815
+ items: DataType[];
816
+ };
817
+ declare type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
818
+ declare type DeepMapGroupValueType<DataType, KeyType> = {
819
+ items: DataType[];
820
+ commonData?: Partial<DataType>;
821
+ reducerResults: Record<string, AggregationReducerResult>;
822
+ pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
823
+ };
824
+ declare type GroupBy<DataType, KeyType> = {
825
+ field: keyof DataType;
826
+ toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
827
+ column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
828
+ };
829
+ declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
830
+ column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
831
+ column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
832
+ }) => Partial<InfiniteTablePivotColumn<DataType>>);
833
+ columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
834
+ columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
835
+ }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
836
+ };
837
+ declare type GroupParams<DataType, KeyType> = {
838
+ groupBy: GroupBy<DataType, KeyType>[];
839
+ defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
840
+ pivot?: PivotBy<DataType, KeyType>[];
841
+ reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
842
+ };
843
+ declare type DataGroupResult<DataType, KeyType extends any> = {
844
+ deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
845
+ groupParams: GroupParams<DataType, KeyType>;
846
+ initialData: DataType[];
847
+ reducerResults?: Record<string, AggregationReducerResult>;
848
+ topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
849
+ pivot?: PivotBy<DataType, KeyType>[];
850
+ };
851
+ declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
852
+ declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
853
+
854
+ declare type RenderRange = {
855
+ renderStartIndex: number;
856
+ renderEndIndex: number;
857
+ };
858
+
859
+ interface DataSourceDataParams<T> {
860
+ originalDataArray: T[];
861
+ sortInfo?: DataSourceSortInfo<T>;
862
+ groupBy?: DataSourcePropGroupBy<T>;
863
+ pivotBy?: DataSourcePropPivotBy<T>;
864
+ lazyLoadBatchSize?: number;
865
+ lazyLoadStartIndex?: number;
866
+ groupKeys?: any[];
867
+ append?: boolean;
868
+ aggregationReducers?: DataSourcePropAggregationReducers<T>;
869
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
870
+ __cursorId?: DataSourceSetupState<T>['cursorId'];
871
+ changes?: DataSourceDataParamsChanges<T>;
872
+ }
873
+ declare type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
874
+ declare type DataSourceSingleSortInfo<T> = MultisortInfo<T> & {
875
+ field?: keyof T;
876
+ id?: string;
877
+ };
878
+ declare type DataSourceGroupBy<T> = GroupBy<T, any>;
879
+ declare type DataSourcePivotBy<T> = PivotBy<T, any>;
427
880
  declare type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
428
881
  declare type DataSourceRemoteData<T> = {
429
882
  data: T[];
@@ -578,117 +1031,82 @@ interface DataSourceReducer<T> {
578
1031
  (state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
579
1032
  }
580
1033
 
581
- declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
582
- id: string;
583
- };
584
- declare type AggregationReducerResult<AggregationResultType extends any = any> = {
585
- value: AggregationResultType;
586
- id: string;
1034
+ declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
1035
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
1036
+ }[Keys];
1037
+
1038
+ declare type InfiniteTableCellProps<T> = {
1039
+ column: InfiniteTableComputedColumn<T>;
1040
+ renderChildren: () => Renderable;
1041
+ width: number;
1042
+ cssEllipsis?: boolean;
1043
+ virtualized?: boolean;
1044
+ skipColumnShifting?: boolean;
1045
+ beforeChildren?: Renderable;
1046
+ afterChildren?: Renderable;
1047
+ offset?: number;
1048
+ offsetProperty?: 'left' | 'right';
1049
+ cssPosition?: CSSProperties['position'];
1050
+ domRef?: React.RefCallback<HTMLElement>;
1051
+ cellType: 'body' | 'header';
587
1052
  };
588
- declare type InfiniteTableRowInfoNormalType<DataType> = {
589
- data: DataType;
590
- isGroupRow: false;
1053
+
1054
+ declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
1055
+ declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1056
+ domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
1057
+ sortTool: JSX.Element;
1058
+ column: COL_TYPE;
1059
+ columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
591
1060
  };
592
- declare type InfiniteTableRowInfoGroupType<DataType> = {
593
- data: Partial<DataType> | null;
594
- isGroupRow: true;
595
- };
596
- declare type InfiniteTableRowInfoNormal<T> = InfiniteTableRowInfoBase<T> & InfiniteTableRowInfoNormalType<T>;
597
- declare type InfiniteTableRowInfoGroup<T> = InfiniteTableRowInfoBase<T> & InfiniteTableRowInfoGroupType<T>;
598
- declare type InfiniteTableRowInfo<T> = InfiniteTableRowInfoNormal<T> | InfiniteTableRowInfoGroup<T>;
599
- declare type InfiniteTableRowInfoBase<T> = {
600
- id: any;
601
- value?: any;
602
- groupData?: T[];
1061
+ declare type InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1062
+ domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
1063
+ value: string | number | Renderable;
1064
+ groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
1065
+ rowIndex: number;
1066
+ column: COL_TYPE;
1067
+ toggleCurrentGroupRow: () => void;
1068
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
1069
+ groupBy: DataSourceState<DATA_TYPE>['groupBy'];
1070
+ pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
1071
+ } & ({
1072
+ rowInfo: InfiniteTableRowInfoNormal<DATA_TYPE>;
1073
+ data: DATA_TYPE;
1074
+ } | {
1075
+ rowInfo: InfiniteTableRowInfoGroup<DATA_TYPE>;
1076
+ data: Partial<DATA_TYPE> | null;
1077
+ });
1078
+ declare type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParams<DATA_TYPE> & {};
1079
+ declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE> & {
603
1080
  collapsed: boolean;
604
- collapsedChildrenCount?: number;
605
- collapsedGroupsCount?: number;
606
- groupNesting?: number;
607
- groupKeys?: any[];
608
- flatRowInfoList?: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
609
- parents?: InfiniteTableEnhancedGroupInfo<T>[];
610
- indexInParentGroups?: number[];
611
- indexInGroup: number;
612
- indexInAll: number;
613
- groupCount?: number;
614
- groupBy?: (keyof T)[];
615
- rootGroupBy?: (keyof T)[];
616
- pivotValuesMap?: PivotValuesDeepMap<T, any>;
617
- reducerResults?: Record<string, AggregationReducerResult>;
618
- };
619
- declare type InfiniteTableEnhancedGroupInfo<T> = InfiniteTableRowInfo<T> & {
620
- data: Partial<T> | null;
621
- groupData: T[];
622
- flatRowInfoList: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
623
- value: any;
624
- isGroupRow: true;
625
- collapsedChildrenCount: number;
626
- collapsedGroupsCount: number;
627
- groupNesting: number;
628
- groupKeys?: any[];
629
- groupCount: number;
630
- groupBy: (keyof T)[];
631
- rootGroupBy: (keyof T)[];
632
- pivotValuesMap?: PivotValuesDeepMap<T, any>;
633
- };
634
- declare type GroupKeyType<T extends any = any> = T;
635
- declare type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
636
- declare type PivotGroupValueType<DataType, KeyType> = {
637
- reducerResults: PivotReducerResults<KeyType>;
638
- items: DataType[];
639
- };
640
- declare type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
641
- declare type DeepMapGroupValueType<DataType, KeyType> = {
642
- items: DataType[];
643
- commonData?: Partial<DataType>;
644
- reducerResults: Record<string, AggregationReducerResult>;
645
- pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
646
- };
647
- declare type GroupBy<DataType, KeyType> = {
648
- field: keyof DataType;
649
- toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
650
- column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
651
- };
652
- declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
653
- column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
654
- column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
655
- }) => Partial<InfiniteTablePivotColumn<DataType>>);
656
- columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
657
- columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
658
- }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
659
- };
660
- declare type GroupParams<DataType, KeyType> = {
661
- groupBy: GroupBy<DataType, KeyType>[];
662
- defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
663
- pivot?: PivotBy<DataType, KeyType>[];
664
- reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
665
- };
666
- declare type DataGroupResult<DataType, KeyType extends any> = {
667
- deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
668
- groupParams: GroupParams<DataType, KeyType>;
669
- initialData: DataType[];
670
- reducerResults?: Record<string, AggregationReducerResult>;
671
- topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
672
- pivot?: PivotBy<DataType, KeyType>[];
673
- };
674
- declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
675
- declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
676
-
677
- declare type LoadMaskProps = {
678
- visible: boolean;
679
- children: Renderable;
1081
+ groupIcon: Renderable;
680
1082
  };
681
-
682
- declare type InfiniteTablePropColumnOrderNormalized = string[];
683
- declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
684
- declare type InfiniteTablePropColumnVisibility = Record<string, false>;
685
- declare type InfiniteTablePropColumnPinningMap = Map<string, true | 'start' | 'end'>;
686
- declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
687
- declare type InfiniteTablePropColumnPinningRecord = Record<string, true | 'start' | 'end'>;
688
- declare type InfiniteTablePropColumnPinning = InfiniteTablePropColumnPinningRecord | InfiniteTablePropColumnPinningMap;
689
- declare type InfiniteTableRowStyleFnParams<T> = {
1083
+ declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE>;
1084
+ declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1085
+ rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
1086
+ data: DATA_TYPE | Partial<DATA_TYPE> | null;
1087
+ dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
690
1088
  rowIndex: number;
691
- groupBy?: (keyof T)[];
1089
+ column: COL_TYPE;
1090
+ };
1091
+ declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, rowInfo, groupBy, pivotBy, }: InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE>) => Renderable | null;
1092
+ declare type InfiniteTableGroupColumnRenderIconFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (param: InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
1093
+ declare type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderParams<T>) => Renderable;
1094
+ declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
1095
+ declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
1096
+ declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
1097
+ declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
1098
+ declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> = RequireAtLeastOne<{
1099
+ /**
1100
+ * Determines the field property of the column.
1101
+ */
1102
+ field?: keyof T;
1103
+ render?: InfiniteTableColumnRenderFunction<T>;
1104
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
1105
+ valueGetter?: InfiniteTableColumnValueGetter<T>;
1106
+ }, 'render' | 'renderValue' | 'field' | 'valueGetter'>;
1107
+ declare type InfiniteTableColumnStyleFnParams<T> = {
1108
+ value: Renderable;
1109
+ column: InfiniteTableColumn<T>;
692
1110
  } & ({
693
1111
  data: T;
694
1112
  rowInfo: InfiniteTableRowInfoNormal<T>;
@@ -696,353 +1114,111 @@ declare type InfiniteTableRowStyleFnParams<T> = {
696
1114
  data: Partial<T> | null;
697
1115
  rowInfo: InfiniteTableRowInfoGroup<T>;
698
1116
  });
699
- declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
700
- declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
701
- declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
702
- declare type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
703
- declare type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
704
- getter?: AggregationReducer<T, AggregationResultType>['getter'];
705
- field?: keyof T;
1117
+ declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
1118
+ declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
1119
+ declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
1120
+ declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
1121
+ declare type InfiniteTableColumnValueGetterParams<T> = {
1122
+ data: T;
1123
+ rowInfo: InfiniteTableRowInfoNormal<T>;
1124
+ } | {
1125
+ data: Partial<T> | null;
1126
+ rowInfo: InfiniteTableRowInfoGroup<T>;
706
1127
  };
707
- declare type InfiniteTableColumnType<T> = {
708
- minWidth?: number;
709
- maxWidth?: number;
710
- defaultWidth?: number;
711
- defaultFlex?: number;
712
- defaultPinned?: InfiniteTableColumnPinnedValues;
713
- defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
714
- header?: InfiniteTableColumn<T>['header'];
715
- comparer?: InfiniteTableColumn<T>['comparer'];
716
- draggable?: InfiniteTableColumn<T>['draggable'];
717
- sortable?: InfiniteTableColumn<T>['sortable'];
718
- resizable?: InfiniteTableColumn<T>['resizable'];
719
- align?: InfiniteTableColumn<T>['align'];
720
- verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
1128
+ declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
1129
+ declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
1130
+ declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
1131
+ declare type InfiniteTableBaseColumn<T> = {
1132
+ sortable?: boolean;
1133
+ draggable?: boolean;
1134
+ resizable?: boolean;
1135
+ comparer?: InfiniteTableColumnComparer<T>;
1136
+ defaultHiddenWhenGroupedBy?: '*' | keyof T | {
1137
+ [k in keyof Partial<T>]: true;
1138
+ };
1139
+ align?: InfiniteTableColumnAlign;
1140
+ verticalAlign?: InfiniteTableColumnVerticalAlign;
1141
+ columnGroup?: string;
1142
+ header?: InfiniteTableColumnHeader<T>;
1143
+ name?: Renderable;
721
1144
  cssEllipsis?: boolean;
722
1145
  headerCssEllipsis?: boolean;
723
- components?: InfiniteTableColumn<T>['components'];
724
- renderValue?: InfiniteTableColumn<T>['renderValue'];
725
- render?: InfiniteTableColumn<T>['render'];
726
- valueGetter?: InfiniteTableColumn<T>['valueGetter'];
727
- style?: InfiniteTableColumn<T>['style'];
728
- };
729
- declare type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
730
- declare type InfiniteTableColumnSizingOptions = {
731
- flex?: number;
732
- width?: number;
1146
+ type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
1147
+ style?: InfiniteTableColumnStyle<T>;
1148
+ className?: InfiniteTableColumnClassName<T>;
1149
+ rowspan?: InfiniteTableColumnRowspanFn<T>;
1150
+ valueGetter?: InfiniteTableColumnValueGetter<T>;
1151
+ defaultWidth?: number;
1152
+ defaultFlex?: number;
733
1153
  minWidth?: number;
734
1154
  maxWidth?: number;
1155
+ components?: {
1156
+ ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
1157
+ HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
1158
+ };
735
1159
  };
736
- declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
737
- declare type InfiniteTableImperativeApi<T> = {
738
- setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
739
- setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
740
- x?: T;
741
- getState: () => InfiniteTableState<T>;
742
- getDataSourceState: () => DataSourceState<T>;
743
- };
744
- declare type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
745
- declare type InfiniteTablePropColumnsMap<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
746
- declare type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = InfiniteTablePropColumnsMap<T, ColumnType> | Record<string, ColumnType>;
747
- declare type InfiniteTablePropColumnGroupsMap = Map<string, InfiniteTableColumnGroup>;
748
- declare type InfiniteTablePropColumnGroupsRecord = Record<string, InfiniteTableColumnGroup>;
749
- declare type InfiniteTablePropColumnGroups = InfiniteTablePropColumnGroupsRecord | InfiniteTablePropColumnGroupsMap;
750
- declare type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
751
- declare type InfiniteTableColumnGroupHeaderRenderParams = {
752
- columnGroup: InfiniteTableComputedColumnGroup;
753
- };
754
- declare type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
755
- declare type InfiniteTableColumnGroup = {
756
- columnGroup?: string;
757
- header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
1160
+ /**
1161
+ * Defines a column in the table.
1162
+ *
1163
+ * @typeParam DATA_TYPE The type of the data in the table.
1164
+ *
1165
+ * Can be bound to a field which is a `keyof DATA_TYPE`.
1166
+ */
1167
+ declare type InfiniteTableColumn<DATA_TYPE> = {} & InfiniteTableBaseColumn<DATA_TYPE> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<DATA_TYPE>;
1168
+ declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
1169
+ groupByField: string | string[];
1170
+ id?: string;
758
1171
  };
759
- declare type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
760
- id: string;
761
- groupOffset: number;
762
- computedWidth: number;
763
- uniqueGroupId: string[];
764
- columns: string[];
765
- depth: number;
1172
+ declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
1173
+ declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
1174
+ pivotBy: DataSourcePivotBy<DataType>[];
1175
+ pivotTotalColumnGroup?: true;
1176
+ pivotGroupKeys: KeyType[];
1177
+ pivotByAtIndex: PivotBy<DataType, KeyType>;
1178
+ pivotGroupKey: KeyType;
1179
+ pivotIndex: number;
766
1180
  };
767
- declare type InfiniteTableGroupColumnGetterOptions<T> = {
768
- groupIndexForColumn?: number;
769
- groupByForColumn?: DataSourceGroupBy<T>;
770
- groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
771
- groupCount: number;
772
- groupBy: DataSourceGroupBy<T>[];
773
- pivotBy?: DataSourcePivotBy<T>[];
774
- };
775
- declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
776
- column: COL_TYPE;
777
- groupBy: DataSourcePropGroupBy<T>;
778
- pivotBy: DataSourcePropPivotBy<T>;
779
- };
780
- declare type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
781
- declare type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
782
- renderValue?: InfiniteTableColumnRenderFunction<T>;
783
- renderGroupIcon?: InfiniteTableGroupColumnRenderIconFunction<T>;
784
- id?: string;
785
- };
786
- declare type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
787
- renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
788
- };
789
- declare type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
790
- declare type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => Partial<InfiniteTableGroupColumnBase<T>>;
791
- declare type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
792
- declare type InfiniteTablePropComponents = {
793
- LoadMask?: React$1.FC<LoadMaskProps>;
794
- };
795
- declare type ScrollStopInfo = {
796
- scrollTop: number;
797
- firstVisibleRowIndex: number;
798
- lastVisibleRowIndex: number;
799
- };
800
- interface InfiniteTableProps<T> {
801
- columns: InfiniteTablePropColumns<T>;
802
- pivotColumns?: InfiniteTablePropColumnsMap<T, InfiniteTablePivotColumn<T>>;
803
- loadingText?: Renderable;
804
- components?: InfiniteTablePropComponents;
805
- viewportReservedWidth?: number;
806
- pivotColumn?: InfiniteTablePropPivotColumn<T, InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>>;
807
- pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
808
- pivotGrandTotalColumnPosition?: InfiniteTablePropPivotGrandTotalColumnPosition;
809
- groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
810
- groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
811
- hideEmptyGroupColumns?: boolean;
812
- columnVisibility?: InfiniteTablePropColumnVisibility;
813
- defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
814
- pinnedStartMaxWidth?: number;
815
- pinnedEndMaxWidth?: number;
816
- columnPinning?: InfiniteTablePropColumnPinning;
817
- defaultColumnPinning?: InfiniteTablePropColumnPinning;
818
- columnSizing?: InfiniteTablePropColumnSizing;
819
- defaultColumnSizing?: InfiniteTablePropColumnSizing;
820
- onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
821
- pivotColumnGroups?: InfiniteTablePropColumnGroups;
822
- columnGroups?: InfiniteTablePropColumnGroups;
823
- defaultColumnGroups?: InfiniteTablePropColumnGroups;
824
- defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
825
- collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
826
- onScrollbarsChange?: (scrollbars: Scrollbars) => void;
827
- onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
828
- columnTypes?: InfiniteTablePropColumnTypes<T>;
829
- showSeparatePivotColumnForSingleAggregation?: boolean;
830
- rowHeight: number | string;
831
- rowStyle?: InfiniteTablePropRowStyle<T>;
832
- rowClassName?: InfiniteTablePropRowClassName<T>;
833
- headerHeight: number | string;
834
- domProps?: React$1.HTMLProps<HTMLDivElement>;
835
- showZebraRows?: boolean;
836
- showHoverRows?: boolean;
837
- sortable?: boolean;
838
- draggableColumns?: boolean;
839
- header?: boolean;
840
- focusedClassName?: string;
841
- focusedWithinClassName?: string;
842
- focusedStyle?: React$1.CSSProperties;
843
- focusedWithinStyle?: React$1.CSSProperties;
844
- columnCssEllipsis?: boolean;
845
- columnHeaderCssEllipsis?: boolean;
846
- columnDefaultWidth?: number;
847
- columnMinWidth?: number;
848
- columnMaxWidth?: number;
849
- resizableColumns?: boolean;
850
- virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
851
- virtualizeRows?: boolean;
852
- defaultActiveIndex?: number;
853
- activeIndex?: number;
854
- onSelfFocus?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
855
- onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
856
- onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
857
- onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
858
- onScrollToTop?: () => void;
859
- onScrollToBottom?: () => void;
860
- scrollStopDelay?: number;
861
- onScrollStop?: (param: ScrollStopInfo) => void;
862
- scrollToBottomOffset?: number;
863
- defaultColumnOrder?: InfiniteTablePropColumnOrder;
864
- columnOrder?: InfiniteTablePropColumnOrder;
865
- onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrder) => void;
866
- onRowHeightChange?: (rowHeight: number) => void;
867
- onReady?: (api: InfiniteTableImperativeApi<T>) => void;
868
- rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
869
- licenseKey?: string;
870
- scrollTopKey?: string | number;
871
- autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
872
- }
873
- declare type InfiniteTablePropAutoSizeColumnsKey = string | number | {
874
- key: string | number;
875
- columnsToSkip?: string[];
876
- columnsToResize?: string[];
877
- includeHeader?: boolean;
878
- };
879
- declare type Scrollbars = {
880
- vertical: boolean;
881
- horizontal: boolean;
1181
+ declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
1182
+ pivotBy: DataSourcePivotBy<DataType>[];
1183
+ pivotColumn: true;
1184
+ pivotTotalColumn: boolean;
1185
+ pivotAggregator: AggregationReducer<DataType, any>;
1186
+ pivotAggregatorIndex: number;
1187
+ pivotGroupKeys: KeyType[];
1188
+ pivotByAtIndex?: PivotBy<DataType, KeyType>;
1189
+ pivotIndex: number;
1190
+ pivotGroupKey: KeyType;
882
1191
  };
883
-
884
- declare class ScrollListener {
885
- private scrollPosition;
886
- private onScrollFns;
887
- getScrollPosition: () => ScrollPosition;
888
- onScroll: (fn: OnScrollFn) => () => void;
889
- setScrollPosition: (scrollPosition: ScrollPosition) => void;
890
- private notifyScrollChange;
891
- destroy: () => void;
892
- }
893
-
894
- interface InfiniteTableSetupState<T> {
895
- propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
896
- columnsWhenInlineGroupRenderStrategy?: Map<string, InfiniteTableColumn<T>>;
897
- domRef: MutableRefObject<HTMLDivElement | null>;
898
- scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
899
- portalDOMRef: MutableRefObject<HTMLDivElement | null>;
900
- onRowHeightCSSVarChange: SubscriptionCallback<number>;
901
- onHeaderHeightCSSVarChange: SubscriptionCallback<number>;
902
- columnsWhenGrouping?: InfiniteTablePropColumnsMap<T>;
903
- bodySize: Size;
904
- verticalVirtualBrain: VirtualBrain;
905
- horizontalVirtualBrain: VirtualBrain;
906
- focused: boolean;
907
- ready: boolean;
908
- focusedWithin: boolean;
909
- scrollPosition: ScrollPosition;
910
- draggingColumnId: null | string;
911
- pinnedStartScrollListener: ScrollListener;
912
- pinnedEndScrollListener: ScrollListener;
913
- columnShifts: number[] | null;
914
- }
915
- declare type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
916
- declare type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
917
- declare type InfiniteTablePropPivotGrandTotalColumnPosition = InfiniteTablePropPivotTotalColumnPosition;
918
- interface InfiniteTableMappedState<T> {
919
- scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
920
- viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
921
- groupColumn: InfiniteTableProps<T>['groupColumn'];
922
- onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
923
- loadingText: InfiniteTableProps<T>['loadingText'];
924
- components: InfiniteTableProps<T>['components'];
925
- columns: InfiniteTablePropColumnsMap<T>;
926
- pivotColumns: InfiniteTableProps<T>['pivotColumns'];
927
- onReady: InfiniteTableProps<T>['onReady'];
928
- onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
929
- onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
930
- onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
931
- onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
932
- autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
933
- scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
934
- onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
935
- onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
936
- onScrollStop: InfiniteTableProps<T>['onScrollStop'];
937
- scrollToBottomOffset: InfiniteTableProps<T>['scrollToBottomOffset'];
938
- focusedClassName: InfiniteTableProps<T>['focusedClassName'];
939
- focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
940
- focusedStyle: InfiniteTableProps<T>['focusedStyle'];
941
- focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
942
- showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
943
- domProps: InfiniteTableProps<T>['domProps'];
944
- rowStyle: InfiniteTableProps<T>['rowStyle'];
945
- rowProps: InfiniteTableProps<T>['rowProps'];
946
- rowClassName: InfiniteTableProps<T>['rowClassName'];
947
- pinnedStartMaxWidth: InfiniteTableProps<T>['pinnedStartMaxWidth'];
948
- pinnedEndMaxWidth: InfiniteTableProps<T>['pinnedEndMaxWidth'];
949
- pivotColumn: InfiniteTableProps<T>['pivotColumn'];
950
- pivotColumnGroups: InfiniteTablePropColumnGroupsMap;
951
- activeIndex: NonUndefined<InfiniteTableProps<T>['activeIndex']>;
952
- columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
953
- columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
954
- columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
955
- columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
956
- draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
957
- sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
958
- hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
959
- columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
960
- showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
961
- showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
962
- header: NonUndefined<InfiniteTableProps<T>['header']>;
963
- virtualizeColumns: NonUndefined<InfiniteTableProps<T>['virtualizeColumns']>;
964
- rowHeight: number;
965
- headerHeight: number;
966
- licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
967
- columnVisibility: InfiniteTablePropColumnVisibility;
968
- columnPinning: InfiniteTablePropColumnPinningMap;
969
- columnSizing: InfiniteTablePropColumnSizing;
970
- columnTypes: InfiniteTablePropColumnTypes<T>;
971
- columnGroups: InfiniteTablePropColumnGroupsMap;
972
- collapsedColumnGroups: NonUndefined<InfiniteTableProps<T>['collapsedColumnGroups']>;
973
- pivotTotalColumnPosition: NonUndefined<InfiniteTableProps<T>['pivotTotalColumnPosition']>;
974
- pivotGrandTotalColumnPosition: InfiniteTableProps<T>['pivotGrandTotalColumnPosition'];
975
- }
976
- interface InfiniteTableDerivedState<T> {
977
- groupBy: DataSourceProps<T>['groupBy'];
978
- computedColumns: Map<string, InfiniteTableColumn<T>>;
979
- virtualizeHeader: boolean;
980
- groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
981
- columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
982
- columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
983
- columnGroupsMaxDepth: number;
984
- computedColumnGroups: InfiniteTablePropColumnGroupsMap;
985
- rowHeightCSSVar: string;
986
- headerHeightCSSVar: string;
987
- controlledColumnVisibility: boolean;
988
- }
989
- declare type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
990
- interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
991
- }
992
-
993
- declare enum InfiniteTableActionType {
994
- SET_COLUMN_SIZE = 0,
995
- SET_SCROLL_POSITION = 1,
996
- SET_BODY_SIZE = 2,
997
- SET_COLUMN_ORDER = 3,
998
- SET_COLUMN_VISIBILITY = 4,
999
- SET_COLUMN_SHIFTS = 5,
1000
- SET_COLUMN_PINNING = 6,
1001
- SET_COLUMN_AGGREGATIONS = 7,
1002
- SET_DRAGGING_COLUMN_ID = 8
1003
- }
1004
-
1005
- declare type InfiniteTableAction = {
1006
- type: InfiniteTableActionType;
1007
- payload?: any;
1192
+ declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
1193
+ declare type InfiniteTableComputedColumnBase<T> = {
1194
+ computedWidth: number;
1195
+ computedOffset: number;
1196
+ computedPinningOffset: number;
1197
+ computedAbsoluteOffset: number;
1198
+ computedSortable: boolean;
1199
+ computedSortInfo: DataSourceSingleSortInfo<T> | null;
1200
+ computedSorted: boolean;
1201
+ computedSortedAsc: boolean;
1202
+ computedSortedDesc: boolean;
1203
+ computedSortIndex: number;
1204
+ computedVisibleIndex: number;
1205
+ computedMultiSort: boolean;
1206
+ computedPinned: InfiniteTableColumnPinnedValues;
1207
+ computedDraggable: boolean;
1208
+ computedFirstInCategory: boolean;
1209
+ computedLastInCategory: boolean;
1210
+ computedFirst: boolean;
1211
+ computedLast: boolean;
1212
+ toggleSort: () => void;
1213
+ id: string;
1008
1214
  };
1215
+ declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
1216
+ declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
1009
1217
 
1010
- interface InfiniteTableComputedValues<T> {
1011
- rowSpan?: VirtualBrainOptions['itemSpan'];
1012
- computedPinnedStartOverflow: boolean;
1013
- computedPinnedEndOverflow: boolean;
1014
- computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
1015
- computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
1016
- computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
1017
- computedVisibleColumns: InfiniteTableComputedColumn<T>[];
1018
- computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
1019
- computedColumnVisibility: InfiniteTablePropColumnVisibility;
1020
- computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
1021
- computedPinnedStartColumnsWidth: number;
1022
- computedPinnedStartWidth: number;
1023
- computedPinnedEndColumnsWidth: number;
1024
- computedPinnedEndWidth: number;
1025
- computedUnpinnedColumnsWidth: number;
1026
- computedUnpinnedOffset: number;
1027
- computedPinnedEndOffset: number;
1028
- computedRemainingSpace: number;
1029
- unpinnedColumnRenderCount: number;
1030
- columnRenderStartIndex: number;
1031
- toggleGroupRow: (groupKeys: any[]) => void;
1032
- }
1033
-
1034
- interface InfiniteTableContextValue<T> {
1035
- componentState: InfiniteTableState<T>;
1036
- componentActions: InfiniteTableActions<T>;
1037
- computed: InfiniteTableComputedValues<T>;
1038
- getComputed: () => InfiniteTableComputedValues<T>;
1039
- getState: () => InfiniteTableState<T>;
1040
- }
1218
+ declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParams<T, InfiniteTableComputedColumn<T>>;
1041
1219
 
1042
1220
  declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
1043
1221
 
1044
- declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParams<T, InfiniteTableComputedColumn<T>>;
1045
-
1046
1222
  declare const InfiniteTableClassName: string;
1047
1223
  declare const InfiniteTableComponent: React$1.MemoExoticComponent<(<T>() => JSX.Element)>;
1048
1224
  declare function InfiniteTable<T>(props: InfiniteTableProps<T>): JSX.Element;
@@ -1106,6 +1282,6 @@ declare type InterceptedMapFns<K, V> = {
1106
1282
  */
1107
1283
  declare function interceptMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>): () => void;
1108
1284
 
1109
- declare function useEffectWithChanges(fn: (changes: Record<string, any>, prevValues: Record<string, any>) => void | (() => void), deps: Record<string, any>): void;
1285
+ declare function useEffectWithChanges<T>(fn: (changes: Record<keyof T, any>, prevValues: Record<string, any>) => void | (() => void), deps: Record<keyof T, any>): void;
1110
1286
 
1111
1287
  export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceExpandedAndCollapsedGroupRows, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropGroupBy, DataSourcePropLivePaginationCursor, DataSourcePropPivotBy, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParams as InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableGroupColumnRenderIconFunction, InfiniteTableImperativeApi, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyGroupRowInfo, Scrollbars, debounce, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteHeaderCell };