@infinite-table/infinite-react 0.2.10 → 0.2.13
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 +5 -5
- package/index.d.ts +335 -218
- package/index.esm.css +5 -5
- package/index.esm.js +6517 -6346
- package/index.js +6434 -6267
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import * as _vanilla_extract_private from '@vanilla-extract/private';
|
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import { CSSProperties, MutableRefObject } from 'react';
|
|
4
4
|
|
|
5
|
+
declare function debounce(fn: Function, { wait }: {
|
|
6
|
+
wait: number;
|
|
7
|
+
}): (...args: any[]) => void;
|
|
8
|
+
|
|
5
9
|
interface ScrollPosition {
|
|
6
10
|
scrollTop: number;
|
|
7
11
|
scrollLeft: number;
|
|
@@ -73,7 +77,7 @@ declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
|
|
|
73
77
|
componentActions: T_ACTIONS;
|
|
74
78
|
};
|
|
75
79
|
declare type ComponentStateGeneratedActions<T_STATE> = {
|
|
76
|
-
[k in keyof T_STATE]: T_STATE[k] | React
|
|
80
|
+
[k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
|
|
77
81
|
};
|
|
78
82
|
declare type ComponentInterceptedActions<T_STATE> = {
|
|
79
83
|
[k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
|
|
@@ -82,40 +86,28 @@ declare type ComponentInterceptedActions<T_STATE> = {
|
|
|
82
86
|
}) => void | boolean;
|
|
83
87
|
};
|
|
84
88
|
declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
108
|
-
updatedProps: Partial<T_PROPS> | null;
|
|
109
|
-
parentState: T_PARENT_STATE | null;
|
|
110
|
-
}) => COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
111
|
-
getReducerActions?: (dispatch: React$1.Dispatch<any>) => T_ACTIONS;
|
|
112
|
-
getParentState?: () => T_PARENT_STATE;
|
|
113
|
-
onControlledPropertyChange?: (name: string, newValue: any, oldValue: any) => void | ((value: any, oldValue: any) => any);
|
|
114
|
-
};
|
|
115
|
-
declare function getComponentStateRoot<T_PROPS, COMPONENT_MAPPED_STATE extends object, COMPONENT_SETUP_STATE extends object = {}, COMPONENT_DERIVED_STATE extends object = {}, T_ACTIONS = {}, T_PARENT_STATE = {}>(config: ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT_SETUP_STATE, COMPONENT_DERIVED_STATE, T_ACTIONS, T_PARENT_STATE>): React$1.NamedExoticComponent<T_PROPS & {
|
|
116
|
-
children: React$1.ReactNode;
|
|
117
|
-
}>;
|
|
118
|
-
declare function useComponentState<COMPONENT_STATE>(): ComponentStateContext<COMPONENT_STATE, ComponentStateGeneratedActions<COMPONENT_STATE>>;
|
|
89
|
+
|
|
90
|
+
declare class GroupRowsState<KeyType extends any = any> {
|
|
91
|
+
private expandedMap?;
|
|
92
|
+
private collapsedMap?;
|
|
93
|
+
private collapsedAll;
|
|
94
|
+
private expandedAll;
|
|
95
|
+
private initialState;
|
|
96
|
+
constructor(state: DataSourceExpandedAndCollapsedGroupRows<KeyType> | GroupRowsState<KeyType>);
|
|
97
|
+
getState(): DataSourceExpandedAndCollapsedGroupRows<KeyType>;
|
|
98
|
+
destroy(): void;
|
|
99
|
+
private update;
|
|
100
|
+
areAllCollapsed(): boolean;
|
|
101
|
+
areAllExpanded(): boolean;
|
|
102
|
+
collapseAll(): void;
|
|
103
|
+
expandAll(): void;
|
|
104
|
+
isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
|
|
105
|
+
isGroupRowCollapsed(keys: KeyType[]): boolean;
|
|
106
|
+
setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
|
|
107
|
+
collapseGroupRow(keys: KeyType[]): void;
|
|
108
|
+
expandGroupRow(keys: KeyType[]): void;
|
|
109
|
+
toggleGroupRow(keys: KeyType[]): void;
|
|
110
|
+
}
|
|
119
111
|
|
|
120
112
|
declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
121
113
|
|
|
@@ -129,6 +121,16 @@ interface SubscriptionCallback<T> {
|
|
|
129
121
|
onChange: (fn: SubscriptionCallbackOnChangeFn<T>) => VoidFn;
|
|
130
122
|
}
|
|
131
123
|
|
|
124
|
+
interface LogFn {
|
|
125
|
+
(...args: any[]): LogFn;
|
|
126
|
+
extend: (channelName: string) => LogFn;
|
|
127
|
+
}
|
|
128
|
+
declare class Logger {
|
|
129
|
+
debug: LogFn;
|
|
130
|
+
error: LogFn;
|
|
131
|
+
constructor(channelName: string);
|
|
132
|
+
}
|
|
133
|
+
|
|
132
134
|
interface Size {
|
|
133
135
|
width: number;
|
|
134
136
|
height: number;
|
|
@@ -145,10 +147,238 @@ declare type VirtualBrainOptions = {
|
|
|
145
147
|
name?: string;
|
|
146
148
|
};
|
|
147
149
|
declare type MainAxisSize = number | ((itemIndex: number) => number);
|
|
150
|
+
declare type OnRenderCountChangeFn = (renderCount: number) => void;
|
|
151
|
+
declare type OnSizeChangeFn = (size: number) => void;
|
|
152
|
+
declare type OnDestroyFn = () => void;
|
|
148
153
|
declare type RenderRange = {
|
|
149
154
|
renderStartIndex: number;
|
|
150
155
|
renderEndIndex: number;
|
|
151
156
|
};
|
|
157
|
+
declare type OnRenderRangeChangeFn = (renderRange: RenderRange) => void;
|
|
158
|
+
declare class VirtualBrain extends Logger {
|
|
159
|
+
private scrollPosition;
|
|
160
|
+
private scrollPositionOnMainAxis;
|
|
161
|
+
private itemSpanParent;
|
|
162
|
+
private itemSpanValue;
|
|
163
|
+
private itemSizeCache;
|
|
164
|
+
private itemOffsetCache;
|
|
165
|
+
private options;
|
|
166
|
+
private destroyed;
|
|
167
|
+
private totalSize;
|
|
168
|
+
private onScrollFns;
|
|
169
|
+
private onTotalSizeChangeFns;
|
|
170
|
+
private onRenderCountChangeFns;
|
|
171
|
+
private onRenderRangeChangeFns;
|
|
172
|
+
private onDestroyFns;
|
|
173
|
+
name: string | undefined;
|
|
174
|
+
private renderCount;
|
|
175
|
+
private renderRange;
|
|
176
|
+
private availableSize;
|
|
177
|
+
constructor(options: VirtualBrainOptions);
|
|
178
|
+
setAvailableSize: (size: Size) => void;
|
|
179
|
+
getOptions(): VirtualBrainOptions;
|
|
180
|
+
private updateRenderCount;
|
|
181
|
+
private computeRenderCount;
|
|
182
|
+
private setRenderCount;
|
|
183
|
+
private updateRenderRange;
|
|
184
|
+
getRenderStartIndex(): number;
|
|
185
|
+
getRenderCount: () => number;
|
|
186
|
+
setScrollPosition: (scrollPosition: ScrollPosition) => void;
|
|
187
|
+
private notifyScrollChange;
|
|
188
|
+
private notifyDestroy;
|
|
189
|
+
private notifyTotalSizeChange;
|
|
190
|
+
private notifyRenderCountChange;
|
|
191
|
+
private notifyRenderRangeChange;
|
|
192
|
+
getRenderRange: () => RenderRange;
|
|
193
|
+
private setRenderRange;
|
|
194
|
+
private computeRenderRange;
|
|
195
|
+
getScrollPosition: () => ScrollPosition;
|
|
196
|
+
onScroll: (fn: OnScrollFn) => () => void;
|
|
197
|
+
onTotalSizeChange: (fn: OnSizeChangeFn) => () => void;
|
|
198
|
+
onRenderCountChange: (fn: OnRenderCountChangeFn) => () => void;
|
|
199
|
+
onRenderRangeChange: (fn: OnRenderRangeChangeFn) => () => void;
|
|
200
|
+
onDestroy: (fn: OnDestroyFn) => () => void;
|
|
201
|
+
update: (newCount: VirtualBrainOptions['count'], newItemSize: VirtualBrainOptions['itemSize'], newItemSpan?: VirtualBrainOptions['itemSpan']) => void;
|
|
202
|
+
private reset;
|
|
203
|
+
private computeItemSpanUpTo;
|
|
204
|
+
private computeCacheFor;
|
|
205
|
+
private getItemSizeCacheFor;
|
|
206
|
+
getItemSpan: (itemIndex: number) => number;
|
|
207
|
+
getItemSpanParent: (itemIndex: number) => number;
|
|
208
|
+
getItemSizeWithSpan: (itemIndex: number, itemSpan: number) => number;
|
|
209
|
+
/**
|
|
210
|
+
* For now, this doesn't take into account the itemspan, and it's okay not to
|
|
211
|
+
* @param itemIndex
|
|
212
|
+
* @returns the size of the specified item
|
|
213
|
+
*/
|
|
214
|
+
getItemSize: (itemIndex: number) => number;
|
|
215
|
+
getTotalSize: () => number;
|
|
216
|
+
getItemAt: (scrollPos: number) => number;
|
|
217
|
+
getItemOffsetFor: (itemIndex: number) => number;
|
|
218
|
+
destroy: () => void;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare type Renderable = React$1.ReactNode;
|
|
222
|
+
|
|
223
|
+
declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
224
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
225
|
+
}[Keys];
|
|
226
|
+
|
|
227
|
+
declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
|
|
228
|
+
declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
229
|
+
value: string | number | Renderable;
|
|
230
|
+
groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
|
|
231
|
+
rowIndex: number;
|
|
232
|
+
column: COL_TYPE;
|
|
233
|
+
toggleCurrentGroupRow: () => void;
|
|
234
|
+
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
235
|
+
groupBy: DataSourceState<DATA_TYPE>['groupBy'];
|
|
236
|
+
pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
|
|
237
|
+
} & ({
|
|
238
|
+
rowInfo: InfiniteTableRowInfoNormal<DATA_TYPE>;
|
|
239
|
+
data: DATA_TYPE;
|
|
240
|
+
} | {
|
|
241
|
+
rowInfo: InfiniteTableRowInfoGroup<DATA_TYPE>;
|
|
242
|
+
data: Partial<DATA_TYPE> | null;
|
|
243
|
+
});
|
|
244
|
+
declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
|
|
245
|
+
collapsed: boolean;
|
|
246
|
+
groupIcon: Renderable;
|
|
247
|
+
};
|
|
248
|
+
declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
|
|
249
|
+
declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
250
|
+
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
251
|
+
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
252
|
+
dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
|
|
253
|
+
rowIndex: number;
|
|
254
|
+
column: COL_TYPE;
|
|
255
|
+
};
|
|
256
|
+
interface InfiniteTableColumnHeaderRenderParams<T> {
|
|
257
|
+
column: InfiniteTableComputedColumn<T>;
|
|
258
|
+
columnSortInfo: DataSourceSingleSortInfo<T> | null | undefined;
|
|
259
|
+
}
|
|
260
|
+
declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, rowInfo, groupBy, pivotBy, }: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
261
|
+
declare type InfiniteTableGroupColumnRenderIconFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (param: InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
262
|
+
declare type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderRenderParams<T>) => Renderable;
|
|
263
|
+
declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
|
|
264
|
+
declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
|
|
265
|
+
declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
|
|
266
|
+
declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
|
|
267
|
+
declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> = RequireAtLeastOne<{
|
|
268
|
+
/**
|
|
269
|
+
* Determines the field property of the column.
|
|
270
|
+
*/
|
|
271
|
+
field?: keyof T;
|
|
272
|
+
render?: InfiniteTableColumnRenderFunction<T>;
|
|
273
|
+
renderValue?: InfiniteTableColumnRenderFunction<T>;
|
|
274
|
+
valueGetter?: InfiniteTableColumnValueGetter<T>;
|
|
275
|
+
}, 'render' | 'renderValue' | 'field' | 'valueGetter'>;
|
|
276
|
+
declare type InfiniteTableColumnStyleFnParams<T> = {
|
|
277
|
+
value: Renderable;
|
|
278
|
+
column: InfiniteTableColumn<T>;
|
|
279
|
+
} & ({
|
|
280
|
+
data: T;
|
|
281
|
+
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
282
|
+
} | {
|
|
283
|
+
data: Partial<T> | null;
|
|
284
|
+
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
285
|
+
});
|
|
286
|
+
declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
|
|
287
|
+
declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
|
|
288
|
+
declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
|
|
289
|
+
declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
|
|
290
|
+
declare type InfiniteTableColumnValueGetterParams<T> = {
|
|
291
|
+
data: T;
|
|
292
|
+
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
293
|
+
} | {
|
|
294
|
+
data: Partial<T> | null;
|
|
295
|
+
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
296
|
+
};
|
|
297
|
+
declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = Renderable> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
|
|
298
|
+
declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
|
|
299
|
+
declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
300
|
+
declare type InfiniteTableBaseColumn<T> = {
|
|
301
|
+
sortable?: boolean;
|
|
302
|
+
draggable?: boolean;
|
|
303
|
+
resizable?: boolean;
|
|
304
|
+
comparer?: InfiniteTableColumnComparer<T>;
|
|
305
|
+
defaultHiddenWhenGroupedBy?: '*' | keyof T | {
|
|
306
|
+
[k in keyof Partial<T>]: true;
|
|
307
|
+
};
|
|
308
|
+
align?: InfiniteTableColumnAlign;
|
|
309
|
+
verticalAlign?: InfiniteTableColumnVerticalAlign;
|
|
310
|
+
columnGroup?: string;
|
|
311
|
+
header?: InfiniteTableColumnHeader<T>;
|
|
312
|
+
name?: Renderable;
|
|
313
|
+
cssEllipsis?: boolean;
|
|
314
|
+
headerCssEllipsis?: boolean;
|
|
315
|
+
type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
|
|
316
|
+
style?: InfiniteTableColumnStyle<T>;
|
|
317
|
+
className?: InfiniteTableColumnClassName<T>;
|
|
318
|
+
rowspan?: InfiniteTableColumnRowspanFn<T>;
|
|
319
|
+
valueGetter?: InfiniteTableColumnValueGetter<T>;
|
|
320
|
+
defaultWidth?: number;
|
|
321
|
+
defaultFlex?: number;
|
|
322
|
+
minWidth?: number;
|
|
323
|
+
maxWidth?: number;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Defines a column in the table.
|
|
327
|
+
*
|
|
328
|
+
* @typeParam DATA_TYPE The type of the data in the table.
|
|
329
|
+
*
|
|
330
|
+
* Can be bound to a field which is a `keyof DATA_TYPE`.
|
|
331
|
+
*/
|
|
332
|
+
declare type InfiniteTableColumn<DATA_TYPE> = {} & InfiniteTableBaseColumn<DATA_TYPE> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<DATA_TYPE>;
|
|
333
|
+
declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
|
|
334
|
+
groupByField: string | string[];
|
|
335
|
+
id?: string;
|
|
336
|
+
};
|
|
337
|
+
declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
|
|
338
|
+
declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
|
|
339
|
+
pivotBy: DataSourcePivotBy<DataType>[];
|
|
340
|
+
pivotTotalColumnGroup?: true;
|
|
341
|
+
pivotGroupKeys: KeyType[];
|
|
342
|
+
pivotByAtIndex: PivotBy<DataType, KeyType>;
|
|
343
|
+
pivotGroupKey: KeyType;
|
|
344
|
+
pivotIndex: number;
|
|
345
|
+
};
|
|
346
|
+
declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
|
|
347
|
+
pivotBy: DataSourcePivotBy<DataType>[];
|
|
348
|
+
pivotColumn: true;
|
|
349
|
+
pivotTotalColumn: boolean;
|
|
350
|
+
pivotAggregator: AggregationReducer<DataType, any>;
|
|
351
|
+
pivotAggregatorIndex: number;
|
|
352
|
+
pivotGroupKeys: KeyType[];
|
|
353
|
+
pivotByAtIndex?: PivotBy<DataType, KeyType>;
|
|
354
|
+
pivotIndex: number;
|
|
355
|
+
pivotGroupKey: KeyType;
|
|
356
|
+
};
|
|
357
|
+
declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
|
|
358
|
+
declare type InfiniteTableComputedColumnBase<T> = {
|
|
359
|
+
computedWidth: number;
|
|
360
|
+
computedOffset: number;
|
|
361
|
+
computedPinningOffset: number;
|
|
362
|
+
computedAbsoluteOffset: number;
|
|
363
|
+
computedSortable: boolean;
|
|
364
|
+
computedSortInfo: DataSourceSingleSortInfo<T> | null;
|
|
365
|
+
computedSorted: boolean;
|
|
366
|
+
computedSortedAsc: boolean;
|
|
367
|
+
computedSortedDesc: boolean;
|
|
368
|
+
computedSortIndex: number;
|
|
369
|
+
computedVisibleIndex: number;
|
|
370
|
+
computedMultiSort: boolean;
|
|
371
|
+
computedPinned: InfiniteTableColumnPinnedValues;
|
|
372
|
+
computedDraggable: boolean;
|
|
373
|
+
computedFirstInCategory: boolean;
|
|
374
|
+
computedLastInCategory: boolean;
|
|
375
|
+
computedFirst: boolean;
|
|
376
|
+
computedLast: boolean;
|
|
377
|
+
toggleSort: () => void;
|
|
378
|
+
id: string;
|
|
379
|
+
};
|
|
380
|
+
declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
|
|
381
|
+
declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
|
|
152
382
|
|
|
153
383
|
interface DataSourceDataParams<T> {
|
|
154
384
|
originalDataArray: T[];
|
|
@@ -207,6 +437,12 @@ declare type DataSourceAggregationReducer<T, AggregationResultType> = {
|
|
|
207
437
|
getter?: (data: T) => any;
|
|
208
438
|
reducer: string | ((accumulator: any, value: any, data: T) => AggregationResultType | any);
|
|
209
439
|
done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
|
|
440
|
+
pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
|
|
441
|
+
column: InfiniteTablePivotFinalColumnVariant<T>;
|
|
442
|
+
}) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
|
|
443
|
+
};
|
|
444
|
+
declare type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
|
|
445
|
+
inheritFromColumn?: string | boolean;
|
|
210
446
|
};
|
|
211
447
|
declare type DataSourceMappings = Record<'totals' | 'values', string>;
|
|
212
448
|
declare type LazyGroupDataItem<DataType> = {
|
|
@@ -317,184 +553,6 @@ interface DataSourceReducer<T> {
|
|
|
317
553
|
(state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
|
|
318
554
|
}
|
|
319
555
|
|
|
320
|
-
declare function useDataSource<T>(): DataSourceState<T>;
|
|
321
|
-
|
|
322
|
-
declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
|
|
323
|
-
|
|
324
|
-
declare class GroupRowsState<KeyType extends any = any> {
|
|
325
|
-
private expandedMap?;
|
|
326
|
-
private collapsedMap?;
|
|
327
|
-
private collapsedAll;
|
|
328
|
-
private expandedAll;
|
|
329
|
-
private initialState;
|
|
330
|
-
constructor(state: DataSourceExpandedAndCollapsedGroupRows<KeyType> | GroupRowsState<KeyType>);
|
|
331
|
-
getState(): DataSourceExpandedAndCollapsedGroupRows<KeyType>;
|
|
332
|
-
destroy(): void;
|
|
333
|
-
private update;
|
|
334
|
-
areAllCollapsed(): boolean;
|
|
335
|
-
areAllExpanded(): boolean;
|
|
336
|
-
collapseAll(): void;
|
|
337
|
-
expandAll(): void;
|
|
338
|
-
isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
|
|
339
|
-
isGroupRowCollapsed(keys: KeyType[]): boolean;
|
|
340
|
-
setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
|
|
341
|
-
collapseGroupRow(keys: KeyType[]): void;
|
|
342
|
-
expandGroupRow(keys: KeyType[]): void;
|
|
343
|
-
toggleGroupRow(keys: KeyType[]): void;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
declare type Renderable = React$1.ReactNode;
|
|
347
|
-
|
|
348
|
-
declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
349
|
-
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
350
|
-
}[Keys];
|
|
351
|
-
|
|
352
|
-
declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
|
|
353
|
-
declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
354
|
-
value: string | number | Renderable;
|
|
355
|
-
groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
|
|
356
|
-
rowIndex: number;
|
|
357
|
-
column: COL_TYPE;
|
|
358
|
-
toggleCurrentGroupRow: () => void;
|
|
359
|
-
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
360
|
-
groupBy: DataSourceState<DATA_TYPE>['groupBy'];
|
|
361
|
-
pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
|
|
362
|
-
} & ({
|
|
363
|
-
rowInfo: InfiniteTableRowInfoNormal<DATA_TYPE>;
|
|
364
|
-
data: DATA_TYPE;
|
|
365
|
-
} | {
|
|
366
|
-
rowInfo: InfiniteTableRowInfoGroup<DATA_TYPE>;
|
|
367
|
-
data: Partial<DATA_TYPE> | null;
|
|
368
|
-
});
|
|
369
|
-
declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
|
|
370
|
-
collapsed: boolean;
|
|
371
|
-
groupIcon: Renderable;
|
|
372
|
-
};
|
|
373
|
-
declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
|
|
374
|
-
declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
375
|
-
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
376
|
-
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
377
|
-
dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
|
|
378
|
-
rowIndex: number;
|
|
379
|
-
column: COL_TYPE;
|
|
380
|
-
};
|
|
381
|
-
interface InfiniteTableColumnHeaderRenderParams<T> {
|
|
382
|
-
column: InfiniteTableComputedColumn<T>;
|
|
383
|
-
columnSortInfo: DataSourceSingleSortInfo<T> | null | undefined;
|
|
384
|
-
}
|
|
385
|
-
declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, rowInfo, groupBy, pivotBy, }: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
386
|
-
declare type InfiniteTableGroupColumnRenderIconFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (param: InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
387
|
-
declare type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderRenderParams<T>) => Renderable;
|
|
388
|
-
declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
|
|
389
|
-
declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
|
|
390
|
-
declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
|
|
391
|
-
declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
|
|
392
|
-
declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> = RequireAtLeastOne<{
|
|
393
|
-
field?: keyof T;
|
|
394
|
-
render?: InfiniteTableColumnRenderFunction<T>;
|
|
395
|
-
renderValue?: InfiniteTableColumnRenderFunction<T>;
|
|
396
|
-
valueGetter?: InfiniteTableColumnValueGetter<T>;
|
|
397
|
-
}, 'render' | 'renderValue' | 'field' | 'valueGetter'>;
|
|
398
|
-
declare type InfiniteTableColumnStyleFnParams<T> = {
|
|
399
|
-
value: Renderable;
|
|
400
|
-
column: InfiniteTableColumn<T>;
|
|
401
|
-
} & ({
|
|
402
|
-
data: T;
|
|
403
|
-
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
404
|
-
} | {
|
|
405
|
-
data: Partial<T> | null;
|
|
406
|
-
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
407
|
-
});
|
|
408
|
-
declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
|
|
409
|
-
declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
|
|
410
|
-
declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
|
|
411
|
-
declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
|
|
412
|
-
declare type InfiniteTableColumnValueGetterParams<T> = {
|
|
413
|
-
data: T;
|
|
414
|
-
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
415
|
-
} | {
|
|
416
|
-
data: Partial<T> | null;
|
|
417
|
-
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
418
|
-
};
|
|
419
|
-
declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = Renderable> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
|
|
420
|
-
declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
|
|
421
|
-
declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
422
|
-
declare type InfiniteTableBaseColumn<T> = {
|
|
423
|
-
sortable?: boolean;
|
|
424
|
-
draggable?: boolean;
|
|
425
|
-
resizable?: boolean;
|
|
426
|
-
comparer?: InfiniteTableColumnComparer<T>;
|
|
427
|
-
defaultHiddenWhenGroupedBy?: '*' | keyof T | {
|
|
428
|
-
[k in keyof Partial<T>]: true;
|
|
429
|
-
};
|
|
430
|
-
align?: InfiniteTableColumnAlign;
|
|
431
|
-
verticalAlign?: InfiniteTableColumnVerticalAlign;
|
|
432
|
-
columnGroup?: string;
|
|
433
|
-
header?: InfiniteTableColumnHeader<T>;
|
|
434
|
-
name?: Renderable;
|
|
435
|
-
cssEllipsis?: boolean;
|
|
436
|
-
headerCssEllipsis?: boolean;
|
|
437
|
-
type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
|
|
438
|
-
style?: InfiniteTableColumnStyle<T>;
|
|
439
|
-
className?: InfiniteTableColumnClassName<T>;
|
|
440
|
-
rowspan?: InfiniteTableColumnRowspanFn<T>;
|
|
441
|
-
valueGetter?: InfiniteTableColumnValueGetter<T>;
|
|
442
|
-
defaultWidth?: number;
|
|
443
|
-
defaultFlex?: number;
|
|
444
|
-
minWidth?: number;
|
|
445
|
-
maxWidth?: number;
|
|
446
|
-
};
|
|
447
|
-
declare type InfiniteTableColumn<T> = {} & InfiniteTableBaseColumn<T> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T>;
|
|
448
|
-
declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
|
|
449
|
-
groupByField: string | string[];
|
|
450
|
-
id?: string;
|
|
451
|
-
};
|
|
452
|
-
declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & Partial<InfiniteTablePivotFinalColumnVariant<T, any>>;
|
|
453
|
-
declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
|
|
454
|
-
pivotBy: DataSourcePivotBy<DataType>[];
|
|
455
|
-
pivotTotalColumnGroup?: true;
|
|
456
|
-
pivotGroupKeys: KeyType[];
|
|
457
|
-
pivotByAtIndex: PivotBy<DataType, KeyType>;
|
|
458
|
-
pivotGroupKey: KeyType;
|
|
459
|
-
pivotIndex: number;
|
|
460
|
-
};
|
|
461
|
-
declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
|
|
462
|
-
pivotBy: DataSourcePivotBy<DataType>[];
|
|
463
|
-
pivotColumn: true;
|
|
464
|
-
pivotTotalColumn: boolean;
|
|
465
|
-
pivotAggregator: AggregationReducer<DataType, any>;
|
|
466
|
-
pivotAggregatorIndex: number;
|
|
467
|
-
pivotGroupKeys: KeyType[];
|
|
468
|
-
pivotByAtIndex?: PivotBy<DataType, KeyType>;
|
|
469
|
-
pivotIndex: number;
|
|
470
|
-
pivotGroupKey: KeyType;
|
|
471
|
-
};
|
|
472
|
-
declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
|
|
473
|
-
declare type InfiniteTableComputedColumnBase<T> = {
|
|
474
|
-
computedWidth: number;
|
|
475
|
-
computedOffset: number;
|
|
476
|
-
computedPinningOffset: number;
|
|
477
|
-
computedAbsoluteOffset: number;
|
|
478
|
-
computedSortable: boolean;
|
|
479
|
-
computedSortInfo: DataSourceSingleSortInfo<T> | null;
|
|
480
|
-
computedSorted: boolean;
|
|
481
|
-
computedSortedAsc: boolean;
|
|
482
|
-
computedSortedDesc: boolean;
|
|
483
|
-
computedSortIndex: number;
|
|
484
|
-
computedVisibleIndex: number;
|
|
485
|
-
computedMultiSort: boolean;
|
|
486
|
-
computedPinned: InfiniteTableColumnPinnedValues;
|
|
487
|
-
computedDraggable: boolean;
|
|
488
|
-
computedFirstInCategory: boolean;
|
|
489
|
-
computedLastInCategory: boolean;
|
|
490
|
-
computedFirst: boolean;
|
|
491
|
-
computedLast: boolean;
|
|
492
|
-
toggleSort: () => void;
|
|
493
|
-
id: string;
|
|
494
|
-
};
|
|
495
|
-
declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
|
|
496
|
-
declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
|
|
497
|
-
|
|
498
556
|
declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
|
|
499
557
|
id: string;
|
|
500
558
|
};
|
|
@@ -567,12 +625,12 @@ declare type GroupBy<DataType, KeyType> = {
|
|
|
567
625
|
column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
|
|
568
626
|
};
|
|
569
627
|
declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
|
|
570
|
-
column?: InfiniteTableColumn<DataType
|
|
628
|
+
column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
|
|
571
629
|
column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
|
|
572
630
|
}) => Partial<InfiniteTablePivotColumn<DataType>>);
|
|
573
631
|
columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
|
|
574
632
|
columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
|
|
575
|
-
}) => Partial<InfiniteTablePivotFinalColumnGroup<DataType
|
|
633
|
+
}) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
|
|
576
634
|
};
|
|
577
635
|
declare type GroupParams<DataType, KeyType> = {
|
|
578
636
|
groupBy: GroupBy<DataType, KeyType>[];
|
|
@@ -635,9 +693,12 @@ declare type InfiniteTableColumnType<T> = {
|
|
|
635
693
|
resizable?: InfiniteTableColumn<T>['resizable'];
|
|
636
694
|
align?: InfiniteTableColumn<T>['align'];
|
|
637
695
|
verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
|
|
696
|
+
cssEllipsis?: boolean;
|
|
697
|
+
headerCssEllipsis?: boolean;
|
|
638
698
|
renderValue?: InfiniteTableColumn<T>['renderValue'];
|
|
639
699
|
render?: InfiniteTableColumn<T>['render'];
|
|
640
700
|
valueGetter?: InfiniteTableColumn<T>['valueGetter'];
|
|
701
|
+
style?: InfiniteTableColumn<T>['style'];
|
|
641
702
|
};
|
|
642
703
|
declare type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
|
|
643
704
|
declare type InfiniteTableColumnSizingOptions = {
|
|
@@ -729,6 +790,7 @@ interface InfiniteTableProps<T> {
|
|
|
729
790
|
defaultColumnPinning?: InfiniteTablePropColumnPinning;
|
|
730
791
|
columnSizing?: InfiniteTablePropColumnSizing;
|
|
731
792
|
defaultColumnSizing?: InfiniteTablePropColumnSizing;
|
|
793
|
+
onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
|
|
732
794
|
pivotColumnGroups?: InfiniteTablePropColumnGroups;
|
|
733
795
|
columnGroups?: InfiniteTablePropColumnGroups;
|
|
734
796
|
defaultColumnGroups?: InfiniteTablePropColumnGroups;
|
|
@@ -752,9 +814,12 @@ interface InfiniteTableProps<T> {
|
|
|
752
814
|
focusedWithinClassName?: string;
|
|
753
815
|
focusedStyle?: React$1.CSSProperties;
|
|
754
816
|
focusedWithinStyle?: React$1.CSSProperties;
|
|
817
|
+
columnCssEllipsis?: boolean;
|
|
818
|
+
columnHeaderCssEllipsis?: boolean;
|
|
755
819
|
columnDefaultWidth?: number;
|
|
756
820
|
columnMinWidth?: number;
|
|
757
821
|
columnMaxWidth?: number;
|
|
822
|
+
resizableColumns?: boolean;
|
|
758
823
|
virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
|
|
759
824
|
virtualizeRows?: boolean;
|
|
760
825
|
defaultActiveIndex?: number;
|
|
@@ -775,8 +840,15 @@ interface InfiniteTableProps<T> {
|
|
|
775
840
|
onReady?: (api: InfiniteTableImperativeApi<T>) => void;
|
|
776
841
|
rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
|
|
777
842
|
licenseKey?: string;
|
|
778
|
-
|
|
843
|
+
scrollTopKey?: string | number;
|
|
844
|
+
autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
|
|
779
845
|
}
|
|
846
|
+
declare type InfiniteTablePropAutoSizeColumnsKey = string | number | {
|
|
847
|
+
key: string | number;
|
|
848
|
+
columnsToSkip?: string[];
|
|
849
|
+
columnsToResize?: string[];
|
|
850
|
+
includeHeader?: boolean;
|
|
851
|
+
};
|
|
780
852
|
declare type Scrollbars = {
|
|
781
853
|
vertical: boolean;
|
|
782
854
|
horizontal: boolean;
|
|
@@ -802,7 +874,10 @@ interface InfiniteTableSetupState<T> {
|
|
|
802
874
|
onHeaderHeightCSSVarChange: SubscriptionCallback<number>;
|
|
803
875
|
columnsWhenGrouping?: InfiniteTablePropColumnsMap<T>;
|
|
804
876
|
bodySize: Size;
|
|
877
|
+
verticalVirtualBrain: VirtualBrain;
|
|
878
|
+
horizontalVirtualBrain: VirtualBrain;
|
|
805
879
|
focused: boolean;
|
|
880
|
+
ready: boolean;
|
|
806
881
|
focusedWithin: boolean;
|
|
807
882
|
scrollPosition: ScrollPosition;
|
|
808
883
|
draggingColumnId: null | string;
|
|
@@ -813,7 +888,7 @@ interface InfiniteTableSetupState<T> {
|
|
|
813
888
|
declare type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
|
|
814
889
|
declare type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
|
|
815
890
|
interface InfiniteTableMappedState<T> {
|
|
816
|
-
|
|
891
|
+
scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
|
|
817
892
|
viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
|
|
818
893
|
groupColumn: InfiniteTableProps<T>['groupColumn'];
|
|
819
894
|
onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
|
|
@@ -826,6 +901,7 @@ interface InfiniteTableMappedState<T> {
|
|
|
826
901
|
onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
|
|
827
902
|
onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
|
|
828
903
|
onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
|
|
904
|
+
autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
|
|
829
905
|
scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
|
|
830
906
|
onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
|
|
831
907
|
onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
|
|
@@ -848,6 +924,7 @@ interface InfiniteTableMappedState<T> {
|
|
|
848
924
|
columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
|
|
849
925
|
columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
|
|
850
926
|
columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
|
|
927
|
+
columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
|
|
851
928
|
draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
|
|
852
929
|
sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
|
|
853
930
|
hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
|
|
@@ -872,6 +949,7 @@ interface InfiniteTableDerivedState<T> {
|
|
|
872
949
|
computedColumns: Map<string, InfiniteTableColumn<T>>;
|
|
873
950
|
virtualizeHeader: boolean;
|
|
874
951
|
groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
|
|
952
|
+
columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
|
|
875
953
|
columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
|
|
876
954
|
columnGroupsMaxDepth: number;
|
|
877
955
|
computedColumnGroups: InfiniteTablePropColumnGroupsMap;
|
|
@@ -942,6 +1020,45 @@ declare namespace InfiniteTable {
|
|
|
942
1020
|
};
|
|
943
1021
|
}
|
|
944
1022
|
|
|
1023
|
+
declare function useDataSource<T>(): DataSourceState<T>;
|
|
1024
|
+
|
|
1025
|
+
declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
|
|
1026
|
+
|
|
1027
|
+
declare type ForwardPropsToStateFnResult<TYPE_PROPS, TYPE_RESULT> = Partial<{
|
|
1028
|
+
[propName in keyof TYPE_PROPS & keyof TYPE_RESULT]: 1 | ((value: TYPE_PROPS[propName]) => TYPE_RESULT[propName]);
|
|
1029
|
+
}>;
|
|
1030
|
+
declare type ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT_SETUP_STATE = {}, COMPONENT_DERIVED_STATE = {}, T_ACTIONS = {}, T_PARENT_STATE = {}> = {
|
|
1031
|
+
debugName?: string;
|
|
1032
|
+
initSetupState?: () => COMPONENT_SETUP_STATE;
|
|
1033
|
+
forwardProps?: (setupState: COMPONENT_SETUP_STATE) => ForwardPropsToStateFnResult<T_PROPS, COMPONENT_MAPPED_STATE>;
|
|
1034
|
+
allowedControlledPropOverrides?: Record<keyof T_PROPS, true>;
|
|
1035
|
+
interceptActions?: ComponentInterceptedActions<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>;
|
|
1036
|
+
onPropChange?: (params: {
|
|
1037
|
+
name: keyof T_PROPS;
|
|
1038
|
+
oldValue: any;
|
|
1039
|
+
newValue: any;
|
|
1040
|
+
}, props: T_PROPS, actions: ComponentStateActions<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>) => void;
|
|
1041
|
+
mapPropsToState?: (params: {
|
|
1042
|
+
props: T_PROPS;
|
|
1043
|
+
state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & Partial<COMPONENT_DERIVED_STATE>;
|
|
1044
|
+
oldState: null | (COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & Partial<COMPONENT_DERIVED_STATE>);
|
|
1045
|
+
parentState: T_PARENT_STATE | null;
|
|
1046
|
+
}) => COMPONENT_DERIVED_STATE;
|
|
1047
|
+
concludeReducer?: (params: {
|
|
1048
|
+
previousState: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
1049
|
+
state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
1050
|
+
updatedProps: Partial<T_PROPS> | null;
|
|
1051
|
+
parentState: T_PARENT_STATE | null;
|
|
1052
|
+
}) => COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
1053
|
+
getReducerActions?: (dispatch: React$1.Dispatch<any>) => T_ACTIONS;
|
|
1054
|
+
getParentState?: () => T_PARENT_STATE;
|
|
1055
|
+
onControlledPropertyChange?: (name: string, newValue: any, oldValue: any) => void | ((value: any, oldValue: any) => any);
|
|
1056
|
+
};
|
|
1057
|
+
declare function getComponentStateRoot<T_PROPS, COMPONENT_MAPPED_STATE extends object, COMPONENT_SETUP_STATE extends object = {}, COMPONENT_DERIVED_STATE extends object = {}, T_ACTIONS = {}, T_PARENT_STATE = {}>(config: ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT_SETUP_STATE, COMPONENT_DERIVED_STATE, T_ACTIONS, T_PARENT_STATE>): React$1.NamedExoticComponent<T_PROPS & {
|
|
1058
|
+
children: React$1.ReactNode;
|
|
1059
|
+
}>;
|
|
1060
|
+
declare function useComponentState<COMPONENT_STATE>(): ComponentStateContext<COMPONENT_STATE, ComponentStateGeneratedActions<COMPONENT_STATE>>;
|
|
1061
|
+
|
|
945
1062
|
declare type InterceptedMapFns<K, V> = {
|
|
946
1063
|
set?: (k: K, v: V) => void;
|
|
947
1064
|
beforeClear?: (map: Map<K, V>) => void;
|
|
@@ -958,4 +1075,4 @@ declare function interceptMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>
|
|
|
958
1075
|
|
|
959
1076
|
declare function useEffectWithChanges(fn: (changes: Record<string, any>, prevValues: Record<string, any>) => void | (() => void), deps: Record<string, any>): void;
|
|
960
1077
|
|
|
961
|
-
export { DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceExpandedAndCollapsedGroupRows, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropGroupBy, DataSourcePropLivePaginationCursor, DataSourcePropPivotBy, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableImperativeApi, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyGroupRowInfo, Scrollbars, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges };
|
|
1078
|
+
export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceExpandedAndCollapsedGroupRows, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropGroupBy, DataSourcePropLivePaginationCursor, DataSourcePropPivotBy, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableImperativeApi, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyGroupRowInfo, Scrollbars, debounce, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges };
|