@infinite-table/infinite-react 0.3.20 → 0.4.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 +37 -20
  2. package/index.d.ts +1049 -858
  3. package/index.esm.css +37 -20
  4. package/index.esm.js +4293 -3126
  5. package/index.js +5475 -4325
  6. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import { RefCallback, MutableRefObject, CSSProperties, HTMLProps } from 'react';
3
-
4
- declare function debounce(fn: Function, { wait }: {
5
- wait: number;
6
- }): (...args: any[]) => void;
2
+ import { CSSProperties, HTMLProps, RefCallback, MutableRefObject, MouseEvent, KeyboardEvent } from 'react';
7
3
 
8
4
  declare type VoidFn$1 = () => void;
9
5
  declare type Pair<KeyType, ValueType> = {
@@ -19,6 +15,7 @@ declare class DeepMap<KeyType, ValueType> {
19
15
  private emptyKey;
20
16
  static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
21
17
  constructor(initial?: [KeyType[], ValueType][]);
18
+ fill(initial?: [KeyType[], ValueType][]): void;
22
19
  getValuesStartingWith(keys: KeyType[]): ValueType[];
23
20
  getKeysStartingWith(keys: KeyType[]): KeyType[][];
24
21
  private getStartingWith;
@@ -45,34 +42,55 @@ declare class DeepMap<KeyType, ValueType> {
45
42
  private sortedIterator;
46
43
  }
47
44
 
48
- declare class GroupRowsState<KeyType extends any = any> {
49
- private expandedMap?;
50
- private collapsedMap?;
51
- private collapsedAll;
52
- private expandedAll;
53
- private initialState;
54
- constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
55
- getState(): DataSourcePropGroupRowsStateObject<KeyType>;
56
- destroy(): void;
57
- private update;
58
- areAllCollapsed(): boolean;
59
- areAllExpanded(): boolean;
60
- collapseAll(): void;
61
- expandAll(): void;
62
- isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
63
- isGroupRowCollapsed(keys: KeyType[]): boolean;
64
- setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
65
- collapseGroupRow(keys: KeyType[]): void;
66
- expandGroupRow(keys: KeyType[]): void;
67
- toggleGroupRow(keys: KeyType[]): void;
68
- }
69
-
70
- declare type Renderable = React$1.ReactNode | JSX.Element;
45
+ declare type SortDir = 1 | -1;
46
+ declare type MultisortInfo<T> = {
47
+ /**
48
+ * The sorting direction
49
+ */
50
+ dir: SortDir;
51
+ /**
52
+ * for now 'string' and 'number' are known types, meaning they have
53
+ * sort functions already implemented
54
+ */
55
+ type?: string;
56
+ fn?: (a: any, b: any) => number;
57
+ /**
58
+ * a property whose value to use for sorting on the array items
59
+ */
60
+ field?: keyof T;
61
+ /**
62
+ * or a function to retrieve the item value to use for sorting
63
+ */
64
+ valueGetter?: (item: T) => any;
65
+ };
66
+ declare const multisort: {
67
+ <T>(sortInfo: MultisortInfo<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
68
+ knownTypes: {
69
+ [key: string]: (first: any, second: any) => number;
70
+ };
71
+ };
71
72
 
72
- interface Size {
73
- width: number;
74
- height: number;
75
- }
73
+ declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
74
+ getComponentState: () => T_STATE;
75
+ componentState: T_STATE;
76
+ componentActions: T_ACTIONS;
77
+ };
78
+ declare type ComponentStateGeneratedActions<T_STATE> = {
79
+ [k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
80
+ };
81
+ declare type ComponentInterceptedActions<T_STATE> = {
82
+ [k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
83
+ actions: ComponentStateGeneratedActions<T_STATE>;
84
+ state: T_STATE;
85
+ }) => void | boolean;
86
+ };
87
+ declare type ComponentMappedCallbacks<T_STATE> = {
88
+ [k in keyof T_STATE]: (value: T_STATE[k], state: T_STATE) => {
89
+ callbackName: string;
90
+ callbackParam: any;
91
+ };
92
+ };
93
+ declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
76
94
 
77
95
  declare enum InfiniteTableActionType {
78
96
  SET_COLUMN_SIZE = 0,
@@ -91,65 +109,299 @@ declare type InfiniteTableAction = {
91
109
  payload?: any;
92
110
  };
93
111
 
94
- interface LogFn {
95
- (...args: any[]): LogFn;
96
- extend: (channelName: string) => LogFn;
97
- }
98
- declare class Logger {
99
- debug: LogFn;
100
- error: LogFn;
101
- constructor(channelName: string);
112
+ declare type Renderable = React$1.ReactNode | JSX.Element;
113
+
114
+ declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParams<T, InfiniteTableComputedColumn<T>>;
115
+
116
+ declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
117
+
118
+ declare const InfiniteTableClassName: string;
119
+ declare const InfiniteTableComponent: React$1.MemoExoticComponent<(<T>() => JSX.Element)>;
120
+ declare function InfiniteTable<T>(props: InfiniteTableProps<T>): JSX.Element;
121
+ declare namespace InfiniteTable {
122
+ var defaultProps: {
123
+ rowHeight: number;
124
+ columnHeaderHeight: string;
125
+ };
102
126
  }
103
127
 
104
- interface ScrollPosition {
105
- scrollTop: number;
106
- scrollLeft: number;
128
+ interface Size {
129
+ width: number;
130
+ height: number;
107
131
  }
108
- declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
109
132
 
110
- declare type VoidFn = () => void;
133
+ declare type InfiniteTableBaseCellProps<T> = {
134
+ column: InfiniteTableComputedColumn<T>;
135
+ renderChildren: () => Renderable;
136
+ width: number;
137
+ cssEllipsis?: boolean;
138
+ contentStyle?: CSSProperties;
139
+ contentClassName?: string;
140
+ virtualized?: boolean;
141
+ skipColumnShifting?: boolean;
142
+ beforeChildren?: Renderable;
143
+ afterChildren?: Renderable;
144
+ cssPosition?: CSSProperties['position'];
145
+ domRef?: React.RefCallback<HTMLElement>;
146
+ };
147
+ declare type InfiniteTableCellProps<T> = ({
148
+ cellType: 'header';
149
+ } & InfiniteTableBaseCellProps<T>) | ({
150
+ cellType: 'body';
151
+ } & InfiniteTableBaseCellProps<T>);
111
152
 
112
- declare type FixedPosition = false | 'start' | 'end';
113
- declare type SpanFunction = ({ rowIndex, colIndex, }: {
153
+ declare type DiscriminatedUnion<A, B> = (A & {
154
+ [K in keyof B]?: undefined;
155
+ }) | (B & {
156
+ [K in keyof A]?: undefined;
157
+ });
158
+
159
+ declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
160
+ declare type InfiniteTableSelectRowFn = (id: any) => void;
161
+ declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
162
+ domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
163
+ sortTool: JSX.Element | null;
164
+ dragging: boolean;
165
+ column: COL_TYPE;
166
+ columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
167
+ columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
168
+ };
169
+ declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
170
+ domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
171
+ value: string | number | Renderable;
172
+ renderBag: {
173
+ value: string | number | Renderable;
174
+ groupIcon?: Renderable;
175
+ selectionCheckBox?: Renderable;
176
+ };
177
+ groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
114
178
  rowIndex: number;
115
- colIndex: number;
116
- }) => number;
117
- declare type RenderRangeType = {
118
- startIndex: number;
119
- endIndex: number;
179
+ rowActive: boolean;
180
+ column: COL_TYPE;
181
+ toggleCurrentGroupRow: () => void;
182
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
183
+ toggleCurrentGroupRowSelection: () => void;
184
+ selectCurrentRow: () => void;
185
+ selectRow: InfiniteTableSelectRowFn;
186
+ deselectRow: InfiniteTableSelectRowFn;
187
+ deselectCurrentRow: () => void;
188
+ toggleRowSelection: InfiniteTableSelectRowFn;
189
+ selectionMode: DataSourcePropSelectionMode | undefined;
190
+ groupBy: DataSourceState<DATA_TYPE>['groupBy'];
191
+ pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
120
192
  };
121
- declare type ItemSizeFunction = (index: number) => number;
122
- declare type MatrixBrainOptions = {
123
- width: number;
124
- height: number;
125
- cols: number;
126
- rows: number;
127
- rowHeight: number | ItemSizeFunction;
128
- colWidth: number | ItemSizeFunction;
129
- rowspan?: SpanFunction;
130
- colspan?: SpanFunction;
193
+ declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
194
+ declare type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParam<DATA_TYPE> & {};
195
+ declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
196
+ declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
197
+ rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
198
+ data: DATA_TYPE | Partial<DATA_TYPE> | null;
199
+ dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
200
+ rowIndex: number;
201
+ column: COL_TYPE;
131
202
  };
132
- declare type TableRenderRange = {
133
- start: [number, number];
134
- end: [number, number];
135
- rowFixed?: FixedPosition;
136
- colFixed?: FixedPosition;
203
+ declare type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
204
+ isGroupRow: true;
205
+ }) => Renderable | null;
206
+ declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
207
+ declare type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParams<T>) => Renderable;
208
+ declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
209
+ declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
210
+ declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
211
+ declare type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
212
+ declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
213
+ declare type InfiniteTableColumnStyleFnParams<T> = {
214
+ value: Renderable;
215
+ column: InfiniteTableColumn<T>;
216
+ } & InfiniteTableRowInfoDataDiscriminator<T>;
217
+ declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
218
+ declare type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParams<T>) => undefined | string;
219
+ declare type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParams<T>) => undefined | React.CSSProperties;
220
+ declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
221
+ declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
222
+ declare type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
223
+ declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
224
+ declare type InfiniteTableColumnHeaderClassName<T> = string | InfiniteTableColumnHeaderClassNameFn<T>;
225
+ declare type InfiniteTableColumnValueGetterParams<T> = {
226
+ data: T;
227
+ field?: keyof T;
137
228
  };
