@opencorestack/opengridx 3.5.1 → 3.7.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/CHANGELOG.md +53 -0
- package/README.md +2 -0
- package/dist/ai.cjs +4 -2
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.es.js +4 -2
- package/dist/ai.es.js.map +1 -1
- package/dist/index.d.ts +62 -0
- package/dist/opengridx.css +1 -1
- package/dist/opengridx.es.js +9643 -9024
- package/dist/opengridx.es.js.map +1 -1
- package/dist/opengridx.umd.js +16 -16
- package/dist/opengridx.umd.js.map +1 -1
- package/docs/API_REFERENCE.md +17 -3
- package/docs/README.md +2 -0
- package/docs/architecture/datagrid-orchestration.md +46 -29
- package/docs/architecture/grid-row-meta.md +1 -1
- package/docs/customization/slots-api.md +1 -1
- package/docs/customization/theming.md +43 -0
- package/docs/features/ai-toolkit.md +2 -2
- package/docs/features/export-guide.md +2 -0
- package/docs/features/header-filters.md +34 -0
- package/docs/features/keyboard-navigation.md +2 -0
- package/docs/features/nextjs.md +241 -0
- package/docs/features/pdf-export.md +2 -0
- package/docs/features/pinning.md +2 -0
- package/docs/features/rtl.md +58 -0
- package/docs/features/virtualization.md +16 -2
- package/docs/performance.md +89 -119
- package/docs/roadmap.md +4 -2
- package/lib/ai/promptHandler.ts +12 -8
- package/lib/ai/validate.ts +5 -2
- package/lib/components/AiAssistant/GridAiAssistantPanel.css +4 -2
- package/lib/components/Cell/Cell.css +31 -9
- package/lib/components/Cell/Cell.tsx +2 -2
- package/lib/components/ColumnGroupHeader/ColumnGroupHeader.css +4 -4
- package/lib/components/ColumnResizeHandle/ColumnResizeHandle.css +3 -3
- package/lib/components/ColumnResizeHandle/ColumnResizeHandle.tsx +18 -2
- package/lib/components/ColumnVisibilityPanel/ColumnVisibilityPanel.css +3 -1
- package/lib/components/DataGrid/DataGrid.css +19 -13
- package/lib/components/DataGrid/DataGrid.tsx +163 -670
- package/lib/components/DataGrid/GridAggregationFooter.tsx +3 -3
- package/lib/components/DataGrid/GridListView.tsx +3 -1
- package/lib/components/DataGrid/GridRoot.tsx +239 -0
- package/lib/components/DataGrid/GridViewport.tsx +314 -0
- package/lib/components/FilterPanel/FilterPanel.css +9 -8
- package/lib/components/Header/ColumnMenu.css +5 -4
- package/lib/components/Header/ColumnMenu.tsx +14 -6
- package/lib/components/Header/Header.css +23 -14
- package/lib/components/Header/Header.tsx +16 -9
- package/lib/components/Header/headerColumnStyle.ts +3 -2
- package/lib/components/HeaderFilter/HeaderFilter.css +9 -3
- package/lib/components/HeaderFilter/HeaderFilterCell.tsx +21 -18
- package/lib/components/HeaderFilter/HeaderFilterOperatorMenu.tsx +5 -4
- package/lib/components/HeaderFilter/HeaderFilterRow.tsx +9 -3
- package/lib/components/ListView/ListViewRow.tsx +1 -1
- package/lib/components/Pagination/Pagination.css +5 -1
- package/lib/components/Pagination/Pagination.tsx +4 -4
- package/lib/components/Row/Row.css +2 -2
- package/lib/components/Row/Row.tsx +3 -3
- package/lib/components/SkeletonRow/SkeletonRow.tsx +2 -2
- package/lib/components/Toolbar/GridToolbar.css +8 -7
- package/lib/components/Toolbar/GridToolbar.tsx +8 -28
- package/lib/components/Toolbar/PivotPanel.css +3 -3
- package/lib/components/Toolbar/PivotPanel.tsx +4 -7
- package/lib/components/ui/ExpandIcon.css +13 -0
- package/lib/components/ui/ExpandIcon.tsx +2 -4
- package/lib/hooks/core/useGridCellSelection.ts +20 -5
- package/lib/hooks/core/useGridColumns.tsx +2 -2
- package/lib/hooks/core/useGridDevWarnings.ts +3 -1
- package/lib/hooks/core/useGridEditPipeline.ts +55 -0
- package/lib/hooks/core/useGridKeyboardNavigation.ts +7 -4
- package/lib/hooks/core/useGridRangeEditing.ts +129 -0
- package/lib/hooks/core/useGridRenderWindow.ts +66 -0
- package/lib/hooks/core/useGridScrollSync.ts +28 -5
- package/lib/hooks/core/useGridScrollViewport.ts +42 -0
- package/lib/hooks/core/useGridSelectionAndStateApi.ts +61 -0
- package/lib/hooks/core/useGridToolbarStack.ts +49 -0
- package/lib/hooks/core/useGridViewApis.ts +46 -0
- package/lib/hooks/core/useLayout.ts +13 -6
- package/lib/hooks/useRowGrouping.ts +9 -9
- package/lib/styles/base/variables.css +12 -0
- package/lib/theme/DataGridThemeProvider.tsx +15 -0
- package/lib/theme/__baseline__/default-theme.darwin.chromium.json +1503 -0
- package/lib/theme/__baseline__/default-theme.darwin.firefox.json +1503 -0
- package/lib/theme/__baseline__/default-theme.darwin.webkit.json +1503 -0
- package/lib/theme/types.ts +31 -0
- package/lib/types/ai.ts +109 -0
- package/lib/types/api.ts +169 -0
- package/lib/types/columns.ts +341 -0
- package/lib/types/dataSource.ts +40 -0
- package/lib/types/editing.ts +77 -0
- package/lib/types/export.ts +164 -0
- package/lib/types/filtering.ts +52 -0
- package/lib/types/grouping.ts +27 -0
- package/lib/types/index.ts +18 -1672
- package/lib/types/locale.ts +51 -0
- package/lib/types/props.ts +405 -0
- package/lib/types/rows.ts +132 -0
- package/lib/types/selection.ts +66 -0
- package/lib/types/slots.ts +56 -0
- package/lib/types/sorting.ts +25 -0
- package/lib/types/state.ts +35 -0
- package/lib/utils/aggregation/index.ts +56 -1
- package/lib/utils/direction.ts +52 -0
- package/lib/utils/export/exportToExcelAdvanced.ts +9 -2
- package/lib/utils/export/exportToPdf.ts +2 -1
- package/lib/utils/filtering/index.ts +58 -6
- package/lib/utils/headerFilterLocale.ts +37 -0
- package/lib/utils/scroll/index.ts +5 -3
- package/lib/utils/sorting/index.ts +141 -26
- package/lib/utils/values.ts +10 -6
- package/llms.txt +4 -2
- package/package.json +4 -2
package/lib/theme/types.ts
CHANGED
|
@@ -90,6 +90,13 @@ export interface GridThemeOverlays {
|
|
|
90
90
|
itemSelectedText?: string;
|
|
91
91
|
itemDangerBackground?: string;
|
|
92
92
|
itemDangerText?: string;
|
|
93
|
+
|
|
94
|
+
/** Font of column menus, header filter menus, toolbar panels and the AI panel (`--ogx-overlay-font-family`). Default: the grid font. @since v3.7 */
|
|
95
|
+
fontFamily?: string;
|
|
96
|
+
/** Weight of menu items and panel labels (`--ogx-overlay-font-weight`). Default: each item's own weight (400, labels 500). @since v3.7 */
|
|
97
|
+
fontWeight?: string;
|
|
98
|
+
/** Size of menu items and panel labels (`--ogx-overlay-font-size`). Default: `--ogx-font-size-xs` (the AI panel: `--ogx-font-size-sm`). @since v3.7 */
|
|
99
|
+
fontSize?: string;
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
export interface GridThemeScrollbar {
|
|
@@ -145,8 +152,32 @@ export interface GridThemeGrid {
|
|
|
145
152
|
cellFontSize?: string;
|
|
146
153
|
/** Font size of header cells (`--ogx-grid-header-font-size`, default 13px). */
|
|
147
154
|
headerFontSize?: string;
|
|
155
|
+
/** Font of header cells (`--ogx-grid-header-font-family`). Default: the grid font. @since v3.7 */
|
|
156
|
+
headerFontFamily?: string;
|
|
157
|
+
/** Weight of header cells (`--ogx-grid-header-font-weight`). Default: `600`. @since v3.7 */
|
|
158
|
+
headerFontWeight?: string;
|
|
159
|
+
/** Font of body cells (`--ogx-grid-cell-font-family`). Default: the grid font. @since v3.7 */
|
|
160
|
+
cellFontFamily?: string;
|
|
161
|
+
/** Weight of body cells (`--ogx-grid-cell-font-weight`). Default: inherited (400). @since v3.7 */
|
|
162
|
+
cellFontWeight?: string;
|
|
148
163
|
cellPaddingX?: string;
|
|
149
164
|
cellPaddingY?: string;
|
|
165
|
+
/** Horizontal padding of header cells (`--ogx-grid-header-padding-x`). Default: `cellPaddingX`. @since v3.7 */
|
|
166
|
+
headerPaddingX?: string;
|
|
167
|
+
/** Width of the grid's outer border (`--ogx-grid-border-width`). Default: `1px`. @since v3.7 */
|
|
168
|
+
borderWidth?: string;
|
|
169
|
+
/** Corner radius of the grid (`--ogx-grid-border-radius`). Default: `borders.radiusLg` (12px). @since v3.7 */
|
|
170
|
+
borderRadius?: string;
|
|
171
|
+
/** Width of the lines between body cells, aggregation footer cells and pinned sections (`--ogx-grid-column-divider-width`). Default: `1px`; `0` hides them. @since v3.7 */
|
|
172
|
+
columnDividerWidth?: string;
|
|
173
|
+
/** Width of the short separators between header and column-group cells (`--ogx-grid-header-column-divider-width`). Default: `1px`; `0` hides them. @since v3.7 */
|
|
174
|
+
headerColumnDividerWidth?: string;
|
|
175
|
+
/** Width of the lines under rows, the header row, column-group rows and the header filter row (`--ogx-grid-row-divider-width`). Default: `1px`; `0` hides them. @since v3.7 */
|
|
176
|
+
rowDividerWidth?: string;
|
|
177
|
+
/** Colour of the column dividers (`--ogx-grid-column-divider-color`). Default: `borderColor`. @since v3.7 */
|
|
178
|
+
columnDividerColor?: string;
|
|
179
|
+
/** Colour of the row dividers (`--ogx-grid-row-divider-color`). Default: `borderColor`. @since v3.7 */
|
|
180
|
+
rowDividerColor?: string;
|
|
150
181
|
background?: string;
|
|
151
182
|
borderColor?: string;
|
|
152
183
|
headerBackground?: string;
|
package/lib/types/ai.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { GridColumnVisibilityModel } from './columns';
|
|
2
|
+
import type { GridSortItem } from './sorting';
|
|
3
|
+
import type { GridFilterModel } from './filtering';
|
|
4
|
+
import type { GridRowGroupingModel, GridAggregationModel, GridPivotModel } from './grouping';
|
|
5
|
+
|
|
6
|
+
/** A part of the grid state a model may change. @since v3.4 */
|
|
7
|
+
export type GridAiPart = 'filter' | 'sort' | 'grouping' | 'aggregation' | 'pivot' | 'columnVisibility';
|
|
8
|
+
|
|
9
|
+
/** Grid state as the AI toolkit reads and writes it. Only the parts present are applied. @since v3.4 */
|
|
10
|
+
export interface GridAiState {
|
|
11
|
+
filterModel?: GridFilterModel;
|
|
12
|
+
sortModel?: GridSortItem[];
|
|
13
|
+
rowGroupingModel?: GridRowGroupingModel;
|
|
14
|
+
aggregationModel?: GridAggregationModel;
|
|
15
|
+
pivotModel?: GridPivotModel;
|
|
16
|
+
columnVisibilityModel?: GridColumnVisibilityModel;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** One thing the validator dropped or could not use. `path` points into the model output. @since v3.4 */
|
|
20
|
+
export interface GridAiValidationError {
|
|
21
|
+
path: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** One earlier prompt of this session and the state the assistant applied for it. @since v3.5 */
|
|
26
|
+
export interface GridAiHistoryEntry {
|
|
27
|
+
prompt: string;
|
|
28
|
+
applied: GridAiState;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What `aiAssistant.onPrompt` receives next to the prompt. @since v3.5 */
|
|
32
|
+
export interface GridAiPromptContext {
|
|
33
|
+
/** The grid's current models (`apiRef.getGridAiState()`). */
|
|
34
|
+
currentState: GridAiState;
|
|
35
|
+
/** Earlier prompts of this session, oldest first. */
|
|
36
|
+
history: GridAiHistoryEntry[];
|
|
37
|
+
/** Aborted when the user presses Stop, sends another prompt or closes the panel. */
|
|
38
|
+
signal: AbortSignal;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* What `aiAssistant.onPrompt` resolves with. The grid applies it only when its `state` comes from
|
|
43
|
+
* `validateGridAiState` (or `createGridAiPromptHandler`), which brands the result and its `state`.
|
|
44
|
+
* @since v3.5
|
|
45
|
+
*/
|
|
46
|
+
export interface GridAiPromptResult {
|
|
47
|
+
state: GridAiState;
|
|
48
|
+
/** What the validator dropped; shown as "Ignored: …". */
|
|
49
|
+
errors: GridAiValidationError[];
|
|
50
|
+
/** The assistant's reply text, shown in the panel. */
|
|
51
|
+
message?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The `aiAssistant` prop: the "Ask AI" prompt panel. @since v3.5 */
|
|
55
|
+
export interface GridAiAssistantOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Answers a prompt. Call your own model and return the validated result: `createGridAiPromptHandler`
|
|
58
|
+
* from `@opencorestack/opengridx/ai` builds this function, or call `validateGridAiState` yourself.
|
|
59
|
+
*/
|
|
60
|
+
onPrompt: (prompt: string, context: GridAiPromptContext) => Promise<GridAiPromptResult>;
|
|
61
|
+
/** Placeholder of the prompt input. Default: `"Ask about this table…"` */
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
/** Example prompts shown as clickable chips. */
|
|
64
|
+
suggestions?: string[];
|
|
65
|
+
/** Shows a microphone button where the browser has speech recognition; the microphone is asked for only on click. Default: true. */
|
|
66
|
+
voice?: boolean;
|
|
67
|
+
/** The parts of the state the assistant may change. Default: every part. */
|
|
68
|
+
parts?: GridAiPart[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** One change the assistant applied, shown as a removable chip. @since v3.5 */
|
|
72
|
+
export interface GridAiChip {
|
|
73
|
+
id: string;
|
|
74
|
+
part: GridAiPart;
|
|
75
|
+
label: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The assistant panel's state. @since v3.5 */
|
|
79
|
+
export type GridAiAssistantStatus = 'idle' | 'running' | 'applied' | 'stopped' | 'error';
|
|
80
|
+
|
|
81
|
+
/** Props of `slots.aiAssistantPanel` and the built-in panel, rendered while the panel is open. @since v3.5 */
|
|
82
|
+
export interface GridAiAssistantPanelProps {
|
|
83
|
+
status: GridAiAssistantStatus;
|
|
84
|
+
/** The status line: "Thinking…", "Applied 3 changes", an error. */
|
|
85
|
+
statusText: string;
|
|
86
|
+
/** The assistant's reply text (`result.message`). */
|
|
87
|
+
message: string | null;
|
|
88
|
+
/** What the last reply asked for that was ignored. */
|
|
89
|
+
errors: GridAiValidationError[];
|
|
90
|
+
/** The changes the last reply applied. */
|
|
91
|
+
chips: GridAiChip[];
|
|
92
|
+
/** Earlier prompts of this session, oldest first. */
|
|
93
|
+
history: GridAiHistoryEntry[];
|
|
94
|
+
suggestions: string[];
|
|
95
|
+
placeholder: string;
|
|
96
|
+
/** `voice` is on and this browser has speech recognition. */
|
|
97
|
+
voiceAvailable: boolean;
|
|
98
|
+
/** Undo can restore the state from before the last reply. */
|
|
99
|
+
canUndo: boolean;
|
|
100
|
+
submit: (prompt: string) => void;
|
|
101
|
+
/** Aborts the running request. */
|
|
102
|
+
stop: () => void;
|
|
103
|
+
/** Restores the state from before the last reply. */
|
|
104
|
+
undo: () => void;
|
|
105
|
+
/** Re-applies the last reply without this change. */
|
|
106
|
+
removeChip: (id: string) => void;
|
|
107
|
+
/** Closes the panel; focus returns to where it was before it opened. */
|
|
108
|
+
close: () => void;
|
|
109
|
+
}
|
package/lib/types/api.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { GridRowId, GridRowModel, GridValidRowModel } from './rows';
|
|
2
|
+
import type { GridColDef, GridColumnVisibilityModel } from './columns';
|
|
3
|
+
import type { GridSortDirection, GridSortItem } from './sorting';
|
|
4
|
+
import type { GridFilterModel } from './filtering';
|
|
5
|
+
import type { GridBatchEditResult } from './editing';
|
|
6
|
+
import type { GridGroupedExportRow } from './export';
|
|
7
|
+
import type { GridCellCoordinates, GridCellSelectionModel, GridSelectedCell } from './selection';
|
|
8
|
+
import type { GridRowGroupingModel, GridAggregationModel, GridPivotModel } from './grouping';
|
|
9
|
+
import type { GridAiState } from './ai';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The Imperative API for interacting with the DataGrid.
|
|
13
|
+
* Access this via the `apiRef` prop or a ref passed to the component.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The imperative grid API. `R` types the row getters (`getRow`, `getAllRows`, `getVisibleRows`,
|
|
17
|
+
* `getAllFilteredRows`); it defaults to `GridRowModel`, so `GridApi` alone keeps working.
|
|
18
|
+
*/
|
|
19
|
+
export interface GridApi<R extends GridValidRowModel = GridRowModel> {
|
|
20
|
+
/**
|
|
21
|
+
* Returns the row model with the given ID.
|
|
22
|
+
* @param id The row unique ID.
|
|
23
|
+
*/
|
|
24
|
+
getRow: (id: GridRowId) => R | null;
|
|
25
|
+
/** Returns all rows currently loaded into the grid. */
|
|
26
|
+
getAllRows: () => R[];
|
|
27
|
+
/** Returns all rows currently visible after filtering and sorting. */
|
|
28
|
+
getVisibleRows: () => R[];
|
|
29
|
+
/** Returns all filtered and sorted rows, ignoring pagination. Use this for full-dataset exports. */
|
|
30
|
+
getAllFilteredRows: () => R[];
|
|
31
|
+
/**
|
|
32
|
+
* Returns an ordered flat list of `GridGroupedExportRow` entries that mirrors the
|
|
33
|
+
* on-screen grouping tree: group-headers, leaf rows, per-group subtotals, and a
|
|
34
|
+
* grand-total entry at the end. Returns `null` when no `rowGroupingModel` is active.
|
|
35
|
+
* Pass the result to export functions that accept a `groupedRows` option.
|
|
36
|
+
*/
|
|
37
|
+
getGroupedExportRows: () => GridGroupedExportRow[] | null;
|
|
38
|
+
/** Returns the current aggregation results. */
|
|
39
|
+
getAggregationResult: () => Record<string, unknown> | null;
|
|
40
|
+
/** Returns the active aggregation configuration. */
|
|
41
|
+
getAggregationModel: () => GridAggregationModel | null;
|
|
42
|
+
|
|
43
|
+
/** Returns the column definition for the given field. */
|
|
44
|
+
getColumn: (field: string) => GridColDef | null;
|
|
45
|
+
/** Returns all defined columns. */
|
|
46
|
+
getAllColumns: () => GridColDef[];
|
|
47
|
+
/** Returns all columns currently visible. */
|
|
48
|
+
getVisibleColumns: () => GridColDef[];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Sets the selection state of a specific row.
|
|
52
|
+
* @param id The row unique ID.
|
|
53
|
+
* @param isSelected Visibility state.
|
|
54
|
+
*/
|
|
55
|
+
selectRow: (id: GridRowId, isSelected?: boolean) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Sets the selection state for multiple rows at once.
|
|
58
|
+
* @param ids Array of row IDs.
|
|
59
|
+
* @param isSelected Visibility state.
|
|
60
|
+
*/
|
|
61
|
+
selectRows: (ids: GridRowId[], isSelected?: boolean) => void;
|
|
62
|
+
/** Returns an array of IDs for all currently selected rows. */
|
|
63
|
+
getSelectedRows: () => GridRowId[];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Triggers sorting on a specific column.
|
|
67
|
+
* @param field The column field.
|
|
68
|
+
* @param direction Sort order ('asc', 'desc', or null to clear).
|
|
69
|
+
*/
|
|
70
|
+
sortColumn: (field: string, direction: GridSortDirection) => void;
|
|
71
|
+
/** Returns the active sorting model. */
|
|
72
|
+
getSortModel: () => GridSortItem[];
|
|
73
|
+
|
|
74
|
+
/** Programmatically sets the filtering model. */
|
|
75
|
+
setFilterModel: (model: GridFilterModel) => void;
|
|
76
|
+
/** Returns the current filtering model. */
|
|
77
|
+
getFilterModel: () => GridFilterModel;
|
|
78
|
+
|
|
79
|
+
/** Changes the current page. */
|
|
80
|
+
setPage: (page: number) => void;
|
|
81
|
+
/** Changes the current page size. */
|
|
82
|
+
setPageSize: (pageSize: number) => void;
|
|
83
|
+
|
|
84
|
+
/** Scrolls the grid viewport to a specific row or column index. */
|
|
85
|
+
scrollToIndexes: (params: { rowIndex?: number; colIndex?: number }) => void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Sizes a column to fit its header and the cells rendered right now (the virtualization window),
|
|
89
|
+
* clamped to `minWidth` (default 50px) / `maxWidth`, like double-clicking its resize handle.
|
|
90
|
+
* Does nothing for `resizable: false` columns or a column that is not rendered.
|
|
91
|
+
* A flex column gets a fixed width. @since v3.1
|
|
92
|
+
*/
|
|
93
|
+
autosizeColumn: (field: string) => void;
|
|
94
|
+
/** `autosizeColumn` for several columns (default: every column). @since v3.1 */
|
|
95
|
+
autosizeColumns: (fields?: readonly string[]) => void;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Programmatically copies all currently selected rows to the clipboard as TSV: every selected
|
|
99
|
+
* row that passes the filter (other pages, collapsed groups and pinned rows included), with the
|
|
100
|
+
* visible columns in screen order. Equivalent to the user pressing Ctrl+C / Cmd+C.
|
|
101
|
+
* @returns A Promise that resolves when the text is written (or when no selected row was found,
|
|
102
|
+
* in which case nothing is written) and rejects when the clipboard write fails.
|
|
103
|
+
*/
|
|
104
|
+
copySelectedRows: () => Promise<void>;
|
|
105
|
+
|
|
106
|
+
/** The cell selection (`[]` when `cellSelection` is off or nothing is selected). @since v3.3 */
|
|
107
|
+
getCellSelectionModel: () => GridCellSelectionModel;
|
|
108
|
+
/**
|
|
109
|
+
* Replaces the cell selection (only the first range is kept) and moves focus to its anchor.
|
|
110
|
+
* Does nothing while `cellSelection` is off. @since v3.3
|
|
111
|
+
*/
|
|
112
|
+
setCellSelectionModel: (model: GridCellSelectionModel) => void;
|
|
113
|
+
/** Selects the rectangle between two cells; `anchor` becomes the active cell. @since v3.3 */
|
|
114
|
+
selectCellRange: (anchor: GridCellCoordinates, head: GridCellCoordinates) => void;
|
|
115
|
+
/** Empties the cell selection. Focus stays where it is. @since v3.3 */
|
|
116
|
+
clearCellSelection: () => void;
|
|
117
|
+
/**
|
|
118
|
+
* Cells of the current range in display order (row by row, columns in screen order), values read
|
|
119
|
+
* through the column's `valueGetter`. Synthetic rows (group headers, subtotals, tree auto-parents, the
|
|
120
|
+
* pivot Grand Total) and positions covered by a span are left out. @since v3.3
|
|
121
|
+
*/
|
|
122
|
+
getSelectedCells: () => GridSelectedCell[];
|
|
123
|
+
/**
|
|
124
|
+
* Copies the cell range (the focused cell when nothing is selected) as tab-separated text, formatted
|
|
125
|
+
* the way the cells show it, with no header line. Resolves without writing when there is nothing to
|
|
126
|
+
* copy; rejects when the clipboard write fails. @since v3.3
|
|
127
|
+
*/
|
|
128
|
+
copySelectedCells: () => Promise<void>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Pastes tab-separated text as Ctrl/Cmd+V does: from `anchor` (default: the range's top-left cell,
|
|
132
|
+
* else the focused cell), with `onBeforeClipboardPaste` and `onClipboardPaste`. Works with
|
|
133
|
+
* `disableClipboardPaste`. Resolves once every row's `processRowUpdate` has settled. @since v3.4
|
|
134
|
+
*/
|
|
135
|
+
pasteText: (text: string, anchor?: GridCellCoordinates) => Promise<GridBatchEditResult>;
|
|
136
|
+
/** Undoes the last action (`undoRedo`). Resolves with what was written. @since v3.4 */
|
|
137
|
+
undo: () => Promise<GridBatchEditResult>;
|
|
138
|
+
/** Redoes the last undone action (`undoRedo`). @since v3.4 */
|
|
139
|
+
redo: () => Promise<GridBatchEditResult>;
|
|
140
|
+
/** Whether there is an action to undo. @since v3.4 */
|
|
141
|
+
canUndo: () => boolean;
|
|
142
|
+
/** Whether there is an undone action to redo. @since v3.4 */
|
|
143
|
+
canRedo: () => boolean;
|
|
144
|
+
/** Forgets every action (undo and redo). @since v3.4 */
|
|
145
|
+
clearHistory: () => void;
|
|
146
|
+
|
|
147
|
+
/** Replaces the sort model (fires `onSortModelChange`). @since v3.5 */
|
|
148
|
+
setSortModel: (model: GridSortItem[]) => void;
|
|
149
|
+
/** Replaces the row grouping model (fires `onRowGroupingModelChange`). @since v3.5 */
|
|
150
|
+
setRowGroupingModel: (model: GridRowGroupingModel) => void;
|
|
151
|
+
/** Replaces the aggregation model (fires `onAggregationModelChange`). @since v3.5 */
|
|
152
|
+
setAggregationModel: (model: GridAggregationModel) => void;
|
|
153
|
+
/** Replaces the column visibility model (fires `onColumnVisibilityModelChange`). @since v3.5 */
|
|
154
|
+
setColumnVisibilityModel: (model: GridColumnVisibilityModel) => void;
|
|
155
|
+
/** Replaces the pivot model (fires `onPivotModelChange`). @since v3.5 */
|
|
156
|
+
setPivotModel: (model: GridPivotModel) => void;
|
|
157
|
+
/**
|
|
158
|
+
* The current filter, sort, grouping, aggregation, pivot and column visibility models, in the shape
|
|
159
|
+
* of the AI toolkit (`GridAiState`). @since v3.5
|
|
160
|
+
*/
|
|
161
|
+
getGridAiState: () => GridAiState;
|
|
162
|
+
/** Opens the `aiAssistant` panel (does nothing without `aiAssistant`). @since v3.5 */
|
|
163
|
+
openAiAssistant: () => void;
|
|
164
|
+
/** Closes the `aiAssistant` panel. @since v3.5 */
|
|
165
|
+
closeAiAssistant: () => void;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ── AI toolkit (v3.4 state types; v3.5 assistant) ──────────────────────────────────────────────────
|
|
169
|
+
// Type-only and React-free: the `@opencorestack/opengridx/ai` entry point re-exports them.
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import type { GridRowModel, GridValidRowModel, GridRowMeta } from './rows';
|
|
2
|
+
import type { GridSortCellParams } from './sorting';
|
|
3
|
+
import type { GridFilterOperator } from './filtering';
|
|
4
|
+
import type { GridFillValueParams } from './editing';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A callback that is checked bivariantly in its parameter, like a method. Used for `GridColDef`
|
|
8
|
+
* options that are either a value or a function, so a column typed for your rows (`GridColDef<Row>`)
|
|
9
|
+
* can still be used where an untyped `GridColDef` is expected.
|
|
10
|
+
*/
|
|
11
|
+
type GridColDefCallback<P, T> = { bivarianceHack(params: P): T }['bivarianceHack'];
|
|
12
|
+
|
|
13
|
+
export type GridAlignment = 'left' | 'center' | 'right';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Metadata for a single column.
|
|
17
|
+
* Governs rendering, sorting, filtering, and data transformation.
|
|
18
|
+
*/
|
|
19
|
+
export interface GridColDef<R extends GridValidRowModel = GridRowModel> {
|
|
20
|
+
/** The unique identifier for the column, typically matching a row object key. */
|
|
21
|
+
field: string;
|
|
22
|
+
/** Text displayed in the column header. */
|
|
23
|
+
headerName?: string;
|
|
24
|
+
/** Tooltip shown on header hover — used as the column's accessibility label. */
|
|
25
|
+
description?: string;
|
|
26
|
+
/** If true, this column can be used as a grouping dimension. */
|
|
27
|
+
groupable?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Custom formatter for the group-header label when this column is used as a grouping field.
|
|
31
|
+
* Receives the field name and grouped value; return the string to display.
|
|
32
|
+
* Falls back to `"field: value"` when omitted.
|
|
33
|
+
*/
|
|
34
|
+
groupingValueFormatter?: (params: { field: string; value: unknown }) => string;
|
|
35
|
+
|
|
36
|
+
/** If true, this column can be summarized using aggregation functions. */
|
|
37
|
+
aggregable?: boolean;
|
|
38
|
+
/** Restricts which aggregation functions are offered for this column (e.g., ['sum', 'avg']). */
|
|
39
|
+
availableAggregationFunctions?: string[];
|
|
40
|
+
|
|
41
|
+
/** Width in pixels or a percentage string. Defaults to automatic calculation. */
|
|
42
|
+
width?: number | string;
|
|
43
|
+
/** Minimum width in pixels. */
|
|
44
|
+
minWidth?: number;
|
|
45
|
+
/** Maximum width in pixels. */
|
|
46
|
+
maxWidth?: number;
|
|
47
|
+
/** Relative flex weight used when distributing extra space. */
|
|
48
|
+
flex?: number;
|
|
49
|
+
/** Content alignment within cells. */
|
|
50
|
+
align?: GridAlignment;
|
|
51
|
+
/** Content alignment within the header cell. */
|
|
52
|
+
headerAlign?: GridAlignment;
|
|
53
|
+
/**
|
|
54
|
+
* Wraps this column's header title onto several lines instead of cutting it with an ellipsis.
|
|
55
|
+
* Overrides the grid's `wrapHeaderText`. The header keeps `headerHeight`: the title shows as many
|
|
56
|
+
* lines as fit and ends in an ellipsis if it is still longer. Raise `headerHeight` for more lines.
|
|
57
|
+
*/
|
|
58
|
+
wrapHeaderText?: boolean;
|
|
59
|
+
/** If false, sorting is disabled for this column. */
|
|
60
|
+
sortable?: boolean;
|
|
61
|
+
/** If false, filtering is disabled for this column. */
|
|
62
|
+
filterable?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Set to `false` to leave this column's cell in the header filter row (`headerFilters`) empty.
|
|
65
|
+
* Columns with `filterable: false` or `type: 'image'` have no header filter either.
|
|
66
|
+
* @since v3.5
|
|
67
|
+
*/
|
|
68
|
+
headerFilter?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The operator a new header filter (`headerFilters`) for this column starts with. Defaults by type:
|
|
71
|
+
* `contains` (string), `=` (number), `is` (date, boolean, singleSelect).
|
|
72
|
+
* @since v3.5
|
|
73
|
+
*/
|
|
74
|
+
headerFilterOperator?: GridFilterOperator;
|
|
75
|
+
/** If false, the user cannot manually resize this column. */
|
|
76
|
+
resizable?: boolean;
|
|
77
|
+
/** If false, the column cannot be hidden via the UI. */
|
|
78
|
+
hideable?: boolean;
|
|
79
|
+
/** If false, the column cannot be pinned. */
|
|
80
|
+
pinnable?: boolean;
|
|
81
|
+
/** Internal: marks this column as a virtual spacer used for horizontal virtualization. */
|
|
82
|
+
isSpacer?: boolean;
|
|
83
|
+
/** Type used to determine default operators and formatting logic. */
|
|
84
|
+
type?: 'string' | 'number' | 'date' | 'boolean' | 'singleSelect' | 'image';
|
|
85
|
+
/** Options used for 'singleSelect' type. */
|
|
86
|
+
valueOptions?: Array<string | number | { value: unknown; label: string }>;
|
|
87
|
+
|
|
88
|
+
// The row callbacks below are declared as methods so that `GridColDef<Row>` stays assignable to an
|
|
89
|
+
// untyped `GridColDef` (method parameters are checked bivariantly).
|
|
90
|
+
/** Function to compute a cell value from raw row data. */
|
|
91
|
+
valueGetter?(params: GridValueGetterParams<R>): unknown;
|
|
92
|
+
/**
|
|
93
|
+
* Maps an edited value back onto the row when an edit is committed; return the updated row.
|
|
94
|
+
* Needed for editable columns with a `valueGetter`, whose value is not stored in `row[field]`.
|
|
95
|
+
* Without it the commit writes `row[field] = value`.
|
|
96
|
+
* @since v3.0
|
|
97
|
+
*/
|
|
98
|
+
valueSetter?(params: GridValueSetterParams<R>): R;
|
|
99
|
+
/**
|
|
100
|
+
* Turns pasted text into this column's value (clipboard paste), instead of the default parser for
|
|
101
|
+
* the column `type` (see `docs/features/clipboard.md`). Use it for locales such as `1.234,5` or for
|
|
102
|
+
* custom codes. Throw (or return `undefined`) to reject the text: the cell is skipped with reason
|
|
103
|
+
* `'invalidValue'`. The value then goes through `valueSetter` and `processRowUpdate` like an edit.
|
|
104
|
+
* @since v3.4
|
|
105
|
+
*/
|
|
106
|
+
valueParser?(text: string, params: GridValueParserParams<R>): unknown;
|
|
107
|
+
/**
|
|
108
|
+
* Custom ascending comparator for client-side sorting by this column, used instead of the built-in
|
|
109
|
+
* type-aware comparison. `v1` / `v2` are the cell values (`valueGetter` applied) and **include
|
|
110
|
+
* `null` / `undefined`**, so the comparator decides where empty values go. The grid reverses the
|
|
111
|
+
* result for 'desc' and chains it with the other sort keys in a multi-sort. Row grouping uses the
|
|
112
|
+
* grouping column's comparator to order groups by their grouping value. A comparator that throws
|
|
113
|
+
* or returns NaN is read as 0 (with a one-time dev warning). Ignored with `sortingMode="server"`.
|
|
114
|
+
* @since v3.1
|
|
115
|
+
*/
|
|
116
|
+
sortComparator?(v1: unknown, v2: unknown, params1: GridSortCellParams<R>, params2: GridSortCellParams<R>): number;
|
|
117
|
+
/**
|
|
118
|
+
* Decides the value the fill handle (or Ctrl/Cmd+D, Ctrl/Cmd+R) writes into a cell of this column.
|
|
119
|
+
* `params.value` is what the grid would write (a continued series, the repeated pattern or a copy);
|
|
120
|
+
* return it to keep that, or any other value. A throw skips the cell with reason `'invalidValue'`.
|
|
121
|
+
* The value then goes through `valueSetter` and `processRowUpdate` like an edit. @since v3.5
|
|
122
|
+
*/
|
|
123
|
+
fillValue?(params: GridFillValueParams<R>): unknown;
|
|
124
|
+
/** Function to format a value into a human-readable string. */
|
|
125
|
+
valueFormatter?(params: GridValueFormatterParams<R>): string;
|
|
126
|
+
/** Custom component or element to render in the cell. */
|
|
127
|
+
renderCell?(params: GridRenderCellParams<R>): React.ReactNode;
|
|
128
|
+
/** Custom component or element to render in the header. */
|
|
129
|
+
renderHeader?(params: GridRenderHeaderParams): React.ReactNode;
|
|
130
|
+
/** Component to render when the cell is in edit mode. Receives `onValueChange`, `onCommit` and `onCancel`. */
|
|
131
|
+
renderEditCell?(params: GridRenderEditCellParams<R>): React.ReactNode;
|
|
132
|
+
/** If true, the cell's value can be modified by the user. */
|
|
133
|
+
editable?: boolean;
|
|
134
|
+
/** Optional stacking order (CSS z-index). */
|
|
135
|
+
zIndex?: number;
|
|
136
|
+
/** If true, the column kebab/hamburger menu is disabled. */
|
|
137
|
+
disableColumnMenu?: boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Number of columns this cell should occupy horizontally: the origin plus the next visible columns
|
|
141
|
+
* in render order, clamped to the end of the origin's pinned section. Fractions are floored,
|
|
142
|
+
* `Infinity` means "to the end", and NaN / values below 1 mean no span. `params.value` is the
|
|
143
|
+
* `valueGetter` result. A function that throws is treated as 1.
|
|
144
|
+
*/
|
|
145
|
+
colSpan?: number | GridColDefCallback<GridRenderCellParams<R>, number>;
|
|
146
|
+
/**
|
|
147
|
+
* Number of rows this cell should occupy vertically, clamped to the end of its row section
|
|
148
|
+
* (top-pinned, scrolling or bottom-pinned rows) and to the first row with an expanded detail
|
|
149
|
+
* panel. Normalised like `colSpan`. With both set, the origin covers the whole rectangle.
|
|
150
|
+
*/
|
|
151
|
+
rowSpan?: number | GridColDefCallback<GridRenderCellParams<R>, number>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Custom CSS class applied to every cell in this column.
|
|
155
|
+
* Can be a static string or a function that receives the cell params and returns a string.
|
|
156
|
+
* Useful for per-row conditional styling without custom renderCell.
|
|
157
|
+
* @example
|
|
158
|
+
* cellClassName: 'my-class'
|
|
159
|
+
* cellClassName: ({ value }) => value > 100 ? 'cell--high' : 'cell--low'
|
|
160
|
+
*/
|
|
161
|
+
cellClassName?: string | GridColDefCallback<GridRenderCellParams<R>, string>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Custom CSS class applied to the header cell of this column.
|
|
165
|
+
* @example
|
|
166
|
+
* headerClassName: 'my-header'
|
|
167
|
+
*/
|
|
168
|
+
headerClassName?: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* If false, this column is excluded from all exports (CSV, Excel, JSON, Print).
|
|
172
|
+
* Useful for action columns with buttons.
|
|
173
|
+
* @default true
|
|
174
|
+
*/
|
|
175
|
+
exportable?: boolean;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Example values for this column, put into the schema from `getGridAiSchema`
|
|
179
|
+
* (`@opencorestack/opengridx/ai`) to help a language model write filters ("Acme" → `customer`).
|
|
180
|
+
* **These values are sent to the model.** The grid never reads row data for the schema; only what
|
|
181
|
+
* you list here leaves the app, so list nothing private. Strings, numbers and booleans are used
|
|
182
|
+
* (at most 10); other values are ignored. Not used by the grid itself.
|
|
183
|
+
* @since v3.4
|
|
184
|
+
*/
|
|
185
|
+
aiExamples?: unknown[];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Column definition used exclusively in List View mode. */
|
|
189
|
+
export interface GridListViewColDef<R extends GridValidRowModel = GridRowModel> {
|
|
190
|
+
field: string;
|
|
191
|
+
renderCell(params: GridRenderCellParams<R>): React.ReactNode;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Describes one level of column grouping.
|
|
196
|
+
* Groups can be nested by placing child GridColumnGroup objects in `children`.
|
|
197
|
+
* Leaf groups reference actual column fields via `children: string[]`.
|
|
198
|
+
*
|
|
199
|
+
* Example – two levels:
|
|
200
|
+
* [
|
|
201
|
+
* { groupId: 'q1', headerName: 'Q1 2024', children: ['q1Sales', 'q1Target'] },
|
|
202
|
+
* { groupId: 'info', headerName: 'Info', children: [
|
|
203
|
+
* { groupId: 'personal', headerName: 'Personal', children: ['name', 'age'] }
|
|
204
|
+
* ] }
|
|
205
|
+
* ]
|
|
206
|
+
*/
|
|
207
|
+
export interface GridColumnGroup {
|
|
208
|
+
/** Unique identifier for this group. */
|
|
209
|
+
groupId: string;
|
|
210
|
+
/** Text displayed in the group header cell. */
|
|
211
|
+
headerName: string;
|
|
212
|
+
/** CSS class(es) added to this group's header cell(s). */
|
|
213
|
+
headerClassName?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Either an array of column field strings (leaf group)
|
|
216
|
+
* or an array of child GridColumnGroup objects (nested group).
|
|
217
|
+
*/
|
|
218
|
+
children: Array<string | GridColumnGroup>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export type GridColumnGroupingModel = GridColumnGroup[];
|
|
222
|
+
|
|
223
|
+
/** Parameters passed to the `valueGetter` function. */
|
|
224
|
+
export interface GridValueGetterParams<R extends GridValidRowModel = GridRowModel> {
|
|
225
|
+
/** The row object. */
|
|
226
|
+
row: R;
|
|
227
|
+
/** The field name. */
|
|
228
|
+
field: string;
|
|
229
|
+
/** The raw value from the row object. */
|
|
230
|
+
value: unknown;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** Parameters passed to `GridColDef.valueParser`. @since v3.4 */
|
|
234
|
+
export interface GridValueParserParams<R extends GridValidRowModel = GridRowModel> {
|
|
235
|
+
/** The row the text is pasted into, as stored now. */
|
|
236
|
+
row: R;
|
|
237
|
+
field: string;
|
|
238
|
+
colDef: GridColDef<R>;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Parameters passed to the `valueSetter` function.
|
|
243
|
+
* @since v3.0
|
|
244
|
+
*/
|
|
245
|
+
export interface GridValueSetterParams<R extends GridValidRowModel = GridRowModel> {
|
|
246
|
+
/** The committed value from the editor. */
|
|
247
|
+
value: unknown;
|
|
248
|
+
/** The row as it was before the edit. */
|
|
249
|
+
row: R;
|
|
250
|
+
/** The field name. */
|
|
251
|
+
field: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Parameters passed to the `valueFormatter` function. */
|
|
255
|
+
export interface GridValueFormatterParams<R extends GridValidRowModel = GridRowModel> {
|
|
256
|
+
/** The raw value to format. */
|
|
257
|
+
value: unknown;
|
|
258
|
+
/** The row object. */
|
|
259
|
+
row: R;
|
|
260
|
+
/** The field name. */
|
|
261
|
+
field: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Parameters passed to the `renderCell` function. */
|
|
265
|
+
export interface GridRenderCellParams<R extends GridValidRowModel = GridRowModel> {
|
|
266
|
+
/** The current cell value. */
|
|
267
|
+
value: unknown;
|
|
268
|
+
/**
|
|
269
|
+
* The value after `colDef.valueFormatter` (or `String(value)` when no formatter is set; `''` for null/undefined).
|
|
270
|
+
* @since v2.1
|
|
271
|
+
*/
|
|
272
|
+
formattedValue?: string;
|
|
273
|
+
/** The row object. */
|
|
274
|
+
row: R;
|
|
275
|
+
/** The field name and unique ID. */
|
|
276
|
+
field: string;
|
|
277
|
+
/** The column definition. */
|
|
278
|
+
colDef: GridColDef<R>;
|
|
279
|
+
/** The index of the row in the currently visible dataset. */
|
|
280
|
+
rowIndex: number;
|
|
281
|
+
/** The index of the column. */
|
|
282
|
+
colIndex: number;
|
|
283
|
+
/**
|
|
284
|
+
* Hierarchy metadata for this row. `undefined` for flat rows (no tree-data or row-grouping active).
|
|
285
|
+
* @since v1.1
|
|
286
|
+
*/
|
|
287
|
+
rowMeta?: GridRowMeta;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Parameters passed to `renderEditCell`. `value` is the pending (uncommitted) value.
|
|
292
|
+
* @since v3.0
|
|
293
|
+
*/
|
|
294
|
+
export interface GridRenderEditCellParams<R extends GridValidRowModel = GridRowModel> extends GridRenderCellParams<R> {
|
|
295
|
+
/** Updates the pending value. Call it on every change; nothing is saved until `onCommit`. */
|
|
296
|
+
onValueChange: (value: unknown) => void;
|
|
297
|
+
/** Commits the pending value (runs `processRowUpdate`) and leaves edit mode. */
|
|
298
|
+
onCommit: () => void;
|
|
299
|
+
/** Discards the pending value and leaves edit mode. */
|
|
300
|
+
onCancel: () => void;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface GridRenderHeaderParams {
|
|
304
|
+
field: string;
|
|
305
|
+
colDef: GridColDef;
|
|
306
|
+
colIndex: number;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type GridPinnedPosition = 'left' | 'right';
|
|
310
|
+
|
|
311
|
+
export type GridColumnVisibilityModel = Record<string, boolean>;
|
|
312
|
+
|
|
313
|
+
/** Configuration for pinning columns to the grid edges. */
|
|
314
|
+
export interface GridColumnPinning {
|
|
315
|
+
/** Field strings to pin to the left edge. */
|
|
316
|
+
left?: string[];
|
|
317
|
+
/** Field strings to pin to the right edge. */
|
|
318
|
+
right?: string[];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface GridColumnOrderChangeParams {
|
|
322
|
+
column: GridColDef;
|
|
323
|
+
oldIndex: number;
|
|
324
|
+
targetIndex: number;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export type GridColumnOrder = string[];
|
|
328
|
+
|
|
329
|
+
export interface GridPinnedColumns {
|
|
330
|
+
left?: string[];
|
|
331
|
+
right?: string[];
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface GridCellParams<R extends GridValidRowModel = GridRowModel> {
|
|
335
|
+
row: R;
|
|
336
|
+
field: string;
|
|
337
|
+
value: unknown;
|
|
338
|
+
colDef: GridColDef<R>;
|
|
339
|
+
rowIndex: number;
|
|
340
|
+
colIndex: number;
|
|
341
|
+
}
|