@opencorestack/opengridx 3.8.0 → 3.9.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/ai.cjs.map +1 -1
  3. package/dist/ai.es.js.map +1 -1
  4. package/dist/index.d.ts +342 -3
  5. package/dist/opengridx.css +1 -1
  6. package/dist/opengridx.es.js +6952 -6697
  7. package/dist/opengridx.es.js.map +1 -1
  8. package/dist/opengridx.umd.js +17 -17
  9. package/dist/opengridx.umd.js.map +1 -1
  10. package/docs/API_REFERENCE.md +121 -4
  11. package/docs/customization/theming.md +11 -2
  12. package/docs/features/ai-toolkit.md +1 -1
  13. package/lib/components/AiAssistant/GridAiAssistantPanel.css +2 -2
  14. package/lib/components/AiAssistant/GridAiAssistantPanel.tsx +16 -14
  15. package/lib/components/Cell/Cell.css +1 -3
  16. package/lib/components/Cell/CellErrorBoundary.tsx +17 -10
  17. package/lib/components/CellSelectionStats/CellSelectionStats.tsx +5 -3
  18. package/lib/components/ColumnGroupHeader/ColumnGroupHeader.css +1 -2
  19. package/lib/components/ColumnResizeHandle/ColumnResizeHandle.tsx +3 -1
  20. package/lib/components/ColumnVisibilityPanel/ColumnVisibilityPanel.tsx +6 -4
  21. package/lib/components/DataGrid/DataGrid.css +1 -28
  22. package/lib/components/DataGrid/GridAggregationFooter.tsx +3 -1
  23. package/lib/components/DataGrid/GridErrorOverlay.tsx +4 -2
  24. package/lib/components/DataGrid/GridListView.tsx +7 -5
  25. package/lib/components/DataGrid/GridLiveRegion.tsx +5 -3
  26. package/lib/components/DataGrid/GridLoadingOverlay.tsx +3 -1
  27. package/lib/components/DataGrid/GridPinnedRows.tsx +1 -1
  28. package/lib/components/DataGrid/GridRoot.tsx +8 -1
  29. package/lib/components/DataGrid/GridStandaloneColumnPanel.tsx +3 -1
  30. package/lib/components/DataGrid/GridViewport.tsx +3 -1
  31. package/lib/components/DataGrid/GridVirtualRows.tsx +3 -2
  32. package/lib/components/DataGrid/gridLocaleContext.ts +13 -0
  33. package/lib/components/FilterPanel/FilterPanel.tsx +25 -56
  34. package/lib/components/Header/ColumnMenu.css +5 -5
  35. package/lib/components/Header/ColumnMenu.tsx +17 -15
  36. package/lib/components/Header/Header.css +2 -11
  37. package/lib/components/Header/Header.tsx +8 -6
  38. package/lib/components/HeaderFilter/HeaderFilterCell.tsx +6 -37
  39. package/lib/components/HeaderFilter/HeaderFilterRow.tsx +3 -1
  40. package/lib/components/ListView/ListView.css +0 -16
  41. package/lib/components/ListView/ListViewRow.tsx +3 -1
  42. package/lib/components/Pagination/Pagination.tsx +15 -18
  43. package/lib/components/QuickFilter/QuickFilter.tsx +5 -2
  44. package/lib/components/Row/Row.tsx +9 -4
  45. package/lib/components/Toolbar/GlobalSearch.tsx +6 -3
  46. package/lib/components/Toolbar/GridToolbar.tsx +35 -29
  47. package/lib/components/Toolbar/PivotPanel.tsx +26 -24
  48. package/lib/components/ui/Checkbox.css +5 -5
  49. package/lib/components/ui/DragHandleIcon.tsx +3 -1
  50. package/lib/components/ui/ExpandIcon.css +3 -3
  51. package/lib/components/ui/ExpandIcon.tsx +3 -1
  52. package/lib/hooks/core/useGridRowInteractions.ts +13 -3
  53. package/lib/hooks/core/useGridToolbarStack.ts +2 -2
  54. package/lib/hooks/core/useGridVirtualization.ts +40 -25
  55. package/lib/hooks/core/useShallowStableValue.ts +29 -0
  56. package/lib/hooks/features/useGridAiAssistant.ts +52 -22
  57. package/lib/hooks/features/useGridSpanning.ts +1 -1
  58. package/lib/styles/base/reset.css +6 -7
  59. package/lib/theme/DataGridThemeProvider.tsx +9 -0
  60. package/lib/theme/__baseline__/default-theme.darwin.chromium.json +1 -1503
  61. package/lib/theme/__baseline__/default-theme.darwin.firefox.json +1 -1503
  62. package/lib/theme/__baseline__/default-theme.darwin.webkit.json +1 -1503
  63. package/lib/theme/types.ts +18 -0
  64. package/lib/types/locale.ts +344 -0
  65. package/lib/types/rows.ts +0 -2
  66. package/lib/utils/cellSelection.ts +0 -2
  67. package/lib/utils/editing/index.ts +1 -1
  68. package/lib/utils/filtering/filterInput.ts +45 -0
  69. package/lib/utils/filtering/index.ts +0 -28
  70. package/lib/utils/gridLocale.ts +241 -0
  71. package/lib/utils/pinning/index.ts +0 -107
  72. package/lib/utils/sorting/index.ts +42 -33
  73. package/lib/utils/values.ts +5 -1
  74. package/llms.txt +9 -3
  75. package/package.json +1 -1
  76. package/lib/theme/defaultStyles.ts +0 -0
