@infinite-table/infinite-react 7.4.2 → 7.5.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { CSSProperties, HTMLProps, RefCallback, MutableRefObject, MouseEvent, KeyboardEvent, HTMLAttributes, ReactNode, EffectCallback, DependencyList } from 'react';
2
+ import React__default, { RefCallback, CSSProperties, HTMLProps, MutableRefObject, MouseEvent, KeyboardEvent, HTMLAttributes, ReactNode, EffectCallback, DependencyList } from 'react';
3
3
 
4
4
  type ManagedComponentStateContextValue<T_STATE, T_ACTIONS> = {
5
5
  getComponentState: () => T_STATE;
@@ -542,7 +542,45 @@ declare function buildManagedComponent<T_PROPS extends object, COMPONENT_MAPPED_
542
542
  };
543
543
  declare function useManagedComponentState<COMPONENT_STATE>(Context?: React$1.Context<ManagedComponentStateContextValue<COMPONENT_STATE, ComponentStateActions<COMPONENT_STATE>>>): ManagedComponentStateContextValue<COMPONENT_STATE, ComponentStateGeneratedActions<COMPONENT_STATE>>;
544
544
 
545
- type Renderable = React$1.ReactNode | React$1.JSX.Element;
545
+ type PerfMarkerDetails = {
546
+ name: string;
547
+ value: string | number | boolean;
548
+ }[];
549
+ interface PerfMarker {
550
+ start(options?: {
551
+ details?: PerfMarkerDetails;
552
+ }): PerfMarker;
553
+ end(options?: {
554
+ details?: PerfMarkerDetails;
555
+ }): PerfMarker;
556
+ }
557
+
558
+ interface RowInfoStore<T> {
559
+ /**
560
+ * Update the entire dataArray (called from reducer)
561
+ * Compares old vs new rowInfo at each index and notifies subscribers for changed indices
562
+ */
563
+ notifyDataArray(newDataArray: InfiniteTableRowInfo<T>[], params?: {
564
+ marker?: PerfMarker;
565
+ }): void;
566
+ /**
567
+ * Get current rowInfo at index (snapshot for useSyncExternalStore)
568
+ */
569
+ getRowInfoAtIndex(index: number): InfiniteTableRowInfo<T> | undefined;
570
+ /**
571
+ * Subscribe to changes at a specific row index
572
+ * Returns unsubscribe function
573
+ */
574
+ subscribeToRowIndex(rowIndex: number, callback: () => void): () => void;
575
+ /**
576
+ * Get current dataArray (for components that need full array)
577
+ */
578
+ getDataArray(): InfiniteTableRowInfo<T>[];
579
+ /**
580
+ * Clear the store (reset dataArray and remove all subscribers)
581
+ */
582
+ clear(): void;
583
+ }
546
584
 
547
585
  type TableRenderRange = {
548
586
  start: [number, number];
@@ -1014,2190 +1052,2183 @@ declare abstract class BooleanCollectionState<StateObject, KeyType> {
1014
1052
  protected toggleItem(key: KeyType): void;
1015
1053
  }
1016
1054
 
1017
- type DiscriminatedUnion<A, B> = (A & {
1018
- [K in keyof B]?: undefined;
1019
- }) | (B & {
1020
- [K in keyof A]?: undefined;
1021
- });
1022
- type KeyOfNoSymbol<T> = Exclude<keyof T, Symbol>;
1023
- /**
1024
- * Restrict using either exclusively the keys of T or exclusively the keys of U.
1025
- *
1026
- * No unique keys of T can be used simultaneously with any unique keys of U.
1027
- *
1028
- * @example
1029
- *```
1030
- * const myVar: XOR<T, U>
1031
- *```
1032
- *
1033
- * @see https://github.com/maninak/ts-xor/tree/master#description
1034
- */
1035
- type XOR<T, U> = T | U extends object ? Prettify<Without<T, U> & U> | Prettify<Without<U, T> & T> : T | U;
1036
- /**
1037
- * Useful if applying XOR on more than 2 types.
1038
- * It comes with the penalty of having the types wrapped in an array
1039
- *
1040
- * @example
1041
- * ```
1042
- * AllXOR<[
1043
- * { a: AModule },
1044
- * { b: BModule },
1045
- * { c: CModule },
1046
- * { d: DModule }
1047
- * ]>
1048
- * ```
1049
- * @see https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-723571692
1050
- */
1051
- type AllXOR<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? AllXOR<[XOR<A, B>, ...Rest]> : never;
1052
- /**
1053
- * Get the keys of T without any keys of U.
1054
- */
1055
- type Without<T, U> = {
1056
- [P in Exclude<keyof T, keyof U>]?: never;
1057
- };
1058
- /**
1059
- * Resolve mapped types and show the derived keys and their types when hovering in
1060
- * IDEs, instead of just showing the names those mapped types are defined with.
1061
- */
1062
- type Prettify<T> = {
1063
- [K in keyof T]: T[K];
1064
- } & {};
1065
-
1066
- type ValueGetterParams<T> = {
1067
- data: T;
1068
- field?: keyof T;
1069
- };
1070
- type GroupKeyType$1<T extends any = any> = T;
1071
- type GroupByValueGetter<T> = (params: ValueGetterParams<T>) => any;
1072
- type GroupBy<DataType, KeyType = any> = {
1073
- toKey?: (value: any, data: DataType) => GroupKeyType$1<KeyType>;
1074
- column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
1075
- } & AllXOR<[
1076
- {
1077
- field: KeyOfNoSymbol<DataType>;
1078
- },
1079
- {
1080
- valueGetter: GroupByValueGetter<DataType>;
1081
- field: KeyOfNoSymbol<DataType>;
1082
- },
1083
- {
1084
- valueGetter: GroupByValueGetter<DataType>;
1085
- field?: KeyOfNoSymbol<DataType>;
1086
- groupField: string;
1087
- }
1088
- ]>;
1089
-
1090
- type PerfMarkerDetails = {
1091
- name: string;
1092
- value: string | number | boolean;
1093
- }[];
1094
- interface PerfMarker {
1095
- start(options?: {
1096
- details?: PerfMarkerDetails;
1097
- }): PerfMarker;
1098
- end(options?: {
1099
- details?: PerfMarkerDetails;
1100
- }): PerfMarker;
1055
+ declare class RowDetailState<KeyType = any> extends BooleanCollectionState<RowDetailStateObject<KeyType>, KeyType> {
1056
+ constructor(state: RowDetailStateObject<KeyType> | RowDetailState<KeyType>);
1057
+ getState(): RowDetailStateObject<KeyType>;
1058
+ getPositiveFromState(state: RowDetailStateObject<KeyType>): true | KeyType[];
1059
+ getNegativeFromState(state: RowDetailStateObject<KeyType>): true | KeyType[];
1060
+ areAllCollapsed(): boolean;
1061
+ areAllExpanded(): boolean;
1062
+ collapseAll(): void;
1063
+ expandAll(): void;
1064
+ isRowDetailsExpanded: (key: KeyType) => boolean;
1065
+ isRowDetailsCollapsed(key: KeyType): boolean;
1066
+ setRowDetailsExpanded(key: KeyType, shouldExpand: boolean): void;
1067
+ collapseRowDetails(key: KeyType): void;
1068
+ expandRowDetails(key: KeyType): void;
1069
+ toggleRowDetails(key: KeyType): void;
1101
1070
  }
1102
1071
 
1103
- type SortDir = 1 | -1;
1104
- type MultisortInfo<T> = {
1105
- /**
1106
- * The sorting direction
1107
- */
1108
- dir: SortDir;
1109
- /**
1110
- * for now 'string' and 'number' are known types, meaning they have
1111
- * sort functions already implemented
1112
- */
1113
- type?: string | string[];
1114
- fn?: (a: any, b: any) => number;
1115
- /**
1116
- * a property whose value to use for sorting on the array items
1117
- */
1118
- field?: keyof T;
1119
- /**
1120
- * or a function to retrieve the item value to use for sorting
1121
- */
1122
- valueGetter?: (item: T) => any;
1072
+ type Renderable = React$1.ReactNode | React$1.JSX.Element;
1073
+
1074
+ type TableRenderCellFnParam = {
1075
+ domRef: RefCallback<HTMLElement>;
1076
+ rowIndex: number;
1077
+ colIndex: number;
1078
+ rowspan: number;
1079
+ colspan: number;
1080
+ hidden: boolean;
1081
+ width: number;
1082
+ height: number;
1083
+ widthWithColspan: number;
1084
+ heightWithRowspan: number;
1085
+ rowFixed: FixedPosition;
1086
+ colFixed: FixedPosition;
1087
+ onMouseEnter: (event: React.MouseEvent<HTMLElement>) => void;
1088
+ onMouseLeave: (event: React.MouseEvent<HTMLElement>) => void;
1123
1089
  };
1124
- type MultisortInfoAllowMultipleFields<T> = Omit<MultisortInfo<T>, 'field'> & {
1125
- field?: keyof T | (keyof T | ((item: T) => any))[];
1090
+ type TableRenderDetailRowFnParam = {
1091
+ domRef: RefCallback<HTMLElement>;
1092
+ rowIndex: number;
1093
+ hidden: boolean;
1094
+ height: number;
1095
+ rowFixed: FixedPosition;
1096
+ onMouseEnter: (event: React.MouseEvent<HTMLElement>) => void;
1097
+ onMouseLeave: (event: React.MouseEvent<HTMLElement>) => void;
1126
1098
  };
1127
- declare const multisort: {
1128
- <T>(sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], options?: {
1129
- marker?: PerfMarker;
1130
- get?: (item: any) => T;
1131
- } | ((item: any) => T)): T[];
1132
- knownTypes: {
1133
- [key: string]: (first: any, second: any) => number;
1134
- };
1099
+ type TableRenderCellFn = (param: TableRenderCellFnParam) => Renderable;
1100
+ type TableRenderDetailRowFn = (param: TableRenderDetailRowFnParam) => Renderable;
1101
+ type RenderRangeOptions = {
1102
+ force?: boolean;
1103
+ renderCell: TableRenderCellFn;
1104
+ renderDetailRow?: TableRenderDetailRowFn;
1105
+ onRender: (items: Renderable[]) => void;
1135
1106
  };
1136
- type NestedMultiSortOptions<T> = {
1137
- get?: (item: any) => T;
1138
- nodesKey: string;
1139
- isLeafNode?: (item: T) => boolean;
1140
- getNodeChildren?: (item: T) => null | T[];
1141
- toKey: (item: T) => any;
1142
- depthFirst?: boolean;
1143
- inplace?: boolean;
1144
- marker?: PerfMarker;
1107
+ type HorizontalLayoutColVisibilityOptions = {
1108
+ horizontalLayoutPageIndex?: number;
1145
1109
  };
1146
- declare const multisortNested: <T>(sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], options: NestedMultiSortOptions<T>) => T[];
1147
1110
 
1148
- type MenuIconProps = {
1149
- lineWidth?: number;
1150
- lineStyle?: React$1.CSSProperties;
1151
- style?: React$1.CSSProperties;
1152
- className?: string;
1153
- domProps?: React$1.HTMLAttributes<HTMLDivElement>;
1154
- reserveSpaceWhenHidden?: boolean;
1155
- menuVisible?: boolean;
1156
- children?: React$1.ReactNode;
1157
- };
1158
- declare function MenuIcon(props: MenuIconProps): React$1.JSX.Element;
1111
+ interface GridCellInterface<T_ADDITIONAL_CELL_INFO = any> {
1112
+ debugId: string;
1113
+ update(content: Renderable, additionalInfo?: T_ADDITIONAL_CELL_INFO, scrollingObjectParam?: {
1114
+ scrolling: boolean;
1115
+ }): void;
1116
+ getElement(): HTMLElement | null;
1117
+ getNode(): Renderable;
1118
+ destroy(): void;
1119
+ onMount(callback: (cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>) => void): void;
1120
+ getAdditionalInfo(): T_ADDITIONAL_CELL_INFO | undefined;
1121
+ isMounted(): boolean;
1122
+ ref: React.RefCallback<HTMLElement | undefined>;
1123
+ }
1124
+
1125
+ type CellPos = [number, number];
1126
+
1127
+ declare class GridCellManager<T_ADDITIONAL_CELL_INFO> extends Logger {
1128
+ private matrix;
1129
+ private rowsWithCellsHistory;
1130
+ private columnsWithCellsHistory;
1131
+ private cellToMatrixPosition;
1132
+ private pool;
1133
+ debugId: string;
1134
+ private offRemoveCell;
1135
+ constructor(debugId: string);
1136
+ private onRemoveCell;
1137
+ set poolSize(cellCount: number);
1138
+ get poolSize(): number;
1139
+ getDetachedCell(): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
1140
+ private clearCellFromMatrix;
1141
+ private addCellToMatrix;
1142
+ private setCellPositionInMatrix;
1143
+ renderNodeAtCell(node: Renderable, cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>, cellPos: CellPos, additionalInfo?: T_ADDITIONAL_CELL_INFO, scrollingObjectParam?: {
1144
+ scrolling: boolean;
1145
+ }): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
1146
+ getCellPosition(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): CellPos | null;
1147
+ getCellAt(cellPos: CellPos): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
1148
+ /**
1149
+ * This gets a cell for a given position.
1150
+ * If there's already a cell currently attached at that position, it will be returned.
1151
+ *
1152
+ * Otherwise, we try to return the most optimal cell to use for that position.
1153
+ * If the optimise parameter is set to 'row', we will try to return a detached cell
1154
+ * that was last rendered in that row.
1155
+ *
1156
+ * If the optimise parameter is set to 'column', we will try to return a detached cell
1157
+ * that was last rendered in that column.
1158
+ *
1159
+ * @param cellPos [rowIndex, colIndex]
1160
+ * @param optimise 'row' | 'column'
1161
+ */
1162
+ getCellFor(cellPos: CellPos, optimise: 'row' | 'column'): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
1163
+ isCellAttached(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): boolean;
1164
+ isCellAttachedAt(cellPos: CellPos): boolean;
1165
+ getMatrix(): Renderable[][];
1166
+ getAllCells(): GridCellInterface<T_ADDITIONAL_CELL_INFO>[];
1167
+ getCellsForRow(rowIndex: number): GridCellInterface<T_ADDITIONAL_CELL_INFO>[];
1168
+ getOneAttachedCell(): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
1169
+ getRowsWithCells(): number[];
1170
+ getColumnsWithCells(): number[];
1171
+ isRowAttached(rowIndex: number): boolean;
1172
+ isColumnAttached(colIndex: number): boolean;
1173
+ detachRow(rowIndex: number): void;
1174
+ detachCol(colIndex: number): void;
1175
+ detachCell(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): boolean;
1176
+ detachCells(cells: Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>): void;
1177
+ detachRowsStartingWith(rowIndex: number): void;
1178
+ detachColsStartingWith(colIndex: number): void;
1179
+ detachCellsStartingAt(cellPos: CellPos): void;
1180
+ detachCellAt(cellPos: CellPos): boolean;
1181
+ onCellAttachmentChange(callback: (cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>, attached: boolean) => void): VoidFn;
1182
+ getCellsOutsideRenderRange: (range: TableRenderRange) => Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>;
1183
+ getCellFromListForRow(cells: Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>, rowIndex: number): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
1184
+ getCellFromListForColumn(cells: Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>, colIndex: number): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
1185
+ getCellCountInMatrix(): number;
1186
+ destroy(): void;
1187
+ reset(): void;
1188
+ makeDetachedCellsEmpty(): void;
1189
+ withDetachedCells(fn: (cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>) => void): void;
1190
+ }
1159
1191
 
1160
- type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
1161
- type InfiniteTableToggleTreeNodeFn = (nodePath: any[]) => void;
1162
- type InfiniteTableToggleRowDetailsFn = (id: any) => void;
1163
- type InfiniteTableSelectRowFn = (id: any) => void;
1164
- type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1165
- dragging: boolean;
1166
- column: COL_TYPE;
1167
- columnsMap: Map<string, COL_TYPE>;
1168
- columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
1169
- columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
1170
- selectionMode: DataSourcePropSelectionMode;
1171
- horizontalLayoutPageIndex: null | number;
1172
- allRowsSelected: boolean;
1173
- someRowsSelected: boolean;
1174
- filtered: boolean;
1175
- api: InfiniteTableApi<DATA_TYPE>;
1176
- dataSourceApi: DataSourceApi<DATA_TYPE>;
1177
- columnApi: InfiniteTableColumnApi<DATA_TYPE>;
1178
- renderBag: {
1179
- all?: Renderable;
1180
- header: string | number | Renderable;
1181
- sortIcon?: Renderable;
1182
- menuIcon?: Renderable;
1183
- menuIconProps?: MenuIconProps;
1184
- filterIcon?: Renderable;
1185
- filterEditor?: Renderable;
1186
- selectionCheckBox?: Renderable;
1187
- };
1188
- } & ({
1189
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
1190
- htmlElementRef: React$1.MutableRefObject<HTMLElement | null>;
1191
- renderLocation: 'column-header';
1192
- } | {
1193
- renderLocation: 'grouping-toolbar' | 'column-menu' | 'column-filter';
1194
- });
1195
- type InfiniteTableColumnRenderBag = {
1196
- value: string | number | Renderable;
1197
- groupIcon?: Renderable;
1198
- treeIcon?: Renderable;
1199
- rowDetailsIcon?: Renderable;
1200
- all?: Renderable;
1201
- selectionCheckBox?: Renderable;
1202
- };
1203
- type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1204
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
1205
- htmlElementRef: React$1.MutableRefObject<HTMLElement | null>;
1206
- rowIndexInHorizontalLayoutPage: null | number;
1207
- horizontalLayoutPageIndex: null | number;
1208
- value: string | number | Renderable;
1209
- align: InfiniteTableColumnAlignValues;
1210
- verticalAlign: InfiniteTableColumnVerticalAlignValues;
1211
- renderBag: InfiniteTableColumnRenderBag;
1212
- rowIndex: number;
1213
- rowActive: boolean;
1214
- api: InfiniteTableApi<DATA_TYPE>;
1215
- dataSourceApi: DataSourceApi<DATA_TYPE>;
1216
- editError?: Error;
1217
- column: COL_TYPE;
1218
- columnsMap: Map<string, COL_TYPE>;
1219
- fieldsToColumn: Map<keyof DATA_TYPE, COL_TYPE>;
1220
- groupByColumn?: InfiniteTableComputedColumn<DATA_TYPE>;
1221
- toggleCurrentGroupRow: () => void;
1222
- toggleCurrentTreeNode: () => void;
1223
- expandTreeNode: InfiniteTableToggleTreeNodeFn;
1224
- collapseTreeNode: InfiniteTableToggleTreeNodeFn;
1225
- toggleGroupRow: InfiniteTableToggleGroupRowFn;
1226
- toggleTreeNode: InfiniteTableToggleTreeNodeFn;
1227
- toggleCurrentTreeNodeSelection: () => void;
1228
- toggleCurrentGroupRowSelection: () => void;
1229
- toggleCurrentRowSelection: () => void;
1230
- toggleCurrentRowDetails: () => void;
1231
- toggleRowDetails: InfiniteTableToggleRowDetailsFn;
1232
- expandRowDetails: InfiniteTableToggleRowDetailsFn;
1233
- collapseRowDetails: InfiniteTableToggleRowDetailsFn;
1234
- rowHasSelectedCells: boolean;
1235
- cellSelected: boolean;
1236
- selectCurrentRow: () => void;
1237
- selectRow: InfiniteTableSelectRowFn;
1238
- deselectRow: InfiniteTableSelectRowFn;
1239
- deselectCurrentRow: () => void;
1240
- selectCell: () => void;
1241
- deselectCell: () => void;
1242
- toggleRowSelection: InfiniteTableSelectRowFn;
1243
- toggleGroupRowSelection: InfiniteTableToggleGroupRowFn;
1244
- toggleTreeNodeSelection: InfiniteTableToggleTreeNodeFn;
1245
- selectTreeNode: InfiniteTableToggleTreeNodeFn;
1246
- deselectTreeNode: InfiniteTableToggleTreeNodeFn;
1247
- selectionMode: DataSourcePropSelectionMode | undefined;
1248
- rootGroupBy: DataSourceState<DATA_TYPE>['groupBy'];
1249
- pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
1250
- };
1251
- type InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
1252
- type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE>;
1253
- type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1254
- rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
1255
- data: DATA_TYPE | Partial<DATA_TYPE> | null;
1256
- dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
1257
- rowIndex: number;
1258
- column: COL_TYPE;
1259
- };
1260
- type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1261
- isGroupRow: true;
1262
- }) => Renderable | null;
1263
- type InfiniteTableColumnRenderFunctionForParentNode<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1264
- isTreeNode: true;
1265
- isParentNode: true;
1266
- }) => Renderable | null;
1267
- type InfiniteTableColumnRenderFunctionForLeafNode<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1268
- isTreeNode: true;
1269
- isParentNode: false;
1270
- }) => Renderable | null;
1271
- type InfiniteTableColumnRenderFunctionForNode<DATA_TYPE, EXTRA_NODE_PARAMS = Partial<InfiniteTableRowInfoDataDiscriminator_ParentNode<DATA_TYPE> | InfiniteTableRowInfoDataDiscriminator_LeafNode<DATA_TYPE>>, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & EXTRA_NODE_PARAMS) => Renderable | null;
1272
- type InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1273
- isGroupRow: false;
1274
- }) => Renderable | null;
1275
- type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE>) => Renderable | null;
1276
- type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParam<T>) => Renderable;
1277
- type InfiniteTableColumnOrHeaderRenderFunction<T> = (params: (InfiniteTableColumnCellContextType<T> & {
1278
- rowInfo: InfiniteTableRowInfo<T>;
1279
- }) | (InfiniteTableColumnHeaderParam<T> & {
1280
- rowInfo: null;
1281
- })) => ReturnType<InfiniteTableColumnRenderFunction<T>>;
1282
- type InfiniteTableColumnContentFocusable<T> = boolean | InfiniteTableColumnContentFocusableFn<T>;
1283
- type InfiniteTableColumnEditable<T> = boolean | InfiniteTableColumnEditableFn<T>;
1284
- type InfiniteTableColumnContentFocusableFn<T> = (params: InfiniteTableColumnContentFocusableParams<T>) => boolean;
1285
- type InfiniteTableColumnEditableFn<T> = (params: InfiniteTableColumnEditableParams<T>) => boolean | Promise<boolean>;
1286
- type InfiniteTableColumnContentFocusableParams<T> = InfiniteTableRowInfoDataDiscriminatorWithColumnAndApis<T>;
1287
- type InfiniteTableColumnEditableParams<T> = InfiniteTableColumnContentFocusableParams<T>;
1288
- type InfiniteTableColumnGetValueToPersistParams<T> = InfiniteTableColumnEditableParams<T> & {
1289
- initialValue: any;
1290
- };
1291
- type InfiniteTableColumnAlignValues = 'start' | 'center' | 'end';
1292
- type InfiniteTableColumnVerticalAlignValues = 'start' | 'center' | 'end';
1293
- type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
1294
- type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
1295
- type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
1296
- type InfiniteTableColumnStylingFnParams<T> = {
1297
- value: Renderable;
1298
- column: InfiniteTableComputedColumn<T>;
1299
- rowIndexInHorizontalLayoutPage: null | number;
1300
- horizontalLayoutPageIndex: null | number;
1301
- inEdit: boolean;
1302
- rowHasSelectedCells: boolean;
1303
- editError: InfiniteTableColumnRenderParamBase<T>['editError'];
1304
- } & InfiniteTableRowInfoDataDiscriminator<T>;
1305
- type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStylingFnParams<T>) => undefined | React$1.CSSProperties;
1306
- type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
1307
- type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React$1.CSSProperties;
1308
- type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStylingFnParams<T>) => undefined | string;
1309
- type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
1310
- type InfiniteTableColumnAlign<T> = InfiniteTableColumnAlignValues | InfiniteTableColumnAlignFn<T>;
1311
- type InfiniteTableColumnVerticalAlign<T> = InfiniteTableColumnVerticalAlignValues | InfiniteTableColumnVerticalAlignFn<T>;
1312
- type InfiniteTableColumnAlignFn<T> = (params: InfiniteTableColumnAlignFnParams<T>) => InfiniteTableColumnAlignValues;
1313
- type InfiniteTableColumnAlignFnParams<T> = XOR<{
1314
- isHeader: true;
1315
- column: InfiniteTableComputedColumn<T>;
1316
- }, InfiniteTableColumnStylingFnParams<T> & {
1317
- isHeader: false;
1318
- }>;
1319
- type InfiniteTableColumnVerticalAlignFn<T> = (params: InfiniteTableColumnAlignFnParams<T>) => InfiniteTableColumnVerticalAlignValues;
1320
- type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
1321
- type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
1322
- type InfiniteTableColumnHeaderClassName<T> = string | InfiniteTableColumnHeaderClassNameFn<T>;
1323
- type InfiniteTableColumnValueGetterParams<T> = ValueGetterParams<T>;
1324
- type InfiniteTableColumnValueFormatterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
1325
- type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
1326
- type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
1327
- type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
1328
- type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
1329
- type InfiniteTableColumnSortableFn<T> = (context: {
1330
- api: InfiniteTableApi<T>;
1331
- columnApi: InfiniteTableColumnApi<T>;
1332
- column: InfiniteTableComputedColumn<T>;
1333
- columns: Map<string, InfiniteTableComputedColumn<T>>;
1334
- }) => boolean;
1335
- type InfiniteTableColumnSortable<T> = boolean | InfiniteTableColumnSortableFn<T>;
1336
1192
  /**
1337
- * Defines a column in the table.
1338
- *
1339
- * @typeParam DATA_TYPE The type of the data in the table.
1340
- *
1341
- * Can be bound to a field which is a `keyof DATA_TYPE`.
1193
+ * This is only used for rendering Detail rows in a master-detail DataGrid
1342
1194
  */
