@infinite-table/infinite-react 0.4.1 → 0.4.4

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.
Files changed (6) hide show
  1. package/index.css +113 -96
  2. package/index.d.ts +337 -218
  3. package/index.esm.css +113 -96
  4. package/index.esm.js +2561 -1752
  5. package/index.js +2895 -2087
  6. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,10 +1,42 @@
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 type MultisortInfoAllowMultipleFields<T> = Omit<MultisortInfo<T>, 'field'> & {
26
+ field?: keyof T | (keyof T)[];
27
+ };
28
+ declare const multisort: {
29
+ <T>(sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
30
+ knownTypes: {
31
+ [key: string]: (first: any, second: any) => number;
32
+ };
33
+ };
34
+
4
35
  declare type VoidFn$1 = () => void;
5
36
  declare type Pair<KeyType, ValueType> = {
6
37
  value?: ValueType;
7
38
  map?: Map<KeyType, Pair<KeyType, ValueType>>;
39
+ length: number;
8
40
  revision?: number;
9
41
  };
10
42
  declare type DeepMapVisitFn<KeyType, ValueType> = (pair: Pair<KeyType, ValueType>, keys: KeyType[], next: VoidFn$1) => void;
@@ -16,9 +48,11 @@ declare class DeepMap<KeyType, ValueType> {
16
48
  static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
17
49
  constructor(initial?: [KeyType[], ValueType][]);
18
50
  fill(initial?: [KeyType[], ValueType][]): void;
19
- getValuesStartingWith(keys: KeyType[]): ValueType[];
20
- getKeysStartingWith(keys: KeyType[]): KeyType[][];
51
+ getValuesStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): ValueType[];
52
+ getKeysStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): KeyType[][];
21
53
  private getStartingWith;
54
+ private getMapAt;
55
+ getAllChildrenSizeFor(keys: KeyType[]): number;
22
56
  getDirectChildrenSizeFor(keys: KeyType[]): number;