@@ -90,6 +90,16 @@ export interface GridThemeOverlays {
90
90
  itemSelectedText?: string;
91
91
  itemDangerBackground?: string;
92
92
  itemDangerText?: string;
93
+ /** The dot before the selected option of a menu group (`--ogx-overlay-item-indicator`). Default: `itemSelectedText`. @since v3.9 */
94
+ itemIndicatorColor?: string;
95
+ /** The icon of the selected option (`--ogx-overlay-item-selected-icon`). Default: the primary colour. @since v3.9 */
96
+ itemSelectedIcon?: string;
97
+ /** Menu item icons (`--ogx-overlay-icon`). Default: gray-400. @since v3.9 */
98
+ iconColor?: string;
99
+ /** Section labels such as "Pin column" (`--ogx-overlay-section-label-text`). Default: gray-400. @since v3.9 */
100
+ sectionLabelText?: string;
101
+ /** Lines between menu sections (`--ogx-overlay-divider`). Default: `border`. @since v3.9 */
102
+ dividerColor?: string;
93
103
 
94
104
  /** 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
105
  fontFamily?: string;
@@ -200,6 +210,14 @@ export interface GridThemeGrid {
200
210
  pinnedRightShadow?: string;
201
211
  checkboxBg?: string;
202
212
  checkboxBorder?: string;
213
+ /** Fill and border of a checked or indeterminate checkbox (`--ogx-checkbox-checked-bg`). Default: the primary colour. @since v3.9 */
214
+ checkboxCheckedBackground?: string;
215
+ /** The check mark and indeterminate dash (`--ogx-checkbox-checkmark`). Default: white. @since v3.9 */
216
+ checkboxCheckmark?: string;
217
+ /** The expand / collapse chevron of group and tree rows (`--ogx-expand-icon-color`). Default: the header text colour. @since v3.9 */
218
+ expandIconColor?: string;
219
+ /** The chevron on hover (`--ogx-expand-icon-hover-color`). Default: the row text colour. @since v3.9 */
220
+ expandIconHoverColor?: string;
203
221
  }
204
222
 