1343
- type InfiniteTableColumn<DATA_TYPE> = {
1344
- field?: KeyOfNoSymbol<DATA_TYPE>;
1345
- valueGetter?: InfiniteTableColumnValueGetter<DATA_TYPE>;
1346
- defaultSortable?: InfiniteTableColumnSortable<DATA_TYPE>;
1195
+ interface ListRowInterface {
1196
+ debugId: string;
1197
+ update(content: Renderable): void;
1198
+ getElement(): HTMLElement | null;
1199
+ getNode(): Renderable;
1200
+ destroy(): void;
1201
+ onMount(callback: (row: ListRowInterface) => void): void;
1202
+ isMounted(): boolean;
1203
+ ref: (htmlElement: HTMLElement) => void;
1204
+ }
1205
+
1206
+ declare class ListRowManager extends Logger {
1207
+ private pool;
1208
+ private indexToRow;
1209
+ private rowToIndex;
1210
+ debugId: string;
1211
+ private offRemoveRow;
1212
+ constructor(debugId: string);
1213
+ private onRemoveRow;
1214
+ set poolSize(rowCount: number);
1215
+ get poolSize(): number;
1216
+ getDetachedRow(): ListRowInterface;
1347
1217
  /**
1348
- * Whether the column is draggable by default.
1218
+ * This gets a row for a given position.
1219
+ * If there's already a row currently attached at that position, it will be returned.
1349
1220
  *
1350
- * This prop overrides the top-level columnDefaultDraggable prop, but is
1351
- * overridden by the top-level draggableColumns prop.
1221
+ * Otherwise, we return another row.
1222
+ * @param rowIndex
1352
1223
  */
1353
- defaultDraggable?: boolean;
1354
- resizable?: boolean;
1355
- shouldAcceptEdit?: (params: InfiniteTablePropOnEditAcceptedParams<DATA_TYPE>) => boolean | Error | Promise<boolean | Error>;
1356
- contentFocusable?: InfiniteTableColumnContentFocusable<DATA_TYPE>;
1357
- defaultEditable?: InfiniteTableColumnEditable<DATA_TYPE>;
1358
- getValueToEdit?: (params: InfiniteTableColumnEditableParams<DATA_TYPE>) => any | Promise<any>;
1359
- getValueToPersist?: (params: InfiniteTableColumnGetValueToPersistParams<DATA_TYPE>) => any | Promise<any>;
1360
- comparer?: InfiniteTableColumnComparer<DATA_TYPE>;
1361
- defaultHiddenWhenGroupedBy?: '*' | true | keyof DATA_TYPE | {
1362
- [k in keyof Partial<DATA_TYPE>]: true;
1363
- };
1364
- align?: InfiniteTableColumnAlign<DATA_TYPE>;
1365
- headerAlign?: InfiniteTableColumnAlign<DATA_TYPE>;
1366
- verticalAlign?: InfiniteTableColumnVerticalAlign<DATA_TYPE>;
1367
- columnGroup?: string;
1368
- header?: InfiniteTableColumnHeader<DATA_TYPE>;
1369
- renderHeader?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1370
- name?: Renderable;
1371
- cssEllipsis?: boolean;
1372
- headerCssEllipsis?: boolean;
1373
- type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
1374
- dataType?: InfiniteTableDataTypeNames;
1375
- sortType?: string | string[];
1376
- filterType?: string;
1377
- style?: InfiniteTableColumnStyle<DATA_TYPE>;
1378
- headerStyle?: InfiniteTableColumnHeaderStyle<DATA_TYPE>;
1379
- headerClassName?: InfiniteTableColumnHeaderClassName<DATA_TYPE>;
1380
- className?: InfiniteTableColumnClassName<DATA_TYPE>;
1381
- rowspan?: InfiniteTableColumnRowspanFn<DATA_TYPE>;
1382
- render?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
1383
- renderValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
1384
- renderGroupValue?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
1385
- renderLeafValue?: InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE>;
1386
- valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE, Renderable>;
1387
- defaultWidth?: number;
1388
- defaultFlex?: number;
1389
- defaultFilterable?: boolean;
1390
- defaultGroupable?: boolean;
1391
- minWidth?: number;
1392
- maxWidth?: number;
1393
- renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
1394
- renderRowDetailIcon?: boolean | InfiniteTableColumnRenderFunction<DATA_TYPE>;
1395
- renderTreeIcon?: boolean | InfiniteTableColumnRenderFunctionForNode<DATA_TYPE, {
1396
- isTreeNode: true;
1397
- isParentNode: boolean;
1398
- isGroupRow: false;
1399
- nodeExpanded: boolean;
1400
- }>;
1401
- renderTreeIconForParentNode?: InfiniteTableColumnRenderFunctionForParentNode<DATA_TYPE, {
1402
- isTreeNode: true;
1403
- isGroupRow: true;
1404
- isParentNode: true;
1405
- }>;
1406
- renderTreeIconForLeafNode?: InfiniteTableColumnRenderFunctionForLeafNode<DATA_TYPE, {
1407
- isTreeNode: true;
1408
- isGroupRow: false;
1409
- isLeafNode: true;
1224
+ getRowFor(rowIndex: number): ListRowInterface;
1225
+ private setRowIndexInList;
1226
+ detachStartingWith(rowIndex: number): void;
1227
+ getRowAt(rowPos: number): ListRowInterface | undefined;
1228
+ getRowIndex(row: ListRowInterface): number | undefined;
1229
+ isRowAttached(row: ListRowInterface): boolean;
1230
+ isRowAttachedAt(rowIndex: number): boolean;
1231
+ getList(): Renderable[];
1232
+ getAttachedCount(): number;
1233
+ forEachAttachedRow(fn: (row: ListRowInterface) => void): void;
1234
+ getAttachedIndexes(): number[];
1235
+ getAllRows(): ListRowInterface[];
1236
+ detachRowAt(rowIndex: number): void;
1237
+ detachRow(row: ListRowInterface): void;
1238
+ renderNodeAtRow(node: Renderable, row: ListRowInterface, rowIndex: number): ListRowInterface;
1239
+ makeDetachedRowsEmpty(): void;
1240
+ onRowAttachmentChange(callback: (row: ListRowInterface, attached: boolean) => void): VoidFn;
1241
+ withDetachedRows(fn: (row: ListRowInterface) => void): void;
1242
+ destroy(): void;
1243
+ reset(): void;
1244
+ }
1245
+
1246
+ declare class GridRenderer extends Logger {
1247
+ protected brain: MatrixBrain;
1248
+ debugId: string;
1249
+ protected destroyed: boolean;
1250
+ private scrolling;
1251
+ cellHoverClassNames: string[];
1252
+ cellDetachedClassNames: string[];
1253
+ cellManager: GridCellManager<{
1254
+ renderRowIndex: number;
1255
+ renderColIndex: number;
1410
1256
  }>;
1411
- renderSortIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1412
- renderFilterIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1413
- renderSelectionCheckBox?: boolean | InfiniteTableColumnOrHeaderRenderFunction<DATA_TYPE>;
1414
- renderMenuIcon?: boolean | InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1415
- renderHeaderSelectionCheckBox?: boolean | InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1416
- components?: {
1417
- ColumnCell?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1418
- HeaderCell?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1419
- Editor?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1420
- FilterEditor?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1421
- FilterOperatorSwitch?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1422
- MenuIcon?: React$1.ComponentType<MenuIconProps>;
1257
+ protected rowManager: ListRowManager;
1258
+ private lastEnteredRow;
1259
+ private lastExitedRow;
1260
+ private onDestroy;
1261
+ private hoverRowUpdatesInProgress;
1262
+ private infiniteNode;
1263
+ private getInfiniteNode;
1264
+ setDetailTransform: (element: HTMLElement, _rowIndex: number, { y, scrollTop, scrollLeft, }: {
1265
+ y: number;
1266
+ scrollTop?: boolean;
1267
+ scrollLeft?: number;
1268
+ }) => void;
1269
+ setTransform: (element: HTMLElement, _rowIndex: number, colIndex: number, { x, y, scrollLeft, scrollTop, }: {
1270
+ x: number;
1271
+ y: number;
1272
+ scrollLeft?: boolean;
1273
+ scrollTop?: boolean;
1274
+ }, zIndex: number | "auto" | undefined | null) => void;
1275
+ constructor(brain: MatrixBrain, debugId?: string);
1276
+ private onCellAttached;
1277
+ private onCellDetached;
1278
+ private onRowAttached;
1279
+ private onRowDetached;
1280
+ getFullyVisibleRowsRange: () => {
1281
+ start: number;
1282
+ end: number;
1283
+ } | null;
1284
+ getScrollPositionForScrollRowIntoView: (rowIndex: number, config?: {
1285
+ scrollAdjustPosition?: ScrollAdjustPosition;
1286
+ offset?: number;
1287
+ colIndex?: number;
1288
+ }) => ScrollPosition | null;
1289
+ getScrollPositionForScrollColumnIntoView: (colIndex: number, config?: {
1290
+ scrollAdjustPosition?: ScrollAdjustPosition;
1291
+ offset?: number;
1292
+ } & HorizontalLayoutColVisibilityOptions) => ScrollPosition | null;
1293
+ getScrollPositionForScrollCellIntoView: (rowIndex: number, colIndex: number, config?: {
1294
+ rowScrollAdjustPosition?: ScrollAdjustPosition;
1295
+ colScrollAdjustPosition?: ScrollAdjustPosition;
1296
+ scrollAdjustPosition?: ScrollAdjustPosition;
1297
+ offsetTop: number;
1298
+ offsetLeft: number;
1299
+ }) => ScrollPosition | null;
1300
+ isRowFullyVisible: (rowIndex: number, offsetMargin?: number) => boolean;
1301
+ isRowVisible: (rowIndex: number, offsetMargin?: number) => boolean;
1302
+ isRowRendered: (rowIndex: number) => boolean;
1303
+ isCellVisible: (rowIndex: number, colIndex: number) => boolean;
1304
+ isCellFullyVisible: (rowIndex: number, colIndex: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
1305
+ isColumnFullyVisible: (colIndex: number, offsetMargin?: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
1306
+ isColumnVisible: (colIndex: number, offsetMargin?: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
1307
+ isCellRendered: (rowIndex: number, colIndex: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
1308
+ isColumnRendered: (colIndex: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
1309
+ getExtraSpanCellsForRange: (range: TableRenderRange) => [number, number][];
1310
+ isCellRenderedAndMappedCorrectly(row: number, col: number): {
1311
+ rendered: boolean;
1312
+ mapped: boolean;
1423
1313
  };
1314
+ renderRange(range: TableRenderRange, { renderCell, renderDetailRow, force, onRender }: RenderRangeOptions): Renderable[];
1315
+ getFixedRanges: (currentRenderRange: TableRenderRange) => TableRenderRange[];
1316
+ protected isCellFixed: (rowIndex: number, colIndex: number) => {
1317
+ row: FixedPosition;
1318
+ col: FixedPosition;
1319
+ };
1320
+ protected isCellCovered: (rowIndex: number, colIndex: number) => false | number[];
1321
+ private renderDetailRowAtElement;
1322
+ protected getCellRealCoordinates(rowIndex: number, colIndex: number): {
1323
+ rowIndex: number;
1324
+ colIndex: number;
1325
+ };
1326
+ protected onMouseEnterNotBound: (event: React.MouseEvent<HTMLElement>) => void;
1327
+ protected onMouseLeaveNotBound: (event: React.MouseEvent<HTMLElement>) => void;
1328
+ protected renderCellAt(rowIndex: number, colIndex: number, cell: GridCellInterface, renderCell: TableRenderCellFn): void;
1329
+ protected onMouseEnter: (rowIndex: number) => void;
1330
+ private addHoverClass;
1331
+ protected onMouseLeave: (rowIndex: number) => void;
1332
+ private removeHoverClass;
1333
+ protected updateHoverClassNamesForRow: (rowIndex: number) => void;
1334
+ protected updateElementPosition: (cell: GridCellInterface<{
1335
+ renderRowIndex: number;
1336
+ renderColIndex: number;
1337
+ }>, options?: {
1338
+ hidden: boolean;
1339
+ rowspan: number;
1340
+ colspan: number;
1341
+ }) => void;
1342
+ private updateDetailElementPosition;
1343
+ private onScrollStart;
1344
+ private onScrollStop;
1345
+ adjustFixedElementsOnScroll: (scrollPosition?: ScrollPosition) => void;
1346
+ destroy: () => void;
1347
+ reset(): void;
1348
+ }
1349
+
1350
+ type CellPositionByIndex = {
1351
+ rowIndex: number;
1352
+ colIndex: number;
1424
1353
  };
1425
- type InfiniteTableGeneratedGroupColumn<T> = Omit<InfiniteTableColumn<T>, 'defaultSortable'> & {
1426
- groupByForColumn: GroupBy<T> | GroupBy<T>[];
1427
- id?: string;
1428
- };
1429
- type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
1430
- type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
1431
- pivotBy: DataSourcePivotBy<DataType>[];
1432
- pivotTotalColumnGroup?: true;
1433
- pivotGroupKeys: KeyType[];
1434
- pivotByAtIndex: PivotBy<DataType, KeyType>;
1435
- pivotGroupKey: KeyType;
1436
- pivotIndex: number;
1437
- };
1438
- type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
1439
- pivotBy: DataSourcePivotBy<DataType>[];
1440
- pivotColumn: true;
1441
- pivotTotalColumn: boolean;
1442
- pivotAggregator: AggregationReducer<DataType, any>;
1443
- pivotAggregatorIndex: number;
1444
- pivotGroupKeys: KeyType[];
1445
- pivotByAtIndex?: PivotBy<DataType, KeyType>;
1446
- pivotIndex: number;
1447
- pivotGroupKey: KeyType;
1448
- };
1449
- type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
1450
- type InfiniteTableComputedColumnBase<T> = {
1451
- computedFilterType: string;
1452
- computedSortType: string | string[];
1453
- computedDataType: string;
1454
- computedWidth: number;
1455
- computedFlex: number | null;
1456
- computedMinWidth: number;
1457
- computedMaxWidth: number;
1458
- computedOffset: number;
1459
- computedPinningOffset: number;
1460
- computedAbsoluteOffset: number;
1461
- computedSortInfo: DataSourceSingleSortInfo<T> | null;
1462
- computedSorted: boolean;
1463
- computedSortedAsc: boolean;
1464
- computedSortedDesc: boolean;
1465
- computedSortIndex: number;
1466
- computedVisible: boolean;
1467
- computedVisibleIndex: number;
1468
- computedVisibleIndexInCategory: number;
1469
- computedMultiSort: boolean;
1470
- computedFiltered: boolean;
1471
- computedFilterable: boolean;
1472
- computedGroupedBy: boolean;
1473
- computedGroupedByIndex: number | undefined;
1474
- computedGroupable: boolean;
1475
- computedFilterValue: DataSourceFilterValueItem<T> | null;
1476
- computedPinned: InfiniteTableColumnPinnedValues;
1477
- computedDraggable: boolean;
1478
- computedResizable: boolean;
1479
- computedFirstInCategory: boolean;
1480
- computedLastInCategory: boolean;
1481
- computedFirst: boolean;
1482
- computedLast: boolean;
1483
- computedEditable: NonUndefined<InfiniteTableColumn<T>['defaultEditable']>;
1484
- computedSortable: NonUndefined<InfiniteTableColumn<T>['defaultSortable']>;
1485
- colType: InfiniteTableColumnType<T>;
1486
- id: string;
1354
+ type MultiSelectRangeOptions = {
1355
+ horizontalLayout: false;
1356
+ } | {
1357
+ horizontalLayout: true;
1358
+ rowsPerPage: number;
1359
+ columnsPerSet: number;
1487
1360
  };
1488
- type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
1489
- type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
1490
1361
 
1491
- type ForceOptions = {
1492
- force?: boolean;
1493
- };
1494
- type TreeExpandStateApi<T> = {
1495
- isNodeExpanded(nodePath: any[]): boolean;
1496
- isNodeReadOnly(nodePath: any[]): boolean;
1497
- expandNode(nodePath: any[], options?: ForceOptions): void;
1498
- collapseNode(nodePath: any[], options?: ForceOptions): void;
1499
- toggleNode(nodePath: any[], options?: ForceOptions): void;
1500
- getNodeDataByPath(nodePath: any[]): T | null;
1501
- getRowInfoByPath(nodePath: any[]): InfiniteTableRowInfo<T> | null;
1502
- };
1503
- type TreeSelectionApi<T = any> = {
1504
- get allRowsSelected(): boolean;
1505
- isNodeSelected(nodePath: NodePath$1): boolean | null;
1506
- selectNode(nodePath: NodePath$1, options?: ForceOptions): void;
1507
- setNodeSelection(nodePath: NodePath$1, selected: boolean, options?: ForceOptions): void;
1508
- deselectNode(nodePath: NodePath$1, options?: ForceOptions): void;
1509
- toggleNodeSelection(nodePath: NodePath$1, options?: ForceOptions): void;
1510
- selectAll(): void;
1511
- expandAll(): void;
1512
- collapseAll(): void;
1513
- deselectAll(): void;
1514
- getSelectedLeafNodePaths(config?: {
1515
- rootNodePath?: NodePath$1;
1516
- treeSelectionState?: TreeSelectionState<T>;
1517
- }): NodePath$1[];
1518
- getDeselectedLeafNodePaths(config?: {
1519
- rootNodePath?: NodePath$1;
1520
- treeSelectionState?: TreeSelectionState<T>;
1521
- }): NodePath$1[];
1522
- getSelectedLeafRowInfos(config?: {
1523
- rootNodePath?: NodePath$1;
1524
- treeSelectionState?: TreeSelectionState<T>;
1525
- }): InfiniteTable_Tree_RowInfoLeafNode<T>[];
1526
- };
1527
- type TreeApi<T> = TreeExpandStateApi<T> & TreeSelectionApi<T>;
1528
-
1529
- type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
1530
- type BooleanDeepCollectionStateObject<KeyType> = {
1531
- positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
1532
- negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
1533
- };
1534
- declare abstract class BooleanDeepCollectionState<StateObject, KeyType extends any = any> {
1535
- protected positiveMap?: DeepMap<KeyType, true>;
1536
- protected negativeMap?: DeepMap<KeyType, true>;
1537
- protected allNegative: boolean;
1538
- protected allPositive: boolean;
1539
- private initialState;
1540
- constructor(state: BooleanDeepCollectionStateObject<KeyType> | BooleanDeepCollectionState<StateObject, KeyType>);
1541
- abstract getPositiveFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1542
- abstract getNegativeFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1543
- abstract getState(): StateObject;
1544
- protected getInitialState(): BooleanDeepCollectionStateObject<KeyType>;
1545
- destroy(): void;
1546
- private update;
1547
- protected areAllNegative(): boolean;
1548
- protected areAllPositive(): boolean;
1549
- protected makeAllNegative(): void;
1550
- protected makeAllPositive(): void;
1551
- protected isItemPositive(keys: KeyType[]): boolean | undefined;
1552
- protected isItemNegative(keys: KeyType[]): boolean;
1553
- protected setItemValue(keys: KeyType[], shouldMakePositive: boolean): void;
1554
- protected makeItemNegative(keys: KeyType[]): void;
1555
- protected makeItemPositive(keys: KeyType[]): void;
1556
- protected toggleItem(keys: KeyType[]): void;
1557
- }
1558
-
1559
- declare class GroupRowsState<KeyType extends any = any> extends BooleanDeepCollectionState<DataSourcePropGroupRowsStateObject<KeyType>, KeyType> {
1560
- constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
1561
- getState(): DataSourcePropGroupRowsStateObject<KeyType>;
1562
- getPositiveFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1563
- getNegativeFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1564
- areAllCollapsed(): boolean;
1565
- areAllExpanded(): boolean;
1566
- collapseAll(): void;
1567
- expandAll(): void;
1568
- isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
1569
- isGroupRowCollapsed(keys: KeyType[]): boolean;
1570
- setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
1571
- collapseGroupRow(keys: KeyType[]): void;
1572
- expandGroupRow(keys: KeyType[]): void;
1573
- toggleGroupRow(keys: KeyType[]): void;
1362
+ declare class ScrollListener {
1363
+ private scrollPosition;
1364
+ private onScrollFns;
1365
+ getScrollPosition: () => ScrollPosition;
1366
+ onScroll: (fn: OnScrollFn) => () => void;
1367
+ setScrollPosition: (scrollPosition: ScrollPosition) => void;
1368
+ private notifyScrollChange;
1369
+ destroy: () => void;
1574
1370
  }
1575
1371
 
1576
- type IndexerOptions<DataType, PrimaryKeyType> = {
1577
- toPrimaryKey: (data: DataType) => PrimaryKeyType;
1578
- cache?: DataSourceCache<DataType, PrimaryKeyType>;
1579
- getNodeChildren?: TreeParams<DataType, PrimaryKeyType>['getNodeChildren'];
1580
- isLeafNode?: TreeParams<DataType, PrimaryKeyType>['isLeafNode'];
1581
- nodesKey: string | undefined;
1372
+ type DiscriminatedUnion<A, B> = (A & {
1373
+ [K in keyof B]?: undefined;
1374
+ }) | (B & {
1375
+ [K in keyof A]?: undefined;
1376
+ });
1377
+ type KeyOfNoSymbol<T> = Exclude<keyof T, Symbol>;
1378
+ /**
1379
+ * Restrict using either exclusively the keys of T or exclusively the keys of U.
1380
+ *
1381
+ * No unique keys of T can be used simultaneously with any unique keys of U.
1382
+ *
1383
+ * @example
1384
+ *```
1385
+ * const myVar: XOR<T, U>
1386
+ *```
1387
+ *
1388
+ * @see https://github.com/maninak/ts-xor/tree/master#description
1389
+ */
1390
+ type XOR<T, U> = T | U extends object ? Prettify<Without<T, U> & U> | Prettify<Without<U, T> & T> : T | U;
1391
+ /**
1392
+ * Useful if applying XOR on more than 2 types.
1393
+ * It comes with the penalty of having the types wrapped in an array
1394
+ *
1395
+ * @example
1396
+ * ```
1397
+ * AllXOR<[
1398
+ * { a: AModule },
1399
+ * { b: BModule },
1400
+ * { c: CModule },
1401
+ * { d: DModule }
1402
+ * ]>
1403
+ * ```
1404
+ * @see https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-723571692
1405
+ */
1406
+ type AllXOR<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? AllXOR<[XOR<A, B>, ...Rest]> : never;
1407
+ /**
1408
+ * Get the keys of T without any keys of U.
1409
+ */
1410
+ type Without<T, U> = {
1411
+ [P in Exclude<keyof T, keyof U>]?: never;
1582
1412
  };
1583
- declare class Indexer<DataType, PrimaryKeyType = string> {
1584
- primaryKeyToData: Map<PrimaryKeyType, DataType>;
1585
- nodePathsToData: DeepMap<PrimaryKeyType, DataType>;
1586
- private removeNodePath;
1587
- private remove;
1588
- private add;
1589
- private addNodePath;
1590
- clear: () => void;
1591
- getDataForPrimaryKey: (primaryKey: PrimaryKeyType) => DataType | undefined;
1592
- getDataForNodePath: (nodePath: NodePath$1) => DataType | undefined;
1593
- indexArray: (arr: DataType[], options: IndexerOptions<DataType, PrimaryKeyType>) => DataType[];
1594
- }
1413
+ /**
1414
+ * Resolve mapped types and show the derived keys and their types when hovering in
1415
+ * IDEs, instead of just showing the names those mapped types are defined with.
1416
+ */
1417
+ type Prettify<T> = {
1418
+ [K in keyof T]: T[K];
1419
+ } & {};
1595
1420
 
1596
- declare class RowDisabledState<KeyType = any> extends BooleanCollectionState<RowDisabledStateObject<KeyType>, KeyType> {
1597
- constructor(state: RowDisabledStateObject<KeyType> | RowDisabledState<KeyType>);
1598
- getState(): RowDisabledStateObject<KeyType>;
1599
- getPositiveFromState(state: RowDisabledStateObject<KeyType>): true | KeyType[];
1600
- getNegativeFromState(state: RowDisabledStateObject<KeyType>): true | KeyType[];
1601
- areAllDisabled(): boolean;
1602
- areAllEnabled(): boolean;
1603
- disableAll(): void;
1604
- enableAll(): void;
1605
- isRowEnabled: (key: KeyType) => boolean;
1606
- isRowDisabled(key: KeyType): boolean;
1607
- setRowEnabled(key: KeyType, enabled: boolean): void;
1608
- disableRow(key: KeyType): void;
1609
- enableRow(key: KeyType): void;
1610
- toggleRow(key: KeyType): void;
1611
- }
1421
+ type MenuIconProps = {
1422
+ lineWidth?: number;
1423
+ lineStyle?: React$1.CSSProperties;
1424
+ style?: React$1.CSSProperties;
1425
+ className?: string;
1426
+ domProps?: React$1.HTMLAttributes<HTMLDivElement>;
1427
+ reserveSpaceWhenHidden?: boolean;
1428
+ menuVisible?: boolean;
1429
+ children?: React$1.ReactNode;
1430
+ };
1431
+ declare function MenuIcon(props: MenuIconProps): React$1.JSX.Element;
1612
1432
 
1613
- type RowSelectionStateItem = (any | any[])[];
1614
- type RowSelectionStateObject = {
1615
- selectedRows: RowSelectionStateItem;
1616
- deselectedRows: RowSelectionStateItem;
1617
- defaultSelection: boolean;
1618
- } | {
1619
- defaultSelection: true;
1620
- deselectedRows: RowSelectionStateItem;
1621
- selectedRows?: RowSelectionStateItem;
1433
+ type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
1434
+ type InfiniteTableToggleTreeNodeFn = (nodePath: any[]) => void;
1435
+ type InfiniteTableToggleRowDetailsFn = (id: any) => void;
1436
+ type InfiniteTableSelectRowFn = (id: any) => void;
1437
+ type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1438
+ dragging: boolean;
1439
+ column: COL_TYPE;
1440
+ columnsMap: Map<string, COL_TYPE>;
1441
+ columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
1442
+ columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
1443
+ selectionMode: DataSourcePropSelectionMode;
1444
+ horizontalLayoutPageIndex: null | number;
1445
+ allRowsSelected: boolean;
1446
+ someRowsSelected: boolean;
1447
+ filtered: boolean;
1448
+ api: InfiniteTableApi<DATA_TYPE>;
1449
+ dataSourceApi: DataSourceApi<DATA_TYPE>;
1450
+ columnApi: InfiniteTableColumnApi<DATA_TYPE>;
1451
+ renderBag: {
1452
+ all?: Renderable;
1453
+ header: string | number | Renderable;
1454
+ sortIcon?: Renderable;
1455
+ menuIcon?: Renderable;
1456
+ menuIconProps?: MenuIconProps;
1457
+ filterIcon?: Renderable;
1458
+ filterEditor?: Renderable;
1459
+ selectionCheckBox?: Renderable;
1460
+ };
1461
+ } & ({
1462
+ domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
1463
+ htmlElementRef: React$1.MutableRefObject<HTMLElement | null>;
1464
+ renderLocation: 'column-header';
1622
1465
  } | {
1623
- defaultSelection: false;
1624
- selectedRows: RowSelectionStateItem;
1625
- deselectedRows?: RowSelectionStateItem;
1626
- };
1627
- type RowSelectionStateConfig<T> = {
1628
- groupBy: DataSourceState<T>['groupBy'];
1629
- groupDeepMap: DataSourceState<T>['groupDeepMap'];
1630
- toPrimaryKey: DataSourceState<T>['toPrimaryKey'];
1631
- totalCount: number;
1632
- indexer: DataSourceState<T>['indexer'];
1633
- lazyLoad: boolean;
1634
- onlyUsePrimaryKeys: boolean;
1635
- };
1636
- type GetRowSelectionStateConfig<T> = () => RowSelectionStateConfig<T>;
1637
- type RowSelectionStateOverride = {
1638
- getGroupKeysForPrimaryKey: RowSelectionState<any>['getGroupKeysForPrimaryKey'];
1639
- getGroupByLength: RowSelectionState<any>['getGroupByLength'];
1640
- getGroupCount: RowSelectionState<any>['getGroupCount'];
1641
- getGroupKeysDirectlyInsideGroup: RowSelectionState<any>['getGroupKeysDirectlyInsideGroup'];
1642
- getAllPrimaryKeysInsideGroup: RowSelectionState<any>['getAllPrimaryKeysInsideGroup'];
1466
+ renderLocation: 'grouping-toolbar' | 'column-menu' | 'column-filter';
1467
+ });
1468
+ type InfiniteTableColumnRenderBag = {
1469
+ value: string | number | Renderable;
1470
+ groupIcon?: Renderable;
1471
+ treeIcon?: Renderable;
1472
+ rowDetailsIcon?: Renderable;
1473
+ all?: Renderable;
1474
+ selectionCheckBox?: Renderable;
1643
1475
  };
1644
- declare class RowSelectionState<T = any> {
1645
- selectedRows: RowSelectionStateItem | null;
1646
- deselectedRows: RowSelectionStateItem | null;
1647
- defaultSelection: boolean;
1648
- selectedMap: DeepMap<any, true>;
1649
- deselectedMap: DeepMap<any, true>;
1650
- onlyUsePrimaryKeys: boolean;
1651
- selectionCache: DeepMap<any, boolean | null>;
1652
- selectionCountCache: DeepMap<any, {
1653
- selectedCount: number;
1654
- deselectedCount: number;
1655
- }>;
1656
- getConfig: GetRowSelectionStateConfig<T>;
1657
- getGroupKeysForPrimaryKey(pk: any): any[];
1658
- getGroupDeepMap(): DeepMap<any, DeepMapGroupValueType<T, any>> | undefined;
1659
- getGroupCount(groupKeys: any[]): number;
1660
- getGroupKeysDirectlyInsideGroup(groupKeys: any[]): any[][];
1661
- getAllPrimaryKeysInsideGroup(groupKeys: any[]): any[];
1662
- getGroupByLength(): number;
1663
- static from<T>(rowSeleStateObject: RowSelectionStateObject, getConfig: GetRowSelectionStateConfig<T>, overrides?: RowSelectionStateOverride): RowSelectionState<T>;
1664
- constructor(state: RowSelectionStateObject | RowSelectionState, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverride);
1665
- mapSet: (name: "selected" | "deselected", key: any | any[]) => void;
1666
- _selectedMapSet: (key: any | any[]) => void;
1667
- _deselectedMapSet: (key: any | any[]) => void;
1668
- update(stateObject: RowSelectionStateObject): void;
1669
- private xcache;
1670
- getState(): RowSelectionStateObject;
1671
- deselectAll(): void;
1672
- selectAll(): void;
1673
- isRowDefaultSelected(): boolean;
1674
- isRowDefaultDeselected(): boolean;
1675
- /**
1676
- *
1677
- * @param key the id of the row - if a row in a grouped datasource, this is the final row id, without the group keys
1678
- * @param groupKeys the keys of row parents, in order
1679
- * @returns Whether the row is selected or not.
1680
- */
1681
- isRowSelected(key: any, groupKeys?: any[]): boolean;
1682
- isRowDeselected(key: any, groupKeys?: any[]): boolean;
1683
- setRowSelected(key: string | number, selected: boolean, groupKeys?: any[]): void;
1684
- /**
1685
- * Returns if the selection state ('full','partial','none') for the current group
1686
- *
1687
- * The selection state will be full (true) if either of those are true:
1688
- * * the group keys are specified as selected
1689
- * * all the children are specified as selected
1690
- *
1691
- * The selection state will be partial (null) if either of those are true:
1692
- * * the group keys are partially selected
1693
- * * some of the children are specified as selected
1694
- *
1695
- *
1696
- * @param groupKeys the keys of the group row
1697
- * @param children leaf children that belong to the group
1698
- * @returns boolean
1699
- */
1700
- getGroupRowSelectionState(initialGroupKeys: any[]): boolean | null;
1701
- private getGroupRowBooleanSelectionStateFromParent;
1702
- isGroupRowPartlySelected(groupKeys: any[]): boolean;
1703
- isGroupRowSelected(groupKeys: any[]): boolean;
1704
- isGroupRowDeselected(groupKeys: any[]): boolean;
1705
- selectGroupRow(groupKeys: any[]): void;
1706
- deselectGroupRow(groupKeys: any[]): void;
1707
- setRowAsSelected(key: string | number, groupKeys?: any[]): void;
1708
- setRowAsDeselected(key: string | number, groupKeys?: any[]): void;
1709
- deselectRow(key: any, groupKeys?: any[]): void;
1710
- selectRow(key: any, groupKeys?: any[]): void;
1711
- toggleGroupRowSelection(groupKeys: any[]): void;
1712
- toggleRowSelection(key: string | number, groupKeys?: any[] | undefined): void;
1713
- getSelectedCount(): number;
1714
- getDeselectedCount(): number;
1715
- getSelectionCountFor(groupKeys?: any[], parentSelected?: boolean): {
1716
- selectedCount: number;
1717
- deselectedCount: number;
1718
- };
1719
- }
1720
-
1721
- declare const DS_ERROR_CODES: Record<"DS001", DebugWarningPayload>;
1722
- declare const INFINITE_ERROR_CODES: Record<"CSS001_CSS", DebugWarningPayload>;
1723
- declare const ERROR_CODES: {
1724
- CSS001_CSS: DebugWarningPayload;
1725
- DS001: DebugWarningPayload;
1726
- };
1727
-
1728
- type DevToolsMessageAddress = 'infinite-table-devtools-contentscript' | 'infinite-table-devtools-contentscript-panel' | 'infinite-table-devtools-background' | 'infinite-table-page';
1729
- type DevToolsGenericMessage = {
1730
- source: DevToolsMessageAddress;
1731
- target: DevToolsMessageAddress;
1732
- payload: any;
1733
- type: string;
1734
- };
1735
- type ErrorCodeKey = keyof typeof ERROR_CODES;
1736
- type DataSourceDebugWarningKey = keyof typeof DS_ERROR_CODES;
1737
- type InfiniteTableDebugWarningKey = keyof typeof INFINITE_ERROR_CODES;
1738
- type DebugWarningPayload = {
1739
- message: string;
1740
- code: ErrorCodeKey;
1741
- type: 'error' | 'warning';
1742
- status?: 'new' | 'discarded';
1743
- debugId?: string;
1744
- };
1745
- type DevToolsHookFnOptions = {
1746
- getState: () => InfiniteTableState<any>;
1747
- getDataSourceState: () => DataSourceState<any>;
1748
- getComputed: () => InfiniteTableComputedValues<any>;
1749
- actions: InfiniteTableActions<any>;
1750
- dataSourceActions: DataSourceComponentActions<any>;
1751
- api: InfiniteTableApi<any>;
1752
- dataSourceApi: DataSourceApi<any>;
1753
- };
1754
- type DevToolsOverrides = Partial<DevToolsInfiniteOverrides & DevToolsDataSourceOverrides>;
1755
- type DevToolsInfiniteOverrides = Partial<{
1756
- groupRenderStrategy: InfiniteTableState<any>['groupRenderStrategy'];
1757
- columnVisibility: InfiniteTableState<any>['columnVisibility'];
1758
- }>;
1759
- type DevToolsDataSourceOverrides = Partial<{
1760
- groupBy: DataSourceState<any>['groupBy'];
1761
- sortInfo: DataSourceState<any>['sortInfo'];
1762
- multiSort: DataSourceState<any>['multiSort'];
1763
- }>;
1764
- type DevToolsHostPageMessagePayload = {
1765
- debugId: string;
1766
- columnOrder: string[];
1767
- visibleColumnIds: string[];
1768
- columnVisibility: InfiniteTableState<any>['columnVisibility'];
1769
- columns: Record<string, {
1770
- field: InfiniteTableComputedColumn<any>['field'];
1771
- dataType: InfiniteTableComputedColumn<any>['computedDataType'];
1772
- sortType: InfiniteTableComputedColumn<any>['computedSortType'];
1773
- filtered: InfiniteTableComputedColumn<any>['computedFiltered'];
1774
- sorted: InfiniteTableComputedColumn<any>['computedSorted'];
1775
- width: InfiniteTableComputedColumn<any>['computedWidth'];
1776
- }>;
1777
- groupRenderStrategy: InfiniteTableState<any>['groupRenderStrategy'];
1778
- groupBy: string[];
1779
- sortInfo: {
1780
- field: string;
1781
- dir: 1 | -1;
1782
- type?: string;
1783
- }[];
1784
- multiSort: DataSourceState<any>['multiSort'];
1785
- selectionMode: DataSourceState<any>['selectionMode'];
1786
- devToolsDetected: InfiniteTableState<any>['devToolsDetected'];
1787
- debugTimings: Record<DebugTimingKey, number>;
1788
- debugWarnings: Record<ErrorCodeKey, DebugWarningPayload>;
1789
- };
1790
- type DevToolsHostPageMessageType = 'update' | 'unmount' | 'log';
1791
- type DevToolsHostPageLogMessage = {
1792
- type: Extract<DevToolsHostPageMessageType, 'log'>;
1793
- payload: DevToolsHostPageLogMessagePayload;
1794
- };
1795
- type DevToolsHostPageLogMessagePayload = {
1796
- channel: string;
1797
- color: string;
1798
- args: any[];
1799
- timestamp: number;
1800
- debugId?: string;
1801
- };
1802
- type DevToolsHostPageMessage = {
1803
- source: Extract<DevToolsMessageAddress, 'infinite-table-page'>;
1804
- target: Extract<DevToolsMessageAddress, 'infinite-table-devtools-background'>;
1805
- url: string;
1806
- } & ({
1807
- type: Extract<DevToolsHostPageMessageType, 'update'>;
1808
- payload: DevToolsHostPageMessagePayload;
1809
- } | {
1810
- type: Extract<DevToolsHostPageMessageType, 'unmount'>;
1811
- payload: {
1812
- debugId: string;
1813
- };
1814
- } | DevToolsHostPageLogMessage);
1815
- type DevToolsHookFn = (debugId: string, options: null | DevToolsHookFnOptions) => void;
1816
-
1817
- interface DataSourceDataParams<T> {
1818
- originalDataArray: T[];
1819
- masterRowInfo?: InfiniteTableRowInfo<any>;
1820
- sortInfo?: DataSourceSortInfo<T>;
1821
- groupBy?: DataSourcePropGroupBy<T>;
1822
- pivotBy?: DataSourcePropPivotBy<T>;
1823
- filterValue?: DataSourcePropFilterValue<T>;
1824
- refetchKey?: DataSourceProps<T>['refetchKey'];
1825
- groupRowsState?: DataSourcePropGroupRowsStateObject<any>;
1826
- lazyLoadBatchSize?: number;
1827
- lazyLoadStartIndex?: number;
1828
- groupKeys?: any[];
1829
- append?: boolean;
1830
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
1831
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1832
- __cursorId?: DataSourceSetupState<T>['cursorId'];
1833
- changes?: DataSourceDataParamsChanges<T>;
1834
- }
1835
- type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
1836
- type DataSourceSingleSortInfo<T> = MultisortInfoAllowMultipleFields<T> & {
1837
- id?: string;
1838
- };
1839
- type DataSourceGroupBy<T> = GroupBy<T, any>;
1840
- type DataSourcePivotBy<T> = PivotBy<T, any>;
1841
- type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
1842
- type DataSourcePropSortInfo<T> = DataSourceSortInfo<T>;
1843
- type DataSourceRemoteData<T> = {
1844
- data: T[] | LazyGroupDataItem<T>[];
1845
- mappings?: DataSourceMappings;
1846
- cache?: boolean;
1847
- error?: string;
1848
- totalCount?: number;
1849
- totalCountUnfiltered?: number;
1850
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1851
- };
1852
- type DataSourceDataFn<T> = (dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>;
1853
- type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | DataSourceDataFn<T>;
1854
- type DataSourceGroupRowsList<KeyType = any> = true | KeyType[][];
1855
- type DataSourcePropGroupRowsStateObject<KeyType = any> = {
1856
- expandedRows: DataSourceGroupRowsList<KeyType>;
1857
- collapsedRows: DataSourceGroupRowsList<KeyType>;
1858
- };
1859
- type DataSourcePropGroupRowsState<KeyType = any> = GroupRowsState<KeyType> | DataSourcePropGroupRowsStateObject<KeyType>;
1860
- type RowDetailStateObject<KeyType = any> = {
1861
- expandedRows: true | KeyType[];
1862
- collapsedRows: true | KeyType[];
1863
- };
1864
- type RowDisabledStateObject<KeyType = any> = {
1865
- enabledRows: true;
1866
- disabledRows: KeyType[];
1867
- } | {
1868
- disabledRows: true;
1869
- enabledRows: KeyType[];
1870
- };
1871
- type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
1872
- type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
1873
- interface DataSourceMappedState<T> {
1874
- aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
1875
- livePagination: DataSourceProps<T>['livePagination'];
1876
- refetchKey: NonUndefined<DataSourceProps<T>['refetchKey']>;
1877
- isRowSelected: DataSourceProps<T>['isRowSelected'];
1878
- isNodeSelected: TreeDataSourceProps<T>['isNodeSelected'];
1879
- isNodeExpanded: TreeDataSourceProps<T>['isNodeExpanded'];
1880
- isNodeCollapsed: TreeDataSourceProps<T>['isNodeCollapsed'];
1881
- isNodeReadOnly: NonUndefined<TreeDataSourceProps<T>['isNodeReadOnly']>;
1882
- isNodeSelectable: NonUndefined<TreeDataSourceProps<T>['isNodeSelectable']>;
1883
- onNodeCollapse: TreeDataSourceProps<T>['onNodeCollapse'];
1884
- onNodeExpand: TreeDataSourceProps<T>['onNodeExpand'];
1885
- isRowDisabled: DataSourceProps<T>['isRowDisabled'];
1886
- nodesKey: NonUndefined<TreeDataSourceProps<T>['nodesKey']>;
1887
- treeSelection: TreeDataSourceProps<T>['treeSelection'];
1888
- batchOperationDelay: DataSourceProps<T>['batchOperationDelay'];
1889
- onDataArrayChange: DataSourceProps<T>['onDataArrayChange'];
1890
- onDataMutations: DataSourceProps<T>['onDataMutations'];
1891
- onTreeDataMutations: TreeDataSourceProps<T>['onTreeDataMutations'];
1892
- onReady: DataSourceProps<T>['onReady'];
1893
- rowInfoReducers: DataSourceProps<T>['rowInfoReducers'];
1894
- lazyLoad: DataSourceProps<T>['lazyLoad'];
1895
- useGroupKeysForMultiRowSelection: NonUndefined<DataSourceProps<T>['useGroupKeysForMultiRowSelection']>;
1896
- onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
1897
- data: DataSourceProps<T>['data'];
1898
- sortFunction: DataSourceProps<T>['sortFunction'];
1899
- filterFunction: DataSourceProps<T>['filterFunction'];
1900
- treeFilterFunction: DataSourceProps<T>['treeFilterFunction'];
1901
- filterValue: DataSourceProps<T>['filterValue'];
1902
- filterTypes: NonUndefined<DataSourceProps<T>['filterTypes']>;
1903
- primaryKey: DataSourceProps<T>['primaryKey'];
1904
- filterDelay: NonUndefined<DataSourceProps<T>['filterDelay']>;
1905
- groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
1906
- pivotBy: DataSourceProps<T>['pivotBy'];
1907
- loading: NonUndefined<DataSourceProps<T>['loading']>;
1908
- sortTypes: NonUndefined<DataSourceProps<T>['sortTypes']>;
1909
- collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
1910
- sortInfo: DataSourceSingleSortInfo<T>[] | null;
1911
- rowDisabledState: RowDisabledState<T> | null;
1912
- }
1913
- type DataSourceRawReducer<T, RESULT_TYPE> = {
1914
- initialValue?: RESULT_TYPE | (() => RESULT_TYPE);
1915
- reducer: (accumulator: any, value: T) => RESULT_TYPE;
1916
- done?: (accumulatedValue: RESULT_TYPE, array: T[]) => RESULT_TYPE;
1917
- };
1918
- type DataSourceAggregationReducer<T, AggregationResultType> = {
1919
- name?: string;
1920
- field?: keyof T;
1921
- initialValue?: AggregationResultType | (() => any);
1922
- getter?: (data: T) => any;
1923
- reducer: string | ((accumulator: any, value: any, data: T, index: number, groupKeys: any[] | undefined) => AggregationResultType | any);
1924
- done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
1925
- pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
1926
- column: InfiniteTablePivotFinalColumnVariant<T>;
1927
- }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
1928
- };
1929
- type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
1930
- inheritFromColumn?: string | boolean;
1931
- };
1932
- type DataSourceMappings = Record<'totals' | 'values', string>;
1933
- type LazyGroupDataItem<DataType> = {
1934
- data: Partial<DataType>;
1935
- keys: any[];
1936
- aggregations?: Record<string, any>;
1937
- dataset?: DataSourceRemoteData<DataType>;
1938
- totalChildrenCount?: number;
1939
- pivot?: {
1940
- values: Record<string, any>;
1941
- totals?: Record<string, any>;
1942
- };
1943
- };
1944
- type LazyRowInfoGroup<DataType> = {
1945
- /**
1946
- * Those are direct children of the current lazy group row
1947
- */
1948
- children: LazyGroupDataItem<DataType>[];
1949
- childrenLoading: boolean;
1950
- childrenAvailable: boolean;
1951
- cache: boolean;
1952
- totalCount: number;
1953
- totalCountUnfiltered: number;
1954
- error?: string;
1955
- };
1956
- type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
1957
- type DebugTimingKey = 'group-and-pivot' | 'filter' | 'sort' | 'pivot' | 'tree';
1958
- interface DataSourceSetupState<T> {
1959
- logger: DebugLogger;
1960
- forceRerenderTimestamp: number;
1961
- devToolsDetected: boolean;
1962
- debugTimings: Map<DebugTimingKey, number>;
1963
- debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
1964
- indexer: Indexer<T, any>;
1965
- getDataSourceMasterContextRef: React$1.MutableRefObject<() => DataSourceMasterDetailContextValue | undefined>;
1966
- __apiRef: React$1.MutableRefObject<DataSourceApi<T> | null>;
1967
- lastSelectionUpdatedNodePathRef: React$1.MutableRefObject<{
1968
- nodePath: NodePath$1;
1969
- selected: boolean;
1970
- } | null>;
1971
- lastExpandStateInfoRef: React$1.MutableRefObject<{
1972
- state: 'collapsed' | 'expanded';
1973
- nodePath: NodePath$1 | null;
1974
- }>;
1975
- waitForNodePathPromises: DeepMap<any, {
1976
- timestamp: number;
1977
- promise: Promise<boolean>;
1978
- resolve: (value: boolean) => void;
1979
- }>;
1980
- repeatWrappedGroupRows: InfiniteTablePropRepeatWrappedGroupRows<T>;
1981
- /**
1982
- * This is just used for horizontal layout and when repeatWrappedGroupRows is TRUE!!!
1983
- */
1984
- rowsPerPage: number | null;
1985
- totalLeafNodesCount: number;
1986
- destroyedRef: React$1.MutableRefObject<boolean>;
1987
- idToIndexMap: Map<any, number>;
1988
- idToPathMap: Map<any, NodePath$1>;
1989
- pathToIndexMap: DeepMap<any, number>;
1990
- detailDataSourcesStateToRestore: Map<any, Partial<DataSourceStateRestoreForDetail<any>>>;
1991
- treeSelectionState?: TreeSelectionState;
1992
- stateReadyAsDetails: boolean;
1993
- cache?: DataSourceCache<T>;
1994
- unfilteredCount: number;
1995
- filteredCount: number;
1996
- rowInfoReducerResults?: Record<string, any>;
1997
- originalDataArrayChanged: boolean;
1998
- originalDataArrayChangedInfo: {
1999
- timestamp: number;
2000
- mutations?: Map<string, DataSourceMutation<T>[]>;
2001
- treeMutations?: DeepMap<any, DataSourceMutation<T>[]>;
2002
- };
2003
- lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
2004
- pivotMappings?: DataSourceMappings;
2005
- propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
2006
- showSeparatePivotColumnForSingleAggregation: boolean;
2007
- dataParams?: DataSourceDataParams<T>;
2008
- originalLazyGroupData: LazyGroupDataDeepMap<T>;
2009
- originalLazyGroupDataChangeDetect: number | string;
2010
- scrollStopDelayUpdatedByTable: number;
2011
- onCleanup: SubscriptionCallback<DataSourceState<T>>;
2012
- notifyScrollbarsChange: SubscriptionCallback<Scrollbars>;
2013
- notifyScrollStop: SubscriptionCallback<ScrollStopInfo>;
2014
- notifyRenderRangeChange: SubscriptionCallback<RenderRange>;
2015
- originalDataArray: T[];
2016
- lastFilterDataArray?: T[];
2017
- lastSortDataArray?: T[];
2018
- lastGroupDataArray?: InfiniteTableRowInfo<T>[];
2019
- lastTreeDataArray?: InfiniteTableRowInfo<T>[];
2020
- dataArray: InfiniteTableRowInfo<T>[];
2021
- groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
2022
- treeDeepMap?: DeepMap<TreeKeyType, DeepMapTreeValueType<T, any>>;
2023
- treePaths?: DeepMap<TreeKeyType, true>;
2024
- unfilteredTreePaths?: DeepMap<TreeKeyType, true>;
2025
- groupRowsIndexesInDataArray?: number[];
2026
- reducerResults?: Record<string, AggregationReducerResult>;
2027
- allRowsSelected: boolean;
2028
- someRowsSelected: boolean;
2029
- pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
2030
- pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
2031
- cursorId: number | symbol | DataSourceLivePaginationCursorValue;
2032
- updatedAt: number;
2033
- reducedAt: number;
2034
- groupedAt: number;
2035
- treeAt: number;
2036
- sortedAt: number;
2037
- filteredAt: number;
2038
- generateGroupRows: boolean;
2039
- postFilterDataArray?: T[];
2040
- postSortDataArray?: T[];
2041
- postGroupDataArray?: InfiniteTableRowInfo<T>[];
2042
- pivotColumns?: Record<string, InfiniteTableColumn<T>>;
2043
- pivotColumnGroups?: Record<string, InfiniteTableColumnGroup>;
2044
- }
2045
- type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
2046
- type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
2047
- type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
2048
- type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
2049
- type TreeSelectionValue = TreeSelectionStateObject | TreeSelectionState;
2050
-
2051
- type DataSourcePropTreeSelection_MultiNode = TreeSelectionValue;
2052
- type DataSourcePropRowSelection_SingleRow = null | string | number;
2053
- type DataSourcePropTreeSelection_SingleNode = null | string | number;
2054
- type DataSourcePropTreeSelection = DataSourcePropTreeSelection_MultiNode | DataSourcePropTreeSelection_SingleNode;
2055
- type DataSourcePropCellSelection_MultiCell = CellSelectionStateObject | CellSelectionState;
2056
- type DataSourcePropCellSelection_SingleCell = null | CellSelectionPosition;
2057
- type DataSourcePropCellSelection = DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
2058
- type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
2059
- type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
2060
- type DataSourcePropOnTreeSelectionChange_MultiNode<T = any> = (treeSelectionStateObject: TreeSelectionStateObject, params: {
2061
- treeSelectionState: TreeSelectionState<T>;
2062
- prevTreeSelectionState: TreeSelectionState<T>;
2063
- unfilteredTreePaths: DeepMap<TreeKeyType, true>;
2064
- selectionMode: 'multi-row';
2065
- lastUpdatedNodeInfo: {
2066
- nodePath: NodePath$1;
2067
- selected: boolean;
2068
- } | null;
2069
- dataSourceApi: DataSourceApi<T>;
2070
- treeApi: TreeApi<T>;
2071
- }) => void;
2072
- type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
2073
- type DataSourcePropOnTreeSelectionChange_SingleNode = (treeSelection: DataSourcePropTreeSelection_SingleNode, params: {
2074
- selectionMode: 'single-row';
2075
- }) => void;
2076
- type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
2077
- type DataSourcePropOnTreeSelectionChange = DataSourcePropOnTreeSelectionChange_SingleNode | DataSourcePropOnTreeSelectionChange_MultiNode;
2078
- type DataSourcePropOnCellSelectionChange_MultiCell = (cellSelection: DataSourcePropCellSelection_MultiCell, selectionMode: 'multi-cell') => void;
2079
- type DataSourcePropOnCellSelectionChange_SingleCell = (cellSelection: DataSourcePropCellSelection_SingleCell, selectionMode: 'single-cell') => void;
2080
- type DataSourcePropOnCellSelectionChange = DataSourcePropOnCellSelectionChange_MultiCell | DataSourcePropOnCellSelectionChange_SingleCell;
2081
- type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelectionState: RowSelectionState, selectionMode: 'multi-row') => boolean | null;
2082
- type DataSourcePropIsNodeReadOnly<T> = (rowInfo: InfiniteTable_Tree_RowInfoParentNode<T>) => boolean;
2083
- type DataSourcePropIsNodeSelected<T> = (rowInfo: InfiniteTable_Tree_RowInfoNode<T>, treeSelectionState: TreeSelectionState, selectionMode: 'multi-row') => boolean | null;
2084
- type DataSourcePropIsNodeSelectable<T> = (rowInfo: InfiniteTable_Tree_RowInfoNode<T>) => boolean;
2085
- type DataSourcePropIsNodeExpanded<T> = (rowInfo: InfiniteTable_Tree_RowInfoParentNode<T>, treeExpandState: TreeExpandState) => boolean;
2086
- type DataSourcePropSortFn<T> = (sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], get?: (item: any) => T) => T[];
2087
- type DataSourceCRUDParam = {
2088
- flush?: boolean;
2089
- metadata?: any;
1476
+ type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1477
+ domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
1478
+ htmlElementRef: React$1.MutableRefObject<HTMLElement | null>;
1479
+ rowIndexInHorizontalLayoutPage: null | number;
1480
+ horizontalLayoutPageIndex: null | number;
1481
+ value: string | number | Renderable;
1482
+ align: InfiniteTableColumnAlignValues;
1483
+ verticalAlign: InfiniteTableColumnVerticalAlignValues;
1484
+ renderBag: InfiniteTableColumnRenderBag;
1485
+ rowIndex: number;
1486
+ rowActive: boolean;
1487
+ api: InfiniteTableApi<DATA_TYPE>;
1488
+ dataSourceApi: DataSourceApi<DATA_TYPE>;
1489
+ editError?: Error;
1490
+ column: COL_TYPE;
1491
+ columnsMap: Map<string, COL_TYPE>;
1492
+ fieldsToColumn: Map<keyof DATA_TYPE, COL_TYPE>;
1493
+ groupByColumn?: InfiniteTableComputedColumn<DATA_TYPE>;
1494
+ toggleCurrentGroupRow: () => void;
1495
+ toggleCurrentTreeNode: () => void;
1496
+ expandTreeNode: InfiniteTableToggleTreeNodeFn;
1497
+ collapseTreeNode: InfiniteTableToggleTreeNodeFn;
1498
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
1499
+ toggleTreeNode: InfiniteTableToggleTreeNodeFn;
1500
+ toggleCurrentTreeNodeSelection: () => void;
1501
+ toggleCurrentGroupRowSelection: () => void;
1502
+ toggleCurrentRowSelection: () => void;
1503
+ toggleCurrentRowDetails: () => void;
1504
+ toggleRowDetails: InfiniteTableToggleRowDetailsFn;
1505
+ expandRowDetails: InfiniteTableToggleRowDetailsFn;
1506
+ collapseRowDetails: InfiniteTableToggleRowDetailsFn;
1507
+ rowHasSelectedCells: boolean;
1508
+ cellSelected: boolean;
1509
+ selectCurrentRow: () => void;
1510
+ selectRow: InfiniteTableSelectRowFn;
1511
+ deselectRow: InfiniteTableSelectRowFn;
1512
+ deselectCurrentRow: () => void;
1513
+ selectCell: () => void;
1514
+ deselectCell: () => void;
1515
+ toggleRowSelection: InfiniteTableSelectRowFn;
1516
+ toggleGroupRowSelection: InfiniteTableToggleGroupRowFn;
1517
+ toggleTreeNodeSelection: InfiniteTableToggleTreeNodeFn;
1518
+ selectTreeNode: InfiniteTableToggleTreeNodeFn;
1519
+ deselectTreeNode: InfiniteTableToggleTreeNodeFn;
1520
+ selectionMode: DataSourcePropSelectionMode | undefined;
1521
+ rootGroupBy: DataSourceState<DATA_TYPE>['groupBy'];
1522
+ pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
2090
1523
  };
2091
- type WaitForNodeOptions = {
2092
- waitForNode?: boolean | number;
1524
+ type InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
1525
+ type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE>;
1526
+ type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
1527
+ rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
1528
+ data: DATA_TYPE | Partial<DATA_TYPE> | null;
1529
+ dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
1530
+ rowIndex: number;
1531
+ column: COL_TYPE;
2093
1532
  };
2094
- type DataSourceUpdateParam = DataSourceCRUDParam & WaitForNodeOptions;
2095
- type DataSourceInsertParam = DataSourceCRUDParam & WaitForNodeOptions & ({
2096
- position: 'before' | 'after';
2097
- primaryKey: any;
2098
- nodePath?: never;
2099
- } | {
2100
- position: 'before' | 'after';
2101
- primaryKey?: never;
2102
- nodePath: NodePath$1;
2103
- } | {
2104
- position: 'start' | 'end';
2105
- nodePath?: never;
2106
- } | {
2107
- position: 'start' | 'end';
2108
- nodePath: NodePath$1;
2109
- });
2110
- type UpdateChildrenFn<T> = (dataChildren: T[] | undefined | null, data: T) => T[] | undefined | null;
2111
- interface DataSourceApi<T> {
2112
- getPendingOperationPromise(): Promise<boolean> | null;
2113
- getOriginalDataArray: () => T[];
2114
- getRowInfoArray: () => InfiniteTableRowInfo<T>[];
2115
- getDataByPrimaryKey(id: any): T | null;
2116
- getDataByNodePath(nodePath: NodePath$1): T | null;
2117
- getDataByIndex(index: number): T | null;
2118
- getRowInfoByIndex(index: number): InfiniteTableRowInfo<T> | null;
2119
- getRowInfoByPrimaryKey(id: any): InfiniteTableRowInfo<T> | null;
2120
- getRowInfoByNodePath(nodePath: NodePath$1): InfiniteTableRowInfo<T> | null;
2121
- getIndexByPrimaryKey(id: any): number;
2122
- getIndexByNodePath(nodePath: NodePath$1): number;
2123
- getPrimaryKeyByIndex(id: any): any;
2124
- getNodePathById(id: any): NodePath$1 | null;
2125
- getNodePathByIndex(index: number): NodePath$1 | null;
2126
- get treeApi(): TreeApi<T>;
2127
- /**
2128
- * @param nodePath The node path to wait for
2129
- * @param options
2130
- * @param options.timeout The timeout to wait for the node path to be available. Defaults to 1000ms.
2131
- *
2132
- * @returns true if the path is already in the DataSource, otherwise a promise resolving to a boolean value.
2133
- * If the timeout is reached and the path is not available, the promise is resolved to false. Otherwise, the promise is resolved to true.
2134
- */
2135
- waitForNodePath(nodePath: NodePath$1, options?: {
2136
- timeout?: number;
2137
- }): Promise<boolean>;
2138
- isNodePathAvailable(nodePath: NodePath$1): boolean;
2139
- updateData(data: Partial<T>, options?: DataSourceCRUDParam): Promise<any>;
2140
- updateDataByNodePath(data: Partial<T>, nodePath: NodePath$1, options?: DataSourceUpdateParam): Promise<any>;
2141
- updateChildrenByNodePath(childrenOrFn: T[] | undefined | null | UpdateChildrenFn<T>, nodePath: NodePath$1, options?: DataSourceUpdateParam): Promise<any>;
2142
- updateDataArray(data: Partial<T>[], options?: DataSourceCRUDParam): Promise<any>;
2143
- updateDataArrayByNodePath(updateInfo: {
2144
- data: Partial<T>;
2145
- nodePath: NodePath$1;
2146
- }[], options?: DataSourceUpdateParam): Promise<any>;
2147
- flush(): Promise<any>;
2148
- removeDataByPrimaryKey(id: any, options?: DataSourceCRUDParam): Promise<any>;
2149
- removeDataByNodePath(nodePath: NodePath$1, options?: DataSourceCRUDParam): Promise<any>;
2150
- removeDataArrayByPrimaryKeys(id: any[], options?: DataSourceCRUDParam): Promise<any>;
2151
- removeData(data: Partial<T>, options?: DataSourceCRUDParam): Promise<any>;
2152
- removeDataArray(data: Partial<T>[], options?: DataSourceCRUDParam): Promise<any>;
2153
- clearAllData(options?: DataSourceCRUDParam): Promise<any>;
2154
- replaceAllData(data: T[], options?: DataSourceCRUDParam): Promise<any>;
2155
- addData(data: T, options?: DataSourceCRUDParam): Promise<any>;
2156
- addDataArray(data: T[], options?: DataSourceCRUDParam): Promise<any>;
2157
- insertData(data: T, options: DataSourceInsertParam): Promise<any>;
2158
- insertDataArray(data: T[], options: DataSourceInsertParam): Promise<any>;
2159
- setSortInfo(sortInfo: null | DataSourceSingleSortInfo<T>[]): void;
2160
- isRowDisabledAt: (rowIndex: number) => boolean;
2161
- isRowDisabled: (primaryKey: any) => boolean;
2162
- setRowEnabledAt: (rowIndex: number, enabled: boolean) => void;
2163
- setRowEnabled: (primaryKey: any, enabled: boolean) => void;
2164
- enableAllRows: () => void;
2165
- disableAllRows: () => void;
2166
- areAllRowsEnabled: () => boolean;
2167
- areAllRowsDisabled: () => boolean;
2168
- setGroupBy: (groupBy: DataSourceState<T>['groupBy']) => void;
2169
- toggleGroupByField: (field: keyof T) => void;
2170
- }
2171
- type DataSourcePropRowInfoReducers<T> = Record<string, DataSourceRowInfoReducer<T>>;
2172
- type DataSourceRowInfoReducer<T> = DataSourceRawReducer<InfiniteTableRowInfo<T>, any>;
2173
- type DataSourcePropShouldReloadDataObject<T> = {
2174
- [key in keyof Pick<DataSourceDataParams<T>, 'sortInfo' | 'pivotBy' | 'groupBy' | 'filterValue'>]: boolean;
1533
+ type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1534
+ isGroupRow: true;
1535
+ }) => Renderable | null;
1536
+ type InfiniteTableColumnRenderFunctionForParentNode<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1537
+ isTreeNode: true;
1538
+ isParentNode: true;
1539
+ }) => Renderable | null;
1540
+ type InfiniteTableColumnRenderFunctionForLeafNode<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1541
+ isTreeNode: true;
1542
+ isParentNode: false;
1543
+ }) => Renderable | null;
1544
+ type InfiniteTableColumnRenderFunctionForNode<DATA_TYPE, EXTRA_NODE_PARAMS = Partial<InfiniteTableRowInfoDataDiscriminator_ParentNode<DATA_TYPE> | InfiniteTableRowInfoDataDiscriminator_LeafNode<DATA_TYPE>>, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & EXTRA_NODE_PARAMS) => Renderable | null;
1545
+ type InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE> & {
1546
+ isGroupRow: false;
1547
+ }) => Renderable | null;
1548
+ type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnCellContextType<DATA_TYPE, COL_TYPE>) => Renderable | null;
1549
+ type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParam<T>) => Renderable;
1550
+ type InfiniteTableColumnOrHeaderRenderFunction<T> = (params: (InfiniteTableColumnCellContextType<T> & {
1551
+ rowInfo: InfiniteTableRowInfo<T>;
1552
+ }) | (InfiniteTableColumnHeaderParam<T> & {
1553
+ rowInfo: null;
1554
+ })) => ReturnType<InfiniteTableColumnRenderFunction<T>>;
1555
+ type InfiniteTableColumnContentFocusable<T> = boolean | InfiniteTableColumnContentFocusableFn<T>;
1556
+ type InfiniteTableColumnEditable<T> = boolean | InfiniteTableColumnEditableFn<T>;
1557
+ type InfiniteTableColumnContentFocusableFn<T> = (params: InfiniteTableColumnContentFocusableParams<T>) => boolean;
1558
+ type InfiniteTableColumnEditableFn<T> = (params: InfiniteTableColumnEditableParams<T>) => boolean | Promise<boolean>;
1559
+ type InfiniteTableColumnContentFocusableParams<T> = InfiniteTableRowInfoDataDiscriminatorWithColumnAndApis<T>;
1560
+ type InfiniteTableColumnEditableParams<T> = InfiniteTableColumnContentFocusableParams<T>;
1561
+ type InfiniteTableColumnGetValueToPersistParams<T> = InfiniteTableColumnEditableParams<T> & {
1562
+ initialValue: any;
2175
1563
  };
