argent-grid 0.1.0 → 0.3.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 (122) hide show
  1. package/.github/workflows/ci.yml +69 -0
  2. package/.github/workflows/pages.yml +6 -12
  3. package/.storybook/main.ts +20 -0
  4. package/.storybook/preview.ts +18 -0
  5. package/.storybook/tsconfig.json +24 -0
  6. package/AGENTS.md +70 -27
  7. package/README.md +51 -34
  8. package/angular.json +66 -0
  9. package/biome.json +66 -0
  10. package/demo-app/e2e/selection-screenshot.spec.ts +20 -0
  11. package/docs/AG-GRID-COMPARISON.md +725 -0
  12. package/docs/CELL-RENDERER-GUIDE.md +241 -0
  13. package/docs/CONTEXT-MENU-GUIDE.md +371 -0
  14. package/docs/LIVE-DATA-OPTIMIZATIONS.md +497 -0
  15. package/docs/PERFORMANCE-OPTIMIZATIONS-PHASE1.md +162 -0
  16. package/docs/PERFORMANCE-REVIEW.md +571 -0
  17. package/docs/RESEARCH-STATUS.md +234 -0
  18. package/docs/STATE-PERSISTENCE-GUIDE.md +370 -0
  19. package/docs/STORYBOOK-REFACTOR.md +215 -0
  20. package/docs/STORYBOOK-STATUS.md +156 -0
  21. package/docs/TEST-COVERAGE-REPORT.md +276 -0
  22. package/docs/THEME-API-GUIDE.md +445 -0
  23. package/docs/THEME-API-PLAN.md +364 -0
  24. package/e2e/advanced.spec.ts +109 -0
  25. package/e2e/argentgrid.spec.ts +65 -0
  26. package/e2e/benchmark.spec.ts +52 -0
  27. package/e2e/cell-renderers.spec.ts +152 -0
  28. package/e2e/debug-streaming.spec.ts +31 -0
  29. package/e2e/dnd.spec.ts +73 -0
  30. package/e2e/screenshots.spec.ts +52 -0
  31. package/e2e/theming.spec.ts +35 -0
  32. package/e2e/visual.spec.ts +112 -0
  33. package/e2e/visual.spec.ts-snapshots/checkbox-renderer-mixed.png +0 -0
  34. package/e2e/visual.spec.ts-snapshots/debug.png +0 -0
  35. package/e2e/visual.spec.ts-snapshots/grid-column-group-headers.png +0 -0
  36. package/e2e/visual.spec.ts-snapshots/grid-default.png +0 -0
  37. package/e2e/visual.spec.ts-snapshots/grid-empty-state.png +0 -0
  38. package/e2e/visual.spec.ts-snapshots/grid-filter-popup.png +0 -0
  39. package/e2e/visual.spec.ts-snapshots/grid-scroll-borders.png +0 -0
  40. package/e2e/visual.spec.ts-snapshots/grid-sidebar-buttons.png +0 -0
  41. package/e2e/visual.spec.ts-snapshots/grid-text-filter.png +0 -0
  42. package/e2e/visual.spec.ts-snapshots/grid-with-selection.png +0 -0
  43. package/e2e/visual.spec.ts-snapshots/rating-renderer-varied.png +0 -0
  44. package/package.json +21 -7
  45. package/plan.md +56 -28
  46. package/playwright.config.ts +38 -0
  47. package/setup-vitest.ts +10 -13
  48. package/src/lib/argent-grid.module.ts +10 -12
  49. package/src/lib/components/argent-grid.component.css +281 -321
  50. package/src/lib/components/argent-grid.component.html +295 -207
  51. package/src/lib/components/argent-grid.component.spec.ts +120 -160
  52. package/src/lib/components/argent-grid.component.ts +1193 -290
  53. package/src/lib/components/argent-grid.regressions.spec.ts +301 -0
  54. package/src/lib/components/argent-grid.selection.spec.ts +132 -0
  55. package/src/lib/components/set-filter/set-filter.component.spec.ts +191 -0
  56. package/src/lib/components/set-filter/set-filter.component.ts +307 -0
  57. package/src/lib/directives/ag-grid-compatibility.directive.ts +16 -26
  58. package/src/lib/directives/click-outside.directive.ts +19 -0
  59. package/src/lib/rendering/canvas-renderer.spec.ts +513 -0
  60. package/src/lib/rendering/canvas-renderer.ts +456 -452
  61. package/src/lib/rendering/live-data-handler.ts +110 -0
  62. package/src/lib/rendering/live-data-optimizations.ts +133 -0
  63. package/src/lib/rendering/render/blit.spec.ts +16 -27
  64. package/src/lib/rendering/render/blit.ts +48 -36
  65. package/src/lib/rendering/render/cells.spec.ts +132 -0
  66. package/src/lib/rendering/render/cells.ts +167 -28
  67. package/src/lib/rendering/render/column-utils.ts +95 -0
  68. package/src/lib/rendering/render/hit-test.ts +50 -0
  69. package/src/lib/rendering/render/index.ts +88 -76
  70. package/src/lib/rendering/render/lines.ts +53 -47
  71. package/src/lib/rendering/render/primitives.ts +423 -0
  72. package/src/lib/rendering/render/theme.spec.ts +8 -12
  73. package/src/lib/rendering/render/theme.ts +7 -10
  74. package/src/lib/rendering/render/types.ts +3 -2
  75. package/src/lib/rendering/render/walk.spec.ts +35 -38
  76. package/src/lib/rendering/render/walk.ts +94 -64
  77. package/src/lib/rendering/utils/damage-tracker.spec.ts +8 -7
  78. package/src/lib/rendering/utils/damage-tracker.ts +6 -18
  79. package/src/lib/rendering/utils/index.ts +1 -1
  80. package/src/lib/services/grid.service.set-filter.spec.ts +219 -0
  81. package/src/lib/services/grid.service.spec.ts +1241 -201
  82. package/src/lib/services/grid.service.ts +1204 -235
  83. package/src/lib/themes/parts/color-schemes.ts +132 -0
  84. package/src/lib/themes/parts/icon-sets.ts +258 -0
  85. package/src/lib/themes/theme-builder.ts +347 -0
  86. package/src/lib/themes/theme-quartz.ts +72 -0
  87. package/src/lib/themes/types.ts +238 -0
  88. package/src/lib/types/ag-grid-types.ts +573 -14
  89. package/src/public-api.ts +39 -9
  90. package/src/stories/Advanced.stories.ts +249 -0
  91. package/src/stories/ArgentGrid.stories.ts +301 -0
  92. package/src/stories/Benchmark.stories.ts +76 -0
  93. package/src/stories/CellRenderers.stories.ts +395 -0
  94. package/src/stories/Filtering.stories.ts +292 -0
  95. package/src/stories/Grouping.stories.ts +290 -0
  96. package/src/stories/Streaming.stories.ts +57 -0
  97. package/src/stories/Theming.stories.ts +137 -0
  98. package/src/stories/Tooltips.stories.ts +381 -0
  99. package/src/stories/benchmark-wrapper.component.ts +355 -0
  100. package/src/stories/story-utils.ts +88 -0
  101. package/src/stories/streaming-wrapper.component.ts +441 -0
  102. package/tsconfig.json +1 -0
  103. package/tsconfig.storybook.json +10 -0
  104. package/vitest.config.ts +9 -9
  105. package/demo-app/README.md +0 -70
  106. package/demo-app/angular.json +0 -78
  107. package/demo-app/e2e/benchmark.spec.ts +0 -53
  108. package/demo-app/e2e/demo-page.spec.ts +0 -77
  109. package/demo-app/e2e/grid-features.spec.ts +0 -269
  110. package/demo-app/package-lock.json +0 -14023
  111. package/demo-app/package.json +0 -36
  112. package/demo-app/playwright-test-menu.js +0 -19
  113. package/demo-app/playwright.config.ts +0 -23
  114. package/demo-app/src/app/app.component.ts +0 -10
  115. package/demo-app/src/app/app.config.ts +0 -13
  116. package/demo-app/src/app/app.routes.ts +0 -7
  117. package/demo-app/src/app/demo-page/demo-page.component.css +0 -313
  118. package/demo-app/src/app/demo-page/demo-page.component.html +0 -124
  119. package/demo-app/src/app/demo-page/demo-page.component.ts +0 -366
  120. package/demo-app/src/index.html +0 -19
  121. package/demo-app/src/main.ts +0 -6
  122. package/demo-app/tsconfig.json +0 -31
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * ArgentGrid - AG Grid Compatible Type Definitions
3
3
  * A free, high-performance alternative to AG Grid Enterprise
