@infinite-table/infinite-react 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +27 -87
- package/README.md +12 -8
- package/index.css +1 -896
- package/index.d.ts +333 -244
- package/index.esm.css +1 -896
- package/index.esm.js +3 -15403
- package/index.js +3 -15239
- package/package.json +10 -2
package/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { CSSProperties, HTMLProps, RefCallback, MutableRefObject, MouseEvent, KeyboardEvent, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type SortDir = 1 | -1;
|
|
5
|
+
type MultisortInfo<T> = {
|
|
6
6
|
/**
|
|
7
7
|
* The sorting direction
|
|
8
8
|
*/
|
|
@@ -22,7 +22,7 @@ declare type MultisortInfo<T> = {
|
|
|
22
22
|
*/
|
|
23
23
|
valueGetter?: (item: T) => any;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
type MultisortInfoAllowMultipleFields<T> = Omit<MultisortInfo<T>, 'field'> & {
|
|
26
26
|
field?: keyof T | (keyof T)[];
|
|
27
27
|
};
|
|
28
28
|
declare const multisort: {
|
|
@@ -32,14 +32,14 @@ declare const multisort: {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
type VoidFn$1 = () => void;
|
|
36
|
+
type Pair<KeyType, ValueType> = {
|
|
37
37
|
value?: ValueType;
|
|
38
38
|
map?: Map<KeyType, Pair<KeyType, ValueType>>;
|
|
39
39
|
length: number;
|
|
40
40
|
revision?: number;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type DeepMapVisitFn<KeyType, ValueType> = (pair: Pair<KeyType, ValueType>, keys: KeyType[], next: VoidFn$1) => void;
|
|
43
43
|
declare class DeepMap<KeyType, ValueType> {
|
|
44
44
|
private map;
|
|
45
45
|
private length;
|
|
@@ -89,14 +89,37 @@ declare enum InfiniteTableActionType {
|
|
|
89
89
|
SET_DRAGGING_COLUMN_ID = 8
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
type InfiniteTableAction = {
|
|
93
93
|
type: InfiniteTableActionType;
|
|
94
94
|
payload?: any;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
type Renderable = React$1.ReactNode | JSX.Element;
|
|
98
98
|
|
|
99
|
-
declare function useInfiniteHeaderCell<T>():
|
|
99
|
+
declare function useInfiniteHeaderCell<T>(): {
|
|
100
|
+
dragging: boolean;
|
|
101
|
+
column: InfiniteTableComputedColumn<T>;
|
|
102
|
+
columnsMap: Map<string, InfiniteTableComputedColumn<T>>;
|
|
103
|
+
columnSortInfo: DataSourceSingleSortInfo<T> | null;
|
|
104
|
+
columnFilterValue: DataSourceFilterValueItem<T> | null;
|
|
105
|
+
selectionMode: DataSourcePropSelectionMode;
|
|
106
|
+
allRowsSelected: boolean;
|
|
107
|
+
someRowsSelected: boolean;
|
|
108
|
+
api: InfiniteTableApi<T>;
|
|
109
|
+
renderBag: {
|
|
110
|
+
all?: Renderable;
|
|
111
|
+
header: Renderable;
|
|
112
|
+
sortIcon?: Renderable;
|
|
113
|
+
menuIcon?: Renderable;
|
|
114
|
+
selectionCheckBox?: Renderable;
|
|
115
|
+
};
|
|
116
|
+
} & {
|
|
117
|
+
domRef: ((instance: HTMLElement | null) => void) | undefined;
|
|
118
|
+
insideColumnMenu: false;
|
|
119
|
+
} & {
|
|
120
|
+
domRef: ((instance: HTMLElement | null) => void) | undefined;
|
|
121
|
+
insideColumnMenu: false;
|
|
122
|
+
};
|
|
100
123
|
|
|
101
124
|
declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
|
|
102
125
|
|
|
@@ -115,7 +138,7 @@ interface Size {
|
|
|
115
138
|
height: number;
|
|
116
139
|
}
|
|
117
140
|
|
|
118
|
-
|
|
141
|
+
type InfiniteTableBaseCellProps<T> = {
|
|
119
142
|
column: InfiniteTableComputedColumn<T>;
|
|
120
143
|
rowId?: any;
|
|
121
144
|
renderChildren: () => Renderable;
|
|
@@ -130,23 +153,22 @@ declare type InfiniteTableBaseCellProps<T> = {
|
|
|
130
153
|
cssPosition?: CSSProperties['position'];
|
|
131
154
|
domRef?: React.RefCallback<HTMLElement>;
|
|
132
155
|
};
|
|
133
|
-
|
|
156
|
+
type InfiniteTableCellProps<T> = ({
|
|
134
157
|
cellType: 'header';
|
|
135
158
|
} & InfiniteTableBaseCellProps<T>) | ({
|
|
136
159
|
cellType: 'body';
|
|
137
160
|
} & InfiniteTableBaseCellProps<T>);
|
|
138
161
|
|
|
139
|
-
|
|
162
|
+
type DiscriminatedUnion<A, B> = (A & {
|
|
140
163
|
[K in keyof B]?: undefined;
|
|
141
164
|
}) | (B & {
|
|
142
165
|
[K in keyof A]?: undefined;
|
|
143
166
|
});
|
|
144
|
-
|
|
167
|
+
type KeyOfNoSymbol<T> = Exclude<keyof T, Symbol>;
|
|
145
168
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
169
|
+
type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
|
|
170
|
+
type InfiniteTableSelectRowFn = (id: any) => void;
|
|
171
|
+
type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
150
172
|
dragging: boolean;
|
|
151
173
|
column: COL_TYPE;
|
|
152
174
|
columnsMap: Map<string, COL_TYPE>;
|
|
@@ -157,18 +179,25 @@ declare type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableC
|
|
|
157
179
|
someRowsSelected: boolean;
|
|
158
180
|
api: InfiniteTableApi<DATA_TYPE>;
|
|
159
181
|
renderBag: {
|
|
182
|
+
all?: Renderable;
|
|
160
183
|
header: string | number | Renderable;
|
|
161
184
|
sortIcon?: Renderable;
|
|
162
185
|
menuIcon?: Renderable;
|
|
163
186
|
selectionCheckBox?: Renderable;
|
|
164
187
|
};
|
|
165
|
-
}
|
|
166
|
-
|
|
188
|
+
} & ({
|
|
189
|
+
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
190
|
+
insideColumnMenu: false;
|
|
191
|
+
} | {
|
|
192
|
+
insideColumnMenu: true;
|
|
193
|
+
});
|
|
194
|
+
type InfiniteTableColumnRenderBag = {
|
|
167
195
|
value: string | number | Renderable;
|
|
168
196
|
groupIcon?: Renderable;
|
|
197
|
+
all?: Renderable;
|
|
169
198
|
selectionCheckBox?: Renderable;
|
|
170
199
|
};
|
|
171
|
-
|
|
200
|
+
type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
172
201
|
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
173
202
|
value: string | number | Renderable;
|
|
174
203
|
renderBag: InfiniteTableColumnRenderBag;
|
|
@@ -193,50 +222,58 @@ declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTa
|
|
|
193
222
|
rootGroupBy: DataSourceState<DATA_TYPE>['groupBy'];
|
|
194
223
|
pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
|
|
195
224
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
225
|
+
type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
|
|
226
|
+
type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParam<DATA_TYPE> & {};
|
|
227
|
+
type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
|
|
228
|
+
type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
200
229
|
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
201
230
|
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
202
231
|
dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
|
|
203
232
|
rowIndex: number;
|
|
204
233
|
column: COL_TYPE;
|
|
205
234
|
};
|
|
206
|
-
|
|
235
|
+
type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
|
|
207
236
|
isGroupRow: true;
|
|
208
237
|
}) => Renderable | null;
|
|
209
|
-
|
|
238
|
+
type InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
|
|
210
239
|
isGroupRow: false;
|
|
211
240
|
}) => Renderable | null;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
241
|
+
type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
242
|
+
type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParam<T>) => Renderable;
|
|
243
|
+
type InfiniteTableColumnContentFocusable<T> = boolean | InfiniteTableColumnContentFocusableFn<T>;
|
|
244
|
+
type InfiniteTableColumnEditable<T> = boolean | InfiniteTableColumnEditableFn<T>;
|
|
245
|
+
type InfiniteTableColumnContentFocusableFn<T> = (params: InfiniteTableColumnContentFocusableParams<T>) => boolean;
|
|
246
|
+
type InfiniteTableColumnEditableFn<T> = (params: InfiniteTableColumnEditableParams<T>) => boolean;
|
|
247
|
+
type InfiniteTableColumnContentFocusableParams<T> = InfiniteTableColumnValueFormatterParams<T> & {
|
|
248
|
+
column: InfiniteTableComputedColumn<T>;
|
|
249
|
+
};
|
|
250
|
+
type InfiniteTableColumnEditableParams<T> = InfiniteTableColumnContentFocusableParams<T>;
|
|
251
|
+
type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
|
|
252
|
+
type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
|
|
253
|
+
type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
|
|
254
|
+
type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
|
|
255
|
+
type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
|
|
256
|
+
type InfiniteTableColumnStyleFnParams<T> = {
|
|
220
257
|
value: Renderable;
|
|
221
258
|
column: InfiniteTableComputedColumn<T>;
|
|
222
259
|
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
260
|
+
type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
|
|
261
|
+
type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
|
|
262
|
+
type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React.CSSProperties;
|
|
263
|
+
type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
|
|
264
|
+
type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
|
|
265
|
+
type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
|
|
266
|
+
type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
|
|
267
|
+
type InfiniteTableColumnHeaderClassName<T> = string | InfiniteTableColumnHeaderClassNameFn<T>;
|
|
268
|
+
type InfiniteTableColumnValueGetterParams<T> = {
|
|
232
269
|
data: T;
|
|
233
270
|
field?: keyof T;
|
|
234
271
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
272
|
+
type InfiniteTableColumnValueFormatterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
|
|
273
|
+
type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
|
|
274
|
+
type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
|
|
275
|
+
type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
|
|
276
|
+
type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
240
277
|
/**
|
|
241
278
|
* Defines a column in the table.
|
|
242
279
|
*
|
|
@@ -244,15 +281,18 @@ declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
|
244
281
|
*
|
|
245
282
|
* Can be bound to a field which is a `keyof DATA_TYPE`.
|
|
246
283
|
*/
|
|
247
|
-
|
|
284
|
+
type InfiniteTableColumn<DATA_TYPE> = {
|
|
248
285
|
sortable?: boolean;
|
|
249
286
|
draggable?: boolean;
|
|
250
287
|
resizable?: boolean;
|
|
288
|
+
contentFocusable?: InfiniteTableColumnContentFocusable<DATA_TYPE>;
|
|
289
|
+
editable?: InfiniteTableColumnEditable<DATA_TYPE>;
|
|
251
290
|
comparer?: InfiniteTableColumnComparer<DATA_TYPE>;
|
|
252
291
|
defaultHiddenWhenGroupedBy?: '*' | true | keyof DATA_TYPE | {
|
|
253
292
|
[k in keyof Partial<DATA_TYPE>]: true;
|
|
254
293
|
};
|
|
255
294
|
align?: InfiniteTableColumnAlign;
|
|
295
|
+
headerAlign?: InfiniteTableColumnAlign;
|
|
256
296
|
verticalAlign?: InfiniteTableColumnVerticalAlign;
|
|
257
297
|
columnGroup?: string;
|
|
258
298
|
header?: InfiniteTableColumnHeader<DATA_TYPE>;
|
|
@@ -291,12 +331,12 @@ declare type InfiniteTableColumn<DATA_TYPE> = {
|
|
|
291
331
|
HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
|
|
292
332
|
};
|
|
293
333
|
};
|
|
294
|
-
|
|
334
|
+
type InfiniteTableGeneratedGroupColumn<T> = Omit<InfiniteTableColumn<T>, 'sortable'> & {
|
|
295
335
|
groupByField: string | string[];
|
|
296
336
|
id?: string;
|
|
297
337
|
};
|
|
298
|
-
|
|
299
|
-
|
|
338
|
+
type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
|
|
339
|
+
type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
|
|
300
340
|
pivotBy: DataSourcePivotBy<DataType>[];
|
|
301
341
|
pivotTotalColumnGroup?: true;
|
|
302
342
|
pivotGroupKeys: KeyType[];
|
|
@@ -304,7 +344,7 @@ declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any =
|
|
|
304
344
|
pivotGroupKey: KeyType;
|
|
305
345
|
pivotIndex: number;
|
|
306
346
|
};
|
|
307
|
-
|
|
347
|
+
type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
|
|
308
348
|
pivotBy: DataSourcePivotBy<DataType>[];
|
|
309
349
|
pivotColumn: true;
|
|
310
350
|
pivotTotalColumn: boolean;
|
|
@@ -315,8 +355,8 @@ declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any>
|
|
|
315
355
|
pivotIndex: number;
|
|
316
356
|
pivotGroupKey: KeyType;
|
|
317
357
|
};
|
|
318
|
-
|
|
319
|
-
|
|
358
|
+
type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
|
|
359
|
+
type InfiniteTableComputedColumnBase<T> = {
|
|
320
360
|
computedFilterType: string;
|
|
321
361
|
computedSortType: string;
|
|
322
362
|
computedDataType: string;
|
|
@@ -351,8 +391,8 @@ declare type InfiniteTableComputedColumnBase<T> = {
|
|
|
351
391
|
colType: InfiniteTableColumnType<T>;
|
|
352
392
|
id: string;
|
|
353
393
|
};
|
|
354
|
-
|
|
355
|
-
|
|
394
|
+
type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
|
|
395
|
+
type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
|
|
356
396
|
|
|
357
397
|
interface LogFn {
|
|
358
398
|
(...args: any[]): LogFn;
|
|
@@ -368,21 +408,21 @@ interface ScrollPosition {
|
|
|
368
408
|
scrollTop: number;
|
|
369
409
|
scrollLeft: number;
|
|
370
410
|
}
|
|
371
|
-
|
|
411
|
+
type OnScrollFn = (scrollPosition: ScrollPosition) => void;
|
|
372
412
|
|
|
373
|
-
|
|
413
|
+
type VoidFn = () => void;
|
|
374
414
|
|
|
375
|
-
|
|
376
|
-
|
|
415
|
+
type FixedPosition = false | 'start' | 'end';
|
|
416
|
+
type SpanFunction = ({ rowIndex, colIndex, }: {
|
|
377
417
|
rowIndex: number;
|
|
378
418
|
colIndex: number;
|
|
379
419
|
}) => number;
|
|
380
|
-
|
|
420
|
+
type RenderRangeType = {
|
|
381
421
|
startIndex: number;
|
|
382
422
|
endIndex: number;
|
|
383
423
|
};
|
|
384
|
-
|
|
385
|
-
|
|
424
|
+
type ItemSizeFunction = (index: number) => number;
|
|
425
|
+
type MatrixBrainOptions = {
|
|
386
426
|
width: number;
|
|
387
427
|
height: number;
|
|
388
428
|
cols: number;
|
|
@@ -392,23 +432,23 @@ declare type MatrixBrainOptions = {
|
|
|
392
432
|
rowspan?: SpanFunction;
|
|
393
433
|
colspan?: SpanFunction;
|
|
394
434
|
};
|
|
395
|
-
|
|
435
|
+
type TableRenderRange = {
|
|
396
436
|
start: [number, number];
|
|
397
437
|
end: [number, number];
|
|
398
438
|
rowFixed?: FixedPosition;
|
|
399
439
|
colFixed?: FixedPosition;
|
|
400
440
|
};
|
|
401
|
-
|
|
441
|
+
type WhichDirection = {
|
|
402
442
|
horizontal?: boolean;
|
|
403
443
|
vertical?: boolean;
|
|
404
444
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
445
|
+
type FnOnRenderRangeChange = (range: TableRenderRange) => void;
|
|
446
|
+
type FnOnDirectionalRenderRangeChange = (range: [number, number]) => void;
|
|
447
|
+
type FnOnRenderCountChange = ({ horizontal, vertical, }: {
|
|
408
448
|
horizontal: number;
|
|
409
449
|
vertical: number;
|
|
410
450
|
}) => void;
|
|
411
|
-
|
|
451
|
+
type OnAvailableSizeChange = (size: Size) => void;
|
|
412
452
|
declare class MatrixBrain extends Logger {
|
|
413
453
|
private scrolling;
|
|
414
454
|
private width;
|
|
@@ -630,8 +670,8 @@ declare class MatrixBrain extends Logger {
|
|
|
630
670
|
destroy: () => void;
|
|
631
671
|
}
|
|
632
672
|
|
|
633
|
-
|
|
634
|
-
|
|
673
|
+
type RowSelectionStateItem = (any | any[])[];
|
|
674
|
+
type RowSelectionStateObject = {
|
|
635
675
|
selectedRows: RowSelectionStateItem;
|
|
636
676
|
deselectedRows: RowSelectionStateItem;
|
|
637
677
|
defaultSelection: boolean;
|
|
@@ -644,7 +684,7 @@ declare type RowSelectionStateObject = {
|
|
|
644
684
|
selectedRows: RowSelectionStateItem;
|
|
645
685
|
deselectedRows?: RowSelectionStateItem;
|
|
646
686
|
};
|
|
647
|
-
|
|
687
|
+
type RowSelectionStateConfig<T> = {
|
|
648
688
|
groupBy: DataSourceState<T>['groupBy'];
|
|
649
689
|
groupDeepMap: DataSourceState<T>['groupDeepMap'];
|
|
650
690
|
toPrimaryKey: DataSourceState<T>['toPrimaryKey'];
|
|
@@ -653,8 +693,8 @@ declare type RowSelectionStateConfig<T> = {
|
|
|
653
693
|
lazyLoad: boolean;
|
|
654
694
|
onlyUsePrimaryKeys: boolean;
|
|
655
695
|
};
|
|
656
|
-
|
|
657
|
-
|
|
696
|
+
type GetRowSelectionStateConfig<T> = () => RowSelectionStateConfig<T>;
|
|
697
|
+
type RowSelectionStateOverride = {
|
|
658
698
|
getGroupKeysForPrimaryKey: RowSelectionState<any>['getGroupKeysForPrimaryKey'];
|
|
659
699
|
getGroupByLength: RowSelectionState<any>['getGroupByLength'];
|
|
660
700
|
getGroupCount: RowSelectionState<any>['getGroupCount'];
|
|
@@ -738,7 +778,7 @@ declare class RowSelectionState<T = any> {
|
|
|
738
778
|
};
|
|
739
779
|
}
|
|
740
780
|
|
|
741
|
-
|
|
781
|
+
type MultiRowSelectorOptions = {
|
|
742
782
|
getIdForIndex: (index: number) => string | number;
|
|
743
783
|
};
|
|
744
784
|
declare class MultiRowSelector {
|
|
@@ -795,7 +835,7 @@ interface InfiniteTableComputedValues<T> {
|
|
|
795
835
|
columnSize: (colIndex: number) => number;
|
|
796
836
|
}
|
|
797
837
|
|
|
798
|
-
|
|
838
|
+
type TableRenderCellFnParam = {
|
|
799
839
|
domRef: RefCallback<HTMLElement>;
|
|
800
840
|
rowIndex: number;
|
|
801
841
|
colIndex: number;
|
|
@@ -811,7 +851,7 @@ declare type TableRenderCellFnParam = {
|
|
|
811
851
|
onMouseEnter: VoidFunction;
|
|
812
852
|
onMouseLeave: VoidFunction;
|
|
813
853
|
};
|
|
814
|
-
|
|
854
|
+
type TableRenderCellFn = (param: TableRenderCellFnParam) => Renderable;
|
|
815
855
|
declare class ReactHeadlessTableRenderer extends Logger {
|
|
816
856
|
private brain;
|
|
817
857
|
private destroyed;
|
|
@@ -887,36 +927,36 @@ declare class ReactHeadlessTableRenderer extends Logger {
|
|
|
887
927
|
reset(): void;
|
|
888
928
|
}
|
|
889
929
|
|
|
890
|
-
|
|
930
|
+
type ComponentStateContext<T_STATE, T_ACTIONS> = {
|
|
891
931
|
getComponentState: () => T_STATE;
|
|
892
932
|
componentState: T_STATE;
|
|
893
933
|
componentActions: T_ACTIONS;
|
|
894
934
|
};
|
|
895
|
-
|
|
935
|
+
type ComponentStateGeneratedActions<T_STATE> = {
|
|
896
936
|
[k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
|
|
897
937
|
};
|
|
898
|
-
|
|
938
|
+
type ComponentInterceptedActions<T_STATE> = {
|
|
899
939
|
[k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
|
|
900
940
|
actions: ComponentStateGeneratedActions<T_STATE>;
|
|
901
941
|
state: T_STATE;
|
|
902
942
|
}) => void | boolean;
|
|
903
943
|
};
|
|
904
|
-
|
|
944
|
+
type ComponentMappedCallbacks<T_STATE> = {
|
|
905
945
|
[k in keyof T_STATE]: (value: T_STATE[k], state: T_STATE) => {
|
|
906
946
|
callbackName: string;
|
|
907
947
|
callbackParams: any[];
|
|
908
948
|
};
|
|
909
949
|
};
|
|
910
|
-
|
|
950
|
+
type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
|
|
911
951
|
|
|
912
|
-
|
|
952
|
+
type CellPosition = {
|
|
913
953
|
rowIndex: number;
|
|
914
954
|
colIndex: number;
|
|
915
955
|
};
|
|
916
956
|
|
|
917
|
-
|
|
957
|
+
type NonUndefined<T> = T extends undefined ? never : T;
|
|
918
958
|
|
|
919
|
-
|
|
959
|
+
type SubscriptionCallbackOnChangeFn<T> = (node: T | null) => void;
|
|
920
960
|
interface SubscriptionCallback<T> {
|
|
921
961
|
(node: T, callback?: () => void): void;
|
|
922
962
|
get: () => T | null;
|
|
@@ -936,12 +976,14 @@ declare class ScrollListener {
|
|
|
936
976
|
|
|
937
977
|
interface InfiniteTableSetupState<T> {
|
|
938
978
|
renderer: ReactHeadlessTableRenderer;
|
|
979
|
+
getDOMNodeForCell: (cellPos: CellPosition) => HTMLElement | null;
|
|
939
980
|
onRenderUpdater: SubscriptionCallback<Renderable>;
|
|
940
981
|
propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
|
|
941
982
|
columnsWhenInlineGroupRenderStrategy?: Map<string, InfiniteTableColumn<T>>;
|
|
942
983
|
domRef: MutableRefObject<HTMLDivElement | null>;
|
|
943
984
|
scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
944
985
|
portalDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
986
|
+
focusDetectDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
945
987
|
activeCellIndicatorDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
946
988
|
onRowHeightCSSVarChange: SubscriptionCallback<number>;
|
|
947
989
|
onColumnMenuClick: SubscriptionCallback<{
|
|
@@ -970,15 +1012,17 @@ interface InfiniteTableSetupState<T> {
|
|
|
970
1012
|
pinnedStartScrollListener: ScrollListener;
|
|
971
1013
|
pinnedEndScrollListener: ScrollListener;
|
|
972
1014
|
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1015
|
+
type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
|
|
1016
|
+
type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
|
|
1017
|
+
type InfiniteTablePropPivotGrandTotalColumnPosition = InfiniteTablePropPivotTotalColumnPosition;
|
|
976
1018
|
interface InfiniteTableMappedState<T> {
|
|
977
1019
|
id: InfiniteTableProps<T>['id'];
|
|
978
1020
|
scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
|
|
979
1021
|
viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
|
|
980
1022
|
resizableColumns: InfiniteTableProps<T>['resizableColumns'];
|
|
981
1023
|
groupColumn: InfiniteTableProps<T>['groupColumn'];
|
|
1024
|
+
onKeyDown: InfiniteTableProps<T>['onKeyDown'];
|
|
1025
|
+
onCellClick: InfiniteTableProps<T>['onCellClick'];
|
|
982
1026
|
headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
|
|
983
1027
|
onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
|
|
984
1028
|
getColumContextMenuItems: InfiniteTableProps<T>['getColumContextMenuItems'];
|
|
@@ -1053,7 +1097,7 @@ interface InfiniteTableDerivedState<T> {
|
|
|
1053
1097
|
columnHeaderHeightCSSVar: string;
|
|
1054
1098
|
controlledColumnVisibility: boolean;
|
|
1055
1099
|
}
|
|
1056
|
-
|
|
1100
|
+
type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
|
|
1057
1101
|
interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
|
|
1058
1102
|
}
|
|
1059
1103
|
|
|
@@ -1064,22 +1108,23 @@ interface InfiniteTableContextValue<T> {
|
|
|
1064
1108
|
computed: InfiniteTableComputedValues<T>;
|
|
1065
1109
|
getComputed: () => InfiniteTableComputedValues<T>;
|
|
1066
1110
|
getState: () => InfiniteTableState<T>;
|
|
1111
|
+
getDataSourceState: () => DataSourceState<T>;
|
|
1067
1112
|
}
|
|
1068
1113
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1114
|
+
type GroupKeyType$1<T extends any = any> = T;
|
|
1115
|
+
type GroupBy<DataType, KeyType> = {
|
|
1071
1116
|
field: KeyOfNoSymbol<DataType>;
|
|
1072
1117
|
toKey?: (value: any, data: DataType) => GroupKeyType$1<KeyType>;
|
|
1073
1118
|
column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
|
|
1074
1119
|
};
|
|
1075
1120
|
|
|
1076
|
-
|
|
1121
|
+
type RenderRange = {
|
|
1077
1122
|
renderStartIndex: number;
|
|
1078
1123
|
renderEndIndex: number;
|
|
1079
1124
|
};
|
|
1080
1125
|
|
|
1081
|
-
|
|
1082
|
-
|
|
1126
|
+
type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
|
|
1127
|
+
type BooleanDeepCollectionStateObject<KeyType> = {
|
|
1083
1128
|
positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
|
|
1084
1129
|
negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
|
|
1085
1130
|
};
|
|
@@ -1149,16 +1194,16 @@ interface DataSourceDataParams<T> {
|
|
|
1149
1194
|
__cursorId?: DataSourceSetupState<T>['cursorId'];
|
|
1150
1195
|
changes?: DataSourceDataParamsChanges<T>;
|
|
1151
1196
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1197
|
+
type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
|
|
1198
|
+
type DataSourceSingleSortInfo<T> = Omit<MultisortInfo<T>, 'field'> & {
|
|
1154
1199
|
field?: keyof T | (keyof T)[];
|
|
1155
1200
|
id?: string;
|
|
1156
1201
|
};
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1202
|
+
type DataSourceGroupBy<T> = GroupBy<T, any>;
|
|
1203
|
+
type DataSourcePivotBy<T> = PivotBy<T, any>;
|
|
1204
|
+
type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
|
|
1205
|
+
type DataSourcePropSortInfo<T> = DataSourceSortInfo<T>;
|
|
1206
|
+
type DataSourceRemoteData<T> = {
|
|
1162
1207
|
data: T[] | LazyGroupDataItem<T>[];
|
|
1163
1208
|
mappings?: DataSourceMappings;
|
|
1164
1209
|
cache?: boolean;
|
|
@@ -1167,18 +1212,19 @@ declare type DataSourceRemoteData<T> = {
|
|
|
1167
1212
|
totalCountUnfiltered?: number;
|
|
1168
1213
|
livePaginationCursor?: DataSourceLivePaginationCursorValue;
|
|
1169
1214
|
};
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1215
|
+
type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
|
|
1216
|
+
type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
|
|
1217
|
+
type DataSourcePropGroupRowsStateObject<KeyType> = {
|
|
1173
1218
|
expandedRows: DataSourceGroupRowsList<KeyType>;
|
|
1174
1219
|
collapsedRows: DataSourceGroupRowsList<KeyType>;
|
|
1175
1220
|
};
|
|
1176
|
-
|
|
1177
|
-
|
|
1221
|
+
type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
|
|
1222
|
+
type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
|
|
1178
1223
|
interface DataSourceMappedState<T> {
|
|
1179
1224
|
aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
|
|
1180
1225
|
livePagination: DataSourceProps<T>['livePagination'];
|
|
1181
1226
|
isRowSelected: DataSourceProps<T>['isRowSelected'];
|
|
1227
|
+
onDataArrayChange: DataSourceProps<T>['onDataArrayChange'];
|
|
1182
1228
|
lazyLoad: DataSourceProps<T>['lazyLoad'];
|
|
1183
1229
|
useGroupKeysForMultiRowSelection: NonUndefined<DataSourceProps<T>['useGroupKeysForMultiRowSelection']>;
|
|
1184
1230
|
onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
|
|
@@ -1196,7 +1242,7 @@ interface DataSourceMappedState<T> {
|
|
|
1196
1242
|
collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
|
|
1197
1243
|
sortInfo: DataSourceSingleSortInfo<T>[] | null;
|
|
1198
1244
|
}
|
|
1199
|
-
|
|
1245
|
+
type DataSourceAggregationReducer<T, AggregationResultType> = {
|
|
1200
1246
|
name?: string;
|
|
1201
1247
|
field?: keyof T;
|
|
1202
1248
|
initialValue?: AggregationResultType;
|
|
@@ -1207,11 +1253,11 @@ declare type DataSourceAggregationReducer<T, AggregationResultType> = {
|
|
|
1207
1253
|
column: InfiniteTablePivotFinalColumnVariant<T>;
|
|
1208
1254
|
}) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
|
|
1209
1255
|
};
|
|
1210
|
-
|
|
1256
|
+
type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
|
|
1211
1257
|
inheritFromColumn?: string | boolean;
|
|
1212
1258
|
};
|
|
1213
|
-
|
|
1214
|
-
|
|
1259
|
+
type DataSourceMappings = Record<'totals' | 'values', string>;
|
|
1260
|
+
type LazyGroupDataItem<DataType> = {
|
|
1215
1261
|
data: Partial<DataType>;
|
|
1216
1262
|
keys: any[];
|
|
1217
1263
|
aggregations?: Record<string, any>;
|
|
@@ -1222,7 +1268,7 @@ declare type LazyGroupDataItem<DataType> = {
|
|
|
1222
1268
|
totals?: Record<string, any>;
|
|
1223
1269
|
};
|
|
1224
1270
|
};
|
|
1225
|
-
|
|
1271
|
+
type LazyRowInfoGroup<DataType> = {
|
|
1226
1272
|
/**
|
|
1227
1273
|
* Those are direct children of the current lazy group row
|
|
1228
1274
|
*/
|
|
@@ -1234,11 +1280,13 @@ declare type LazyRowInfoGroup<DataType> = {
|
|
|
1234
1280
|
totalCountUnfiltered: number;
|
|
1235
1281
|
error?: string;
|
|
1236
1282
|
};
|
|
1237
|
-
|
|
1283
|
+
type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
|
|
1238
1284
|
interface DataSourceSetupState<T> {
|
|
1239
1285
|
indexer: Indexer<T, any>;
|
|
1240
1286
|
unfilteredCount: number;
|
|
1241
1287
|
filteredCount: number;
|
|
1288
|
+
originalDataArrayChanged: boolean;
|
|
1289
|
+
originalDataArrayChangedAt: number;
|
|
1242
1290
|
lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
|
|
1243
1291
|
pivotMappings?: DataSourceMappings;
|
|
1244
1292
|
propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
|
|
@@ -1275,19 +1323,19 @@ interface DataSourceSetupState<T> {
|
|
|
1275
1323
|
pivotColumns?: Map<string, InfiniteTableColumn<T>>;
|
|
1276
1324
|
pivotColumnGroups?: Map<string, InfiniteTableColumnGroup>;
|
|
1277
1325
|
}
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1326
|
+
type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
|
|
1327
|
+
type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
|
|
1328
|
+
type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
|
|
1329
|
+
type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
|
|
1330
|
+
type DataSourcePropRowSelection_SingleRow = null | string | number;
|
|
1331
|
+
type DataSourcePropCellSelection = any;
|
|
1332
|
+
type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
|
|
1333
|
+
type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
|
|
1334
|
+
type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
|
|
1335
|
+
type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
|
|
1336
|
+
type DataSourcePropOnCellSelectionChange = (cellSelectionParams: any) => void;
|
|
1337
|
+
type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelectionState: RowSelectionState, selectionMode: 'multi-row') => boolean | null;
|
|
1338
|
+
type DataSourceProps<T> = {
|
|
1291
1339
|
children: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
|
|
1292
1340
|
primaryKey: keyof T | ((data: T) => string);
|
|
1293
1341
|
fields?: (keyof T)[];
|
|
@@ -1322,6 +1370,7 @@ declare type DataSourceProps<T> = {
|
|
|
1322
1370
|
defaultSortInfo?: DataSourceSortInfo<T>;
|
|
1323
1371
|
onSortInfoChange?: ((sortInfo: DataSourceSingleSortInfo<T> | null) => void) | ((sortInfo: DataSourceSingleSortInfo<T>[]) => void);
|
|
1324
1372
|
onDataParamsChange?: (dataParamsChange: DataSourceDataParams<T>) => void;
|
|
1373
|
+
onDataArrayChange?: (dataArray: DataSourceState<T>['originalDataArray']) => void;
|
|
1325
1374
|
livePagination?: boolean;
|
|
1326
1375
|
livePaginationCursor?: DataSourcePropLivePaginationCursor<T>;
|
|
1327
1376
|
onLivePaginationCursorChange?: (livePaginationCursor: DataSourceLivePaginationCursorValue) => void;
|
|
@@ -1351,17 +1400,17 @@ declare type DataSourceProps<T> = {
|
|
|
1351
1400
|
} | {
|
|
1352
1401
|
selectionMode?: false;
|
|
1353
1402
|
});
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1403
|
+
type DataSourcePropSortTypes = Record<string, (first: any, second: any) => number>;
|
|
1404
|
+
type DataSourcePropFilterTypes<T> = Record<string, DataSourceFilterType<T>>;
|
|
1405
|
+
type DataSourceFilterFunctionParam<T> = {
|
|
1357
1406
|
data: T;
|
|
1358
1407
|
index: number;
|
|
1359
1408
|
dataArray: T[];
|
|
1360
1409
|
primaryKey: any;
|
|
1361
1410
|
};
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1411
|
+
type DataSourcePropFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T>) => boolean;
|
|
1412
|
+
type DataSourcePropFilterValue<T> = DataSourceFilterValueItem<T>[];
|
|
1413
|
+
type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
|
|
1365
1414
|
field: keyof T;
|
|
1366
1415
|
}, {
|
|
1367
1416
|
id: string;
|
|
@@ -1372,35 +1421,35 @@ declare type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
|
|
|
1372
1421
|
filterType: string;
|
|
1373
1422
|
operator: string;
|
|
1374
1423
|
};
|
|
1375
|
-
|
|
1376
|
-
|
|
1424
|
+
type DataSourceFilterValueItemValueGetter<T> = (param: DataSourceFilterFunctionParam<T>) => any;
|
|
1425
|
+
type DataSourceFilterType<T> = {
|
|
1377
1426
|
emptyValues: Set<any>;
|
|
1378
1427
|
label?: string;
|
|
1379
1428
|
defaultOperator: string;
|
|
1380
1429
|
operators: DataSourceFilterOperator<T>[];
|
|
1381
1430
|
};
|
|
1382
|
-
|
|
1431
|
+
type DataSourceFilterOperator<T> = {
|
|
1383
1432
|
name: string;
|
|
1384
1433
|
label?: string;
|
|
1385
1434
|
fn: DataSourceFilterOperatorFunction<T>;
|
|
1386
1435
|
};
|
|
1387
|
-
|
|
1388
|
-
|
|
1436
|
+
type DataSourceFilterOperatorFunction<T> = (filterOperatorFunctionParam: DataSourceFilterOperatorFunctionParam<T>) => boolean;
|
|
1437
|
+
type DataSourceFilterOperatorFunctionParam<T> = {
|
|
1389
1438
|
currentValue: any;
|
|
1390
1439
|
filterValue: any;
|
|
1391
1440
|
emptyValues: Set<any>;
|
|
1392
1441
|
} & DataSourceFilterFunctionParam<T>;
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1442
|
+
type DataSourcePropLivePaginationCursor<T> = DataSourceLivePaginationCursorValue | DataSourceLivePaginationCursorFn<T>;
|
|
1443
|
+
type DataSourceLivePaginationCursorFn<T> = (params: DataSourceLivePaginationCursorParams<T>) => DataSourceLivePaginationCursorValue;
|
|
1444
|
+
type DataSourceLivePaginationCursorParams<T> = {
|
|
1396
1445
|
array: T[];
|
|
1397
1446
|
lastItem: T | Partial<T> | null;
|
|
1398
1447
|
length: number;
|
|
1399
1448
|
};
|
|
1400
|
-
|
|
1449
|
+
type DataSourceLivePaginationCursorValue = string | number | null;
|
|
1401
1450
|
interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedState<T>, DataSourceMappedState<T> {
|
|
1402
1451
|
}
|
|
1403
|
-
|
|
1452
|
+
type DataSourceDerivedState<T> = {
|
|
1404
1453
|
toPrimaryKey: (data: T) => any;
|
|
1405
1454
|
operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
|
|
1406
1455
|
filterMode: NonUndefined<DataSourceProps<T>['filterMode']>;
|
|
@@ -1413,7 +1462,7 @@ declare type DataSourceDerivedState<T> = {
|
|
|
1413
1462
|
rowSelection: RowSelectionState | null | number | string;
|
|
1414
1463
|
selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
|
|
1415
1464
|
};
|
|
1416
|
-
|
|
1465
|
+
type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
|
|
1417
1466
|
interface DataSourceContextValue<T> {
|
|
1418
1467
|
getState: () => DataSourceState<T>;
|
|
1419
1468
|
componentState: DataSourceState<T>;
|
|
@@ -1436,10 +1485,10 @@ declare function useDataSource<T>(): DataSourceState<T>;
|
|
|
1436
1485
|
|
|
1437
1486
|
declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
|
|
1438
1487
|
|
|
1439
|
-
|
|
1488
|
+
type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
|
|
1440
1489
|
id: string;
|
|
1441
1490
|
};
|
|
1442
|
-
|
|
1491
|
+
type AggregationReducerResult<AggregationResultType extends any = any> = AggregationResultType;
|
|
1443
1492
|
/**
|
|
1444
1493
|
* InfiniteTableRowInfo can have different object shape depending on the presence or absence of grouping.
|
|
1445
1494
|
*
|
|
@@ -1448,8 +1497,8 @@ declare type AggregationReducerResult<AggregationResultType extends any = any> =
|
|
|
1448
1497
|
* you can use `isGroupRow: boolean` to discriminate between group rows vs normal rows.
|
|
1449
1498
|
*
|
|
1450
1499
|
*/
|
|
1451
|
-
|
|
1452
|
-
|
|
1500
|
+
type InfiniteTableRowInfo<T> = InfiniteTable_HasGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoGroup<T> | InfiniteTable_NoGrouping_RowInfoNormal<T>;
|
|
1501
|
+
type InfiniteTableRowInfoDataDiscriminator_RowInfoNormal<T> = {
|
|
1453
1502
|
data: T;
|
|
1454
1503
|
isGroupRow: false;
|
|
1455
1504
|
rowActive: boolean;
|
|
@@ -1458,7 +1507,7 @@ declare type InfiniteTableRowInfoDataDiscriminator_RowInfoNormal<T> = {
|
|
|
1458
1507
|
value: any;
|
|
1459
1508
|
rowSelected: boolean | null;
|
|
1460
1509
|
};
|
|
1461
|
-
|
|
1510
|
+
type InfiniteTableRowInfoDataDiscriminator_RowInfoGroup<T> = {
|
|
1462
1511
|
rowActive: boolean;
|
|
1463
1512
|
data: Partial<T> | null;
|
|
1464
1513
|
rowInfo: InfiniteTable_HasGrouping_RowInfoGroup<T>;
|
|
@@ -1467,24 +1516,24 @@ declare type InfiniteTableRowInfoDataDiscriminator_RowInfoGroup<T> = {
|
|
|
1467
1516
|
value: any;
|
|
1468
1517
|
rowSelected: boolean | null;
|
|
1469
1518
|
};
|
|
1470
|
-
|
|
1519
|
+
type InfiniteTableRowInfoDataDiscriminator<T> = InfiniteTableRowInfoDataDiscriminator_RowInfoNormal<T> | InfiniteTableRowInfoDataDiscriminator_RowInfoGroup<T>;
|
|
1471
1520
|
/**
|
|
1472
1521
|
* This is the base row info for all scenarios - things every
|
|
1473
1522
|
* rowInfo is guaranteed to have (be it group or normal row, or dataSource with or without grouping)
|
|
1474
1523
|
*
|
|
1475
1524
|
*/
|
|
1476
|
-
|
|
1525
|
+
type InfiniteTable_RowInfoBase<_T> = {
|
|
1477
1526
|
id: any;
|
|
1478
1527
|
value?: any;
|
|
1479
1528
|
indexInAll: number;
|
|
1480
1529
|
rowSelected: boolean | null;
|
|
1481
1530
|
};
|
|
1482
|
-
|
|
1531
|
+
type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
|
|
1483
1532
|
dataSourceHasGrouping: true;
|
|
1484
1533
|
data: T;
|
|
1485
1534
|
isGroupRow: false;
|
|
1486
1535
|
} & InfiniteTable_HasGrouping_RowInfoBase<T> & InfiniteTable_RowInfoBase<T>;
|
|
1487
|
-
|
|
1536
|
+
type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
|
|
1488
1537
|
dataSourceHasGrouping: true;
|
|
1489
1538
|
data: Partial<T> | null;
|
|
1490
1539
|
isGroupRow: true;
|
|
@@ -1562,13 +1611,13 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
|
|
|
1562
1611
|
*/
|
|
1563
1612
|
childrenLoading: boolean;
|
|
1564
1613
|
} & InfiniteTable_HasGrouping_RowInfoBase<T> & InfiniteTable_RowInfoBase<T>;
|
|
1565
|
-
|
|
1614
|
+
type InfiniteTable_NoGrouping_RowInfoNormal<T> = {
|
|
1566
1615
|
dataSourceHasGrouping: false;
|
|
1567
1616
|
data: T;
|
|
1568
1617
|
isGroupRow: false;
|
|
1569
1618
|
selfLoaded: boolean;
|
|
1570
1619
|
} & InfiniteTable_RowInfoBase<T>;
|
|
1571
|
-
|
|
1620
|
+
type InfiniteTable_HasGrouping_RowInfoBase<T> = {
|
|
1572
1621
|
indexInGroup: number;
|
|
1573
1622
|
/**
|
|
1574
1623
|
* Available on all rowInfo objects when the datasource is grouped, otherwise, it will be undefined.
|
|
@@ -1656,14 +1705,14 @@ declare type InfiniteTable_HasGrouping_RowInfoBase<T> = {
|
|
|
1656
1705
|
*/
|
|
1657
1706
|
selfLoaded: boolean;
|
|
1658
1707
|
};
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1708
|
+
type GroupKeyType<T extends any = any> = T;
|
|
1709
|
+
type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
|
|
1710
|
+
type PivotGroupValueType<DataType, KeyType> = {
|
|
1662
1711
|
reducerResults: PivotReducerResults<KeyType>;
|
|
1663
1712
|
items: DataType[];
|
|
1664
1713
|
};
|
|
1665
|
-
|
|
1666
|
-
|
|
1714
|
+
type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
|
|
1715
|
+
type DeepMapGroupValueType<DataType, KeyType> = {
|
|
1667
1716
|
/**
|
|
1668
1717
|
* These are leaf items. This array may be empty when there is batched lazy loading
|
|
1669
1718
|
*/
|
|
@@ -1677,7 +1726,7 @@ declare type DeepMapGroupValueType<DataType, KeyType> = {
|
|
|
1677
1726
|
reducerResults: Record<string, AggregationReducerResult>;
|
|
1678
1727
|
pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
|
|
1679
1728
|
};
|
|
1680
|
-
|
|
1729
|
+
type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
|
|
1681
1730
|
column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
|
|
1682
1731
|
column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
|
|
1683
1732
|
}) => Partial<InfiniteTablePivotColumn<DataType>>);
|
|
@@ -1685,13 +1734,13 @@ declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'colu
|
|
|
1685
1734
|
columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
|
|
1686
1735
|
}) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
|
|
1687
1736
|
};
|
|
1688
|
-
|
|
1737
|
+
type GroupParams<DataType, KeyType> = {
|
|
1689
1738
|
groupBy: GroupBy<DataType, KeyType>[];
|
|
1690
1739
|
defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
|
|
1691
1740
|
pivot?: PivotBy<DataType, KeyType>[];
|
|
1692
1741
|
reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
|
|
1693
1742
|
};
|
|
1694
|
-
|
|
1743
|
+
type DataGroupResult<DataType, KeyType extends any> = {
|
|
1695
1744
|
deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
|
|
1696
1745
|
groupParams: GroupParams<DataType, KeyType>;
|
|
1697
1746
|
initialData: DataType[];
|
|
@@ -1702,8 +1751,8 @@ declare type DataGroupResult<DataType, KeyType extends any> = {
|
|
|
1702
1751
|
declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
|
|
1703
1752
|
declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
|
|
1704
1753
|
|
|
1705
|
-
|
|
1706
|
-
|
|
1754
|
+
type InfiniteCheckBoxPropChecked = true | false | null;
|
|
1755
|
+
type InfiniteCheckBoxProps = {
|
|
1707
1756
|
disabled?: boolean;
|
|
1708
1757
|
checked?: InfiniteCheckBoxPropChecked;
|
|
1709
1758
|
defaultChecked?: InfiniteCheckBoxPropChecked;
|
|
@@ -1712,8 +1761,8 @@ declare type InfiniteCheckBoxProps = {
|
|
|
1712
1761
|
};
|
|
1713
1762
|
declare function InfiniteCheckBox(props: InfiniteCheckBoxProps): JSX.Element;
|
|
1714
1763
|
|
|
1715
|
-
|
|
1716
|
-
|
|
1764
|
+
type ArrayOfIds = Pick<InfiniteTable_RowInfoBase<any>, 'id'>[];
|
|
1765
|
+
type InfiniteTableSelectionApi = {
|
|
1717
1766
|
get allRowsSelected(): boolean;
|
|
1718
1767
|
isRowSelected(pk: any, groupKeys?: any[]): boolean;
|
|
1719
1768
|
isRowDeselected(pk: any, groupKeys?: any[]): boolean;
|
|
@@ -1729,41 +1778,41 @@ declare type InfiniteTableSelectionApi = {
|
|
|
1729
1778
|
deselectAll(): void;
|
|
1730
1779
|
};
|
|
1731
1780
|
|
|
1732
|
-
|
|
1781
|
+
type PointCoords = {
|
|
1733
1782
|
top: number;
|
|
1734
1783
|
left: number;
|
|
1735
1784
|
};
|
|
1736
1785
|
|
|
1737
|
-
|
|
1786
|
+
type CoordsWithSize = {
|
|
1738
1787
|
width: number;
|
|
1739
1788
|
height: number;
|
|
1740
1789
|
left: number;
|
|
1741
1790
|
top: number;
|
|
1742
1791
|
};
|
|
1743
|
-
|
|
1792
|
+
type CoordsNoSize = {
|
|
1744
1793
|
right: number;
|
|
1745
1794
|
bottom: number;
|
|
1746
1795
|
left: number;
|
|
1747
1796
|
top: number;
|
|
1748
1797
|
};
|
|
1749
|
-
|
|
1798
|
+
type RectangleCoords = CoordsWithSize | CoordsNoSize;
|
|
1750
1799
|
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1800
|
+
type Alignable = RectangleCoords | HTMLElement | DOMRect;
|
|
1801
|
+
type AlignPositionEnum = 'TopLeft' | 'TopCenter' | 'TopRight' | 'CenterRight' | 'BottomRight' | 'BottomCenter' | 'BottomLeft' | 'CenterLeft' | 'Center';
|
|
1802
|
+
type AlignPositionItem = [AlignPositionEnum, AlignPositionEnum];
|
|
1803
|
+
type AlignPositionOptions = {
|
|
1755
1804
|
alignPosition: AlignPositionItem[];
|
|
1756
1805
|
constrainTo?: Alignable;
|
|
1757
1806
|
alignAnchor: Alignable;
|
|
1758
1807
|
alignTarget: Alignable;
|
|
1759
1808
|
};
|
|
1760
1809
|
|
|
1761
|
-
|
|
1810
|
+
type OverlayParams = {
|
|
1762
1811
|
portalContainer?: ElementContainerGetter | null | false;
|
|
1763
1812
|
constrainTo?: OverlayShowParams['constrainTo'];
|
|
1764
1813
|
};
|
|
1765
|
-
|
|
1766
|
-
|
|
1814
|
+
type ElementContainerGetter = (() => HTMLElement | string | Promise<HTMLElement | string>) | string | HTMLElement | Promise<HTMLElement | string>;
|
|
1815
|
+
type AdvancedAlignable = Alignable | ElementContainerGetter;
|
|
1767
1816
|
/**
|
|
1768
1817
|
* If portal container is given, it will create a React portal from that element
|
|
1769
1818
|
* otherwise it will simply render another node as portal
|
|
@@ -1771,7 +1820,7 @@ declare type AdvancedAlignable = Alignable | ElementContainerGetter;
|
|
|
1771
1820
|
* @param portalContainer
|
|
1772
1821
|
*/
|
|
1773
1822
|
declare function useOverlayPortal(content: ReactNode, portalContainer?: ElementContainerGetter | null | false): string | number | boolean | JSX.Element | React$1.ReactFragment | null | undefined;
|
|
1774
|
-
|
|
1823
|
+
type OverlayShowParams = {
|
|
1775
1824
|
id?: string | number;
|
|
1776
1825
|
constrainTo?: AdvancedAlignable | boolean;
|
|
1777
1826
|
alignPosition: AlignPositionOptions['alignPosition'];
|
|
@@ -1800,9 +1849,9 @@ we don't want to allow the above `y` as a valid declaration
|
|
|
1800
1849
|
it breaks some types in the Menu component as well
|
|
1801
1850
|
|
|
1802
1851
|
*/
|
|
1803
|
-
|
|
1852
|
+
type RemoveObject<T> = T extends null | undefined ? T : T extends unknown ? keyof T extends never ? never : T : never;
|
|
1804
1853
|
|
|
1805
|
-
|
|
1854
|
+
type MenuSetupState = {
|
|
1806
1855
|
domRef: MutableRefObject<HTMLDivElement | null>;
|
|
1807
1856
|
keyboardActiveItemKey: string | null;
|
|
1808
1857
|
activeItemKey: string | null;
|
|
@@ -1810,13 +1859,13 @@ declare type MenuSetupState = {
|
|
|
1810
1859
|
focused: boolean;
|
|
1811
1860
|
destroyed: boolean;
|
|
1812
1861
|
};
|
|
1813
|
-
|
|
1862
|
+
type MenuDerivedState = {
|
|
1814
1863
|
runtimeItems: MenuRuntimeItem[];
|
|
1815
1864
|
runtimeSelectableItems: MenuRuntimeItemSelectable[];
|
|
1816
1865
|
columns: MenuColumn[];
|
|
1817
1866
|
menuId: string;
|
|
1818
1867
|
};
|
|
1819
|
-
|
|
1868
|
+
type MenuMappedState = {
|
|
1820
1869
|
parentMenuId: MenuProps['parentMenuId'];
|
|
1821
1870
|
parentMenuItemKey: MenuProps['parentMenuItemKey'];
|
|
1822
1871
|
constrainTo: MenuProps['constrainTo'];
|
|
@@ -1829,14 +1878,14 @@ declare type MenuMappedState = {
|
|
|
1829
1878
|
};
|
|
1830
1879
|
interface MenuState extends MenuMappedState, MenuDerivedState, MenuSetupState {
|
|
1831
1880
|
}
|
|
1832
|
-
|
|
1881
|
+
type MenuApi = {
|
|
1833
1882
|
focus: VoidFunction;
|
|
1834
1883
|
getMenuId: () => string;
|
|
1835
1884
|
getParentMenuId: () => string | undefined;
|
|
1836
1885
|
};
|
|
1837
1886
|
|
|
1838
|
-
|
|
1839
|
-
|
|
1887
|
+
type MenuRenderable = string | number | RemoveObject<Renderable>;
|
|
1888
|
+
type MenuRuntimeItemSelectable = {
|
|
1840
1889
|
type: 'item';
|
|
1841
1890
|
key: string;
|
|
1842
1891
|
parentMenuId: string;
|
|
@@ -1850,18 +1899,18 @@ declare type MenuRuntimeItemSelectable = {
|
|
|
1850
1899
|
menu: MenuProps | (() => MenuProps) | null;
|
|
1851
1900
|
originalMenuItem: MenuItemObject;
|
|
1852
1901
|
};
|
|
1853
|
-
|
|
1902
|
+
type MenuRuntimeItem = MenuRuntimeItemSelectable | {
|
|
1854
1903
|
type: 'decoration';
|
|
1855
1904
|
value: MenuDecoration;
|
|
1856
1905
|
style: CSSProperties;
|
|
1857
1906
|
span: number;
|
|
1858
1907
|
};
|
|
1859
|
-
|
|
1908
|
+
type MenuChildrenFnParam = {
|
|
1860
1909
|
item: MenuRuntimeItem;
|
|
1861
1910
|
column: MenuColumn;
|
|
1862
1911
|
columns: MenuColumn[];
|
|
1863
1912
|
};
|
|
1864
|
-
|
|
1913
|
+
type MenuProps = {
|
|
1865
1914
|
id?: string;
|
|
1866
1915
|
portalContainer?: ElementContainerGetter | false | null;
|
|
1867
1916
|
items?: MenuItemDefinition[];
|
|
@@ -1879,12 +1928,12 @@ declare type MenuProps = {
|
|
|
1879
1928
|
parentMenuItemKey?: string;
|
|
1880
1929
|
autoFocus?: boolean;
|
|
1881
1930
|
};
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1931
|
+
type MenuSeparator = '-';
|
|
1932
|
+
type MenuItemDefinition = MenuItemObject | MenuDecoration | MenuSeparator;
|
|
1933
|
+
type MenuItemSubMenu = Omit<MenuProps, 'children' | 'items'> & {
|
|
1885
1934
|
items: (MenuItemObject | MenuSeparator)[];
|
|
1886
1935
|
};
|
|
1887
|
-
|
|
1936
|
+
type MenuItemObject = {
|
|
1888
1937
|
key: string;
|
|
1889
1938
|
label: NonUndefined<MenuRenderable>;
|
|
1890
1939
|
span?: number;
|
|
@@ -1897,8 +1946,8 @@ declare type MenuItemObject = {
|
|
|
1897
1946
|
onAction?: (key: string, item: MenuItemObject) => void;
|
|
1898
1947
|
[k: string]: any;
|
|
1899
1948
|
};
|
|
1900
|
-
|
|
1901
|
-
|
|
1949
|
+
type MenuDecoration = MenuRenderable;
|
|
1950
|
+
type MenuColumn = {
|
|
1902
1951
|
flex?: number;
|
|
1903
1952
|
width?: string | number;
|
|
1904
1953
|
style?: CSSProperties;
|
|
@@ -1906,34 +1955,51 @@ declare type MenuColumn = {
|
|
|
1906
1955
|
field?: string;
|
|
1907
1956
|
render?: (param: MenuColumnRenderParam) => MenuRenderable;
|
|
1908
1957
|
};
|
|
1909
|
-
|
|
1958
|
+
type MenuColumnRenderParam = {
|
|
1910
1959
|
item: MenuItemObject;
|
|
1911
1960
|
column: MenuColumn;
|
|
1912
1961
|
value: MenuRenderable;
|
|
1913
1962
|
domProps: HTMLProps<HTMLDivElement>;
|
|
1914
1963
|
};
|
|
1915
1964
|
|
|
1916
|
-
|
|
1965
|
+
type InfiniteTableEventHandlerContext<T> = {
|
|
1966
|
+
getComputed: () => InfiniteTableComputedValues<T>;
|
|
1967
|
+
getState: () => InfiniteTableState<T>;
|
|
1968
|
+
actions: InfiniteTableActions<T>;
|
|
1969
|
+
cloneRowSelection: (rowSelection: RowSelectionState<T>) => RowSelectionState<T>;
|
|
1970
|
+
getDataSourceState: () => DataSourceState<T>;
|
|
1971
|
+
dataSourceActions: DataSourceComponentActions<T>;
|
|
1972
|
+
api: InfiniteTableApi<T>;
|
|
1973
|
+
};
|
|
1974
|
+
type InfiniteTableKeyboardEventHandlerContext<T> = InfiniteTableEventHandlerContext<T>;
|
|
1975
|
+
type InfiniteTableCellClickEventHandlerContext<T> = InfiniteTableEventHandlerContext<T> & {
|
|
1976
|
+
rowIndex: number;
|
|
1977
|
+
colIndex: number;
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1980
|
+
type OnCellClickContext<T> = InfiniteTableCellClickEventHandlerContext<T> & InfiniteTableKeyboardEventHandlerContext<T>;
|
|
1981
|
+
|
|
1982
|
+
type LoadMaskProps = {
|
|
1917
1983
|
visible: boolean;
|
|
1918
1984
|
children: Renderable;
|
|
1919
1985
|
};
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1986
|
+
type InfiniteTablePropColumnOrderNormalized = string[];
|
|
1987
|
+
type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
|
|
1988
|
+
type InfiniteTablePropColumnVisibility = Record<string, false>;
|
|
1989
|
+
type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
|
|
1990
|
+
type InfiniteTablePropColumnPinning = Record<string, true | 'start' | 'end'>;
|
|
1991
|
+
type InfiniteTableRowStyleFnParams<T> = {
|
|
1926
1992
|
rowIndex: number;
|
|
1927
1993
|
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1994
|
+
type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
|
|
1995
|
+
type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
|
|
1996
|
+
type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
|
|
1997
|
+
type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
|
|
1998
|
+
type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
|
|
1933
1999
|
getter?: AggregationReducer<T, AggregationResultType>['getter'];
|
|
1934
2000
|
field?: keyof T;
|
|
1935
2001
|
};
|
|
1936
|
-
|
|
2002
|
+
type InfiniteTableColumnType<T> = {
|
|
1937
2003
|
minWidth?: number;
|
|
1938
2004
|
maxWidth?: number;
|
|
1939
2005
|
filterType?: string;
|
|
@@ -1951,6 +2017,8 @@ declare type InfiniteTableColumnType<T> = {
|
|
|
1951
2017
|
resizable?: InfiniteTableColumn<T>['resizable'];
|
|
1952
2018
|
align?: InfiniteTableColumn<T>['align'];
|
|
1953
2019
|
verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
|
|
2020
|
+
contentFocusable?: InfiniteTableColumn<T>['contentFocusable'];
|
|
2021
|
+
editable?: InfiniteTableColumn<T>['editable'];
|
|
1954
2022
|
columnGroup?: string;
|
|
1955
2023
|
cssEllipsis?: boolean;
|
|
1956
2024
|
headerCssEllipsis?: boolean;
|
|
@@ -1968,15 +2036,15 @@ declare type InfiniteTableColumnType<T> = {
|
|
|
1968
2036
|
headerStyle?: InfiniteTableColumn<T>['headerStyle'];
|
|
1969
2037
|
headerClassName?: InfiniteTableColumn<T>['headerClassName'];
|
|
1970
2038
|
};
|
|
1971
|
-
|
|
1972
|
-
|
|
2039
|
+
type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
|
|
2040
|
+
type InfiniteTableColumnSizingOptions = {
|
|
1973
2041
|
flex?: number;
|
|
1974
2042
|
width?: number;
|
|
1975
2043
|
minWidth?: number;
|
|
1976
2044
|
maxWidth?: number;
|
|
1977
2045
|
};
|
|
1978
|
-
|
|
1979
|
-
|
|
2046
|
+
type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
|
|
2047
|
+
type InfiniteTableApi<T> = {
|
|
1980
2048
|
get selectionApi(): InfiniteTableSelectionApi;
|
|
1981
2049
|
setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
|
|
1982
2050
|
setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
|
|
@@ -2008,22 +2076,22 @@ declare type InfiniteTableApi<T> = {
|
|
|
2008
2076
|
getState: () => InfiniteTableState<T>;
|
|
2009
2077
|
getDataSourceState: () => DataSourceState<T>;
|
|
2010
2078
|
};
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2079
|
+
type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
|
|
2080
|
+
type InfiniteTableColumnsMap<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
|
|
2081
|
+
type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = Record<string, ColumnType> | InfiniteTableColumnsMap<T, ColumnType>;
|
|
2082
|
+
type InfiniteTablePropColumnGroupsMap = Map<string, InfiniteTableColumnGroup>;
|
|
2083
|
+
type InfiniteTablePropColumnGroupsRecord = Record<string, InfiniteTableColumnGroup>;
|
|
2084
|
+
type InfiniteTablePropColumnGroups = InfiniteTablePropColumnGroupsRecord | InfiniteTablePropColumnGroupsMap;
|
|
2085
|
+
type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
|
|
2086
|
+
type InfiniteTableColumnGroupHeaderRenderParams = {
|
|
2019
2087
|
columnGroup: InfiniteTableComputedColumnGroup;
|
|
2020
2088
|
};
|
|
2021
|
-
|
|
2022
|
-
|
|
2089
|
+
type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
|
|
2090
|
+
type InfiniteTableColumnGroup = {
|
|
2023
2091
|
columnGroup?: string;
|
|
2024
2092
|
header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
|
|
2025
2093
|
};
|
|
2026
|
-
|
|
2094
|
+
type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
|
|
2027
2095
|
id: string;
|
|
2028
2096
|
groupOffset: number;
|
|
2029
2097
|
computedWidth: number;
|
|
@@ -2031,7 +2099,7 @@ declare type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
|
|
|
2031
2099
|
columns: string[];
|
|
2032
2100
|
depth: number;
|
|
2033
2101
|
};
|
|
2034
|
-
|
|
2102
|
+
type InfiniteTableGroupColumnGetterOptions<T> = {
|
|
2035
2103
|
groupIndexForColumn?: number;
|
|
2036
2104
|
groupByForColumn?: DataSourceGroupBy<T>;
|
|
2037
2105
|
selectionMode: DataSourcePropSelectionMode;
|
|
@@ -2041,34 +2109,34 @@ declare type InfiniteTableGroupColumnGetterOptions<T> = {
|
|
|
2041
2109
|
pivotBy?: DataSourcePivotBy<T>[];
|
|
2042
2110
|
sortable?: boolean;
|
|
2043
2111
|
};
|
|
2044
|
-
|
|
2112
|
+
type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
|
|
2045
2113
|
column: COL_TYPE;
|
|
2046
2114
|
groupBy: DataSourcePropGroupBy<T>;
|
|
2047
2115
|
pivotBy: DataSourcePropPivotBy<T>;
|
|
2048
2116
|
};
|
|
2049
|
-
|
|
2050
|
-
|
|
2117
|
+
type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
|
|
2118
|
+
type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
|
|
2051
2119
|
renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
|
|
2052
2120
|
id?: string;
|
|
2053
2121
|
};
|
|
2054
|
-
|
|
2122
|
+
type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
|
|
2055
2123
|
renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
|
|
2056
2124
|
};
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2125
|
+
type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
|
|
2126
|
+
type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => Partial<InfiniteTableGroupColumnBase<T>>;
|
|
2127
|
+
type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
|
|
2128
|
+
type InfiniteTablePropComponents = {
|
|
2061
2129
|
LoadMask?: React$1.FC<React$1.PropsWithChildren<LoadMaskProps>>;
|
|
2062
2130
|
CheckBox?: React$1.FC<InfiniteCheckBoxProps>;
|
|
2063
2131
|
Menu?: React$1.FC<React$1.PropsWithChildren<MenuProps>>;
|
|
2064
2132
|
};
|
|
2065
|
-
|
|
2133
|
+
type ScrollStopInfo = {
|
|
2066
2134
|
scrollTop: number;
|
|
2067
2135
|
firstVisibleRowIndex: number;
|
|
2068
2136
|
lastVisibleRowIndex: number;
|
|
2069
2137
|
};
|
|
2070
|
-
|
|
2071
|
-
|
|
2138
|
+
type InfiniteTablePropFilterEditors<T> = Record<string, React$1.FC<InfiniteTableFilterEditorProps<T>>>;
|
|
2139
|
+
type InfiniteTableFilterEditorProps<T extends any> = {
|
|
2072
2140
|
filterType: string;
|
|
2073
2141
|
operator: string;
|
|
2074
2142
|
ariaLabel: string;
|
|
@@ -2111,6 +2179,27 @@ interface InfiniteTableProps<T> {
|
|
|
2111
2179
|
rowStyle?: InfiniteTablePropRowStyle<T>;
|
|
2112
2180
|
rowClassName?: InfiniteTablePropRowClassName<T>;
|
|
2113
2181
|
columnHeaderHeight: number | string;
|
|
2182
|
+
onKeyDown?: (context: {
|
|
2183
|
+
api: InfiniteTableEventHandlerContext<T>['api'];
|
|
2184
|
+
getState: InfiniteTableEventHandlerContext<T>['getState'];
|
|
2185
|
+
getDataSourceState: InfiniteTableEventHandlerContext<T>['getDataSourceState'];
|
|
2186
|
+
actions: InfiniteTableEventHandlerContext<T>['actions'];
|
|
2187
|
+
}, event: React$1.KeyboardEvent) => void;
|
|
2188
|
+
onCellClick?: (context: {
|
|
2189
|
+
rowIndex: OnCellClickContext<T>['rowIndex'];
|
|
2190
|
+
colIndex: OnCellClickContext<T>['colIndex'];
|
|
2191
|
+
api: OnCellClickContext<T>['api'];
|
|
2192
|
+
getState: OnCellClickContext<T>['getState'];
|
|
2193
|
+
getDataSourceState: OnCellClickContext<T>['getDataSourceState'];
|
|
2194
|
+
actions: OnCellClickContext<T>['actions'];
|
|
2195
|
+
}, event: React$1.MouseEvent) => void;
|
|
2196
|
+
/**
|
|
2197
|
+
* Properties to be sent directly to the DOM element underlying InfiniteTable.
|
|
2198
|
+
*
|
|
2199
|
+
* Useful for passing a className or style and any other event handlers. For more context
|
|
2200
|
+
* on some event handlers (eg: onKeyDown), you might want to use dedicated props that give you access
|
|
2201
|
+
* to component state as well.
|
|
2202
|
+
*/
|
|
2114
2203
|
domProps?: React$1.HTMLProps<HTMLDivElement>;
|
|
2115
2204
|
/**
|
|
2116
2205
|
* A unique identifier for the table instance. Will not be passed to the DOM.
|
|
@@ -2170,22 +2259,22 @@ interface InfiniteTableProps<T> {
|
|
|
2170
2259
|
actions: InfiniteTableActions<T>;
|
|
2171
2260
|
}) => MenuProps['items'];
|
|
2172
2261
|
}
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2262
|
+
type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
|
|
2263
|
+
type InfiniteTablePropKeyboardSelection = boolean;
|
|
2264
|
+
type InfiniteTablePropHeaderOptions = {
|
|
2176
2265
|
alwaysReserveSpaceForSortIcon: boolean;
|
|
2177
2266
|
};
|
|
2178
|
-
|
|
2267
|
+
type InfiniteTablePropAutoSizeColumnsKey = string | number | {
|
|
2179
2268
|
key: string | number;
|
|
2180
2269
|
columnsToSkip?: string[];
|
|
2181
2270
|
columnsToResize?: string[];
|
|
2182
2271
|
includeHeader?: boolean;
|
|
2183
2272
|
};
|
|
2184
|
-
|
|
2273
|
+
type Scrollbars = {
|
|
2185
2274
|
vertical: boolean;
|
|
2186
2275
|
horizontal: boolean;
|
|
2187
2276
|
};
|
|
2188
|
-
|
|
2277
|
+
type ScrollAdjustPosition = 'start' | 'end' | 'center';
|
|
2189
2278
|
|
|
2190
2279
|
declare function debounce(fn: Function, { wait }: {
|
|
2191
2280
|
wait: number;
|
|
@@ -2198,10 +2287,10 @@ declare namespace Menu {
|
|
|
2198
2287
|
};
|
|
2199
2288
|
}
|
|
2200
2289
|
|
|
2201
|
-
|
|
2290
|
+
type ForwardPropsToStateFnResult<TYPE_PROPS, TYPE_RESULT> = {
|
|
2202
2291
|
[propName in keyof TYPE_PROPS & keyof TYPE_RESULT]: 1 | ((value: TYPE_PROPS[propName]) => TYPE_RESULT[propName]);
|
|
2203
2292
|
};
|
|
2204
|
-
|
|
2293
|
+
type ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT_SETUP_STATE = {}, COMPONENT_DERIVED_STATE = {}, T_ACTIONS = {}, T_PARENT_STATE = {}> = {
|
|
2205
2294
|
debugName?: string;
|
|
2206
2295
|
initSetupState?: () => COMPONENT_SETUP_STATE;
|
|
2207
2296
|
layoutEffect?: boolean;
|
|
@@ -2236,7 +2325,7 @@ declare function getComponentStateRoot<T_PROPS, COMPONENT_MAPPED_STATE extends o
|
|
|
2236
2325
|
}>;
|
|
2237
2326
|
declare function useComponentState<COMPONENT_STATE>(): ComponentStateContext<COMPONENT_STATE, ComponentStateGeneratedActions<COMPONENT_STATE>>;
|
|
2238
2327
|
|
|
2239
|
-
|
|
2328
|
+
type InterceptedMapFns<K, V> = {
|
|
2240
2329
|
set?: (k: K, v: V) => void;
|
|
2241
2330
|
beforeClear?: (map: Map<K, V>) => void;
|
|
2242
2331
|
clear?: () => void;
|