138
- declare type WhichDirection = {
139
- horizontal?: boolean;
140
- vertical?: boolean;
229
+ declare type InfiniteTableColumnValueFormatterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
230
+ declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
231
+ declare type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
232
+ declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
233
+ declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
234
+ declare type InfiniteTableBaseColumn<T> = {
235
+ sortable?: boolean;
236
+ draggable?: boolean;
237
+ resizable?: boolean;
238
+ comparer?: InfiniteTableColumnComparer<T>;
239
+ defaultHiddenWhenGroupedBy?: '*' | keyof T | {
240
+ [k in keyof Partial<T>]: true;
241
+ };
242
+ align?: InfiniteTableColumnAlign;
243
+ verticalAlign?: InfiniteTableColumnVerticalAlign;
244
+ columnGroup?: string;
245
+ header?: InfiniteTableColumnHeader<T>;
246
+ name?: Renderable;
247
+ cssEllipsis?: boolean;
248
+ headerCssEllipsis?: boolean;
249
+ type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
250
+ dataType?: InfiniteTableDataTypeNames;
251
+ sortType?: string;
252
+ filterType?: string;
253
+ style?: InfiniteTableColumnStyle<T>;
254
+ headerStyle?: InfiniteTableColumnHeaderStyle<T>;
255
+ headerClassName?: InfiniteTableColumnHeaderClassName<T>;
256
+ className?: InfiniteTableColumnClassName<T>;
257
+ rowspan?: InfiniteTableColumnRowspanFn<T>;
258
+ field?: keyof T;
259
+ render?: InfiniteTableColumnRenderFunction<T>;
260
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
261
+ renderGroupValue?: InfiniteTableColumnRenderFunction<T>;
262
+ renderLeafValue?: InfiniteTableColumnRenderFunction<T>;
263
+ valueGetter?: InfiniteTableColumnValueGetter<T>;
264
+ valueFormatter?: InfiniteTableColumnValueFormatter<T>;
265
+ defaultWidth?: number;
266
+ defaultFlex?: number;
267
+ defaultFilterable?: boolean;
268
+ minWidth?: number;
269
+ maxWidth?: number;
270
+ renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
271
+ renderSelectionCheckBox?: boolean | InfiniteTableColumnRenderFunction<T>;
272
+ components?: {
273
+ ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
274
+ HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
275
+ };
141
276
  };
142
- declare type FnOnRenderRangeChange = (range: TableRenderRange) => void;
143
- declare type FnOnDirectionalRenderRangeChange = (range: [number, number]) => void;
144
- declare type FnOnRenderCountChange = ({ horizontal, vertical, }: {
145
- horizontal: number;
146
- vertical: number;
147
- }) => void;
148
- declare type OnAvailableSizeChange = (size: Size) => void;
149
- declare class MatrixBrain extends Logger {
150
- private scrolling;
151
- private width;
152
- private height;
277
+ /**
278
+ * Defines a column in the table.
279
+ *
280
+ * @typeParam DATA_TYPE The type of the data in the table.
281
+ *
282
+ * Can be bound to a field which is a `keyof DATA_TYPE`.
283
+ */
284
+ declare type InfiniteTableColumn<DATA_TYPE> = {} & InfiniteTableBaseColumn<DATA_TYPE>;
285
+ declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
286
+ groupByField: string | string[];
287
+ id?: string;
288
+ };
289
+ declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
290
+ declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
291
+ pivotBy: DataSourcePivotBy<DataType>[];
292
+ pivotTotalColumnGroup?: true;
293
+ pivotGroupKeys: KeyType[];
294
+ pivotByAtIndex: PivotBy<DataType, KeyType>;
295
+ pivotGroupKey: KeyType;
296
+ pivotIndex: number;
297
+ };
298
+ declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
299
+ pivotBy: DataSourcePivotBy<DataType>[];
300
+ pivotColumn: true;
301
+ pivotTotalColumn: boolean;
302
+ pivotAggregator: AggregationReducer<DataType, any>;
303
+ pivotAggregatorIndex: number;
304
+ pivotGroupKeys: KeyType[];
305
+ pivotByAtIndex?: PivotBy<DataType, KeyType>;
306
+ pivotIndex: number;
307
+ pivotGroupKey: KeyType;
308
+ };
309
+ declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
310
+ declare type InfiniteTableComputedColumnBase<T> = {
311
+ computedFilterType: string;
312
+ computedSortType: string;
313
+ computedDataType: string;
314
+ computedWidth: number;
315
+ computedFlex: number | null;
316
+ computedMinWidth: number;
317
+ computedMaxWidth: number;
318
+ computedOffset: number;
319
+ computedPinningOffset: number;
320
+ computedAbsoluteOffset: number;
321
+ computedSortable: boolean;
322
+ computedSortInfo: DataSourceSingleSortInfo<T> | null;
323
+ computedSorted: boolean;
324
+ computedSortedAsc: boolean;
325
+ computedSortedDesc: boolean;
326
+ computedSortIndex: number;
327
+ computedVisibleIndex: number;
328
+ computedVisibleIndexInCategory: number;
329
+ computedMultiSort: boolean;
330
+ computedFiltered: boolean;
331
+ computedFilterable: boolean;
332
+ computedFilterValue: DataSourceFilterValueItem<T> | null;
333
+ computedPinned: InfiniteTableColumnPinnedValues;
334
+ computedDraggable: boolean;
335
+ computedResizable: boolean;
336
+ computedFirstInCategory: boolean;
337
+ computedLastInCategory: boolean;
338
+ computedFirst: boolean;
339
+ computedLast: boolean;
340
+ toggleSort: () => void;
341
+ id: string;
342
+ };
343
+ declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
344
+ declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
345
+
346
+ interface LogFn {
347
+ (...args: any[]): LogFn;
348
+ extend: (channelName: string) => LogFn;
349
+ }
350
+ declare class Logger {
351
+ debug: LogFn;
352
+ error: LogFn;
353
+ constructor(channelName: string);
354
+ }
355
+
356
+ interface ScrollPosition {
357
+ scrollTop: number;
358
+ scrollLeft: number;
359
+ }
360
+ declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
361
+
362
+ declare type VoidFn = () => void;
363
+
364
+ declare type FixedPosition = false | 'start' | 'end';
365
+ declare type SpanFunction = ({ rowIndex, colIndex, }: {
366
+ rowIndex: number;
367
+ colIndex: number;
368
+ }) => number;
369
+ declare type RenderRangeType = {
370
+ startIndex: number;
371
+ endIndex: number;
372
+ };
373
+ declare type ItemSizeFunction = (index: number) => number;
374
+ declare type MatrixBrainOptions = {
375
+ width: number;
376
+ height: number;
377
+ cols: number;
378
+ rows: number;
379
+ rowHeight: number | ItemSizeFunction;
380
+ colWidth: number | ItemSizeFunction;
381
+ rowspan?: SpanFunction;
382
+ colspan?: SpanFunction;
383
+ };
384
+ declare type TableRenderRange = {
385
+ start: [number, number];
386
+ end: [number, number];
387
+ rowFixed?: FixedPosition;
388
+ colFixed?: FixedPosition;
389
+ };
390
+ declare type WhichDirection = {
391
+ horizontal?: boolean;
392
+ vertical?: boolean;
393
+ };
394
+ declare type FnOnRenderRangeChange = (range: TableRenderRange) => void;
395
+ declare type FnOnDirectionalRenderRangeChange = (range: [number, number]) => void;
396
+ declare type FnOnRenderCountChange = ({ horizontal, vertical, }: {
397
+ horizontal: number;
398
+ vertical: number;
399
+ }) => void;
400
+ declare type OnAvailableSizeChange = (size: Size) => void;
401
+ declare class MatrixBrain extends Logger {
402
+ private scrolling;
403
+ private width;
404
+ private height;
153
405
  private cols;
154
406
  private rows;
155
407
  private rowHeight;
@@ -367,6 +619,34 @@ declare class MatrixBrain extends Logger {
367
619
  destroy: () => void;
368
620
  }
369
621
 
622
+ interface InfiniteTableComputedValues<T> {
623
+ scrollbars: {
624
+ vertical: boolean;
625
+ horizontal: boolean;
626
+ };
627
+ showColumnFilters: boolean;
628
+ rowspan?: MatrixBrainOptions['rowspan'];
629
+ computedPinnedStartOverflow: boolean;
630
+ computedPinnedEndOverflow: boolean;
631
+ computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
632
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
633
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
634
+ computedVisibleColumns: InfiniteTableComputedColumn<T>[];
635
+ computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
636
+ computedColumnVisibility: InfiniteTablePropColumnVisibility;
637
+ computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
638
+ computedPinnedStartColumnsWidth: number;
639
+ computedPinnedStartWidth: number;
640
+ computedPinnedEndColumnsWidth: number;
641
+ computedPinnedEndWidth: number;
642
+ computedUnpinnedColumnsWidth: number;
643
+ computedUnpinnedOffset: number;
644
+ computedPinnedEndOffset: number;
645
+ computedRemainingSpace: number;
646
+ toggleGroupRow: (groupKeys: any[]) => void;
647
+ columnSize: (colIndex: number) => number;
648
+ }
649
+
370
650
  declare type TableRenderCellFnParam = {
371
651
  domRef: RefCallback<HTMLElement>;
372
652
  rowIndex: number;
@@ -459,21 +739,10 @@ declare class ReactHeadlessTableRenderer extends Logger {
459
739
  reset(): void;
460
740
  }
461
741
 
462
- declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
463
- getComponentState: () => T_STATE;
464
- componentState: T_STATE;
465
- componentActions: T_ACTIONS;
466
- };
467
- declare type ComponentStateGeneratedActions<T_STATE> = {
468
- [k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
469
- };
470
- declare type ComponentInterceptedActions<T_STATE> = {
471
- [k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
472
- actions: ComponentStateGeneratedActions<T_STATE>;
473
- state: T_STATE;
474
- }) => void | boolean;
742
+ declare type CellPosition = {
743
+ rowIndex: number;
744
+ colIndex: number;
475
745
  };
476
- declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
477
746
 
478
747
  declare type NonUndefined<T> = T extends undefined ? never : T;
479
748
 
@@ -506,7 +775,11 @@ interface InfiniteTableSetupState<T> {
506
775
  activeCellIndicatorDOMRef: MutableRefObject<HTMLDivElement | null>;
507
776
  onRowHeightCSSVarChange: SubscriptionCallback<number>;
508
777
  onColumnHeaderHeightCSSVarChange: SubscriptionCallback<number>;
509
- columnsWhenGrouping?: InfiniteTablePropColumnsMap<T>;
778
+ cellClick: SubscriptionCallback<CellPosition & {
779
+ event: MouseEvent;
780
+ }>;
781
+ keyDown: SubscriptionCallback<KeyboardEvent>;
782
+ columnsWhenGrouping?: InfiniteTableColumnsMap<T>;
510
783
  bodySize: Size;
511
784
  brain: MatrixBrain;
512
785
  headerBrain: MatrixBrain;
@@ -528,9 +801,10 @@ interface InfiniteTableMappedState<T> {
528
801
  groupColumn: InfiniteTableProps<T>['groupColumn'];
529
802
  headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
530
803
  onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
804
+ columnPinning: InfiniteTablePropColumnPinning;
531
805
  loadingText: InfiniteTableProps<T>['loadingText'];
532
806
  components: InfiniteTableProps<T>['components'];
533
- columns: InfiniteTablePropColumnsMap<T>;
807
+ columns: InfiniteTableColumnsMap<T>;
534
808
  pivotColumns: InfiniteTableProps<T>['pivotColumns'];
535
809
  onReady: InfiniteTableProps<T>['onReady'];
536
810
  onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
@@ -586,8 +860,6 @@ interface InfiniteTableDerivedState<T> {
586
860
  groupBy: DataSourceProps<T>['groupBy'];
587
861
  computedColumns: Map<string, InfiniteTableColumn<T>>;
588
862
  groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
589
- columnPinning: InfiniteTablePropColumnPinning;
590
- columnPinningWhileDragging: InfiniteTablePropColumnPinning;
591
863
  columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
592
864
  keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>;
593
865
  columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
@@ -601,499 +873,435 @@ declare type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<
601
873
  interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
602
874
  }
603
875
 
604
- declare type LoadMaskProps = {
605
- visible: boolean;
606
- children: Renderable;
876
+ interface InfiniteTableContextValue<T> {
877
+ imperativeApi: InfiniteTableImperativeApi<T>;
878
+ componentState: InfiniteTableState<T>;
879
+ componentActions: InfiniteTableActions<T>;
880
+ computed: InfiniteTableComputedValues<T>;
881
+ getComputed: () => InfiniteTableComputedValues<T>;
882
+ getState: () => InfiniteTableState<T>;
883
+ }
884
+
885
+ declare type RenderRange = {
886
+ renderStartIndex: number;
887
+ renderEndIndex: number;
607
888
  };
608
- declare type InfiniteTablePropColumnOrderNormalized = string[];
609
- declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
610
- declare type InfiniteTablePropColumnVisibility = Record<string, false>;
611
- declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
612
- declare type InfiniteTablePropColumnPinning = Record<string, true | 'start' | 'end'>;
613
- declare type InfiniteTableRowStyleFnParams<T> = {
614
- rowIndex: number;
615
- } & InfiniteTableRowInfoDataDiscriminator<T>;
616
- declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
617
- declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
618
- declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
619
- declare type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
620
- declare type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
621
- getter?: AggregationReducer<T, AggregationResultType>['getter'];
889
+
890
+ declare class Indexer<PrimaryKeyType = string> {
891
+ indexToPrimaryKey: Map<number, PrimaryKeyType>;
892
+ primaryKeyToIndex: Map<string, number>;
893
+ add(index: number, primaryKey: PrimaryKeyType): void;
894
+ clear(): void;
895
+ getIndexOf(primaryKey: PrimaryKeyType): number | undefined;
896
+ getPrimaryKeyFor(index: number): PrimaryKeyType | undefined;
897
+ }
898
+
899
+ declare type BooleanCollectionStateKeys<KeyType extends string | number> = true | Record<KeyType, true>;
900
+ declare type BooleanCollectionStateObject<KeyType extends string | number> = {
901
+ positiveItems: BooleanCollectionStateKeys<KeyType>;
902
+ negativeItems: BooleanCollectionStateKeys<KeyType>;
903
+ };
904
+ declare abstract class BooleanCollectionState<StateObject, KeyType extends string | number = string> {
905
+ protected positiveMap?: Map<KeyType, true>;
906
+ protected negativeMap?: Map<KeyType, true>;
907
+ protected allNegative: boolean;
908
+ protected allPositive: boolean;
909
+ private initialState;
910
+ constructor(state: BooleanCollectionStateObject<KeyType> | BooleanCollectionState<StateObject, KeyType>);
911
+ abstract getPositiveFromState(state: StateObject): BooleanCollectionStateKeys<KeyType>;
912
+ abstract getNegativeFromState(state: StateObject): BooleanCollectionStateKeys<KeyType>;
913
+ abstract getState(): StateObject;
914
+ protected getInitialState(): BooleanCollectionStateObject<KeyType>;
915
+ destroy(): void;
916
+ private update;
917
+ protected isDefaultNegativeSelection(): boolean;
918
+ protected isDefaultPositiveSelection(): boolean;
919
+ protected areAllNegative(): boolean;
920
+ protected areAllPositive(): boolean;
921
+ protected makeAllNegative(): void;
922
+ protected makeAllPositive(): void;
923
+ protected isItemPositive(key: KeyType): boolean;
924
+ protected isItemNegative(key: KeyType): boolean;
925
+ protected setItemValue(key: KeyType, shouldMakePositive: boolean): void;
926
+ protected makeItemNegative(key: KeyType): void;
927
+ protected makeItemPositive(key: KeyType): void;
928
+ protected toggleItem(key: KeyType): void;
929
+ }
930
+
931
+ declare type RowSelectionStateKeys<RowKeyType extends string | number> = true | Record<RowKeyType, true>;
932
+ declare type RowSelectionStateObject<RowKeyType extends string | number = string> = {
933
+ selectedRows: RowSelectionStateKeys<RowKeyType>;
934
+ deselectedRows: RowSelectionStateKeys<RowKeyType>;
935
+ };
936
+ declare class RowSelectionState<RowKeyType extends string | number = string> extends BooleanCollectionState<RowSelectionStateObject<RowKeyType>, RowKeyType> {
937
+ constructor(state: RowSelectionStateObject<RowKeyType> | RowSelectionState<RowKeyType>);
938
+ getState(): RowSelectionStateObject<RowKeyType>;
939
+ getPositiveFromState(state: RowSelectionStateObject<RowKeyType>): RowSelectionStateKeys<RowKeyType>;
940
+ getNegativeFromState(state: RowSelectionStateObject<RowKeyType>): RowSelectionStateKeys<RowKeyType>;
941
+ areAllSelected(): boolean;
942
+ areAllDeselected(): boolean;
943
+ deselectAll(): void;
944
+ selectAll(): void;
945
+ isRowDefaultSelected(): boolean;
946
+ isRowDefaultDeselected(): boolean;
947
+ isRowSelected(key: string | number): boolean;
948
+ isRowDeselected(key: string | number): boolean;
949
+ setRowSelected(key: string | number, selected: boolean): void;
950
+ deselectRow(key: string | number): void;
951
+ selectRow(key: string | number): void;
952
+ toggleRowSelection(key: string | number): void;
953
+ getSelectedCount(maxCount?: number): number;
954
+ }
955
+
956
+ interface DataSourceDataParams<T> {
957
+ originalDataArray: T[];
958
+ sortInfo?: DataSourceSortInfo<T>;
959
+ groupBy?: DataSourcePropGroupBy<T>;
960
+ pivotBy?: DataSourcePropPivotBy<T>;
961
+ filterValue?: DataSourcePropFilterValue<T>;
962
+ groupRowsState?: DataSourcePropGroupRowsStateObject<any>;
963
+ lazyLoadBatchSize?: number;
964
+ lazyLoadStartIndex?: number;
965
+ groupKeys?: any[];
966
+ append?: boolean;
967
+ aggregationReducers?: DataSourcePropAggregationReducers<T>;
968
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
969
+ __cursorId?: DataSourceSetupState<T>['cursorId'];
970
+ changes?: DataSourceDataParamsChanges<T>;
971
+ }
972
+ declare type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
973
+ declare type DataSourceSingleSortInfo<T> = MultisortInfo<T> & {
622
974
  field?: keyof T;
975
+ id?: string;
623
976
  };
624
- declare type InfiniteTableColumnType<T> = {
625
- minWidth?: number;
626
- maxWidth?: number;
627
- filterType?: string;
628
- sortType?: string;
629
- dataType?: InfiniteTableDataTypeNames;
630
- defaultWidth?: number;
631
- defaultFlex?: number;
632
- defaultPinned?: InfiniteTableColumnPinnedValues;
633
- defaultFilterable?: boolean;
634
- defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
635
- header?: InfiniteTableColumn<T>['header'];
636
- comparer?: InfiniteTableColumn<T>['comparer'];
637
- draggable?: InfiniteTableColumn<T>['draggable'];
638
- sortable?: InfiniteTableColumn<T>['sortable'];
639
- resizable?: InfiniteTableColumn<T>['resizable'];
640
- align?: InfiniteTableColumn<T>['align'];
641
- verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
642
- columnGroup?: string;
643
- cssEllipsis?: boolean;
644
- headerCssEllipsis?: boolean;
645
- field?: keyof T;
646
- components?: InfiniteTableColumn<T>['components'];
647
- renderValue?: InfiniteTableColumn<T>['renderValue'];
648
- render?: InfiniteTableColumn<T>['render'];
649
- valueGetter?: InfiniteTableColumn<T>['valueGetter'];
650
- valueFormatter?: InfiniteTableColumn<T>['valueFormatter'];
651
- style?: InfiniteTableColumn<T>['style'];
652
- headerStyle?: InfiniteTableColumn<T>['headerStyle'];
653
- headerClassName?: InfiniteTableColumn<T>['headerClassName'];
654
- };
655
- declare type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
656
- declare type InfiniteTableColumnSizingOptions = {
657
- flex?: number;
658
- width?: number;
659
- minWidth?: number;
660
- maxWidth?: number;
661
- };
662
- declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
663
- declare type InfiniteTableImperativeApi<T> = {
664
- setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
665
- setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
666
- x?: T;
667
- get scrollLeft(): number;
668
- set scrollLeft(value: number);
669
- get scrollTop(): number;
670
- set scrollTop(value: number);
671
- scrollRowIntoView: (rowIndex: number, config?: {
672
- scrollAdjustPosition?: ScrollAdjustPosition;
673
- offset?: number;
674
- }) => boolean;
675
- scrollColumnIntoView: (colId: string, config?: {
676
- scrollAdjustPosition?: ScrollAdjustPosition;
677
- offset?: number;
678
- }) => boolean;
679
- scrollCellIntoView: (rowIndex: number, colIdOrIndex: string | number, config?: {
680
- scrollAdjustPosition?: ScrollAdjustPosition;
681
- offset?: number;
682
- }) => boolean;
683
- getState: () => InfiniteTableState<T>;
684
- getDataSourceState: () => DataSourceState<T>;
685
- };
686
- declare type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
687
- declare type InfiniteTablePropColumnsMap<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
688
- declare type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = InfiniteTablePropColumnsMap<T, ColumnType> | Record<string, ColumnType>;
689
- declare type InfiniteTablePropColumnGroupsMap = Map<string, InfiniteTableColumnGroup>;
690
- declare type InfiniteTablePropColumnGroupsRecord = Record<string, InfiniteTableColumnGroup>;
691
- declare type InfiniteTablePropColumnGroups = InfiniteTablePropColumnGroupsRecord | InfiniteTablePropColumnGroupsMap;
692
- declare type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
693
- declare type InfiniteTableColumnGroupHeaderRenderParams = {
694
- columnGroup: InfiniteTableComputedColumnGroup;
695
- };
696
- declare type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
697
- declare type InfiniteTableColumnGroup = {
698
- columnGroup?: string;
699
- header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
700
- };
701
- declare type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
702
- id: string;
703
- groupOffset: number;
704
- computedWidth: number;
705
- uniqueGroupId: string[];
706
- columns: string[];
707
- depth: number;
708
- };
709
- declare type InfiniteTableGroupColumnGetterOptions<T> = {
710
- groupIndexForColumn?: number;
711
- groupByForColumn?: DataSourceGroupBy<T>;
712
- groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
713
- groupCount: number;
714
- groupBy: DataSourceGroupBy<T>[];
715
- pivotBy?: DataSourcePivotBy<T>[];
716
- };
717
- declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
718
- column: COL_TYPE;
719
- groupBy: DataSourcePropGroupBy<T>;
720
- pivotBy: DataSourcePropPivotBy<T>;
977
+ declare type DataSourceGroupBy<T> = GroupBy<T, any>;
978
+ declare type DataSourcePivotBy<T> = PivotBy<T, any>;
979
+ declare type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
980
+ declare type DataSourcePropSortInfo<T> = DataSourceSortInfo<T>;
981
+ declare type DataSourceRemoteData<T> = {
982
+ data: T[] | LazyGroupDataItem<T>[];
983
+ mappings?: DataSourceMappings;
984
+ cache?: boolean;
985
+ error?: string;
986
+ totalCount?: number;
987
+ totalCountUnfiltered?: number;
988
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
721
989
  };
722
- declare type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
723
- declare type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
724
- renderValue?: InfiniteTableColumnRenderFunction<T>;
725
- renderGroupIcon?: InfiniteTableGroupColumnRenderIconFunction<T>;
726
- id?: string;
990
+ declare type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
991
+ declare type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
992
+ declare type DataSourcePropGroupRowsStateObject<KeyType> = {
993
+ expandedRows: DataSourceGroupRowsList<KeyType>;
994
+ collapsedRows: DataSourceGroupRowsList<KeyType>;
727
995
  };
728
- declare type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
729
- renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
996
+ declare type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
997
+ declare type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
998
+ interface DataSourceMappedState<T> {
999
+ aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
1000
+ livePagination: DataSourceProps<T>['livePagination'];
1001
+ isRowSelected: DataSourceProps<T>['isRowSelected'];
1002
+ lazyLoad: DataSourceProps<T>['lazyLoad'];
1003
+ onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
1004
+ data: DataSourceProps<T>['data'];
1005
+ sortMode: DataSourceProps<T>['sortMode'];
1006
+ filterFunction: DataSourceProps<T>['filterFunction'];
1007
+ filterValue: DataSourceProps<T>['filterValue'];
1008
+ filterTypes: NonUndefined<DataSourceProps<T>['filterTypes']>;
1009
+ primaryKey: DataSourceProps<T>['primaryKey'];
1010
+ filterDelay: NonUndefined<DataSourceProps<T>['filterDelay']>;
1011
+ groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
1012
+ groupRowsState: GroupRowsState<T>;
1013
+ pivotBy: DataSourceProps<T>['pivotBy'];
1014
+ loading: NonUndefined<DataSourceProps<T>['loading']>;
1015
+ sortTypes: NonUndefined<DataSourceProps<T>['sortTypes']>;
1016
+ collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
1017
+ sortInfo: DataSourceSingleSortInfo<T>[] | null;
1018
+ }
1019
+ declare type DataSourceAggregationReducer<T, AggregationResultType> = {
1020
+ name?: string;
1021
+ field?: keyof T;
1022
+ initialValue?: AggregationResultType;
1023
+ getter?: (data: T) => any;
1024
+ reducer: string | ((accumulator: any, value: any, data: T, index: number) => AggregationResultType | any);
1025
+ done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
1026
+ pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
1027
+ column: InfiniteTablePivotFinalColumnVariant<T>;
1028
+ }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
730
1029
  };
731
- declare type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
732
- declare type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => Partial<InfiniteTableGroupColumnBase<T>>;
733
- declare type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
734
- declare type InfiniteTablePropComponents = {
735
- LoadMask?: React$1.FC<LoadMaskProps>;
1030
+ declare type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
1031
+ inheritFromColumn?: string | boolean;
736
1032
  };
737
- declare type ScrollStopInfo = {
738
- scrollTop: number;
739
- firstVisibleRowIndex: number;
740
- lastVisibleRowIndex: number;
1033
+ declare type DataSourceMappings = Record<'totals' | 'values', string>;
1034
+ declare type LazyGroupDataItem<DataType> = {
1035
+ data: Partial<DataType>;
1036
+ keys: any[];
1037
+ aggregations?: Record<string, any>;
1038
+ dataset?: DataSourceRemoteData<DataType>;
1039
+ pivot?: {
1040
+ values: Record<string, any>;
1041
+ totals?: Record<string, any>;
1042
+ };
741
1043
  };
742
- declare type InfiniteTablePropFilterEditors<T> = Record<string, React$1.FC<InfiniteTableFilterEditorProps<T>>>;
743
- declare type InfiniteTableFilterEditorProps<T extends any> = {
744
- filterType: string;
745
- operator: string;
746
- ariaLabel: string;
747
- filterValue: T;
748
- className: string;
749
- onChange: (value: T | undefined) => void;
1044
+ declare type LazyRowInfoGroup<DataType> = {
1045
+ /**
1046
+ * Those are direct children of the current lazy group row
1047
+ */
1048
+ children: LazyGroupDataItem<DataType>[];
1049
+ childrenLoading: boolean;
1050
+ childrenAvailable: boolean;
1051
+ cache: boolean;
1052
+ totalCount: number;
1053
+ totalCountUnfiltered: number;
1054
+ error?: string;
750
1055
  };
751
- interface InfiniteTableProps<T> {
752
- columns: InfiniteTablePropColumns<T>;
753
- pivotColumns?: InfiniteTablePropColumnsMap<T, InfiniteTablePivotColumn<T>>;
754
- loadingText?: Renderable;
755
- components?: InfiniteTablePropComponents;
756
- viewportReservedWidth?: number;
757
- onViewportReservedWidthChange?: (viewportReservedWidth: number) => void;
758
- pivotColumn?: InfiniteTablePropPivotColumn<T, InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>>;
759
- pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
760
- pivotGrandTotalColumnPosition?: InfiniteTablePropPivotGrandTotalColumnPosition;
761
- groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
762
- groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
763
- hideEmptyGroupColumns?: boolean;
764
- columnVisibility?: InfiniteTablePropColumnVisibility;
765
- defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
766
- pinnedStartMaxWidth?: number;
767
- pinnedEndMaxWidth?: number;
768
- columnPinning?: InfiniteTablePropColumnPinning;
769
- defaultColumnPinning?: InfiniteTablePropColumnPinning;
770
- columnSizing?: InfiniteTablePropColumnSizing;
771
- defaultColumnSizing?: InfiniteTablePropColumnSizing;
772
- onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
773
- pivotColumnGroups?: InfiniteTablePropColumnGroups;
774
- columnGroups?: InfiniteTablePropColumnGroups;
775
- defaultColumnGroups?: InfiniteTablePropColumnGroups;
776
- defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
777
- collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
778
- onScrollbarsChange?: (scrollbars: Scrollbars) => void;
779
- onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
780
- columnTypes?: InfiniteTablePropColumnTypes<T>;
781
- showSeparatePivotColumnForSingleAggregation?: boolean;
782
- rowHeight: number | string;
783
- rowStyle?: InfiniteTablePropRowStyle<T>;
784
- rowClassName?: InfiniteTablePropRowClassName<T>;
785
- columnHeaderHeight: number | string;
786
- domProps?: React$1.HTMLProps<HTMLDivElement>;
787
- showZebraRows?: boolean;
788
- showHoverRows?: boolean;
789
- sortable?: boolean;
790
- keyboardNavigation?: InfiniteTablePropKeyboardNavigation;
791
- defaultActiveRowIndex?: number | null;
792
- activeRowIndex?: number | null;
793
- onActiveRowIndexChange?: (activeRowIndex: number) => void;
794
- onActiveCellIndexChange?: (activeCellIndex: [number, number]) => void;
795
- activeCellIndex?: [number, number] | null;
796
- defaultActiveCellIndex?: [number, number] | null;
797
- draggableColumns?: boolean;
798
- header?: boolean;
799
- headerOptions?: InfiniteTablePropHeaderOptions;
800
- focusedClassName?: string;
801
- focusedWithinClassName?: string;
802
- focusedStyle?: React$1.CSSProperties;
803
- focusedWithinStyle?: React$1.CSSProperties;
804
- columnCssEllipsis?: boolean;
805
- columnHeaderCssEllipsis?: boolean;
806
- columnDefaultWidth?: number;
807
- columnMinWidth?: number;
808
- columnMaxWidth?: number;
809
- resizableColumns?: boolean;
810
- virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
811
- virtualizeRows?: boolean;
812
- onSelfFocus?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
813
- onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
814
- onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
815
- onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
816
- onScrollToTop?: () => void;
817
- onScrollToBottom?: () => void;
818
- scrollStopDelay?: number;
819
- onScrollStop?: (param: ScrollStopInfo) => void;
820
- scrollToBottomOffset?: number;
821
- defaultColumnOrder?: InfiniteTablePropColumnOrder;
822
- columnOrder?: InfiniteTablePropColumnOrder;
823
- onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrder) => void;
824
- onRowHeightChange?: (rowHeight: number) => void;
825
- filterEditors?: InfiniteTablePropFilterEditors<T>;
826
- onReady?: (api: InfiniteTableImperativeApi<T>) => void;
827
- rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
828
- licenseKey?: string;
829
- scrollTopKey?: string | number;
830
- autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
1056
+ declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
1057
+ interface DataSourceSetupState<T> {
1058
+ indexer: Indexer;
1059
+ unfilteredCount: number;
1060
+ filteredCount: number;
1061
+ lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
1062
+ pivotMappings?: DataSourceMappings;
1063
+ propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
1064
+ showSeparatePivotColumnForSingleAggregation: boolean;
1065
+ dataParams?: DataSourceDataParams<T>;
1066
+ originalLazyGroupData: LazyGroupDataDeepMap<T>;
1067
+ originalLazyGroupDataChangeDetect: number | string;
1068
+ scrollStopDelayUpdatedByTable: number;
1069
+ notifyScrollbarsChange: SubscriptionCallback<Scrollbars>;
1070
+ notifyScrollStop: SubscriptionCallback<ScrollStopInfo>;
1071
+ notifyRenderRangeChange: SubscriptionCallback<RenderRange>;
1072
+ originalDataArray: T[];
1073
+ lastFilterDataArray?: T[];
1074
+ lastSortDataArray?: T[];
1075
+ lastGroupDataArray?: InfiniteTableRowInfo<T>[];
1076
+ dataArray: InfiniteTableRowInfo<T>[];
1077
+ groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
1078
+ reducerResults?: Record<string, AggregationReducerResult>;
1079
+ allRowsSelected: boolean;
1080
+ selectedRowCount: number;
1081
+ pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
1082
+ pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
1083
+ cursorId: number | symbol | DataSourceLivePaginationCursorValue;
1084
+ updatedAt: number;
1085
+ reducedAt: number;
1086
+ groupedAt: number;
1087
+ sortedAt: number;
1088
+ filteredAt: number;
1089
+ generateGroupRows: boolean;
1090
+ postFilterDataArray?: T[];
1091
+ postSortDataArray?: T[];
1092
+ postGroupDataArray?: InfiniteTableRowInfo<T>[];
1093
+ pivotColumns?: Map<string, InfiniteTableColumn<T>>;
1094
+ pivotColumnGroups?: Map<string, InfiniteTableColumnGroup>;
831
1095
  }
832
- declare type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
833
- declare type InfiniteTablePropHeaderOptions = {
834
- alwaysReserveSpaceForSortIcon: boolean;
835
- };
836
- declare type InfiniteTablePropAutoSizeColumnsKey = string | number | {
837
- key: string | number;
838
- columnsToSkip?: string[];
839
- columnsToResize?: string[];
840
- includeHeader?: boolean;
841
- };
842
- declare type Scrollbars = {
843
- vertical: boolean;
844
- horizontal: boolean;
845
- };
846
- declare type ScrollAdjustPosition = 'start' | 'end' | 'center';
847
-
848
- interface InfiniteTableComputedValues<T> {
849
- scrollbars: {
850
- vertical: boolean;
851
- horizontal: boolean;
1096
+ declare type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
1097
+ declare type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
1098
+ declare type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1099
+ declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject | RowSelectionState;
1100
+ declare type DataSourcePropRowSelection_SingleRow = null | string | number;
1101
+ declare type DataSourcePropCellSelection = any;
1102
+ declare type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
1103
+ declare type DataSourcePropOnRowSelectionChange_MultiRow = (params: {
1104
+ rowSelection: DataSourcePropRowSelection_MultiRow;
1105
+ rowSelectionState: RowSelectionState;
1106
+ selectionMode: 'multi-row';
1107
+ }) => void;
1108
+ declare type DataSourcePropOnRowSelectionChange_SingleRow = (params: {
1109
+ rowSelection: DataSourcePropRowSelection_SingleRow;
1110
+ selectionMode: 'single-row';
1111
+ }) => void;
1112
+ declare type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
1113
+ declare type DataSourcePropOnCellSelectionChange = (cellSelectionParams: any) => void;
1114
+ declare type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelection: DataSourcePropRowSelection, selectionMode: DataSourcePropSelectionMode) => boolean;
1115
+ declare type DataSourceProps<T> = {
1116
+ children: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
1117
+ primaryKey: keyof T | (({ data, index }: {
1118
+ data: T;
1119
+ index: number;
1120
+ }) => string);
1121
+ fields?: (keyof T)[];
1122
+ data: DataSourceData<T>;
1123
+ selectionMode?: DataSourcePropSelectionMode;
1124
+ rowSelection?: DataSourcePropRowSelection;
1125
+ defaultRowSelection?: DataSourcePropRowSelection;
1126
+ cellSelection?: DataSourcePropCellSelection;
1127
+ defaultCellSelection?: DataSourcePropCellSelection;
1128
+ onCellSelectionChange?: DataSourcePropOnCellSelectionChange;
1129
+ isRowSelected?: DataSourcePropIsRowSelected<T>;
1130
+ lazyLoad?: boolean | {
1131
+ batchSize?: number;
852
1132
  };
853
- showColumnFilters: boolean;
854
- rowspan?: MatrixBrainOptions['rowspan'];
855
- computedPinnedStartOverflow: boolean;
856
- computedPinnedEndOverflow: boolean;
857
- computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
858
- computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
859
- computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
860
- computedVisibleColumns: InfiniteTableComputedColumn<T>[];
861
- computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
862
- computedColumnVisibility: InfiniteTablePropColumnVisibility;
863
- computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
864
- computedPinnedStartColumnsWidth: number;
865
- computedPinnedStartWidth: number;
866
- computedPinnedEndColumnsWidth: number;
867
- computedPinnedEndWidth: number;
868
- computedUnpinnedColumnsWidth: number;
869
- computedUnpinnedOffset: number;
870
- computedPinnedEndOffset: number;
871
- computedRemainingSpace: number;
872
- toggleGroupRow: (groupKeys: any[]) => void;
873
- columnSize: (colIndex: number) => number;
874
- }
875
-
876
- interface InfiniteTableContextValue<T> {
877
- imperativeApi: InfiniteTableImperativeApi<T>;
878
- componentState: InfiniteTableState<T>;
879
- componentActions: InfiniteTableActions<T>;
880
- computed: InfiniteTableComputedValues<T>;
881
- getComputed: () => InfiniteTableComputedValues<T>;
882
- getState: () => InfiniteTableState<T>;
883
- }
884
-
885
- declare type InfiniteTableBaseCellProps<T> = {
886
- column: InfiniteTableComputedColumn<T>;
887
- renderChildren: () => Renderable;
888
- width: number;
889
- cssEllipsis?: boolean;
890
- contentStyle?: CSSProperties;
891
- contentClassName?: string;
892
- virtualized?: boolean;
893
- skipColumnShifting?: boolean;
894
- beforeChildren?: Renderable;
895
- afterChildren?: Renderable;
896
- cssPosition?: CSSProperties['position'];
897
- domRef?: React.RefCallback<HTMLElement>;
898
- };
899
- declare type InfiniteTableCellProps<T> = ({
900
- cellType: 'header';
901
- } & InfiniteTableBaseCellProps<T>) | ({
902
- cellType: 'body';
903
- } & InfiniteTableBaseCellProps<T>);
904
-
905
- declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
906
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
907
- }[Keys];
908
- declare type DiscriminatedUnion<A, B> = (A & {
909
- [K in keyof B]?: undefined;
910
- }) | (B & {
911
- [K in keyof A]?: undefined;
1133
+ loading?: boolean;
1134
+ defaultLoading?: boolean;
1135
+ onLoadingChange?: (loading: boolean) => void;
1136
+ pivotBy?: DataSourcePropPivotBy<T>;
1137
+ defaultPivotBy?: DataSourcePropPivotBy<T>;
1138
+ onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
1139
+ aggregationReducers?: DataSourcePropAggregationReducers<T>;
1140
+ defaultAggregationReducers?: DataSourcePropAggregationReducers<T>;
1141
+ groupBy?: DataSourcePropGroupBy<T>;
1142
+ defaultGroupBy?: DataSourcePropGroupBy<T>;
1143
+ onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
1144
+ groupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<any>;
1145
+ defaultGroupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<keyof T>;
1146
+ onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
1147
+ collapseGroupRowsOnDataFunctionChange?: boolean;
1148
+ sortInfo?: DataSourceSortInfo<T>;
1149
+ defaultSortInfo?: DataSourceSortInfo<T>;
1150
+ onSortInfoChange?: ((sortInfo: DataSourceSingleSortInfo<T> | null) => void) | ((sortInfo: DataSourceSingleSortInfo<T>[]) => void);
1151
+ onDataParamsChange?: (dataParamsChange: DataSourceDataParams<T>) => void;
1152
+ livePagination?: boolean;
1153
+ livePaginationCursor?: DataSourcePropLivePaginationCursor<T>;
1154
+ onLivePaginationCursorChange?: (livePaginationCursor: DataSourceLivePaginationCursorValue) => void;
1155
+ filterFunction?: DataSourcePropFilterFunction<T>;
1156
+ sortMode?: 'local' | 'remote';
1157
+ filterMode?: 'local' | 'remote';
1158
+ filterValue?: DataSourcePropFilterValue<T>;
1159
+ defaultFilterValue?: DataSourcePropFilterValue<T>;
1160
+ onFilterValueChange?: (filterValue: DataSourcePropFilterValue<T>) => void;
1161
+ filterDelay?: number;
1162
+ filterTypes?: DataSourcePropFilterTypes<T>;
1163
+ sortTypes?: DataSourcePropSortTypes;
1164
+ } & ({
1165
+ selectionMode?: 'multi-row';
1166
+ rowSelection?: DataSourcePropRowSelection_MultiRow;
1167
+ defaultRowSelection?: DataSourcePropRowSelection_MultiRow;
1168
+ onRowSelectionChange?: DataSourcePropOnRowSelectionChange_MultiRow;
1169
+ } | {
1170
+ selectionMode?: 'single-row';
1171
+ rowSelection?: DataSourcePropRowSelection_SingleRow;
1172
+ defaultRowSelection?: DataSourcePropRowSelection_SingleRow;
1173
+ onRowSelectionChange?: DataSourcePropOnRowSelectionChange_SingleRow;
1174
+ } | {
1175
+ selectionMode?: 'single-cell';
1176
+ } | {
1177
+ selectionMode?: 'multi-cell';
1178
+ } | {
1179
+ selectionMode?: false;
912
1180
  });
913
-
914
- declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
915
- declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
916
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
917
- sortTool: JSX.Element | null;
918
- dragging: boolean;
919
- column: COL_TYPE;
920
- columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
921
- columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
922
- };
923
- declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
924
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
925
- value: string | number | Renderable;
926
- groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
927
- rowIndex: number;
928
- rowActive: boolean;
929
- column: COL_TYPE;
930
- toggleCurrentGroupRow: () => void;
931
- toggleGroupRow: InfiniteTableToggleGroupRowFn;
932
- groupBy: DataSourceState<DATA_TYPE>['groupBy'];
933
- pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
934
- };
935
- declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
936
- declare type InfiniteTableGroupColumnRenderParams<DATA_TYPE, COL_TYPE> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & {
937
- rowInfo: InfiniteTable_HasGrouping_RowInfoGroup<DATA_TYPE>;
938
- isGroupRow: true;
939
- data: Partial<DATA_TYPE> | null;
940
- };
941
- declare type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParam<DATA_TYPE> & {};
942
- declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableGroupColumnRenderParams<DATA_TYPE, COL_TYPE> & {
943
- collapsed: boolean;
944
- groupIcon: Renderable;
945
- };
946
- declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
947
- declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
948
- rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
949
- data: DATA_TYPE | Partial<DATA_TYPE> | null;
950
- dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
951
- rowIndex: number;
952
- column: COL_TYPE;
953
- };
954
- declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
955
- declare type InfiniteTableGroupColumnRenderIconFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (param: InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
956
- declare type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParams<T>) => Renderable;
957
- declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
958
- declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
959
- declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
960
- declare type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
961
- declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
962
- declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> = RequireAtLeastOne<{
963
- /**
964
- * Determines the field property of the column.
965
- */
966
- field?: keyof T;
967
- render?: InfiniteTableColumnRenderFunction<T>;
968
- renderValue?: InfiniteTableColumnRenderFunction<T>;
969
- valueGetter?: InfiniteTableColumnValueGetter<T>;
970
- valueFormatter?: InfiniteTableColumnValueFormatter<T>;
971
- }, 'render' | 'renderValue' | 'field' | 'valueGetter' | 'valueFormatter'>;
972
- declare type InfiniteTableColumnStyleFnParams<T> = {
973
- value: Renderable;
974
- column: InfiniteTableColumn<T>;
975
- } & InfiniteTableRowInfoDataDiscriminator<T>;
976
- declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
977
- declare type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParams<T>) => undefined | string;
978
- declare type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParams<T>) => undefined | React.CSSProperties;
979
- declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
980
- declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
981
- declare type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
982
- declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
983
- declare type InfiniteTableColumnHeaderClassName<T> = string | InfiniteTableColumnHeaderClassNameFn<T>;
984
- declare type InfiniteTableColumnValueGetterParams<T> = {
1181
+ declare type DataSourcePropSortTypes = Record<string, (first: any, second: any) => number>;
1182
+ declare type DataSourcePropFilterTypes<T> = Record<string, DataSourceFilterType<T>>;
1183
+ declare type DataSourceFilterFunctionParam<T> = {
985
1184
  data: T;
986
- field?: keyof T;
1185
+ index: number;
1186
+ dataArray: T[];
1187
+ primaryKey: any;
987
1188
  };
988
- declare type InfiniteTableColumnValueFormatterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
989
- declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
990
- declare type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
991
- declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
992
- declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
993
- declare type InfiniteTableBaseColumn<T> = {
994
- sortable?: boolean;
995
- draggable?: boolean;
996
- resizable?: boolean;
997
- comparer?: InfiniteTableColumnComparer<T>;
998
- defaultHiddenWhenGroupedBy?: '*' | keyof T | {
999
- [k in keyof Partial<T>]: true;
1000
- };
1001
- align?: InfiniteTableColumnAlign;
1002
- verticalAlign?: InfiniteTableColumnVerticalAlign;
1003
- columnGroup?: string;
1004
- header?: InfiniteTableColumnHeader<T>;
1005
- name?: Renderable;
1006
- cssEllipsis?: boolean;
1007
- headerCssEllipsis?: boolean;
1008
- type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
1009
- dataType?: InfiniteTableDataTypeNames;
1010
- sortType?: string;
1011
- filterType?: string;
1012
- style?: InfiniteTableColumnStyle<T>;
1013
- headerStyle?: InfiniteTableColumnHeaderStyle<T>;
1014
- headerClassName?: InfiniteTableColumnHeaderClassName<T>;
1015
- className?: InfiniteTableColumnClassName<T>;
1016
- rowspan?: InfiniteTableColumnRowspanFn<T>;
1017
- valueGetter?: InfiniteTableColumnValueGetter<T>;
1018
- valueFormatter?: InfiniteTableColumnValueFormatter<T>;
1019
- defaultWidth?: number;
1020
- defaultFlex?: number;
1021
- defaultFilterable?: boolean;
1022
- minWidth?: number;
1023
- maxWidth?: number;
1024
- components?: {
1025
- ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
1026
- HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
1027
- };
1189
+ declare type DataSourcePropFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T>) => boolean;
1190
+ declare type DataSourcePropFilterValue<T> = DataSourceFilterValueItem<T>[];
1191
+ declare type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
1192
+ field: keyof T;
1193
+ }, {
1194
+ id: string;
1195
+ }> & {
1196
+ valueGetter?: DataSourceFilterValueItemValueGetter<T>;
1197
+ filterValue: any;
1198
+ disabled?: boolean;
1199
+ filterType: string;
1200
+ operator: string;
1028
1201
  };
1029
- /**
1030
- * Defines a column in the table.
1031
- *
1032
- * @typeParam DATA_TYPE The type of the data in the table.
1033
- *
1034
- * Can be bound to a field which is a `keyof DATA_TYPE`.
1035
- */
1036
- declare type InfiniteTableColumn<DATA_TYPE> = {} & InfiniteTableBaseColumn<DATA_TYPE> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<DATA_TYPE>;
1037
- declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
1038
- groupByField: string | string[];
1039
- id?: string;
1202
+ declare type DataSourceFilterValueItemValueGetter<T> = (param: DataSourceFilterFunctionParam<T>) => any;
1203
+ declare type DataSourceFilterType<T> = {
1204
+ emptyValues: Set<any>;
1205
+ label?: string;
1206
+ defaultOperator: string;
1207
+ operators: DataSourceFilterOperator<T>[];
1040
1208
  };
1041
- declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
1042
- declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
1043
- pivotBy: DataSourcePivotBy<DataType>[];
1044
- pivotTotalColumnGroup?: true;
1045
- pivotGroupKeys: KeyType[];
1046
- pivotByAtIndex: PivotBy<DataType, KeyType>;
1047
- pivotGroupKey: KeyType;
1048
- pivotIndex: number;
1209
+ declare type DataSourceFilterOperator<T> = {
1210
+ name: string;
1211
+ label?: string;
1212
+ fn: DataSourceFilterOperatorFunction<T>;
1049
1213
  };
1050
- declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
1051
- pivotBy: DataSourcePivotBy<DataType>[];
1052
- pivotColumn: true;
1053
- pivotTotalColumn: boolean;
1054
- pivotAggregator: AggregationReducer<DataType, any>;
1055
- pivotAggregatorIndex: number;
1056
- pivotGroupKeys: KeyType[];
1057
- pivotByAtIndex?: PivotBy<DataType, KeyType>;
1058
- pivotIndex: number;
1059
- pivotGroupKey: KeyType;
1214
+ declare type DataSourceFilterOperatorFunction<T> = (filterOperatorFunctionParam: DataSourceFilterOperatorFunctionParam<T>) => boolean;
1215
+ declare type DataSourceFilterOperatorFunctionParam<T> = {
1216
+ currentValue: any;
1217
+ filterValue: any;
1218
+ emptyValues: Set<any>;
1219
+ } & DataSourceFilterFunctionParam<T>;
1220
+ declare type DataSourcePropLivePaginationCursor<T> = DataSourceLivePaginationCursorValue | DataSourceLivePaginationCursorFn<T>;
1221
+ declare type DataSourceLivePaginationCursorFn<T> = (params: DataSourceLivePaginationCursorParams<T>) => DataSourceLivePaginationCursorValue;
1222
+ declare type DataSourceLivePaginationCursorParams<T> = {
1223
+ array: T[];
1224
+ lastItem: T | Partial<T> | null;
1225
+ length: number;
1060
1226
  };
1061
- declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
1062
- declare type InfiniteTableComputedColumnBase<T> = {
1063
- computedFilterType: string;
1064
- computedSortType: string;
1065
- computedDataType: string;
1066
- computedWidth: number;
1067
- computedFlex: number | null;
1068
- computedMinWidth: number;
1069
- computedMaxWidth: number;
1070
- computedOffset: number;
1071
- computedPinningOffset: number;
1072
- computedAbsoluteOffset: number;
1073
- computedSortable: boolean;
1074
- computedSortInfo: DataSourceSingleSortInfo<T> | null;
1075
- computedSorted: boolean;
1076
- computedSortedAsc: boolean;
1077
- computedSortedDesc: boolean;
1078
- computedSortIndex: number;
1079
- computedVisibleIndex: number;
1080
- computedVisibleIndexInCategory: number;
1081
- computedMultiSort: boolean;
1082
- computedFiltered: boolean;
1083
- computedFilterable: boolean;
1084
- computedFilterValue: DataSourceFilterValueItem<T> | null;
1085
- computedPinned: InfiniteTableColumnPinnedValues;
1086
- computedDraggable: boolean;
1087
- computedResizable: boolean;
1088
- computedFirstInCategory: boolean;
1089
- computedLastInCategory: boolean;
1090
- computedFirst: boolean;
1091
- computedLast: boolean;
1092
- toggleSort: () => void;
1093
- id: string;
1227
+ declare type DataSourceLivePaginationCursorValue = string | number | null;
1228
+ interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedState<T>, DataSourceMappedState<T> {
1229
+ }
1230
+ declare type DataSourceDerivedState<T> = {
1231
+ toPrimaryKey: (data: T) => any;
1232
+ operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
1233
+ rowSelection: RowSelectionState | null | number | string;
1234
+ selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
1235
+ filterMode: NonUndefined<DataSourceProps<T>['filterMode']>;
1236
+ multiSort: boolean;
1237
+ controlledSort: boolean;
1238
+ controlledFilter: boolean;
1239
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
1240
+ lazyLoadBatchSize?: number;
1094
1241
  };
1095
- declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
1096
- declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
1242
+ declare type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
1243
+ interface DataSourceContextValue<T> {
1244
+ getState: () => DataSourceState<T>;
1245
+ componentState: DataSourceState<T>;
1246
+ componentActions: DataSourceComponentActions<T>;
1247
+ }
1248
+ declare enum DataSourceActionType {
1249
+ INIT = "INIT"
1250
+ }
1251
+ interface DataSourceAction<T> {
1252
+ type: DataSourceActionType;
1253
+ payload: T;
1254
+ }
1255
+ interface DataSourceReducer<T> {
1256
+ (state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
1257
+ }
1258
+
1259
+ declare type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
1260
+ declare type BooleanDeepCollectionStateObject<KeyType> = {
1261
+ positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
1262
+ negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
1263
+ };
1264
+ declare abstract class BooleanDeepCollectionState<StateObject, KeyType extends any = any> {
1265
+ protected positiveMap?: DeepMap<KeyType, true>;
1266
+ protected negativeMap?: DeepMap<KeyType, true>;
1267
+ protected allNegative: boolean;
1268
+ protected allPositive: boolean;
1269
+ private initialState;
1270
+ constructor(state: BooleanDeepCollectionStateObject<KeyType> | BooleanDeepCollectionState<StateObject, KeyType>);
1271
+ abstract getPositiveFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1272
+ abstract getNegativeFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1273
+ abstract getState(): StateObject;
1274
+ protected getInitialState(): BooleanDeepCollectionStateObject<KeyType>;
1275
+ destroy(): void;
1276
+ private update;
1277
+ protected areAllNegative(): boolean;
1278
+ protected areAllPositive(): boolean;
1279
+ protected makeAllNegative(): void;
1280
+ protected makeAllPositive(): void;
1281
+ protected isItemPositive(keys: KeyType[]): boolean | undefined;
1282
+ protected isItemNegative(keys: KeyType[]): boolean;
1283
+ protected setItemValue(keys: KeyType[], shouldMakePositive: boolean): void;
1284
+ protected makeItemNegative(keys: KeyType[]): void;
1285
+ protected makeItemPositive(keys: KeyType[]): void;
1286
+ protected toggleItem(keys: KeyType[]): void;
1287
+ }
1288
+
1289
+ declare class GroupRowsState<KeyType extends any = any> extends BooleanDeepCollectionState<DataSourcePropGroupRowsStateObject<KeyType>, KeyType> {
1290
+ constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
1291
+ getState(): DataSourcePropGroupRowsStateObject<KeyType>;
1292
+ getPositiveFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1293
+ getNegativeFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1294
+ areAllCollapsed(): boolean;
1295
+ areAllExpanded(): boolean;
1296
+ collapseAll(): void;
1297
+ expandAll(): void;
1298
+ isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
1299
+ isGroupRowCollapsed(keys: KeyType[]): boolean;
1300
+ setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
1301
+ collapseGroupRow(keys: KeyType[]): void;
1302
+ expandGroupRow(keys: KeyType[]): void;
1303
+ toggleGroupRow(keys: KeyType[]): void;
1304
+ }
1097
1305
 
1098
1306
  declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
1099
1307
  id: string;
@@ -1135,6 +1343,7 @@ declare type InfiniteTable_RowInfoBase<_T> = {
1135
1343
  id: any;
1136
1344
  value?: any;
1137
1345
  indexInAll: number;
1346
+ rowSelected: boolean;
1138
1347
  };
1139
1348
  declare type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
1140
1349
  dataSourceHasGrouping: true;
@@ -1145,6 +1354,10 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
1145
1354
  dataSourceHasGrouping: true;
1146
1355
  data: Partial<T> | null;
1147
1356
  isGroupRow: true;
1357
+ /**
1358
+ * The count of all selected leaf nodes (normal rows) inside the group that are selected
1359
+ */
1360
+ childrenSelectedCount: number;
1148
1361
  /**
1149
1362
  * This array contains all the (uncollapsed, so visible) row infos under this group, at any level of nesting,
1150
1363
  * in the order in which they are visible in the table
@@ -1155,6 +1368,7 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
1155
1368
  /**
1156
1369
  * The count of all leaf nodes (normal rows) that are inside this group.
1157
1370
  * This count is the same as the length of the groupData array property.
1371
+ *
1158
1372
  */
1159
1373
  groupCount: number;
1160
1374
  /**
@@ -1345,306 +1559,277 @@ declare type DataGroupResult<DataType, KeyType extends any> = {
1345
1559
  declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
1346
1560
  declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
1347
1561
 
1348
- declare type SortDir = 1 | -1;
1349
- declare type MultisortInfo<T> = {
1350
- /**
1351
- * The sorting direction
1352
- */
1353
- dir: SortDir;
1354
- /**
1355
- * for now 'string' and 'number' are known types, meaning they have
1356
- * sort functions already implemented
1357
- */
1358
- type?: string;
1359
- fn?: (a: any, b: any) => number;
1360
- /**
1361
- * a property whose value to use for sorting on the array items
1362
- */
1363
- field?: keyof T;
1364
- /**
1365
- * or a function to retrieve the item value to use for sorting
1366
- */
1367
- valueGetter?: (item: T) => any;
1368
- };
1369
- declare const multisort: {
1370
- <T>(sortInfo: MultisortInfo<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
1371
- knownTypes: {
1372
- [key: string]: (first: any, second: any) => number;
1373
- };
1374
- };
1562
+ declare type InfiniteCheckBoxPropChecked = true | false | null;
1563
+ declare type InfiniteCheckBoxProps = {
1564
+ checked?: InfiniteCheckBoxPropChecked;
1565
+ defaultChecked?: InfiniteCheckBoxPropChecked;
1566
+ onChange?: (checked: InfiniteCheckBoxPropChecked) => void;
1567
+ domProps?: React$1.HTMLProps<HTMLElement>;
1568
+ };
1569
+ declare function InfiniteCheckBox(props: InfiniteCheckBoxProps): JSX.Element;
1375
1570
 
1376
- declare type RenderRange = {
1377
- renderStartIndex: number;
1378
- renderEndIndex: number;
1571
+ declare type LoadMaskProps = {
1572
+ visible: boolean;
1573
+ children: Renderable;
1379
1574
  };
1380
-
1381
- interface DataSourceDataParams<T> {
1382
- originalDataArray: T[];
1383
- sortInfo?: DataSourceSortInfo<T>;
1384
- groupBy?: DataSourcePropGroupBy<T>;
1385
- pivotBy?: DataSourcePropPivotBy<T>;
1386
- filterValue?: DataSourcePropFilterValue<T>;
1387
- groupRowsState?: DataSourcePropGroupRowsStateObject<any>;
1388
- lazyLoadBatchSize?: number;
1389
- lazyLoadStartIndex?: number;
1390
- groupKeys?: any[];
1391
- append?: boolean;
1392
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
1393
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1394
- __cursorId?: DataSourceSetupState<T>['cursorId'];
1395
- changes?: DataSourceDataParamsChanges<T>;
1396
- }
1397
- declare type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
1398
- declare type DataSourceSingleSortInfo<T> = MultisortInfo<T> & {
1575
+ declare type InfiniteTablePropColumnOrderNormalized = string[];
1576
+ declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
1577
+ declare type InfiniteTablePropColumnVisibility = Record<string, false>;
1578
+ declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
1579
+ declare type InfiniteTablePropColumnPinning = Record<string, true | 'start' | 'end'>;
1580
+ declare type InfiniteTableRowStyleFnParams<T> = {
1581
+ rowIndex: number;
1582
+ } & InfiniteTableRowInfoDataDiscriminator<T>;
1583
+ declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
1584
+ declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
1585
+ declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
1586
+ declare type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
1587
+ declare type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
1588
+ getter?: AggregationReducer<T, AggregationResultType>['getter'];
1399
1589
  field?: keyof T;
1400
- id?: string;
1401
- };
1402
- declare type DataSourceGroupBy<T> = GroupBy<T, any>;
1403
- declare type DataSourcePivotBy<T> = PivotBy<T, any>;
1404
- declare type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
1405
- declare type DataSourcePropSortInfo<T> = DataSourceSortInfo<T>;
1406
- declare type DataSourceRemoteData<T> = {
1407
- data: T[] | LazyGroupDataItem<T>[];
1408
- mappings?: DataSourceMappings;
1409
- cache?: boolean;
1410
- error?: string;
1411
- totalCount?: number;
1412
- totalCountUnfiltered?: number;
1413
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1414
1590
  };
1415
- declare type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
1416
- declare type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
1417
- declare type DataSourcePropGroupRowsStateObject<KeyType> = {
1418
- expandedRows: DataSourceGroupRowsList<KeyType>;
1419
- collapsedRows: DataSourceGroupRowsList<KeyType>;
1420
- };
1421
- declare type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
1422
- declare type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
1423
- interface DataSourceMappedState<T> {
1424
- aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
1425
- livePagination: DataSourceProps<T>['livePagination'];
1426
- lazyLoad: DataSourceProps<T>['lazyLoad'];
1427
- onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
1428
- data: DataSourceProps<T>['data'];
1429
- sortMode: DataSourceProps<T>['sortMode'];
1430
- filterFunction: DataSourceProps<T>['filterFunction'];
1431
- filterValue: DataSourceProps<T>['filterValue'];
1432
- filterTypes: NonUndefined<DataSourceProps<T>['filterTypes']>;
1433
- primaryKey: DataSourceProps<T>['primaryKey'];
1434
- filterDelay: NonUndefined<DataSourceProps<T>['filterDelay']>;
1435
- groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
1436
- groupRowsState: GroupRowsState<T>;
1437
- pivotBy: DataSourceProps<T>['pivotBy'];
1438
- loading: NonUndefined<DataSourceProps<T>['loading']>;
1439
- sortTypes: NonUndefined<DataSourceProps<T>['sortTypes']>;
1440
- collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
1441
- sortInfo: DataSourceSingleSortInfo<T>[] | null;
1442
- }
1443
- declare type DataSourceAggregationReducer<T, AggregationResultType> = {
1444
- name?: string;
1591
+ declare type InfiniteTableColumnType<T> = {
1592
+ minWidth?: number;
1593
+ maxWidth?: number;
1594
+ filterType?: string;
1595
+ sortType?: string;
1596
+ dataType?: InfiniteTableDataTypeNames;
1597
+ defaultWidth?: number;
1598
+ defaultFlex?: number;
1599
+ defaultPinned?: InfiniteTableColumnPinnedValues;
1600
+ defaultFilterable?: boolean;
1601
+ defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
1602
+ header?: InfiniteTableColumn<T>['header'];
1603
+ comparer?: InfiniteTableColumn<T>['comparer'];
1604
+ draggable?: InfiniteTableColumn<T>['draggable'];
1605
+ sortable?: InfiniteTableColumn<T>['sortable'];
1606
+ resizable?: InfiniteTableColumn<T>['resizable'];
1607
+ align?: InfiniteTableColumn<T>['align'];
1608
+ verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
1609
+ columnGroup?: string;
1610
+ cssEllipsis?: boolean;
1611
+ headerCssEllipsis?: boolean;
1445
1612
  field?: keyof T;
1446
- initialValue?: AggregationResultType;
1447
- getter?: (data: T) => any;
1448
- reducer: string | ((accumulator: any, value: any, data: T) => AggregationResultType | any);
1449
- done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
1450
- pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
1451
- column: InfiniteTablePivotFinalColumnVariant<T>;
1452
- }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
1453
- };
1454
- declare type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
1455
- inheritFromColumn?: string | boolean;
1456
- };
1457
- declare type DataSourceMappings = Record<'totals' | 'values', string>;
1458
- declare type LazyGroupDataItem<DataType> = {
1459
- data: Partial<DataType>;
1460
- keys: any[];
1461
- aggregations?: Record<string, any>;
1462
- dataset?: DataSourceRemoteData<DataType>;
1463
- pivot?: {
1464
- values: Record<string, any>;
1465
- totals?: Record<string, any>;
1466
- };
1467
- };
1468
- declare type LazyRowInfoGroup<DataType> = {
1469
- /**
1470
- * Those are direct children of the current lazy group row
1471
- */
1472
- children: LazyGroupDataItem<DataType>[];
1473
- childrenLoading: boolean;
1474
- childrenAvailable: boolean;
1475
- cache: boolean;
1476
- totalCount: number;
1477
- totalCountUnfiltered: number;
1478
- error?: string;
1613
+ components?: InfiniteTableColumn<T>['components'];
1614
+ renderValue?: InfiniteTableColumn<T>['renderValue'];
1615
+ render?: InfiniteTableColumn<T>['render'];
1616
+ valueGetter?: InfiniteTableColumn<T>['valueGetter'];
1617
+ valueFormatter?: InfiniteTableColumn<T>['valueFormatter'];
1618
+ style?: InfiniteTableColumn<T>['style'];
1619
+ headerStyle?: InfiniteTableColumn<T>['headerStyle'];
1620
+ headerClassName?: InfiniteTableColumn<T>['headerClassName'];
1479
1621
  };
1480
- declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
1481
- interface DataSourceSetupState<T> {
1482
- unfilteredCount: number;
1483
- filteredCount: number;
1484
- lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
1485
- pivotMappings?: DataSourceMappings;
1486
- propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
1487
- showSeparatePivotColumnForSingleAggregation: boolean;
1488
- dataParams?: DataSourceDataParams<T>;
1489
- originalLazyGroupData: LazyGroupDataDeepMap<T>;
1490
- originalLazyGroupDataChangeDetect: number | string;
1491
- scrollStopDelayUpdatedByTable: number;
1492
- notifyScrollbarsChange: SubscriptionCallback<Scrollbars>;
1493
- notifyScrollStop: SubscriptionCallback<ScrollStopInfo>;
1494
- notifyRenderRangeChange: SubscriptionCallback<RenderRange>;
1495
- originalDataArray: T[];
1496
- lastFilterDataArray?: T[];
1497
- lastSortDataArray?: T[];
1498
- lastGroupDataArray?: InfiniteTableRowInfo<T>[];
1499
- dataArray: InfiniteTableRowInfo<T>[];
1500
- groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
1501
- pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
1502
- pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
1503
- cursorId: number | symbol | DataSourceLivePaginationCursorValue;
1504
- updatedAt: number;
1505
- reducedAt: number;
1506
- groupedAt: number;
1507
- sortedAt: number;
1508
- filteredAt: number;
1509
- generateGroupRows: boolean;
1510
- postFilterDataArray?: T[];
1511
- postSortDataArray?: T[];
1512
- postGroupDataArray?: InfiniteTableRowInfo<T>[];
1513
- pivotColumns?: Map<string, InfiniteTableColumn<T>>;
1514
- pivotColumnGroups?: Map<string, InfiniteTableColumnGroup>;
1515
- }
1516
- declare type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
1517
- declare type DataSourceProps<T> = {
1518
- children: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
1519
- primaryKey: keyof T | (({ data, index }: {
1520
- data: T;
1521
- index: number;
1522
- }) => string);
1523
- fields?: (keyof T)[];
1524
- data: DataSourceData<T>;
1525
- lazyLoad?: boolean | {
1526
- batchSize?: number;
1527
- };
1528
- loading?: boolean;
1529
- defaultLoading?: boolean;
1530
- onLoadingChange?: (loading: boolean) => void;
1531
- pivotBy?: DataSourcePropPivotBy<T>;
1532
- defaultPivotBy?: DataSourcePropPivotBy<T>;
1533
- onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
1534
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
1535
- defaultAggregationReducers?: DataSourcePropAggregationReducers<T>;
1536
- groupBy?: DataSourcePropGroupBy<T>;
1537
- defaultGroupBy?: DataSourcePropGroupBy<T>;
1538
- onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
1539
- groupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<any>;
1540
- defaultGroupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<keyof T>;
1541
- onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
1542
- collapseGroupRowsOnDataFunctionChange?: boolean;
1543
- sortInfo?: DataSourceSortInfo<T>;
1544
- defaultSortInfo?: DataSourceSortInfo<T>;
1545
- onSortInfoChange?: ((sortInfo: DataSourceSingleSortInfo<T> | null) => void) | ((sortInfo: DataSourceSingleSortInfo<T>[]) => void);
1546
- onDataParamsChange?: (dataParamsChange: DataSourceDataParams<T>) => void;
1547
- livePagination?: boolean;
1548
- livePaginationCursor?: DataSourcePropLivePaginationCursor<T>;
1549
- onLivePaginationCursorChange?: (livePaginationCursor: DataSourceLivePaginationCursorValue) => void;
1550
- filterFunction?: DataSourcePropFilterFunction<T>;
1551
- sortMode?: 'local' | 'remote';
1552
- filterMode?: 'local' | 'remote';
1553
- filterValue?: DataSourcePropFilterValue<T>;
1554
- defaultFilterValue?: DataSourcePropFilterValue<T>;
1555
- onFilterValueChange?: (filterValue: DataSourcePropFilterValue<T>) => void;
1556
- filterDelay?: number;
1557
- filterTypes?: DataSourcePropFilterTypes<T>;
1558
- sortTypes?: DataSourcePropSortTypes;
1622
+ declare type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
1623
+ declare type InfiniteTableColumnSizingOptions = {
1624
+ flex?: number;
1625
+ width?: number;
1626
+ minWidth?: number;
1627
+ maxWidth?: number;
1559
1628
  };
1560
- declare type DataSourcePropSortTypes = Record<string, (first: any, second: any) => number>;
1561
- declare type DataSourcePropFilterTypes<T> = Record<string, DataSourceFilterType<T>>;
1562
- declare type DataSourceFilterFunctionParam<T> = {
1563
- data: T;
1564
- index: number;
1565
- dataArray: T[];
1566
- primaryKey: any;
1629
+ declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
1630
+ declare type InfiniteTableImperativeApi<T> = {
1631
+ setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
1632
+ setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
1633
+ x?: T;
1634
+ get allRowsSelected(): boolean;
1635
+ getSelectedRowCount(): number;
1636
+ get scrollLeft(): number;
1637
+ set scrollLeft(value: number);
1638
+ get scrollTop(): number;
1639
+ set scrollTop(value: number);
1640
+ getSelectedRows: () => T[];
1641
+ toggleGroupRow: (groupKeys: any[]) => void;
1642
+ toggleRowSelection: (pk: any) => boolean;
1643
+ selectRow: (pk: any) => boolean;
1644
+ isRowSelected: (pk: any) => boolean;
1645
+ isGroupRowSelected: (groupKeys: any[]) => boolean;
1646
+ toggleGroupRowSelection: (groupKeys: any[]) => boolean;
1647
+ deselectRow: (pk: any) => boolean;
1648
+ selectGroupRow: (groupKeys: any[]) => boolean;
1649
+ deselectGroupRow: (groupKeys: any[]) => boolean;
1650
+ selectAllRows: () => boolean;
1651
+ deselectAllRows: () => boolean;
1652
+ scrollRowIntoView: (rowIndex: number, config?: {
1653
+ scrollAdjustPosition?: ScrollAdjustPosition;
1654
+ offset?: number;
1655
+ }) => boolean;
1656
+ scrollColumnIntoView: (colId: string, config?: {
1657
+ scrollAdjustPosition?: ScrollAdjustPosition;
1658
+ offset?: number;
1659
+ }) => boolean;
1660
+ scrollCellIntoView: (rowIndex: number, colIdOrIndex: string | number, config?: {
1661
+ scrollAdjustPosition?: ScrollAdjustPosition;
1662
+ offset?: number;
1663
+ }) => boolean;
1664
+ getState: () => InfiniteTableState<T>;
1665
+ getDataSourceState: () => DataSourceState<T>;
1567
1666
  };
1568
- declare type DataSourcePropFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T>) => boolean;
1569
- declare type DataSourcePropFilterValue<T> = DataSourceFilterValueItem<T>[];
1570
- declare type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
1571
- field: keyof T;
1572
- }, {
1667
+ declare type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
1668
+ declare type InfiniteTableColumnsMap<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
1669
+ declare type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = Record<string, ColumnType> | InfiniteTableColumnsMap<T, ColumnType>;
1670
+ declare type InfiniteTablePropColumnGroupsMap = Map<string, InfiniteTableColumnGroup>;
1671
+ declare type InfiniteTablePropColumnGroupsRecord = Record<string, InfiniteTableColumnGroup>;
1672
+ declare type InfiniteTablePropColumnGroups = InfiniteTablePropColumnGroupsRecord | InfiniteTablePropColumnGroupsMap;
1673
+ declare type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
1674
+ declare type InfiniteTableColumnGroupHeaderRenderParams = {
1675
+ columnGroup: InfiniteTableComputedColumnGroup;
1676
+ };
1677
+ declare type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
1678
+ declare type InfiniteTableColumnGroup = {
1679
+ columnGroup?: string;
1680
+ header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
1681
+ };
1682
+ declare type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
1573
1683
  id: string;
1574
- }> & {
1575
- valueGetter?: DataSourceFilterValueItemValueGetter<T>;
1576
- filterValue: any;
1577
- disabled?: boolean;
1684
+ groupOffset: number;
1685
+ computedWidth: number;
1686
+ uniqueGroupId: string[];
1687
+ columns: string[];
1688
+ depth: number;
1689
+ };
1690
+ declare type InfiniteTableGroupColumnGetterOptions<T> = {
1691
+ groupIndexForColumn?: number;
1692
+ groupByForColumn?: DataSourceGroupBy<T>;
1693
+ groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
1694
+ groupCount: number;
1695
+ groupBy: DataSourceGroupBy<T>[];
1696
+ pivotBy?: DataSourcePivotBy<T>[];
1697
+ };
1698
+ declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
1699
+ column: COL_TYPE;
1700
+ groupBy: DataSourcePropGroupBy<T>;
1701
+ pivotBy: DataSourcePropPivotBy<T>;
1702
+ };
1703
+ declare type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
1704
+ declare type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
1705
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
1706
+ renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
1707
+ id?: string;
1708
+ };
1709
+ declare type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
1710
+ renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
1711
+ };
1712
+ declare type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
1713
+ declare type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => Partial<InfiniteTableGroupColumnBase<T>>;
1714
+ declare type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
1715
+ declare type InfiniteTablePropComponents = {
1716
+ LoadMask?: React$1.FC<LoadMaskProps>;
1717
+ CheckBox?: React$1.FC<InfiniteCheckBoxProps>;
1718
+ };
1719
+ declare type ScrollStopInfo = {
1720
+ scrollTop: number;
1721
+ firstVisibleRowIndex: number;
1722
+ lastVisibleRowIndex: number;
1723
+ };
1724
+ declare type InfiniteTablePropFilterEditors<T> = Record<string, React$1.FC<InfiniteTableFilterEditorProps<T>>>;
1725
+ declare type InfiniteTableFilterEditorProps<T extends any> = {
1578
1726
  filterType: string;
1579
1727
  operator: string;
1728
+ ariaLabel: string;
1729
+ filterValue: T;
1730
+ className: string;
1731
+ onChange: (value: T | undefined) => void;
1580
1732
  };
