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