205
223
  export interface GridThemeTransitions {
@@ -1,4 +1,5 @@
1
1
  import type { GridFilterOperator } from './filtering';
2
+ import type { GridRowId } from './rows';
2
3
 
3
4
  /** Overrideable user-visible strings for internationalisation. All fields are optional; defaults match the built-in English strings. */
4
5
  export interface GridLocaleText {
@@ -48,4 +49,347 @@ export interface GridLocaleText {
48
49
  * operators keep their English name. @since v3.6
49
50
  */
50
51
  headerFilterOperators?: Partial<Record<GridFilterOperator, string>>;
52
+
53
+ // ── Grid and list view (v3.9) ─────────────────────────────────────────────
54
+ /** `aria-label` of the grid when no `aria-label` prop is set. Default: `"Data grid"` @since v3.9 */
55
+ gridLabel?: string;
56
+ /** `aria-label` of the list view when no `aria-label` prop is set. Default: `"Data grid list view"` @since v3.9 */
57
+ listViewLabel?: string;
58
+ /** List view item count. Default: `` (n) => `${n} items` `` (`"1 item"` for 1) @since v3.9 */
59
+ listViewItemCount?: (count: number) => string;
60
+ /** List view page, after `" · "`. Default: `` (p, pc) => `page ${p} of ${pc}` `` @since v3.9 */
61
+ listViewPage?: (page: number, pageCount: number) => string;
62
+ /** List view selected count, after `" · "`. Default: `` (n) => `${n} selected` `` @since v3.9 */
63
+ listViewSelectedCount?: (count: number) => string;
64
+ /** `aria-label` of the loading progress bar. Default: `"Loading data"` @since v3.9 */
65
+ loadingLabel?: string;
66
+ /** Live-region announcement while loading. Default: `"Loading data..."` @since v3.9 */
67
+ liveRegionLoading?: string;
68
+ /** Live-region announcement of a load error. Default: `` (m) => `Error: ${m}` `` @since v3.9 */
69
+ liveRegionError?: (message: string) => string;
70
+ /** Live-region announcement of the filtered row count. Default: `` (n) => `${n} rows found` `` (`"1 row found"`) @since v3.9 */
71
+ liveRegionRowsFound?: (count: number) => string;
72
+ /** Title of the data source error overlay. Default: `"Oops! Something went wrong"` @since v3.9 */
73
+ errorOverlayTitle?: string;
74
+ /** Retry button of the error overlay. Default: `"Retry"` @since v3.9 */
75
+ errorOverlayRetry?: string;
76
+ /** `aria-label` of the aggregation footer row. Default: `"Aggregation totals"` @since v3.9 */
77
+ aggregationFooterLabel?: string;
78
+ /** `aria-label` of a cell whose `renderCell` threw. Default: `` (field) => `Error in cell: ${field}` `` @since v3.9 */
79
+ cellErrorLabel?: (field: string) => string;
80
+ /** Tooltip of such a cell when the error has no message. Default: `"Render error"` @since v3.9 */
81
+ cellErrorTooltip?: string;
82
+
83
+ // ── Header (v3.9) ─────────────────────────────────────────────────────────
84
+ /** `aria-label` of the row reorder column header. Default: `"Row reorder handle"` @since v3.9 */
85
+ headerRowReorderLabel?: string;
86
+ /** Tooltip of the row reorder column header. Default: `"Drag to reorder rows"` @since v3.9 */
87
+ headerRowReorderTooltip?: string;
88
+ /** `aria-label` of the detail panel column header. Default: `"Expand row details"` @since v3.9 */
89
+ headerDetailPanelLabel?: string;
90
+ /** `aria-label` of the select-all checkbox. Default: `"Select all rows"` @since v3.9 */
91
+ headerSelectAllLabel?: string;
92
+ /** `aria-label` of the select-all checkbox when every row is selected. Default: `"Deselect all rows"` @since v3.9 */
93
+ headerDeselectAllLabel?: string;
94
+ /**
95
+ * Description of a sorted column with multi-sort. Receives the direction, the 1-based priority and the
96
+ * number of sorted columns. Default: `` (d, p, n) => `Sorted ${d === 'asc' ? 'ascending' : 'descending'}, sort priority ${p} of ${n}` `` @since v3.9
97
+ */
98
+ headerSortDescription?: (direction: 'asc' | 'desc', priority: number, total: number) => string;
99
+ /** `aria-label` of the column menu button. Default: `` (h) => `Open column menu for ${h}` `` @since v3.9 */
100
+ headerColumnMenuButtonLabel?: (header: string) => string;
101
+ /** `aria-label` of a column resize handle. Receives the field. Default: `` (f) => `Resize ${f} column` `` @since v3.9 */
102
+ headerColumnResizeLabel?: (field: string) => string;
103
+ /** `aria-label` of the header filter cell of a column that cannot be filtered. Default: `` (h) => `No filter for ${h}` `` @since v3.9 */
104
+ headerFilterNoFilterLabel?: (header: string) => string;
105
+
106
+ // ── Rows (v3.9) ───────────────────────────────────────────────────────────
107
+ /** `aria-label` of a row checkbox. Default: `` (id) => `Select row ${id}` `` @since v3.9 */
108
+ rowSelectLabel?: (id: GridRowId) => string;
109
+ /** `aria-label` of a selected row's checkbox. Default: `` (id) => `Deselect row ${id}` `` @since v3.9 */
110
+ rowDeselectLabel?: (id: GridRowId) => string;
111
+ /** `aria-label` of the row drag handle. Default: `"Drag to reorder row"` @since v3.9 */
112
+ rowReorderLabel?: string;
113
+ /** `aria-label` of the detail panel toggle. Default: `"Expand row details"` @since v3.9 */
114
+ rowDetailPanelExpandLabel?: string;
115
+ /** `aria-label` of an open detail panel's toggle. Default: `"Collapse row details"` @since v3.9 */
116
+ rowDetailPanelCollapseLabel?: string;
117
+ /** `aria-label` of a tree / group expand button. Default: `"Expand row"` @since v3.9 */
118
+ rowExpandLabel?: string;
119
+ /** `aria-label` of an expanded tree / group row's button. Default: `"Collapse row"` @since v3.9 */
120
+ rowCollapseLabel?: string;
121
+
122
+ // ── Column menu (v3.9) ────────────────────────────────────────────────────
123
+ /** `aria-label` of the column menu. Default: `` (h) => `Column options for ${h}` `` @since v3.9 */
124
+ columnMenuLabel?: (header: string) => string;
125
+ /** Default: `"Sort Ascending"` @since v3.9 */
126
+ columnMenuSortAscending?: string;
127
+ /** Default: `"Sort Descending"` @since v3.9 */
128
+ columnMenuSortDescending?: string;
129
+ /** Default: `"Unsort"` @since v3.9 */
130
+ columnMenuUnsort?: string;
131
+ /** Section label above the pin items. Default: `"Pin column"` @since v3.9 */
132
+ columnMenuPinColumn?: string;
133
+ /** Default: `"Pin to Left"` @since v3.9 */
134
+ columnMenuPinLeft?: string;
135
+ /** `aria-label` of the item. Default: `"Pin to left"` @since v3.9 */
136
+ columnMenuPinLeftLabel?: string;
137
+ /** Default: `"Pin to Right"` @since v3.9 */
138
+ columnMenuPinRight?: string;
139
+ /** `aria-label` of the item. Default: `"Pin to right"` @since v3.9 */
140
+ columnMenuPinRightLabel?: string;
141
+ /** Default: `"Unpin"` @since v3.9 */
142
+ columnMenuUnpin?: string;
143
+ /** `aria-label` of the item. Default: `"Unpin column"` @since v3.9 */
144
+ columnMenuUnpinLabel?: string;
145
+ /** Default: `"Hide Column"` @since v3.9 */
146
+ columnMenuHideColumn?: string;
147
+ /** `aria-label` of the item. Default: `` (h) => `Hide ${h} column` `` @since v3.9 */
148
+ columnMenuHideColumnLabel?: (header: string) => string;
149
+ /** Default: `"Manage columns"` @since v3.9 */
150
+ columnMenuManageColumns?: string;
151
+ /** `aria-label` of the item. Default: `"Manage all columns"` @since v3.9 */
152
+ columnMenuManageColumnsLabel?: string;
153
+
154
+ // ── Columns panel (v3.9) ──────────────────────────────────────────────────
155
+ /** Placeholder of the search box. Default: `"Search"` @since v3.9 */
156
+ columnsPanelSearchPlaceholder?: string;
157
+ /** Tooltip of a drag handle. Default: `"Drag to reorder"` @since v3.9 */
158
+ columnsPanelDragToReorder?: string;
159
+ /** Default: `"Show/Hide All"` @since v3.9 */
160
+ columnsPanelShowHideAll?: string;
161
+ /** Default: `"Reset"` @since v3.9 */
162
+ columnsPanelReset?: string;
163
+ /** `aria-label` of the close button of the panel opened from the column menu. Default: `"Close"` @since v3.9 */
164
+ columnsPanelClose?: string;
165
+
166
+ // ── Filter panel (v3.9) ───────────────────────────────────────────────────
167
+ /** `aria-label` of a value input. Default: `` (h) => `Filter value for ${h}` `` @since v3.9 */
168
+ filterPanelValueLabel?: (header: string) => string;
169
+ /** `aria-label` of an operator select. Default: `` (h) => `Filter operator for ${h}` `` @since v3.9 */
170
+ filterPanelOperatorLabel?: (header: string) => string;
171
+ /** `aria-label` of a clear button. Default: `` (h) => `Clear filter for ${h}` `` @since v3.9 */
172
+ filterPanelClearLabel?: (header: string) => string;
173
+ /** Tooltip of a clear button. Default: `"Clear"` @since v3.9 */
174
+ filterPanelClearTooltip?: string;
175
+ /** Empty choice of the boolean and single-select values. Default: `"Any"` @since v3.9 */
176
+ filterPanelAny?: string;
177
+ /** "true" choice of the boolean value. Default: `"true"` @since v3.9 */
178
+ filterPanelTrue?: string;
179
+ /** "false" choice of the boolean value. Default: `"false"` @since v3.9 */
180
+ filterPanelFalse?: string;
181
+ /** Placeholder of a number value. Default: `"Number…"` @since v3.9 */
182
+ filterPanelNumberPlaceholder?: string;
183
+ /** Placeholder of other values. Default: `"Value…"` @since v3.9 */
184
+ filterPanelValuePlaceholder?: string;
185
+ /** Label before the And / Or choice. Default: `"Match:"` @since v3.9 */
186
+ filterPanelMatch?: string;
187
+ /** Default: `"ALL (AND)"` @since v3.9 */
188
+ filterPanelAnd?: string;
189
+ /** Default: `"ANY (OR)"` @since v3.9 */
190
+ filterPanelOr?: string;
191
+ /**
192
+ * Note about conditions the panel cannot show. Default for 1: `"1 more condition (a filter group or a
193
+ * second condition on a column) is applied and not shown here."`, plural otherwise. @since v3.9
194
+ */
195
+ filterPanelHiddenConditions?: (count: number) => string;
196
+ /** Default: `"No filterable columns."` @since v3.9 */
197
+ filterPanelNoColumns?: string;
198
+ /** Operator names in the operator select. Missing operators show their id (`"contains"`). @since v3.9 */
199
+ filterPanelOperators?: Partial<Record<GridFilterOperator, string>>;
200
+
201
+ // ── Toolbar and search (v3.9) ─────────────────────────────────────────────
202
+ /** `aria-label` of the toolbar. Default: `"Grid toolbar"` @since v3.9 */
203
+ toolbarLabel?: string;
204
+ /** Placeholder of the toolbar search and of `QuickFilter`. Default: `"Search..."` @since v3.9 */
205
+ toolbarSearchPlaceholder?: string;
206
+ /** `aria-label` of the toolbar search. Default: `"Global Search"` @since v3.9 */
207
+ toolbarSearchLabel?: string;
208
+ /** `aria-label` of the search clear button. Default: `"Clear search"` @since v3.9 */
209
+ toolbarSearchClear?: string;
210
+ /** Tooltip of the columns button. Default: `"Columns"` @since v3.9 */
211
+ toolbarColumns?: string;
212
+ /** `aria-label` of the columns button. Default: `"Manage columns"` @since v3.9 */
213
+ toolbarColumnsLabel?: string;
214
+ /** `aria-label` of the columns panel. Default: `"Column visibility"` @since v3.9 */
215
+ toolbarColumnsPanelLabel?: string;
216
+ /** Tooltip of the filters button and title of the filters panel. Default: `"Filters"` @since v3.9 */
217
+ toolbarFilters?: string;
218
+ /** `aria-label` of the filters button and panel. Default: `"Advanced filters"` @since v3.9 */
219
+ toolbarFiltersLabel?: string;
220
+ /** `aria-label` of the active-filters dot. Default: `"Filters active"` @since v3.9 */
221
+ toolbarFiltersActive?: string;
222
+ /** Default: `"Clear all"` @since v3.9 */
223
+ toolbarFiltersClearAll?: string;
224
+ /** Default: `"Clear all filters"` @since v3.9 */
225
+ toolbarFiltersClearAllTooltip?: string;
226
+ /** Default: `"Close"` @since v3.9 */
227
+ toolbarFiltersClose?: string;
228
+ /** Default: `"Close filters"` @since v3.9 */
229
+ toolbarFiltersCloseTooltip?: string;
230
+ /** Default: `"Close filters panel"` @since v3.9 */
231
+ toolbarFiltersCloseLabel?: string;
232
+ /** Tooltip of the pivot button. Default: `"Pivot"` @since v3.9 */
233
+ toolbarPivot?: string;
234
+ /** `aria-label` of the pivot button. Default: `"Configure pivot"` @since v3.9 */
235
+ toolbarPivotLabel?: string;
236
+ /** `aria-label` of the active-pivot dot. Default: `"Pivot active"` @since v3.9 */
237
+ toolbarPivotActive?: string;
238
+ /** Tooltip of the summaries button and title of its panel. Default: `"Summaries"` @since v3.9 */
239
+ toolbarSummaries?: string;
240
+ /** `aria-label` of the summaries button. Default: `"Configure summaries"` @since v3.9 */
241
+ toolbarSummariesLabel?: string;
242
+ /** `aria-label` of the active-summaries dot. Default: `` (n) => `${n} active summaries` `` @since v3.9 */
243
+ toolbarSummariesActive?: (count: number) => string;
244
+ /** `aria-label` of the summaries panel. Default: `"Summaries configuration"` @since v3.9 */
245
+ toolbarSummariesPanelLabel?: string;
246
+ /** Default: `"Clear all"` @since v3.9 */
247
+ toolbarSummariesClearAll?: string;
248
+ /** Default: `"Clear all summaries"` @since v3.9 */
249
+ toolbarSummariesClearAllTooltip?: string;
250
+ /** Default: `"No aggregable columns."` @since v3.9 */
251
+ toolbarSummariesEmpty?: string;
252
+ /** Text before `aggregable: true` in the empty panel. Default: `"Set"` @since v3.9 */
253
+ toolbarSummariesEmptyHintBefore?: string;
254
+ /** Text after `aggregable: true` in the empty panel. Default: `"on a column to enable."` @since v3.9 */
255
+ toolbarSummariesEmptyHintAfter?: string;
256
+ /** Names of the aggregation functions in the summaries panel (`none`, `sum`, …). Missing ones show their id. @since v3.9 */
257
+ toolbarAggregationFunctions?: Partial<Record<string, string>>;
258
+
259
+ // ── Pivot panel (v3.9) ────────────────────────────────────────────────────
260
+ /** `aria-label` of the panel. Default: `"Pivot configuration"` @since v3.9 */
261
+ pivotPanelLabel?: string;
262
+ /** Default: `"Pivot Mode"` @since v3.9 */
263
+ pivotMode?: string;
264
+ /** Default: `"Reset"` @since v3.9 */
265
+ pivotReset?: string;
266
+ /** Default: `"Reset pivot"` @since v3.9 */
267
+ pivotResetTooltip?: string;
268
+ /** Default: `"Row Fields"` @since v3.9 */
269
+ pivotRowFields?: string;
270
+ /** Default: `"Column Fields"` @since v3.9 */
271
+ pivotColumnFields?: string;
272
+ /** Default: `"Value Fields (aggregated)"` @since v3.9 */
273
+ pivotValueFields?: string;
274
+ /** Default: `"Add fields here — each becomes a row label"` @since v3.9 */
275
+ pivotRowFieldsPlaceholder?: string;
276
+ /** Default: `"Add fields here — unique values become column headers"` @since v3.9 */
277
+ pivotColumnFieldsPlaceholder?: string;
278
+ /** Default: `"Add numeric fields here — values are aggregated"` @since v3.9 */
279
+ pivotValueFieldsPlaceholder?: string;
280
+ /** Tooltip of a chip's remove button. Default: `` (h) => `Remove ${h}` `` @since v3.9 */
281
+ pivotRemoveTooltip?: (header: string) => string;
282
+ /** Default: `` (h) => `Remove ${h} from Row Fields` `` @since v3.9 */
283
+ pivotRemoveRowLabel?: (header: string) => string;
284
+ /** Default: `` (h) => `Remove ${h} from Column Fields` `` @since v3.9 */
285
+ pivotRemoveColumnLabel?: (header: string) => string;
286
+ /** Receives the header and the function's name. Default: `` (h, fn) => `Remove ${h} (${fn}) from Value Fields` `` @since v3.9 */
287
+ pivotRemoveValueLabel?: (header: string, aggregationFunction: string) => string;
288
+ /** Tooltip of a value field's function select. Default: `"Aggregation function"` @since v3.9 */
289
+ pivotAggregationTooltip?: string;
290
+ /** Default: `` (h) => `Aggregation function for ${h}` `` @since v3.9 */
291
+ pivotAggregationLabel?: (header: string) => string;
292
+ /** Names of the aggregation functions in the pivot panel. Missing ones show the id in upper case (`"SUM"`). @since v3.9 */
293
+ pivotAggregationFunctions?: Partial<Record<string, string>>;
294
+ /** Default: `"Available Fields"` @since v3.9 */
295
+ pivotAvailableFields?: string;
296
+ /** Default: `"All fields are in use."` @since v3.9 */
297
+ pivotAllFieldsInUse?: string;
298
+ /** Default: `"Row"` @since v3.9 */
299
+ pivotAddRow?: string;
300
+ /** Default: `"Col"` @since v3.9 */
301
+ pivotAddColumn?: string;
302
+ /** Default: `"Val"` @since v3.9 */
303
+ pivotAddValue?: string;
304
+ /** Default: `"Add to Row Fields"` @since v3.9 */
305
+ pivotAddRowTooltip?: string;
306
+ /** Default: `"Add to Column Fields"` @since v3.9 */
307
+ pivotAddColumnTooltip?: string;
308
+ /** Default: `"Add to Value Fields"` @since v3.9 */
309
+ pivotAddValueTooltip?: string;
310
+ /** Default: `` (h) => `Add ${h} to Row Fields` `` @since v3.9 */
311
+ pivotAddRowLabel?: (header: string) => string;
312
+ /** Default: `` (h) => `Add ${h} to Column Fields` `` @since v3.9 */
313
+ pivotAddColumnLabel?: (header: string) => string;
314
+ /** Default: `` (h) => `Add ${h} to Value Fields` `` @since v3.9 */
315
+ pivotAddValueLabel?: (header: string) => string;
316
+
317
+ // ── AI assistant panel (v3.9) ─────────────────────────────────────────────
318
+ /** Panel title and `aria-label`. Default: `"Ask AI"` @since v3.9 */
319
+ aiAssistantTitle?: string;
320
+ /** `aria-label` of the close button. Default: `"Close"` @since v3.9 */
321
+ aiAssistantClose?: string;
322
+ /** `aria-label` of the prompt input. Default: `"Prompt"` @since v3.9 */
323
+ aiAssistantPromptLabel?: string;
324
+ /** Placeholder of the prompt input; `aiAssistant.placeholder` wins. Default: `"Ask about this table…"` @since v3.9 */
325
+ aiAssistantPlaceholder?: string;
326
+ /** Default: `"Dictate a prompt"` @since v3.9 */
327
+ aiAssistantStartDictation?: string;
328
+ /** Default: `"Stop dictation"` @since v3.9 */
329
+ aiAssistantStopDictation?: string;
330
+ /** Default: `"Ask"` @since v3.9 */
331
+ aiAssistantAsk?: string;
332
+ /** Default: `"Stop"` @since v3.9 */
333
+ aiAssistantStop?: string;
334
+ /** Default: `"Suggestions"` @since v3.9 */
335
+ aiAssistantSuggestions?: string;
336
+ /** Default: `"Applied changes"` @since v3.9 */
337
+ aiAssistantAppliedChanges?: string;
338
+ /** `aria-label` of a chip's remove button. Default: `` (label) => `Remove ${label}` `` @since v3.9 */
339
+ aiAssistantRemoveChange?: (label: string) => string;
340
+ /** Default: `"Undo"` @since v3.9 */
341
+ aiAssistantUndo?: string;
342
+ /** `aria-label` of the ignored list. Default: `"Ignored"` @since v3.9 */
343
+ aiAssistantIgnored?: string;
344
+ /** An ignored item. Default: `` (message) => `Ignored: ${message}` `` @since v3.9 */
345
+ aiAssistantIgnoredItem?: (message: string) => string;
346
+ /** Default: `"Earlier"` @since v3.9 */
347
+ aiAssistantEarlier?: string;
348
+ /** Status while a request runs. Default: `"Thinking…"` @since v3.9 */
349
+ aiAssistantThinking?: string;
350
+ /** Default: `"Stopped"` @since v3.9 */
351
+ aiAssistantStopped?: string;
352
+ /** Default: `"Undone"` @since v3.9 */
353
+ aiAssistantUndone?: string;
354
+ /** Default: `"Change removed"` @since v3.9 */
355
+ aiAssistantChangeRemoved?: string;
356
+ /**
357
+ * Status after a reply. Receives the applied and ignored counts. Default: `"No changes"`,
358
+ * `"Applied 1 change"`, `"Applied 3 changes, 1 ignored"` @since v3.9
359
+ */
360
+ aiAssistantApplied?: (applied: number, ignored: number) => string;
361
+ /** Status when a reply was not validated. Default: `"The reply was not validated"` @since v3.9 */
362
+ aiAssistantNotValidated?: string;
363
+ /** Status when the request failed. Default: `` (m) => `The assistant could not answer: ${m}` `` @since v3.9 */
364
+ aiAssistantFailed?: (message: string) => string;
365
+ /** Error text when a failed request has no message. Default: `"Unknown error"` @since v3.9 */
366
+ aiAssistantUnknownError?: string;
367
+
368
+ // ── Pagination (v3.9) ─────────────────────────────────────────────────────
369
+ /** `aria-label` of the pagination bar. Default: `"Pagination"` @since v3.9 */
370
+ paginationLabel?: string;
371
+ /** Default: `"Go to first page"` @since v3.9 */
372
+ paginationFirstPageLabel?: string;
373
+ /** Default: `"First page"` @since v3.9 */
374
+ paginationFirstPageTooltip?: string;
375
+ /** Default: `"Go to previous page"` @since v3.9 */
376
+ paginationPreviousPageLabel?: string;
377
+ /** Default: `"Previous page"` @since v3.9 */
378
+ paginationPreviousPageTooltip?: string;
379
+ /** Default: `"Go to next page"` @since v3.9 */
380
+ paginationNextPageLabel?: string;
381
+ /** Default: `"Next page"` @since v3.9 */
382
+ paginationNextPageTooltip?: string;
383
+ /** Default: `"Go to last page"` @since v3.9 */
384
+ paginationLastPageLabel?: string;
385
+ /** Default: `"Last page"` @since v3.9 */
386
+ paginationLastPageTooltip?: string;
387
+
388
+ // ── Cell selection stats (v3.9) ───────────────────────────────────────────
389
+ /** Default: `"Count"` @since v3.9 */
390
+ cellSelectionStatsCount?: string;
391
+ /** Default: `"Sum"` @since v3.9 */
392
+ cellSelectionStatsSum?: string;
393
+ /** Default: `"Average"` @since v3.9 */
394
+ cellSelectionStatsAverage?: string;
51
395
  }
package/lib/types/rows.ts CHANGED
@@ -5,8 +5,6 @@ export type GridRowId = string | number;
5
5
  export interface GridRowModel {
6
6
  /** Uniquely identifies the row. */
7
7
  id: GridRowId;
8
- /** Internal: row is a skeleton placeholder during infinite-scroll loading. */
9
- _isSkeleton?: boolean;
10
8
  /** Internal: server-reported child count for lazy-loaded tree nodes. */
11
9
  serverChildrenCount?: number;
12
10
  /** Any other dynamic row properties. */
@@ -17,8 +17,6 @@ export function isRangeColumnField(field: string): boolean {
17
17
  export const isSameCoordinates = (a: GridCellCoordinates | null | undefined, b: GridCellCoordinates | null | undefined): boolean =>
18
18
  a === b || (!!a && !!b && a.id === b.id && a.field === b.field);
19
19
 
20
- export const isSingleCellRange = (range: GridCellRange): boolean => isSameCoordinates(range.anchor, range.head);
21
-
22
20
  /** A model holding the same range(s) as `b`. */
23
21
  export function isSameCellSelectionModel(a: GridCellSelectionModel, b: GridCellSelectionModel): boolean {
24
22
  if (a === b) return true;
@@ -20,7 +20,7 @@ export function resolveCellEditable<R extends GridRowModel>(
20
20
  ): boolean {
21
21
  const { row, field, value, colDef, rowIndex, colIndex, rowMeta } = params;
22
22
  if (!colDef.editable) return false;
23
- if (rowMeta?.isGroupRow || row._isSkeleton) return false;
23
+ if (rowMeta?.isGroupRow) return false;
24
24
  if (!isCellEditable) return true;
25
25
  try {
26
26
  return Boolean(isCellEditable({ row, field, value, colDef, rowIndex, colIndex }));
@@ -0,0 +1,45 @@
1
+ import type { GridColDef, GridFilterOperator } from '../../types';
2
+
3
+ /**
4
+ * Helpers shared by the filter panel and the header filter row: both edit a filter item's value
5
+ * through a text box or a select of the column's `valueOptions`.
6
+ */
7
+
8
+ /** One entry of a `valueOptions` select. `key` is the option's index, used as the `<option>` value. */
9
+ export interface FilterValueOption {
10
+ key: string;
11
+ value: unknown;
12
+ label: string;
13
+ }
14
+
15
+ export function getFilterValueOptions(col: Pick<GridColDef, 'valueOptions'>): FilterValueOption[] {
16
+ return (col.valueOptions ?? []).map((option, index) => (
17
+ option !== null && typeof option === 'object'
18
+ ? { key: String(index), value: option.value, label: option.label }
19
+ : { key: String(index), value: option, label: String(option) }
20
+ ));
21
+ }
22
+
23
+ /**
24
+ * Whether a filter value selects this option: the same value, or the same text ignoring case (a
25
+ * value typed or restored from a URL is a string). A list matches by its first entry.
26
+ */
27
+ export function matchesFilterValueOption(option: FilterValueOption, value: unknown): boolean {
28
+ const single = Array.isArray(value) ? value[0] : value;
29
+ if (Object.is(option.value, single)) return true;
30
+ return single != null && String(option.value).toLowerCase() === String(single).toLowerCase();
31
+ }
32
+
33
+ /** The item value for typed text. `isAnyOf` takes a comma-separated list. */
34
+ export function filterValueFromInputText(text: string, operator: GridFilterOperator): unknown {
35
+ if (operator === 'isAnyOf') return text.split(',').map(part => part.trim()).filter(part => part !== '');
36
+ return text;
37
+ }
38
+
39
+ /** Equal filter values: the same value, dates at the same time, or lists of equal values. */
40
+ export function isSameFilterValue(a: unknown, b: unknown): boolean {
41
+ if (Object.is(a, b)) return true;
42
+ if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
43
+ if (Array.isArray(a) && Array.isArray(b)) return a.length === b.length && a.every((v, i) => isSameFilterValue(v, b[i]));
44
+ return false;
45
+ }
@@ -362,19 +362,6 @@ export function applyQuickFilter<R extends GridRowModel>(
362
362
  return predicate ? predicate(row) : true;
363
363
  }
364
364
 
365
- /**
366
- * Check if a row matches the filter model. Compiles the model on every call: to test many rows,
367
- * build a predicate once with createRowFilter.
368
- */
369
- export function isRowMatchingFilter<R extends GridRowModel>(
370
- row: R,
371
- filterModel: GridFilterModel | GridFilterGroup,
372
- columns?: GridColumnLookup
373
- ): boolean {
374
- const predicate = createRowFilter(filterModel, columns);
375
- return predicate ? predicate(row) : true;
376
- }
377
-
378
365
  export function filterRows<R extends GridRowModel>(
379
366
  rows: R[],
380
367
  filterModel: GridFilterModel,
@@ -396,21 +383,6 @@ export function filterRows<R extends GridRowModel>(
396
383
  return rows.filter(row => predicate(row));
397
384
  }
398
385
 
399
- export function getDefaultOperator(type?: string): GridFilterOperator {
400
- switch (type) {
401
- case 'number':
402
- return '=';
403
- case 'date':
404
- return 'is';
405
- case 'boolean':
406
- return 'is';
407
- case 'singleSelect':
408
- return 'isAnyOf';
409
- default:
410
- return 'contains';
411
- }
412
- }
413
-
414
386
  export function getOperatorsForType(type?: string): GridFilterOperator[] {
415
387
  switch (type) {
416
388
  case 'number':