2176
- type DataSourcePropShouldReloadData<T> = DataSourcePropShouldReloadDataObject<T> | boolean;
2177
- type TreeExpandStateValue = TreeExpandState | TreeExpandStateObject<any>;
2178
- type DataSourceProps<T> = {
2179
- nodesKey?: never;
2180
- debugId?: string;
2181
- children?: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
2182
- primaryKey: keyof T | ((data: T) => string);
2183
- /**
2184
- * @deprecated for now
2185
- */
2186
- fields?: (keyof T)[];
2187
- refetchKey?: number | string | object;
2188
- batchOperationDelay?: number;
2189
- rowInfoReducers?: DataSourcePropRowInfoReducers<T>;
2190
- data: DataSourceData<T>;
2191
- selectionMode?: DataSourcePropSelectionMode;
2192
- useGroupKeysForMultiRowSelection?: boolean;
2193
- rowSelection?: DataSourcePropRowSelection;
2194
- defaultRowSelection?: DataSourcePropRowSelection;
2195
- cellSelection?: DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
2196
- defaultCellSelection?: DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
2197
- onCellSelectionChange?: DataSourcePropOnCellSelectionChange;
2198
- rowDisabledState?: RowDisabledState | RowDisabledStateObject<any>;
2199
- defaultRowDisabledState?: RowDisabledState | RowDisabledStateObject<any>;
2200
- onRowDisabledStateChange?: (rowDisabledState: RowDisabledState) => void;
2201
- isRowDisabled?: (rowInfo: InfiniteTableRowInfo<T>) => boolean;
2202
- isRowSelected?: DataSourcePropIsRowSelected<T>;
2203
- lazyLoad?: boolean | {
2204
- batchSize?: number;
2205
- };
2206
- loading?: boolean;
2207
- defaultLoading?: boolean;
2208
- onLoadingChange?: (loading: boolean) => void;
2209
- onReady?: (api: DataSourceApi<T>) => void;
2210
- pivotBy?: DataSourcePropPivotBy<T>;
2211
- defaultPivotBy?: DataSourcePropPivotBy<T>;
2212
- onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
2213
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
2214
- defaultAggregationReducers?: DataSourcePropAggregationReducers<T>;
2215
- groupBy?: DataSourcePropGroupBy<T>;
2216
- defaultGroupBy?: DataSourcePropGroupBy<T>;
2217
- onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
2218
- groupRowsState?: DataSourcePropGroupRowsState<any>;
2219
- defaultGroupRowsState?: DataSourcePropGroupRowsState<any>;
2220
- onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
2221
- collapseGroupRowsOnDataFunctionChange?: boolean;
2222
- sortFunction?: DataSourcePropSortFn<T>;
2223
- sortInfo?: DataSourceSortInfo<T>;
2224
- defaultSortInfo?: DataSourceSortInfo<T>;
2225
- onSortInfoChange?: ((sortInfo: DataSourceSingleSortInfo<T> | null) => void) | ((sortInfo: DataSourceSingleSortInfo<T>[]) => void);
2226
- onDataParamsChange?: (dataParamsChange: DataSourceDataParams<T>) => void;
2227
- onDataArrayChange?: (dataArray: DataSourceState<T>['originalDataArray'], info: DataSourceState<T>['originalDataArrayChangedInfo']) => void;
2228
- onDataMutations?: ({ dataArray, timestamp, mutations, primaryKeyField, }: {
2229
- primaryKeyField: undefined | keyof T;
2230
- dataArray: DataSourceState<T>['originalDataArray'];
2231
- timestamp: number;
2232
- mutations: NonUndefined<DataSourceState<T>['originalDataArrayChangedInfo']['mutations']>;
2233
- }) => void;
2234
- livePagination?: boolean;
2235
- livePaginationCursor?: DataSourcePropLivePaginationCursor<T>;
2236
- onLivePaginationCursorChange?: (livePaginationCursor: DataSourceLivePaginationCursorValue) => void;
2237
- filterFunction?: DataSourcePropFilterFunction<T>;
2238
- treeFilterFunction?: DataSourcePropTreeFilterFunction<T>;
2239
- /**
2240
- * @deprecated Use shouldReloadData.sortInfo instead
2241
- */
2242
- sortMode?: 'local' | 'remote';
2243
- /**
2244
- * @deprecated Use shouldReloadData.filterValue instead
2245
- */
2246
- filterMode?: 'local' | 'remote';
2247
- /**
2248
- * @deprecated Use shouldReloadData.groupBy instead
2249
- */
2250
- groupMode?: 'local' | 'remote';
2251
- shouldReloadData?: DataSourcePropShouldReloadData<T>;
2252
- filterValue?: DataSourcePropFilterValue<T>;
2253
- defaultFilterValue?: DataSourcePropFilterValue<T>;
2254
- onFilterValueChange?: (filterValue: DataSourcePropFilterValue<T>) => void;
2255
- filterDelay?: number;
2256
- filterTypes?: DataSourcePropFilterTypes<T>;
2257
- sortTypes?: DataSourcePropSortTypes;
2258
- } & ({
2259
- selectionMode?: 'multi-row';
2260
- rowSelection?: DataSourcePropRowSelection_MultiRow;
2261
- defaultRowSelection?: DataSourcePropRowSelection_MultiRow;
2262
- onRowSelectionChange?: DataSourcePropOnRowSelectionChange_MultiRow;
2263
- } | {
2264
- selectionMode?: 'single-row';
2265
- rowSelection?: DataSourcePropRowSelection_SingleRow;
2266
- defaultRowSelection?: DataSourcePropRowSelection_SingleRow;
2267
- onRowSelectionChange?: DataSourcePropOnRowSelectionChange_SingleRow;
2268
- } | {
2269
- selectionMode?: 'single-cell';
2270
- cellSelection?: DataSourcePropCellSelection_SingleCell;
2271
- defaultCellSelection?: DataSourcePropCellSelection_SingleCell;
2272
- onCellSelectionChange?: DataSourcePropOnCellSelectionChange_SingleCell;
2273
- } | {
2274
- selectionMode?: 'multi-cell';
2275
- cellSelection?: DataSourcePropCellSelection_MultiCell;
2276
- defaultCellSelection?: DataSourcePropCellSelection_MultiCell;
2277
- onCellSelectionChange?: DataSourcePropOnCellSelectionChange_MultiCell;
2278
- } | {
2279
- selectionMode?: false;
2280
- });
1564
+ type InfiniteTableColumnAlignValues = 'start' | 'center' | 'end';
1565
+ type InfiniteTableColumnVerticalAlignValues = 'start' | 'center' | 'end';
1566
+ type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
1567
+ type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
1568
+ type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
1569
+ type InfiniteTableColumnStylingFnParams<T> = {
1570
+ value: Renderable;
1571
+ column: InfiniteTableComputedColumn<T>;
1572
+ rowIndexInHorizontalLayoutPage: null | number;
1573
+ horizontalLayoutPageIndex: null | number;
1574
+ inEdit: boolean;
1575
+ rowHasSelectedCells: boolean;
1576
+ editError: InfiniteTableColumnRenderParamBase<T>['editError'];
1577
+ } & InfiniteTableRowInfoDataDiscriminator<T>;
1578
+ type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStylingFnParams<T>) => undefined | React$1.CSSProperties;
1579
+ type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
1580
+ type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React$1.CSSProperties;
1581
+ type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStylingFnParams<T>) => undefined | string;
1582
+ type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
1583
+ type InfiniteTableColumnAlign<T> = InfiniteTableColumnAlignValues | InfiniteTableColumnAlignFn<T>;
1584
+ type InfiniteTableColumnVerticalAlign<T> = InfiniteTableColumnVerticalAlignValues | InfiniteTableColumnVerticalAlignFn<T>;
1585
+ type InfiniteTableColumnAlignFn<T> = (params: InfiniteTableColumnAlignFnParams<T>) => InfiniteTableColumnAlignValues;
1586
+ type InfiniteTableColumnAlignFnParams<T> = XOR<{
1587
+ isHeader: true;
1588
+ column: InfiniteTableComputedColumn<T>;
1589
+ }, InfiniteTableColumnStylingFnParams<T> & {
1590
+ isHeader: false;
1591
+ }>;
1592
+ type InfiniteTableColumnVerticalAlignFn<T> = (params: InfiniteTableColumnAlignFnParams<T>) => InfiniteTableColumnVerticalAlignValues;
1593
+ type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
1594
+ type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
1595
+ type InfiniteTableColumnHeaderClassName<T> = string | InfiniteTableColumnHeaderClassNameFn<T>;
1596
+ type InfiniteTableColumnValueGetterParams<T> = ValueGetterParams<T>;
1597
+ type InfiniteTableColumnValueFormatterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
1598
+ type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
1599
+ type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
1600
+ type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
1601
+ type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
1602
+ type InfiniteTableColumnSortableFn<T> = (context: {
1603
+ api: InfiniteTableApi<T>;
1604
+ columnApi: InfiniteTableColumnApi<T>;
1605
+ column: InfiniteTableComputedColumn<T>;
1606
+ columns: Map<string, InfiniteTableComputedColumn<T>>;
1607
+ }) => boolean;
1608
+ type InfiniteTableColumnSortable<T> = boolean | InfiniteTableColumnSortableFn<T>;
2281
1609
  /**
2282
- * @deprecated Use DataSourceProps<T> instead
1610
+ * Defines a column in the table.
1611
+ *
1612
+ * @typeParam DATA_TYPE The type of the data in the table.
1613
+ *
1614
+ * Can be bound to a field which is a `keyof DATA_TYPE`.
2283
1615
  */
