@geovi/the-datagrid 0.0.9 → 0.0.10
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/LICENSE +21 -0
- package/README.md +163 -72
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/community-api-manifest.json +324 -0
- package/dist/BoolEditor.cjs +2 -0
- package/dist/BoolEditor.js +3503 -0
- package/dist/BoolFilter.cjs +2 -0
- package/dist/BoolFilter.js +3527 -0
- package/dist/DateEditor.cjs +2 -0
- package/dist/DateEditor.js +2922 -0
- package/dist/DateFilter.cjs +2 -0
- package/dist/DateFilter.js +2979 -0
- package/dist/NumberFilter.cjs +2 -0
- package/dist/NumberFilter.js +2968 -0
- package/dist/NumericEditor.cjs +2 -0
- package/dist/NumericEditor.js +2923 -0
- package/dist/SelectFilter.cjs +42 -0
- package/dist/SelectFilter.js +8275 -0
- package/dist/StringFilter.cjs +2 -0
- package/dist/StringFilter.js +2949 -0
- package/dist/base.css +1 -0
- package/dist/community-api-manifest.json +324 -0
- package/dist/community-package-manifest.json +35 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +14 -1
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/editors/BoolEditor.d.ts +8 -0
- package/dist/editors/BoolEditor.d.ts.map +1 -0
- package/dist/editors/DateEditor.d.ts +17 -0
- package/dist/editors/DateEditor.d.ts.map +1 -0
- package/dist/editors/NumericEditor.d.ts +11 -0
- package/dist/editors/NumericEditor.d.ts.map +1 -0
- package/dist/editors/editorTypes.d.ts +21 -0
- package/dist/editors/editorTypes.d.ts.map +1 -0
- package/dist/editors/index.d.ts +8 -0
- package/dist/editors/index.d.ts.map +1 -0
- package/dist/filters/editors/BoolFilter.d.ts +21 -0
- package/dist/filters/editors/BoolFilter.d.ts.map +1 -0
- package/dist/filters/editors/DateFilter.d.ts +8 -9
- package/dist/filters/editors/DateFilter.d.ts.map +1 -1
- package/dist/filters/editors/NumberFilter.d.ts +8 -9
- package/dist/filters/editors/NumberFilter.d.ts.map +1 -1
- package/dist/filters/editors/SelectFilter.d.ts +10 -11
- package/dist/filters/editors/SelectFilter.d.ts.map +1 -1
- package/dist/filters/editors/StringFilter.d.ts +25 -0
- package/dist/filters/editors/StringFilter.d.ts.map +1 -0
- package/dist/filters/editors/editorTypes.d.ts +13 -0
- package/dist/filters/editors/editorTypes.d.ts.map +1 -0
- package/dist/filters/editors/index.d.ts +8 -0
- package/dist/filters/editors/index.d.ts.map +1 -1
- package/dist/filters/utils.d.ts +9 -0
- package/dist/filters/utils.d.ts.map +1 -1
- package/dist/grid/ReactDataGrid.d.ts +6 -4
- package/dist/grid/ReactDataGrid.d.ts.map +1 -1
- package/dist/grid/components/ColumnGroupHeaderCell.d.ts +29 -0
- package/dist/grid/components/ColumnGroupHeaderCell.d.ts.map +1 -0
- package/dist/grid/components/FilterCell.d.ts +11 -1
- package/dist/grid/components/FilterCell.d.ts.map +1 -1
- package/dist/grid/components/FilterOperatorMenu.d.ts +10 -1
- package/dist/grid/components/FilterOperatorMenu.d.ts.map +1 -1
- package/dist/grid/components/GridBody.d.ts +29 -1
- package/dist/grid/components/GridBody.d.ts.map +1 -1
- package/dist/grid/components/GridContextMenuLayer.d.ts +27 -0
- package/dist/grid/components/GridContextMenuLayer.d.ts.map +1 -0
- package/dist/grid/components/GridHeader.d.ts +37 -2
- package/dist/grid/components/GridHeader.d.ts.map +1 -1
- package/dist/grid/components/HeaderCell.d.ts +14 -2
- package/dist/grid/components/HeaderCell.d.ts.map +1 -1
- package/dist/grid/components/MobileGridList.d.ts +13 -2
- package/dist/grid/components/MobileGridList.d.ts.map +1 -1
- package/dist/grid/engine/tanstackAdapter.d.ts.map +1 -1
- package/dist/grid/utils/columnGroups.d.ts +75 -0
- package/dist/grid/utils/columnGroups.d.ts.map +1 -0
- package/dist/grid/utils/columnSizing.d.ts +2 -1
- package/dist/grid/utils/columnSizing.d.ts.map +1 -1
- package/dist/grid/utils/contextMenuPosition.d.ts +8 -0
- package/dist/grid/utils/contextMenuPosition.d.ts.map +1 -0
- package/dist/grid/utils/editing.d.ts +6 -1
- package/dist/grid/utils/editing.d.ts.map +1 -1
- package/dist/index.cjs +48 -0
- package/dist/index.css +1 -1
- package/dist/index.js +14180 -9784
- package/dist/main.d.ts +5 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/sorting/utils.d.ts +24 -7
- package/dist/sorting/utils.d.ts.map +1 -1
- package/dist/style/theme/amber-dark/index.css +1 -0
- package/dist/style/theme/amber-light/index.css +1 -0
- package/dist/style/theme/blue-dark/index.css +1 -0
- package/dist/style/theme/blue-light/index.css +1 -0
- package/dist/style/theme/default-dark/index.css +1 -0
- package/dist/style/theme/default-light/index.css +1 -0
- package/dist/style/theme/green-dark/index.css +1 -0
- package/dist/style/theme/green-light/index.css +1 -0
- package/dist/style/theme/pink-dark/index.css +1 -0
- package/dist/style/theme/pink-light/index.css +1 -0
- package/dist/types/TypeColumn.d.ts +2 -0
- package/dist/types/TypeColumn.d.ts.map +1 -0
- package/dist/types/TypeDataGridProps.d.ts +2 -0
- package/dist/types/TypeDataGridProps.d.ts.map +1 -0
- package/dist/types/TypeDataSource.d.ts +2 -0
- package/dist/types/TypeDataSource.d.ts.map +1 -0
- package/dist/types/TypeFilterValue.d.ts +2 -0
- package/dist/types/TypeFilterValue.d.ts.map +1 -0
- package/dist/types/TypePaginationProps.d.ts +2 -0
- package/dist/types/TypePaginationProps.d.ts.map +1 -0
- package/dist/types/TypeSelected.d.ts +2 -0
- package/dist/types/TypeSelected.d.ts.map +1 -0
- package/dist/types/TypeSize.d.ts +2 -0
- package/dist/types/TypeSize.d.ts.map +1 -0
- package/dist/types/TypeSortInfo.d.ts +2 -0
- package/dist/types/TypeSortInfo.d.ts.map +1 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types.d.ts +566 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +184 -8
package/dist/types.d.ts
CHANGED
|
@@ -42,10 +42,22 @@ export type TypeSingleSortInfo = {
|
|
|
42
42
|
name: string;
|
|
43
43
|
id?: string;
|
|
44
44
|
type?: string;
|
|
45
|
-
fn?: (
|
|
45
|
+
fn?: (value1: unknown, value2: unknown, data1: unknown, data2: unknown, sortInfo: TypeSingleSortInfo) => number | boolean;
|
|
46
46
|
columnName?: string;
|
|
47
47
|
};
|
|
48
48
|
export type TypeSortInfo = TypeSingleSortInfo | TypeSingleSortInfo[] | null;
|
|
49
|
+
export type TypeSortFunction = (value1: unknown, value2: unknown, column: TypeColumn) => number | boolean;
|
|
50
|
+
export type TypeSortFunctions = Record<string, TypeSortFunction>;
|
|
51
|
+
export type TypeColumnSort = (value1: unknown, value2: unknown, column: TypeColumn, data1: unknown, data2: unknown, sortInfo: TypeSingleSortInfo) => number | boolean;
|
|
52
|
+
export type TypeSortToolProps = {
|
|
53
|
+
column: TypeColumn;
|
|
54
|
+
columnId: string;
|
|
55
|
+
computedSortable: boolean;
|
|
56
|
+
computedSortInfo: TypeSingleSortInfo | null;
|
|
57
|
+
sortInfo: TypeSortInfo;
|
|
58
|
+
headerCell: true;
|
|
59
|
+
};
|
|
60
|
+
export type TypeRenderSortTool = (direction: SortDirection, extraProps: TypeSortToolProps) => React.ReactNode;
|
|
49
61
|
export type TypeSingleFilterValue = {
|
|
50
62
|
name: string;
|
|
51
63
|
type: string;
|
|
@@ -57,7 +69,10 @@ export type TypeSingleFilterValue = {
|
|
|
57
69
|
*/
|
|
58
70
|
emptyValue?: unknown;
|
|
59
71
|
fn?: (arg: unknown) => unknown;
|
|
60
|
-
getFilterValue?: (
|
|
72
|
+
getFilterValue?: (args: {
|
|
73
|
+
data: TypeColumnRenderArgs["data"];
|
|
74
|
+
value: unknown;
|
|
75
|
+
}) => unknown;
|
|
61
76
|
/**
|
|
62
77
|
* If not set, runtime derives active/inactive from operator and value.
|
|
63
78
|
*/
|
|
@@ -125,17 +140,55 @@ export type TypeFilterType = {
|
|
|
125
140
|
operators: TypeFilterOperator[];
|
|
126
141
|
};
|
|
127
142
|
export type TypeFilterTypes = Record<string, TypeFilterType>;
|
|
143
|
+
export type TypeFilterParam = {
|
|
144
|
+
column?: TypeColumn;
|
|
145
|
+
data?: unknown;
|
|
146
|
+
emptyValue?: string;
|
|
147
|
+
filterValue?: string | number;
|
|
148
|
+
value?: string | number;
|
|
149
|
+
};
|
|
150
|
+
export type TypeFnParam = {
|
|
151
|
+
value: unknown;
|
|
152
|
+
filterValue?: unknown;
|
|
153
|
+
emptyValue?: string;
|
|
154
|
+
data?: unknown[];
|
|
155
|
+
column?: TypeColumn;
|
|
156
|
+
};
|
|
157
|
+
export type TypeFilter = (data: unknown[], filterValueArray: TypeSingleFilterValue[], filterTypes?: TypeFilterTypes, columnsMap?: Record<string, TypeColumn>) => unknown[] | ((item: unknown) => boolean);
|
|
128
158
|
export type TypeColumnRenderArgs = {
|
|
129
159
|
data: any;
|
|
130
160
|
rowIndex: number;
|
|
131
161
|
column: IColumn;
|
|
132
162
|
columnId: string;
|
|
163
|
+
value?: any;
|
|
164
|
+
rowId?: string | number;
|
|
165
|
+
rowSelected?: boolean;
|
|
166
|
+
rowActive?: boolean;
|
|
167
|
+
cellSelected?: boolean;
|
|
168
|
+
cellActive?: boolean;
|
|
169
|
+
empty?: boolean;
|
|
170
|
+
totalDataCount?: number;
|
|
133
171
|
/**
|
|
134
172
|
* Raw disabledRows entry for this displayed index. Inovua exposes `null`
|
|
135
173
|
* when the map is absent and `undefined` when this key is missing.
|
|
136
174
|
*/
|
|
137
175
|
disabledRow?: boolean | null;
|
|
138
176
|
};
|
|
177
|
+
export type TypeInlineEditorProps = {
|
|
178
|
+
inEdit: boolean;
|
|
179
|
+
value: any;
|
|
180
|
+
startEdit: (editValue?: any, errBack?: (...args: any[]) => any) => Promise<any>;
|
|
181
|
+
onClick: (event: {
|
|
182
|
+
stopPropagation: () => void;
|
|
183
|
+
}) => void;
|
|
184
|
+
onChange: (value: any, event?: unknown) => void;
|
|
185
|
+
onComplete: (valueOrEvent?: any) => void;
|
|
186
|
+
onCancel: (event?: unknown) => void;
|
|
187
|
+
onEnterNavigation: (complete?: boolean, direction?: number, event?: unknown) => void;
|
|
188
|
+
onTabNavigation: (complete?: boolean, direction?: number, event?: unknown) => void;
|
|
189
|
+
gotoNext: () => unknown;
|
|
190
|
+
gotoPrev: () => unknown;
|
|
191
|
+
};
|
|
139
192
|
export type CellProps = TypeColumnRenderArgs & {
|
|
140
193
|
value: any;
|
|
141
194
|
cellProps: Record<string, unknown>;
|
|
@@ -152,10 +205,46 @@ export type CellProps = TypeColumnRenderArgs & {
|
|
|
152
205
|
rtl?: boolean;
|
|
153
206
|
nativeScroll?: boolean;
|
|
154
207
|
editorProps?: Record<string, unknown>;
|
|
208
|
+
rendersInlineEditor?: boolean | ((cellProps: CellProps) => boolean);
|
|
209
|
+
editProps?: TypeInlineEditorProps;
|
|
155
210
|
[key: string]: any;
|
|
156
211
|
};
|
|
157
212
|
export type TypeColumnRenderCellProps = CellProps;
|
|
158
213
|
export type TypeColumnRenderFn = ((cellProps: CellProps) => React.ReactNode) | ((value: any, args: TypeColumnRenderArgs) => React.ReactNode);
|
|
214
|
+
export type TypeActiveCell = [rowIndex: number, columnIndex: number] | null;
|
|
215
|
+
export type TypeCellSelection = {
|
|
216
|
+
[cellKey: string]: boolean;
|
|
217
|
+
} | null;
|
|
218
|
+
export type TypeRowHeights = {
|
|
219
|
+
[rowId: string]: number;
|
|
220
|
+
};
|
|
221
|
+
export type TypeScrollProps = {
|
|
222
|
+
/** Hides custom tracks until the viewport is hovered or scrolled. */
|
|
223
|
+
autoHide?: boolean;
|
|
224
|
+
/** Space between the custom thumb and the viewport edge. */
|
|
225
|
+
scrollThumbMargin?: number;
|
|
226
|
+
/** Resting custom thumb thickness in pixels. */
|
|
227
|
+
scrollThumbWidth?: number;
|
|
228
|
+
/** Hover/drag custom thumb thickness in pixels. */
|
|
229
|
+
scrollThumbOverWidth?: number;
|
|
230
|
+
/** Custom thumb corner radius. */
|
|
231
|
+
scrollThumbRadius?: number | string;
|
|
232
|
+
/** Inline custom-track overrides. */
|
|
233
|
+
scrollTrackStyle?: React.CSSProperties;
|
|
234
|
+
/** Inline custom-thumb overrides. */
|
|
235
|
+
scrollThumbStyle?: React.CSSProperties;
|
|
236
|
+
};
|
|
237
|
+
export type TypeCellDOMProps = React.TdHTMLAttributes<HTMLTableCellElement> & {
|
|
238
|
+
[key: `data-${string}`]: unknown;
|
|
239
|
+
};
|
|
240
|
+
export type TypeHeaderDOMProps = React.ThHTMLAttributes<HTMLTableCellElement> & {
|
|
241
|
+
[key: `data-${string}`]: unknown;
|
|
242
|
+
};
|
|
243
|
+
export type TypeRowDOMProps = React.HTMLAttributes<HTMLTableRowElement> & {
|
|
244
|
+
[key: `data-${string}`]: unknown;
|
|
245
|
+
};
|
|
246
|
+
export type TypeCellDOMPropsConfig = TypeCellDOMProps | ((cellProps: CellProps) => TypeCellDOMProps | undefined);
|
|
247
|
+
export type TypeHeaderDOMPropsConfig = TypeHeaderDOMProps | ((cellProps: TypeCellProps) => TypeHeaderDOMProps | undefined);
|
|
159
248
|
export type TypeEditInfo = {
|
|
160
249
|
rowIndex: number;
|
|
161
250
|
columnIndex: number;
|
|
@@ -204,6 +293,7 @@ export type TypeColumnEditorCell = {
|
|
|
204
293
|
cancelEdit: () => void;
|
|
205
294
|
completeEdit: (value?: any) => void;
|
|
206
295
|
getCurrentEditValue: () => any;
|
|
296
|
+
getEditStartValue: (cellProps?: CellProps) => Promise<any>;
|
|
207
297
|
gotoNextEditor: () => unknown;
|
|
208
298
|
gotoPrevEditor: () => unknown;
|
|
209
299
|
onEditorEnterNavigation: (complete?: boolean, direction?: number, event?: unknown) => void;
|
|
@@ -213,10 +303,8 @@ export type TypeColumnEditorCell = {
|
|
|
213
303
|
}) => void;
|
|
214
304
|
domRef: HTMLElement | null;
|
|
215
305
|
props: CellProps;
|
|
216
|
-
[key: string]: any;
|
|
217
306
|
};
|
|
218
307
|
export type TypeColumnEditorProps = {
|
|
219
|
-
[key: string]: any;
|
|
220
308
|
value: any;
|
|
221
309
|
autoFocus: boolean;
|
|
222
310
|
cellProps: CellProps;
|
|
@@ -236,6 +324,16 @@ export type TypeColumnEditorProps = {
|
|
|
236
324
|
onClick: (event: {
|
|
237
325
|
stopPropagation: () => void;
|
|
238
326
|
}) => void;
|
|
327
|
+
key?: React.Key;
|
|
328
|
+
};
|
|
329
|
+
export type TypeStartEditKeyArgs = {
|
|
330
|
+
event: React.KeyboardEvent<HTMLDivElement>;
|
|
331
|
+
data: any;
|
|
332
|
+
index: number;
|
|
333
|
+
activeItem: any;
|
|
334
|
+
activeIndex: number;
|
|
335
|
+
handle: React.MutableRefObject<TypeComputedProps | null>;
|
|
336
|
+
rowSelectionEnabled: boolean;
|
|
239
337
|
};
|
|
240
338
|
export type TypeColumnResizeInfo = {
|
|
241
339
|
column: TypeColumn;
|
|
@@ -320,11 +418,50 @@ export type TypeRowStyleArgs = {
|
|
|
320
418
|
style: TypeOpenRowStyleObject;
|
|
321
419
|
};
|
|
322
420
|
export type TypeRowStyle = TypeRowStyleObject | ((args: TypeRowStyleArgs) => TypeRowStyleObject | undefined);
|
|
421
|
+
export type TypeColumnGroupHeaderProps = {
|
|
422
|
+
group: TypeColumnGroup;
|
|
423
|
+
groupName: string;
|
|
424
|
+
depth: number;
|
|
425
|
+
computedDepth: number;
|
|
426
|
+
segmentIndex: number;
|
|
427
|
+
segmentCount: number;
|
|
428
|
+
split: boolean;
|
|
429
|
+
width: number;
|
|
430
|
+
fullWidth: number;
|
|
431
|
+
columnIds: string[];
|
|
432
|
+
columns: TypeColumn[];
|
|
433
|
+
grid: TypeComputedProps;
|
|
434
|
+
computedProps: TypeComputedProps;
|
|
435
|
+
computedPropsRef: React.MutableRefObject<TypeComputedProps | null>;
|
|
436
|
+
};
|
|
437
|
+
export type TypeColumnGroupDOMProps = React.ThHTMLAttributes<HTMLTableCellElement> & {
|
|
438
|
+
[key: `data-${string}`]: unknown;
|
|
439
|
+
};
|
|
440
|
+
/**
|
|
441
|
+
* Inovua-compatible stacked-column descriptor.
|
|
442
|
+
*
|
|
443
|
+
* `group` points at another descriptor by name and creates a nested header.
|
|
444
|
+
* Header groups are derived from the live visible column order, so separated
|
|
445
|
+
* siblings render as independent segments of the same logical group.
|
|
446
|
+
*/
|
|
447
|
+
export type TypeColumnGroup = {
|
|
448
|
+
name: string;
|
|
449
|
+
header?: React.ReactNode | ((props: TypeColumnGroupHeaderProps) => React.ReactNode);
|
|
450
|
+
group?: string;
|
|
451
|
+
computedDepth?: number;
|
|
452
|
+
draggable?: boolean;
|
|
453
|
+
resizable?: boolean;
|
|
454
|
+
headerClassName?: string | ((props: TypeColumnGroupHeaderProps) => string | undefined);
|
|
455
|
+
headerStyle?: React.CSSProperties | ((props: TypeColumnGroupHeaderProps) => React.CSSProperties | undefined);
|
|
456
|
+
headerDOMProps?: TypeColumnGroupDOMProps | ((props: TypeColumnGroupHeaderProps) => TypeColumnGroupDOMProps | undefined);
|
|
457
|
+
};
|
|
323
458
|
export interface IColumn {
|
|
324
459
|
name?: string;
|
|
325
460
|
id?: string;
|
|
326
|
-
|
|
327
|
-
|
|
461
|
+
/** Name of the stacked-column descriptor this leaf belongs to. */
|
|
462
|
+
group?: string;
|
|
463
|
+
header?: React.ReactNode | ((cellProps: TypeCellProps) => React.ReactNode);
|
|
464
|
+
renderHeader?: (cellProps: TypeCellProps) => React.ReactNode;
|
|
328
465
|
/**
|
|
329
466
|
* Compatibility note:
|
|
330
467
|
* Inovua commonly uses `render({ value, data, ... }) => ReactNode`.
|
|
@@ -336,6 +473,12 @@ export interface IColumn {
|
|
|
336
473
|
editable?: boolean | ((editValue: any, cellProps: CellProps) => boolean | void | Promise<boolean | void>);
|
|
337
474
|
editor?: React.ElementType<any> | React.ReactElement<any>;
|
|
338
475
|
editorProps?: Record<string, unknown>;
|
|
476
|
+
getEditStartValue?: (value: any, cellProps: CellProps) => any | Promise<any>;
|
|
477
|
+
/**
|
|
478
|
+
* Keeps a consumer-rendered editor mounted through `column.render`.
|
|
479
|
+
* The render callback receives lifecycle-aware `cellProps.editProps`.
|
|
480
|
+
*/
|
|
481
|
+
rendersInlineEditor?: boolean | ((cellRenderObject: CellProps) => boolean);
|
|
339
482
|
renderEditor?: (editorProps: TypeColumnEditorProps, cellProps: CellProps, cell: TypeColumnEditorCell) => React.ReactNode;
|
|
340
483
|
width?: number;
|
|
341
484
|
defaultWidth?: number;
|
|
@@ -343,6 +486,13 @@ export interface IColumn {
|
|
|
343
486
|
maxWidth?: number;
|
|
344
487
|
flex?: number | null;
|
|
345
488
|
defaultFlex?: number | null;
|
|
489
|
+
/**
|
|
490
|
+
* Retains flex ownership when the user resizes this column.
|
|
491
|
+
*
|
|
492
|
+
* Inovua defaults this to true. Set false to convert an uncontrolled
|
|
493
|
+
* flex/defaultFlex column to a fixed-width column after a no-share resize.
|
|
494
|
+
*/
|
|
495
|
+
keepFlex?: boolean;
|
|
346
496
|
visible?: boolean;
|
|
347
497
|
defaultVisible?: boolean;
|
|
348
498
|
defaultHidden?: boolean;
|
|
@@ -358,6 +508,9 @@ export interface IColumn {
|
|
|
358
508
|
locked?: "start" | "end" | true | false;
|
|
359
509
|
sortable?: boolean;
|
|
360
510
|
sortName?: string;
|
|
511
|
+
type?: string;
|
|
512
|
+
sort?: TypeColumnSort;
|
|
513
|
+
renderSortTool?: TypeRenderSortTool;
|
|
361
514
|
filterable?: boolean;
|
|
362
515
|
filterType?: string;
|
|
363
516
|
filterName?: string;
|
|
@@ -367,6 +520,13 @@ export interface IColumn {
|
|
|
367
520
|
}) => unknown;
|
|
368
521
|
filterEditor?: React.ComponentType<Record<string, unknown>>;
|
|
369
522
|
filterEditorProps?: unknown;
|
|
523
|
+
/**
|
|
524
|
+
* Debounce interval for committing this column's filter value.
|
|
525
|
+
*
|
|
526
|
+
* `false` and `0` commit immediately. When omitted, filter editors use the
|
|
527
|
+
* Inovua-compatible 250 ms default.
|
|
528
|
+
*/
|
|
529
|
+
filterDelay?: boolean | number;
|
|
370
530
|
filterCellPadding?: React.CSSProperties["padding"];
|
|
371
531
|
/** Excludes this column from optional global search when false. */
|
|
372
532
|
searchable?: boolean;
|
|
@@ -376,19 +536,114 @@ export interface IColumn {
|
|
|
376
536
|
searchValue?: (data: TypeColumnRenderArgs["data"]) => unknown;
|
|
377
537
|
textAlign?: "start" | "end" | "left" | "right" | "center";
|
|
378
538
|
headerAlign?: "start" | "end" | "left" | "right" | "center";
|
|
379
|
-
|
|
380
|
-
|
|
539
|
+
cellSelectable?: boolean;
|
|
540
|
+
cellProps?: Record<string, unknown>;
|
|
541
|
+
cellDOMProps?: TypeCellDOMPropsConfig;
|
|
542
|
+
headerDOMProps?: TypeHeaderDOMPropsConfig;
|
|
543
|
+
colspan?: number | ((cellProps: CellProps) => number);
|
|
544
|
+
rowspan?: number | ((cellProps: CellProps) => number);
|
|
545
|
+
className?: string | ((cellProps: CellProps) => string | undefined);
|
|
546
|
+
style?: React.CSSProperties | ((cellProps: CellProps) => React.CSSProperties | undefined);
|
|
381
547
|
headerProps?: {
|
|
382
548
|
className?: string;
|
|
383
549
|
style?: React.CSSProperties;
|
|
384
550
|
};
|
|
385
|
-
[key: string]: unknown;
|
|
386
551
|
}
|
|
387
552
|
export type TypeColumn = IColumn;
|
|
388
553
|
export type TypeColumns = TypeColumn[];
|
|
554
|
+
export type TypeColumnWithId = TypeColumn & {
|
|
555
|
+
id: string;
|
|
556
|
+
};
|
|
557
|
+
export type TypeHeaderProps = {
|
|
558
|
+
style?: React.CSSProperties;
|
|
559
|
+
className?: string;
|
|
560
|
+
};
|
|
389
561
|
export type TypeI18n = {
|
|
390
562
|
[key: string]: string | React.ReactNode;
|
|
391
563
|
};
|
|
564
|
+
export type TypeColumnFilterContextMenuProps = {
|
|
565
|
+
position?: string;
|
|
566
|
+
style?: React.CSSProperties;
|
|
567
|
+
constrainTo?: boolean | HTMLElement | string | ((...args: unknown[]) => HTMLElement | null);
|
|
568
|
+
alignPositions?: string[];
|
|
569
|
+
updatePositionOnScroll?: boolean;
|
|
570
|
+
selected?: string | {
|
|
571
|
+
operator: string;
|
|
572
|
+
};
|
|
573
|
+
items?: TypeContextMenuItem[];
|
|
574
|
+
onSelectionChange?: (operator: string) => void;
|
|
575
|
+
onDismiss?: () => void;
|
|
576
|
+
[key: string]: unknown;
|
|
577
|
+
};
|
|
578
|
+
export type TypeRenderColumnFilterContextMenu = (menuProps: TypeColumnFilterContextMenuProps, context: {
|
|
579
|
+
cellProps: TypeCellProps;
|
|
580
|
+
grid: React.MutableRefObject<TypeComputedProps | null>;
|
|
581
|
+
props: TypeComputedProps;
|
|
582
|
+
}) => React.ReactNode;
|
|
583
|
+
export type TypeContextMenuConstrainTo = boolean | HTMLElement | string | ((...args: unknown[]) => HTMLElement | null);
|
|
584
|
+
export type TypeContextMenuPoint = {
|
|
585
|
+
left: number;
|
|
586
|
+
top: number;
|
|
587
|
+
};
|
|
588
|
+
export type TypeContextMenuItem = "-" | {
|
|
589
|
+
name?: string;
|
|
590
|
+
label?: React.ReactNode;
|
|
591
|
+
disabled?: boolean;
|
|
592
|
+
checked?: boolean;
|
|
593
|
+
items?: TypeContextMenuItem[];
|
|
594
|
+
onClick?: (...args: unknown[]) => void;
|
|
595
|
+
[key: string]: unknown;
|
|
596
|
+
};
|
|
597
|
+
export type TypeRowProps = Partial<TypeRowStyleProps> & Pick<TypeRowStyleProps, "data" | "rowIndex"> & {
|
|
598
|
+
groupProps?: unknown;
|
|
599
|
+
empty?: boolean;
|
|
600
|
+
active?: boolean;
|
|
601
|
+
rowSelected?: boolean;
|
|
602
|
+
};
|
|
603
|
+
export type RowProps = TypeRowProps;
|
|
604
|
+
export type TypeRenderRow = (rowProps: TypeRowDOMProps & React.RefAttributes<HTMLTableRowElement> & {
|
|
605
|
+
children?: React.ReactNode;
|
|
606
|
+
rowProps: TypeRowProps;
|
|
607
|
+
}) => React.ReactNode;
|
|
608
|
+
export type TypeOnRenderRow = (rowProps: TypeRowProps) => void;
|
|
609
|
+
export type TypeRowClassName = string | ((rowProps: TypeRowProps) => string | undefined);
|
|
610
|
+
export type TypeOnRowClick = (rowProps: TypeRowProps, event: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
611
|
+
export type TypeOnRowDoubleClick = (event: React.MouseEvent<HTMLTableRowElement>, rowProps: TypeRowProps) => void;
|
|
612
|
+
export type TypeOnCellClick = (event: React.MouseEvent<HTMLTableCellElement>, cellProps: CellProps) => void;
|
|
613
|
+
export type TypeOnCellDoubleClick = TypeOnCellClick;
|
|
614
|
+
export type TypeColumnContextMenuProps = {
|
|
615
|
+
autoFocus?: boolean;
|
|
616
|
+
alignTo?: HTMLElement | TypeContextMenuPoint | null;
|
|
617
|
+
alignPositions?: string[];
|
|
618
|
+
cellProps?: TypeCellProps;
|
|
619
|
+
constrainTo?: TypeContextMenuConstrainTo;
|
|
620
|
+
items?: TypeContextMenuItem[];
|
|
621
|
+
nativeScroll?: boolean;
|
|
622
|
+
onDismiss?: () => void;
|
|
623
|
+
position?: string;
|
|
624
|
+
style?: React.CSSProperties;
|
|
625
|
+
theme?: string;
|
|
626
|
+
updatePositionOnScroll?: boolean;
|
|
627
|
+
[key: string]: unknown;
|
|
628
|
+
};
|
|
629
|
+
export type TypeRowContextMenuProps = TypeColumnContextMenuProps & {
|
|
630
|
+
rowProps?: TypeRowProps;
|
|
631
|
+
};
|
|
632
|
+
export type TypeRenderColumnContextMenu = (menuProps: TypeColumnContextMenuProps, context: {
|
|
633
|
+
cellProps: TypeCellProps;
|
|
634
|
+
grid: TypeComputedProps;
|
|
635
|
+
computedProps: TypeComputedProps;
|
|
636
|
+
computedPropsRef: React.MutableRefObject<TypeComputedProps | null>;
|
|
637
|
+
}) => React.ReactNode;
|
|
638
|
+
export type TypeRenderRowContextMenu = (menuProps: TypeRowContextMenuProps, context: {
|
|
639
|
+
rowProps: TypeRowProps;
|
|
640
|
+
cellProps?: TypeCellProps;
|
|
641
|
+
grid: TypeComputedProps;
|
|
642
|
+
computedProps: TypeComputedProps;
|
|
643
|
+
computedPropsRef: React.MutableRefObject<TypeComputedProps | null>;
|
|
644
|
+
}) => React.ReactNode;
|
|
645
|
+
export type TypeContextMenuEvent = React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement> | React.PointerEvent<HTMLElement>;
|
|
646
|
+
export type TypeOnRowContextMenu = (rowProps: TypeRowProps, event: TypeContextMenuEvent) => void;
|
|
392
647
|
/**
|
|
393
648
|
* Inovua selection in your codebase is an object map: { [id]: rowObject }.
|
|
394
649
|
* We accept broad shapes, and the runtime also tolerates the emitted
|
|
@@ -400,6 +655,7 @@ export type TypeRowSelection = string | number | boolean | {
|
|
|
400
655
|
export type TypeBoolMap = {
|
|
401
656
|
[key: string]: boolean;
|
|
402
657
|
};
|
|
658
|
+
export type TypeRowUnselected = TypeBoolMap | null;
|
|
403
659
|
export type TypeOnSelectionChangeArg = {
|
|
404
660
|
selected: TypeRowSelection;
|
|
405
661
|
data?: unknown;
|
|
@@ -420,6 +676,52 @@ export type TypeComputedColumn = TypeColumn & {
|
|
|
420
676
|
index?: number;
|
|
421
677
|
};
|
|
422
678
|
export type TypeComputedColumnsMap = Record<string, TypeComputedColumn>;
|
|
679
|
+
export type TypeWithId = {
|
|
680
|
+
id: string;
|
|
681
|
+
};
|
|
682
|
+
export interface TypeBatchUpdateQueue {
|
|
683
|
+
(fn: () => void): void;
|
|
684
|
+
commit: (extraFn?: () => void) => void;
|
|
685
|
+
}
|
|
686
|
+
export type TypeDragHelper = {
|
|
687
|
+
onDrag: (...args: unknown[]) => unknown;
|
|
688
|
+
onDrop: (...args: unknown[]) => unknown;
|
|
689
|
+
};
|
|
690
|
+
export type TypeConstrainRegion = {
|
|
691
|
+
0: number;
|
|
692
|
+
1: number;
|
|
693
|
+
bottom: number;
|
|
694
|
+
left: number;
|
|
695
|
+
right: number;
|
|
696
|
+
top: number;
|
|
697
|
+
_events: object;
|
|
698
|
+
_eventsCount: number;
|
|
699
|
+
_maxListeners: number;
|
|
700
|
+
height: number;
|
|
701
|
+
width: number;
|
|
702
|
+
getHeight?: () => number;
|
|
703
|
+
};
|
|
704
|
+
export type TypeDiff = {
|
|
705
|
+
top: number;
|
|
706
|
+
left: number;
|
|
707
|
+
};
|
|
708
|
+
export type TypeConfig = {
|
|
709
|
+
diff: TypeDiff;
|
|
710
|
+
didDrag: boolean;
|
|
711
|
+
scope?: unknown;
|
|
712
|
+
};
|
|
713
|
+
export type RangeResultType = {
|
|
714
|
+
top: number;
|
|
715
|
+
bottom: number;
|
|
716
|
+
height: number;
|
|
717
|
+
index: number;
|
|
718
|
+
group?: boolean;
|
|
719
|
+
keyPath?: string[] | string;
|
|
720
|
+
leaf?: boolean;
|
|
721
|
+
value?: string;
|
|
722
|
+
depth?: number;
|
|
723
|
+
parent?: boolean;
|
|
724
|
+
};
|
|
423
725
|
export type TypeSize = {
|
|
424
726
|
width: number;
|
|
425
727
|
height: number;
|
|
@@ -497,12 +799,6 @@ export type TypeComputedVirtualList = {
|
|
|
497
799
|
getMaxRenderCount: () => number;
|
|
498
800
|
};
|
|
499
801
|
export type TypeComputedProps = {
|
|
500
|
-
/**
|
|
501
|
-
* Inovua exposes a very broad computed-props object.
|
|
502
|
-
* Keep this type intentionally open so legacy property access continues
|
|
503
|
-
* to type-check even when our runtime only implements a compat subset.
|
|
504
|
-
*/
|
|
505
|
-
[key: string]: any;
|
|
506
802
|
reload: () => void;
|
|
507
803
|
initialProps?: unknown;
|
|
508
804
|
publicAPI?: TypeComputedProps;
|
|
@@ -510,6 +806,7 @@ export type TypeComputedProps = {
|
|
|
510
806
|
originalData?: unknown[];
|
|
511
807
|
count?: number;
|
|
512
808
|
dataCountAfterFilter?: number;
|
|
809
|
+
filteredRowsCount?: (filteredRows: number) => void;
|
|
513
810
|
getData: () => unknown[];
|
|
514
811
|
getCount: () => number;
|
|
515
812
|
computedSkip?: number;
|
|
@@ -519,12 +816,14 @@ export type TypeComputedProps = {
|
|
|
519
816
|
setSkip: (skip: number) => void;
|
|
520
817
|
setLimit: (limit: number) => void;
|
|
521
818
|
computedSortInfo?: TypeSortInfo;
|
|
819
|
+
computedIsMultiSort?: boolean;
|
|
522
820
|
getSortInfo: () => TypeSortInfo;
|
|
523
821
|
setSortInfo: (sortInfo: TypeSortInfo) => void;
|
|
524
822
|
toggleColumnSort?: (column: TypeGetColumnByParam) => void;
|
|
525
823
|
setColumnSortInfo?: (column: TypeGetColumnByParam, dir: SortDirection) => void;
|
|
526
824
|
unsortColumn?: (column: TypeGetColumnByParam) => void;
|
|
527
825
|
computedFilterValue?: TypeFilterValue;
|
|
826
|
+
computedFiltered?: boolean;
|
|
528
827
|
computedFilterValueMap?: Record<string, TypeSingleFilterValue> | null;
|
|
529
828
|
getFilterValue: () => TypeFilterValue;
|
|
530
829
|
setFilterValue: (filterValue: TypeFilterValue) => void;
|
|
@@ -544,9 +843,32 @@ export type TypeComputedProps = {
|
|
|
544
843
|
completeEdit?: (args?: TypeCompleteEditArgs) => void;
|
|
545
844
|
cancelEdit?: (args?: TypeCancelEditArgs) => void;
|
|
546
845
|
currentEditCompletePromise?: React.MutableRefObject<Promise<unknown>>;
|
|
846
|
+
computedRowHeights?: TypeRowHeights;
|
|
847
|
+
setRowHeights?: (rowHeights: TypeRowHeights) => void;
|
|
848
|
+
setRowHeightById: (rowHeight: number | null, id: string | number) => void;
|
|
849
|
+
getRowHeightById: (id: string | number) => number;
|
|
850
|
+
getRowHeight?: (rowIndex: number) => number;
|
|
547
851
|
computedColumnOrder?: string[] | undefined;
|
|
548
852
|
getColumnOrder: () => string[];
|
|
549
853
|
setColumnOrder: (columnOrder: string[]) => void;
|
|
854
|
+
columnSizes?: Record<string, number>;
|
|
855
|
+
columnFlexes?: Record<string, number>;
|
|
856
|
+
setColumnSizes?: React.Dispatch<React.SetStateAction<Record<string, number>>>;
|
|
857
|
+
setColumnFlexes?: React.Dispatch<React.SetStateAction<Record<string, number | null>>>;
|
|
858
|
+
onBatchColumnResize?: (info: TypeColumnResizeInfo[], context?: TypeColumnResizeContext) => void;
|
|
859
|
+
computedOnColumnResize?: (args: {
|
|
860
|
+
index: number;
|
|
861
|
+
diff: number;
|
|
862
|
+
}) => void;
|
|
863
|
+
setColumnsSizesAuto?: (config?: {
|
|
864
|
+
columnIds?: string[];
|
|
865
|
+
skipHeader?: boolean;
|
|
866
|
+
skipSortTool?: boolean;
|
|
867
|
+
}) => void;
|
|
868
|
+
setColumnSizesToFit?: () => void;
|
|
869
|
+
setColumnSizeAuto?: (id: string, skipHeader?: boolean) => void;
|
|
870
|
+
reservedViewportWidth?: number;
|
|
871
|
+
setReservedViewportWidth?: React.Dispatch<React.SetStateAction<number>>;
|
|
550
872
|
columnsMap?: TypeComputedColumnsMap;
|
|
551
873
|
visibleColumnsMap?: TypeComputedColumnsMap;
|
|
552
874
|
allColumns?: TypeComputedColumn[];
|
|
@@ -602,11 +924,16 @@ export type TypeComputedProps = {
|
|
|
602
924
|
setEnableFiltering?: (value: React.SetStateAction<boolean>) => void;
|
|
603
925
|
computedShowHeader?: boolean;
|
|
604
926
|
setShowHeader?: (value: React.SetStateAction<boolean>) => void;
|
|
927
|
+
computedShowHoverRows?: boolean;
|
|
928
|
+
setShowHoverRows?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
605
929
|
computedShowZebraRows: boolean;
|
|
606
930
|
setShowZebraRows: (value: React.SetStateAction<boolean>) => void;
|
|
931
|
+
computedShowEmptyRows?: boolean;
|
|
932
|
+
setShowEmptyRows?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
607
933
|
showHorizontalCellBorders?: boolean;
|
|
608
934
|
showVerticalCellBorders?: boolean;
|
|
609
935
|
computedShowCellBorders?: TypeShowCellBorders;
|
|
936
|
+
setShowCellBorders?: React.Dispatch<React.SetStateAction<TypeShowCellBorders>>;
|
|
610
937
|
computedRemoteData?: boolean;
|
|
611
938
|
computedRemotePagination?: boolean;
|
|
612
939
|
computedRemoteFilter?: boolean;
|
|
@@ -614,22 +941,45 @@ export type TypeComputedProps = {
|
|
|
614
941
|
computedPagination?: boolean;
|
|
615
942
|
computedLivePagination?: boolean;
|
|
616
943
|
remoteSort?: boolean;
|
|
944
|
+
loadNextPage?: () => void;
|
|
945
|
+
paginationCount?: number;
|
|
946
|
+
paginationProps?: TypePaginationProps;
|
|
947
|
+
hasNextPage?: () => boolean;
|
|
948
|
+
hasPrevPage?: () => boolean;
|
|
949
|
+
gotoNextPage?: () => void;
|
|
950
|
+
gotoPrevPage?: () => void;
|
|
951
|
+
gotoFirstPage?: () => void;
|
|
952
|
+
gotoLastPage?: () => void;
|
|
617
953
|
getItemId?: (item: object) => unknown;
|
|
618
954
|
getItemAt?: (index: number) => unknown;
|
|
619
955
|
getItemIdAt?: (index: number) => unknown;
|
|
620
956
|
getItemIndex?: (id: string | number) => number;
|
|
621
957
|
getRowIndexById?: (rowId: string | number, data?: unknown[]) => number;
|
|
622
958
|
getItemIndexById?: (rowId: string | number, data?: unknown[]) => number;
|
|
959
|
+
setItemPropertyAt?: (index: number, property: string, value: unknown) => void;
|
|
960
|
+
setItemPropertyForId?: (id: string | number, property: string, value: unknown) => void;
|
|
961
|
+
setItemAt?: (index: number, item: unknown, config?: {
|
|
962
|
+
replace?: boolean;
|
|
963
|
+
property?: string;
|
|
964
|
+
value?: unknown;
|
|
965
|
+
deepCloning?: boolean;
|
|
966
|
+
}) => void;
|
|
967
|
+
setItemsAt?: (items: unknown[] | Record<number, unknown>, config?: {
|
|
968
|
+
replace?: boolean;
|
|
969
|
+
}) => void;
|
|
623
970
|
computedSelected?: TypeRowSelection;
|
|
624
971
|
computedUnselected?: TypeBoolMap | null;
|
|
625
972
|
computedRowSelectionEnabled?: boolean;
|
|
626
973
|
computedRowMultiSelectionEnabled?: boolean;
|
|
627
974
|
getSelectedMap?: () => Record<string, unknown>;
|
|
628
975
|
setSelected?: (selected: TypeRowSelection, ...args: unknown[]) => void;
|
|
976
|
+
setUnselected?: React.Dispatch<React.SetStateAction<TypeRowUnselected>>;
|
|
629
977
|
selectAll?: () => void;
|
|
630
978
|
deselectAll?: () => void;
|
|
631
979
|
isRowSelected?: (data: object | number | string) => boolean;
|
|
632
980
|
getSelectedCount?: (selected?: TypeRowSelection, unselected?: TypeRowSelection) => number;
|
|
981
|
+
getUnselectedCount?: (unselected?: TypeRowUnselected) => number;
|
|
982
|
+
isSelectionEmpty?: () => boolean;
|
|
633
983
|
computedSelectedCount?: number;
|
|
634
984
|
computedUnselectedCount?: number;
|
|
635
985
|
setSelectedById?: (id: string, selected: boolean) => void;
|
|
@@ -637,19 +987,67 @@ export type TypeComputedProps = {
|
|
|
637
987
|
setRowSelected?: (index: number, selected: boolean, event?: unknown) => void;
|
|
638
988
|
computedActiveIndex?: number;
|
|
639
989
|
computedLastActiveIndex?: number | null;
|
|
990
|
+
doSetLastActiveIndex?: (activeIndex: number | null) => void;
|
|
640
991
|
computedActiveItem?: unknown;
|
|
641
992
|
computedHasRowNavigation?: boolean;
|
|
642
993
|
computedFocused?: boolean;
|
|
994
|
+
computedSetFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
995
|
+
computedOnKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
996
|
+
computedOnFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
997
|
+
toggleActiveRowSelection?: (event?: {
|
|
998
|
+
ctrlKey?: boolean;
|
|
999
|
+
metaKey?: boolean;
|
|
1000
|
+
shiftKey?: boolean;
|
|
1001
|
+
}) => void;
|
|
1002
|
+
computedOnRowClick?: (event: React.MouseEvent<HTMLTableRowElement>, rowProps: TypeRowProps) => void;
|
|
1003
|
+
computedRowDoubleClick?: TypeOnRowDoubleClick;
|
|
1004
|
+
computedCellDoubleClick?: TypeOnCellDoubleClick;
|
|
643
1005
|
setActiveIndex?: (activeIndex: number) => void;
|
|
644
1006
|
incrementActiveIndex?: (increment: number) => void;
|
|
645
1007
|
getActiveItem?: () => unknown;
|
|
1008
|
+
computedActiveCell?: TypeActiveCell;
|
|
1009
|
+
computedCellSelection?: TypeCellSelection;
|
|
1010
|
+
computedCellSelectionEnabled?: boolean;
|
|
1011
|
+
computedCellMultiSelectionEnabled?: boolean;
|
|
1012
|
+
computedCellNavigationEnabled?: boolean;
|
|
1013
|
+
computedCellSelectionByIndex?: boolean;
|
|
1014
|
+
getActiveCell?: () => TypeActiveCell;
|
|
1015
|
+
setActiveCell?: (activeCell: TypeActiveCell) => void;
|
|
1016
|
+
getCellSelection?: () => TypeCellSelection;
|
|
1017
|
+
setCellSelection?: (selection: TypeCellSelection) => void;
|
|
1018
|
+
isCellSelected?: (cell: TypeActiveCell | {
|
|
1019
|
+
rowIndex: number;
|
|
1020
|
+
columnIndex: number;
|
|
1021
|
+
}) => boolean;
|
|
1022
|
+
getCellSelectionIdKey?: (rowIndex: number, columnIndex: number) => string | number;
|
|
1023
|
+
getCellSelectionKey?: (cell: string | number | TypeCellProps, column?: TypeGetColumnByParam) => string | number;
|
|
1024
|
+
incrementActiveCell?: (direction: [number, number]) => void;
|
|
1025
|
+
toggleActiveCellSelection?: (event?: {
|
|
1026
|
+
shiftKey?: boolean;
|
|
1027
|
+
ctrlKey?: boolean;
|
|
1028
|
+
metaKey?: boolean;
|
|
1029
|
+
}) => void;
|
|
1030
|
+
getCellSelectionBetween?: (start?: TypeActiveCell, end?: TypeActiveCell) => Record<string, boolean>;
|
|
1031
|
+
isCellVisible?: (cell: {
|
|
1032
|
+
rowIndex: number;
|
|
1033
|
+
columnIndex: number;
|
|
1034
|
+
}) => boolean | {
|
|
1035
|
+
topDiff: number;
|
|
1036
|
+
bottomDiff: number;
|
|
1037
|
+
leftDiff: number;
|
|
1038
|
+
rightDiff: number;
|
|
1039
|
+
};
|
|
646
1040
|
setScrollLeft?: (scrollLeft: number) => void;
|
|
647
1041
|
incrementScrollLeft?: (scrollLeft: number) => void;
|
|
648
1042
|
getScrollLeft?: () => number;
|
|
649
1043
|
getScrollLeftMax?: () => number;
|
|
1044
|
+
/** Logical horizontal offset; writable in both LTR and RTL mode. */
|
|
1045
|
+
scrollLeft?: number;
|
|
650
1046
|
setScrollTop?: (scrollTop: number) => void;
|
|
651
1047
|
incrementScrollTop?: (scrollTop: number) => void;
|
|
652
1048
|
getScrollTop?: () => number;
|
|
1049
|
+
/** Vertical offset; writable in both native and custom-scrollbar modes. */
|
|
1050
|
+
scrollTop?: number;
|
|
653
1051
|
scrollToIndex?: TypeScrollToIndex;
|
|
654
1052
|
scrollToId?: (id: string | number, config?: TypeScrollToIndexConfig, callback?: (...args: unknown[]) => void) => void;
|
|
655
1053
|
scrollToCell?: (cell: {
|
|
@@ -680,14 +1078,50 @@ export type TypeComputedProps = {
|
|
|
680
1078
|
vertical: boolean;
|
|
681
1079
|
horizontal: boolean;
|
|
682
1080
|
};
|
|
1081
|
+
virtualizeColumns?: boolean;
|
|
1082
|
+
computedEnableRowspan?: boolean;
|
|
1083
|
+
computedHasColSpan?: boolean;
|
|
1084
|
+
computedEnableColumnHover?: boolean;
|
|
1085
|
+
availableWidth?: number;
|
|
1086
|
+
edition?: "community";
|
|
1087
|
+
computedLicenseValid?: boolean;
|
|
1088
|
+
getColumnLayout?: () => unknown;
|
|
1089
|
+
computedShowHeaderBorderRight?: boolean;
|
|
1090
|
+
silentSetData?: React.Dispatch<React.SetStateAction<any[]>>;
|
|
1091
|
+
setOriginalData?: React.Dispatch<React.SetStateAction<any[]>>;
|
|
683
1092
|
i18n?: (key: string, defaultValue?: string) => string | React.ReactNode;
|
|
1093
|
+
getMenuAvailableHeight?: () => number;
|
|
1094
|
+
isFilterable?: () => boolean;
|
|
1095
|
+
shouldShowFilteringMenuItems?: () => boolean;
|
|
1096
|
+
updateMenuPositions?: () => void;
|
|
1097
|
+
onScroll?: React.UIEventHandler<HTMLDivElement>;
|
|
1098
|
+
rtlOffset?: number;
|
|
684
1099
|
columnFilterContextMenuProps?: Record<string, unknown> | null;
|
|
685
1100
|
showColumnFilterContextMenu?: (...args: unknown[]) => void;
|
|
686
1101
|
hideColumnFilterContextMenu?: () => void;
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1102
|
+
columnContextMenuProps?: TypeColumnContextMenuProps | null;
|
|
1103
|
+
rowContextMenuProps?: TypeRowContextMenuProps | null;
|
|
1104
|
+
showColumnContextMenu?: (alignTo: HTMLElement | TypeContextMenuPoint, cellProps: TypeCellProps, config?: {
|
|
1105
|
+
computedVisibleIndex?: number;
|
|
1106
|
+
}, onHide?: () => void) => void;
|
|
1107
|
+
hideColumnContextMenu?: () => void;
|
|
1108
|
+
showRowContextMenu?: (alignTo: HTMLElement | TypeContextMenuPoint, rowProps: TypeRowProps, cellProps?: TypeCellProps, onHide?: () => void) => void;
|
|
1109
|
+
hideRowContextMenu?: () => void;
|
|
1110
|
+
getState?: () => {
|
|
1111
|
+
data: unknown[];
|
|
1112
|
+
count: number;
|
|
1113
|
+
skip: number;
|
|
1114
|
+
limit: number;
|
|
1115
|
+
sortInfo: TypeSortInfo;
|
|
1116
|
+
filterValue: TypeFilterValue;
|
|
1117
|
+
selected: TypeRowSelection;
|
|
1118
|
+
unselected: TypeRowUnselected;
|
|
1119
|
+
activeIndex: number;
|
|
1120
|
+
activeCell: TypeActiveCell;
|
|
1121
|
+
cellSelection: TypeCellSelection;
|
|
1122
|
+
columnOrder: string[];
|
|
1123
|
+
rowHeights: TypeRowHeights;
|
|
1124
|
+
};
|
|
691
1125
|
};
|
|
692
1126
|
export type TypePaginationMode = true | false | "remote" | "local";
|
|
693
1127
|
/**
|
|
@@ -786,14 +1220,41 @@ export type TypeDataGridProps = {
|
|
|
786
1220
|
idProperty: string;
|
|
787
1221
|
columns: TypeColumns;
|
|
788
1222
|
dataSource: TypeDataSource;
|
|
1223
|
+
/** Stacked and nested column-header descriptors. */
|
|
1224
|
+
groups?: TypeColumnGroup[];
|
|
1225
|
+
/**
|
|
1226
|
+
* When false, leaf and group drag operations stay inside their existing
|
|
1227
|
+
* group parent. The Inovua Community default is true.
|
|
1228
|
+
*/
|
|
1229
|
+
allowGroupSplitOnReorder?: boolean;
|
|
789
1230
|
columnOrder?: string[];
|
|
1231
|
+
defaultColumnOrder?: string[];
|
|
790
1232
|
onColumnOrderChange?: (columnOrder: string[]) => void;
|
|
1233
|
+
onColumnVisibleChange?: (args: {
|
|
1234
|
+
column: TypeColumn;
|
|
1235
|
+
visible: boolean;
|
|
1236
|
+
}) => void;
|
|
791
1237
|
/**
|
|
792
1238
|
* In Inovua, `reorderColumns={false}` is common.
|
|
793
1239
|
* We support it explicitly now.
|
|
794
1240
|
*/
|
|
795
1241
|
reorderColumns?: boolean;
|
|
796
1242
|
resizable?: boolean;
|
|
1243
|
+
/** Root fallback used when a column has no width/defaultWidth. */
|
|
1244
|
+
columnDefaultWidth?: number;
|
|
1245
|
+
/** Root fallback used when a column has no minWidth. */
|
|
1246
|
+
columnMinWidth?: number;
|
|
1247
|
+
/** Root fallback used when a column has no maxWidth. */
|
|
1248
|
+
columnMaxWidth?: number | null;
|
|
1249
|
+
/**
|
|
1250
|
+
* Resizes the adjacent visible column in the opposite direction so the
|
|
1251
|
+
* pair keeps its total rendered width.
|
|
1252
|
+
*/
|
|
1253
|
+
shareSpaceOnResize?: boolean;
|
|
1254
|
+
/** Pointer target width, in pixels, for header resize handles. */
|
|
1255
|
+
columnResizeHandleWidth?: number;
|
|
1256
|
+
/** Rendered width, in pixels, of the deferred resize proxy. */
|
|
1257
|
+
columnResizeProxyWidth?: number;
|
|
797
1258
|
/**
|
|
798
1259
|
* When enabled, the rendered column follows the pointer while its resize
|
|
799
1260
|
* handle is dragged. The default deferred mode keeps the lightweight resize
|
|
@@ -820,10 +1281,30 @@ export type TypeDataGridProps = {
|
|
|
820
1281
|
onFilterValueChange?: (filterValue: TypeFilterValue) => void;
|
|
821
1282
|
onColumnFilterValueChange?: (columnFilterValue: TypeColumnFilterValueChangeArg) => void;
|
|
822
1283
|
filterTypes?: TypeFilterTypes;
|
|
1284
|
+
scrollTopOnFilter?: boolean;
|
|
1285
|
+
renderColumnFilterContextMenu?: TypeRenderColumnFilterContextMenu;
|
|
1286
|
+
columnFilterContextMenuAlignPositions?: string[];
|
|
1287
|
+
columnFilterContextMenuConstrainTo?: boolean | HTMLElement | string | ((...args: unknown[]) => HTMLElement | null);
|
|
1288
|
+
columnFilterContextMenuPosition?: string;
|
|
1289
|
+
updateMenuPositionOnScroll?: boolean;
|
|
1290
|
+
renderColumnContextMenu?: TypeRenderColumnContextMenu;
|
|
1291
|
+
columnContextMenuAlignPositions?: string[];
|
|
1292
|
+
columnContextMenuConstrainTo?: TypeContextMenuConstrainTo;
|
|
1293
|
+
columnContextMenuPosition?: string;
|
|
1294
|
+
renderRowContextMenu?: TypeRenderRowContextMenu;
|
|
1295
|
+
onRowContextMenu?: TypeOnRowContextMenu;
|
|
1296
|
+
rowContextMenuAlignPositions?: string[];
|
|
1297
|
+
rowContextMenuConstrainTo?: TypeContextMenuConstrainTo;
|
|
1298
|
+
rowContextMenuPosition?: string;
|
|
1299
|
+
updateMenuPositionOnColumnsChange?: boolean;
|
|
823
1300
|
filteredRowsCount?: (filteredRows: number) => void;
|
|
824
1301
|
sortInfo?: TypeSortInfo;
|
|
825
1302
|
defaultSortInfo?: TypeSortInfo;
|
|
826
1303
|
onSortInfoChange?: (sortInfo: TypeSortInfo) => void;
|
|
1304
|
+
sortable?: boolean;
|
|
1305
|
+
sortFunctions?: TypeSortFunctions | null;
|
|
1306
|
+
renderSortTool?: TypeRenderSortTool;
|
|
1307
|
+
scrollTopOnSort?: boolean | "always";
|
|
827
1308
|
allowUnsort?: boolean;
|
|
828
1309
|
defaultSortingDirection?: "desc" | "asc";
|
|
829
1310
|
pagination?: TypePaginationMode;
|
|
@@ -836,6 +1317,18 @@ export type TypeDataGridProps = {
|
|
|
836
1317
|
pageSizes?: number[];
|
|
837
1318
|
renderPaginationToolbar?: (paginationProps: TypePaginationProps) => React.ReactNode;
|
|
838
1319
|
virtualized?: boolean;
|
|
1320
|
+
/**
|
|
1321
|
+
* Uses the browser's visible scrollbars when true. The default false mode
|
|
1322
|
+
* keeps native overflow semantics while rendering shadcn-compatible custom
|
|
1323
|
+
* tracks and thumbs.
|
|
1324
|
+
*/
|
|
1325
|
+
nativeScroll?: boolean;
|
|
1326
|
+
scrollProps?: TypeScrollProps;
|
|
1327
|
+
initialScrollTop?: number;
|
|
1328
|
+
initialScrollLeft?: number;
|
|
1329
|
+
onScroll?: React.UIEventHandler<HTMLDivElement>;
|
|
1330
|
+
/** Mirrors horizontal layout and exposes logical scroll offsets. */
|
|
1331
|
+
rtl?: boolean;
|
|
839
1332
|
/**
|
|
840
1333
|
* Enables horizontal column virtualization when the grid has at least this
|
|
841
1334
|
* many visible columns. The boundary is inclusive and defaults to `15`.
|
|
@@ -868,19 +1361,41 @@ export type TypeDataGridProps = {
|
|
|
868
1361
|
emptyText?: React.ReactNode | (() => React.ReactNode);
|
|
869
1362
|
showColumnMenuTool?: boolean;
|
|
870
1363
|
rowHeight?: number | ((rowIndex: number) => number) | null;
|
|
1364
|
+
rowHeights?: TypeRowHeights;
|
|
1365
|
+
defaultRowHeights?: TypeRowHeights;
|
|
1366
|
+
onRowHeightsChange?: (rowHeights: TypeRowHeights) => void;
|
|
1367
|
+
onUpdateRowHeights?: (heights: {
|
|
1368
|
+
[rowIndex: number]: number;
|
|
1369
|
+
}, computedProps: TypeComputedProps) => void;
|
|
871
1370
|
minRowHeight?: number;
|
|
872
1371
|
maxRowHeight?: number;
|
|
873
1372
|
rowStyle?: TypeRowStyle;
|
|
1373
|
+
rowProps?: TypeRowDOMProps | ((rowProps: TypeRowProps) => TypeRowDOMProps | undefined);
|
|
1374
|
+
rowClassName?: TypeRowClassName;
|
|
1375
|
+
renderRow?: TypeRenderRow;
|
|
1376
|
+
onRenderRow?: TypeOnRenderRow;
|
|
1377
|
+
onRowClick?: TypeOnRowClick;
|
|
1378
|
+
onRowDoubleClick?: TypeOnRowDoubleClick;
|
|
1379
|
+
onCellClick?: TypeOnCellClick;
|
|
1380
|
+
onCellDoubleClick?: TypeOnCellDoubleClick;
|
|
1381
|
+
cellDOMProps?: TypeCellDOMPropsConfig;
|
|
1382
|
+
headerDOMProps?: TypeHeaderDOMPropsConfig;
|
|
1383
|
+
showHoverRows?: boolean;
|
|
1384
|
+
showEmptyRows?: boolean;
|
|
874
1385
|
showZebraRows?: boolean;
|
|
875
1386
|
defaultShowZebraRows?: boolean;
|
|
876
1387
|
editable?: boolean;
|
|
877
1388
|
editStartEvent?: string;
|
|
1389
|
+
isStartEditKeyPressed?: (args: TypeStartEditKeyArgs) => boolean;
|
|
1390
|
+
autoFocusOnEditComplete?: boolean;
|
|
1391
|
+
autoFocusOnEditEscape?: boolean;
|
|
878
1392
|
onEditStart?: (editInfo: TypeEditInfo) => void;
|
|
879
1393
|
onEditStop?: (editInfo: TypeEditInfo) => void;
|
|
880
1394
|
onEditComplete?: (editInfo: TypeEditInfo) => void | Promise<unknown>;
|
|
881
1395
|
onEditCancel?: (editInfo: TypeEditInfo) => void;
|
|
882
1396
|
onEditValueChange?: (editInfo: TypeEditInfo) => void;
|
|
883
1397
|
onColumnResize?: (info: TypeColumnResizeInfo, context: TypeColumnResizeContext) => void;
|
|
1398
|
+
onBatchColumnResize?: (info: TypeColumnResizeInfo[], context: TypeColumnResizeContext) => void;
|
|
884
1399
|
headerHeight?: number;
|
|
885
1400
|
filterRowHeight?: number;
|
|
886
1401
|
loading?: boolean;
|
|
@@ -909,6 +1424,15 @@ export type TypeDataGridProps = {
|
|
|
909
1424
|
checkboxOnlyRowSelect?: boolean;
|
|
910
1425
|
checkboxSelectEnableShiftKey?: boolean;
|
|
911
1426
|
toggleRowSelectOnClick?: boolean;
|
|
1427
|
+
activeCell?: TypeActiveCell;
|
|
1428
|
+
defaultActiveCell?: TypeActiveCell;
|
|
1429
|
+
onActiveCellChange?: (activeCell: TypeActiveCell) => void;
|
|
1430
|
+
activeCellThrottle?: number;
|
|
1431
|
+
cellSelection?: TypeCellSelection;
|
|
1432
|
+
defaultCellSelection?: TypeCellSelection;
|
|
1433
|
+
onCellSelectionChange?: (cellSelection: TypeCellSelection) => void;
|
|
1434
|
+
cellSelectionByIndex?: boolean;
|
|
1435
|
+
toggleCellSelectOnClick?: boolean;
|
|
912
1436
|
activeIndex?: number;
|
|
913
1437
|
defaultActiveIndex?: number;
|
|
914
1438
|
onActiveIndexChange?: (activeIndex: number) => void;
|
|
@@ -938,12 +1462,34 @@ export type TypeDataGridProps = {
|
|
|
938
1462
|
*/
|
|
939
1463
|
onDidMount?: (computedPropsRef: React.MutableRefObject<TypeComputedProps | null>) => void;
|
|
940
1464
|
onReady?: (computedPropsRef: React.MutableRefObject<TypeComputedProps | null>) => void;
|
|
941
|
-
handle?: (gridApiRef: React.MutableRefObject<TypeComputedProps | null>) => void;
|
|
1465
|
+
handle?: (gridApiRef: React.MutableRefObject<TypeComputedProps | null> | null) => void;
|
|
942
1466
|
className?: string;
|
|
943
1467
|
style?: React.CSSProperties;
|
|
944
1468
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
945
1469
|
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
946
1470
|
onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
|
947
1471
|
};
|
|
1472
|
+
/**
|
|
1473
|
+
* Executable descriptor for an internally implemented Community feature.
|
|
1474
|
+
*
|
|
1475
|
+
* the-datagrid does not require consumers to install plugins. These
|
|
1476
|
+
* descriptors expose the equivalent built-in behavior for compatibility and
|
|
1477
|
+
* diagnostics without pretending that an empty placeholder is functional.
|
|
1478
|
+
*/
|
|
1479
|
+
export type TypePlugin = {
|
|
1480
|
+
readonly name: string;
|
|
1481
|
+
hook: (props: TypeDataGridProps, computedProps: TypeComputedProps, computedPropsRef: React.MutableRefObject<TypeComputedProps | null>) => unknown;
|
|
1482
|
+
defaultProps?: () => Record<string, unknown>;
|
|
1483
|
+
maybeAddColumns?: (columns: TypeColumns, props: Record<string, unknown>) => TypeColumns;
|
|
1484
|
+
renderColumnContextMenu?: (computedProps: TypeComputedProps, computedPropsRef: React.MutableRefObject<TypeComputedProps | null>) => React.ReactNode;
|
|
1485
|
+
renderRowContextMenu?: (computedProps: TypeComputedProps, computedPropsRef: React.MutableRefObject<TypeComputedProps | null>) => React.ReactNode;
|
|
1486
|
+
renderColumnFilterContextMenu?: (computedProps: TypeComputedProps, computedPropsRef: React.MutableRefObject<TypeComputedProps | null>) => React.ReactNode;
|
|
1487
|
+
};
|
|
1488
|
+
export type TypeCommunityPlugin = TypePlugin & {
|
|
1489
|
+
readonly name: "sortable-columns" | "filters" | "menus" | "cell-selection";
|
|
1490
|
+
readonly methods: readonly (keyof TypeComputedProps)[];
|
|
1491
|
+
isEnabled: (props: Readonly<TypeDataGridProps>) => boolean;
|
|
1492
|
+
getState: (computedProps: Readonly<TypeComputedProps>) => unknown;
|
|
1493
|
+
};
|
|
948
1494
|
export {};
|
|
949
1495
|
//# sourceMappingURL=types.d.ts.map
|