23
57
  set(keys: KeyType[] & {
24
58
  length: Omit<number, 0>;
@@ -33,6 +67,7 @@ declare class DeepMap<KeyType, ValueType> {
33
67
  visitDepthFirst: (fn: (value: ValueType, keys: KeyType[], indexInGroup: number, next?: VoidFn$1 | undefined) => void) => void;
34
68
  private visitWithNext;
35
69
  private getArray;
70
+ valuesAt(keys: KeyType[]): ValueType[];
36
71
  values(): Generator<ValueType, void, unknown>;
37
72
  keys(): Generator<KeyType[], void, unknown>;
38
73
  entries(): Generator<[KeyType[], ValueType], void, unknown>;
@@ -42,34 +77,6 @@ declare class DeepMap<KeyType, ValueType> {
42
77
  private sortedIterator;
43
78
  }
44
79
 
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
80
  declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
74
81
  getComponentState: () => T_STATE;
75
82
  componentState: T_STATE;
@@ -87,7 +94,7 @@ declare type ComponentInterceptedActions<T_STATE> = {
87
94
  declare type ComponentMappedCallbacks<T_STATE> = {
88
95
  [k in keyof T_STATE]: (value: T_STATE[k], state: T_STATE) => {
89
96
  callbackName: string;
90
- callbackParam: any;
97
+ callbackParams: any[];
91
98
  };
92
99
  };
93
100
  declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
@@ -111,7 +118,7 @@ declare type InfiniteTableAction = {
111
118
 
112
119
  declare type Renderable = React$1.ReactNode | JSX.Element;
113
120
 
114
- declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParams<T, InfiniteTableComputedColumn<T>>;
121
+ declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParam<T, InfiniteTableComputedColumn<T>>;
115
122
 
116
123
  declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
117
124
 
@@ -132,6 +139,7 @@ interface Size {
132
139
 
133
140
  declare type InfiniteTableBaseCellProps<T> = {
134
141
  column: InfiniteTableComputedColumn<T>;
142
+ rowId?: any;
135
143
  renderChildren: () => Renderable;
136
144
  width: number;
137
145
  cssEllipsis?: boolean;
@@ -158,13 +166,22 @@ declare type DiscriminatedUnion<A, B> = (A & {
158
166
 
159
167
  declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
160
168
  declare type InfiniteTableSelectRowFn = (id: any) => void;
161
- declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
169
+ declare type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
162
170
  domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
163
- sortTool: JSX.Element | null;
164
171
  dragging: boolean;
165
172
  column: COL_TYPE;
173
+ columnsMap: Map<string, COL_TYPE>;
166
174
  columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
167
175
  columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
176
+ selectionMode: DataSourcePropSelectionMode;
177
+ allRowsSelected: boolean;
178
+ someRowsSelected: boolean;
179
+ api: InfiniteTableApi<DATA_TYPE>;
180
+ renderBag: {
181
+ header: string | number | Renderable;
182
+ sortIcon?: Renderable;
183
+ selectionCheckBox?: Renderable;
184
+ };
168
185
  };
169
186
  declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
170
187
  domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
@@ -174,10 +191,12 @@ declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTa
174
191
  groupIcon?: Renderable;
175
192
  selectionCheckBox?: Renderable;
176
193
  };
177
- groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
178
194
  rowIndex: number;
179
195
  rowActive: boolean;
196
+ api: InfiniteTableApi<DATA_TYPE>;
180
197
  column: COL_TYPE;
198
+ columnsMap: Map<string, COL_TYPE>;
199
+ groupByColumn?: InfiniteTableComputedColumn<DATA_TYPE>;
181
200
  toggleCurrentGroupRow: () => void;
182
201
  toggleGroupRow: InfiniteTableToggleGroupRowFn;
183
202
  toggleCurrentGroupRowSelection: () => void;
@@ -187,7 +206,7 @@ declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTa
187
206
  deselectCurrentRow: () => void;
188
207
  toggleRowSelection: InfiniteTableSelectRowFn;
189
208
  selectionMode: DataSourcePropSelectionMode | undefined;
190
- groupBy: DataSourceState<DATA_TYPE>['groupBy'];
209
+ rootGroupBy: DataSourceState<DATA_TYPE>['groupBy'];
191
210
  pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
192
211
  };
193
212
  declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
@@ -204,7 +223,7 @@ declare type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE =
204
223
  isGroupRow: true;
205
224
  }) => Renderable | null;
206
225
  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;
226
+ declare type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParam<T>) => Renderable;
208
227
  declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
209
228
  declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
210
229
  declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
@@ -212,11 +231,11 @@ declare type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
212
231
  declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
213
232
  declare type InfiniteTableColumnStyleFnParams<T> = {
214
233
  value: Renderable;
215
- column: InfiniteTableColumn<T>;
234
+ column: InfiniteTableComputedColumn<T>;
216
235
  } & InfiniteTableRowInfoDataDiscriminator<T>;
217
236
  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;
237
+ declare type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
238
+ declare type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React.CSSProperties;
220
239
  declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
221
240
  declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
222
241
  declare type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
@@ -231,18 +250,26 @@ declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | numb
231
250
  declare type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
232
251
  declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
233
252
  declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
234
- declare type InfiniteTableBaseColumn<T> = {
253
+ /**
254
+ * Defines a column in the table.
255
+ *
256
+ * @typeParam DATA_TYPE The type of the data in the table.
257
+ *
258
+ * Can be bound to a field which is a `keyof DATA_TYPE`.
259
+ */
260
+ declare type InfiniteTableColumn<DATA_TYPE> = {
235
261
  sortable?: boolean;
236
262
  draggable?: boolean;
237
263
  resizable?: boolean;
238
- comparer?: InfiniteTableColumnComparer<T>;
239
- defaultHiddenWhenGroupedBy?: '*' | keyof T | {
240
- [k in keyof Partial<T>]: true;
264
+ comparer?: InfiniteTableColumnComparer<DATA_TYPE>;
265
+ defaultHiddenWhenGroupedBy?: '*' | true | keyof DATA_TYPE | {
266
+ [k in keyof Partial<DATA_TYPE>]: true;
241
267
  };
242
268
  align?: InfiniteTableColumnAlign;
243
269
  verticalAlign?: InfiniteTableColumnVerticalAlign;
244
270
  columnGroup?: string;
245
- header?: InfiniteTableColumnHeader<T>;
271
+ header?: InfiniteTableColumnHeader<DATA_TYPE>;
272
+ renderHeader?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
246
273
  name?: Renderable;
247
274
  cssEllipsis?: boolean;
248
275
  headerCssEllipsis?: boolean;
@@ -250,39 +277,33 @@ declare type InfiniteTableBaseColumn<T> = {
250
277
  dataType?: InfiniteTableDataTypeNames;
251
278
  sortType?: string;
252
279
  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>;
280
+ style?: InfiniteTableColumnStyle<DATA_TYPE>;
281
+ headerStyle?: InfiniteTableColumnHeaderStyle<DATA_TYPE>;
282
+ headerClassName?: InfiniteTableColumnHeaderClassName<DATA_TYPE>;
283
+ className?: InfiniteTableColumnClassName<DATA_TYPE>;
284
+ rowspan?: InfiniteTableColumnRowspanFn<DATA_TYPE>;
285
+ field?: keyof DATA_TYPE;
286
+ render?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
287
+ renderValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
288
+ renderGroupValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
289
+ renderLeafValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
290
+ valueGetter?: InfiniteTableColumnValueGetter<DATA_TYPE>;
291
+ valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE>;
265
292
  defaultWidth?: number;
266
293
  defaultFlex?: number;
267
294
  defaultFilterable?: boolean;
268
295
  minWidth?: number;
269
296
  maxWidth?: number;
270
- renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
271
- renderSelectionCheckBox?: boolean | InfiniteTableColumnRenderFunction<T>;
297
+ renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
298
+ renderSortIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
299
+ renderSelectionCheckBox?: boolean | InfiniteTableColumnRenderFunction<DATA_TYPE>;
300
+ renderHeaderSelectionCheckBox?: boolean | InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
272
301
  components?: {
273
302
  ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
274
303
  HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
275
304
  };
276
305
  };
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> & {
306
+ declare type InfiniteTableGeneratedGroupColumn<T> = Omit<InfiniteTableColumn<T>, 'sortable'> & {
286
307
  groupByField: string | string[];
287
308
  id?: string;
288
309
  };
@@ -324,6 +345,7 @@ declare type InfiniteTableComputedColumnBase<T> = {
324
345
  computedSortedAsc: boolean;
325
346
  computedSortedDesc: boolean;
326
347
  computedSortIndex: number;
348
+ computedVisible: boolean;
327
349
  computedVisibleIndex: number;
328
350
  computedVisibleIndexInCategory: number;
329
351
  computedMultiSort: boolean;
@@ -338,6 +360,7 @@ declare type InfiniteTableComputedColumnBase<T> = {
338
360
  computedFirst: boolean;
339
361
  computedLast: boolean;
340
362
  toggleSort: () => void;
363
+ colType: InfiniteTableColumnType<T>;
341
364
  id: string;
342
365
  };
343
366
  declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
@@ -619,12 +642,142 @@ declare class MatrixBrain extends Logger {
619
642
  destroy: () => void;
620
643
  }
621
644
 
645
+ declare type RowSelectionStateItem = (any | any[])[];
646
+ declare type RowSelectionStateObject = {
647
+ selectedRows: RowSelectionStateItem;
648
+ deselectedRows: RowSelectionStateItem;
649
+ defaultSelection: boolean;
650
+ } | {
651
+ defaultSelection: true;
652
+ deselectedRows: RowSelectionStateItem;
653
+ selectedRows?: RowSelectionStateItem;
654
+ } | {
655
+ defaultSelection: false;
656
+ selectedRows: RowSelectionStateItem;
657
+ deselectedRows?: RowSelectionStateItem;
658
+ };
659
+ declare type RowSelectionStateConfig<T> = {
660
+ groupBy: DataSourceState<T>['groupBy'];
661
+ groupDeepMap: DataSourceState<T>['groupDeepMap'];
662
+ totalCount: number;
663
+ indexer: DataSourceState<T>['indexer'];
664
+ lazyLoad: boolean;
665
+ };
666
+ declare type GetRowSelectionStateConfig<T> = () => RowSelectionStateConfig<T>;
667
+ declare type RowSelectionStateOverrideForTesting = {
668
+ getGroupKeysForPrimaryKey: RowSelectionState<any>['getGroupKeysForPrimaryKey'];
669
+ getGroupByLength: RowSelectionState<any>['getGroupByLength'];
670
+ getGroupCount: RowSelectionState<any>['getGroupCount'];
671
+ getGroupKeysDirectlyInsideGroup: RowSelectionState<any>['getGroupKeysDirectlyInsideGroup'];
672
+ };
673
+ declare class RowSelectionState<T = any> {
674
+ selectedRows: RowSelectionStateItem | null;
675
+ deselectedRows: RowSelectionStateItem | null;
676
+ defaultSelection: boolean;
677
+ selectedMap: DeepMap<any, true>;
678
+ deselectedMap: DeepMap<any, true>;
679
+ selectionCache: DeepMap<any, boolean | null>;
680
+ selectionCountCache: DeepMap<any, {
681
+ selectedCount: number;
682
+ deselectedCount: number;
683
+ }>;
684
+ getConfig: GetRowSelectionStateConfig<T>;
685
+ getGroupKeysForPrimaryKey(pk: any): any[];
686
+ getGroupDeepMap(): DeepMap<any, DeepMapGroupValueType<T, any>> | undefined;
687
+ getGroupCount(groupKeys: any[]): number;
688
+ getGroupKeysDirectlyInsideGroup(groupKeys: any[]): any[][];
689
+ getGroupByLength(): number;
690
+ static from<T>(rowSeleStateObject: RowSelectionStateObject, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverrideForTesting): RowSelectionState<T>;
691
+ constructor(state: RowSelectionStateObject | RowSelectionState, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverrideForTesting);
692
+ mapSet: (name: 'selected' | 'deselected', key: any | any[]) => void;
693
+ _selectedMapSet: (key: any | any[]) => void;
694
+ _deselectedMapSet: (key: any | any[]) => void;
695
+ update(stateObject: RowSelectionStateObject): void;
696
+ private xcache;
697
+ getState(): RowSelectionStateObject;
698
+ deselectAll(): void;
699
+ selectAll(): void;
700
+ isRowDefaultSelected(): boolean;
701
+ isRowDefaultDeselected(): boolean;
702
+ /**
703
+ *
704
+ * @param key the id of the row - if a row in a grouped datasource, this is the final row id, without the group keys
705
+ * @param groupKeys the keys of row parents, in order
706
+ * @returns Whether the row is selected or not.
707
+ */
708
+ isRowSelected(key: any, groupKeys?: any[]): boolean;
709
+ isRowDeselected(key: any, groupKeys?: any[]): boolean;
710
+ setRowSelected(key: string | number, selected: boolean, groupKeys?: any[]): void;
711
+ /**
712
+ * Returns if the selection state ('full','partial','none') for the current group
713
+ *
714
+ * The selection state will be full (true) if either of those are true:
715
+ * * the group keys are specified as selected
716
+ * * all the children are specified as selected
717
+ *
718
+ * The selection state will be partial (null) if either of those are true:
719
+ * * the group keys are partially selected
720
+ * * some of the children are specified as selected
721
+ *
722
+ *
723
+ * @param groupKeys the keys of the group row
724
+ * @param children leaf children that belong to the group
725
+ * @returns boolean
726
+ */
727
+ getGroupRowSelectionState(initialGroupKeys: any[]): boolean | null;
728
+ private getGroupRowBooleanSelectionStateFromParent;
729
+ isGroupRowPartlySelected(groupKeys: any[]): boolean;
730
+ isGroupRowSelected(groupKeys: any[]): boolean;
731
+ isGroupRowDeselected(groupKeys: any[]): boolean;
732
+ selectGroupRow(groupKeys: any[]): void;
733
+ deselectGroupRow(groupKeys: any[]): void;
734
+ setRowAsSelected(key: string | number, groupKeys?: any[]): void;
735
+ setRowAsDeselected(key: string | number, groupKeys?: any[]): void;
736
+ deselectRow(key: any, groupKeys?: any[]): void;
737
+ selectRow(key: any, groupKeys?: any[]): void;
738
+ toggleGroupRowSelection(groupKeys: any[]): void;
739
+ toggleRowSelection(key: string | number, groupKeys?: any[] | undefined): void;
740
+ getSelectedCount(): number;
741
+ getDeselectedCount(): number;
742
+ getSelectionCountFor(groupKeys?: any[], parentSelected?: boolean): {
743
+ selectedCount: number;
744
+ deselectedCount: number;
745
+ };
746
+ }
747
+
748
+ declare type MultiRowSelectorOptions = {
749
+ getIdForIndex: (index: number) => string | number;
750
+ };
751
+ declare class MultiRowSelector {
752
+ getIdForIndex: MultiRowSelectorOptions['getIdForIndex'];
753
+ multiSelectStartIndex: number;
754
+ multiSelectEndIndex?: number;
755
+ _rowSelectionState: RowSelectionState;
756
+ constructor(options: MultiRowSelectorOptions);
757
+ set rowSelectionState(rowSelectionState: RowSelectionState);
758
+ get rowSelectionState(): RowSelectionState;
759
+ private selectRange;
760
+ private deselectRange;
761
+ /**
762
+ * This is the single click, without any modifier
763
+ */
764
+ resetClick(index: number): void;
765
+ /**
766
+ * This is the click with ctrl/cmd key pressed
767
+ * @param index
768
+ */
769
+ singleAddClick(index: number): void;
770
+ multiSelectClick(index: number): void;
771
+ }
772
+
622
773
  interface InfiniteTableComputedValues<T> {
623
774
  scrollbars: {
624
775
  vertical: boolean;
625
776
  horizontal: boolean;
626
777
  };
778
+ multiRowSelector: MultiRowSelector;
627
779
  showColumnFilters: boolean;
780
+ renderSelectionCheckBox: boolean;
628
781
  rowspan?: MatrixBrainOptions['rowspan'];
629
782
  computedPinnedStartOverflow: boolean;
630
783
  computedPinnedEndOverflow: boolean;
@@ -633,6 +786,7 @@ interface InfiniteTableComputedValues<T> {
633
786
  computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
634
787
  computedVisibleColumns: InfiniteTableComputedColumn<T>[];
635
788
  computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
789
+ computedColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
636
790
  computedColumnVisibility: InfiniteTablePropColumnVisibility;
637
791
  computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
638
792
  computedPinnedStartColumnsWidth: number;
@@ -778,6 +932,9 @@ interface InfiniteTableSetupState<T> {
778
932
  cellClick: SubscriptionCallback<CellPosition & {
779
933
  event: MouseEvent;
780
934
  }>;
935
+ cellMouseDown: SubscriptionCallback<CellPosition & {
936
+ event: MouseEvent;
937
+ }>;
781
938
  keyDown: SubscriptionCallback<KeyboardEvent>;
782
939
  columnsWhenGrouping?: InfiniteTableColumnsMap<T>;
783
940
  bodySize: Size;
@@ -840,6 +997,8 @@ interface InfiniteTableMappedState<T> {
840
997
  draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
841
998
  sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
842
999
  hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
1000
+ hideColumnWhenGrouped: NonUndefined<InfiniteTableProps<T>['hideColumnWhenGrouped']>;
1001
+ keyboardSelection: NonUndefined<InfiniteTableProps<T>['keyboardSelection']>;
843
1002
  columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
844
1003
  showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
845
1004
  showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
@@ -859,6 +1018,7 @@ interface InfiniteTableMappedState<T> {
859
1018
  interface InfiniteTableDerivedState<T> {
860
1019
  groupBy: DataSourceProps<T>['groupBy'];
861
1020
  computedColumns: Map<string, InfiniteTableColumn<T>>;
1021
+ initialColumns: InfiniteTableProps<T>['columns'];
862
1022
  groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
863
1023
  columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
864
1024
  keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>;
@@ -874,7 +1034,7 @@ interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTab
874
1034
  }
875
1035
 
876
1036
  interface InfiniteTableContextValue<T> {
877
- imperativeApi: InfiniteTableImperativeApi<T>;
1037
+ imperativeApi: InfiniteTableApi<T>;
878
1038
  componentState: InfiniteTableState<T>;
879
1039
  componentActions: InfiniteTableActions<T>;
880
1040
  computed: InfiniteTableComputedValues<T>;
@@ -887,70 +1047,59 @@ declare type RenderRange = {
887
1047
  renderEndIndex: number;
888
1048
  };
889
1049
 
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>;
1050
+ declare type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
1051
+ declare type BooleanDeepCollectionStateObject<KeyType> = {
1052
+ positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
1053
+ negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
1054
+ };
1055
+ declare abstract class BooleanDeepCollectionState<StateObject, KeyType extends any = any> {
1056
+ protected positiveMap?: DeepMap<KeyType, true>;
1057
+ protected negativeMap?: DeepMap<KeyType, true>;
907
1058
  protected allNegative: boolean;
908
1059
  protected allPositive: boolean;
909
1060
  private initialState;
910
- constructor(state: BooleanCollectionStateObject<KeyType> | BooleanCollectionState<StateObject, KeyType>);
911
- abstract getPositiveFromState(state: StateObject): BooleanCollectionStateKeys<KeyType>;
912
- abstract getNegativeFromState(state: StateObject): BooleanCollectionStateKeys<KeyType>;
1061
+ constructor(state: BooleanDeepCollectionStateObject<KeyType> | BooleanDeepCollectionState<StateObject, KeyType>);
1062
+ abstract getPositiveFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1063
+ abstract getNegativeFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
913
1064
  abstract getState(): StateObject;
914
- protected getInitialState(): BooleanCollectionStateObject<KeyType>;
1065
+ protected getInitialState(): BooleanDeepCollectionStateObject<KeyType>;
915
1066
  destroy(): void;
916
1067
  private update;
917
- protected isDefaultNegativeSelection(): boolean;
918
- protected isDefaultPositiveSelection(): boolean;
919
1068
  protected areAllNegative(): boolean;
920
1069
  protected areAllPositive(): boolean;
921
1070
  protected makeAllNegative(): void;
922
1071
  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;
1072
+ protected isItemPositive(keys: KeyType[]): boolean | undefined;
1073
+ protected isItemNegative(keys: KeyType[]): boolean;
1074
+ protected setItemValue(keys: KeyType[], shouldMakePositive: boolean): void;
1075
+ protected makeItemNegative(keys: KeyType[]): void;
1076
+ protected makeItemPositive(keys: KeyType[]): void;
1077
+ protected toggleItem(keys: KeyType[]): void;
929
1078
  }
930
1079
 
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;
1080
+ declare class GroupRowsState<KeyType extends any = any> extends BooleanDeepCollectionState<DataSourcePropGroupRowsStateObject<KeyType>, KeyType> {
1081
+ constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
1082
+ getState(): DataSourcePropGroupRowsStateObject<KeyType>;
1083
+ getPositiveFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1084
+ getNegativeFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1085
+ areAllCollapsed(): boolean;
1086
+ areAllExpanded(): boolean;
1087
+ collapseAll(): void;
1088
+ expandAll(): void;
1089
+ isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
1090
+ isGroupRowCollapsed(keys: KeyType[]): boolean;
1091
+ setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
1092
+ collapseGroupRow(keys: KeyType[]): void;
1093
+ expandGroupRow(keys: KeyType[]): void;
1094
+ toggleGroupRow(keys: KeyType[]): void;
1095
+ }
1096
+
1097
+ declare class Indexer<DataType, PrimaryKeyType = string> {
1098
+ primaryKeyToData: Map<string, DataType>;
1099
+ add: (primaryKey: PrimaryKeyType, data: DataType) => void;
1100
+ clear: () => void;
1101
+ getDataForPrimaryKey: (primaryKey: PrimaryKeyType) => DataType | undefined;
1102
+ indexArray: (arr: DataType[], toPrimaryKey: (data: DataType) => PrimaryKeyType) => void;
954
1103
  }
955
1104
 
956
1105
  interface DataSourceDataParams<T> {
@@ -970,8 +1119,8 @@ interface DataSourceDataParams<T> {
970
1119
  changes?: DataSourceDataParamsChanges<T>;
971
1120
  }
972
1121
  declare type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
973
- declare type DataSourceSingleSortInfo<T> = MultisortInfo<T> & {
974
- field?: keyof T;
1122
+ declare type DataSourceSingleSortInfo<T> = Omit<MultisortInfo<T>, 'field'> & {
1123
+ field?: keyof T | (keyof T)[];
975
1124
  id?: string;
976
1125
  };
977
1126
  declare type DataSourceGroupBy<T> = GroupBy<T, any>;
@@ -1021,7 +1170,7 @@ declare type DataSourceAggregationReducer<T, AggregationResultType> = {
1021
1170
  field?: keyof T;
1022
1171
  initialValue?: AggregationResultType;
1023
1172
  getter?: (data: T) => any;
1024
- reducer: string | ((accumulator: any, value: any, data: T, index: number) => AggregationResultType | any);
1173
+ reducer: string | ((accumulator: any, value: any, data: T, index: number, groupKeys: any[] | undefined) => AggregationResultType | any);
1025
1174
  done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
1026
1175
  pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
1027
1176
  column: InfiniteTablePivotFinalColumnVariant<T>;
@@ -1036,6 +1185,7 @@ declare type LazyGroupDataItem<DataType> = {
1036
1185
  keys: any[];
1037
1186
  aggregations?: Record<string, any>;
1038
1187
  dataset?: DataSourceRemoteData<DataType>;
1188
+ totalChildrenCount?: number;
1039
1189
  pivot?: {
1040
1190
  values: Record<string, any>;
1041
1191
  totals?: Record<string, any>;
@@ -1055,7 +1205,7 @@ declare type LazyRowInfoGroup<DataType> = {
1055
1205
  };
1056
1206
  declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
1057
1207
  interface DataSourceSetupState<T> {
1058
- indexer: Indexer;
1208
+ indexer: Indexer<T, any>;
1059
1209
  unfilteredCount: number;
1060
1210
  filteredCount: number;
1061
1211
  lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
@@ -1077,7 +1227,7 @@ interface DataSourceSetupState<T> {
1077
1227
  groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
1078
1228
  reducerResults?: Record<string, AggregationReducerResult>;
1079
1229
  allRowsSelected: boolean;
1080
- selectedRowCount: number;
1230
+ someRowsSelected: boolean;
1081
1231
  pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
1082
1232
  pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
1083
1233
  cursorId: number | symbol | DataSourceLivePaginationCursorValue;
@@ -1096,33 +1246,23 @@ interface DataSourceSetupState<T> {
1096
1246
  declare type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
1097
1247
  declare type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
1098
1248
  declare type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1099
- declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject | RowSelectionState;
1249
+ declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
1100
1250
  declare type DataSourcePropRowSelection_SingleRow = null | string | number;
1101
1251
  declare type DataSourcePropCellSelection = any;
1102
1252
  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;
1253
+ declare type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
1254
+ declare type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
1112
1255
  declare type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
1113
1256
  declare type DataSourcePropOnCellSelectionChange = (cellSelectionParams: any) => void;
1114
- declare type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelection: DataSourcePropRowSelection, selectionMode: DataSourcePropSelectionMode) => boolean;
1257
+ declare type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelectionState: RowSelectionState, selectionMode: 'multi-row') => boolean | null;
1115
1258
  declare type DataSourceProps<T> = {
1116
1259
  children: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
1117
- primaryKey: keyof T | (({ data, index }: {
1118
- data: T;
1119
- index: number;
1120
- }) => string);
1260
+ primaryKey: keyof T | ((data: T) => string);
1121
1261
  fields?: (keyof T)[];
1122
1262
  data: DataSourceData<T>;
1123
1263
  selectionMode?: DataSourcePropSelectionMode;
1124
- rowSelection?: DataSourcePropRowSelection;
1125
- defaultRowSelection?: DataSourcePropRowSelection;
1264
+ rowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1265
+ defaultRowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1126
1266
  cellSelection?: DataSourcePropCellSelection;
1127
1267
  defaultCellSelection?: DataSourcePropCellSelection;
1128
1268
  onCellSelectionChange?: DataSourcePropOnCellSelectionChange;
@@ -1230,14 +1370,14 @@ interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedS
1230
1370
  declare type DataSourceDerivedState<T> = {
1231
1371
  toPrimaryKey: (data: T) => any;
1232
1372
  operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
1233
- rowSelection: RowSelectionState | null | number | string;
1234
- selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
1235
1373
  filterMode: NonUndefined<DataSourceProps<T>['filterMode']>;
1236
1374
  multiSort: boolean;
1237
1375
  controlledSort: boolean;
1238
1376
  controlledFilter: boolean;
1239
1377
  livePaginationCursor?: DataSourceLivePaginationCursorValue;
1240
1378
  lazyLoadBatchSize?: number;
1379
+ rowSelection: RowSelectionState | null | number | string;
1380
+ selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
1241
1381
  };
1242
1382
  declare type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
1243
1383
  interface DataSourceContextValue<T> {
@@ -1256,52 +1396,11 @@ interface DataSourceReducer<T> {
1256
1396
  (state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
1257
1397
  }
1258
1398
 
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
- }
1399
+ declare const defaultFilterTypes: Record<string, DataSourceFilterType<any>>;
1288
1400
 
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
- }
1401
+ declare function useDataSource<T>(): DataSourceState<T>;
1402
+
1403
+ declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
1305
1404
 
1306
1405
  declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
1307
1406
  id: string;
@@ -1326,6 +1425,7 @@ declare type InfiniteTableRowInfoDataDiscriminator<T> = {
1326
1425
  rowInfo: InfiniteTable_NoGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoNormal<T>;
1327
1426
  field?: keyof T;
1328
1427
  value: any;
1428
+ rowSelected: boolean | null;
1329
1429
  } | {
1330
1430
  rowActive: boolean;
1331
1431
  data: Partial<T> | null;
@@ -1333,6 +1433,7 @@ declare type InfiniteTableRowInfoDataDiscriminator<T> = {
1333
1433
  isGroupRow: true;
1334
1434
  field?: keyof T;
1335
1435
  value: any;
1436
+ rowSelected: boolean | null;
1336
1437
  };
1337
1438
  /**
1338
1439
  * This is the base row info for all scenarios - things every
@@ -1343,7 +1444,7 @@ declare type InfiniteTable_RowInfoBase<_T> = {
1343
1444
  id: any;
1344
1445
  value?: any;
1345
1446
  indexInAll: number;
1346
- rowSelected: boolean;
1447
+ rowSelected: boolean | null;
1347
1448
  };
1348
1449
  declare type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
1349
1450
  dataSourceHasGrouping: true;
@@ -1354,10 +1455,6 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
1354
1455
  dataSourceHasGrouping: true;
1355
1456
  data: Partial<T> | null;
1356
1457
  isGroupRow: true;
1357
- /**
1358
- * The count of all selected leaf nodes (normal rows) inside the group that are selected
1359
- */
1360
- childrenSelectedCount: number;
1361
1458
  /**
1362
1459
  * This array contains all the (uncollapsed, so visible) row infos under this group, at any level of nesting,
1363
1460
  * in the order in which they are visible in the table
@@ -1375,6 +1472,23 @@ declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
1375
1472
  * The array of all leaf nodes (normal rows) that are inside this group.
1376
1473
  */
1377
1474
  groupData: T[];
1475
+ /**
1476
+ * The count of all selected leaf nodes (normal rows) inside the group that are selected
1477
+ */
1478
+ selectedChildredCount: number;
1479
+ /**
1480
+ * The count of all deselected leaf nodes (normal rows) inside the group that are selected
1481
+ */
1482
+ deselectedChildredCount: number;
1483
+ /**
1484
+ * Will be used only with lazy loading, if the server provides this info on the data items.
1485
+ *
1486
+ * Represents the total count of all leaf nodes (normal rows) that are under this group
1487
+ * at any level (so not only direct children). This is needed for multiple selection to work properly,
1488
+ * so the table component knows how many rows are on the remote backend, and whether to show a group as selected or not
1489
+ * when it has a certain number of rows selected
1490
+ */
1491
+ totalChildrenCount?: number;
1378
1492
  /**
1379
1493
  * The count of all leaf nodes (normal rows) inside the group that are not being visible
1380
1494
  * due to collapsing (either the current row is collapsed or any of its children)
@@ -1524,6 +1638,7 @@ declare type DeepMapGroupValueType<DataType, KeyType> = {
1524
1638
  commonData?: Partial<DataType>;
1525
1639
  childrenLoading: boolean;
1526
1640
  childrenAvailable: boolean;
1641
+ totalChildrenCount?: number;
1527
1642
  cache: boolean;
1528
1643
  error?: string;
1529
1644
  reducerResults: Record<string, AggregationReducerResult>;
@@ -1568,6 +1683,23 @@ declare type InfiniteCheckBoxProps = {
1568
1683
  };
1569
1684
  declare function InfiniteCheckBox(props: InfiniteCheckBoxProps): JSX.Element;
1570
1685
 
1686
+ declare type ArrayOfIds = Pick<InfiniteTable_RowInfoBase<any>, 'id'>[];
1687
+ declare type InfiniteTableSelectionApi = {
1688
+ get allRowsSelected(): boolean;
1689
+ isRowSelected(pk: any, groupKeys?: any[]): boolean;
1690
+ isRowDeselected(pk: any, groupKeys?: any[]): boolean;
1691
+ selectRow(pk: any, groupKeys?: any[]): void;
1692
+ deselectRow(pk: any, groupKeys?: any[]): void;
1693
+ toggleRowSelection(pk: any, groupKeys?: any[]): void;
1694
+ selectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
1695
+ deselectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
1696
+ toggleGroupRowSelection(groupKeys: any[], children?: ArrayOfIds): void;
1697
+ getGroupRowSelectionState(groupKeys: any[]): boolean | null;
1698
+ getSelectedPrimaryKeys(): (string | number)[];
1699
+ selectAll(): void;
1700
+ deselectAll(): void;
1701
+ };
1702
+
1571
1703
  declare type LoadMaskProps = {
1572
1704
  visible: boolean;
1573
1705
  children: Renderable;
@@ -1627,28 +1759,18 @@ declare type InfiniteTableColumnSizingOptions = {
1627
1759
  maxWidth?: number;
1628
1760
  };
1629
1761
  declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
1630
- declare type InfiniteTableImperativeApi<T> = {
1762
+ declare type InfiniteTableApi<T> = {
1763
+ get selectionApi(): InfiniteTableSelectionApi;
1631
1764
  setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
1632
1765
  setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
1633
1766
  x?: T;
1634
- get allRowsSelected(): boolean;
1635
- getSelectedRowCount(): number;
1636
1767
  get scrollLeft(): number;
1637
1768
  set scrollLeft(value: number);
1638
1769
  get scrollTop(): number;
1639
1770
  set scrollTop(value: number);
1640
- getSelectedRows: () => T[];
1641
1771
  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;
1772
+ collapseGroupRow: (groupKeys: any[]) => boolean;
1773
+ expandGroupRow: (groupKeys: any[]) => boolean;
1652
1774
  scrollRowIntoView: (rowIndex: number, config?: {
1653
1775
  scrollAdjustPosition?: ScrollAdjustPosition;
1654
1776
  offset?: number;
@@ -1695,6 +1817,7 @@ declare type InfiniteTableGroupColumnGetterOptions<T> = {
1695
1817
  groupCount: number;
1696
1818
  groupBy: DataSourceGroupBy<T>[];
1697
1819
  pivotBy?: DataSourcePivotBy<T>[];
1820
+ sortable?: boolean;
1698
1821
  };
1699
1822
  declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
1700
1823
  column: COL_TYPE;
@@ -1703,7 +1826,6 @@ declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableCo
1703
1826
  };
1704
1827
  declare type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
1705
1828
  declare type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
1706
- renderValue?: InfiniteTableColumnRenderFunction<T>;
1707
1829
  renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
1708
1830
  id?: string;
1709
1831
  };
@@ -1771,6 +1893,7 @@ interface InfiniteTableProps<T> {
1771
1893
  showHoverRows?: boolean;
1772
1894
  sortable?: boolean;
1773
1895
  keyboardNavigation?: InfiniteTablePropKeyboardNavigation;
1896
+ keyboardSelection?: InfiniteTablePropKeyboardSelection;
1774
1897
  defaultActiveRowIndex?: number | null;
1775
1898
  activeRowIndex?: number | null;
1776
1899
  onActiveRowIndexChange?: (activeRowIndex: number) => void;
@@ -1789,6 +1912,7 @@ interface InfiniteTableProps<T> {
1789
1912
  columnDefaultWidth?: number;
1790
1913
  columnMinWidth?: number;
1791
1914
  columnMaxWidth?: number;
1915
+ hideColumnWhenGrouped?: boolean;
1792
1916
  resizableColumns?: boolean;
1793
1917
  virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
1794
1918
  virtualizeRows?: boolean;
@@ -1806,13 +1930,14 @@ interface InfiniteTableProps<T> {
1806
1930
  onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrderNormalized) => void;
1807
1931
  onRowHeightChange?: (rowHeight: number) => void;
1808
1932
  filterEditors?: InfiniteTablePropFilterEditors<T>;
1809
- onReady?: (api: InfiniteTableImperativeApi<T>) => void;
1933
+ onReady?: (api: InfiniteTableApi<T>) => void;
1810
1934
  rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
1811
1935
  licenseKey?: string;
1812
1936
  scrollTopKey?: string | number;
1813
1937
  autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
1814
1938
  }
1815
1939
  declare type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
1940
+ declare type InfiniteTablePropKeyboardSelection = boolean;
1816
1941
  declare type InfiniteTablePropHeaderOptions = {
1817
1942
  alwaysReserveSpaceForSortIcon: boolean;
1818
1943
  };
@@ -1832,12 +1957,6 @@ declare function debounce(fn: Function, { wait }: {
1832
1957
  wait: number;
1833
1958
  }): (...args: any[]) => void;
1834
1959
 
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
1960
  declare type ForwardPropsToStateFnResult<TYPE_PROPS, TYPE_RESULT> = {
1842
1961
  [propName in keyof TYPE_PROPS & keyof TYPE_RESULT]: 1 | ((value: TYPE_PROPS[propName]) => TYPE_RESULT[propName]);
1843
1962
  };
@@ -1900,4 +2019,4 @@ declare const components: {
1900
2019
  LoadMask: (props: LoadMaskProps) => JSX.Element;
1901
2020
  };
1902
2021
 
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, 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 };
2022
+ 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 };