1581
- declare type DataSourceFilterValueItemValueGetter<T> = (param: DataSourceFilterFunctionParam<T>) => any;
1582
- declare type DataSourceFilterType<T> = {
1583
- emptyValues: Set<any>;
1584
- label?: string;
1585
- defaultOperator: string;
1586
- operators: DataSourceFilterOperator<T>[];
1733
+ interface InfiniteTableProps<T> {
1734
+ columns: InfiniteTablePropColumns<T>;
1735
+ pivotColumns?: InfiniteTableColumnsMap<T, InfiniteTablePivotColumn<T>>;
1736
+ loadingText?: Renderable;
1737
+ components?: InfiniteTablePropComponents;
1738
+ viewportReservedWidth?: number;
1739
+ onViewportReservedWidthChange?: (viewportReservedWidth: number) => void;
1740
+ pivotColumn?: InfiniteTablePropPivotColumn<T, InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>>;
1741
+ pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
1742
+ pivotGrandTotalColumnPosition?: InfiniteTablePropPivotGrandTotalColumnPosition;
1743
+ groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
1744
+ groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
1745
+ hideEmptyGroupColumns?: boolean;
1746
+ columnVisibility?: InfiniteTablePropColumnVisibility;
1747
+ defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
1748
+ pinnedStartMaxWidth?: number;
1749
+ pinnedEndMaxWidth?: number;
1750
+ columnPinning?: InfiniteTablePropColumnPinning;
1751
+ defaultColumnPinning?: InfiniteTablePropColumnPinning;
1752
+ columnSizing?: InfiniteTablePropColumnSizing;
1753
+ defaultColumnSizing?: InfiniteTablePropColumnSizing;
1754
+ onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
1755
+ pivotColumnGroups?: InfiniteTablePropColumnGroups;
1756
+ columnGroups?: InfiniteTablePropColumnGroups;
1757
+ defaultColumnGroups?: InfiniteTablePropColumnGroups;
1758
+ defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
1759
+ collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
1760
+ onScrollbarsChange?: (scrollbars: Scrollbars) => void;
1761
+ onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
1762
+ columnTypes?: InfiniteTablePropColumnTypes<T>;
1763
+ showSeparatePivotColumnForSingleAggregation?: boolean;
1764
+ rowHeight: number | string;
1765
+ rowStyle?: InfiniteTablePropRowStyle<T>;
1766
+ rowClassName?: InfiniteTablePropRowClassName<T>;
1767
+ columnHeaderHeight: number | string;
1768
+ domProps?: React$1.HTMLProps<HTMLDivElement>;
1769
+ showZebraRows?: boolean;
1770
+ showHoverRows?: boolean;
1771
+ sortable?: boolean;
1772
+ keyboardNavigation?: InfiniteTablePropKeyboardNavigation;
1773
+ defaultActiveRowIndex?: number | null;
1774
+ activeRowIndex?: number | null;
1775
+ onActiveRowIndexChange?: (activeRowIndex: number) => void;
1776
+ onActiveCellIndexChange?: (activeCellIndex: [number, number]) => void;
1777
+ activeCellIndex?: [number, number] | null;
1778
+ defaultActiveCellIndex?: [number, number] | null;
1779
+ draggableColumns?: boolean;
1780
+ header?: boolean;
1781
+ headerOptions?: InfiniteTablePropHeaderOptions;
1782
+ focusedClassName?: string;
1783
+ focusedWithinClassName?: string;
1784
+ focusedStyle?: React$1.CSSProperties;
1785
+ focusedWithinStyle?: React$1.CSSProperties;
1786
+ columnCssEllipsis?: boolean;
1787
+ columnHeaderCssEllipsis?: boolean;
1788
+ columnDefaultWidth?: number;
1789
+ columnMinWidth?: number;
1790
+ columnMaxWidth?: number;
1791
+ resizableColumns?: boolean;
1792
+ virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
1793
+ virtualizeRows?: boolean;
1794
+ onSelfFocus?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1795
+ onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1796
+ onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1797
+ onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1798
+ onScrollToTop?: () => void;
1799
+ onScrollToBottom?: () => void;
1800
+ scrollStopDelay?: number;
1801
+ onScrollStop?: (param: ScrollStopInfo) => void;
1802
+ scrollToBottomOffset?: number;
1803
+ defaultColumnOrder?: InfiniteTablePropColumnOrder;
1804
+ columnOrder?: InfiniteTablePropColumnOrder;
1805
+ onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrderNormalized) => void;
1806
+ onRowHeightChange?: (rowHeight: number) => void;
1807
+ filterEditors?: InfiniteTablePropFilterEditors<T>;
1808
+ onReady?: (api: InfiniteTableImperativeApi<T>) => void;
1809
+ rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
1810
+ licenseKey?: string;
1811
+ scrollTopKey?: string | number;
1812
+ autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
1813
+ }
1814
+ declare type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
1815
+ declare type InfiniteTablePropHeaderOptions = {
1816
+ alwaysReserveSpaceForSortIcon: boolean;
1587
1817
  };
