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