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