1588
- declare type DataSourceFilterOperator<T> = {
1589
- name: string;
1590
- label?: string;
1591
- fn: DataSourceFilterOperatorFunction<T>;
1818
+ declare type InfiniteTablePropAutoSizeColumnsKey = string | number | {
1819
+ key: string | number;
1820
+ columnsToSkip?: string[];
1821
+ columnsToResize?: string[];
1822
+ includeHeader?: boolean;
1592
1823
  };
1593
- declare type DataSourceFilterOperatorFunction<T> = (filterOperatorFunctionParam: DataSourceFilterOperatorFunctionParam<T>) => boolean;
1594
- declare type DataSourceFilterOperatorFunctionParam<T> = {
1595
- currentValue: any;
1596
- filterValue: any;
1597
- emptyValues: Set<any>;
1598
- } & DataSourceFilterFunctionParam<T>;
1599
- declare type DataSourcePropLivePaginationCursor<T> = DataSourceLivePaginationCursorValue | DataSourceLivePaginationCursorFn<T>;
1600
- declare type DataSourceLivePaginationCursorFn<T> = (params: DataSourceLivePaginationCursorParams<T>) => DataSourceLivePaginationCursorValue;
1601
- declare type DataSourceLivePaginationCursorParams<T> = {
1602
- array: T[];
1603
- lastItem: T | Partial<T> | null;
1604
- length: number;
1824
+ declare type Scrollbars = {
1825
+ vertical: boolean;
1826
+ horizontal: boolean;
1605
1827
  };
1606
- declare type DataSourceLivePaginationCursorValue = string | number | null;
1607
- interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedState<T>, DataSourceMappedState<T> {
1608
- }
1609
- interface DataSourceDerivedState<T> {
1610
- operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
1611
- filterMode: NonUndefined<DataSourceProps<T>['filterMode']>;
1612
- multiSort: boolean;
1613
- controlledSort: boolean;
1614
- controlledFilter: boolean;
1615
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1616
- lazyLoadBatchSize?: number;
1617
- }
1618
- declare type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
1619
- interface DataSourceContextValue<T> {
1620
- getState: () => DataSourceState<T>;
1621
- componentState: DataSourceState<T>;
1622
- componentActions: DataSourceComponentActions<T>;
1623
- }
1624
- declare enum DataSourceActionType {
1625
- INIT = "INIT"
1626
- }
1627
- interface DataSourceAction<T> {
1628
- type: DataSourceActionType;
1629
- payload: T;
1630
- }
1631
- interface DataSourceReducer<T> {
1632
- (state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
1633
- }
1634
-
1635
- declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParams<T, InfiniteTableComputedColumn<T>>;
1636
-
1637
- declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
1828
+ declare type ScrollAdjustPosition = 'start' | 'end' | 'center';
1638
1829
 
1639
- declare const InfiniteTableClassName: string;
1640
- declare const InfiniteTableComponent: React$1.MemoExoticComponent<(<T>() => JSX.Element)>;
1641
- declare function InfiniteTable<T>(props: InfiniteTableProps<T>): JSX.Element;
1642
- declare namespace InfiniteTable {
1643
- var defaultProps: {
1644
- rowHeight: number;
1645
- columnHeaderHeight: string;
1646
- };
1647
- }
1830
+ declare function debounce(fn: Function, { wait }: {
1831
+ wait: number;
1832
+ }): (...args: any[]) => void;
1648
1833
 
1649
1834
  declare const defaultFilterTypes: Record<string, DataSourceFilterType<any>>;
1650
1835
 
@@ -1661,6 +1846,7 @@ declare type ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT
1661
1846
  forwardProps?: (setupState: COMPONENT_SETUP_STATE) => ForwardPropsToStateFnResult<T_PROPS, COMPONENT_MAPPED_STATE>;
1662
1847
  allowedControlledPropOverrides?: Record<keyof T_PROPS, true>;
1663
1848
  interceptActions?: ComponentInterceptedActions<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>;
1849
+ mappedCallbacks?: ComponentMappedCallbacks<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>;
1664
1850
  onPropChange?: (params: {
1665
1851
  name: keyof T_PROPS;
1666
1852
  oldValue: any;
@@ -1708,4 +1894,9 @@ declare const defaultFilterEditors: InfiniteTablePropFilterEditors<unknown>;
1708
1894
  declare function StringFilterEditor<T>(props: InfiniteTableFilterEditorProps<T>): JSX.Element;
1709
1895
  declare function NumberFilterEditor<T>(props: InfiniteTableFilterEditorProps<T>): JSX.Element;
1710
1896
 
1711
- export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropLivePaginationCursor, DataSourcePropPivotBy, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableFilterEditorProps, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableGroupColumnRenderIconFunction, InfiniteTableImperativeApi, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropFilterEditors, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, NumberFilterEditor, Scrollbars, StringFilterEditor, debounce, defaultFilterEditors, defaultFilterTypes, defaultFilterTypes as filterTypes, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteHeaderCell };
1897
+ declare const components: {
1898
+ CheckBox: typeof InfiniteCheckBox;
1899
+ LoadMask: (props: LoadMaskProps) => JSX.Element;
1900
+ };
1901
+
1902
+ export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropCellSelection, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropIsRowSelected, DataSourcePropLivePaginationCursor, DataSourcePropMultiRowSelectionChangeParamType, DataSourcePropOnCellSelectionChange, DataSourcePropOnRowSelectionChange, DataSourcePropOnRowSelectionChange_MultiRow, DataSourcePropOnRowSelectionChange_SingleRow, DataSourcePropPivotBy, DataSourcePropRowSelection, DataSourcePropRowSelection_MultiRow, DataSourcePropRowSelection_SingleRow, DataSourcePropSelectionMode, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnsMap, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableFilterEditorProps, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableImperativeApi, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropComponents, InfiniteTablePropFilterEditors, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, NumberFilterEditor, RowSelectionState, Scrollbars, StringFilterEditor, components, debounce, defaultFilterEditors, defaultFilterTypes, defaultFilterTypes as filterTypes, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteHeaderCell };