@infinite-table/infinite-react 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +81 -64
- package/index.d.ts +290 -185
- package/index.esm.css +81 -64
- package/index.esm.js +1472 -935
- package/index.js +1478 -942
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { CSSProperties, HTMLProps, RefCallback, MutableRefObject, MouseEvent, KeyboardEvent } from 'react';
|
|
3
3
|
|
|
4
|
+
declare type SortDir = 1 | -1;
|
|
5
|
+
declare type MultisortInfo<T> = {
|
|
6
|
+
/**
|
|
7
|
+
* The sorting direction
|
|
8
|
+
*/
|
|
9
|
+
dir: SortDir;
|
|
10
|
+
/**
|
|
11
|
+
* for now 'string' and 'number' are known types, meaning they have
|
|
12
|
+
* sort functions already implemented
|
|
13
|
+
*/
|
|
14
|
+
type?: string;
|
|
15
|
+
fn?: (a: any, b: any) => number;
|
|
16
|
+
/**
|
|
17
|
+
* a property whose value to use for sorting on the array items
|
|
18
|
+
*/
|
|
19
|
+
field?: keyof T;
|
|
20
|
+
/**
|
|
21
|
+
* or a function to retrieve the item value to use for sorting
|
|
22
|
+
*/
|
|
23
|
+
valueGetter?: (item: T) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const multisort: {
|
|
26
|
+
<T>(sortInfo: MultisortInfo<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
|
|
27
|
+
knownTypes: {
|
|
28
|
+
[key: string]: (first: any, second: any) => number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
4
32
|
declare type VoidFn$1 = () => void;
|
|
5
33
|
declare type Pair<KeyType, ValueType> = {
|
|
6
34
|
value?: ValueType;
|
|
7
35
|
map?: Map<KeyType, Pair<KeyType, ValueType>>;
|
|
36
|
+
length: number;
|
|
8
37
|
revision?: number;
|
|
9
38
|
};
|
|
10
39
|
declare type DeepMapVisitFn<KeyType, ValueType> = (pair: Pair<KeyType, ValueType>, keys: KeyType[], next: VoidFn$1) => void;
|
|
@@ -16,9 +45,11 @@ declare class DeepMap<KeyType, ValueType> {
|
|
|
16
45
|
static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
|
|
17
46
|
constructor(initial?: [KeyType[], ValueType][]);
|
|
18
47
|
fill(initial?: [KeyType[], ValueType][]): void;
|
|
19
|
-
getValuesStartingWith(keys: KeyType[]): ValueType[];
|
|
20
|
-
getKeysStartingWith(keys: KeyType[]): KeyType[][];
|
|
48
|
+
getValuesStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): ValueType[];
|
|
49
|
+
getKeysStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): KeyType[][];
|
|
21
50
|
private getStartingWith;
|
|
51
|
+
private getMapAt;
|
|
52
|
+
getAllChildrenSizeFor(keys: KeyType[]): number;
|
|
22
53
|
getDirectChildrenSizeFor(keys: KeyType[]): number;
|
|
23
54
|
set(keys: KeyType[] & {
|
|
24
55
|
length: Omit<number, 0>;
|
|
@@ -33,6 +64,7 @@ declare class DeepMap<KeyType, ValueType> {
|
|
|
33
64
|
visitDepthFirst: (fn: (value: ValueType, keys: KeyType[], indexInGroup: number, next?: VoidFn$1 | undefined) => void) => void;
|
|
34
65
|
private visitWithNext;
|
|
35
66
|
private getArray;
|
|
67
|
+
valuesAt(keys: KeyType[]): ValueType[];
|
|
36
68
|
values(): Generator<ValueType, void, unknown>;
|
|
37
69
|
keys(): Generator<KeyType[], void, unknown>;
|
|
38
70
|
entries(): Generator<[KeyType[], ValueType], void, unknown>;
|
|
@@ -42,34 +74,6 @@ declare class DeepMap<KeyType, ValueType> {
|
|
|
42
74
|
private sortedIterator;
|
|
43
75
|
}
|
|
44
76
|
|
|
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
|
-
};
|
|
72
|
-
|
|
73
77
|
declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
|
|
74
78
|
getComponentState: () => T_STATE;
|
|
75
79
|
componentState: T_STATE;
|
|
@@ -87,7 +91,7 @@ declare type ComponentInterceptedActions<T_STATE> = {
|
|
|
87
91
|
declare type ComponentMappedCallbacks<T_STATE> = {
|
|
88
92
|
[k in keyof T_STATE]: (value: T_STATE[k], state: T_STATE) => {
|
|
89
93
|
callbackName: string;
|
|
90
|
-
|
|
94
|
+
callbackParams: any[];
|
|
91
95
|
};
|
|
92
96
|
};
|
|
93
97
|
declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
|
|
@@ -111,7 +115,7 @@ declare type InfiniteTableAction = {
|
|
|
111
115
|
|
|
112
116
|
declare type Renderable = React$1.ReactNode | JSX.Element;
|
|
113
117
|
|
|
114
|
-
declare function useInfiniteHeaderCell<T>():
|
|
118
|
+
declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParam<T, InfiniteTableComputedColumn<T>>;
|
|
115
119
|
|
|
116
120
|
declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
|
|
117
121
|
|
|
@@ -158,13 +162,22 @@ declare type DiscriminatedUnion<A, B> = (A & {
|
|
|
158
162
|
|
|
159
163
|
declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
|
|
160
164
|
declare type InfiniteTableSelectRowFn = (id: any) => void;
|
|
161
|
-
declare type
|
|
165
|
+
declare type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
162
166
|
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
163
|
-
sortTool: JSX.Element | null;
|
|
164
167
|
dragging: boolean;
|
|
165
168
|
column: COL_TYPE;
|
|
169
|
+
columnsMap: Map<string, COL_TYPE>;
|
|
166
170
|
columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
|
|
167
171
|
columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
|
|
172
|
+
selectionMode: DataSourcePropSelectionMode;
|
|
173
|
+
allRowsSelected: boolean;
|
|
174
|
+
someRowsSelected: boolean;
|
|
175
|
+
api: InfiniteTableApi<DATA_TYPE>;
|
|
176
|
+
renderBag: {
|
|
177
|
+
header: string | number | Renderable;
|
|
178
|
+
sortIcon?: Renderable;
|
|
179
|
+
selectionCheckBox?: Renderable;
|
|
180
|
+
};
|
|
168
181
|
};
|
|
169
182
|
declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
170
183
|
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
@@ -178,6 +191,7 @@ declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTa
|
|
|
178
191
|
rowIndex: number;
|
|
179
192
|
rowActive: boolean;
|
|
180
193
|
column: COL_TYPE;
|
|
194
|
+
columnsMap: Map<string, COL_TYPE>;
|
|
181
195
|
toggleCurrentGroupRow: () => void;
|
|
182
196
|
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
183
197
|
toggleCurrentGroupRowSelection: () => void;
|
|
@@ -204,7 +218,7 @@ declare type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE =
|
|
|
204
218
|
isGroupRow: true;
|
|
205
219
|
}) => Renderable | null;
|
|
206
220
|
declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
207
|
-
declare type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams:
|
|
221
|
+
declare type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParam<T>) => Renderable;
|
|
208
222
|
declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
|
|
209
223
|
declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
|
|
210
224
|
declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
|
|
@@ -212,11 +226,11 @@ declare type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
|
|
|
212
226
|
declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
|
|
213
227
|
declare type InfiniteTableColumnStyleFnParams<T> = {
|
|
214
228
|
value: Renderable;
|
|
215
|
-
column:
|
|
229
|
+
column: InfiniteTableComputedColumn<T>;
|
|
216
230
|
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
217
231
|
declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
|
|
218
|
-
declare type InfiniteTableColumnHeaderClassNameFn<T> = (params:
|
|
219
|
-
declare type InfiniteTableColumnHeaderStyleFn<T> = (params:
|
|
232
|
+
declare type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
|
|
233
|
+
declare type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React.CSSProperties;
|
|
220
234
|
declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
|
|
221
235
|
declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
|
|
222
236
|
declare type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
|
|
@@ -243,6 +257,7 @@ declare type InfiniteTableBaseColumn<T> = {
|
|
|
243
257
|
verticalAlign?: InfiniteTableColumnVerticalAlign;
|
|
244
258
|
columnGroup?: string;
|
|
245
259
|
header?: InfiniteTableColumnHeader<T>;
|
|
260
|
+
renderHeader?: InfiniteTableColumnHeaderRenderFunction<T>;
|
|
246
261
|
name?: Renderable;
|
|
247
262
|
cssEllipsis?: boolean;
|
|
248
263
|
headerCssEllipsis?: boolean;
|
|
@@ -268,7 +283,9 @@ declare type InfiniteTableBaseColumn<T> = {
|
|
|
268
283
|
minWidth?: number;
|
|
269
284
|
maxWidth?: number;
|
|
270
285
|
renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
|
|
286
|
+
renderSortIcon?: InfiniteTableColumnHeaderRenderFunction<T>;
|
|
271
287
|
renderSelectionCheckBox?: boolean | InfiniteTableColumnRenderFunction<T>;
|
|
288
|
+
renderHeaderSelectionCheckBox?: boolean | InfiniteTableColumnHeaderRenderFunction<T>;
|
|
272
289
|
components?: {
|
|
273
290
|
ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
|
|
274
291
|
HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
|
|
@@ -619,12 +636,142 @@ declare class MatrixBrain extends Logger {
|
|
|
619
636
|
destroy: () => void;
|
|
620
637
|
}
|
|
621
638
|
|
|
639
|
+
declare type RowSelectionStateItem = (any | any[])[];
|
|
640
|
+
declare type RowSelectionStateObject = {
|
|
641
|
+
selectedRows: RowSelectionStateItem;
|
|
642
|
+
deselectedRows: RowSelectionStateItem;
|
|
643
|
+
defaultSelection: boolean;
|
|
644
|
+
} | {
|
|
645
|
+
defaultSelection: true;
|
|
646
|
+
deselectedRows: RowSelectionStateItem;
|
|
647
|
+
selectedRows?: RowSelectionStateItem;
|
|
648
|
+
} | {
|
|
649
|
+
defaultSelection: false;
|
|
650
|
+
selectedRows: RowSelectionStateItem;
|
|
651
|
+
deselectedRows?: RowSelectionStateItem;
|
|
652
|
+
};
|
|
653
|
+
declare type RowSelectionStateConfig<T> = {
|
|
654
|
+
groupBy: DataSourceState<T>['groupBy'];
|
|
655
|
+
groupDeepMap: DataSourceState<T>['groupDeepMap'];
|
|
656
|
+
totalCount: number;
|
|
657
|
+
indexer: DataSourceState<T>['indexer'];
|
|
658
|
+
lazyLoad: boolean;
|
|
659
|
+
};
|
|
660
|
+
declare type GetRowSelectionStateConfig<T> = () => RowSelectionStateConfig<T>;
|
|
661
|
+
declare type RowSelectionStateOverrideForTesting = {
|
|
662
|
+
getGroupKeysForPrimaryKey: RowSelectionState<any>['getGroupKeysForPrimaryKey'];
|
|
663
|
+
getGroupByLength: RowSelectionState<any>['getGroupByLength'];
|
|
664
|
+
getGroupCount: RowSelectionState<any>['getGroupCount'];
|
|
665
|
+
getGroupKeysDirectlyInsideGroup: RowSelectionState<any>['getGroupKeysDirectlyInsideGroup'];
|
|
666
|
+
};
|
|
667
|
+
declare class RowSelectionState<T = any> {
|
|
668
|
+
selectedRows: RowSelectionStateItem | null;
|
|
669
|
+
deselectedRows: RowSelectionStateItem | null;
|
|
670
|
+
defaultSelection: boolean;
|
|
671
|
+
selectedMap: DeepMap<any, true>;
|
|
672
|
+
deselectedMap: DeepMap<any, true>;
|
|
673
|
+
selectionCache: DeepMap<any, boolean | null>;
|
|
674
|
+
selectionCountCache: DeepMap<any, {
|
|
675
|
+
selectedCount: number;
|
|
676
|
+
deselectedCount: number;
|
|
677
|
+
}>;
|
|
678
|
+
getConfig: GetRowSelectionStateConfig<T>;
|
|
679
|
+
getGroupKeysForPrimaryKey(pk: any): any[];
|
|
680
|
+
getGroupDeepMap(): DeepMap<any, DeepMapGroupValueType<T, any>> | undefined;
|
|
681
|
+
getGroupCount(groupKeys: any[]): number;
|
|
682
|
+
getGroupKeysDirectlyInsideGroup(groupKeys: any[]): any[][];
|
|
683
|
+
getGroupByLength(): number;
|
|
684
|
+
static from<T>(rowSeleStateObject: RowSelectionStateObject, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverrideForTesting): RowSelectionState<T>;
|
|
685
|
+
constructor(state: RowSelectionStateObject | RowSelectionState, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverrideForTesting);
|
|
686
|
+
mapSet: (name: 'selected' | 'deselected', key: any | any[]) => void;
|
|
687
|
+
_selectedMapSet: (key: any | any[]) => void;
|
|
688
|
+
_deselectedMapSet: (key: any | any[]) => void;
|
|
689
|
+
update(stateObject: RowSelectionStateObject): void;
|
|
690
|
+
private xcache;
|
|
691
|
+
getState(): RowSelectionStateObject;
|
|
692
|
+
deselectAll(): void;
|
|
693
|
+
selectAll(): void;
|
|
694
|
+
isRowDefaultSelected(): boolean;
|
|
695
|
+
isRowDefaultDeselected(): boolean;
|
|
696
|
+
/**
|
|
697
|
+
*
|
|
698
|
+
* @param key the id of the row - if a row in a grouped datasource, this is the final row id, without the group keys
|
|
699
|
+
* @param groupKeys the keys of row parents, in order
|
|
700
|
+
* @returns Whether the row is selected or not.
|
|
701
|
+
*/
|
|
702
|
+
isRowSelected(key: any, groupKeys?: any[]): boolean;
|
|
703
|
+
isRowDeselected(key: any, groupKeys?: any[]): boolean;
|
|
704
|
+
setRowSelected(key: string | number, selected: boolean, groupKeys?: any[]): void;
|
|
705
|
+
/**
|
|
706
|
+
* Returns if the selection state ('full','partial','none') for the current group
|
|
707
|
+
*
|
|
708
|
+
* The selection state will be full (true) if either of those are true:
|
|
709
|
+
* * the group keys are specified as selected
|
|
710
|
+
* * all the children are specified as selected
|
|
711
|
+
*
|
|
712
|
+
* The selection state will be partial (null) if either of those are true:
|
|
713
|
+
* * the group keys are partially selected
|
|
714
|
+
* * some of the children are specified as selected
|
|
715
|
+
*
|
|
716
|
+
*
|
|
717
|
+
* @param groupKeys the keys of the group row
|
|
718
|
+
* @param children leaf children that belong to the group
|
|
719
|
+
* @returns boolean
|
|
720
|
+
*/
|
|
721
|
+
getGroupRowSelectionState(initialGroupKeys: any[]): boolean | null;
|
|
722
|
+
private getGroupRowBooleanSelectionStateFromParent;
|
|
723
|
+
isGroupRowPartlySelected(groupKeys: any[]): boolean;
|
|
724
|
+
isGroupRowSelected(groupKeys: any[]): boolean;
|
|
725
|
+
isGroupRowDeselected(groupKeys: any[]): boolean;
|
|
726
|
+
selectGroupRow(groupKeys: any[]): void;
|
|
727
|
+
deselectGroupRow(groupKeys: any[]): void;
|
|
728
|
+
setRowAsSelected(key: string | number, groupKeys?: any[]): void;
|
|
729
|
+
setRowAsDeselected(key: string | number, groupKeys?: any[]): void;
|
|
730
|
+
deselectRow(key: any, groupKeys?: any[]): void;
|
|
731
|
+
selectRow(key: any, groupKeys?: any[]): void;
|
|
732
|
+
toggleGroupRowSelection(groupKeys: any[]): void;
|
|
733
|
+
toggleRowSelection(key: string | number, groupKeys?: any[] | undefined): void;
|
|
734
|
+
getSelectedCount(): number;
|
|
735
|
+
getDeselectedCount(): number;
|
|
736
|
+
getSelectionCountFor(groupKeys?: any[], parentSelected?: boolean): {
|
|
737
|
+
selectedCount: number;
|
|
738
|
+
deselectedCount: number;
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
declare type MultiRowSelectorOptions = {
|
|
743
|
+
getIdForIndex: (index: number) => string | number;
|
|
744
|
+
};
|
|
745
|
+
declare class MultiRowSelector {
|
|
746
|
+
getIdForIndex: MultiRowSelectorOptions['getIdForIndex'];
|
|
747
|
+
multiSelectStartIndex: number;
|
|
748
|
+
multiSelectEndIndex?: number;
|
|
749
|
+
_rowSelectionState: RowSelectionState;
|
|
750
|
+
constructor(options: MultiRowSelectorOptions);
|
|
751
|
+
set rowSelectionState(rowSelectionState: RowSelectionState);
|
|
752
|
+
get rowSelectionState(): RowSelectionState;
|
|
753
|
+
private selectRange;
|
|
754
|
+
private deselectRange;
|
|
755
|
+
/**
|
|
756
|
+
* This is the single click, without any modifier
|
|
757
|
+
*/
|
|
758
|
+
resetClick(index: number): void;
|
|
759
|
+
/**
|
|
760
|
+
* This is the click with ctrl/cmd key pressed
|
|
761
|
+
* @param index
|
|
762
|
+
*/
|
|
763
|
+
singleAddClick(index: number): void;
|
|
764
|
+
multiSelectClick(index: number): void;
|
|
765
|
+
}
|
|
766
|
+
|
|
622
767
|
interface InfiniteTableComputedValues<T> {
|
|
623
768
|
scrollbars: {
|
|
624
769
|
vertical: boolean;
|
|
625
770
|
horizontal: boolean;
|
|
626
771
|
};
|
|
772
|
+
multiRowSelector: MultiRowSelector;
|
|
627
773
|
showColumnFilters: boolean;
|
|
774
|
+
renderSelectionCheckBox: boolean;
|
|
628
775
|
rowspan?: MatrixBrainOptions['rowspan'];
|
|
629
776
|
computedPinnedStartOverflow: boolean;
|
|
630
777
|
computedPinnedEndOverflow: boolean;
|
|
@@ -840,6 +987,7 @@ interface InfiniteTableMappedState<T> {
|
|
|
840
987
|
draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
|
|
841
988
|
sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
|
|
842
989
|
hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
|
|
990
|
+
keyboardSelection: NonUndefined<InfiniteTableProps<T>['keyboardSelection']>;
|
|
843
991
|
columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
|
|
844
992
|
showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
|
|
845
993
|
showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
|
|
@@ -874,7 +1022,7 @@ interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTab
|
|
|
874
1022
|
}
|
|
875
1023
|
|
|
876
1024
|
interface InfiniteTableContextValue<T> {
|
|
877
|
-
imperativeApi:
|
|
1025
|
+
imperativeApi: InfiniteTableApi<T>;
|
|
878
1026
|
componentState: InfiniteTableState<T>;
|
|
879
1027
|
componentActions: InfiniteTableActions<T>;
|
|
880
1028
|
computed: InfiniteTableComputedValues<T>;
|
|
@@ -887,70 +1035,59 @@ declare type RenderRange = {
|
|
|
887
1035
|
renderEndIndex: number;
|
|
888
1036
|
};
|
|
889
1037
|
|
|
890
|
-
declare
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
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>;
|
|
1038
|
+
declare type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
|
|
1039
|
+
declare type BooleanDeepCollectionStateObject<KeyType> = {
|
|
1040
|
+
positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
|
|
1041
|
+
negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
|
|
1042
|
+
};
|
|
1043
|
+
declare abstract class BooleanDeepCollectionState<StateObject, KeyType extends any = any> {
|
|
1044
|
+
protected positiveMap?: DeepMap<KeyType, true>;
|
|
1045
|
+
protected negativeMap?: DeepMap<KeyType, true>;
|
|
907
1046
|
protected allNegative: boolean;
|
|
908
1047
|
protected allPositive: boolean;
|
|
909
1048
|
private initialState;
|
|
910
|
-
constructor(state:
|
|
911
|
-
abstract getPositiveFromState(state: StateObject):
|
|
912
|
-
abstract getNegativeFromState(state: StateObject):
|
|
1049
|
+
constructor(state: BooleanDeepCollectionStateObject<KeyType> | BooleanDeepCollectionState<StateObject, KeyType>);
|
|
1050
|
+
abstract getPositiveFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
|
|
1051
|
+
abstract getNegativeFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
|
|
913
1052
|
abstract getState(): StateObject;
|
|
914
|
-
protected getInitialState():
|
|
1053
|
+
protected getInitialState(): BooleanDeepCollectionStateObject<KeyType>;
|
|
915
1054
|
destroy(): void;
|
|
916
1055
|
private update;
|
|
917
|
-
protected isDefaultNegativeSelection(): boolean;
|
|
918
|
-
protected isDefaultPositiveSelection(): boolean;
|
|
919
1056
|
protected areAllNegative(): boolean;
|
|
920
1057
|
protected areAllPositive(): boolean;
|
|
921
1058
|
protected makeAllNegative(): void;
|
|
922
1059
|
protected makeAllPositive(): void;
|
|
923
|
-
protected isItemPositive(
|
|
924
|
-
protected isItemNegative(
|
|
925
|
-
protected setItemValue(
|
|
926
|
-
protected makeItemNegative(
|
|
927
|
-
protected makeItemPositive(
|
|
928
|
-
protected toggleItem(
|
|
1060
|
+
protected isItemPositive(keys: KeyType[]): boolean | undefined;
|
|
1061
|
+
protected isItemNegative(keys: KeyType[]): boolean;
|
|
1062
|
+
protected setItemValue(keys: KeyType[], shouldMakePositive: boolean): void;
|
|
1063
|
+
protected makeItemNegative(keys: KeyType[]): void;
|
|
1064
|
+
protected makeItemPositive(keys: KeyType[]): void;
|
|
1065
|
+
protected toggleItem(keys: KeyType[]): void;
|
|
929
1066
|
}
|
|
930
1067
|
|
|
931
|
-
declare
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1068
|
+
declare class GroupRowsState<KeyType extends any = any> extends BooleanDeepCollectionState<DataSourcePropGroupRowsStateObject<KeyType>, KeyType> {
|
|
1069
|
+
constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
|
|
1070
|
+
getState(): DataSourcePropGroupRowsStateObject<KeyType>;
|
|
1071
|
+
getPositiveFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
|
|
1072
|
+
getNegativeFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
|
|
1073
|
+
areAllCollapsed(): boolean;
|
|
1074
|
+
areAllExpanded(): boolean;
|
|
1075
|
+
collapseAll(): void;
|
|
1076
|
+
expandAll(): void;
|
|
1077
|
+
isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
|
|
1078
|
+
isGroupRowCollapsed(keys: KeyType[]): boolean;
|
|
1079
|
+
setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
|
|
1080
|
+
collapseGroupRow(keys: KeyType[]): void;
|
|
1081
|
+
expandGroupRow(keys: KeyType[]): void;
|
|
1082
|
+
toggleGroupRow(keys: KeyType[]): void;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
declare class Indexer<DataType, PrimaryKeyType = string> {
|
|
1086
|
+
primaryKeyToData: Map<string, DataType>;
|
|
1087
|
+
add: (primaryKey: PrimaryKeyType, data: DataType) => void;
|
|
1088
|
+
clear: () => void;
|
|
1089
|
+
getDataForPrimaryKey: (primaryKey: PrimaryKeyType) => DataType | undefined;
|
|
1090
|
+
indexArray: (arr: DataType[], toPrimaryKey: (data: DataType) => PrimaryKeyType) => void;
|
|
954
1091
|
}
|
|
955
1092
|
|
|
956
1093
|
interface DataSourceDataParams<T> {
|
|
@@ -1021,7 +1158,7 @@ declare type DataSourceAggregationReducer<T, AggregationResultType> = {
|
|
|
1021
1158
|
field?: keyof T;
|
|
1022
1159
|
initialValue?: AggregationResultType;
|
|
1023
1160
|
getter?: (data: T) => any;
|
|
1024
|
-
reducer: string | ((accumulator: any, value: any, data: T, index: number) => AggregationResultType | any);
|
|
1161
|
+
reducer: string | ((accumulator: any, value: any, data: T, index: number, groupKeys: any[] | undefined) => AggregationResultType | any);
|
|
1025
1162
|
done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
|
|
1026
1163
|
pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
|
|
1027
1164
|
column: InfiniteTablePivotFinalColumnVariant<T>;
|
|
@@ -1036,6 +1173,7 @@ declare type LazyGroupDataItem<DataType> = {
|
|
|
1036
1173
|
keys: any[];
|
|
1037
1174
|
aggregations?: Record<string, any>;
|
|
1038
1175
|
dataset?: DataSourceRemoteData<DataType>;
|
|
1176
|
+
totalChildrenCount?: number;
|
|
1039
1177
|
pivot?: {
|
|
1040
1178
|
values: Record<string, any>;
|
|
1041
1179
|
totals?: Record<string, any>;
|
|
@@ -1055,7 +1193,7 @@ declare type LazyRowInfoGroup<DataType> = {
|
|
|
1055
1193
|
};
|
|
1056
1194
|
declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
|
|
1057
1195
|
interface DataSourceSetupState<T> {
|
|
1058
|
-
indexer: Indexer
|
|
1196
|
+
indexer: Indexer<T, any>;
|
|
1059
1197
|
unfilteredCount: number;
|
|
1060
1198
|
filteredCount: number;
|
|
1061
1199
|
lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
|
|
@@ -1077,7 +1215,7 @@ interface DataSourceSetupState<T> {
|
|
|
1077
1215
|
groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
|
|
1078
1216
|
reducerResults?: Record<string, AggregationReducerResult>;
|
|
1079
1217
|
allRowsSelected: boolean;
|
|
1080
|
-
|
|
1218
|
+
someRowsSelected: boolean;
|
|
1081
1219
|
pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
|
|
1082
1220
|
pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
|
|
1083
1221
|
cursorId: number | symbol | DataSourceLivePaginationCursorValue;
|
|
@@ -1096,33 +1234,23 @@ interface DataSourceSetupState<T> {
|
|
|
1096
1234
|
declare type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
|
|
1097
1235
|
declare type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
|
|
1098
1236
|
declare type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
|
|
1099
|
-
declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject
|
|
1237
|
+
declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
|
|
1100
1238
|
declare type DataSourcePropRowSelection_SingleRow = null | string | number;
|
|
1101
1239
|
declare type DataSourcePropCellSelection = any;
|
|
1102
1240
|
declare type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
|
|
1103
|
-
declare type DataSourcePropOnRowSelectionChange_MultiRow = (
|
|
1104
|
-
|
|
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;
|
|
1241
|
+
declare type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
|
|
1242
|
+
declare type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
|
|
1112
1243
|
declare type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
|
|
1113
1244
|
declare type DataSourcePropOnCellSelectionChange = (cellSelectionParams: any) => void;
|
|
1114
|
-
declare type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>,
|
|
1245
|
+
declare type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelectionState: RowSelectionState, selectionMode: 'multi-row') => boolean | null;
|
|
1115
1246
|
declare type DataSourceProps<T> = {
|
|
1116
1247
|
children: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
|
|
1117
|
-
primaryKey: keyof T | ((
|
|
1118
|
-
data: T;
|
|
1119
|
-
index: number;
|
|
1120
|
-
}) => string);
|
|
1248
|
+
primaryKey: keyof T | ((data: T) => string);
|
|
1121
1249
|
fields?: (keyof T)[];
|
|
1122
1250
|
data: DataSourceData<T>;
|
|
1123
1251
|
selectionMode?: DataSourcePropSelectionMode;
|
|
1124
|
-
rowSelection?:
|
|
1125
|
-
defaultRowSelection?:
|
|
1252
|
+
rowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
|
|
1253
|
+
defaultRowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
|
|
1126
1254
|
cellSelection?: DataSourcePropCellSelection;
|
|
1127
1255
|
defaultCellSelection?: DataSourcePropCellSelection;
|
|
1128
1256
|
onCellSelectionChange?: DataSourcePropOnCellSelectionChange;
|
|
@@ -1230,14 +1358,14 @@ interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedS
|
|
|
1230
1358
|
declare type DataSourceDerivedState<T> = {
|
|
1231
1359
|
toPrimaryKey: (data: T) => any;
|
|
1232
1360
|
operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
|
|
1233
|
-
rowSelection: RowSelectionState | null | number | string;
|
|
1234
|
-
selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
|
|
1235
1361
|
filterMode: NonUndefined<DataSourceProps<T>['filterMode']>;
|
|
1236
1362
|
multiSort: boolean;
|
|
1237
1363
|
controlledSort: boolean;
|
|
1238
1364
|
controlledFilter: boolean;
|
|
1239
1365
|
livePaginationCursor?: DataSourceLivePaginationCursorValue;
|
|
1240
1366
|
lazyLoadBatchSize?: number;
|
|
1367
|
+
rowSelection: RowSelectionState | null | number | string;
|
|
1368
|
+
selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
|
|
1241
1369
|
};
|
|
1242
1370
|
declare type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
|
|
1243
1371
|
interface DataSourceContextValue<T> {
|
|
@@ -1256,52 +1384,11 @@ interface DataSourceReducer<T> {
|
|
|
1256
1384
|
(state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
|
|
1257
1385
|
}
|
|
1258
1386
|
|
|
1259
|
-
declare
|
|
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
|
-
}
|
|
1387
|
+
declare const defaultFilterTypes: Record<string, DataSourceFilterType<any>>;
|
|
1288
1388
|
|
|
1289
|
-
declare
|
|
1290
|
-
|
|
1291
|
-
|
|
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
|
-
}
|
|
1389
|
+
declare function useDataSource<T>(): DataSourceState<T>;
|
|
1390
|
+
|
|
1391
|
+
declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
|
|
1305
1392
|
|
|
1306
1393
|
declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
|
|
1307
1394
|
id: string;
|
|
@@ -1343,7 +1430,7 @@ declare type InfiniteTable_RowInfoBase<_T> = {
|
|
|
1343
1430
|
id: any;
|
|
1344
1431
|
value?: any;
|
|
1345
1432
|
indexInAll: number;
|
|
1346
|
-
rowSelected: boolean;
|
|
1433
|
+
rowSelected: boolean | null;
|
|
1347
1434
|
};
|
|
1348
1435
|
declare type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
|
|
1349
1436
|
dataSourceHasGrouping: true;
|
|
@@ -1354,10 +1441,6 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
|
|
|
1354
1441
|
dataSourceHasGrouping: true;
|
|
1355
1442
|
data: Partial<T> | null;
|
|
1356
1443
|
isGroupRow: true;
|
|
1357
|
-
/**
|
|
1358
|
-
* The count of all selected leaf nodes (normal rows) inside the group that are selected
|
|
1359
|
-
*/
|
|
1360
|
-
childrenSelectedCount: number;
|
|
1361
1444
|
/**
|
|
1362
1445
|
* This array contains all the (uncollapsed, so visible) row infos under this group, at any level of nesting,
|
|
1363
1446
|
* in the order in which they are visible in the table
|
|
@@ -1375,6 +1458,23 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
|
|
|
1375
1458
|
* The array of all leaf nodes (normal rows) that are inside this group.
|
|
1376
1459
|
*/
|
|
1377
1460
|
groupData: T[];
|
|
1461
|
+
/**
|
|
1462
|
+
* The count of all selected leaf nodes (normal rows) inside the group that are selected
|
|
1463
|
+
*/
|
|
1464
|
+
selectedChildredCount: number;
|
|
1465
|
+
/**
|
|
1466
|
+
* The count of all deselected leaf nodes (normal rows) inside the group that are selected
|
|
1467
|
+
*/
|
|
1468
|
+
deselectedChildredCount: number;
|
|
1469
|
+
/**
|
|
1470
|
+
* Will be used only with lazy loading, if the server provides this info on the data items.
|
|
1471
|
+
*
|
|
1472
|
+
* Represents the total count of all leaf nodes (normal rows) that are under this group
|
|
1473
|
+
* at any level (so not only direct children). This is needed for multiple selection to work properly,
|
|
1474
|
+
* so the table component knows how many rows are on the remote backend, and whether to show a group as selected or not
|
|
1475
|
+
* when it has a certain number of rows selected
|
|
1476
|
+
*/
|
|
1477
|
+
totalChildrenCount?: number;
|
|
1378
1478
|
/**
|
|
1379
1479
|
* The count of all leaf nodes (normal rows) inside the group that are not being visible
|
|
1380
1480
|
* due to collapsing (either the current row is collapsed or any of its children)
|
|
@@ -1524,6 +1624,7 @@ declare type DeepMapGroupValueType<DataType, KeyType> = {
|
|
|
1524
1624
|
commonData?: Partial<DataType>;
|
|
1525
1625
|
childrenLoading: boolean;
|
|
1526
1626
|
childrenAvailable: boolean;
|
|
1627
|
+
totalChildrenCount?: number;
|
|
1527
1628
|
cache: boolean;
|
|
1528
1629
|
error?: string;
|
|
1529
1630
|
reducerResults: Record<string, AggregationReducerResult>;
|
|
@@ -1568,6 +1669,23 @@ declare type InfiniteCheckBoxProps = {
|
|
|
1568
1669
|
};
|
|
1569
1670
|
declare function InfiniteCheckBox(props: InfiniteCheckBoxProps): JSX.Element;
|
|
1570
1671
|
|
|
1672
|
+
declare type ArrayOfIds = Pick<InfiniteTable_RowInfoBase<any>, 'id'>[];
|
|
1673
|
+
declare type InfiniteTableSelectionApi = {
|
|
1674
|
+
get allRowsSelected(): boolean;
|
|
1675
|
+
isRowSelected(pk: any, groupKeys?: any[]): boolean;
|
|
1676
|
+
isRowDeselected(pk: any, groupKeys?: any[]): boolean;
|
|
1677
|
+
selectRow(pk: any, groupKeys?: any[]): void;
|
|
1678
|
+
deselectRow(pk: any, groupKeys?: any[]): void;
|
|
1679
|
+
toggleRowSelection(pk: any, groupKeys?: any[]): void;
|
|
1680
|
+
selectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
|
|
1681
|
+
deselectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
|
|
1682
|
+
toggleGroupRowSelection(groupKeys: any[], children?: ArrayOfIds): void;
|
|
1683
|
+
getGroupRowSelectionState(groupKeys: any[]): boolean | null;
|
|
1684
|
+
getSelectedPrimaryKeys(): (string | number)[];
|
|
1685
|
+
selectAll(): void;
|
|
1686
|
+
deselectAll(): void;
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1571
1689
|
declare type LoadMaskProps = {
|
|
1572
1690
|
visible: boolean;
|
|
1573
1691
|
children: Renderable;
|
|
@@ -1627,28 +1745,18 @@ declare type InfiniteTableColumnSizingOptions = {
|
|
|
1627
1745
|
maxWidth?: number;
|
|
1628
1746
|
};
|
|
1629
1747
|
declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
|
|
1630
|
-
declare type
|
|
1748
|
+
declare type InfiniteTableApi<T> = {
|
|
1749
|
+
get selectionApi(): InfiniteTableSelectionApi;
|
|
1631
1750
|
setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
|
|
1632
1751
|
setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
|
|
1633
1752
|
x?: T;
|
|
1634
|
-
get allRowsSelected(): boolean;
|
|
1635
|
-
getSelectedRowCount(): number;
|
|
1636
1753
|
get scrollLeft(): number;
|
|
1637
1754
|
set scrollLeft(value: number);
|
|
1638
1755
|
get scrollTop(): number;
|
|
1639
1756
|
set scrollTop(value: number);
|
|
1640
|
-
getSelectedRows: () => T[];
|
|
1641
1757
|
toggleGroupRow: (groupKeys: any[]) => void;
|
|
1642
|
-
|
|
1643
|
-
|
|
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;
|
|
1758
|
+
collapseGroupRow: (groupKeys: any[]) => boolean;
|
|
1759
|
+
expandGroupRow: (groupKeys: any[]) => boolean;
|
|
1652
1760
|
scrollRowIntoView: (rowIndex: number, config?: {
|
|
1653
1761
|
scrollAdjustPosition?: ScrollAdjustPosition;
|
|
1654
1762
|
offset?: number;
|
|
@@ -1771,6 +1879,7 @@ interface InfiniteTableProps<T> {
|
|
|
1771
1879
|
showHoverRows?: boolean;
|
|
1772
1880
|
sortable?: boolean;
|
|
1773
1881
|
keyboardNavigation?: InfiniteTablePropKeyboardNavigation;
|
|
1882
|
+
keyboardSelection?: InfiniteTablePropKeyboardSelection;
|
|
1774
1883
|
defaultActiveRowIndex?: number | null;
|
|
1775
1884
|
activeRowIndex?: number | null;
|
|
1776
1885
|
onActiveRowIndexChange?: (activeRowIndex: number) => void;
|
|
@@ -1806,13 +1915,14 @@ interface InfiniteTableProps<T> {
|
|
|
1806
1915
|
onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrderNormalized) => void;
|
|
1807
1916
|
onRowHeightChange?: (rowHeight: number) => void;
|
|
1808
1917
|
filterEditors?: InfiniteTablePropFilterEditors<T>;
|
|
1809
|
-
onReady?: (api:
|
|
1918
|
+
onReady?: (api: InfiniteTableApi<T>) => void;
|
|
1810
1919
|
rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
|
|
1811
1920
|
licenseKey?: string;
|
|
1812
1921
|
scrollTopKey?: string | number;
|
|
1813
1922
|
autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
|
|
1814
1923
|
}
|
|
1815
1924
|
declare type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
|
|
1925
|
+
declare type InfiniteTablePropKeyboardSelection = boolean;
|
|
1816
1926
|
declare type InfiniteTablePropHeaderOptions = {
|
|
1817
1927
|
alwaysReserveSpaceForSortIcon: boolean;
|
|
1818
1928
|
};
|
|
@@ -1832,12 +1942,6 @@ declare function debounce(fn: Function, { wait }: {
|
|
|
1832
1942
|
wait: number;
|
|
1833
1943
|
}): (...args: any[]) => void;
|
|
1834
1944
|
|
|
1835
|
-
declare const defaultFilterTypes: Record<string, DataSourceFilterType<any>>;
|
|
1836
|
-
|
|
1837
|
-
declare function useDataSource<T>(): DataSourceState<T>;
|
|
1838
|
-
|
|
1839
|
-
declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
|
|
1840
|
-
|
|
1841
1945
|
declare type ForwardPropsToStateFnResult<TYPE_PROPS, TYPE_RESULT> = {
|
|
1842
1946
|
[propName in keyof TYPE_PROPS & keyof TYPE_RESULT]: 1 | ((value: TYPE_PROPS[propName]) => TYPE_RESULT[propName]);
|
|
1843
1947
|
};
|
|
@@ -1858,6 +1962,7 @@ declare type ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT
|
|
|
1858
1962
|
state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & Partial<COMPONENT_DERIVED_STATE>;
|
|
1859
1963
|
oldState: null | (COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & Partial<COMPONENT_DERIVED_STATE>);
|
|
1860
1964
|
parentState: T_PARENT_STATE | null;
|
|
1965
|
+
getState: () => COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
1861
1966
|
}) => COMPONENT_DERIVED_STATE;
|
|
1862
1967
|
concludeReducer?: (params: {
|
|
1863
1968
|
previousState: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
|
|
@@ -1900,4 +2005,4 @@ declare const components: {
|
|
|
1900
2005
|
LoadMask: (props: LoadMaskProps) => JSX.Element;
|
|
1901
2006
|
};
|
|
1902
2007
|
|
|
1903
|
-
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,
|
|
2008
|
+
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, InfiniteTableApi, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnsMap, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableFilterEditorProps, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, 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 };
|