4
- *
4
+ *
5
5
  * This file provides 1:1 TypeScript definitions compatible with AG Grid API
6
6
  * to ensure users can switch to ArgentGrid by simply changing their import.
7
7
  */
@@ -12,142 +12,247 @@
12
12
 
13
13
  export interface GridOptions<TData = any> {
14
14
  // === COLUMN DEFINITIONS ===
15
+ /** Array of Column or Column Group definitions. */
15
16
  columnDefs?: (ColDef<TData> | ColGroupDef<TData>)[] | null;
17
+ /** A default column definition of all columns in the grid. */
16
18
  defaultColDef?: ColDef<TData>;
19
+ /** A default column group definition for all column groups in the grid. */
17
20
  defaultColGroupDef?: Partial<ColGroupDef<TData>>;
21
+ /** A map of column types to column definitions. */
18
22
  columnTypes?: { [key: string]: ColDef<TData> };
23
+ /** Definitions for custom data types. */
19
24
  dataTypeDefinitions?: DataTypeDefinitions<TData>;
25
+ /** If true, the grid will maintain the order of columns as they are provided in the `columnDefs`. */
20
26
  maintainColumnOrder?: boolean;
27
+ /** If true, pivot column order will be strictly maintained. */
21
28
  enableStrictPivotColumnOrder?: boolean;
29
+ /** If true, the grid will not use dot notation for field names. */
22
30
  suppressFieldDotNotation?: boolean;
23
31
 
24
32
  // === ROW DATA ===
33
+ /** Data to be displayed in the grid. */
25
34
  rowData?: TData[] | null;
35
+ /** The type of row model to use. Defaults to 'clientSide'. */
26
36
  rowModelType?: RowModelType;
37
+ /** Callback to get the ID for a row. */
27
38
  getRowId?: GetRowIdFunc<TData>;
28
39
 
29
40
  // === RENDERING ===
41
+ /** If true, rows will animate when their position changes. */
30
42
  animateRows?: boolean;
43
+ /** Duration in milliseconds for cell flashing. */
31
44
  cellFlashDuration?: number;
45
+ /** Duration in milliseconds for cell fading. */
32
46
  cellFadeDuration?: number;
47
+ /** Set the layout for the grid. Defaults to 'normal'. */
33
48
  domLayout?: DomLayoutType;
49
+ /** Default height in pixels for each row. */
34
50
  rowHeight?: number;
51
+ /** Default height in pixels for each header row. */
52
+ headerHeight?: number;
53
+ /** Callback to get the height for a row. */
35
54
  getRowHeight?: (params: RowHeightParams) => number | null | undefined;
55
+ /** CSS style to apply to all rows. */
36
56
  rowStyle?: RowStyle;
57
+ /** Callback to get the style for a row. */
37
58
  getRowStyle?: (params: RowClassParams) => RowStyle | undefined;
59
+ /** CSS class to apply to all rows. */
38
60
  rowClass?: string | string[];
61
+ /** Callback to get the class for a row. */
39
62
  getRowClass?: (params: RowClassParams) => string | string[] | undefined;
63
+ /** Rules for applying CSS classes to rows based on data. */
40
64
  rowClassRules?: RowClassRules<TData>;
65
+ /** If true, row hover highlight will be suppressed. */
41
66
  suppressRowHoverHighlight?: boolean;
67
+ /** If true, column hover highlight will be enabled. */
42
68
  columnHoverHighlight?: boolean;
43
69
 
44
70
  // === SELECTION ===
71
+ /** Row selection options. Can be 'single', 'multiple', or an options object. */
45
72
  rowSelection?: RowSelectionOptions | 'single' | 'multiple';
73
+ /** Enable cell selection. */
46
74
  cellSelection?: boolean | CellSelectionOptions;
75
+ /** Enable range selection. */
47
76
  enableRangeSelection?: boolean;
77
+ /** Options for the selection column. */
48
78
  selectionColumnDef?: SelectionColumnDef;
79
+ /** If true, cell focus will be suppressed. */
49
80
  suppressCellFocus?: boolean;
81
+ /** If true, header focus will be suppressed. */
50
82
  suppressHeaderFocus?: boolean;
83
+ /** If true, cell text selection will be enabled. */
51
84
  enableCellTextSelection?: boolean;
52
85
 
53
86
  // === SORTING ===
87
+ /** If true, accented characters will be treated as their unaccented equivalents for sorting. */
54
88
  accentedSort?: boolean;
89
+ /** If true, multi-column sorting will be suppressed. */
55
90
  suppressMultiSort?: boolean;
91
+ /** If true, multi-column sorting will always be enabled. */
56
92
  alwaysMultiSort?: boolean;
93
+ /** The key used for multi-column sorting. Defaults to 'ctrl'. */
57
94
  multiSortKey?: 'ctrl';
95
+ /** If true, the grid will not maintain the unsorted order of rows. */
58
96
  suppressMaintainUnsortedOrder?: boolean;
97
+ /** Callback called after rows are sorted. */
59
98
  postSortRows?: (params: PostSortRowsParams<TData>) => void;
99
+ /** If true, delta sorting will be enabled. */
60
100
  deltaSort?: boolean;
61
101
 
62
102
  // === FILTERING ===
103
+ /** Text to use for quick filtering. */
63
104
  quickFilterText?: string;
105
+ /** If true, quick filter results will be cached. */
64
106
  cacheQuickFilter?: boolean;
107
+ /** If true, hidden columns will be included in the quick filter. */
65
108
  includeHiddenColumnsInQuickFilter?: boolean;
109
+ /** Callback to check if an external filter is present. */
66
110
  isExternalFilterPresent?: () => boolean;
111
+ /** Callback to check if a row passes the external filter. */
67
112
  doesExternalFilterPass?: (node: IRowNode<TData>) => boolean;
113
+ /** If true, children will be excluded when filtering tree data. */
68
114
  excludeChildrenWhenTreeDataFiltering?: boolean;
115
+ /** Enable advanced filtering. */
69
116
  enableAdvancedFilter?: boolean;
117
+ /** Enable floating filters. */
70
118
  floatingFilter?: boolean;
71
119
 
72
120
  // === SCROLLING ===
121
+ /** Always show horizontal scrollbar. */
73
122
  alwaysShowHorizontalScroll?: boolean;
123
+ /** Always show vertical scrollbar. */
74
124
  alwaysShowVerticalScroll?: boolean;
125
+ /** Suppress horizontal scrollbar. */
75
126
  suppressHorizontalScroll?: boolean;
127
+ /** Width of the scrollbar in pixels. */
76
128
  scrollbarWidth?: number;
77
129
 
78
130
  // === EDITING ===
131
+ /** The type of editing to use. 'fullRow' or undefined. */
79
132
  editType?: 'fullRow' | undefined;
133
+ /** If true, cells will start editing on a single click. */
80
134
  singleClickEdit?: boolean;
135
+ /** If true, click editing will be suppressed. */
81
136
  suppressClickEdit?: boolean;
137
+ /** If true, editing will stop when cells lose focus. */
82
138
  stopEditingWhenCellsLoseFocus?: boolean;
139
+ /** If true, pressing Enter will navigate vertically. */
83
140
  enterNavigatesVertically?: boolean;
141
+ /** If true, pressing Enter will navigate vertically after editing. */
84
142
  enterNavigatesVerticallyAfterEdit?: boolean;
143
+ /** Enable undo/redo for cell editing. */
85
144
  undoRedoCellEditing?: boolean;
145
+ /** The limit for undo/redo steps. */
86
146
  undoRedoCellEditingLimit?: number;
87
147
 
88
148
  // === PAGINATION ===
149
+ /** Enable pagination. */
89
150
  pagination?: boolean;
151
+ /** The number of rows per page. */
90
152
  paginationPageSize?: number;
153
+ /** Options for the page size selector. */
91
154
  paginationPageSizeSelector?: number[] | boolean;
155
+ /** Automatically set the page size based on the grid height. */
92
156
  paginationAutoPageSize?: boolean;
93
157
 
94
158
  // === COLUMN SIZING ===
159
+ /** Default column resize behavior. */
95
160
  colResizeDefault?: 'shift';
161
+ /** If true, auto-sizing will be suppressed. */
96
162
  suppressAutoSize?: boolean;
163
+ /** Padding in pixels to add when auto-sizing columns. */
97
164
  autoSizePadding?: number;
165
+ /** If true, column resizing will be animated. */
98
166
  animateColumnResizing?: boolean;
99
167
 
100
168
  // === COLUMN MOVING ===
169
+ /** If true, columns cannot be moved. */
101
170
  suppressMovableColumns?: boolean;
171
+ /** If true, column move animation will be suppressed. */
102
172
  suppressColumnMoveAnimation?: boolean;
103
173
 
104
174
  // === ROW GROUPING ===
175
+ /** The display type for row grouping. */
105
176
  groupDisplayType?: RowGroupingDisplayType;
177
+ /** Definition for the auto-group column. */
106
178
  autoGroupColumnDef?: AutoGroupColumnDef<TData>;
179
+ /** Renderer for group rows. */
107
180
  groupRowRenderer?: any;
181
+ /** Parameters for the group row renderer. */
108
182
  groupRowRendererParams?: any;
183
+ /** If true, open parents will be hidden in groups. */
109
184
  groupHideOpenParents?: boolean;
185
+ /** The default level to expand groups to. */
110
186
  groupDefaultExpanded?: number;
187
+ /** When to show the row group panel. */
111
188
  rowGroupPanelShow?: 'always' | 'onlyWhenGrouping' | 'never';
112
189
 
113
190
  // === TREE DATA ===
191
+ /** Enable tree data. */
114
192
  treeData?: boolean;
193
+ /** Callback to get the path for a row in tree data. */
115
194
  getDataPath?: (data: TData) => string[];
195
+ /** Field to use for children in tree data. */
116
196
  treeDataChildrenField?: string;
197
+ /** Field to use for parent ID in tree data. */
117
198
  treeDataParentIdField?: string;
118
199
 
119
200
  // === MASTER DETAIL ===
201
+ /** Enable master-detail. */
120
202
  masterDetail?: boolean;
203
+ /** Callback to check if a row is a master row. */
121
204
  isRowMaster?: (data: TData) => boolean;
205
+ /** Renderer for the detail cell. */
122
206
  detailCellRenderer?: any;
207
+ /** Parameters for the detail cell renderer. */
123
208
  detailCellRendererParams?: any;
209
+ /** Height in pixels for the detail row. */
124
210
  detailRowHeight?: number;
125
211
 
126
212
  // === PINNING ===
213
+ /** Enable row pinning. */
127
214
  enableRowPinning?: boolean | 'top' | 'bottom';
215
+ /** Data for rows pinned to the top. */
128
216
  pinnedTopRowData?: any[];
217
+ /** Data for rows pinned to the bottom. */
129
218
  pinnedBottomRowData?: any[];
130
219
 
131
220
  // === PIVOTING ===
221
+ /** Enable pivot mode. */
132
222
  pivotMode?: boolean;
223
+ /** When to show the pivot panel. */
133
224
  pivotPanelShow?: 'always' | 'onlyWhenPivoting' | 'never';
134
225
 
135
226
  // === STYLING ===
227
+ /** Custom icons for the grid. */
136
228
  icons?: Icons;
229
+ /** Theme for the grid. */
137
230
  theme?: Theme | 'legacy';
231
+ /** Configuration for the side bar. */
138
232
  sideBar?: any;
233
+ /** Component to use for the overlay. */
139
234
  overlayComponent?: any;
235
+ /** Show loading overlay. */
140
236
  loading?: boolean;
141
237
 
142
238
  // === CONTEXT ===
239
+ /** Custom context object available in callbacks. */
143
240
  context?: any;
241
+ /** Unique ID for the grid. */
144
242
  gridId?: string;
243
+ /** Enable debug logging. */
145
244
  debug?: boolean;
146
245
 
147
246
  // === CALLBACKS ===
247
+ /** Callback to process a cell value before it's copied to the clipboard. */
148
248
  processCellForClipboard?: (params: ProcessCellForClipboardParams<TData>) => any;
249
+ /** Callback to process a cell value after it's pasted from the clipboard. */
149
250
  processCellFromClipboard?: (params: ProcessCellFromClipboardParams<TData>) => any;
150
- getContextMenuItems?: (params: GetContextMenuItemsParams<TData>) => (DefaultMenuItem | MenuItemDef)[];
251
+ /** Callback to get context menu items. */
252
+ getContextMenuItems?: (
253
+ params: GetContextMenuItemsParams<TData>
254
+ ) => (DefaultMenuItem | MenuItemDef)[];
255
+ /** Callback to get main menu items. */
151
256
  getMainMenuItems?: (params: GetMainMenuItemsParams<TData>) => (DefaultMenuItem | MenuItemDef)[];
152
257
  }