2284
- type DataSourcePropsWithChildren<T> = DataSourceProps<T> & {};
2285
- type DataSourcePropSortTypes = Record<string, (first: any, second: any) => number>;
2286
- type DataSourcePropFilterTypes<T> = Record<string, DataSourceFilterType<T>>;
2287
- type DataSourceFilterFunctionParam<T> = {
2288
- data: T;
2289
- index: number;
2290
- dataArray: T[];
2291
- primaryKey: any;
2292
- };
2293
- type DataSourcePropFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T>) => boolean;
2294
- type DataSourcePropTreeFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T> & {
2295
- filterTreeNode: (data: T) => T | boolean;
2296
- }) => T | boolean;
2297
- type DataSourcePropFilterValue<T> = DataSourceFilterValueItem<T>[];
2298
- type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
2299
- field: keyof T;
2300
- }, {
2301
- id: string;
2302
- }> & {
2303
- valueGetter?: DataSourceFilterValueItemValueGetter<T>;
2304
- filter: {
2305
- type: string;
2306
- operator: string;
2307
- value: any;
2308
- };
2309
- disabled?: boolean;
2310
- };
2311
- type DataSourceFilterValueItemValueGetter<T> = (param: DataSourceFilterFunctionParam<T> & {
2312
- field?: keyof T;
2313
- }) => any;
2314
- type DataSourceFilterType<T> = {
2315
- emptyValues: any[];
2316
- label?: string;
2317
- defaultOperator: string;
2318
- valueGetter?: DataSourceFilterValueItemValueGetter<T>;
2319
- components?: {
2320
- FilterEditor?: () => React$1.JSX.Element | null;
2321
- FilterOperatorSwitch?: () => React$1.JSX.Element | null;
1616
+ type InfiniteTableColumn<DATA_TYPE> = {
1617
+ field?: KeyOfNoSymbol<DATA_TYPE>;
1618
+ valueGetter?: InfiniteTableColumnValueGetter<DATA_TYPE>;
1619
+ defaultSortable?: InfiniteTableColumnSortable<DATA_TYPE>;
1620
+ /**
1621
+ * Whether the column is draggable by default.
1622
+ *
1623
+ * This prop overrides the top-level columnDefaultDraggable prop, but is
1624
+ * overridden by the top-level draggableColumns prop.
1625
+ */
1626
+ defaultDraggable?: boolean;
1627
+ resizable?: boolean;
1628
+ shouldAcceptEdit?: (params: InfiniteTablePropOnEditAcceptedParams<DATA_TYPE>) => boolean | Error | Promise<boolean | Error>;
1629
+ contentFocusable?: InfiniteTableColumnContentFocusable<DATA_TYPE>;
1630
+ defaultEditable?: InfiniteTableColumnEditable<DATA_TYPE>;
1631
+ getValueToEdit?: (params: InfiniteTableColumnEditableParams<DATA_TYPE>) => any | Promise<any>;
1632
+ getValueToPersist?: (params: InfiniteTableColumnGetValueToPersistParams<DATA_TYPE>) => any | Promise<any>;
1633
+ comparer?: InfiniteTableColumnComparer<DATA_TYPE>;
1634
+ defaultHiddenWhenGroupedBy?: '*' | true | keyof DATA_TYPE | {
1635
+ [k in keyof Partial<DATA_TYPE>]: true;
2322
1636
  };
2323
- operators: DataSourceFilterOperator<T>[];
2324
- };
2325
- type DataSourceFilterOperator<T> = {
2326
- name: string;
2327
- label?: string;
1637
+ align?: InfiniteTableColumnAlign<DATA_TYPE>;
1638
+ headerAlign?: InfiniteTableColumnAlign<DATA_TYPE>;
1639
+ verticalAlign?: InfiniteTableColumnVerticalAlign<DATA_TYPE>;
1640
+ columnGroup?: string;
1641
+ header?: InfiniteTableColumnHeader<DATA_TYPE>;
1642
+ renderHeader?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1643
+ name?: Renderable;
1644
+ cssEllipsis?: boolean;
1645
+ headerCssEllipsis?: boolean;
1646
+ type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
1647
+ dataType?: InfiniteTableDataTypeNames;
1648
+ sortType?: string | string[];
1649
+ filterType?: string;
1650
+ style?: InfiniteTableColumnStyle<DATA_TYPE>;
1651
+ headerStyle?: InfiniteTableColumnHeaderStyle<DATA_TYPE>;
1652
+ headerClassName?: InfiniteTableColumnHeaderClassName<DATA_TYPE>;
1653
+ className?: InfiniteTableColumnClassName<DATA_TYPE>;
1654
+ rowspan?: InfiniteTableColumnRowspanFn<DATA_TYPE>;
1655
+ render?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
1656
+ renderValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
1657
+ renderGroupValue?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
1658
+ renderLeafValue?: InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE>;
1659
+ valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE, Renderable>;
1660
+ defaultWidth?: number;
1661
+ defaultFlex?: number;
1662
+ defaultFilterable?: boolean;
1663
+ defaultGroupable?: boolean;
1664
+ minWidth?: number;
1665
+ maxWidth?: number;
1666
+ renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
1667
+ renderRowDetailIcon?: boolean | InfiniteTableColumnRenderFunction<DATA_TYPE>;
1668
+ renderTreeIcon?: boolean | InfiniteTableColumnRenderFunctionForNode<DATA_TYPE, {
1669
+ isTreeNode: true;
1670
+ isParentNode: boolean;
1671
+ isGroupRow: false;
1672
+ nodeExpanded: boolean;
1673
+ }>;
1674
+ renderTreeIconForParentNode?: InfiniteTableColumnRenderFunctionForParentNode<DATA_TYPE, {
1675
+ isTreeNode: true;
1676
+ isGroupRow: true;
1677
+ isParentNode: true;
1678
+ }>;
1679
+ renderTreeIconForLeafNode?: InfiniteTableColumnRenderFunctionForLeafNode<DATA_TYPE, {
1680
+ isTreeNode: true;
1681
+ isGroupRow: false;
1682
+ isLeafNode: true;
1683
+ }>;
1684
+ renderSortIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1685
+ renderFilterIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1686
+ renderSelectionCheckBox?: boolean | InfiniteTableColumnOrHeaderRenderFunction<DATA_TYPE>;
1687
+ renderMenuIcon?: boolean | InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
1688
+ renderHeaderSelectionCheckBox?: boolean | InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
2328
1689
  components?: {
2329
- FilterEditor?: () => React$1.JSX.Element | null;
2330
- Icon?: (props: any) => React$1.JSX.Element | null;
1690
+ ColumnCell?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1691
+ HeaderCell?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1692
+ Editor?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1693
+ FilterEditor?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1694
+ FilterOperatorSwitch?: React$1.ComponentType<HTMLProps<HTMLDivElement>>;
1695
+ MenuIcon?: React$1.ComponentType<MenuIconProps>;
2331
1696
  };
2332
- fn: DataSourceFilterOperatorFunction<T>;
2333
- defaultFilterValue?: any;
2334
- };
2335
- type DataSourceFilterOperatorFunction<T> = (filterOperatorFunctionParam: DataSourceFilterOperatorFunctionParam<T>) => boolean;
2336
- type DataSourceFilterOperatorFunctionParam<T> = {
2337
- currentValue: any;
2338
- filterValue: any;
2339
- emptyValues: any[];
2340
- field?: keyof T;
2341
- } & DataSourceFilterFunctionParam<T>;
2342
- type DataSourcePropLivePaginationCursor<T> = DataSourceLivePaginationCursorValue | DataSourceLivePaginationCursorFn<T>;
2343
- type DataSourceLivePaginationCursorFn<T> = (params: DataSourceLivePaginationCursorParams<T>) => DataSourceLivePaginationCursorValue;
2344
- type DataSourceLivePaginationCursorParams<T> = {
2345
- array: T[];
2346
- lastItem: T | Partial<T> | null;
2347
- length: number;
2348
- };
2349
- type DataSourceLivePaginationCursorValue = string | number | null;
2350
- interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedState<T>, DataSourceMappedState<T> {
2351
- }
2352
- type DataSourceCallback_BaseParam<T> = {
2353
- dataSourceApi: DataSourceApi<T>;
2354
- };
2355
- type DataSourceDerivedState<T> = {
2356
- debugId: DataSourceProps<T>['debugId'];
2357
- isTree: boolean;
2358
- toPrimaryKey: (data: T) => any;
2359
- operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
2360
- sortMode: 'local' | 'remote';
2361
- filterMode: 'local' | 'remote';
2362
- groupMode: 'local' | 'remote';
2363
- pivotMode: 'local' | 'remote';
2364
- shouldReloadData: NonUndefined<Required<DataSourcePropShouldReloadDataObject<T>>>;
2365
- groupRowsState: GroupRowsState<T>;
2366
- treeExpandState: TreeExpandState<any>;
2367
- treeExpandMode: TreeExpandStateMode;
2368
- multiSort: boolean;
2369
- controlledSort: boolean;
2370
- controlledFilter: boolean;
2371
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
2372
- lazyLoadBatchSize?: number;
2373
- rowSelection: RowSelectionState | null | number | string;
2374
- isRowDisabled: DataSourceProps<T>['isRowDisabled'];
2375
- cellSelection: CellSelectionState | null;
2376
- selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
2377
- };
2378
- type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
2379
- interface DataSourceContextValue<T> {
2380
- api: DataSourceApi<T>;
2381
- getState: () => DataSourceState<T>;
2382
- assignState: (state: Partial<DataSourceState<T>>) => void;
2383
- getDataSourceMasterContext: () => DataSourceMasterDetailContextValue<any> | undefined;
2384
- componentState: DataSourceState<T>;
2385
- componentActions: DataSourceComponentActions<T>;
2386
- }
2387
- interface DataSourceMasterDetailContextValue<MASTER_TYPE = any> {
2388
- registerDetail: (detail: DataSourceContextValue<any>) => void;
2389
- getMasterState: () => InfiniteTableState<MASTER_TYPE>;
2390
- getMasterDataSourceState: () => DataSourceState<MASTER_TYPE>;
2391
- shouldRestoreState: boolean;
2392
- masterRowInfo: InfiniteTableRowInfo<MASTER_TYPE>;
2393
- }
2394
- declare enum DataSourceActionType {
2395
- INIT = "INIT"
2396
- }
2397
- interface DataSourceAction<T> {
2398
- type: DataSourceActionType;
2399
- payload: T;
2400
- }
2401
-
2402
- declare class RowDetailState<KeyType = any> extends BooleanCollectionState<RowDetailStateObject<KeyType>, KeyType> {
2403
- constructor(state: RowDetailStateObject<KeyType> | RowDetailState<KeyType>);
2404
- getState(): RowDetailStateObject<KeyType>;
2405
- getPositiveFromState(state: RowDetailStateObject<KeyType>): true | KeyType[];
2406
- getNegativeFromState(state: RowDetailStateObject<KeyType>): true | KeyType[];
2407
- areAllCollapsed(): boolean;
2408
- areAllExpanded(): boolean;
2409
- collapseAll(): void;
2410
- expandAll(): void;
2411
- isRowDetailsExpanded: (key: KeyType) => boolean;
2412
- isRowDetailsCollapsed(key: KeyType): boolean;
2413
- setRowDetailsExpanded(key: KeyType, shouldExpand: boolean): void;
2414
- collapseRowDetails(key: KeyType): void;
2415
- expandRowDetails(key: KeyType): void;
2416
- toggleRowDetails(key: KeyType): void;
2417
- }
2418
-
2419
- type TableRenderCellFnParam = {
2420
- domRef: RefCallback<HTMLElement>;
2421
- rowIndex: number;
2422
- colIndex: number;
2423
- rowspan: number;
2424
- colspan: number;
2425
- hidden: boolean;
2426
- width: number;
2427
- height: number;
2428
- widthWithColspan: number;
2429
- heightWithRowspan: number;
2430
- rowFixed: FixedPosition;
2431
- colFixed: FixedPosition;
2432
- onMouseEnter: VoidFunction;
2433
- onMouseLeave: VoidFunction;
2434
1697
  };
2435
- type TableRenderDetailRowFnParam = {
2436
- domRef: RefCallback<HTMLElement>;
2437
- rowIndex: number;
2438
- hidden: boolean;
2439
- height: number;
2440
- rowFixed: FixedPosition;
2441
- onMouseEnter: VoidFunction;
2442
- onMouseLeave: VoidFunction;
1698
+ type InfiniteTableGeneratedGroupColumn<T> = Omit<InfiniteTableColumn<T>, 'defaultSortable'> & {
1699
+ groupByForColumn: GroupBy<T> | GroupBy<T>[];
1700
+ id?: string;
2443
1701
  };
2444
- type TableRenderCellFn = (param: TableRenderCellFnParam) => Renderable;
2445
- type TableRenderDetailRowFn = (param: TableRenderDetailRowFnParam) => Renderable;
2446
- type RenderRangeOptions = {
2447
- force?: boolean;
2448
- renderCell: TableRenderCellFn;
2449
- renderDetailRow?: TableRenderDetailRowFn;
2450
- onRender: (items: Renderable[]) => void;
1702
+ type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
1703
+ type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
1704
+ pivotBy: DataSourcePivotBy<DataType>[];
1705
+ pivotTotalColumnGroup?: true;
1706
+ pivotGroupKeys: KeyType[];
1707
+ pivotByAtIndex: PivotBy<DataType, KeyType>;
1708
+ pivotGroupKey: KeyType;
1709
+ pivotIndex: number;
2451
1710
  };
2452
- type HorizontalLayoutColVisibilityOptions = {
2453
- horizontalLayoutPageIndex?: number;
1711
+ type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
1712
+ pivotBy: DataSourcePivotBy<DataType>[];
1713
+ pivotColumn: true;
1714
+ pivotTotalColumn: boolean;
1715
+ pivotAggregator: AggregationReducer<DataType, any>;
1716
+ pivotAggregatorIndex: number;
1717
+ pivotGroupKeys: KeyType[];
1718
+ pivotByAtIndex?: PivotBy<DataType, KeyType>;
1719
+ pivotIndex: number;
1720
+ pivotGroupKey: KeyType;
2454
1721
  };
1722
+ type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
1723
+ type InfiniteTableComputedColumnBase<T> = {
1724
+ computedFilterType: string;
1725
+ computedSortType: string | string[];
1726
+ computedDataType: string;
1727
+ computedWidth: number;
1728
+ computedFlex: number | null;
1729
+ computedMinWidth: number;
1730
+ computedMaxWidth: number;
1731
+ computedOffset: number;
1732
+ computedPinningOffset: number;
1733
+ computedAbsoluteOffset: number;
1734
+ computedSortInfo: DataSourceSingleSortInfo<T> | null;
1735
+ computedSorted: boolean;
1736
+ computedSortedAsc: boolean;
1737
+ computedSortedDesc: boolean;
1738
+ computedSortIndex: number;
1739
+ computedVisible: boolean;
1740
+ computedVisibleIndex: number;
1741
+ computedVisibleIndexInCategory: number;
1742
+ computedMultiSort: boolean;
1743
+ computedFiltered: boolean;
1744
+ computedFilterable: boolean;
1745
+ computedGroupedBy: boolean;
1746
+ computedGroupedByIndex: number | undefined;
1747
+ computedGroupable: boolean;
1748
+ computedFilterValue: DataSourceFilterValueItem<T> | null;
1749
+ computedPinned: InfiniteTableColumnPinnedValues;
1750
+ computedDraggable: boolean;
1751
+ computedResizable: boolean;
1752
+ computedFirstInCategory: boolean;
1753
+ computedLastInCategory: boolean;
1754
+ computedFirst: boolean;
1755
+ computedLast: boolean;
1756
+ computedEditable: NonUndefined<InfiniteTableColumn<T>['defaultEditable']>;
1757
+ computedSortable: NonUndefined<InfiniteTableColumn<T>['defaultSortable']>;
1758
+ colType: InfiniteTableColumnType<T>;
1759
+ id: string;
1760
+ };
1761
+ type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
1762
+ type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
2455
1763
 
2456
- interface GridCellInterface<T_ADDITIONAL_CELL_INFO = any> {
2457
- debugId: string;
2458
- update(content: Renderable, additionalInfo?: T_ADDITIONAL_CELL_INFO, scrollingObjectParam?: {
2459
- scrolling: boolean;
2460
- }): void;
2461
- getElement(): HTMLElement | null;
2462
- getNode(): Renderable;
2463
- destroy(): void;
2464
- onMount(callback: (cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>) => void): void;
2465
- getAdditionalInfo(): T_ADDITIONAL_CELL_INFO | undefined;
2466
- isMounted(): boolean;
2467
- ref: React.RefCallback<HTMLElement | undefined>;
2468
- }
2469
-
2470
- type CellPos = [number, number];
2471
-
2472
- declare class GridCellManager<T_ADDITIONAL_CELL_INFO> extends Logger {
2473
- private matrix;
2474
- private rowsWithCellsHistory;
2475
- private columnsWithCellsHistory;
2476
- private cellToMatrixPosition;
2477
- private pool;
2478
- debugId: string;
2479
- private offRemoveCell;
2480
- constructor(debugId: string);
2481
- private onRemoveCell;
2482
- set poolSize(cellCount: number);
2483
- get poolSize(): number;
2484
- getDetachedCell(): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
2485
- private clearCellFromMatrix;
2486
- private addCellToMatrix;
2487
- private setCellPositionInMatrix;
2488
- renderNodeAtCell(node: Renderable, cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>, cellPos: CellPos, additionalInfo?: T_ADDITIONAL_CELL_INFO, scrollingObjectParam?: {
2489
- scrolling: boolean;
2490
- }): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
2491
- getCellPosition(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): CellPos | null;
2492
- getCellAt(cellPos: CellPos): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
2493
- /**
2494
- * This gets a cell for a given position.
2495
- * If there's already a cell currently attached at that position, it will be returned.
2496
- *
2497
- * Otherwise, we try to return the most optimal cell to use for that position.
2498
- * If the optimise parameter is set to 'row', we will try to return a detached cell
2499
- * that was last rendered in that row.
2500
- *
2501
- * If the optimise parameter is set to 'column', we will try to return a detached cell
2502
- * that was last rendered in that column.
2503
- *
2504
- * @param cellPos [rowIndex, colIndex]
2505
- * @param optimise 'row' | 'column'
2506
- */
2507
- getCellFor(cellPos: CellPos, optimise: 'row' | 'column'): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
2508
- isCellAttached(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): boolean;
2509
- isCellAttachedAt(cellPos: CellPos): boolean;
2510
- getMatrix(): Renderable[][];
2511
- getAllCells(): GridCellInterface<T_ADDITIONAL_CELL_INFO>[];
2512
- getCellsForRow(rowIndex: number): GridCellInterface<T_ADDITIONAL_CELL_INFO>[];
2513
- getOneAttachedCell(): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
2514
- getRowsWithCells(): number[];
2515
- getColumnsWithCells(): number[];
2516
- isRowAttached(rowIndex: number): boolean;
2517
- isColumnAttached(colIndex: number): boolean;
2518
- detachRow(rowIndex: number): void;
2519
- detachCol(colIndex: number): void;
2520
- detachCell(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): boolean;
2521
- detachCells(cells: Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>): void;
2522
- detachRowsStartingWith(rowIndex: number): void;
2523
- detachColsStartingWith(colIndex: number): void;
2524
- detachCellsStartingAt(cellPos: CellPos): void;
2525
- detachCellAt(cellPos: CellPos): boolean;
2526
- onCellAttachmentChange(callback: (cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>, attached: boolean) => void): VoidFn;
2527
- getCellsOutsideRenderRange: (range: TableRenderRange) => Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>;
2528
- getCellFromListForRow(cells: Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>, rowIndex: number): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
2529
- getCellFromListForColumn(cells: Set<GridCellInterface<T_ADDITIONAL_CELL_INFO>>, colIndex: number): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
2530
- getCellCountInMatrix(): number;
2531
- destroy(): void;
2532
- reset(): void;
2533
- makeDetachedCellsEmpty(): void;
2534
- withDetachedCells(fn: (cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>) => void): void;
2535
- }
2536
-
2537
- /**
2538
- * This is only used for rendering Detail rows in a master-detail DataGrid
2539
- */
2540
- interface ListRowInterface {
2541
- debugId: string;
2542
- update(content: Renderable): void;
2543
- getElement(): HTMLElement | null;
2544
- getNode(): Renderable;
2545
- destroy(): void;
2546
- onMount(callback: (row: ListRowInterface) => void): void;
2547
- isMounted(): boolean;
2548
- ref: (htmlElement: HTMLElement) => void;
2549
- }
2550
-
2551
- declare class ListRowManager extends Logger {
2552
- private pool;
2553
- private indexToRow;
2554
- private rowToIndex;
2555
- debugId: string;
2556
- private offRemoveRow;
2557
- constructor(debugId: string);
2558
- private onRemoveRow;
2559
- set poolSize(rowCount: number);
2560
- get poolSize(): number;
2561
- getDetachedRow(): ListRowInterface;
2562
- /**
2563
- * This gets a row for a given position.
2564
- * If there's already a row currently attached at that position, it will be returned.
2565
- *
2566
- * Otherwise, we return another row.
2567
- * @param rowIndex
2568
- */
2569
- getRowFor(rowIndex: number): ListRowInterface;
2570
- private setRowIndexInList;
2571
- detachStartingWith(rowIndex: number): void;
2572
- getRowAt(rowPos: number): ListRowInterface | undefined;
2573
- getRowIndex(row: ListRowInterface): number | undefined;
2574
- isRowAttached(row: ListRowInterface): boolean;
2575
- isRowAttachedAt(rowIndex: number): boolean;
2576
- getList(): Renderable[];
2577
- getAttachedCount(): number;
2578
- forEachAttachedRow(fn: (row: ListRowInterface) => void): void;
2579
- getAttachedIndexes(): number[];
2580
- getAllRows(): ListRowInterface[];
2581
- detachRowAt(rowIndex: number): void;
2582
- detachRow(row: ListRowInterface): void;
2583
- renderNodeAtRow(node: Renderable, row: ListRowInterface, rowIndex: number): ListRowInterface;
2584
- makeDetachedRowsEmpty(): void;
2585
- onRowAttachmentChange(callback: (row: ListRowInterface, attached: boolean) => void): VoidFn;
2586
- withDetachedRows(fn: (row: ListRowInterface) => void): void;
2587
- destroy(): void;
2588
- reset(): void;
2589
- }
1764
+ declare const DS_ERROR_CODES: Record<"DS001", DebugWarningPayload>;
1765
+ declare const INFINITE_ERROR_CODES: Record<"CSS001_CSS", DebugWarningPayload>;
1766
+ declare const ERROR_CODES: {
1767
+ CSS001_CSS: DebugWarningPayload;
1768
+ DS001: DebugWarningPayload;
1769
+ };
2590
1770
 
2591
- declare class GridRenderer extends Logger {
2592
- protected brain: MatrixBrain;
1771
+ type DevToolsMessageAddress = 'infinite-table-devtools-contentscript' | 'infinite-table-devtools-contentscript-panel' | 'infinite-table-devtools-background' | 'infinite-table-page';
1772
+ type DevToolsGenericMessage = {
1773
+ source: DevToolsMessageAddress;
1774
+ target: DevToolsMessageAddress;
1775
+ payload: any;
1776
+ type: string;
1777
+ };
1778
+ type ErrorCodeKey = keyof typeof ERROR_CODES;
1779
+ type DataSourceDebugWarningKey = keyof typeof DS_ERROR_CODES;
1780
+ type InfiniteTableDebugWarningKey = keyof typeof INFINITE_ERROR_CODES;
1781
+ type DebugWarningPayload = {
1782
+ message: string;
1783
+ code: ErrorCodeKey;
1784
+ type: 'error' | 'warning';
1785
+ status?: 'new' | 'discarded';
1786
+ debugId?: string;
1787
+ };
1788
+ type DevToolsHookFnOptions = {
1789
+ getState: () => InfiniteTableState<any>;
1790
+ getDataSourceState: () => DataSourceState<any>;
1791
+ getComputed: () => InfiniteTableComputedValues<any>;
1792
+ actions: InfiniteTableActions<any>;
1793
+ dataSourceActions: DataSourceComponentActions<any>;
1794
+ api: InfiniteTableApi<any>;
1795
+ dataSourceApi: DataSourceApi<any>;
1796
+ };
1797
+ type DevToolsOverrides = Partial<DevToolsInfiniteOverrides & DevToolsDataSourceOverrides>;
1798
+ type DevToolsInfiniteOverrides = Partial<{
1799
+ groupRenderStrategy: InfiniteTableState<any>['groupRenderStrategy'];
1800
+ columnVisibility: InfiniteTableState<any>['columnVisibility'];
1801
+ }>;
1802
+ type DevToolsDataSourceOverrides = Partial<{
1803
+ groupBy: DataSourceState<any>['groupBy'];
1804
+ sortInfo: DataSourceState<any>['sortInfo'];
1805
+ multiSort: DataSourceState<any>['multiSort'];
1806
+ }>;
1807
+ type DevToolsHostPageMessagePayload = {
2593
1808
  debugId: string;
2594
- protected destroyed: boolean;
2595
- private scrolling;
2596
- cellHoverClassNames: string[];
2597
- cellDetachedClassNames: string[];
2598
- cellManager: GridCellManager<{
2599
- renderRowIndex: number;
2600
- renderColIndex: number;
1809
+ columnOrder: string[];
1810
+ visibleColumnIds: string[];
1811
+ columnVisibility: InfiniteTableState<any>['columnVisibility'];
1812
+ columns: Record<string, {
1813
+ field: InfiniteTableComputedColumn<any>['field'];
1814
+ dataType: InfiniteTableComputedColumn<any>['computedDataType'];
1815
+ sortType: InfiniteTableComputedColumn<any>['computedSortType'];
1816
+ filtered: InfiniteTableComputedColumn<any>['computedFiltered'];
1817
+ sorted: InfiniteTableComputedColumn<any>['computedSorted'];
1818
+ width: InfiniteTableComputedColumn<any>['computedWidth'];
2601
1819
  }>;
2602
- protected rowManager: ListRowManager;
2603
- private lastEnteredRow;
2604
- private lastExitedRow;
2605
- private onDestroy;
2606
- private hoverRowUpdatesInProgress;
2607
- private infiniteNode;
2608
- private getInfiniteNode;
2609
- setDetailTransform: (element: HTMLElement, _rowIndex: number, { y, scrollTop, scrollLeft, }: {
2610
- y: number;
2611
- scrollTop?: boolean;
2612
- scrollLeft?: number;
2613
- }) => void;
2614
- setTransform: (element: HTMLElement, _rowIndex: number, colIndex: number, { x, y, scrollLeft, scrollTop, }: {
2615
- x: number;
2616
- y: number;
2617
- scrollLeft?: boolean;
2618
- scrollTop?: boolean;
2619
- }, zIndex: number | "auto" | undefined | null) => void;
2620
- constructor(brain: MatrixBrain, debugId?: string);
2621
- private onCellAttached;
2622
- private onCellDetached;
2623
- private onRowAttached;
2624
- private onRowDetached;
2625
- getFullyVisibleRowsRange: () => {
2626
- start: number;
2627
- end: number;
2628
- } | null;
2629
- getScrollPositionForScrollRowIntoView: (rowIndex: number, config?: {
2630
- scrollAdjustPosition?: ScrollAdjustPosition;
2631
- offset?: number;
2632
- colIndex?: number;
2633
- }) => ScrollPosition | null;
2634
- getScrollPositionForScrollColumnIntoView: (colIndex: number, config?: {
2635
- scrollAdjustPosition?: ScrollAdjustPosition;
2636
- offset?: number;
2637
- } & HorizontalLayoutColVisibilityOptions) => ScrollPosition | null;
2638
- getScrollPositionForScrollCellIntoView: (rowIndex: number, colIndex: number, config?: {
2639
- rowScrollAdjustPosition?: ScrollAdjustPosition;
2640
- colScrollAdjustPosition?: ScrollAdjustPosition;
2641
- scrollAdjustPosition?: ScrollAdjustPosition;
2642
- offsetTop: number;
2643
- offsetLeft: number;
2644
- }) => ScrollPosition | null;
2645
- isRowFullyVisible: (rowIndex: number, offsetMargin?: number) => boolean;
2646
- isRowVisible: (rowIndex: number, offsetMargin?: number) => boolean;
2647
- isRowRendered: (rowIndex: number) => boolean;
2648
- isCellVisible: (rowIndex: number, colIndex: number) => boolean;
2649
- isCellFullyVisible: (rowIndex: number, colIndex: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
2650
- isColumnFullyVisible: (colIndex: number, offsetMargin?: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
2651
- isColumnVisible: (colIndex: number, offsetMargin?: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
2652
- isCellRendered: (rowIndex: number, colIndex: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
2653
- isColumnRendered: (colIndex: number, opts?: HorizontalLayoutColVisibilityOptions) => boolean;
2654
- getExtraSpanCellsForRange: (range: TableRenderRange) => [number, number][];
2655
- isCellRenderedAndMappedCorrectly(row: number, col: number): {
2656
- rendered: boolean;
2657
- mapped: boolean;
2658
- };
2659
- renderRange(range: TableRenderRange, { renderCell, renderDetailRow, force, onRender }: RenderRangeOptions): Renderable[];
2660
- getFixedRanges: (currentRenderRange: TableRenderRange) => TableRenderRange[];
2661
- protected isCellFixed: (rowIndex: number, colIndex: number) => {
2662
- row: FixedPosition;
2663
- col: FixedPosition;
1820
+ groupRenderStrategy: InfiniteTableState<any>['groupRenderStrategy'];
1821
+ groupBy: string[];
1822
+ sortInfo: {
1823
+ field: string;
1824
+ dir: 1 | -1;
1825
+ type?: string;
1826
+ }[];
1827
+ multiSort: DataSourceState<any>['multiSort'];
1828
+ selectionMode: DataSourceState<any>['selectionMode'];
1829
+ devToolsDetected: InfiniteTableState<any>['devToolsDetected'];
1830
+ debugTimings: Record<DebugTimingKey, number>;
1831
+ debugWarnings: Record<ErrorCodeKey, DebugWarningPayload>;
1832
+ };
1833
+ type DevToolsHostPageMessageType = 'update' | 'unmount' | 'log';
1834
+ type DevToolsHostPageLogMessage = {
1835
+ type: Extract<DevToolsHostPageMessageType, 'log'>;
1836
+ payload: DevToolsHostPageLogMessagePayload;
1837
+ };
1838
+ type DevToolsHostPageLogMessagePayload = {
1839
+ channel: string;
1840
+ color: string;
1841
+ args: any[];
1842
+ timestamp: number;
1843
+ debugId?: string;
1844
+ };
1845
+ type DevToolsHostPageMessage = {
1846
+ source: Extract<DevToolsMessageAddress, 'infinite-table-page'>;
1847
+ target: Extract<DevToolsMessageAddress, 'infinite-table-devtools-background'>;
1848
+ url: string;
1849
+ } & ({
1850
+ type: Extract<DevToolsHostPageMessageType, 'update'>;
1851
+ payload: DevToolsHostPageMessagePayload;
1852
+ } | {
1853
+ type: Extract<DevToolsHostPageMessageType, 'unmount'>;
1854
+ payload: {
1855
+ debugId: string;
2664
1856
  };
2665
- protected isCellCovered: (rowIndex: number, colIndex: number) => false | number[];
2666
- private renderDetailRowAtElement;
2667
- protected getCellRealCoordinates(rowIndex: number, colIndex: number): {
1857
+ } | DevToolsHostPageLogMessage);
1858
+ type DevToolsHookFn = (debugId: string, options: null | DevToolsHookFnOptions) => void;
1859
+
1860
+ type CellContextMenuLocation = {
1861
+ rowId: any;
1862
+ rowIndex: number;
1863
+ columnId: string;
1864
+ colIndex: number;
1865
+ };
1866
+ type CellContextMenuLocationWithEvent = CellContextMenuLocation & {
1867
+ event: React.MouseEvent;
1868
+ target: HTMLElement;
1869
+ };
1870
+ type ContextMenuLocationWithEvent = Partial<CellContextMenuLocation> & {
1871
+ event: React.MouseEvent;
1872
+ target: HTMLElement;
1873
+ };
1874
+ interface InfiniteTableSetupState<T> {
1875
+ updatedAt: number;
1876
+ brain: MatrixBrain;
1877
+ headerBrain: MatrixBrain;
1878
+ renderer: GridRenderer;
1879
+ onRenderUpdater: SubscriptionCallback<Renderable>;
1880
+ headerRenderer: GridRenderer;
1881
+ headerOnRenderUpdater: SubscriptionCallback<Renderable>;
1882
+ debugWarnings: Map<InfiniteTableDebugWarningKey, DebugWarningPayload>;
1883
+ devToolsDetected: boolean;
1884
+ forceBodyRerenderTimestamp: number;
1885
+ lastRowToExpandRef: MutableRefObject<any | null>;
1886
+ lastRowToCollapseRef: MutableRefObject<any | null>;
1887
+ getDOMNodeForCell: (cellPos: CellPositionByIndex) => HTMLElement | null;
1888
+ propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
1889
+ columnsWhenInlineGroupRenderStrategy?: Record<string, InfiniteTableColumn<T>>;
1890
+ domRef: MutableRefObject<HTMLDivElement | null>;
1891
+ editingValueRef: MutableRefObject<any | null>;
1892
+ scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
1893
+ portalDOMRef: MutableRefObject<HTMLDivElement | null>;
1894
+ focusDetectDOMRef: MutableRefObject<HTMLDivElement | null>;
1895
+ activeCellIndicatorDOMRef: MutableRefObject<HTMLDivElement | null>;
1896
+ onFlashingDurationCSSVarChange: SubscriptionCallback<number>;
1897
+ flashingDurationCSSVarValue: number | null;
1898
+ onRowHeightCSSVarChange: SubscriptionCallback<number>;
1899
+ onRowDetailHeightCSSVarChange: SubscriptionCallback<number>;
1900
+ onColumnMenuClick: SubscriptionCallback<{
1901
+ target: HTMLElement | EventTarget;
1902
+ column: InfiniteTableComputedColumn<T>;
1903
+ }>;
1904
+ onFilterOperatorMenuClick: SubscriptionCallback<{
1905
+ target: HTMLElement | EventTarget;
1906
+ column: InfiniteTableComputedColumn<T>;
1907
+ }>;
1908
+ cellContextMenu: SubscriptionCallback<CellContextMenuLocationWithEvent>;
1909
+ contextMenu: SubscriptionCallback<ContextMenuLocationWithEvent>;
1910
+ cellContextMenuVisibleFor: CellContextMenuLocation | null;
1911
+ contextMenuVisibleFor: (Partial<CellContextMenuLocation> & {
1912
+ point: PointCoords;
1913
+ }) | null;
1914
+ columnMenuVisibleForColumnId: string | null;
1915
+ columnMenuTargetRef: MutableRefObject<HTMLElement | null>;
1916
+ columnMenuVisibleKey: string | number;
1917
+ filterOperatorMenuVisibleForColumnId: string | null;
1918
+ onColumnHeaderHeightCSSVarChange: SubscriptionCallback<number>;
1919
+ cellClick: SubscriptionCallback<CellPositionByIndex & {
1920
+ event: MouseEvent;
1921
+ }>;
1922
+ cellMouseDown: SubscriptionCallback<CellPositionByIndex & {
1923
+ event: MouseEvent;
1924
+ }>;
1925
+ keyDown: SubscriptionCallback<KeyboardEvent>;
1926
+ columnsWhenGrouping?: InfiniteTablePropColumns<T>;
1927
+ bodySize: Size;
1928
+ focused: boolean;
1929
+ ready: boolean;
1930
+ columnReorderDragColumnId: false | string;
1931
+ columnReorderInPageIndex: number | null;
1932
+ columnVisibilityForGrouping: Record<string, false>;
1933
+ focusedWithin: boolean;
1934
+ scrollPosition: ScrollPosition;
1935
+ pinnedStartScrollListener: ScrollListener;
1936
+ pinnedEndScrollListener: ScrollListener;
1937
+ editingCell: {
1938
+ active: true;
1939
+ accepted: false;
1940
+ columnId: string;
1941
+ value: any;
1942
+ persisted: false;
1943
+ initialValue: any;
2668
1944
  rowIndex: number;
2669
- colIndex: number;
1945
+ primaryKey: any;
1946
+ } | null | {
1947
+ active: false;
1948
+ columnId: string;
1949
+ rowIndex: number;
1950
+ value: any;
1951
+ initialValue: any;
1952
+ primaryKey?: any;
1953
+ waiting: 'accept' | 'persist' | false;
1954
+ accepted: boolean | Error;
1955
+ persisted: boolean | Error;
1956
+ cancelled?: boolean;
2670
1957
  };
2671
- protected renderCellAt(rowIndex: number, colIndex: number, cell: GridCellInterface, renderCell: TableRenderCellFn): void;
2672
- protected onMouseEnter: (rowIndex: number) => void;
2673
- private addHoverClass;
2674
- protected onMouseLeave: (rowIndex: number) => void;
2675
- private removeHoverClass;
2676
- protected updateHoverClassNamesForRow: (rowIndex: number) => void;
2677
- protected updateElementPosition: (cell: GridCellInterface<{
2678
- renderRowIndex: number;
2679
- renderColIndex: number;
2680
- }>, options?: {
2681
- hidden: boolean;
2682
- rowspan: number;
2683
- colspan: number;
2684
- }) => void;
2685
- private updateDetailElementPosition;
2686
- private onScrollStart;
2687
- private onScrollStop;
2688
- adjustFixedElementsOnScroll: (scrollPosition?: ScrollPosition) => void;
2689
- destroy: () => void;
2690
- reset(): void;
1958
+ }
1959
+ type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
1960
+ type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
1961
+ type InfiniteTablePropPivotGrandTotalColumnPosition = InfiniteTablePropPivotTotalColumnPosition;
1962
+ interface InfiniteTableMappedState<T> {
1963
+ id: InfiniteTableProps<T>['id'];
1964
+ debugId: InfiniteTableProps<T>['debugId'];
1965
+ scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
1966
+ multiSortBehavior: NonUndefined<InfiniteTableProps<T>['multiSortBehavior']>;
1967
+ viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
1968
+ resizableColumns: InfiniteTableProps<T>['resizableColumns'];
1969
+ groupColumn: InfiniteTableProps<T>['groupColumn'];
1970
+ onKeyDown: InfiniteTableProps<T>['onKeyDown'];
1971
+ onCellClick: InfiniteTableProps<T>['onCellClick'];
1972
+ onCellDoubleClick: InfiniteTableProps<T>['onCellDoubleClick'];
1973
+ onRowMouseEnter: InfiniteTableProps<T>['onRowMouseEnter'];
1974
+ onRowMouseLeave: InfiniteTableProps<T>['onRowMouseLeave'];
1975
+ repeatWrappedGroupRows: InfiniteTableProps<T>['repeatWrappedGroupRows'];
1976
+ wrapRowsHorizontally: InfiniteTableProps<T>['wrapRowsHorizontally'];
1977
+ rowDetailCache: RowDetailCache<RowDetailCacheKey, RowDetailCacheEntry>;
1978
+ headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
1979
+ draggableColumnsRestrictTo: NonUndefined<InfiniteTableProps<T>['draggableColumnsRestrictTo']>;
1980
+ onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
1981
+ getContextMenuItems: InfiniteTableProps<T>['getContextMenuItems'];
1982
+ getCellContextMenuItems: InfiniteTableProps<T>['getCellContextMenuItems'];
1983
+ getColumnMenuItems: InfiniteTableProps<T>['getColumnMenuItems'];
1984
+ getFilterOperatorMenuItems: InfiniteTableProps<T>['getFilterOperatorMenuItems'];
1985
+ keyboardShortcuts: InfiniteTableProps<T>['keyboardShortcuts'];
1986
+ columnPinning: InfiniteTablePropColumnPinning;
1987
+ loadingText: InfiniteTableProps<T>['loadingText'];
1988
+ components: InfiniteTableProps<T>['components'];
1989
+ columns: InfiniteTablePropColumns<T>;
1990
+ pivotColumns: InfiniteTableProps<T>['pivotColumns'];
1991
+ onReady: InfiniteTableProps<T>['onReady'];
1992
+ onContextMenu: InfiniteTableProps<T>['onContextMenu'];
1993
+ onCellContextMenu: InfiniteTableProps<T>['onCellContextMenu'];
1994
+ onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
1995
+ onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
1996
+ onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
1997
+ onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
1998
+ onEditCancelled: InfiniteTableProps<T>['onEditCancelled'];
1999
+ onEditRejected: InfiniteTableProps<T>['onEditRejected'];
2000
+ onEditAccepted: InfiniteTableProps<T>['onEditAccepted'];
2001
+ shouldAcceptEdit: InfiniteTableProps<T>['shouldAcceptEdit'];
2002
+ persistEdit: InfiniteTableProps<T>['persistEdit'];
2003
+ onEditPersistSuccess: InfiniteTableProps<T>['onEditPersistSuccess'];
2004
+ onEditPersistError: InfiniteTableProps<T>['onEditPersistError'];
2005
+ autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
2006
+ activeRowIndex: InfiniteTableProps<T>['activeRowIndex'];
2007
+ activeCellIndex: InfiniteTableProps<T>['activeCellIndex'];
2008
+ onRenderRangeChange: InfiniteTableProps<T>['onRenderRangeChange'];
2009
+ scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
2010
+ onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
2011
+ onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
2012
+ onScrollStop: InfiniteTableProps<T>['onScrollStop'];
2013
+ scrollToBottomOffset: InfiniteTableProps<T>['scrollToBottomOffset'];
2014
+ focusedClassName: InfiniteTableProps<T>['focusedClassName'];
2015
+ focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
2016
+ focusedStyle: InfiniteTableProps<T>['focusedStyle'];
2017
+ focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
2018
+ showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
2019
+ domProps: InfiniteTableProps<T>['domProps'];
2020
+ editable: InfiniteTableProps<T>['editable'];
2021
+ columnMenuRealignDelay: NonUndefined<InfiniteTableProps<T>['columnMenuRealignDelay']>;
2022
+ columnDefaultEditable: InfiniteTableProps<T>['columnDefaultEditable'];
2023
+ columnDefaultFilterable: InfiniteTableProps<T>['columnDefaultFilterable'];
2024
+ columnDefaultGroupable: InfiniteTableProps<T>['columnDefaultGroupable'];
2025
+ columnDefaultSortable: InfiniteTableProps<T>['columnDefaultSortable'];
2026
+ rowStyle: InfiniteTableProps<T>['rowStyle'];
2027
+ cellStyle: InfiniteTableProps<T>['cellStyle'];
2028
+ rowProps: InfiniteTableProps<T>['rowProps'];
2029
+ rowClassName: InfiniteTableProps<T>['rowClassName'];
2030
+ rowHoverClassName: InfiniteTableProps<T>['rowHoverClassName'];
2031
+ cellClassName: InfiniteTableProps<T>['cellClassName'];
2032
+ pinnedStartMaxWidth: InfiniteTableProps<T>['pinnedStartMaxWidth'];
2033
+ pinnedEndMaxWidth: InfiniteTableProps<T>['pinnedEndMaxWidth'];
2034
+ pivotColumn: InfiniteTableProps<T>['pivotColumn'];
2035
+ pivotColumnGroups: InfiniteTablePropColumnGroups;
2036
+ columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
2037
+ columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
2038
+ columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
2039
+ columnDefaultFlex: InfiniteTableProps<T>['columnDefaultFlex'];
2040
+ columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
2041
+ draggableColumns: InfiniteTableProps<T>['draggableColumns'];
2042
+ columnDefaultDraggable: InfiniteTableProps<T>['columnDefaultDraggable'];
2043
+ sortable: InfiniteTableProps<T>['sortable'];
2044
+ hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
2045
+ hideColumnWhenGrouped: NonUndefined<InfiniteTableProps<T>['hideColumnWhenGrouped']>;
2046
+ keyboardSelection: NonUndefined<InfiniteTableProps<T>['keyboardSelection']>;
2047
+ columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
2048
+ showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
2049
+ showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
2050
+ header: NonUndefined<InfiniteTableProps<T>['header']>;
2051
+ virtualizeColumns: NonUndefined<InfiniteTableProps<T>['virtualizeColumns']>;
2052
+ rowHeight: number | ((rowInfo: InfiniteTableRowInfo<T>) => number);
2053
+ rowDetailHeight: number | ((rowInfo: InfiniteTableRowInfo<T>) => number);
2054
+ columnHeaderHeight: number;
2055
+ licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
2056
+ columnVisibility: InfiniteTablePropColumnVisibility;
2057
+ columnGroupVisibility: NonUndefined<InfiniteTableProps<T>['columnGroupVisibility']>;
2058
+ columnSizing: InfiniteTablePropColumnSizing;
2059
+ columnTypes: InfiniteTablePropColumnTypes<T>;
2060
+ columnGroups: InfiniteTablePropColumnGroups;
2061
+ collapsedColumnGroups: NonUndefined<InfiniteTableProps<T>['collapsedColumnGroups']>;
2062
+ pivotTotalColumnPosition: NonUndefined<InfiniteTableProps<T>['pivotTotalColumnPosition']>;
2063
+ pivotGrandTotalColumnPosition: InfiniteTableProps<T>['pivotGrandTotalColumnPosition'];
2064
+ }
2065
+ interface InfiniteTableDerivedState<T> {
2066
+ isTree: boolean;
2067
+ groupBy: DataSourceProps<T>['groupBy'];
2068
+ computedColumns: Record<string, InfiniteTableColumn<T>>;
2069
+ initialColumns: InfiniteTableProps<T>['columns'];
2070
+ rowDetailState: RowDetailState<T> | undefined;
2071
+ isRowDetailExpanded: InfiniteTableProps<T>['isRowDetailExpanded'] | undefined;
2072
+ rowDetailRenderer?: InfiniteTableProps<T>['rowDetailRenderer'];
2073
+ isRowDetailEnabled: NonUndefined<InfiniteTableProps<T>['isRowDetailEnabled']> | boolean;
2074
+ showColumnFilters: NonUndefined<InfiniteTableProps<T>['showColumnFilters']>;
2075
+ groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
2076
+ columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
2077
+ keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>;
2078
+ columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
2079
+ columnGroupsMaxDepth: number;
2080
+ computedColumnGroups: InfiniteTablePropColumnGroups;
2081
+ rowHeightCSSVar: string;
2082
+ rowDetailHeightCSSVar: string;
2083
+ columnHeaderHeightCSSVar: string;
2084
+ controlledColumnVisibility: boolean;
2085
+ }
2086
+ type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
2087
+ interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
2691
2088
  }
2692
2089
 
2693
- type CellPositionByIndex = {
2090
+ type CellPositionOptions = {
2091
+ rowIndex: number;
2092
+ colIndex: number;
2093
+ rowId?: never;
2094
+ colId?: never;
2095
+ } | {
2096
+ rowIndex?: never;
2097
+ colIndex?: never;
2098
+ rowId: any;
2099
+ colId: string;
2100
+ } | {
2694
2101
  rowIndex: number;
2102
+ colIndex?: never;
2103
+ rowId?: never;
2104
+ colId: string;
2105
+ } | {
2106
+ rowIndex?: never;
2695
2107
  colIndex: number;
2108
+ rowId: any;
2109
+ colId?: never;
2696
2110
  };
2697
- type MultiSelectRangeOptions = {
2698
- horizontalLayout: false;
2699
- } | {
2700
- horizontalLayout: true;
2701
- rowsPerPage: number;
2702
- columnsPerSet: number;
2111
+
2112
+ type InfiniteTableCellSelectionApi<T> = {
2113
+ isCellSelected(cellPosition: CellPositionOptions): boolean;
2114
+ selectCell(cellPosition: CellPositionOptions & {
2115
+ clear?: boolean;
2116
+ }): void;
2117
+ deselectCell(cellPosition: CellPositionOptions): void;
2118
+ deselectAll(): void;
2119
+ clear(): void;
2120
+ selectAll(): void;
2121
+ selectColumn(colId: string, options?: {
2122
+ clear?: boolean;
2123
+ }): void;
2124
+ deselectColumn(colId: string): void;
2125
+ selectRange(start: CellPositionOptions, end: CellPositionOptions): void;
2126
+ deselectRange(start: CellPositionOptions, end: CellPositionOptions): void;
2127
+ getAllCellSelectionPositions(): {
2128
+ columnIds: string[];
2129
+ positions: (CellSelectionPosition | null)[][];
2130
+ };
2131
+ mapCellSelectionPositions<SELECTED_VALUE, EMPTY_VALUE>(fn: (rowInfo: InfiniteTableRowInfo<T>, colId: string) => SELECTED_VALUE, emptyValue: EMPTY_VALUE): {
2132
+ columnIds: string[];
2133
+ positions: (SELECTED_VALUE | EMPTY_VALUE)[][];
2134
+ };
2703
2135
  };
2704
2136
 
2705
- declare class ScrollListener {
2706
- private scrollPosition;
2707
- private onScrollFns;
2708
- getScrollPosition: () => ScrollPosition;
2709
- onScroll: (fn: OnScrollFn) => () => void;
2710
- setScrollPosition: (scrollPosition: ScrollPosition) => void;
2711
- private notifyScrollChange;
2712
- destroy: () => void;
2137
+ type CellNavigationConfig = {
2138
+ direction: 'top' | 'bottom' | 'left' | 'right';
2139
+ };
2140
+ interface InfiniteTableKeyboardNavigationApi<T> {
2141
+ setKeyboardNavigation: (keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>) => void;
2142
+ setActiveCellIndex: (activeCellIndex: NonUndefined<InfiniteTableProps<T>['activeCellIndex']>) => void;
2143
+ setActiveRowIndex: (activeRowIndex: NonUndefined<InfiniteTableProps<T>['activeRowIndex']>) => void;
2144
+ gotoNextRow: () => number | false;
2145
+ gotoPreviousRow: () => number | false;
2146
+ gotoRow: (direction: 1 | -1) => number | false;
2147
+ gotoCell: (config: CellNavigationConfig) => false | [number, number];
2713
2148
  }
2714
2149
 
2715
- type CellContextMenuLocation = {
2716
- rowId: any;
2717
- rowIndex: number;
2718
- columnId: string;
2719
- colIndex: number;
2150
+ type InfiniteTableRowDetailApi = {
2151
+ isRowDetailExpanded(pk: any): boolean;
2152
+ isRowDetailCollapsed(pk: any): boolean;
2153
+ expandRowDetail(pk: any): void;
2154
+ collapseRowDetail(pk: any): void;
2155
+ toggleRowDetail(pk: any): void;
2156
+ collapseAllDetails(): void;
2157
+ expandAllDetails(): void;
2158
+ isRowDetailEnabledForRow(pk: any): boolean;
2720
2159
  };
2721
- type CellContextMenuLocationWithEvent = CellContextMenuLocation & {
2722
- event: React.MouseEvent;
2723
- target: HTMLElement;
2160
+
2161
+ type RowSelectionStateItem = (any | any[])[];
2162
+ type RowSelectionStateObject = {
2163
+ selectedRows: RowSelectionStateItem;
2164
+ deselectedRows: RowSelectionStateItem;
2165
+ defaultSelection: boolean;
2166
+ } | {
2167
+ defaultSelection: true;
2168
+ deselectedRows: RowSelectionStateItem;
2169
+ selectedRows?: RowSelectionStateItem;
2170
+ } | {
2171
+ defaultSelection: false;
2172
+ selectedRows: RowSelectionStateItem;
2173
+ deselectedRows?: RowSelectionStateItem;
2724
2174
  };
2725
- type ContextMenuLocationWithEvent = Partial<CellContextMenuLocation> & {
2726
- event: React.MouseEvent;
2727
- target: HTMLElement;
2175
+ type RowSelectionStateConfig<T> = {
2176
+ groupBy: DataSourceState<T>['groupBy'];
2177
+ groupDeepMap: DataSourceState<T>['groupDeepMap'];
2178
+ toPrimaryKey: DataSourceState<T>['toPrimaryKey'];
2179
+ totalCount: number;
2180
+ indexer: DataSourceState<T>['indexer'];
2181
+ lazyLoad: boolean;
2182
+ onlyUsePrimaryKeys: boolean;
2728
2183
  };
2729
- interface InfiniteTableSetupState<T> {
2730
- brain: MatrixBrain;
2731
- headerBrain: MatrixBrain;
2732
- renderer: GridRenderer;
2733
- onRenderUpdater: SubscriptionCallback<Renderable>;
2734
- headerRenderer: GridRenderer;
2735
- headerOnRenderUpdater: SubscriptionCallback<Renderable>;
2736
- debugWarnings: Map<InfiniteTableDebugWarningKey, DebugWarningPayload>;
2737
- devToolsDetected: boolean;
2738
- forceBodyRerenderTimestamp: number;
2739
- lastRowToExpandRef: MutableRefObject<any | null>;
2740
- lastRowToCollapseRef: MutableRefObject<any | null>;
2741
- getDOMNodeForCell: (cellPos: CellPositionByIndex) => HTMLElement | null;
2742
- propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
2743
- columnsWhenInlineGroupRenderStrategy?: Record<string, InfiniteTableColumn<T>>;
2744
- domRef: MutableRefObject<HTMLDivElement | null>;
2745
- editingValueRef: MutableRefObject<any | null>;
2746
- scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
2747
- portalDOMRef: MutableRefObject<HTMLDivElement | null>;
2748
- focusDetectDOMRef: MutableRefObject<HTMLDivElement | null>;
2749
- activeCellIndicatorDOMRef: MutableRefObject<HTMLDivElement | null>;
2750
- onFlashingDurationCSSVarChange: SubscriptionCallback<number>;
2751
- flashingDurationCSSVarValue: number | null;
2752
- onRowHeightCSSVarChange: SubscriptionCallback<number>;
2753
- onRowDetailHeightCSSVarChange: SubscriptionCallback<number>;
2754
- onColumnMenuClick: SubscriptionCallback<{
2755
- target: HTMLElement | EventTarget;
2756
- column: InfiniteTableComputedColumn<T>;
2757
- }>;
2758
- onFilterOperatorMenuClick: SubscriptionCallback<{
2759
- target: HTMLElement | EventTarget;
2760
- column: InfiniteTableComputedColumn<T>;
2761
- }>;
2762
- cellContextMenu: SubscriptionCallback<CellContextMenuLocationWithEvent>;
2763
- contextMenu: SubscriptionCallback<ContextMenuLocationWithEvent>;
2764
- cellContextMenuVisibleFor: CellContextMenuLocation | null;
2765
- contextMenuVisibleFor: (Partial<CellContextMenuLocation> & {
2766
- point: PointCoords;
2767
- }) | null;
2768
- columnMenuVisibleForColumnId: string | null;
2769
- columnMenuTargetRef: MutableRefObject<HTMLElement | null>;
2770
- columnMenuVisibleKey: string | number;
2771
- filterOperatorMenuVisibleForColumnId: string | null;
2772
- onColumnHeaderHeightCSSVarChange: SubscriptionCallback<number>;
2773
- cellClick: SubscriptionCallback<CellPositionByIndex & {
2774
- event: MouseEvent;
2775
- }>;
2776
- cellMouseDown: SubscriptionCallback<CellPositionByIndex & {
2777
- event: MouseEvent;
2184
+ type GetRowSelectionStateConfig<T> = () => RowSelectionStateConfig<T>;
2185
+ type RowSelectionStateOverride = {
2186
+ getGroupKeysForPrimaryKey: RowSelectionState<any>['getGroupKeysForPrimaryKey'];
2187
+ getGroupByLength: RowSelectionState<any>['getGroupByLength'];
2188
+ getGroupCount: RowSelectionState<any>['getGroupCount'];
2189
+ getGroupKeysDirectlyInsideGroup: RowSelectionState<any>['getGroupKeysDirectlyInsideGroup'];
2190
+ getAllPrimaryKeysInsideGroup: RowSelectionState<any>['getAllPrimaryKeysInsideGroup'];
2191
+ };
2192
+ declare class RowSelectionState<T = any> {
2193
+ selectedRows: RowSelectionStateItem | null;
2194
+ deselectedRows: RowSelectionStateItem | null;
2195
+ defaultSelection: boolean;
2196
+ selectedMap: DeepMap<any, true>;
2197
+ deselectedMap: DeepMap<any, true>;
2198
+ onlyUsePrimaryKeys: boolean;
2199
+ selectionCache: DeepMap<any, boolean | null>;
2200
+ selectionCountCache: DeepMap<any, {
2201
+ selectedCount: number;
2202
+ deselectedCount: number;
2778
2203
  }>;
2779
- keyDown: SubscriptionCallback<KeyboardEvent>;
2780
- columnsWhenGrouping?: InfiniteTablePropColumns<T>;
2781
- bodySize: Size;
2782
- focused: boolean;
2783
- ready: boolean;
2784
- columnReorderDragColumnId: false | string;
2785
- columnReorderInPageIndex: number | null;
2786
- columnVisibilityForGrouping: Record<string, false>;
2787
- focusedWithin: boolean;
2788
- scrollPosition: ScrollPosition;
2789
- pinnedStartScrollListener: ScrollListener;
2790
- pinnedEndScrollListener: ScrollListener;
2791
- editingCell: {
2792
- active: true;
2793
- accepted: false;
2794
- columnId: string;
2795
- value: any;
2796
- persisted: false;
2797
- initialValue: any;
2798
- rowIndex: number;
2799
- primaryKey: any;
2800
- } | null | {
2801
- active: false;
2802
- columnId: string;
2803
- rowIndex: number;
2804
- value: any;
2805
- initialValue: any;
2806
- primaryKey?: any;
2807
- waiting: 'accept' | 'persist' | false;
2808
- accepted: boolean | Error;
2809
- persisted: boolean | Error;
2810
- cancelled?: boolean;
2204
+ getConfig: GetRowSelectionStateConfig<T>;
2205
+ getGroupKeysForPrimaryKey(pk: any): any[];
2206
+ getGroupDeepMap(): DeepMap<any, DeepMapGroupValueType<T, any>> | undefined;
2207
+ getGroupCount(groupKeys: any[]): number;
2208
+ getGroupKeysDirectlyInsideGroup(groupKeys: any[]): any[][];
2209
+ getAllPrimaryKeysInsideGroup(groupKeys: any[]): any[];
2210
+ getGroupByLength(): number;
2211
+ static from<T>(rowSeleStateObject: RowSelectionStateObject, getConfig: GetRowSelectionStateConfig<T>, overrides?: RowSelectionStateOverride): RowSelectionState<T>;
2212
+ constructor(state: RowSelectionStateObject | RowSelectionState, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverride);
2213
+ mapSet: (name: "selected" | "deselected", key: any | any[]) => void;
2214
+ _selectedMapSet: (key: any | any[]) => void;
2215
+ _deselectedMapSet: (key: any | any[]) => void;
2216
+ update(stateObject: RowSelectionStateObject): void;
2217
+ private xcache;
2218
+ getState(): RowSelectionStateObject;
2219
+ deselectAll(): void;
2220
+ selectAll(): void;
2221
+ isRowDefaultSelected(): boolean;
2222
+ isRowDefaultDeselected(): boolean;
2223
+ /**
2224
+ *
2225
+ * @param key the id of the row - if a row in a grouped datasource, this is the final row id, without the group keys
2226
+ * @param groupKeys the keys of row parents, in order
2227
+ * @returns Whether the row is selected or not.
2228
+ */
2229
+ isRowSelected(key: any, groupKeys?: any[]): boolean;
2230
+ isRowDeselected(key: any, groupKeys?: any[]): boolean;
2231
+ setRowSelected(key: string | number, selected: boolean, groupKeys?: any[]): void;
2232
+ /**
2233
+ * Returns if the selection state ('full','partial','none') for the current group
2234
+ *
2235
+ * The selection state will be full (true) if either of those are true:
2236
+ * * the group keys are specified as selected
2237
+ * * all the children are specified as selected
2238
+ *
2239
+ * The selection state will be partial (null) if either of those are true:
2240
+ * * the group keys are partially selected
2241
+ * * some of the children are specified as selected
2242
+ *
2243
+ *
2244
+ * @param groupKeys the keys of the group row
2245
+ * @param children leaf children that belong to the group
2246
+ * @returns boolean
2247
+ */
2248
+ getGroupRowSelectionState(initialGroupKeys: any[]): boolean | null;
2249
+ private getGroupRowBooleanSelectionStateFromParent;
2250
+ isGroupRowPartlySelected(groupKeys: any[]): boolean;
2251
+ isGroupRowSelected(groupKeys: any[]): boolean;
2252
+ isGroupRowDeselected(groupKeys: any[]): boolean;
2253
+ selectGroupRow(groupKeys: any[]): void;
2254
+ deselectGroupRow(groupKeys: any[]): void;
2255
+ setRowAsSelected(key: string | number, groupKeys?: any[]): void;
2256
+ setRowAsDeselected(key: string | number, groupKeys?: any[]): void;
2257
+ deselectRow(key: any, groupKeys?: any[]): void;
2258
+ selectRow(key: any, groupKeys?: any[]): void;
2259
+ toggleGroupRowSelection(groupKeys: any[]): void;
2260
+ toggleRowSelection(key: string | number, groupKeys?: any[] | undefined): void;
2261
+ getSelectedCount(): number;
2262
+ getDeselectedCount(): number;
2263
+ getSelectionCountFor(groupKeys?: any[], parentSelected?: boolean): {
2264
+ selectedCount: number;
2265
+ deselectedCount: number;
2266
+ };
2267
+ }
2268
+
2269
+ type ArrayOfIds = Pick<InfiniteTable_RowInfoBase<any>, 'id'>[];
2270
+ type InfiniteTableRowSelectionApi = {
2271
+ get allRowsSelected(): boolean;
2272
+ isRowSelected(pk: any, groupKeys?: any[]): boolean;
2273
+ isRowDeselected(pk: any, groupKeys?: any[]): boolean;
2274
+ selectRow(pk: any, groupKeys?: any[]): void;
2275
+ deselectRow(pk: any, groupKeys?: any[]): void;
2276
+ toggleRowSelection(pk: any, groupKeys?: any[]): void;
2277
+ selectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
2278
+ deselectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
2279
+ toggleGroupRowSelection(groupKeys: any[], children?: ArrayOfIds): void;
2280
+ getGroupRowSelectionState(groupKeys: any[]): boolean | null;
2281
+ getSelectedPrimaryKeys(rowSelection?: RowSelectionStateObject): (string | number)[];
2282
+ selectAll(): void;
2283
+ deselectAll(): void;
2284
+ };
2285
+
2286
+ declare enum InfiniteTableActionType {
2287
+ SET_COLUMN_SIZE = 0,
2288
+ SET_SCROLL_POSITION = 1,
2289
+ SET_BODY_SIZE = 2,
2290
+ SET_COLUMN_ORDER = 3,
2291
+ SET_COLUMN_VISIBILITY = 4,
2292
+ SET_COLUMN_SHIFTS = 5,
2293
+ SET_COLUMN_PINNING = 6,
2294
+ SET_COLUMN_AGGREGATIONS = 7,
2295
+ SET_DRAGGING_COLUMN_ID = 8
2296
+ }
2297
+
2298
+ type InfiniteTableAction = {
2299
+ type: InfiniteTableActionType;
2300
+ payload?: any;
2301
+ };
2302
+
2303
+ declare class RowSizeCache {
2304
+ rowHeight: Map<number, number>;
2305
+ rowDetailHeight: Map<number, number>;
2306
+ getTotalRowHeight(index: number): number;
2307
+ getRowHeight: (index: number) => number;
2308
+ getRowDetailHeight: (index: number) => number;
2309
+ getSize(index: number): {
2310
+ rowHeight: number;
2311
+ rowDetailHeight: number;
2312
+ totalRowHeight: number;
2811
2313
  };
2812
2314
  }
2813
- type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
2814
- type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
2815
- type InfiniteTablePropPivotGrandTotalColumnPosition = InfiniteTablePropPivotTotalColumnPosition;
2816
- interface InfiniteTableMappedState<T> {
2817
- id: InfiniteTableProps<T>['id'];
2818
- debugId: InfiniteTableProps<T>['debugId'];
2819
- scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
2820
- multiSortBehavior: NonUndefined<InfiniteTableProps<T>['multiSortBehavior']>;
2821
- viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
2822
- resizableColumns: InfiniteTableProps<T>['resizableColumns'];
2823
- groupColumn: InfiniteTableProps<T>['groupColumn'];
2824
- onKeyDown: InfiniteTableProps<T>['onKeyDown'];
2825
- onCellClick: InfiniteTableProps<T>['onCellClick'];
2826
- onCellDoubleClick: InfiniteTableProps<T>['onCellDoubleClick'];
2827
- onRowMouseEnter: InfiniteTableProps<T>['onRowMouseEnter'];
2828
- onRowMouseLeave: InfiniteTableProps<T>['onRowMouseLeave'];
2829
- repeatWrappedGroupRows: InfiniteTableProps<T>['repeatWrappedGroupRows'];
2830
- wrapRowsHorizontally: InfiniteTableProps<T>['wrapRowsHorizontally'];
2831
- rowDetailCache: RowDetailCache<RowDetailCacheKey, RowDetailCacheEntry>;
2832
- headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
2833
- draggableColumnsRestrictTo: NonUndefined<InfiniteTableProps<T>['draggableColumnsRestrictTo']>;
2834
- onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
2835
- getContextMenuItems: InfiniteTableProps<T>['getContextMenuItems'];
2836
- getCellContextMenuItems: InfiniteTableProps<T>['getCellContextMenuItems'];
2837
- getColumnMenuItems: InfiniteTableProps<T>['getColumnMenuItems'];
2838
- getFilterOperatorMenuItems: InfiniteTableProps<T>['getFilterOperatorMenuItems'];
2839
- keyboardShortcuts: InfiniteTableProps<T>['keyboardShortcuts'];
2840
- columnPinning: InfiniteTablePropColumnPinning;
2841
- loadingText: InfiniteTableProps<T>['loadingText'];
2842
- components: InfiniteTableProps<T>['components'];
2843
- columns: InfiniteTablePropColumns<T>;
2844
- pivotColumns: InfiniteTableProps<T>['pivotColumns'];
2845
- onReady: InfiniteTableProps<T>['onReady'];
2846
- onContextMenu: InfiniteTableProps<T>['onContextMenu'];
2847
- onCellContextMenu: InfiniteTableProps<T>['onCellContextMenu'];
2848
- onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
2849
- onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
2850
- onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
2851
- onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
2852
- onEditCancelled: InfiniteTableProps<T>['onEditCancelled'];
2853
- onEditRejected: InfiniteTableProps<T>['onEditRejected'];
2854
- onEditAccepted: InfiniteTableProps<T>['onEditAccepted'];
2855
- shouldAcceptEdit: InfiniteTableProps<T>['shouldAcceptEdit'];
2856
- persistEdit: InfiniteTableProps<T>['persistEdit'];
2857
- onEditPersistSuccess: InfiniteTableProps<T>['onEditPersistSuccess'];
2858
- onEditPersistError: InfiniteTableProps<T>['onEditPersistError'];
2859
- autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
2860
- activeRowIndex: InfiniteTableProps<T>['activeRowIndex'];
2861
- activeCellIndex: InfiniteTableProps<T>['activeCellIndex'];
2862
- onRenderRangeChange: InfiniteTableProps<T>['onRenderRangeChange'];
2863
- scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
2864
- onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
2865
- onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
2866
- onScrollStop: InfiniteTableProps<T>['onScrollStop'];
2867
- scrollToBottomOffset: InfiniteTableProps<T>['scrollToBottomOffset'];
2868
- focusedClassName: InfiniteTableProps<T>['focusedClassName'];
2869
- focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
2870
- focusedStyle: InfiniteTableProps<T>['focusedStyle'];
2871
- focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
2872
- showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
2873
- domProps: InfiniteTableProps<T>['domProps'];
2874
- editable: InfiniteTableProps<T>['editable'];
2875
- columnMenuRealignDelay: NonUndefined<InfiniteTableProps<T>['columnMenuRealignDelay']>;
2876
- columnDefaultEditable: InfiniteTableProps<T>['columnDefaultEditable'];
2877
- columnDefaultFilterable: InfiniteTableProps<T>['columnDefaultFilterable'];
2878
- columnDefaultGroupable: InfiniteTableProps<T>['columnDefaultGroupable'];
2879
- columnDefaultSortable: InfiniteTableProps<T>['columnDefaultSortable'];
2880
- rowStyle: InfiniteTableProps<T>['rowStyle'];
2881
- cellStyle: InfiniteTableProps<T>['cellStyle'];
2882
- rowProps: InfiniteTableProps<T>['rowProps'];
2883
- rowClassName: InfiniteTableProps<T>['rowClassName'];
2884
- rowHoverClassName: InfiniteTableProps<T>['rowHoverClassName'];
2885
- cellClassName: InfiniteTableProps<T>['cellClassName'];
2886
- pinnedStartMaxWidth: InfiniteTableProps<T>['pinnedStartMaxWidth'];
2887
- pinnedEndMaxWidth: InfiniteTableProps<T>['pinnedEndMaxWidth'];
2888
- pivotColumn: InfiniteTableProps<T>['pivotColumn'];
2889
- pivotColumnGroups: InfiniteTablePropColumnGroups;
2890
- columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
2891
- columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
2892
- columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
2893
- columnDefaultFlex: InfiniteTableProps<T>['columnDefaultFlex'];
2894
- columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
2895
- draggableColumns: InfiniteTableProps<T>['draggableColumns'];
2896
- columnDefaultDraggable: InfiniteTableProps<T>['columnDefaultDraggable'];
2897
- sortable: InfiniteTableProps<T>['sortable'];
2898
- hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
2899
- hideColumnWhenGrouped: NonUndefined<InfiniteTableProps<T>['hideColumnWhenGrouped']>;
2900
- keyboardSelection: NonUndefined<InfiniteTableProps<T>['keyboardSelection']>;
2901
- columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
2902
- showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
2903
- showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
2904
- header: NonUndefined<InfiniteTableProps<T>['header']>;
2905
- virtualizeColumns: NonUndefined<InfiniteTableProps<T>['virtualizeColumns']>;
2906
- rowHeight: number | ((rowInfo: InfiniteTableRowInfo<T>) => number);
2907
- rowDetailHeight: number | ((rowInfo: InfiniteTableRowInfo<T>) => number);
2908
- columnHeaderHeight: number;
2909
- licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
2910
- columnVisibility: InfiniteTablePropColumnVisibility;
2911
- columnGroupVisibility: NonUndefined<InfiniteTableProps<T>['columnGroupVisibility']>;
2912
- columnSizing: InfiniteTablePropColumnSizing;
2913
- columnTypes: InfiniteTablePropColumnTypes<T>;
2914
- columnGroups: InfiniteTablePropColumnGroups;
2915
- collapsedColumnGroups: NonUndefined<InfiniteTableProps<T>['collapsedColumnGroups']>;
2916
- pivotTotalColumnPosition: NonUndefined<InfiniteTableProps<T>['pivotTotalColumnPosition']>;
2917
- pivotGrandTotalColumnPosition: InfiniteTableProps<T>['pivotGrandTotalColumnPosition'];
2315
+
2316
+ type MultiCellSelectorOptions = {
2317
+ getPrimaryKeyByIndex: (rowIndex: number) => string | number;
2318
+ getColumnIdByIndex: (colIndex: number) => string;
2319
+ };
2320
+ declare class MultiCellSelector {
2321
+ multiSelectStartPosition: CellPositionByIndex;
2322
+ multiSelectEndPosition?: CellPositionByIndex;
2323
+ getPrimaryKeyByIndex: MultiCellSelectorOptions['getPrimaryKeyByIndex'];
2324
+ getColumnIdByIndex: MultiCellSelectorOptions['getColumnIdByIndex'];
2325
+ _cellSelectionState: CellSelectionState;
2326
+ constructor(options: MultiCellSelectorOptions);
2327
+ private getCellSelectionPosition;
2328
+ set cellSelectionState(cellSelectionState: CellSelectionState);
2329
+ get cellSelectionState(): CellSelectionState;
2330
+ /**
2331
+ * This is the single click, without any modifier
2332
+ */
2333
+ resetClick(position: CellPositionByIndex): void;
2334
+ /**
2335
+ * This is the click with ctrl/cmd key pressed
2336
+ * @param position CellPosition
2337
+ */
2338
+ singleAddClick(position: CellPositionByIndex): void;
2339
+ multiSelectClick(position: CellPositionByIndex, options: MultiSelectRangeOptions): void;
2340
+ setRangeSelected(startPosition: CellPositionByIndex, endPosition: CellPositionByIndex, selected: boolean, options: MultiSelectRangeOptions): void;
2341
+ deselectRange(startPosition: CellPositionByIndex, endPosition: CellPositionByIndex, options: MultiSelectRangeOptions): void;
2342
+ selectRange(startPosition: CellPositionByIndex, endPosition: CellPositionByIndex, options: MultiSelectRangeOptions): void;
2918
2343
  }
2919
- interface InfiniteTableDerivedState<T> {
2920
- isTree: boolean;
2921
- groupBy: DataSourceProps<T>['groupBy'];
2922
- computedColumns: Record<string, InfiniteTableColumn<T>>;
2923
- initialColumns: InfiniteTableProps<T>['columns'];
2924
- rowDetailState: RowDetailState<T> | undefined;
2925
- isRowDetailExpanded: InfiniteTableProps<T>['isRowDetailExpanded'] | undefined;
2926
- rowDetailRenderer?: InfiniteTableProps<T>['rowDetailRenderer'];
2927
- isRowDetailEnabled: NonUndefined<InfiniteTableProps<T>['isRowDetailEnabled']> | boolean;
2928
- showColumnFilters: NonUndefined<InfiniteTableProps<T>['showColumnFilters']>;
2929
- groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
2930
- columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
2931
- keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>;
2932
- columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
2933
- columnGroupsMaxDepth: number;
2934
- computedColumnGroups: InfiniteTablePropColumnGroups;
2935
- rowHeightCSSVar: string;
2936
- rowDetailHeightCSSVar: string;
2937
- columnHeaderHeightCSSVar: string;
2938
- controlledColumnVisibility: boolean;
2344
+
2345
+ type MultiRowSelectorOptions = {
2346
+ getIdForIndex: (index: number) => string | number;
2347
+ isRowDisabledAt: (index: number) => boolean;
2348
+ };
2349
+ declare class MultiRowSelector {
2350
+ getIdForIndex: MultiRowSelectorOptions['getIdForIndex'];
2351
+ isRowDisabledAt: MultiRowSelectorOptions['isRowDisabledAt'];
2352
+ multiSelectStartIndex: number;
2353
+ multiSelectEndIndex?: number;
2354
+ _rowSelectionState: RowSelectionState;
2355
+ constructor(options: MultiRowSelectorOptions);
2356
+ set rowSelectionState(rowSelectionState: RowSelectionState);
2357
+ get rowSelectionState(): RowSelectionState;
2358
+ private selectRange;
2359
+ private deselectRange;
2360
+ /**
2361
+ * This is the single click, without any modifier
2362
+ */
2363
+ resetClick(index: number): void;
2364
+ /**
2365
+ * This is the click with ctrl/cmd key pressed
2366
+ * @param index
2367
+ */
2368
+ singleAddClick(index: number): void;
2369
+ multiSelectClick(index: number): void;
2939
2370
  }
2940
- type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
2941
- interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
2371
+
2372
+ interface InfiniteTableComputedValues<T> {
2373
+ scrollbars: {
2374
+ vertical: boolean;
2375
+ horizontal: boolean;
2376
+ };
2377
+ multiRowSelector: MultiRowSelector;
2378
+ multiCellSelector: MultiCellSelector;
2379
+ computedRowHeight: number | ((index: number) => number);
2380
+ computedRowSizeCacheForDetails: RowSizeCache | undefined;
2381
+ renderSelectionCheckBox: boolean;
2382
+ rowspan?: MatrixBrainOptions['rowspan'];
2383
+ computedPinnedStartOverflow: boolean;
2384
+ computedPinnedEndOverflow: boolean;
2385
+ computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
2386
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
2387
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
2388
+ computedVisibleColumns: InfiniteTableComputedColumn<T>[];
2389
+ computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
2390
+ computedColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
2391
+ computedColumnsMapInInitialOrder: Map<string, InfiniteTableComputedColumn<T>>;
2392
+ computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
2393
+ computedPinnedStartColumnsWidth: number;
2394
+ computedPinnedStartWidth: number;
2395
+ computedPinnedEndColumnsWidth: number;
2396
+ computedPinnedEndWidth: number;
2397
+ computedUnpinnedColumnsWidth: number;
2398
+ computedUnpinnedOffset: number;
2399
+ computedPinnedEndOffset: number;
2400
+ computedRemainingSpace: number;
2401
+ fieldsToColumn: Map<keyof T, InfiniteTableComputedColumn<T>>;
2402
+ toggleGroupRow: (groupKeys: any[]) => void;
2403
+ columnSize: (colIndex: number) => number;
2942
2404
  }
2943
2405
 
2944
- type CellPositionOptions = {
2406
+ type InfiniteTableEventHandlerContext<T> = {
2407
+ getComputed: () => InfiniteTableComputedValues<T>;
2408
+ getState: () => InfiniteTableState<T>;
2409
+ actions: InfiniteTableActions<T>;
2410
+ cloneRowSelection: (rowSelection: RowSelectionState<T>) => RowSelectionState<T>;
2411
+ cloneTreeSelection: (treeSelection: TreeSelectionState<T>) => TreeSelectionState<T>;
2412
+ getDataSourceState: () => DataSourceState<T>;
2413
+ getDataSourceMasterContext: () => DataSourceMasterDetailContextValue | undefined;
2414
+ dataSourceActions: DataSourceComponentActions<T>;
2415
+ api: InfiniteTableApi<T>;
2416
+ dataSourceApi: DataSourceApi<T>;
2417
+ };
2418
+ type InfiniteTableKeyboardEventHandlerContext<T> = InfiniteTableEventHandlerContext<T>;
2419
+ type InfiniteTableCellClickEventHandlerContext<T> = InfiniteTableEventHandlerContext<T> & {
2945
2420
  rowIndex: number;
2946
2421
  colIndex: number;
2947
- rowId?: never;
2948
- colId?: never;
2949
- } | {
2950
- rowIndex?: never;
2951
- colIndex?: never;
2952
- rowId: any;
2953
- colId: string;
2954
- } | {
2422
+ column: InfiniteTableComputedColumn<T>;
2423
+ columnApi: InfiniteTableColumnApi<T>;
2424
+ };
2425
+
2426
+ type OnCellClickContext<T> = InfiniteTableCellClickEventHandlerContext<T> & InfiniteTableKeyboardEventHandlerContext<T>;
2427
+
2428
+ interface InfiniteTableContextValue<T> {
2429
+ children?: React.ReactNode;
2430
+ api: InfiniteTableApi<T>;
2431
+ dataSourceApi: DataSourceApi<T>;
2432
+ state: InfiniteTableState<T>;
2433
+ actions: InfiniteTableActions<T>;
2434
+ dataSourceActions: DataSourceComponentActions<T>;
2435
+ computed: InfiniteTableComputedValues<T>;
2436
+ getComputed: () => InfiniteTableComputedValues<T>;
2437
+ getState: () => InfiniteTableState<T>;
2438
+ getDataSourceState: () => DataSourceState<T>;
2439
+ getDataSourceMasterContext: () => DataSourceMasterDetailContextValue | undefined;
2440
+ }
2441
+ interface InfiniteTablePublicContext<T> {
2442
+ api: InfiniteTableApi<T>;
2443
+ dataSourceApi: DataSourceApi<T>;
2444
+ getState: () => InfiniteTableState<T>;
2445
+ getDataSourceState: () => DataSourceState<T>;
2446
+ }
2447
+ type InfiniteTableRowContext<T> = InfiniteTablePublicContext<T> & InfiniteTableRowInfoDataDiscriminator<T> & {
2955
2448
  rowIndex: number;
2956
- colIndex?: never;
2957
- rowId?: never;
2958
- colId: string;
2959
- } | {
2960
- rowIndex?: never;
2961
- colIndex: number;
2962
- rowId: any;
2963
- colId?: never;
2964
2449
  };
2450
+ interface InfiniteTableCellContext<T> {
2451
+ rowIndex: OnCellClickContext<T>['rowIndex'];
2452
+ colIndex: OnCellClickContext<T>['colIndex'];
2453
+ column: InfiniteTableComputedColumn<T>;
2454
+ columnApi: InfiniteTableColumnApi<T>;
2455
+ }
2456
+
2457
+ type ValueGetterParams<T> = {
2458
+ data: T;
2459
+ field?: keyof T;
2460
+ };
2461
+ type GroupKeyType$1<T extends any = any> = T;
2462
+ type GroupByValueGetter<T> = (params: ValueGetterParams<T>) => any;
2463
+ type GroupBy<DataType, KeyType = any> = {
2464
+ toKey?: (value: any, data: DataType) => GroupKeyType$1<KeyType>;
2465
+ column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
2466
+ } & AllXOR<[
2467
+ {
2468
+ field: KeyOfNoSymbol<DataType>;
2469
+ },
2470
+ {
2471
+ valueGetter: GroupByValueGetter<DataType>;
2472
+ field: KeyOfNoSymbol<DataType>;
2473
+ },
2474
+ {
2475
+ valueGetter: GroupByValueGetter<DataType>;
2476
+ field?: KeyOfNoSymbol<DataType>;
2477
+ groupField: string;
2478
+ }
2479
+ ]>;
2480
+
2481
+ type SortDir = 1 | -1;
2482
+ type MultisortInfo<T> = {
2483
+ /**
2484
+ * The sorting direction
2485
+ */
2486
+ dir: SortDir;
2487
+ /**
2488
+ * for now 'string' and 'number' are known types, meaning they have
2489
+ * sort functions already implemented
2490
+ */
2491
+ type?: string | string[];
2492
+ fn?: (a: any, b: any) => number;
2493
+ /**
2494
+ * a property whose value to use for sorting on the array items
2495
+ */
2496
+ field?: keyof T;
2497
+ /**
2498
+ * or a function to retrieve the item value to use for sorting
2499
+ */
2500
+ valueGetter?: (item: T) => any;
2501
+ };
2502
+ type MultisortInfoAllowMultipleFields<T> = Omit<MultisortInfo<T>, 'field'> & {
2503
+ field?: keyof T | (keyof T | ((item: T) => any))[];
2504
+ };
2505
+ declare const multisort: {
2506
+ <T>(sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], options?: {
2507
+ marker?: PerfMarker;
2508
+ get?: (item: any) => T;
2509
+ } | ((item: any) => T)): T[];
2510
+ knownTypes: {
2511
+ [key: string]: (first: any, second: any) => number;
2512
+ };
2513
+ };
2514
+ type NestedMultiSortOptions<T> = {
2515
+ get?: (item: any) => T;
2516
+ nodesKey: string;
2517
+ isLeafNode?: (item: T) => boolean;
2518
+ getNodeChildren?: (item: T) => null | T[];
2519
+ toKey: (item: T) => any;
2520
+ depthFirst?: boolean;
2521
+ inplace?: boolean;
2522
+ marker?: PerfMarker;
2523
+ };
2524
+ declare const multisortNested: <T>(sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], options: NestedMultiSortOptions<T>) => T[];
2525
+
2526
+ type ForceOptions = {
2527
+ force?: boolean;
2528
+ };
2529
+ type TreeExpandStateApi<T> = {
2530
+ isNodeExpanded(nodePath: any[]): boolean;
2531
+ isNodeReadOnly(nodePath: any[]): boolean;
2532
+ expandNode(nodePath: any[], options?: ForceOptions): void;
2533
+ collapseNode(nodePath: any[], options?: ForceOptions): void;
2534
+ toggleNode(nodePath: any[], options?: ForceOptions): void;
2535
+ getNodeDataByPath(nodePath: any[]): T | null;
2536
+ getRowInfoByPath(nodePath: any[]): InfiniteTableRowInfo<T> | null;
2537
+ };
2538
+ type TreeSelectionApi<T = any> = {
2539
+ get allRowsSelected(): boolean;
2540
+ isNodeSelected(nodePath: NodePath$1): boolean | null;
2541
+ selectNode(nodePath: NodePath$1, options?: ForceOptions): void;
2542
+ setNodeSelection(nodePath: NodePath$1, selected: boolean, options?: ForceOptions): void;
2543
+ deselectNode(nodePath: NodePath$1, options?: ForceOptions): void;
2544
+ toggleNodeSelection(nodePath: NodePath$1, options?: ForceOptions): void;
2545
+ selectAll(): void;
2546
+ expandAll(): void;
2547
+ collapseAll(): void;
2548
+ deselectAll(): void;
2549
+ getSelectedLeafNodePaths(config?: {
2550
+ rootNodePath?: NodePath$1;
2551
+ treeSelectionState?: TreeSelectionState<T>;
2552
+ }): NodePath$1[];
2553
+ getDeselectedLeafNodePaths(config?: {
2554
+ rootNodePath?: NodePath$1;
2555
+ treeSelectionState?: TreeSelectionState<T>;
2556
+ }): NodePath$1[];
2557
+ getSelectedLeafRowInfos(config?: {
2558
+ rootNodePath?: NodePath$1;
2559
+ treeSelectionState?: TreeSelectionState<T>;
2560
+ }): InfiniteTable_Tree_RowInfoLeafNode<T>[];
2561
+ };
2562
+ type TreeApi<T> = TreeExpandStateApi<T> & TreeSelectionApi<T>;
2563
+
2564
+ type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
2565
+ type BooleanDeepCollectionStateObject<KeyType> = {
2566
+ positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
2567
+ negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
2568
+ };
2569
+ declare abstract class BooleanDeepCollectionState<StateObject, KeyType extends any = any> {
2570
+ protected positiveMap?: DeepMap<KeyType, true>;
2571
+ protected negativeMap?: DeepMap<KeyType, true>;
2572
+ protected allNegative: boolean;
2573
+ protected allPositive: boolean;
2574
+ private initialState;
2575
+ constructor(state: BooleanDeepCollectionStateObject<KeyType> | BooleanDeepCollectionState<StateObject, KeyType>);
2576
+ abstract getPositiveFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
2577
+ abstract getNegativeFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
2578
+ abstract getState(): StateObject;
2579
+ protected getInitialState(): BooleanDeepCollectionStateObject<KeyType>;
2580
+ destroy(): void;
2581
+ private update;
2582
+ protected areAllNegative(): boolean;
2583
+ protected areAllPositive(): boolean;
2584
+ protected makeAllNegative(): void;
2585
+ protected makeAllPositive(): void;
2586
+ protected isItemPositive(keys: KeyType[]): boolean | undefined;
2587
+ protected isItemNegative(keys: KeyType[]): boolean;
2588
+ protected setItemValue(keys: KeyType[], shouldMakePositive: boolean): void;
2589
+ protected makeItemNegative(keys: KeyType[]): void;
2590
+ protected makeItemPositive(keys: KeyType[]): void;
2591
+ protected toggleItem(keys: KeyType[]): void;
2592
+ }
2593
+
2594
+ declare class GroupRowsState<KeyType extends any = any> extends BooleanDeepCollectionState<DataSourcePropGroupRowsStateObject<KeyType>, KeyType> {
2595
+ constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
2596
+ getState(): DataSourcePropGroupRowsStateObject<KeyType>;
2597
+ getPositiveFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
2598
+ getNegativeFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
2599
+ areAllCollapsed(): boolean;
2600
+ areAllExpanded(): boolean;
2601
+ collapseAll(): void;
2602
+ expandAll(): void;
2603
+ isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
2604
+ isGroupRowCollapsed(keys: KeyType[]): boolean;
2605
+ setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
2606
+ collapseGroupRow(keys: KeyType[]): void;
2607
+ expandGroupRow(keys: KeyType[]): void;
2608
+ toggleGroupRow(keys: KeyType[]): void;
2609
+ }
2610
+
2611
+ type IndexerOptions<DataType, PrimaryKeyType> = {
2612
+ toPrimaryKey: (data: DataType) => PrimaryKeyType;
2613
+ cache?: DataSourceCache<DataType, PrimaryKeyType>;
2614
+ getNodeChildren?: TreeParams<DataType, PrimaryKeyType>['getNodeChildren'];
2615
+ isLeafNode?: TreeParams<DataType, PrimaryKeyType>['isLeafNode'];
2616
+ nodesKey: string | undefined;
2617
+ };
2618
+ declare class Indexer<DataType, PrimaryKeyType = string> {
2619
+ primaryKeyToData: Map<PrimaryKeyType, DataType>;
2620
+ nodePathsToData: DeepMap<PrimaryKeyType, DataType>;
2621
+ private removeNodePath;
2622
+ private remove;
2623
+ private add;
2624
+ private addNodePath;
2625
+ clear: () => void;
2626
+ getDataForPrimaryKey: (primaryKey: PrimaryKeyType) => DataType | undefined;
2627
+ getDataForNodePath: (nodePath: NodePath$1) => DataType | undefined;
2628
+ indexArray: (arr: DataType[], options: IndexerOptions<DataType, PrimaryKeyType>) => DataType[];
2629
+ }
2630
+
2631
+ declare class RowDisabledState<KeyType = any> extends BooleanCollectionState<RowDisabledStateObject<KeyType>, KeyType> {
2632
+ constructor(state: RowDisabledStateObject<KeyType> | RowDisabledState<KeyType>);
2633
+ getState(): RowDisabledStateObject<KeyType>;
2634
+ getPositiveFromState(state: RowDisabledStateObject<KeyType>): true | KeyType[];
2635
+ getNegativeFromState(state: RowDisabledStateObject<KeyType>): true | KeyType[];
2636
+ areAllDisabled(): boolean;
2637
+ areAllEnabled(): boolean;
2638
+ disableAll(): void;
2639
+ enableAll(): void;
2640
+ isRowEnabled: (key: KeyType) => boolean;
2641
+ isRowDisabled(key: KeyType): boolean;
2642
+ setRowEnabled(key: KeyType, enabled: boolean): void;
2643
+ disableRow(key: KeyType): void;
2644
+ enableRow(key: KeyType): void;
2645
+ toggleRow(key: KeyType): void;
2646
+ }
2965
2647
 
2966
- type InfiniteTableCellSelectionApi<T> = {
2967
- isCellSelected(cellPosition: CellPositionOptions): boolean;
2968
- selectCell(cellPosition: CellPositionOptions & {
2969
- clear?: boolean;
2970
- }): void;
2971
- deselectCell(cellPosition: CellPositionOptions): void;
2972
- deselectAll(): void;
2973
- clear(): void;
2974
- selectAll(): void;
2975
- selectColumn(colId: string, options?: {
2976
- clear?: boolean;
2977
- }): void;
2978
- deselectColumn(colId: string): void;
2979
- selectRange(start: CellPositionOptions, end: CellPositionOptions): void;
2980
- deselectRange(start: CellPositionOptions, end: CellPositionOptions): void;
2981
- getAllCellSelectionPositions(): {
2982
- columnIds: string[];
2983
- positions: (CellSelectionPosition | null)[][];
2984
- };
2985
- mapCellSelectionPositions<SELECTED_VALUE, EMPTY_VALUE>(fn: (rowInfo: InfiniteTableRowInfo<T>, colId: string) => SELECTED_VALUE, emptyValue: EMPTY_VALUE): {
2986
- columnIds: string[];
2987
- positions: (SELECTED_VALUE | EMPTY_VALUE)[][];
2988
- };
2648
+ interface DataSourceDataParams<T> {
2649
+ originalDataArray: T[];
2650
+ masterRowInfo?: InfiniteTableRowInfo<any>;
2651
+ sortInfo?: DataSourceSortInfo<T>;
2652
+ groupBy?: DataSourcePropGroupBy<T>;
2653
+ pivotBy?: DataSourcePropPivotBy<T>;
2654
+ filterValue?: DataSourcePropFilterValue<T>;
2655
+ refetchKey?: DataSourceProps<T>['refetchKey'];
2656
+ groupRowsState?: DataSourcePropGroupRowsStateObject<any>;
2657
+ lazyLoadBatchSize?: number;
2658
+ lazyLoadStartIndex?: number;
2659
+ groupKeys?: any[];
2660
+ append?: boolean;
2661
+ aggregationReducers?: DataSourcePropAggregationReducers<T>;
2662
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
2663
+ __cursorId?: DataSourceSetupState<T>['cursorId'];
2664
+ changes?: DataSourceDataParamsChanges<T>;
2665
+ }
2666
+ type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
2667
+ type DataSourceSingleSortInfo<T> = MultisortInfoAllowMultipleFields<T> & {
2668
+ id?: string;
2989
2669
  };
2990
-
2991
- type CellNavigationConfig = {
2992
- direction: 'top' | 'bottom' | 'left' | 'right';
2670
+ type DataSourceGroupBy<T> = GroupBy<T, any>;
2671
+ type DataSourcePivotBy<T> = PivotBy<T, any>;
2672
+ type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
2673
+ type DataSourcePropSortInfo<T> = DataSourceSortInfo<T>;
2674
+ type DataSourceRemoteData<T> = {
2675
+ data: T[] | LazyGroupDataItem<T>[];
2676
+ mappings?: DataSourceMappings;
2677
+ cache?: boolean;
2678
+ error?: string;
2679
+ totalCount?: number;
2680
+ totalCountUnfiltered?: number;
2681
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
2993
2682
  };
2994
- interface InfiniteTableKeyboardNavigationApi<T> {
2995
- setKeyboardNavigation: (keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>) => void;
2996
- setActiveCellIndex: (activeCellIndex: NonUndefined<InfiniteTableProps<T>['activeCellIndex']>) => void;
2997
- setActiveRowIndex: (activeRowIndex: NonUndefined<InfiniteTableProps<T>['activeRowIndex']>) => void;
2998
- gotoNextRow: () => number | false;
2999
- gotoPreviousRow: () => number | false;
3000
- gotoRow: (direction: 1 | -1) => number | false;
3001
- gotoCell: (config: CellNavigationConfig) => false | [number, number];
2683
+ type DataSourceDataFn<T> = (dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>;
2684
+ type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | DataSourceDataFn<T>;
2685
+ type DataSourceGroupRowsList<KeyType = any> = true | KeyType[][];
2686
+ type DataSourcePropGroupRowsStateObject<KeyType = any> = {
2687
+ expandedRows: DataSourceGroupRowsList<KeyType>;
2688
+ collapsedRows: DataSourceGroupRowsList<KeyType>;
2689
+ };
2690
+ type DataSourcePropGroupRowsState<KeyType = any> = GroupRowsState<KeyType> | DataSourcePropGroupRowsStateObject<KeyType>;
2691
+ type RowDetailStateObject<KeyType = any> = {
2692
+ expandedRows: true | KeyType[];
2693
+ collapsedRows: true | KeyType[];
2694
+ };
2695
+ type RowDisabledStateObject<KeyType = any> = {
2696
+ enabledRows: true;
2697
+ disabledRows: KeyType[];
2698
+ } | {
2699
+ disabledRows: true;
2700
+ enabledRows: KeyType[];
2701
+ };
2702
+ type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
2703
+ type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
2704
+ interface DataSourceMappedState<T> {
2705
+ aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
2706
+ livePagination: DataSourceProps<T>['livePagination'];
2707
+ refetchKey: NonUndefined<DataSourceProps<T>['refetchKey']>;
2708
+ isRowSelected: DataSourceProps<T>['isRowSelected'];
2709
+ isNodeSelected: TreeDataSourceProps<T>['isNodeSelected'];
2710
+ isNodeExpanded: TreeDataSourceProps<T>['isNodeExpanded'];
2711
+ isNodeCollapsed: TreeDataSourceProps<T>['isNodeCollapsed'];
2712
+ isNodeReadOnly: NonUndefined<TreeDataSourceProps<T>['isNodeReadOnly']>;
2713
+ isNodeSelectable: NonUndefined<TreeDataSourceProps<T>['isNodeSelectable']>;
2714
+ onNodeCollapse: TreeDataSourceProps<T>['onNodeCollapse'];
2715
+ onNodeExpand: TreeDataSourceProps<T>['onNodeExpand'];
2716
+ isRowDisabled: DataSourceProps<T>['isRowDisabled'];
2717
+ nodesKey: NonUndefined<TreeDataSourceProps<T>['nodesKey']>;
2718
+ treeSelection: TreeDataSourceProps<T>['treeSelection'];
2719
+ batchOperationDelay: DataSourceProps<T>['batchOperationDelay'];
2720
+ onDataArrayChange: DataSourceProps<T>['onDataArrayChange'];
2721
+ onDataMutations: DataSourceProps<T>['onDataMutations'];
2722
+ onTreeDataMutations: TreeDataSourceProps<T>['onTreeDataMutations'];
2723
+ onReady: DataSourceProps<T>['onReady'];
2724
+ rowInfoReducers: DataSourceProps<T>['rowInfoReducers'];
2725
+ lazyLoad: DataSourceProps<T>['lazyLoad'];
2726
+ useGroupKeysForMultiRowSelection: NonUndefined<DataSourceProps<T>['useGroupKeysForMultiRowSelection']>;
2727
+ onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
2728
+ data: DataSourceProps<T>['data'];
2729
+ sortFunction: DataSourceProps<T>['sortFunction'];
2730
+ filterFunction: DataSourceProps<T>['filterFunction'];
2731
+ treeFilterFunction: DataSourceProps<T>['treeFilterFunction'];
2732
+ filterValue: DataSourceProps<T>['filterValue'];
2733
+ filterTypes: NonUndefined<DataSourceProps<T>['filterTypes']>;
2734
+ primaryKey: DataSourceProps<T>['primaryKey'];
2735
+ filterDelay: NonUndefined<DataSourceProps<T>['filterDelay']>;
2736
+ groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
2737
+ pivotBy: DataSourceProps<T>['pivotBy'];
2738
+ loading: NonUndefined<DataSourceProps<T>['loading']>;
2739
+ sortTypes: NonUndefined<DataSourceProps<T>['sortTypes']>;
2740
+ collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
2741
+ sortInfo: DataSourceSingleSortInfo<T>[] | null;
2742
+ rowDisabledState: RowDisabledState<T> | null;
3002
2743
  }
3003
-
3004
- type InfiniteTableRowDetailApi = {
3005
- isRowDetailExpanded(pk: any): boolean;
3006
- isRowDetailCollapsed(pk: any): boolean;
3007
- expandRowDetail(pk: any): void;
3008
- collapseRowDetail(pk: any): void;
3009
- toggleRowDetail(pk: any): void;
3010
- collapseAllDetails(): void;
3011
- expandAllDetails(): void;
3012
- isRowDetailEnabledForRow(pk: any): boolean;
2744
+ type DataSourceRawReducer<T, RESULT_TYPE> = {
2745
+ initialValue?: RESULT_TYPE | (() => RESULT_TYPE);
2746
+ reducer: (accumulator: any, value: T) => RESULT_TYPE;
2747
+ done?: (accumulatedValue: RESULT_TYPE, array: T[]) => RESULT_TYPE;
3013
2748
  };
3014
-
3015
- type ArrayOfIds = Pick<InfiniteTable_RowInfoBase<any>, 'id'>[];
3016
- type InfiniteTableRowSelectionApi = {
3017
- get allRowsSelected(): boolean;
3018
- isRowSelected(pk: any, groupKeys?: any[]): boolean;
3019
- isRowDeselected(pk: any, groupKeys?: any[]): boolean;
3020
- selectRow(pk: any, groupKeys?: any[]): void;
3021
- deselectRow(pk: any, groupKeys?: any[]): void;
3022
- toggleRowSelection(pk: any, groupKeys?: any[]): void;
3023
- selectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
3024
- deselectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
3025
- toggleGroupRowSelection(groupKeys: any[], children?: ArrayOfIds): void;
3026
- getGroupRowSelectionState(groupKeys: any[]): boolean | null;
3027
- getSelectedPrimaryKeys(rowSelection?: RowSelectionStateObject): (string | number)[];
3028
- selectAll(): void;
3029
- deselectAll(): void;
2749
+ type DataSourceAggregationReducer<T, AggregationResultType> = {
2750
+ name?: string;
2751
+ field?: keyof T;
2752
+ initialValue?: AggregationResultType | (() => any);
2753
+ getter?: (data: T) => any;
2754
+ reducer: string | ((accumulator: any, value: any, data: T, index: number, groupKeys: any[] | undefined) => AggregationResultType | any);
2755
+ done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
2756
+ pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
2757
+ column: InfiniteTablePivotFinalColumnVariant<T>;
2758
+ }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
3030
2759
  };
3031
-
3032
- declare enum InfiniteTableActionType {
3033
- SET_COLUMN_SIZE = 0,
3034
- SET_SCROLL_POSITION = 1,
3035
- SET_BODY_SIZE = 2,
3036
- SET_COLUMN_ORDER = 3,
3037
- SET_COLUMN_VISIBILITY = 4,
3038
- SET_COLUMN_SHIFTS = 5,
3039
- SET_COLUMN_PINNING = 6,
3040
- SET_COLUMN_AGGREGATIONS = 7,
3041
- SET_DRAGGING_COLUMN_ID = 8
2760
+ type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
2761
+ inheritFromColumn?: string | boolean;
2762
+ };
2763
+ type DataSourceMappings = Record<'totals' | 'values', string>;
2764
+ type LazyGroupDataItem<DataType> = {
2765
+ data: Partial<DataType>;
2766
+ keys: any[];
2767
+ aggregations?: Record<string, any>;
2768
+ dataset?: DataSourceRemoteData<DataType>;
2769
+ totalChildrenCount?: number;
2770
+ pivot?: {
2771
+ values: Record<string, any>;
2772
+ totals?: Record<string, any>;
2773
+ };
2774
+ };
2775
+ type LazyRowInfoGroup<DataType> = {
2776
+ /**
2777
+ * Those are direct children of the current lazy group row
2778
+ */
2779
+ children: LazyGroupDataItem<DataType>[];
2780
+ childrenLoading: boolean;
2781
+ childrenAvailable: boolean;
2782
+ cache: boolean;
2783
+ totalCount: number;
2784
+ totalCountUnfiltered: number;
2785
+ error?: string;
2786
+ };
2787
+ type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
2788
+ type DebugTimingKey = 'group-and-pivot' | 'filter' | 'sort' | 'pivot' | 'tree';
2789
+ interface DataSourceSetupState<T> {
2790
+ logger: DebugLogger;
2791
+ forceRerenderTimestamp: number;
2792
+ devToolsDetected: boolean;
2793
+ rowInfoStore: RowInfoStore<T>;
2794
+ debugTimings: Map<DebugTimingKey, number>;
2795
+ debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
2796
+ indexer: Indexer<T, any>;
2797
+ getDataSourceMasterContextRef: React$1.MutableRefObject<() => DataSourceMasterDetailContextValue | undefined>;
2798
+ __apiRef: React$1.MutableRefObject<DataSourceApi<T> | null>;
2799
+ lastSelectionUpdatedNodePathRef: React$1.MutableRefObject<{
2800
+ nodePath: NodePath$1;
2801
+ selected: boolean;
2802
+ } | null>;
2803
+ lastExpandStateInfoRef: React$1.MutableRefObject<{
2804
+ state: 'collapsed' | 'expanded';
2805
+ nodePath: NodePath$1 | null;
2806
+ }>;
2807
+ waitForNodePathPromises: DeepMap<any, {
2808
+ timestamp: number;
2809
+ promise: Promise<boolean>;
2810
+ resolve: (value: boolean) => void;
2811
+ }>;
2812
+ repeatWrappedGroupRows: InfiniteTablePropRepeatWrappedGroupRows<T>;
2813
+ /**
2814
+ * This is just used for horizontal layout and when repeatWrappedGroupRows is TRUE!!!
2815
+ */
2816
+ rowsPerPage: number | null;
2817
+ totalLeafNodesCount: number;
2818
+ destroyedRef: React$1.MutableRefObject<boolean>;
2819
+ idToIndexMap: Map<any, number>;
2820
+ idToPathMap: Map<any, NodePath$1>;
2821
+ pathToIndexMap: DeepMap<any, number>;
2822
+ detailDataSourcesStateToRestore: Map<any, Partial<DataSourceStateRestoreForDetail<any>>>;
2823
+ treeSelectionState?: TreeSelectionState;
2824
+ stateReadyAsDetails: boolean;
2825
+ cache?: DataSourceCache<T>;
2826
+ unfilteredCount: number;
2827
+ filteredCount: number;
2828
+ rowInfoReducerResults?: Record<string, any>;
2829
+ originalDataArrayChanged: boolean;
2830
+ originalDataArrayChangedInfo: {
2831
+ timestamp: number;
2832
+ mutations?: Map<string, DataSourceMutation<T>[]>;
2833
+ treeMutations?: DeepMap<any, DataSourceMutation<T>[]>;
2834
+ };
2835
+ lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
2836
+ pivotMappings?: DataSourceMappings;
2837
+ propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
2838
+ showSeparatePivotColumnForSingleAggregation: boolean;
2839
+ dataParams?: DataSourceDataParams<T>;
2840
+ originalLazyGroupData: LazyGroupDataDeepMap<T>;
2841
+ originalLazyGroupDataChangeDetect: number | string;
2842
+ scrollStopDelayUpdatedByTable: number;
2843
+ onCleanup: SubscriptionCallback<DataSourceState<T>>;
2844
+ notifyScrollbarsChange: SubscriptionCallback<Scrollbars>;
2845
+ notifyScrollStop: SubscriptionCallback<ScrollStopInfo>;
2846
+ notifyRenderRangeChange: SubscriptionCallback<RenderRange>;
2847
+ originalDataArray: T[];
2848
+ lastFilterDataArray?: T[];
2849
+ lastSortDataArray?: T[];
2850
+ lastGroupDataArray?: InfiniteTableRowInfo<T>[];
2851
+ lastTreeDataArray?: InfiniteTableRowInfo<T>[];
2852
+ dataArray: InfiniteTableRowInfo<T>[];
2853
+ groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
2854
+ treeDeepMap?: DeepMap<TreeKeyType, DeepMapTreeValueType<T, any>>;
2855
+ treePaths?: DeepMap<TreeKeyType, true>;
2856
+ unfilteredTreePaths?: DeepMap<TreeKeyType, true>;
2857
+ groupRowsIndexesInDataArray?: number[];
2858
+ reducerResults?: Record<string, AggregationReducerResult>;
2859
+ allRowsSelected: boolean;
2860
+ someRowsSelected: boolean;
2861
+ pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
2862
+ pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
2863
+ cursorId: number | symbol | DataSourceLivePaginationCursorValue;
2864
+ updatedAt: number;
2865
+ reducedAt: number;
2866
+ groupedAt: number;
2867
+ treeAt: number;
2868
+ sortedAt: number;
2869
+ filteredAt: number;
2870
+ generateGroupRows: boolean;
2871
+ postFilterDataArray?: T[];
2872
+ postSortDataArray?: T[];
2873
+ postGroupDataArray?: InfiniteTableRowInfo<T>[];
2874
+ pivotColumns?: Record<string, InfiniteTableColumn<T>>;
2875
+ pivotColumnGroups?: Record<string, InfiniteTableColumnGroup>;
3042
2876
  }
2877
+ type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
2878
+ type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
2879
+ type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
2880
+ type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
2881
+ type TreeSelectionValue = TreeSelectionStateObject | TreeSelectionState;
3043
2882
 
3044
- type InfiniteTableAction = {
3045
- type: InfiniteTableActionType;
3046
- payload?: any;
2883
+ type DataSourcePropTreeSelection_MultiNode = TreeSelectionValue;
2884
+ type DataSourcePropRowSelection_SingleRow = null | string | number;
2885
+ type DataSourcePropTreeSelection_SingleNode = null | string | number;
2886
+ type DataSourcePropTreeSelection = DataSourcePropTreeSelection_MultiNode | DataSourcePropTreeSelection_SingleNode;
2887
+ type DataSourcePropCellSelection_MultiCell = CellSelectionStateObject | CellSelectionState;
2888
+ type DataSourcePropCellSelection_SingleCell = null | CellSelectionPosition;
2889
+ type DataSourcePropCellSelection = DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
2890
+ type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
2891
+ type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
2892
+ type DataSourcePropOnTreeSelectionChange_MultiNode<T = any> = (treeSelectionStateObject: TreeSelectionStateObject, params: {
2893
+ treeSelectionState: TreeSelectionState<T>;
2894
+ prevTreeSelectionState: TreeSelectionState<T>;
2895
+ unfilteredTreePaths: DeepMap<TreeKeyType, true>;
2896
+ selectionMode: 'multi-row';
2897
+ lastUpdatedNodeInfo: {
2898
+ nodePath: NodePath$1;
2899
+ selected: boolean;
2900
+ } | null;
2901
+ dataSourceApi: DataSourceApi<T>;
2902
+ treeApi: TreeApi<T>;
2903
+ }) => void;
2904
+ type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
2905
+ type DataSourcePropOnTreeSelectionChange_SingleNode = (treeSelection: DataSourcePropTreeSelection_SingleNode, params: {
2906
+ selectionMode: 'single-row';
2907
+ }) => void;
2908
+ type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
2909
+ type DataSourcePropOnTreeSelectionChange = DataSourcePropOnTreeSelectionChange_SingleNode | DataSourcePropOnTreeSelectionChange_MultiNode;
2910
+ type DataSourcePropOnCellSelectionChange_MultiCell = (cellSelection: DataSourcePropCellSelection_MultiCell, selectionMode: 'multi-cell') => void;
2911
+ type DataSourcePropOnCellSelectionChange_SingleCell = (cellSelection: DataSourcePropCellSelection_SingleCell, selectionMode: 'single-cell') => void;
2912
+ type DataSourcePropOnCellSelectionChange = DataSourcePropOnCellSelectionChange_MultiCell | DataSourcePropOnCellSelectionChange_SingleCell;
2913
+ type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelectionState: RowSelectionState, selectionMode: 'multi-row') => boolean | null;
2914
+ type DataSourcePropIsNodeReadOnly<T> = (rowInfo: InfiniteTable_Tree_RowInfoParentNode<T>) => boolean;
2915
+ type DataSourcePropIsNodeSelected<T> = (rowInfo: InfiniteTable_Tree_RowInfoNode<T>, treeSelectionState: TreeSelectionState, selectionMode: 'multi-row') => boolean | null;
2916
+ type DataSourcePropIsNodeSelectable<T> = (rowInfo: InfiniteTable_Tree_RowInfoNode<T>) => boolean;
2917
+ type DataSourcePropIsNodeExpanded<T> = (rowInfo: InfiniteTable_Tree_RowInfoParentNode<T>, treeExpandState: TreeExpandState) => boolean;
2918
+ type DataSourcePropSortFn<T> = (sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], get?: (item: any) => T) => T[];
2919
+ type DataSourceCRUDParam = {
2920
+ flush?: boolean;
2921
+ metadata?: any;
3047
2922
  };
3048
-
3049
- declare class RowSizeCache {
3050
- rowHeight: Map<number, number>;
3051
- rowDetailHeight: Map<number, number>;
3052
- getTotalRowHeight(index: number): number;
3053
- getRowHeight: (index: number) => number;
3054
- getRowDetailHeight: (index: number) => number;
3055
- getSize(index: number): {
3056
- rowHeight: number;
3057
- rowDetailHeight: number;
3058
- totalRowHeight: number;
3059
- };
2923
+ type WaitForNodeOptions = {
2924
+ waitForNode?: boolean | number;
2925
+ };
2926
+ type DataSourceUpdateParam = DataSourceCRUDParam & WaitForNodeOptions;
2927
+ type DataSourceInsertParam = DataSourceCRUDParam & WaitForNodeOptions & ({
2928
+ position: 'before' | 'after';
2929
+ primaryKey: any;
2930
+ nodePath?: never;
2931
+ } | {
2932
+ position: 'before' | 'after';
2933
+ primaryKey?: never;
2934
+ nodePath: NodePath$1;
2935
+ } | {
2936
+ position: 'start' | 'end';
2937
+ nodePath?: never;
2938
+ } | {
2939
+ position: 'start' | 'end';
2940
+ nodePath: NodePath$1;
2941
+ });
2942
+ type UpdateChildrenFn<T> = (dataChildren: T[] | undefined | null, data: T) => T[] | undefined | null;
2943
+ interface DataSourceApi<T> {
2944
+ getPendingOperationPromise(): Promise<boolean> | null;
2945
+ getOriginalDataArray: () => T[];
2946
+ getRowInfoArray: () => InfiniteTableRowInfo<T>[];
2947
+ getDataByPrimaryKey(id: any): T | null;
2948
+ getDataByNodePath(nodePath: NodePath$1): T | null;
2949
+ getDataByIndex(index: number): T | null;
2950
+ getRowInfoByIndex(index: number): InfiniteTableRowInfo<T> | null;
2951
+ getRowInfoByPrimaryKey(id: any): InfiniteTableRowInfo<T> | null;
2952
+ getRowInfoByNodePath(nodePath: NodePath$1): InfiniteTableRowInfo<T> | null;
2953
+ getIndexByPrimaryKey(id: any): number;
2954
+ getIndexByNodePath(nodePath: NodePath$1): number;
2955
+ getPrimaryKeyByIndex(id: any): any;
2956
+ getNodePathById(id: any): NodePath$1 | null;
2957
+ getNodePathByIndex(index: number): NodePath$1 | null;
2958
+ get treeApi(): TreeApi<T>;
2959
+ /**
2960
+ * @param nodePath The node path to wait for
2961
+ * @param options
2962
+ * @param options.timeout The timeout to wait for the node path to be available. Defaults to 1000ms.
2963
+ *
2964
+ * @returns true if the path is already in the DataSource, otherwise a promise resolving to a boolean value.
2965
+ * If the timeout is reached and the path is not available, the promise is resolved to false. Otherwise, the promise is resolved to true.
2966
+ */
2967
+ waitForNodePath(nodePath: NodePath$1, options?: {
2968
+ timeout?: number;
2969
+ }): Promise<boolean>;
2970
+ isNodePathAvailable(nodePath: NodePath$1): boolean;
2971
+ updateData(data: Partial<T>, options?: DataSourceCRUDParam): Promise<any>;
2972
+ updateDataByNodePath(data: Partial<T>, nodePath: NodePath$1, options?: DataSourceUpdateParam): Promise<any>;
2973
+ updateChildrenByNodePath(childrenOrFn: T[] | undefined | null | UpdateChildrenFn<T>, nodePath: NodePath$1, options?: DataSourceUpdateParam): Promise<any>;
2974
+ updateDataArray(data: Partial<T>[], options?: DataSourceCRUDParam): Promise<any>;
2975
+ updateDataArrayByNodePath(updateInfo: {
2976
+ data: Partial<T>;
2977
+ nodePath: NodePath$1;
2978
+ }[], options?: DataSourceUpdateParam): Promise<any>;
2979
+ flush(): Promise<any>;
2980
+ removeDataByPrimaryKey(id: any, options?: DataSourceCRUDParam): Promise<any>;
2981
+ removeDataByNodePath(nodePath: NodePath$1, options?: DataSourceCRUDParam): Promise<any>;
2982
+ removeDataArrayByPrimaryKeys(id: any[], options?: DataSourceCRUDParam): Promise<any>;
2983
+ removeData(data: Partial<T>, options?: DataSourceCRUDParam): Promise<any>;
2984
+ removeDataArray(data: Partial<T>[], options?: DataSourceCRUDParam): Promise<any>;
2985
+ clearAllData(options?: DataSourceCRUDParam): Promise<any>;
2986
+ replaceAllData(data: T[], options?: DataSourceCRUDParam): Promise<any>;
2987
+ addData(data: T, options?: DataSourceCRUDParam): Promise<any>;
2988
+ addDataArray(data: T[], options?: DataSourceCRUDParam): Promise<any>;
2989
+ insertData(data: T, options: DataSourceInsertParam): Promise<any>;
2990
+ insertDataArray(data: T[], options: DataSourceInsertParam): Promise<any>;
2991
+ setSortInfo(sortInfo: null | DataSourceSingleSortInfo<T>[]): void;
2992
+ isRowDisabledAt: (rowIndex: number) => boolean;
2993
+ isRowDisabled: (primaryKey: any) => boolean;
2994
+ setRowEnabledAt: (rowIndex: number, enabled: boolean) => void;
2995
+ setRowEnabled: (primaryKey: any, enabled: boolean) => void;
2996
+ enableAllRows: () => void;
2997
+ disableAllRows: () => void;
2998
+ areAllRowsEnabled: () => boolean;
2999
+ areAllRowsDisabled: () => boolean;
3000
+ setGroupBy: (groupBy: DataSourceState<T>['groupBy']) => void;
3001
+ toggleGroupByField: (field: keyof T) => void;
3060
3002
  }
3061
-
3062
- type MultiCellSelectorOptions = {
3063
- getPrimaryKeyByIndex: (rowIndex: number) => string | number;
3064
- getColumnIdByIndex: (colIndex: number) => string;
3003
+ type DataSourcePropRowInfoReducers<T> = Record<string, DataSourceRowInfoReducer<T>>;
3004
+ type DataSourceRowInfoReducer<T> = DataSourceRawReducer<InfiniteTableRowInfo<T>, any>;
3005
+ type DataSourcePropShouldReloadDataObject<T> = {
3006
+ [key in keyof Pick<DataSourceDataParams<T>, 'sortInfo' | 'pivotBy' | 'groupBy' | 'filterValue'>]: boolean;
3065
3007
  };
3066
- declare class MultiCellSelector {
3067
- multiSelectStartPosition: CellPositionByIndex;
3068
- multiSelectEndPosition?: CellPositionByIndex;
3069
- getPrimaryKeyByIndex: MultiCellSelectorOptions['getPrimaryKeyByIndex'];
3070
- getColumnIdByIndex: MultiCellSelectorOptions['getColumnIdByIndex'];
3071
- _cellSelectionState: CellSelectionState;
3072
- constructor(options: MultiCellSelectorOptions);
3073
- private getCellSelectionPosition;
3074
- set cellSelectionState(cellSelectionState: CellSelectionState);
3075
- get cellSelectionState(): CellSelectionState;
3008
+ type DataSourcePropShouldReloadData<T> = DataSourcePropShouldReloadDataObject<T> | boolean;
3009
+ type TreeExpandStateValue = TreeExpandState | TreeExpandStateObject<any>;
3010
+ type DataSourceProps<T> = {
3011
+ nodesKey?: never;
3012
+ debugId?: string;
3013
+ children?: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
3014
+ primaryKey: keyof T | ((data: T) => string);
3076
3015
  /**
3077
- * This is the single click, without any modifier
3016
+ * @deprecated for now
3078
3017
  */
3079
- resetClick(position: CellPositionByIndex): void;
3018
+ fields?: (keyof T)[];
3019
+ refetchKey?: number | string | object;
3020
+ batchOperationDelay?: number;
3021
+ rowInfoReducers?: DataSourcePropRowInfoReducers<T>;
3022
+ data: DataSourceData<T>;
3023
+ selectionMode?: DataSourcePropSelectionMode;
3024
+ useGroupKeysForMultiRowSelection?: boolean;
3025
+ rowSelection?: DataSourcePropRowSelection;
3026
+ defaultRowSelection?: DataSourcePropRowSelection;
3027
+ cellSelection?: DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
3028
+ defaultCellSelection?: DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
3029
+ onCellSelectionChange?: DataSourcePropOnCellSelectionChange;
3030
+ rowDisabledState?: RowDisabledState | RowDisabledStateObject<any>;
3031
+ defaultRowDisabledState?: RowDisabledState | RowDisabledStateObject<any>;
3032
+ onRowDisabledStateChange?: (rowDisabledState: RowDisabledState) => void;
3033
+ isRowDisabled?: (rowInfo: InfiniteTableRowInfo<T>) => boolean;
3034
+ isRowSelected?: DataSourcePropIsRowSelected<T>;
3035
+ lazyLoad?: boolean | {
3036
+ batchSize?: number;
3037
+ };
3038
+ loading?: boolean;
3039
+ defaultLoading?: boolean;
3040
+ onLoadingChange?: (loading: boolean) => void;
3041
+ onReady?: (api: DataSourceApi<T>) => void;
3042
+ pivotBy?: DataSourcePropPivotBy<T>;
3043
+ defaultPivotBy?: DataSourcePropPivotBy<T>;
3044
+ onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
3045
+ aggregationReducers?: DataSourcePropAggregationReducers<T>;
3046
+ defaultAggregationReducers?: DataSourcePropAggregationReducers<T>;
3047
+ groupBy?: DataSourcePropGroupBy<T>;
3048
+ defaultGroupBy?: DataSourcePropGroupBy<T>;
3049
+ onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
3050
+ groupRowsState?: DataSourcePropGroupRowsState<any>;
3051
+ defaultGroupRowsState?: DataSourcePropGroupRowsState<any>;
3052
+ onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
3053
+ collapseGroupRowsOnDataFunctionChange?: boolean;
3054
+ sortFunction?: DataSourcePropSortFn<T>;
3055
+ sortInfo?: DataSourceSortInfo<T>;
3056
+ defaultSortInfo?: DataSourceSortInfo<T>;
3057
+ onSortInfoChange?: ((sortInfo: DataSourceSingleSortInfo<T> | null) => void) | ((sortInfo: DataSourceSingleSortInfo<T>[]) => void);
3058
+ onDataParamsChange?: (dataParamsChange: DataSourceDataParams<T>) => void;
3059
+ onDataArrayChange?: (dataArray: DataSourceState<T>['originalDataArray'], info: DataSourceState<T>['originalDataArrayChangedInfo']) => void;
3060
+ onDataMutations?: ({ dataArray, timestamp, mutations, primaryKeyField, }: {
3061
+ primaryKeyField: undefined | keyof T;
3062
+ dataArray: DataSourceState<T>['originalDataArray'];
3063
+ timestamp: number;
3064
+ mutations: NonUndefined<DataSourceState<T>['originalDataArrayChangedInfo']['mutations']>;
3065
+ }) => void;
3066
+ livePagination?: boolean;
3067
+ livePaginationCursor?: DataSourcePropLivePaginationCursor<T>;
3068
+ onLivePaginationCursorChange?: (livePaginationCursor: DataSourceLivePaginationCursorValue) => void;
3069
+ filterFunction?: DataSourcePropFilterFunction<T>;
3070
+ treeFilterFunction?: DataSourcePropTreeFilterFunction<T>;
3080
3071
  /**
3081
- * This is the click with ctrl/cmd key pressed
3082
- * @param position CellPosition
3072
+ * @deprecated Use shouldReloadData.sortInfo instead
3083
3073
  */
3084
- singleAddClick(position: CellPositionByIndex): void;
3085
- multiSelectClick(position: CellPositionByIndex, options: MultiSelectRangeOptions): void;
3086
- setRangeSelected(startPosition: CellPositionByIndex, endPosition: CellPositionByIndex, selected: boolean, options: MultiSelectRangeOptions): void;
3087
- deselectRange(startPosition: CellPositionByIndex, endPosition: CellPositionByIndex, options: MultiSelectRangeOptions): void;
3088
- selectRange(startPosition: CellPositionByIndex, endPosition: CellPositionByIndex, options: MultiSelectRangeOptions): void;
3089
- }
3090
-
3091
- type MultiRowSelectorOptions = {
3092
- getIdForIndex: (index: number) => string | number;
3093
- isRowDisabledAt: (index: number) => boolean;
3094
- };
3095
- declare class MultiRowSelector {
3096
- getIdForIndex: MultiRowSelectorOptions['getIdForIndex'];
3097
- isRowDisabledAt: MultiRowSelectorOptions['isRowDisabledAt'];
3098
- multiSelectStartIndex: number;
3099
- multiSelectEndIndex?: number;
3100
- _rowSelectionState: RowSelectionState;
3101
- constructor(options: MultiRowSelectorOptions);
3102
- set rowSelectionState(rowSelectionState: RowSelectionState);
3103
- get rowSelectionState(): RowSelectionState;
3104
- private selectRange;
3105
- private deselectRange;
3074
+ sortMode?: 'local' | 'remote';
3106
3075
  /**
3107
- * This is the single click, without any modifier
3076
+ * @deprecated Use shouldReloadData.filterValue instead
3108
3077
  */
3109
- resetClick(index: number): void;
3078
+ filterMode?: 'local' | 'remote';
3110
3079
  /**
3111
- * This is the click with ctrl/cmd key pressed
3112
- * @param index
3080
+ * @deprecated Use shouldReloadData.groupBy instead
3113
3081
  */
3114
- singleAddClick(index: number): void;
3115
- multiSelectClick(index: number): void;
3116
- }
3117
-
3118
- interface InfiniteTableComputedValues<T> {
3119
- scrollbars: {
3120
- vertical: boolean;
3121
- horizontal: boolean;
3082
+ groupMode?: 'local' | 'remote';
3083
+ shouldReloadData?: DataSourcePropShouldReloadData<T>;
3084
+ filterValue?: DataSourcePropFilterValue<T>;
3085
+ defaultFilterValue?: DataSourcePropFilterValue<T>;
3086
+ onFilterValueChange?: (filterValue: DataSourcePropFilterValue<T>) => void;
3087
+ filterDelay?: number;
3088
+ filterTypes?: DataSourcePropFilterTypes<T>;
3089
+ sortTypes?: DataSourcePropSortTypes;
3090
+ } & ({
3091
+ selectionMode?: 'multi-row';
3092
+ rowSelection?: DataSourcePropRowSelection_MultiRow;
3093
+ defaultRowSelection?: DataSourcePropRowSelection_MultiRow;
3094
+ onRowSelectionChange?: DataSourcePropOnRowSelectionChange_MultiRow;
3095
+ } | {
3096
+ selectionMode?: 'single-row';
3097
+ rowSelection?: DataSourcePropRowSelection_SingleRow;
3098
+ defaultRowSelection?: DataSourcePropRowSelection_SingleRow;
3099
+ onRowSelectionChange?: DataSourcePropOnRowSelectionChange_SingleRow;
3100
+ } | {
3101
+ selectionMode?: 'single-cell';
3102
+ cellSelection?: DataSourcePropCellSelection_SingleCell;
3103
+ defaultCellSelection?: DataSourcePropCellSelection_SingleCell;
3104
+ onCellSelectionChange?: DataSourcePropOnCellSelectionChange_SingleCell;
3105
+ } | {
3106
+ selectionMode?: 'multi-cell';
3107
+ cellSelection?: DataSourcePropCellSelection_MultiCell;
3108
+ defaultCellSelection?: DataSourcePropCellSelection_MultiCell;
3109
+ onCellSelectionChange?: DataSourcePropOnCellSelectionChange_MultiCell;
3110
+ } | {
3111
+ selectionMode?: false;
3112
+ });
3113
+ /**
3114
+ * @deprecated Use DataSourceProps<T> instead
3115
+ */
3116
+ type DataSourcePropsWithChildren<T> = DataSourceProps<T> & {};
3117
+ type DataSourcePropSortTypes = Record<string, (first: any, second: any) => number>;
3118
+ type DataSourcePropFilterTypes<T> = Record<string, DataSourceFilterType<T>>;
3119
+ type DataSourceFilterFunctionParam<T> = {
3120
+ data: T;
3121
+ index: number;
3122
+ dataArray: T[];
3123
+ primaryKey: any;
3124
+ };
3125
+ type DataSourcePropFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T>) => boolean;
3126
+ type DataSourcePropTreeFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T> & {
3127
+ filterTreeNode: (data: T) => T | boolean;
3128
+ }) => T | boolean;
3129
+ type DataSourcePropFilterValue<T> = DataSourceFilterValueItem<T>[];
3130
+ type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
3131
+ field: keyof T;
3132
+ }, {
3133
+ id: string;
3134
+ }> & {
3135
+ valueGetter?: DataSourceFilterValueItemValueGetter<T>;
3136
+ filter: {
3137
+ type: string;
3138
+ operator: string;
3139
+ value: any;
3122
3140
  };
3123
- multiRowSelector: MultiRowSelector;
3124
- multiCellSelector: MultiCellSelector;
3125
- computedRowHeight: number | ((index: number) => number);
3126
- computedRowSizeCacheForDetails: RowSizeCache | undefined;
3127
- renderSelectionCheckBox: boolean;
3128
- rowspan?: MatrixBrainOptions['rowspan'];
3129
- computedPinnedStartOverflow: boolean;
3130
- computedPinnedEndOverflow: boolean;
3131
- computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
3132
- computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
3133
- computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
3134
- computedVisibleColumns: InfiniteTableComputedColumn<T>[];
3135
- computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
3136
- computedColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
3137
- computedColumnsMapInInitialOrder: Map<string, InfiniteTableComputedColumn<T>>;
3138
- computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
3139
- computedPinnedStartColumnsWidth: number;
3140
- computedPinnedStartWidth: number;
3141
- computedPinnedEndColumnsWidth: number;
3142
- computedPinnedEndWidth: number;
3143
- computedUnpinnedColumnsWidth: number;
3144
- computedUnpinnedOffset: number;
3145
- computedPinnedEndOffset: number;
3146
- computedRemainingSpace: number;
3147
- fieldsToColumn: Map<keyof T, InfiniteTableComputedColumn<T>>;
3148
- toggleGroupRow: (groupKeys: any[]) => void;
3149
- columnSize: (colIndex: number) => number;
3141
+ disabled?: boolean;
3142
+ };
3143
+ type DataSourceFilterValueItemValueGetter<T> = (param: DataSourceFilterFunctionParam<T> & {
3144
+ field?: keyof T;
3145
+ }) => any;
3146
+ type DataSourceFilterType<T> = {
3147
+ emptyValues: any[];
3148
+ label?: string;
3149
+ defaultOperator: string;
3150
+ valueGetter?: DataSourceFilterValueItemValueGetter<T>;
3151
+ components?: {
3152
+ FilterEditor?: () => React$1.JSX.Element | null;
3153
+ FilterOperatorSwitch?: () => React$1.JSX.Element | null;
3154
+ };
3155
+ operators: DataSourceFilterOperator<T>[];
3156
+ };
3157
+ type DataSourceFilterOperator<T> = {
3158
+ name: string;
3159
+ label?: string;
3160
+ components?: {
3161
+ FilterEditor?: () => React$1.JSX.Element | null;
3162
+ Icon?: (props: any) => React$1.JSX.Element | null;
3163
+ };
3164
+ fn: DataSourceFilterOperatorFunction<T>;
3165
+ defaultFilterValue?: any;
3166
+ };
3167
+ type DataSourceFilterOperatorFunction<T> = (filterOperatorFunctionParam: DataSourceFilterOperatorFunctionParam<T>) => boolean;
3168
+ type DataSourceFilterOperatorFunctionParam<T> = {
3169
+ currentValue: any;
3170
+ filterValue: any;
3171
+ emptyValues: any[];
3172
+ field?: keyof T;
3173
+ } & DataSourceFilterFunctionParam<T>;
3174
+ type DataSourcePropLivePaginationCursor<T> = DataSourceLivePaginationCursorValue | DataSourceLivePaginationCursorFn<T>;
3175
+ type DataSourceLivePaginationCursorFn<T> = (params: DataSourceLivePaginationCursorParams<T>) => DataSourceLivePaginationCursorValue;
3176
+ type DataSourceLivePaginationCursorParams<T> = {
3177
+ array: T[];
3178
+ lastItem: T | Partial<T> | null;
3179
+ length: number;
3180
+ };
3181
+ type DataSourceLivePaginationCursorValue = string | number | null;
3182
+ interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedState<T>, DataSourceMappedState<T> {
3150
3183
  }
3151
-
3152
- type InfiniteTableEventHandlerContext<T> = {
3153
- getComputed: () => InfiniteTableComputedValues<T>;
3154
- getState: () => InfiniteTableState<T>;
3155
- actions: InfiniteTableActions<T>;
3156
- cloneRowSelection: (rowSelection: RowSelectionState<T>) => RowSelectionState<T>;
3157
- cloneTreeSelection: (treeSelection: TreeSelectionState<T>) => TreeSelectionState<T>;
3158
- getDataSourceState: () => DataSourceState<T>;
3159
- getDataSourceMasterContext: () => DataSourceMasterDetailContextValue | undefined;
3160
- dataSourceActions: DataSourceComponentActions<T>;
3161
- api: InfiniteTableApi<T>;
3184
+ type DataSourceCallback_BaseParam<T> = {
3162
3185
  dataSourceApi: DataSourceApi<T>;
3163
3186
  };
3164
- type InfiniteTableKeyboardEventHandlerContext<T> = InfiniteTableEventHandlerContext<T>;
3165
- type InfiniteTableCellClickEventHandlerContext<T> = InfiniteTableEventHandlerContext<T> & {
3166
- rowIndex: number;
3167
- colIndex: number;
3168
- column: InfiniteTableComputedColumn<T>;
3169
- columnApi: InfiniteTableColumnApi<T>;
3187
+ type DataSourceDerivedState<T> = {
3188
+ debugId: DataSourceProps<T>['debugId'];
3189
+ isTree: boolean;
3190
+ toPrimaryKey: (data: T) => any;
3191
+ operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
3192
+ sortMode: 'local' | 'remote';
3193
+ filterMode: 'local' | 'remote';
3194
+ groupMode: 'local' | 'remote';
3195
+ pivotMode: 'local' | 'remote';
3196
+ shouldReloadData: NonUndefined<Required<DataSourcePropShouldReloadDataObject<T>>>;
3197
+ groupRowsState: GroupRowsState<T>;
3198
+ treeExpandState: TreeExpandState<any>;
3199
+ treeExpandMode: TreeExpandStateMode;
3200
+ multiSort: boolean;
3201
+ controlledSort: boolean;
3202
+ controlledFilter: boolean;
3203
+ livePaginationCursor?: DataSourceLivePaginationCursorValue;
3204
+ lazyLoadBatchSize?: number;
3205
+ rowSelection: RowSelectionState | null | number | string;
3206
+ isRowDisabled: DataSourceProps<T>['isRowDisabled'];
3207
+ cellSelection: CellSelectionState | null;
3208
+ selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
3170
3209
  };
3171
-
3172
- type OnCellClickContext<T> = InfiniteTableCellClickEventHandlerContext<T> & InfiniteTableKeyboardEventHandlerContext<T>;
3173
-
3174
- interface InfiniteTableContextValue<T> {
3175
- children?: React.ReactNode;
3176
- api: InfiniteTableApi<T>;
3177
- dataSourceApi: DataSourceApi<T>;
3178
- state: InfiniteTableState<T>;
3179
- actions: InfiniteTableActions<T>;
3180
- dataSourceActions: DataSourceComponentActions<T>;
3181
- computed: InfiniteTableComputedValues<T>;
3182
- getComputed: () => InfiniteTableComputedValues<T>;
3183
- getState: () => InfiniteTableState<T>;
3184
- getDataSourceState: () => DataSourceState<T>;
3185
- getDataSourceMasterContext: () => DataSourceMasterDetailContextValue | undefined;
3210
+ type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
3211
+ interface DataSourceContextValue<T> {
3212
+ api: DataSourceApi<T>;
3213
+ getState: () => DataSourceState<T>;
3214
+ assignState: (state: Partial<DataSourceState<T>>) => void;
3215
+ getDataSourceMasterContext: () => DataSourceMasterDetailContextValue<any> | undefined;
3216
+ componentState: DataSourceState<T>;
3217
+ componentActions: DataSourceComponentActions<T>;
3186
3218
  }
3187
- interface InfiniteTablePublicContext<T> {
3188
- api: InfiniteTableApi<T>;
3189
- dataSourceApi: DataSourceApi<T>;
3190
- getState: () => InfiniteTableState<T>;
3191
- getDataSourceState: () => DataSourceState<T>;
3219
+ interface DataSourceMasterDetailContextValue<MASTER_TYPE = any> {
3220
+ registerDetail: (detail: DataSourceContextValue<any>) => void;
3221
+ getMasterState: () => InfiniteTableState<MASTER_TYPE>;
3222
+ getMasterDataSourceState: () => DataSourceState<MASTER_TYPE>;
3223
+ shouldRestoreState: boolean;
3224
+ masterRowInfo: InfiniteTableRowInfo<MASTER_TYPE>;
3192
3225
  }
3193
- type InfiniteTableRowContext<T> = InfiniteTablePublicContext<T> & InfiniteTableRowInfoDataDiscriminator<T> & {
3194
- rowIndex: number;
3195
- };
3196
- interface InfiniteTableCellContext<T> {
3197
- rowIndex: OnCellClickContext<T>['rowIndex'];
3198
- colIndex: OnCellClickContext<T>['colIndex'];
3199
- column: InfiniteTableComputedColumn<T>;
3200
- columnApi: InfiniteTableColumnApi<T>;
3226
+ declare enum DataSourceActionType {
3227
+ INIT = "INIT"
3228
+ }
3229
+ interface DataSourceAction<T> {
3230
+ type: DataSourceActionType;
3231
+ payload: T;
3201
3232
  }
3202
3233
 
3203
3234
  type InfiniteTableBaseCellProps<T> = {
@@ -3216,6 +3247,7 @@ type InfiniteTableBaseCellProps<T> = {
3216
3247
  afterChildren?: Renderable;
3217
3248
  cssPosition?: CSSProperties['position'];
3218
3249
  domRef?: React.RefCallback<HTMLElement>;
3250
+ repaintId?: number | string;
3219
3251
  };
3220
3252
  type InfiniteTableCellProps<T> = ({
3221
3253
  cellType: 'header';
@@ -3416,6 +3448,7 @@ declare const useManagedDataSource: (props: object) => {
3416
3448
  logger: DebugLogger;
3417
3449
  forceRerenderTimestamp: number;
3418
3450
  devToolsDetected: never;
3451
+ rowInfoStore: RowInfoStore<unknown>;
3419
3452
  debugTimings: Map<DebugTimingKey, number>;
3420
3453
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
3421
3454
  indexer: Indexer<unknown, any>;
@@ -3557,6 +3590,7 @@ declare const useManagedDataSource: (props: object) => {
3557
3590
  logger: DebugLogger;
3558
3591
  forceRerenderTimestamp: number;
3559
3592
  devToolsDetected: never;
3593
+ rowInfoStore: RowInfoStore<unknown>;
3560
3594
  debugTimings: Map<DebugTimingKey, number>;
3561
3595
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
3562
3596
  indexer: Indexer<unknown, any>;
@@ -3698,6 +3732,7 @@ declare const useManagedDataSource: (props: object) => {
3698
3732
  logger: DebugLogger;
3699
3733
  forceRerenderTimestamp: number;
3700
3734
  devToolsDetected: never;
3735
+ rowInfoStore: RowInfoStore<unknown>;
3701
3736
  debugTimings: Map<DebugTimingKey, number>;
3702
3737
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
3703
3738
  indexer: Indexer<unknown, any>;
@@ -3840,6 +3875,7 @@ declare const useManagedDataSource: (props: object) => {
3840
3875
  logger: DebugLogger;
3841
3876
  forceRerenderTimestamp: number;
3842
3877
  devToolsDetected: never;
3878
+ rowInfoStore: RowInfoStore<unknown>;
3843
3879
  debugTimings: Map<DebugTimingKey, number>;
3844
3880
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
3845
3881
  indexer: Indexer<unknown, any>;
@@ -3981,6 +4017,7 @@ declare const useManagedDataSource: (props: object) => {
3981
4017
  logger: DebugLogger;
3982
4018
  forceRerenderTimestamp: number;
3983
4019
  devToolsDetected: never;
4020
+ rowInfoStore: RowInfoStore<unknown>;
3984
4021
  debugTimings: Map<DebugTimingKey, number>;
3985
4022
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
3986
4023
  indexer: Indexer<unknown, any>;
@@ -4122,6 +4159,7 @@ declare const useManagedDataSource: (props: object) => {
4122
4159
  logger: DebugLogger;
4123
4160
  forceRerenderTimestamp: number;
4124
4161
  devToolsDetected: never;
4162
+ rowInfoStore: RowInfoStore<unknown>;
4125
4163
  debugTimings: Map<DebugTimingKey, number>;
4126
4164
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4127
4165
  indexer: Indexer<unknown, any>;
@@ -4264,6 +4302,7 @@ declare const useManagedDataSource: (props: object) => {
4264
4302
  logger: DebugLogger;
4265
4303
  forceRerenderTimestamp: number;
4266
4304
  devToolsDetected: never;
4305
+ rowInfoStore: RowInfoStore<unknown>;
4267
4306
  debugTimings: Map<DebugTimingKey, number>;
4268
4307
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4269
4308
  indexer: Indexer<unknown, any>;
@@ -4405,6 +4444,7 @@ declare const useManagedDataSource: (props: object) => {
4405
4444
  logger: DebugLogger;
4406
4445
  forceRerenderTimestamp: number;
4407
4446
  devToolsDetected: never;
4447
+ rowInfoStore: RowInfoStore<unknown>;
4408
4448
  debugTimings: Map<DebugTimingKey, number>;
4409
4449
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4410
4450
  indexer: Indexer<unknown, any>;
@@ -4546,6 +4586,7 @@ declare const useManagedDataSource: (props: object) => {
4546
4586
  logger: DebugLogger;
4547
4587
  forceRerenderTimestamp: number;
4548
4588
  devToolsDetected: never;
4589
+ rowInfoStore: RowInfoStore<unknown>;
4549
4590
  debugTimings: Map<DebugTimingKey, number>;
4550
4591
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4551
4592
  indexer: Indexer<unknown, any>;
@@ -4688,6 +4729,7 @@ declare const useManagedDataSource: (props: object) => {
4688
4729
  logger: DebugLogger;
4689
4730
  forceRerenderTimestamp: number;
4690
4731
  devToolsDetected: never;
4732
+ rowInfoStore: RowInfoStore<unknown>;
4691
4733
  debugTimings: Map<DebugTimingKey, number>;
4692
4734
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4693
4735
  indexer: Indexer<unknown, any>;
@@ -4829,6 +4871,7 @@ declare const useManagedDataSource: (props: object) => {
4829
4871
  logger: DebugLogger;
4830
4872
  forceRerenderTimestamp: number;
4831
4873
  devToolsDetected: never;
4874
+ rowInfoStore: RowInfoStore<unknown>;
4832
4875
  debugTimings: Map<DebugTimingKey, number>;
4833
4876
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4834
4877
  indexer: Indexer<unknown, any>;
@@ -4970,6 +5013,7 @@ declare const useManagedDataSource: (props: object) => {
4970
5013
  logger: DebugLogger;
4971
5014
  forceRerenderTimestamp: number;
4972
5015
  devToolsDetected: never;
5016
+ rowInfoStore: RowInfoStore<unknown>;
4973
5017
  debugTimings: Map<DebugTimingKey, number>;
4974
5018
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
4975
5019
  indexer: Indexer<unknown, any>;
@@ -5112,6 +5156,7 @@ declare const useManagedDataSource: (props: object) => {
5112
5156
  logger: DebugLogger;
5113
5157
  forceRerenderTimestamp: number;
5114
5158
  devToolsDetected: never;
5159
+ rowInfoStore: RowInfoStore<unknown>;
5115
5160
  debugTimings: Map<DebugTimingKey, number>;
5116
5161
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5117
5162
  indexer: Indexer<unknown, any>;
@@ -5253,6 +5298,7 @@ declare const useManagedDataSource: (props: object) => {
5253
5298
  logger: DebugLogger;
5254
5299
  forceRerenderTimestamp: number;
5255
5300
  devToolsDetected: never;
5301
+ rowInfoStore: RowInfoStore<unknown>;
5256
5302
  debugTimings: Map<DebugTimingKey, number>;
5257
5303
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5258
5304
  indexer: Indexer<unknown, any>;
@@ -5394,6 +5440,7 @@ declare const useManagedDataSource: (props: object) => {
5394
5440
  logger: DebugLogger;
5395
5441
  forceRerenderTimestamp: number;
5396
5442
  devToolsDetected: never;
5443
+ rowInfoStore: RowInfoStore<unknown>;
5397
5444
  debugTimings: Map<DebugTimingKey, number>;
5398
5445
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5399
5446
  indexer: Indexer<unknown, any>;
@@ -5537,6 +5584,7 @@ declare const useManagedDataSource: (props: object) => {
5537
5584
  logger: DebugLogger;
5538
5585
  forceRerenderTimestamp: number;
5539
5586
  devToolsDetected: never;
5587
+ rowInfoStore: RowInfoStore<unknown>;
5540
5588
  debugTimings: Map<DebugTimingKey, number>;
5541
5589
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5542
5590
  indexer: Indexer<unknown, any>;
@@ -5678,6 +5726,7 @@ declare const useManagedDataSource: (props: object) => {
5678
5726
  logger: DebugLogger;
5679
5727
  forceRerenderTimestamp: number;
5680
5728
  devToolsDetected: never;
5729
+ rowInfoStore: RowInfoStore<unknown>;
5681
5730
  debugTimings: Map<DebugTimingKey, number>;
5682
5731
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5683
5732
  indexer: Indexer<unknown, any>;
@@ -5819,6 +5868,7 @@ declare const useManagedDataSource: (props: object) => {
5819
5868
  logger: DebugLogger;
5820
5869
  forceRerenderTimestamp: number;
5821
5870
  devToolsDetected: never;
5871
+ rowInfoStore: RowInfoStore<unknown>;
5822
5872
  debugTimings: Map<DebugTimingKey, number>;
5823
5873
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5824
5874
  indexer: Indexer<unknown, any>;
@@ -5960,6 +6010,7 @@ declare const useManagedDataSource: (props: object) => {
5960
6010
  logger: DebugLogger;
5961
6011
  forceRerenderTimestamp: number;
5962
6012
  devToolsDetected: never;
6013
+ rowInfoStore: RowInfoStore<unknown>;
5963
6014
  debugTimings: Map<DebugTimingKey, number>;
5964
6015
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
5965
6016
  indexer: Indexer<unknown, any>;
@@ -6101,6 +6152,7 @@ declare const useManagedDataSource: (props: object) => {
6101
6152
  logger: DebugLogger;
6102
6153
  forceRerenderTimestamp: number;
6103
6154
  devToolsDetected: never;
6155
+ rowInfoStore: RowInfoStore<unknown>;
6104
6156
  debugTimings: Map<DebugTimingKey, number>;
6105
6157
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
6106
6158
  indexer: Indexer<unknown, any>;
@@ -6242,6 +6294,7 @@ declare const useManagedDataSource: (props: object) => {
6242
6294
  logger: DebugLogger;
6243
6295
  forceRerenderTimestamp: number;
6244
6296
  devToolsDetected: never;
6297
+ rowInfoStore: RowInfoStore<unknown>;
6245
6298
  debugTimings: Map<DebugTimingKey, number>;
6246
6299
  debugWarnings: Map<DataSourceDebugWarningKey, DebugWarningPayload>;
6247
6300
  indexer: Indexer<unknown, any>;