153
258
 
@@ -157,178 +262,328 @@ export interface GridOptions<TData = any> {
157
262
 
158
263
  export interface ColDef<TData = any, TValue = any> {
159
264
  // === COLUMNS ===
265
+ /** The field of the row object to get the cell's data from. */
160
266
  field?: keyof TData | string;
267
+ /** The unique ID for the column. */
161
268
  colId?: string;
269
+ /** Column type or types. */
162
270
  type?: string | string[];
271
+ /** The data type for the cell. */
163
272
  cellDataType?: boolean | string;
273
+ /** Callback or string expression to get the cell value. */
164
274
  valueGetter?: string | ValueGetterFunc<TData, TValue>;
275
+ /** Callback or string expression to format the cell value for display. */
165
276
  valueFormatter?: string | ValueFormatterFunc<TData, TValue>;
277
+ /** Reference data for the column. */
166
278
  refData?: { [key: string]: any };
279
+ /** Callback to create a key for the cell value. */
167
280
  keyCreator?: KeyCreatorFunc<TValue>;
281
+ /** Callback to check if two values are equal. */
168
282
  equals?: EqualsFunc<TValue>;
283
+ /** CSS class to apply to the tool panel for this column. */
169
284
  toolPanelClass?: string | string[];
285
+ /** If true, this column will not be shown in the columns tool panel. */
170
286
  suppressColumnsToolPanel?: boolean;
287
+ /** Whether to show the column when the group is open or closed. */
171
288
  columnGroupShow?: 'open' | 'closed' | 'all';
289
+ /** Custom icons for the column. */
172
290
  icons?: Icons;
291
+ /** If true, this column will not be navigable using the keyboard. */
173
292
  suppressNavigable?: boolean | ((params: IsRowNavigableParams<TData>) => boolean);
293
+ /** Callback to suppress keyboard events for this column. */
174
294
  suppressKeyboardEvent?: (params: SuppressKeyboardEventParams<TData>) => boolean;
295
+ /** If true, pasting into this column will be suppressed. */
175
296
  suppressPaste?: boolean | ((params: SuppressPasteParams<TData>) => boolean);
297
+ /** If true, the fill handle will be suppressed for this column. */
176
298
  suppressFillHandle?: boolean;
177
- contextMenuItems?: (DefaultMenuItem | MenuItemDef)[] | ((params: any) => (DefaultMenuItem | MenuItemDef)[]);
299
+ /** Context menu items for this column. */
300
+ contextMenuItems?:
301
+ | (DefaultMenuItem | MenuItemDef)[]
302
+ | ((params: any) => (DefaultMenuItem | MenuItemDef)[]);
303
+ /** Custom context object available in callbacks. */
178
304
  context?: any;
179
305
 
180
306
  // === SELECTION ===
307
+ /** If true, show a checkbox for row selection in this column. */
181
308
  checkboxSelection?: boolean;
309
+ /** If true, show a checkbox in the header for selecting all rows. */
182
310
  headerCheckboxSelection?: boolean;
311
+ /** If true, only filtered rows will be selected when the header checkbox is clicked. */
183
312
  headerCheckboxSelectionFilteredOnly?: boolean;
184
313
 
185
314
  // === ACCESSIBILITY ===
315
+ /** ARIA role for the cell. */
186
316
  cellAriaRole?: string;
187
317
 
188
318
  // === AGGREGATION ===
319
+ /** Aggregation function for the column. */
189
320
  aggFunc?: string | IAggFunc<TData> | null;
321
+ /** Initial aggregation function for the column. */
190
322
  initialAggFunc?: string | IAggFunc<TData>;
323
+ /** If true, enable value aggregation for this column. */
191
324
  enableValue?: boolean;
325
+ /** Allowed aggregation functions for this column. */
192
326
  allowedAggFuncs?: string[];
327
+ /** Default aggregation function for this column. */
193
328
  defaultAggFunc?: string;
194
329
 
195
330
  // === DISPLAY ===
331
+ /** If true, the column is hidden. */
196
332
  hide?: boolean | null;
333
+ /** If true, the column is initially hidden. */
197
334
  initialHide?: boolean;
335
+ /** If true, the column's visibility cannot be changed. */
198
336
  lockVisible?: boolean;
337
+ /** If true, the column's position is locked. */
199
338
  lockPosition?: boolean | 'left' | 'right';
339
+ /** If true, the column cannot be moved. */
200
340
  suppressMovable?: boolean;
341
+ /** If true, the value formatter will be used for export. */
201
342
  useValueFormatterForExport?: boolean;
202
343
 
203
344
  // === EDITING ===
345
+ /** If true, the cell is editable. */
204
346
  editable?: boolean | ((params: EditableCallbackParams<TData>) => boolean);
347
+ /** Callback or string expression to set the cell value. */
205
348
  valueSetter?: string | ValueSetterFunc<TData, TValue>;
349
+ /** Callback or string expression to parse the cell value after editing. */
206
350
  valueParser?: string | ValueParserFunc<TData, TValue>;
351
+ /** Cell editor component. */
207
352
  cellEditor?: any;
353
+ /** Parameters for the cell editor. */
208
354
  cellEditorParams?: any;
355
+ /** Selector for the cell editor. */
209
356
  cellEditorSelector?: (params: any) => any;
357
+ /** If true, the cell editor will be shown in a popup. */
210
358
  cellEditorPopup?: boolean;
359
+ /** The position of the cell editor popup. */
211
360
  cellEditorPopupPosition?: 'over' | 'under';
361
+ /** If true, start editing on a single click. */
212
362
  singleClickEdit?: boolean;
363
+ /** If true, the value parser will be used for import. */
213
364
  useValueParserForImport?: boolean;
214
365
 
215
366
  // === EVENTS ===
367
+ /** Callback called when a cell value changes. */
216
368
  onCellValueChanged?: (params: NewValueParams<TData>) => void;
369
+ /** Callback called when a cell is clicked. */
217
370
  onCellClicked?: (params: CellClickedEvent<TData>) => void;
371
+ /** Callback called when a cell is double clicked. */
218
372
  onCellDoubleClicked?: (params: CellDoubleClickedEvent<TData>) => void;
373
+ /** Callback called when a cell context menu is triggered. */
219
374
  onCellContextMenu?: (params: CellContextMenuEvent<TData>) => void;
220
375
 
221
376
  // === FILTER ===
377
+ /** Filter component to use for this column. */
222
378
  filter?: any;
379
+ /** Parameters for the filter. */
223
380
  filterParams?: any;
381
+ /** Callback or string expression to get the value for filtering. */
224
382
  filterValueGetter?: string | ValueGetterFunc<TData, any>;
383
+ /** Callback to get the text for quick filtering. */
225
384
  getQuickFilterText?: (params: GetQuickFilterTextParams<TData>) => string;
385
+ /** If true, show a floating filter for this column. */
226
386
  floatingFilter?: boolean;
387
+ /** Floating filter component. */
227
388
  floatingFilterComponent?: any;
389
+ /** Parameters for the floating filter component. */
228
390
  floatingFilterComponentParams?: any;
391
+ /** If true, this column will not be shown in the filters tool panel. */
229
392
  suppressFiltersToolPanel?: boolean;
230
393
 
231
394
  // === HEADER ===
395
+ /** The name of the header. */
232
396
  headerName?: string;
397
+ /** Callback or string expression to get the header name. */
233
398
  headerValueGetter?: string | HeaderValueGetterFunc<TData>;
399
+ /** Tooltip for the header. */
234
400
  headerTooltip?: string;
401
+ /** CSS style for the header. */
235
402
  headerStyle?: { [key: string]: any } | ((params: any) => { [key: string]: any });
403
+ /** CSS class for the header. */
236
404
  headerClass?: string | string[] | ((params: any) => string | string[]);
405
+ /** Header component. */
237
406
  headerComponent?: any;
407
+ /** Parameters for the header component. */
238
408
  headerComponentParams?: any;
409
+ /** If true, wrap header text. */
239
410
  wrapHeaderText?: boolean;
411
+ /** If true, automatically set header height. */
240
412
  autoHeaderHeight?: boolean;
413
+ /** Menu tabs to show in the column menu. */
241
414
  menuTabs?: ColumnMenuTab[];
415
+ /** If true, suppress the header menu button. */
242
416
  suppressHeaderMenuButton?: boolean;
417
+ /** If true, suppress the header filter button. */
243
418
  suppressHeaderFilterButton?: boolean;
419
+ /** If true, suppress the header context menu. */
244
420
  suppressHeaderContextMenu?: boolean;
245
421
 
246
422
  // === PINNED ===
423
+ /** Pin the column to 'left' or 'right'. */
247
424
  pinned?: boolean | 'left' | 'right' | null;
425
+ /** Initial pinned state. */
248
426
  initialPinned?: boolean | 'left' | 'right';
427
+ /** If true, the pinned state is locked. */
249
428
  lockPinned?: boolean;
250
429
 
251
430
  // === PIVOTING ===
431
+ /** If true, the column is a pivot column. */
252
432
  pivot?: boolean | null;
433
+ /** Initial pivot state. */
253
434
  initialPivot?: boolean;
435
+ /** Initial pivot index. */
254
436
  pivotIndex?: number | null;
437
+ /** If true, enable pivoting for this column. */
255
438
  enablePivot?: boolean;
256
439
 
257
440
  // === RENDERING AND STYLING ===
258
- cellStyle?: { [key: string]: any } | ((params: CellStyleParams<TData, TValue>) => { [key: string]: any });
441
+ /** CSS style for the cell. */
442
+ cellStyle?:
443
+ | { [key: string]: any }
444
+ | ((params: CellStyleParams<TData, TValue>) => { [key: string]: any });
445
+ /** CSS class for the cell. */
259
446
  cellClass?: string | string[] | ((params: CellClassParams<TData, TValue>) => string | string[]);
447
+ /** Rules for applying CSS classes to cells based on data. */
260
448
  cellClassRules?: { [key: string]: (params: CellClassParams<TData, TValue>) => boolean };
449
+ /** Cell renderer component. */
261
450
  cellRenderer?: any;
451
+ /** Parameters for the cell renderer. */
262
452
  cellRendererParams?: any;
453
+ /** Selector for the cell renderer. */
263
454
  cellRendererSelector?: (params: any) => any;
455
+ /** If true, automatically set row height based on cell content. */
264
456
  autoHeight?: boolean;
457
+ /** If true, wrap cell text. */
265
458
  wrapText?: boolean;
459
+ /** If true, enable cell change flashing. */
266
460
  enableCellChangeFlash?: boolean;
267
461
 
268
462
  // === ROW DRAGGING ===
463
+ /** If true, enable row dragging for this column. */
269
464
  rowDrag?: boolean | ((params: RowDragCallbackParams<TData>) => boolean);
465
+ /** Callback to get the text for row dragging. */
270
466
  rowDragText?: (params: any) => string;
467
+ /** If true, this column is a drag and drop source. */
271
468
  dndSource?: boolean | ((params: any) => boolean);
272
469
 
273
470
  // === SPARKLINE ===
471
+ /** Options for sparkline rendering. */
274
472
  sparklineOptions?: SparklineOptions;
275
473
 
474
+ // === PROGRESS BAR ===
475
+ /** Options for progress bar rendering. */
476
+ progressOptions?: ProgressOptions;
477
+
478
+ // === BADGE ===
479
+ /** Options for badge rendering. */
480
+ badgeOptions?: BadgeOptions;
481
+
482
+ // === BUTTON ===
483
+ /** Options for button rendering. */
484
+ buttonOptions?: ButtonOptions<TData>;
485
+
486
+ /** Options for rating (star) rendering. */
487
+ ratingOptions?: RatingOptions;
488
+
276
489
  // === ROW GROUPING ===
490
+ /** If true, the column is a row group column. */
277
491
  rowGroup?: boolean | null;
492
+ /** Initial row group state. */
278
493
  initialRowGroup?: boolean;
494
+ /** Initial row group index. */
279
495
  rowGroupIndex?: number | null;
496
+ /** If true, enable row grouping for this column. */
280
497
  enableRowGroup?: boolean;
498
+ /** Field or boolean to show row group. */
281
499
  showRowGroup?: string | boolean;
282
500
 
283
501
  // === SORT ===
502
+ /** If true, the column is sortable. */
284
503
  sortable?: boolean;
504
+ /** Initial sort direction or definition. */
285
505
  sort?: SortDirection | SortDef;
506
+ /** Initial sort direction or definition. */
286
507
  initialSort?: SortDirection | SortDef;
508
+ /** Initial sort index. */
287
509
  sortIndex?: number | null;
510
+ /** Allowed sorting orders for this column. */
288
511
  sortingOrder?: (SortDirection | SortDef)[];
512
+ /** Custom comparator for sorting. */
289
513
  comparator?: SortComparatorFn<TValue>;
514
+ /** If true, show the unsort icon. */
290
515
  unSortIcon?: boolean;
291
516
 
292
517
  // === SPANNING ===
518
+ /** Callback to get the column span. */
293
519
  colSpan?: (params: ColSpanParams<TData>) => number;
520
+ /** Whether to span rows. */
294
521
  spanRows?: boolean | ((params: any) => boolean);
295
522
 
296
523
  // === TOOLTIPS ===
524
+ /** The field to use for the tooltip. */
297
525
  tooltipField?: keyof TData | string;
526
+ /** Callback to get the tooltip value. */
298
527
  tooltipValueGetter?: (params: TooltipValueGetterParams<TData>) => string;
528
+ /** Tooltip component. */
299
529
  tooltipComponent?: any;
530
+ /** Parameters for the tooltip component. */
300
531
  tooltipComponentParams?: any;
301
532
 
302
533
  // === WIDTH ===
534
+ /** The width of the column in pixels. */
303
535
  width?: number;
536
+ /** Initial width of the column in pixels. */
304
537
  initialWidth?: number;
538
+ /** Minimum width of the column in pixels. */
305
539
  minWidth?: number;
540
+ /** Maximum width of the column in pixels. */
306
541
  maxWidth?: number;
542
+ /** The flex factor for the column. */
307
543
  flex?: number | null;
544
+ /** Initial flex factor for the column. */
308
545
  initialFlex?: number;
546
+ /** If true, the column is resizable. */
309
547
  resizable?: boolean;
548
+ /** If true, this column will be suppressed from size-to-fit. */
310
549
  suppressSizeToFit?: boolean;
550
+ /** If true, this column will be suppressed from auto-sizing. */
311
551
  suppressAutoSize?: boolean;
312
552
  }
313
553
 
314
554
  export interface ColGroupDef<TData = any> {
315
555
  // === GROUPS (required) ===
556
+ /** The columns or column groups within this group. */
316
557
  children: (ColDef<TData> | ColGroupDef<TData>)[];
558
+ /** The unique ID for the column group. */
317
559
  groupId?: string;
560
+ /** If true, the children will be 'married' and move together. */
318
561
  marryChildren?: boolean;
562
+ /** If true, the group will be open by default. */
319
563
  openByDefault?: boolean;
564
+ /** Whether to show the column when the group is open or closed. */
320
565
  columnGroupShow?: 'open' | 'closed' | 'all';
566
+ /** CSS class to apply to the tool panel for this group. */
321
567
  toolPanelClass?: string | string[];
568
+ /** If true, this group will not be shown in the columns tool panel. */
322
569
  suppressColumnsToolPanel?: boolean;
570
+ /** If true, this group will not be shown in the filters tool panel. */
323
571
  suppressFiltersToolPanel?: boolean;
324
572
 
325
573
  // === HEADER ===
574
+ /** The name of the group header. */
326
575
  headerName?: string;
576
+ /** CSS class for the group header. */
327
577
  headerClass?: string | string[] | ((params: any) => string | string[]);
578
+ /** Tooltip for the group header. */
328
579
  headerTooltip?: string;
580
+ /** If true, automatically set header height. */
329
581
  autoHeaderHeight?: boolean;
582
+ /** Header group component. */
330
583
  headerGroupComponent?: any;
584
+ /** Parameters for the header group component. */
331
585
  headerGroupComponentParams?: any;
586
+ /** If true, suppress the sticky label for this group. */
332
587
  suppressStickyLabel?: boolean;
333
588
  }
334
589
 
@@ -338,96 +593,199 @@ export interface ColGroupDef<TData = any> {
338
593
 
339
594
  export interface GridApi<TData = any> {
340
595
  // === COLUMN API ===
596
+ /** Returns the current column definitions. */
341
597
  getColumnDefs(): (ColDef<TData> | ColGroupDef<TData>)[] | null;
598
+ /** Sets the column definitions. */
342
599
  setColumnDefs(colDefs: (ColDef<TData> | ColGroupDef<TData>)[]): void;
600
+ /** Returns the column with the given key. */
343
601
  getColumn(key: string | Column): Column | null;
602
+ /** Returns all columns. */
344
603
  getAllColumns(): Column[];
604
+ /** Returns the row node at the given index. */
345
605
  getDisplayedRowAtIndex(index: number): IRowNode<TData> | null;
606
+ /** Returns the header rows. */
607
+ getHeaderRows(): (Column | ColumnGroup)[][];
608
+ /** Returns the depth of the header. */
609
+ getHeaderDepth(): number;
610
+ /** Returns the height of the header. */
611
+ getHeaderHeight(): number;
612
+ /** Toggles the expansion state of a column group. */
613
+ toggleColumnGroup(groupId: string, expanded: boolean): void;
614
+ /** Adds a column to the row grouping. */
615
+ addRowGroupColumn(colId: string): void;
616
+ /** Removes a column from the row grouping. */
617
+ removeRowGroupColumn(colId: string): void;
618
+ /** Sets the columns to use for row grouping. */
619
+ setRowGroupColumns(colIds: string[]): void;
620
+ /** Returns the columns used for row grouping. */
621
+ getRowGroupColumns(): string[];
622
+ /** Sets the pinned state of a column. */
623
+ setColumnPinned(col: string | Column, pinned: 'left' | 'right' | boolean): void;
624
+ /** Moves a column to a new index. */
625
+ moveColumn(col: string | Column, toIndex: number): void;
626
+ /** Sets the visibility of a column. */
627
+ setColumnVisible(col: string | Column, visible: boolean): void;
628
+ /** Sets the width of a column. */
629
+ setColumnWidth(col: string | Column, width: number): void;
630
+ /** Sets the sort of a column. */
631
+ setColumnSort(col: string | Column, sort: SortDirection, multiSort?: boolean): void;
632
+ /** Notifies the grid that the sort has changed. */
633
+ onSortChanged(): void;
346
634
 
347
635
  // === ROW DATA API ===
636
+ /** Returns all row data in the grid. */
348
637
  getRowData(): TData[];
638
+ /** Sets the row data. */
349
639
  setRowData(rowData: TData[]): void;
640
+ /** Applies a transaction to the row data. */
350
641
  applyTransaction(transaction: RowDataTransaction<TData>): RowDataTransactionResult | null;
642
+ /** Returns the number of displayed rows. */
351
643
  getDisplayedRowCount(): number;
644
+ /** Returns the Y position of the row at the given index. */
645
+ getRowY(index: number): number;
646
+ /** Returns the current aggregations. */
352
647
  getAggregations(): { [field: string]: any };
648
+ /** Returns the row node with the given ID. */
353
649
  getRowNode(id: string): IRowNode<TData> | null;
354
650
 
355
651
  // === SELECTION API ===
652
+ /** Returns the data for the selected rows. */
356
653
  getSelectedRows(): IRowNode<TData>[];
654
+ /** Returns the selected row nodes. */
357
655
  getSelectedNodes(): IRowNode<TData>[];
656
+ /** Selects all rows. */
358
657
  selectAll(): void;
658
+ /** Deselects all rows. */
359
659
  deselectAll(): void;
360
660
 
361
661
  // === FILTER API ===
662
+ /** Sets the filter model. */
362
663
  setFilterModel(model: FilterModel): void;
664
+ /** Returns the filter model. */
363
665
  getFilterModel(): FilterModel;
666
+ /** Notifies the grid that the filter has changed. */
364
667
  onFilterChanged(): void;
668
+ /** Returns true if any filter is present. */
365
669
  isFilterPresent(): boolean;
366
670
 
367
671
  // === SORT API ===
672
+ /** Sets the sort model. */
368
673
  setSortModel(model: SortModelItem[]): void;
674
+ /** Returns the sort model. */
369
675
  getSortModel(): SortModelItem[];
676
+ /** Notifies the grid that the sort has changed. */
370
677
  onSortChanged(): void;
371
678
 
372
679
  // === PAGINATION API ===
680
+ /** Returns the current page size. */
373
681
  paginationGetPageSize(): number;
682
+ /** Sets the page size. */
374
683
  paginationSetPageSize(size: number): void;
684
+ /** Returns the current page index. */
375
685
  paginationGetCurrentPage(): number;
686
+ /** Returns the total number of pages. */
376
687
  paginationGetTotalPages(): number;
688
+ /** Goes to the first page. */
377
689
  paginationGoToFirstPage(): void;
690
+ /** Goes to the last page. */
378
691
  paginationGoToLastPage(): void;
692
+ /** Goes to the next page. */
379
693
  paginationGoToNextPage(): void;
694
+ /** Goes to the previous page. */
380
695
  paginationGoToPreviousPage(): void;
381
696
 
382
697
  // === EXPORT API ===
698
+ /** Exports the grid data as CSV. */
383
699
  exportDataAsCsv(params?: CsvExportParams): void;
700
+ /** Exports the grid data as Excel. */
384
701
  exportDataAsExcel(params?: ExcelExportParams): void;
385
702
 
386
703
  // === CLIPBOARD API ===
704
+ /** Copies the selected cells to the clipboard. */
387
705
  copyToClipboard(): void;
706
+ /** Cuts the selected cells to the clipboard. */
388
707
  cutToClipboard(): void;
708
+
709
+ // === STATE PERSISTENCE API ===
710
+ /** Returns the current grid state. */
711
+ getState(): GridState;
712
+ /** Sets the grid state. */
713
+ setState(state: GridState): void;
714
+ /** Saves the grid state. */
715
+ saveState(key?: string): void;
716
+ /** Restores the grid state. */
717
+ restoreState(key?: string): boolean;
718
+ /** Clears the grid state. */
719
+ clearState(key?: string): void;
720
+ /** Returns true if the grid has a saved state. */
721
+ hasState(key?: string): boolean;
722
+ /** Returns unique values for a field. */
723
+ getUniqueValues(field: string): any[];
724
+ /** Pastes from the clipboard. */
389
725
  pasteFromClipboard(): void;
390
726
 
391
727
  // === GRID STATE API ===
728
+ /** Returns the current grid state. */
392
729
  getState(): GridState;
730
+ /** Applies a grid state. */
393
731
  applyState(state: GridState): void;
394
732
 
395
733
  // === FOCUS API ===
734
+ /** Sets the focus to the cell at the given row and column. */
396
735
  setFocusedCell(rowIndex: number, colKey: string): void;
736
+ /** Returns the currently focused cell position. */
397
737
  getFocusedCell(): CellPosition | null;
398
738
 
399
739
  // === REFRESH API ===
740
+ /** Refreshes the given cells. */
400
741
  refreshCells(params?: RefreshCellsParams): void;
742
+ /** Refreshes the given rows. */
401
743
  refreshRows(params?: RefreshRowsParams): void;
744
+ /** Refreshes the header. */
402
745
  refreshHeader(): void;
403
746
 
404
747
  // === SCROLL API ===
748
+ /** Ensures the row at the given index is visible. */
405
749
  ensureIndexVisible(index: number, position?: 'top' | 'bottom' | 'auto'): void;
750
+ /** Ensures the column with the given key is visible. */
406
751
  ensureColumnVisible(key: string): void;
407
752
 
408
753
  // === DESTROY API ===
754
+ /** Destroys the grid. */
409
755
  destroy(): void;
410
756
 
411
757
  // === GRID INFORMATION ===
758
+ /** Returns the grid ID. */
412
759
  getGridId(): string;
760
+ /** Returns a grid option value. */
413
761
  getGridOption<K extends keyof GridOptions<TData>>(key: K): GridOptions<TData>[K];
762
+ /** Sets a grid option value. */
414
763
  setGridOption<K extends keyof GridOptions<TData>>(key: K, value: GridOptions<TData>[K]): void;
415
764
 
416
765
  // === GROUP EXPANSION ===
766
+ /** Sets the expansion state of a row node. */
417
767
  setRowNodeExpanded(node: IRowNode<TData>, expanded: boolean): void;
418
768
 
419
769
  // === ROW HEIGHT API ===
770
+ /** Returns the Y position of the row at the given index. */
420
771
  getRowY(index: number): number;
772
+ /** Returns the row index at the given Y position. */
421
773
  getRowAtY(y: number): number;
774
+ /** Returns the total height of all rows. */
422
775
  getTotalHeight(): number;
423
776
 
424
777
  // === PIVOT API ===
778
+ /** Sets pivot mode. */
425
779
  setPivotMode(pivotMode: boolean): void;
780
+ /** Returns true if pivot mode is enabled. */
426
781
  isPivotMode(): boolean;
427
782
 
428
783
  // === RANGE SELECTION ===
784
+ /** Returns the current cell ranges. */
429
785
  getCellRanges(): CellRange[] | null;
786
+ /** Adds a cell range. */
430
787
  addCellRange(params: CellRange): void;
788
+ /** Clears the range selection. */
431
789
  clearRangeSelection(): void;
432
790
  }
433
791
 
@@ -436,41 +794,103 @@ export interface GridApi<TData = any> {
436
794
  // ============================================================================
437
795
 
438
796
  export interface Column {
797
+ /** Unique ID for the column. */
439
798
  colId: string;
799
+ /** The field of the row object this column represents. */
440
800
  field?: string;
801
+ /** The header name for the column. */
441
802
  headerName?: string;
803
+ /** The current width of the column in pixels. */
442
804
  width: number;
805
+ /** The minimum width of the column in pixels. */
443
806
  minWidth?: number;
807
+ /** The maximum width of the column in pixels. */
444
808
  maxWidth?: number;
809
+ /** Pinned state of the column ('left', 'right', or false). */
445
810
  pinned: 'left' | 'right' | false;
811
+ /** Visibility state of the column. */
446
812
  visible: boolean;
813
+ /** Current sort direction ('asc', 'desc', or null). */
447
814
  sort?: SortDirection;
815
+ /** Current sort index for multi-column sorting. */
448
816
  sortIndex?: number;
817
+ /** Current aggregation function. */
449
818
  aggFunc?: string | null;
819
+ /** True if checkbox selection is enabled for this column. */
820
+ checkboxSelection?: boolean;
821
+ /** True if header checkbox selection is enabled for this column. */
822
+ headerCheckboxSelection?: boolean;
823
+ /** Filter component or definition for this column. */
824
+ filter?: any;
825
+ /** Parent column group. */
826
+ parent?: ColumnGroup;
827
+ /** Whether to show the column when the group is open or closed. */
828
+ columnGroupShow?: 'open' | 'closed' | 'all';
829
+ /** The index of the column in the grid. */
830
+ colIndex?: number;
831
+ }
832
+
833
+ export interface ColumnGroup {
834
+ groupId: string;
835
+ headerName?: string;
836
+ children: (Column | ColumnGroup)[];
837
+ displayedChildren: (Column | ColumnGroup)[];
838
+ visible: boolean;
839
+ expanded: boolean;
840
+ resizable?: boolean;
841
+ parent?: ColumnGroup;
842
+ pinned?: 'left' | 'right' | false;
843
+ level: number;
844
+ columnGroupShow?: 'open' | 'closed' | 'all';
845
+ marryChildren?: boolean;
846
+ colIndex?: number;
450
847
  }
451
848
 
452
849
  export interface IRowNode<TData = any> {
850
+ /** Unique ID for the row. */
453
851
  id: string | null;
852
+ /** The row data. */
454
853
  data: TData;
854
+ /** Pinned state of the row ('top', 'bottom', or false). */
455
855
  rowPinned: 'top' | 'bottom' | false;
856
+ /** Height of the row in pixels. */
456
857
  rowHeight: number | null;
858
+ /** True if the row is currently displayed. */
457
859
  displayed: boolean;
860
+ /** True if the row is selected. */
458
861
  selected: boolean;
862
+ /** True if the group row is expanded. */
459
863
  expanded: boolean;
864
+ /** True if the row is a group row. */
460
865
  group: boolean;
866
+ /** True if the row is a master row. */
461
867
  master?: boolean;
868
+ /** True if the row is a detail row. */
462
869
  detail?: boolean;
870
+ /** Reference to the master row node if this is a detail row. */
463
871
  masterRowNode?: IRowNode<TData>;
872
+ /** The level of the row in grouping/tree data. */
464
873
  level: number;
874
+ /** The parent row node. */
465
875
  parent?: IRowNode<TData>;
876
+ /** Children row nodes if this is a group/master row. */
466
877
  children?: IRowNode<TData>[];
878
+ /** Children row nodes after filtering. */
467
879
  childrenAfterFilter?: IRowNode<TData>[];
880
+ /** Children row nodes after sorting. */
468
881
  childrenAfterSort?: IRowNode<TData>[];
882
+ /** All leaf children row nodes. */
469
883
  allLeafChildren?: IRowNode<TData>[];
884
+ /** True if this is the first child. */
470
885
  firstChild: boolean;
886
+ /** True if this is the last child. */
471
887
  lastChild: boolean;
888
+ /** The index of the row in the row model. */
472
889
  rowIndex: number | null;
890
+ /** The index of the row as displayed. */
473
891
  displayedRowIndex: number;
892
+ /** Sets the selection state of the row. */
893
+ setSelected(selected: boolean, clearSelection?: boolean): void;
474
894
  }
475
895
 
476
896
  export interface GroupRowNode<TData = any> {
@@ -573,7 +993,7 @@ export interface CellRange {
573
993
  startRow: number;
574
994
  endRow: number;
575
995
  startColumn: string; // colId
576
- endColumn: string; // colId
996
+ endColumn: string; // colId
577
997
  columns: Column[];
578
998
  }
579
999
 
@@ -590,6 +1010,100 @@ export interface RowDataTransactionResult {
590
1010
  remove: IRowNode[];
591
1011
  }
592
1012
 
1013
+ export interface ButtonCellRendererParams<TData = any> {
1014
+ /** The raw cell value */
1015
+ value: any;
1016
+ /** The row data object */
1017
+ data: TData;
1018
+ /** The row node */
1019
+ node: IRowNode<TData>;
1020
+ /** The grid API */
1021
+ api: GridApi<TData>;
1022
+ /** The column definition */
1023
+ colDef: ColDef<TData>;
1024
+ /** The original mouse event */
1025
+ event: MouseEvent;
1026
+ }
1027
+
1028
+ export interface ButtonOptions<TData = any> {
1029
+ /**
1030
+ * Button label. Can be a string or a function receiving cell params.
1031
+ * Compatible with AG Grid's cellRendererParams pattern.
1032
+ */
1033
+ label: string | ((params: Omit<ButtonCellRendererParams<TData>, 'event'>) => string);
1034
+ /**
1035
+ * Visual style preset. Defaults to 'primary'.
1036
+ * - primary: filled blue
1037
+ * - secondary: outlined
1038
+ * - danger: filled red
1039
+ * - ghost: transparent with hover-style border
1040
+ */
1041
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
1042
+ /** Override background fill color */
1043
+ fill?: string;
1044
+ /** Override text color */
1045
+ textColor?: string;
1046
+ /** Override border color (secondary/ghost variants) */
1047
+ borderColor?: string;
1048
+ /** Border radius in px (default: 4) */
1049
+ borderRadius?: number;
1050
+ /** Font size in px (default: 12) */
1051
+ fontSize?: number;
1052
+ /** Horizontal padding in px (default: 12) */
1053
+ paddingX?: number;
1054
+ /**
1055
+ * Click handler — receives AG Grid-compatible params.
1056
+ * Called instead of the row's onRowClicked event when the button is clicked.
1057
+ */
1058
+ onClick?: (params: ButtonCellRendererParams<TData>) => void;
1059
+ }
1060
+
1061
+ export interface BadgeOptions {
1062
+ /**
1063
+ * Map of cell value → { fill, text } colors.
1064
+ * Falls back to `defaultColors` if value not found.
1065
+ */
1066
+ colorMap?: Record<string, { fill: string; text: string }>;
1067
+ /** Fallback colors for values not in colorMap */
1068
+ defaultColors?: { fill: string; text: string };
1069
+ /** Border radius in px (default: 9999 for pill shape) */
1070
+ borderRadius?: number;
1071
+ /** Horizontal padding in px (default: 8) */
1072
+ paddingX?: number;
1073
+ /** Font size in px (default: 11) */
1074
+ fontSize?: number;
1075
+ }
1076
+
1077
+ export interface ProgressOptions {
1078
+ /** Minimum value (default: 0) */
1079
+ min?: number;
1080
+ /** Maximum value (default: 100) */
1081
+ max?: number;
1082
+ /** Bar fill color or function returning a color based on value */
1083
+ fill?: string | ((value: number) => string);
1084
+ /** Track background color (default: '#e5e7eb') */
1085
+ trackColor?: string;
1086
+ /** Bar height in px (default: 8) */
1087
+ barHeight?: number;
1088
+ /** Border radius in px (default: 4) */
1089
+ borderRadius?: number;
1090
+ /** Show text label after the bar (default: true) */
1091
+ showLabel?: boolean;
1092
+ /** Custom label formatter */
1093
+ labelFormatter?: (value: number) => string;
1094
+ }
1095
+
1096
+ export interface RatingOptions {
1097
+ /** Maximum number of stars (default: 5) */
1098
+ max?: number;
1099
+ /** Color of filled stars (default: '#ffb400') */
1100
+ color?: string;
1101
+ /** Color of empty stars (default: '#e5e7eb') */
1102
+ emptyColor?: string;
1103
+ /** Size of stars in px (default: 14) */
1104
+ size?: number;
1105
+ }
1106
+
593
1107
  export interface SparklineOptions {
594
1108
  type?: 'line' | 'area' | 'column' | 'bar';
595
1109
  line?: {
@@ -607,6 +1121,12 @@ export interface SparklineOptions {
607
1121
  strokeWidth?: number;
608
1122
  padding?: number;
609
1123
  };
1124
+ bar?: {
1125
+ fill?: string;
1126
+ stroke?: string;
1127
+ strokeWidth?: number;
1128
+ padding?: number;
1129
+ };
610
1130
  padding?: {
611
1131
  top?: number;
612
1132
  bottom?: number;
@@ -650,9 +1170,7 @@ export interface RowSelectionOptions {
650
1170
  enableSelectionWithoutKeys?: boolean;
651
1171
  }
652
1172
 
653
- export interface CellSelectionOptions {
654
- // Cell selection configuration
655
- }
1173
+ export type CellSelectionOptions = {};
656
1174
 
657
1175
  export interface SelectionColumnDef {
658
1176
  headerCheckbox?: boolean;
@@ -869,7 +1387,34 @@ export type DomLayoutType = 'normal' | 'autoHeight' | 'print';
869
1387
  export type SortDirection = 'asc' | 'desc' | null;
870
1388
  export type RowGroupingDisplayType = 'singleColumn' | 'multipleColumns' | 'groupRows' | 'custom';
871
1389
  export type ColumnMenuTab = 'filterMenu' | 'mainMenu' | 'columnsMenu' | 'chartMenu';
872
- export type DefaultMenuItem = 'pinMenu' | 'valueMenu' | 'columnMenu' | 'expandable' | 'separator' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'export' | 'chartRange' | 'pivot' | 'resetColumns' | 'deselectAll' | 'selectAll' | 'selectAllOtherColumns' | 'autoSizeAll' | 'autoSizeThisColumn' | 'resetColumns' | 'expandAll' | 'collapseAll' | 'rowGroupingGroup' | 'rowGroupingUnGroup' | 'pivotMenu' | 'aggFuncMenu' | 'sideBar';
1390
+ export type DefaultMenuItem =
1391
+ | 'pinMenu'
1392
+ | 'valueMenu'
1393
+ | 'columnMenu'
1394
+ | 'expandable'
1395
+ | 'separator'
1396
+ | 'copy'
1397
+ | 'copyWithHeaders'
1398
+ | 'copyWithGroupHeaders'
1399
+ | 'cut'
1400
+ | 'paste'
1401
+ | 'export'
1402
+ | 'chartRange'
1403
+ | 'pivot'
1404
+ | 'resetColumns'
1405
+ | 'deselectAll'
1406
+ | 'selectAll'
1407
+ | 'selectAllOtherColumns'
1408
+ | 'autoSizeAll'
1409
+ | 'autoSizeThisColumn'
1410
+ | 'resetColumns'
1411
+ | 'expandAll'
1412
+ | 'collapseAll'
1413
+ | 'rowGroupingGroup'
1414
+ | 'rowGroupingUnGroup'
1415
+ | 'pivotMenu'
1416
+ | 'aggFuncMenu'
1417
+ | 'sideBar';
873
1418
 
874
1419
  export interface MenuItemDef {
875
1420
  name: string;
@@ -885,14 +1430,28 @@ export interface MenuItemDef {
885
1430
  // FUNCTION TYPE DEFINITIONS
886
1431
  // ============================================================================
887
1432
 
888
- export type ValueGetterFunc<TData = any, TValue = any> = (params: ValueGetterParams<TData>) => TValue;
889
- export type ValueFormatterFunc<TData = any, TValue = any> = (params: ValueFormatterParams<TData, TValue>) => string;
890
- export type ValueSetterFunc<TData = any, TValue = any> = (params: ValueSetterParams<TData, TValue>) => boolean;
891
- export type ValueParserFunc<TData = any, TValue = any> = (params: ValueParserParams<TData, TValue>) => TValue;
1433
+ export type ValueGetterFunc<TData = any, TValue = any> = (
1434
+ params: ValueGetterParams<TData>
1435
+ ) => TValue;
1436
+ export type ValueFormatterFunc<TData = any, TValue = any> = (
1437
+ params: ValueFormatterParams<TData, TValue>
1438
+ ) => string;
1439
+ export type ValueSetterFunc<TData = any, TValue = any> = (
1440
+ params: ValueSetterParams<TData, TValue>
1441
+ ) => boolean;
1442
+ export type ValueParserFunc<TData = any, TValue = any> = (
1443
+ params: ValueParserParams<TData, TValue>
1444
+ ) => TValue;
892
1445
  export type KeyCreatorFunc<TValue = any> = (params: KeyCreatorParams<TValue>) => string;
893
1446
  export type EqualsFunc<TValue = any> = (params: EqualsParams<TValue>) => boolean;
894
1447
  export type HeaderValueGetterFunc<TData = any> = (params: HeaderValueGetterParams<TData>) => string;
895
- export type SortComparatorFn<TValue = any> = (valueA: TValue, valueB: TValue, nodeA: IRowNode, nodeB: IRowNode, isDescending: boolean) => number;
1448
+ export type SortComparatorFn<TValue = any> = (
1449
+ valueA: TValue,
1450
+ valueB: TValue,
1451
+ nodeA: IRowNode,
1452
+ nodeB: IRowNode,
1453
+ isDescending: boolean
1454
+ ) => number;
896
1455
  export type GetRowIdFunc<TData = any> = (params: GetRowIdParams<TData>) => string;
897
1456
  export type IAggFunc<TData = any> = (params: IAggFuncParams<TData>) => any;
898
1457