apex-grid 3.2.0 → 3.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 (197) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +200 -52
  3. package/components/cell.d.ts +14 -1
  4. package/components/cell.js +48 -6
  5. package/components/cell.js.map +1 -1
  6. package/components/filter-row.d.ts +3 -6
  7. package/components/filter-row.js +79 -109
  8. package/components/filter-row.js.map +1 -1
  9. package/components/grid.d.ts +416 -77
  10. package/components/grid.js +398 -11
  11. package/components/grid.js.map +1 -1
  12. package/components/group-header-row.d.ts +34 -0
  13. package/components/group-header-row.js +125 -0
  14. package/components/group-header-row.js.map +1 -0
  15. package/components/header-row.d.ts +13 -2
  16. package/components/header-row.js +33 -18
  17. package/components/header-row.js.map +1 -1
  18. package/components/header.d.ts +11 -0
  19. package/components/header.js +135 -5
  20. package/components/header.js.map +1 -1
  21. package/components/paginator.d.ts +6 -1
  22. package/components/paginator.js +17 -11
  23. package/components/paginator.js.map +1 -1
  24. package/components/row.d.ts +28 -0
  25. package/components/row.js +100 -3
  26. package/components/row.js.map +1 -1
  27. package/components/toolbar.d.ts +8 -1
  28. package/components/toolbar.js +25 -7
  29. package/components/toolbar.js.map +1 -1
  30. package/controllers/data-operation.js +1 -0
  31. package/controllers/data-operation.js.map +1 -1
  32. package/controllers/dom.d.ts +24 -6
  33. package/controllers/dom.js +62 -5
  34. package/controllers/dom.js.map +1 -1
  35. package/controllers/editing.d.ts +68 -1
  36. package/controllers/editing.js +129 -44
  37. package/controllers/editing.js.map +1 -1
  38. package/controllers/filter.d.ts +1 -1
  39. package/controllers/filter.js +16 -5
  40. package/controllers/filter.js.map +1 -1
  41. package/controllers/history.d.ts +86 -0
  42. package/controllers/history.js +118 -0
  43. package/controllers/history.js.map +1 -0
  44. package/controllers/navigation.d.ts +15 -0
  45. package/controllers/navigation.js +53 -0
  46. package/controllers/navigation.js.map +1 -1
  47. package/controllers/reorder.js +3 -1
  48. package/controllers/reorder.js.map +1 -1
  49. package/controllers/row-pin.d.ts +59 -0
  50. package/controllers/row-pin.js +75 -0
  51. package/controllers/row-pin.js.map +1 -0
  52. package/controllers/row-reorder.d.ts +161 -0
  53. package/controllers/row-reorder.js +332 -0
  54. package/controllers/row-reorder.js.map +1 -0
  55. package/controllers/sort.js +9 -1
  56. package/controllers/sort.js.map +1 -1
  57. package/controllers/state.d.ts +33 -0
  58. package/controllers/state.js +37 -2
  59. package/controllers/state.js.map +1 -1
  60. package/controllers/tree.d.ts +8 -0
  61. package/controllers/tree.js +0 -0
  62. package/controllers/tree.js.map +1 -1
  63. package/custom-elements.json +4411 -886
  64. package/docs/assets/hierarchy.js +1 -1
  65. package/docs/assets/highlight.css +28 -0
  66. package/docs/assets/navigation.js +1 -1
  67. package/docs/assets/search.js +1 -1
  68. package/docs/functions/custom.html +3 -0
  69. package/docs/functions/interpolate.html +4 -0
  70. package/docs/functions/localize.html +8 -0
  71. package/docs/functions/max.html +3 -0
  72. package/docs/functions/min.html +3 -0
  73. package/docs/functions/pattern.html +3 -0
  74. package/docs/functions/required.html +3 -0
  75. package/docs/hierarchy.html +1 -1
  76. package/docs/index.html +184 -54
  77. package/docs/interfaces/ApexCellValidationFailedEvent.html +13 -0
  78. package/docs/interfaces/ApexCellValueChangedEvent.html +1 -1
  79. package/docs/interfaces/ApexCellValueChangingEvent.html +2 -2
  80. package/docs/interfaces/ApexColumnGroupContext.html +6 -0
  81. package/docs/interfaces/ApexColumnMovedEvent.html +2 -2
  82. package/docs/interfaces/ApexColumnMovingEvent.html +1 -1
  83. package/docs/interfaces/ApexDetailContext.html +2 -2
  84. package/docs/interfaces/ApexGridEventMap.html +37 -9
  85. package/docs/interfaces/ApexHistoryChangedEvent.html +6 -0
  86. package/docs/interfaces/ApexPageChangedEvent.html +1 -1
  87. package/docs/interfaces/ApexRowMovingEvent.html +9 -0
  88. package/docs/interfaces/ApexRowPinningEvent.html +8 -0
  89. package/docs/interfaces/ApexStateChangedEvent.html +4 -0
  90. package/docs/interfaces/BaseApexCellContext.html +1 -1
  91. package/docs/interfaces/BaseApexEditorContext.html +1 -1
  92. package/docs/interfaces/BaseColumnConfiguration.html +42 -17
  93. package/docs/interfaces/CSVExportOptions.html +2 -2
  94. package/docs/interfaces/ColumnGroupConfiguration.html +12 -0
  95. package/docs/interfaces/ColumnLayoutState.html +2 -0
  96. package/docs/interfaces/ColumnSchema.html +22 -0
  97. package/docs/interfaces/DataPipelineConfiguration.html +2 -2
  98. package/docs/interfaces/EditingHistoryConfiguration.html +10 -0
  99. package/docs/interfaces/ExportFormat.html +2 -2
  100. package/docs/interfaces/ExportOptions.html +1 -1
  101. package/docs/interfaces/FilterStateSnapshot.html +4 -0
  102. package/docs/interfaces/GetStateOptions.html +4 -0
  103. package/docs/interfaces/GridCapabilities.html +8 -0
  104. package/docs/interfaces/GridEditingConfiguration.html +4 -2
  105. package/docs/interfaces/GridRowPinningConfiguration.html +5 -0
  106. package/docs/interfaces/GridRowReorderingConfiguration.html +22 -0
  107. package/docs/interfaces/GridSchema.html +19 -0
  108. package/docs/interfaces/GridState.html +41 -0
  109. package/docs/interfaces/GridTreeConfiguration.html +2 -2
  110. package/docs/interfaces/PaginationConfiguration.html +1 -1
  111. package/docs/interfaces/PaginationState.html +1 -1
  112. package/docs/interfaces/SetStateOptions.html +9 -0
  113. package/docs/interfaces/SetStateResult.html +11 -0
  114. package/docs/interfaces/SortStateSnapshot.html +2 -0
  115. package/docs/interfaces/ValidatorContext.html +8 -0
  116. package/docs/media/_tokens.scss +70 -81
  117. package/docs/media/package.json +1 -1
  118. package/docs/media/state-persistence.html +189 -0
  119. package/docs/modules.html +1 -1
  120. package/docs/types/DataPipelineParams.html +2 -2
  121. package/docs/types/EditMode.html +2 -2
  122. package/docs/types/GridLocaleKey.html +3 -0
  123. package/docs/types/GridLocaleText.html +5 -0
  124. package/docs/types/LocaleParams.html +2 -0
  125. package/docs/types/PaginationMode.html +1 -1
  126. package/docs/types/RowDropPosition.html +2 -0
  127. package/docs/types/RowPinPosition.html +2 -0
  128. package/docs/types/RowRef.html +3 -0
  129. package/docs/types/Validator.html +4 -0
  130. package/docs/variables/EN_LOCALE.html +9 -0
  131. package/docs/variables/esLocale.html +8 -0
  132. package/i18n/en.d.ts +151 -0
  133. package/i18n/en.js +125 -0
  134. package/i18n/en.js.map +1 -0
  135. package/i18n/es.d.ts +18 -0
  136. package/i18n/es.js +125 -0
  137. package/i18n/es.js.map +1 -0
  138. package/i18n/index.d.ts +3 -0
  139. package/i18n/index.js +4 -0
  140. package/i18n/index.js.map +1 -0
  141. package/i18n/localize.d.ts +23 -0
  142. package/i18n/localize.js +15 -0
  143. package/i18n/localize.js.map +1 -0
  144. package/index.d.ts +8 -2
  145. package/index.js +2 -0
  146. package/index.js.map +1 -1
  147. package/internal/feature-module.d.ts +46 -0
  148. package/internal/feature-module.js +11 -0
  149. package/internal/feature-module.js.map +1 -1
  150. package/internal/flip.js +1 -1
  151. package/internal/flip.js.map +1 -1
  152. package/internal/icons.d.ts +9 -7
  153. package/internal/icons.js +75 -35
  154. package/internal/icons.js.map +1 -1
  155. package/internal/index.d.ts +5 -3
  156. package/internal/index.js +2 -1
  157. package/internal/index.js.map +1 -1
  158. package/internal/state-schema.d.ts +85 -0
  159. package/internal/state-schema.js +27 -0
  160. package/internal/state-schema.js.map +1 -0
  161. package/internal/state-snapshot.d.ts +152 -0
  162. package/internal/state-snapshot.js +115 -0
  163. package/internal/state-snapshot.js.map +1 -0
  164. package/internal/tags.d.ts +1 -0
  165. package/internal/tags.js +1 -0
  166. package/internal/tags.js.map +1 -1
  167. package/internal/types.d.ts +162 -2
  168. package/internal/types.js.map +1 -1
  169. package/internal/utils.d.ts +12 -0
  170. package/internal/utils.js +17 -0
  171. package/internal/utils.js.map +1 -1
  172. package/internal/validators.d.ts +31 -0
  173. package/internal/validators.js +44 -0
  174. package/internal/validators.js.map +1 -0
  175. package/package.json +1 -1
  176. package/styles/_tokens.css.js +1 -1
  177. package/styles/_tokens.css.js.map +1 -1
  178. package/styles/body-cell/body-cell.css.js +1 -1
  179. package/styles/body-cell/body-cell.css.js.map +1 -1
  180. package/styles/body-row/body-row.css.js +1 -1
  181. package/styles/body-row/body-row.css.js.map +1 -1
  182. package/styles/filter-row/filter-row.css.js +1 -1
  183. package/styles/filter-row/filter-row.css.js.map +1 -1
  184. package/styles/grid/_grid.base.css.js +1 -1
  185. package/styles/grid/_grid.base.css.js.map +1 -1
  186. package/styles/grid/grid.css.js +1 -1
  187. package/styles/grid/grid.css.js.map +1 -1
  188. package/styles/group-header-row/group-header-row.css.d.ts +1 -0
  189. package/styles/group-header-row/group-header-row.css.js +3 -0
  190. package/styles/group-header-row/group-header-row.css.js.map +1 -0
  191. package/styles/header-cell/header-cell.css.js +1 -1
  192. package/styles/header-cell/header-cell.css.js.map +1 -1
  193. package/styles/header-row/header-row.base.css.js +1 -1
  194. package/styles/header-row/header-row.base.css.js.map +1 -1
  195. package/styles/toolbar/toolbar.css.js +1 -1
  196. package/styles/toolbar/toolbar.css.js.map +1 -1
  197. package/docs/classes/ApexGrid.html +0 -399
@@ -2,10 +2,15 @@ import { ContextProvider } from '@lit/context';
2
2
  import { nothing } from 'lit';
3
3
  import { DataOperationsController } from '../controllers/data-operation.js';
4
4
  import { GridDOMController } from '../controllers/dom.js';
5
+ import type { RowPinPosition } from '../controllers/row-pin.js';
6
+ import type { RowDropPosition } from '../controllers/row-reorder.js';
5
7
  import { StateController } from '../controllers/state.js';
8
+ import { type GridLocaleKey, type GridLocaleText, type LocaleParams } from '../i18n/index.js';
6
9
  import { type CSVExportOptions, type ExportFormat, type ExportOptions } from '../internal/export.js';
7
10
  import { EventEmitterBase } from '../internal/mixins/event-emitter.js';
8
- import type { ColumnConfiguration, DataPipelineConfiguration, GridEditingConfiguration, GridExpansionConfiguration, GridSelectionConfiguration, GridSortConfiguration, GridTreeConfiguration, Keys, PaginationConfiguration, PaginationState, PinPosition } from '../internal/types.js';
11
+ import { type GridSchema } from '../internal/state-schema.js';
12
+ import { type GetStateOptions, type GridState, type SetStateOptions, type SetStateResult } from '../internal/state-snapshot.js';
13
+ import type { ColumnConfiguration, ColumnGroupConfiguration, DataPipelineConfiguration, GridEditingConfiguration, GridExpansionConfiguration, GridRowPinningConfiguration, GridRowReorderingConfiguration, GridSelectionConfiguration, GridSortConfiguration, GridTreeConfiguration, Keys, PaginationConfiguration, PaginationState, PinPosition, ToolbarAction } from '../internal/types.js';
9
14
  import type { FilterExpression } from '../operations/filter/types.js';
10
15
  import type { SortExpression } from '../operations/sort/types.js';
11
16
  import ApexFilterRow from './filter-row.js';
@@ -150,6 +155,73 @@ export interface ApexCellValueChangedEvent<T extends object> {
150
155
  */
151
156
  value: unknown;
152
157
  }
158
+ /**
159
+ * Event payload for the `cellValidationFailed` event.
160
+ */
161
+ export interface ApexCellValidationFailedEvent<T extends object> {
162
+ /**
163
+ * The column key of the rejected cell.
164
+ */
165
+ key: Keys<T>;
166
+ /**
167
+ * The view-relative row index of the rejected cell.
168
+ */
169
+ rowIndex: number;
170
+ /**
171
+ * The data record being edited (a live reference to the row in
172
+ * {@link ApexGrid.data}).
173
+ */
174
+ data: T;
175
+ /**
176
+ * The candidate value that failed validation.
177
+ */
178
+ value: unknown;
179
+ /**
180
+ * The collected validator error messages.
181
+ */
182
+ errors: readonly string[];
183
+ }
184
+ /**
185
+ * Event payload for the cancellable `rowPinning` event and the follow-up
186
+ * `rowPinned` event.
187
+ */
188
+ export interface ApexRowPinningEvent<T extends object> {
189
+ /** The row being pinned or unpinned (a live reference into {@link ApexGrid.data}). */
190
+ row: T;
191
+ /**
192
+ * The target band: `'top'` / `'bottom'` when pinning, or `null` when
193
+ * unpinning.
194
+ */
195
+ position: RowPinPosition | null;
196
+ }
197
+ /**
198
+ * Event payload for the cancellable `rowMoving` event and the follow-up
199
+ * `rowMoved` event.
200
+ */
201
+ export interface ApexRowMovingEvent<T extends object> {
202
+ /** The moving row's view index before the move. */
203
+ from: number;
204
+ /** The target row's view index. */
205
+ to: number;
206
+ /** The row being moved (a live reference into {@link ApexGrid.data}). */
207
+ data: T;
208
+ }
209
+ /**
210
+ * Event payload for the `historyChanged` event.
211
+ */
212
+ export interface ApexHistoryChangedEvent {
213
+ /** Whether there is at least one command to undo. */
214
+ canUndo: boolean;
215
+ /** Whether there is at least one command to redo. */
216
+ canRedo: boolean;
217
+ }
218
+ /**
219
+ * Event payload for the `stateChanged` event.
220
+ */
221
+ export interface ApexStateChangedEvent {
222
+ /** The grid's restorable state after the change, as captured by `getState`. */
223
+ state: GridState;
224
+ }
153
225
  /**
154
226
  * Event payload for the `rowEditStarted` event.
155
227
  */
@@ -450,6 +522,68 @@ export interface ApexGridEventMap<T extends object> {
450
522
  * @event
451
523
  */
452
524
  cellValueChanged: CustomEvent<ApexCellValueChangedEvent<T>>;
525
+ /**
526
+ * Emitted when a candidate cell value is rejected by one or more of the
527
+ * column's {@link BaseColumnConfiguration.validators}. The value is not
528
+ * written; in inline edit mode the editor stays open. Fires for single,
529
+ * row-mode, and bulk (paste / fill) edits.
530
+ *
531
+ * @event
532
+ */
533
+ cellValidationFailed: CustomEvent<ApexCellValidationFailedEvent<T>>;
534
+ /**
535
+ * Emitted after the undo / redo stacks change (a recorded edit, an undo, a
536
+ * redo, or a clear). Carries the current `canUndo` / `canRedo` so a toolbar
537
+ * can enable or disable its buttons.
538
+ *
539
+ * @event
540
+ */
541
+ historyChanged: CustomEvent<ApexHistoryChangedEvent>;
542
+ /**
543
+ * Emitted (debounced, after the render pipeline settles) whenever the grid's
544
+ * restorable state changes, carrying the new {@link ApexGrid.getState}
545
+ * snapshot. The single signal for persistence (save the snapshot) or for
546
+ * re-prompting an AI layer. The payload is only computed while at least one
547
+ * `stateChanged` listener is attached, so it is zero-cost otherwise.
548
+ *
549
+ * @remarks
550
+ * Fires for programmatic changes (including `setState`) as well as user
551
+ * interaction. To avoid a save loop, compare the snapshot to your last-saved
552
+ * one before persisting (identical snapshots never fire a second time).
553
+ *
554
+ * @event
555
+ */
556
+ stateChanged: CustomEvent<ApexStateChangedEvent>;
557
+ /**
558
+ * Emitted before a row is pinned, moved between bands, or unpinned.
559
+ *
560
+ * @remarks
561
+ * Cancellable — `preventDefault()` aborts the change.
562
+ *
563
+ * @event
564
+ */
565
+ rowPinning: CustomEvent<ApexRowPinningEvent<T>>;
566
+ /**
567
+ * Emitted after a row's pin state has changed.
568
+ *
569
+ * @event
570
+ */
571
+ rowPinned: CustomEvent<ApexRowPinningEvent<T>>;
572
+ /**
573
+ * Emitted before a row is moved via drag, keyboard, or {@link ApexGrid.moveRow}.
574
+ *
575
+ * @remarks
576
+ * Cancellable — `preventDefault()` aborts the move.
577
+ *
578
+ * @event
579
+ */
580
+ rowMoving: CustomEvent<ApexRowMovingEvent<T>>;
581
+ /**
582
+ * Emitted after a row has been moved.
583
+ *
584
+ * @event
585
+ */
586
+ rowMoved: CustomEvent<ApexRowMovingEvent<T>>;
453
587
  /**
454
588
  * Emitted when a row enters edit mode (row edit mode only).
455
589
  *
@@ -515,81 +649,8 @@ export interface ApexGridEventMap<T extends object> {
515
649
  */
516
650
  rowSelected: CustomEvent<ApexRowSelectedEvent<T>>;
517
651
  }
518
- /**
519
- * Apex grid is a web component for displaying data in a tabular format quick and easy.
520
- *
521
- * Out of the box it provides row virtualization, sort and filter operations (client and server side),
522
- * the ability to template cells and headers and column hiding.
523
- *
524
- * @remarks
525
- * A working, styled grid requires three things:
526
- * 1. Register the element: `import 'apex-grid/define'` (or `ApexGrid.register()`).
527
- * 2. Give the host element a bounded height, e.g. `apex-grid { height: 480px }` —
528
- * the virtualizer collapses without one.
529
- * 3. Do NOT set `display` on the host — the component declares `:host { display: grid }`
530
- * internally and any override breaks the track layout.
531
- *
532
- * The grid is styled out of the box through `--ag-*` CSS custom properties —
533
- * there is no theme to import and no `configureTheme()` call. Override `--ag-*`
534
- * tokens on the host (or any ancestor) to rebrand; when `igniteui-webcomponents`
535
- * is present, the brand tokens auto-tint from its palette. For dark mode, set
536
- * the `theme="dark"` attribute on the host for the built-in slate dark palette
537
- * (further `--ag-*` overrides still compose on top). Add `tinted` (e.g.
538
- * `theme="tinted"` or `theme="dark tinted"`) to mix the brand into the chrome
539
- * so the grid wears its brand even at rest. See the README "Getting Started"
540
- * and "Theming" sections for the full example and token list.
541
- *
542
- * @element apex-grid
543
- *
544
- * @attr {string} theme - Space-separated theme flags. `dark` opts into the built-in dark palette; `tinted` mixes `--ag-brand` into the chrome surfaces. Combine as `theme="dark tinted"`.
545
- *
546
- * @fires sorting - Emitted when sorting is initiated through the UI.
547
- * @fires sorted - Emitted when a sort operation initiated through the UI has completed.
548
- * @fires filtering - Emitted when filtering is initiated through the UI.
549
- * @fires filtered - Emitted when a filter operation initiated through the UI has completed.
550
- * @fires pageChanging - Cancellable. Emitted before page/page-size changes are applied.
551
- * @fires pageChanged - Emitted after a page/page-size change has been applied.
552
- * @fires quickFilterChanging - Cancellable. Emitted before a quick-filter value is applied.
553
- * @fires quickFilterChanged - Emitted after a quick-filter change has been applied.
554
- * @fires columnPinning - Cancellable. Emitted before a column's pin position changes.
555
- * @fires columnPinned - Emitted after a column's pin position has changed.
556
- * @fires columnMoving - Cancellable. Emitted before a column is moved.
557
- * @fires columnMoved - Emitted after a column has been moved.
558
- * @fires cellValueChanging - Cancellable. Emitted before a cell value is committed.
559
- * @fires cellValueChanged - Emitted after a cell value has been committed.
560
- * @fires rowEditStarted - Emitted when a row enters edit mode (row mode only).
561
- * @fires rowEditEnded - Emitted when a row leaves edit mode (row mode only).
562
- * @fires rowSelecting - Cancellable. Emitted before a selection-set change is applied.
563
- * @fires rowSelected - Emitted after a selection-set change has been applied.
564
- * @fires rowExpanding - Cancellable. Emitted before the row-expansion set changes (master-detail).
565
- * @fires rowExpanded - Emitted after a row-expansion change has been applied.
566
- * @fires treeRowExpanding - Cancellable. Emitted before a tree-row expansion change (tree mode).
567
- * @fires treeRowExpanded - Emitted after a tree-row expansion change has been applied.
568
- *
569
- * @csspart live-region - Visually-hidden ARIA live region used for screen-reader announcements.
570
- *
571
- * @cssprop [--ag-brand] - Brand color for selection, focus rings, and accents. Auto-tints from `--ig-primary-500` when igniteui is present.
572
- * @cssprop [--ag-brand-strong] - Brand color for hover / pressed states.
573
- * @cssprop [--ag-grid-shadow] - Grid edge/shadow override. Default is a flat 1px hairline edge; set to `var(--ag-shadow-card)` for the elevated card look, or `none` to remove it.
574
- * @cssprop [--ag-grid-bg] - Host card background. Defaults to a subtle light gradient; override with a flat color (or use `theme="dark"`) for dark themes.
575
- * @cssprop [--ag-surface] - Grid card background (must be opaque).
576
- * @cssprop [--ag-surface-alt] - Alternating row tint.
577
- * @cssprop [--ag-surface-elevated] - Header background.
578
- * @cssprop [--ag-hairline] - Header / structural gridline color.
579
- * @cssprop [--ag-border] - Row separator color.
580
- * @cssprop [--ag-text] - Primary text color.
581
- * @cssprop [--ag-text-body] - Row text color.
582
- * @cssprop [--ag-text-muted] - Muted text (roles, labels).
583
- * @cssprop [--ag-row-hover] - Row hover wash.
584
- * @cssprop [--ag-row-h] - Row height.
585
- * @cssprop [--ag-header-h] - Header height.
586
- * @cssprop [--ag-radius] - Outer card corner radius.
587
- * @cssprop [--ag-font] - Grid font family.
588
- * @cssprop [--ag-fs-cell] - Cell font size.
589
- *
590
- * @see {@link https://github.com/apexcharts/apex-grid/blob/main/packages/core/src/styles/_tokens.scss | _tokens.scss} for the complete `--ag-*` token list.
591
- */
592
652
  export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMap<T>> {
653
+ #private;
593
654
  static get tagName(): string;
594
655
  static styles: import("lit").CSSResult;
595
656
  /**
@@ -628,6 +689,17 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
628
689
  columns: Array<ColumnConfiguration<T>>;
629
690
  /** The data source for the grid. */
630
691
  data: Array<T>;
692
+ /**
693
+ * Optional stable row-identity resolver.
694
+ *
695
+ * @remarks
696
+ * When provided, {@link ApexGrid.getState} captures selection / expansion /
697
+ * tree rows by the returned id, so they survive a wholesale {@link ApexGrid.data}
698
+ * reload. Without it those rows are captured by positional index into
699
+ * {@link ApexGrid.data}, which round-trips within a session but not across a
700
+ * data swap. The id must be unique per row and stable across reloads.
701
+ */
702
+ rowId?: (row: T) => string | number;
631
703
  /**
632
704
  * Whether the grid will try to "resolve" its column configuration based on the passed
633
705
  * data source.
@@ -712,6 +784,39 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
712
784
  * @attr show-export
713
785
  */
714
786
  showExport: boolean;
787
+ /**
788
+ * Localization overrides for the grid's built-in UI text (pagination, filter
789
+ * operators and controls, row/selection labels, the toolbar, and so on).
790
+ *
791
+ * @remarks
792
+ * A (possibly partial) map of locale keys to translated strings. Any key you
793
+ * omit falls back to the built-in English default, so partial maps are valid.
794
+ * A ready-made Spanish dictionary ships as `esLocale`; community translations
795
+ * are just plain objects of the same shape.
796
+ *
797
+ * @example
798
+ * ```ts
799
+ * import { esLocale } from '@apexcharts/grid';
800
+ *
801
+ * // Whole-UI translation:
802
+ * grid.localeText = esLocale;
803
+ *
804
+ * // Or override a handful of strings:
805
+ * grid.localeText = { 'toolbar.searchPlaceholder': 'Buscar productos…' };
806
+ * ```
807
+ */
808
+ localeText?: GridLocaleText;
809
+ /**
810
+ * Resolves a built-in locale key to its display string, applying any
811
+ * {@link ApexGrid.localeText} override over the English default and
812
+ * interpolating `{placeholder}` tokens from `params`.
813
+ *
814
+ * @remarks
815
+ * Used internally by the grid's components. `fallback` is returned when the
816
+ * key is not part of the built-in set (for example a custom filter operand's
817
+ * own label).
818
+ */
819
+ localize(key: GridLocaleKey, params?: LocaleParams, fallback?: string): string;
715
820
  /**
716
821
  * Enables drag-and-drop column reordering on the column headers.
717
822
  *
@@ -724,6 +829,26 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
724
829
  * @attr column-reordering
725
830
  */
726
831
  columnReordering: boolean;
832
+ /**
833
+ * Shows a persistent vertical divider on the trailing edge of every column
834
+ * header, rather than only the frozen-column pin edges.
835
+ *
836
+ * @remarks
837
+ * On by default. On columns that opt into resizing (via
838
+ * {@link BaseColumnConfiguration.resizable}) the divider doubles as the
839
+ * resize handle: it takes the `col-resize` cursor and can be dragged to
840
+ * resize, so the always-visible line is also the grab target. On
841
+ * non-resizable columns it is purely decorative.
842
+ *
843
+ * Because the default is `true`, hide the dividers by setting the property to
844
+ * `false` (`grid.columnSeparator = false`); the reflected `column-separator`
845
+ * attribute is then removed. The line's color and vertical inset are themeable
846
+ * through the `--ag-header-separator` / `--header-separator-color` custom
847
+ * properties and `--apex-header-separator-inset`.
848
+ *
849
+ * @attr column-separator
850
+ */
851
+ columnSeparator: boolean;
727
852
  /**
728
853
  * Inline editing configuration for the grid.
729
854
  *
@@ -809,6 +934,76 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
809
934
  * ```
810
935
  */
811
936
  expansion?: GridExpansionConfiguration<T>;
937
+ /**
938
+ * Row-pinning configuration.
939
+ *
940
+ * @remarks
941
+ * Disabled by default. Set `enabled: true` to allow pinning rows to a sticky
942
+ * top / bottom band via {@link ApexGrid.pinRow}.
943
+ *
944
+ * @example
945
+ * ```ts
946
+ * grid.rowPinning = { enabled: true };
947
+ * grid.pinRow(grid.data[0], 'top');
948
+ * ```
949
+ */
950
+ rowPinning?: GridRowPinningConfiguration;
951
+ /**
952
+ * Row-reordering configuration.
953
+ *
954
+ * @remarks
955
+ * Disabled by default. Set `enabled: true` to allow drag / keyboard reorder
956
+ * and {@link ApexGrid.moveRow}. A manual order is mutually exclusive with
957
+ * column sorting (applying a sort clears it). Set `applyToData: true` to also
958
+ * splice {@link ApexGrid.data} in place.
959
+ *
960
+ * @example
961
+ * ```ts
962
+ * grid.rowReordering = { enabled: true };
963
+ * ```
964
+ */
965
+ rowReordering?: GridRowReorderingConfiguration;
966
+ /**
967
+ * Transient spreadsheet coordinate hints: when `true`, a leading row-number
968
+ * gutter (1, 2, 3, ...) and A / B / C column letters are revealed so cell
969
+ * references are discoverable. Enterprise toggles this while a formula cell is
970
+ * being edited; it can also be set directly for a persistent spreadsheet look.
971
+ * Reflected so styling / tests can observe it on the host.
972
+ */
973
+ coordinateHints: boolean;
974
+ /**
975
+ * Whether column headers show the column-menu (kebab) button. On by default,
976
+ * and the button is always visible (not hover-only). Set to `false` to hide it
977
+ * entirely; a feature module's menu (e.g. the enterprise context menu) stays
978
+ * reachable by right-click. This is a JS property (no attribute) so it can
979
+ * stay `true` by default.
980
+ */
981
+ columnMenu: boolean;
982
+ /**
983
+ * Column groups rendered as spanning headers above the column header row.
984
+ *
985
+ * @remarks
986
+ * A column joins a group via its {@link BaseColumnConfiguration.group} id.
987
+ * Members must be contiguous within one pin region. `columns` stays flat — all
988
+ * width / pin / resize / reorder machinery is unchanged; grouping is a
989
+ * presentational header layer. v1 ships static spanning headers (no collapse).
990
+ *
991
+ * @example
992
+ * ```ts
993
+ * grid.columnGroups = [{ id: 'name', headerText: 'Name' }];
994
+ * grid.columns = [{ key: 'first', group: 'name' }, { key: 'last', group: 'name' }];
995
+ * ```
996
+ */
997
+ columnGroups?: ColumnGroupConfiguration[];
998
+ /**
999
+ * Whether a group header row should render: at least one configured group has
1000
+ * a visible member column.
1001
+ */
1002
+ get hasColumnGroups(): boolean;
1003
+ /**
1004
+ * Number of group header rows above the column header (0 or 1 in v1).
1005
+ */
1006
+ get columnGroupDepth(): number;
812
1007
  /**
813
1008
  * The currently expanded rows, in insertion order.
814
1009
  *
@@ -851,8 +1046,8 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
851
1046
  *
852
1047
  * @remarks
853
1048
  * Tree mode keeps {@link ApexGrid.data} flat; the grid derives the
854
- * hierarchy from a user-supplied `getDataPath(row)` callback (AG Grid's
855
- * "tree data" pattern). When enabled, the first visible data column (or
1049
+ * hierarchy from a user-supplied `getDataPath(row)` callback (the
1050
+ * flat-array "tree data" pattern). When enabled, the first visible data column (or
856
1051
  * the column referenced by `groupColumnKey`) renders a chevron toggle
857
1052
  * and depth-based indentation.
858
1053
  *
@@ -962,6 +1157,8 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
962
1157
  protected paginationChanged(): void;
963
1158
  protected quickFilterChanged(): void;
964
1159
  protected updated(): void;
1160
+ addEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
1161
+ removeEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | EventListenerOptions): void;
965
1162
  protected firstUpdated(): void;
966
1163
  /**
967
1164
  * Performs a filter operation in the grid based on the passed expression(s).
@@ -971,6 +1168,59 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
971
1168
  * Performs a sort operation in the grid based on the passed expression(s).
972
1169
  */
973
1170
  sort(expressions: SortExpression<T> | SortExpression<T>[]): void;
1171
+ /**
1172
+ * Returns a serializable, JSON-safe snapshot of the grid's restorable state:
1173
+ * column layout, sort, filter, quick-filter, pagination, selection, expansion,
1174
+ * tree expansion, and any feature-module state. Functions and templates are
1175
+ * omitted (see {@link GridState}).
1176
+ *
1177
+ * @remarks
1178
+ * Pair with {@link ApexGrid.setState} to persist/restore views, drive an AI
1179
+ * assistant, or implement save/restore. Set {@link ApexGrid.rowId} for
1180
+ * selection/expansion to survive a wholesale data reload.
1181
+ *
1182
+ * @example
1183
+ * ```ts
1184
+ * const snapshot = grid.getState();
1185
+ * localStorage.setItem('grid', JSON.stringify(snapshot));
1186
+ * // later …
1187
+ * grid.setState(JSON.parse(localStorage.getItem('grid')!));
1188
+ * ```
1189
+ */
1190
+ getState(options?: GetStateOptions<T>): GridState;
1191
+ /**
1192
+ * A machine-readable description of the grid: its columns and data types, the
1193
+ * operations available per column (sort directions, filter operands), the
1194
+ * grid-level capabilities, and the current {@link ApexGrid.getState} snapshot.
1195
+ *
1196
+ * @remarks
1197
+ * This is the contract an AI layer hands to an LLM (to constrain its output)
1198
+ * and validates a returned patch against before {@link ApexGrid.setState}, but
1199
+ * it is AI-agnostic: it equally drives a view-editor UI or documentation. It is
1200
+ * a descriptor, not a JSON-Schema document. The enterprise grid extends it with
1201
+ * grouping / pivot / aggregation availability.
1202
+ */
1203
+ getSchema(): GridSchema;
1204
+ /**
1205
+ * Applies a (partial) state snapshot produced by {@link ApexGrid.getState}.
1206
+ *
1207
+ * @remarks
1208
+ * Only the slices present on `state` are applied — omit a slice to leave it
1209
+ * untouched (e.g. pass `{ sort }` to change only sorting). A present-but-empty
1210
+ * `sort`/`filter` array clears that operation. Slices are applied in dependency
1211
+ * order (columns → sort → filter → quick-filter → module structure → row order
1212
+ * → tree → expansion → row pinning → selection → pagination) so row-referencing
1213
+ * state resolves against the transformed view. `rowOrder` is mutually exclusive
1214
+ * with an active `sort`: a snapshot carrying both keeps the sort and drops
1215
+ * `rowOrder`.
1216
+ *
1217
+ * **Defensive by design.** `setState` is written into by persisted blobs and
1218
+ * LLM output, so it never throws on malformed input (unless
1219
+ * {@link SetStateOptions.strict}): unknown columns / operands, out-of-range
1220
+ * pages, unresolvable rows, and wrong-typed slices are dropped, clamped, or
1221
+ * skipped, each recorded in the returned {@link SetStateResult}.
1222
+ */
1223
+ setState(state: Partial<GridState>, options?: SetStateOptions<T>): SetStateResult;
974
1224
  /**
975
1225
  * Resets the current sort state of the control.
976
1226
  */
@@ -1119,6 +1369,72 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1119
1369
  * Discards the current edit without writing back to {@link ApexGrid.data}.
1120
1370
  */
1121
1371
  cancelEdit(): void;
1372
+ /**
1373
+ * Whether there is a recorded edit to undo.
1374
+ *
1375
+ * @remarks
1376
+ * Always `false` unless `editing.history.enabled` is set.
1377
+ */
1378
+ get canUndo(): boolean;
1379
+ /**
1380
+ * Whether there is a previously-undone edit to redo.
1381
+ */
1382
+ get canRedo(): boolean;
1383
+ /**
1384
+ * Reverts the most recent cell-data edit (single, row-mode, or bulk paste /
1385
+ * fill commits each as one step). No-op when there is nothing to undo or
1386
+ * history is disabled.
1387
+ */
1388
+ undo(): void;
1389
+ /**
1390
+ * Re-applies the most recently undone edit. No-op when there is nothing to
1391
+ * redo or history is disabled.
1392
+ */
1393
+ redo(): void;
1394
+ /**
1395
+ * Clears the undo / redo stacks.
1396
+ */
1397
+ clearHistory(): void;
1398
+ /**
1399
+ * Pins `row` to a sticky top or bottom band, lifting it out of the scrolling
1400
+ * body. Moves it between bands when already pinned elsewhere.
1401
+ *
1402
+ * @remarks
1403
+ * Requires `rowPinning.enabled`. Goes through the cancellable `rowPinning`
1404
+ * event and emits `rowPinned` on success. Identity is by reference, so pass
1405
+ * the same object held in {@link ApexGrid.data}.
1406
+ *
1407
+ * @returns `true` when applied, `false` when disabled or cancelled.
1408
+ */
1409
+ pinRow(row: T, position?: RowPinPosition): boolean;
1410
+ /**
1411
+ * Unpins `row` from whichever band holds it, returning it to the scrolling
1412
+ * body.
1413
+ *
1414
+ * @returns `true` when applied (or already unpinned), `false` when cancelled.
1415
+ */
1416
+ unpinRow(row: T): boolean;
1417
+ /**
1418
+ * The currently pinned rows per band, in the order they were pinned.
1419
+ */
1420
+ get pinnedRows(): {
1421
+ top: T[];
1422
+ bottom: T[];
1423
+ };
1424
+ /**
1425
+ * Moves the row at view index `from` to land `position` (`'before'` /
1426
+ * `'after'`) the row at view index `to`. Indices are into
1427
+ * {@link ApexGrid.pageItems}.
1428
+ *
1429
+ * @remarks
1430
+ * Requires `rowReordering.enabled`. Establishes a manual order (mutually
1431
+ * exclusive with column sorting), goes through the cancellable `rowMoving`
1432
+ * event, emits `rowMoved`, and animates the affected rows.
1433
+ *
1434
+ * @returns `true` when applied, `false` when disabled, out of range, or
1435
+ * cancelled.
1436
+ */
1437
+ moveRow(from: number, to: number, position?: RowDropPosition): boolean;
1122
1438
  /**
1123
1439
  * Exports the current grid contents as a CSV string and (in a browser
1124
1440
  * context) triggers a download.
@@ -1150,6 +1466,17 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1150
1466
  * chosen id to {@link ApexGrid.exportAs}.
1151
1467
  */
1152
1468
  get exportFormats(): ReadonlyArray<ExportFormat>;
1469
+ /**
1470
+ * Custom action buttons rendered in the toolbar's trailing actions area, in
1471
+ * order.
1472
+ *
1473
+ * @remarks
1474
+ * The community grid contributes none. This is the seam derived grids use to
1475
+ * add toolbar buttons (mirroring {@link ApexGrid.exportFormats}):
1476
+ * `@apexcharts/grid-enterprise` overrides it to add a "Create chart" action.
1477
+ * The toolbar renders one button per entry and calls its `run()` on click.
1478
+ */
1479
+ get toolbarActions(): ReadonlyArray<ToolbarAction>;
1153
1480
  /**
1154
1481
  * Exports the grid in the given format (one of {@link ApexGrid.exportFormats}).
1155
1482
  * Called by the toolbar's export menu. The community grid handles `'csv'`;
@@ -1187,8 +1514,13 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1187
1514
  * builds on.
1188
1515
  */
1189
1516
  protected bodyPointerHandler(event: PointerEvent): void;
1517
+ protected renderGroupHeaderRow(): import("lit-html").TemplateResult<1> | typeof nothing;
1190
1518
  protected renderHeaderRow(): import("lit-html").TemplateResult<1>;
1191
1519
  protected renderBody(): import("lit-html").TemplateResult<1>;
1520
+ /** Number of chrome rows above the body (group header + header + optional filter). */
1521
+ protected get headerRowCount(): number;
1522
+ protected renderPinnedTop(): import("lit-html").TemplateResult<1> | typeof nothing;
1523
+ protected renderPinnedBottom(): import("lit-html").TemplateResult<1> | typeof nothing;
1192
1524
  protected renderFilterRow(): import("lit-html").TemplateResult<1> | typeof nothing;
1193
1525
  protected renderToolbar(): import("lit-html").TemplateResult<1> | typeof nothing;
1194
1526
  protected renderPaginator(): import("lit-html").TemplateResult<1> | typeof nothing;
@@ -1199,6 +1531,13 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1199
1531
  * don't have to coordinate consumer DOM placement.
1200
1532
  */
1201
1533
  protected renderLiveRegion(): import("lit-html").TemplateResult<1>;
1534
+ /**
1535
+ * Floating "ghost" of the row being pointer-dragged for reorder. Rendered at
1536
+ * the top of the shadow tree (outside the virtualizer) so its `position: fixed`
1537
+ * tracks the viewport, and painted from the cell snapshot captured at grab
1538
+ * time so it mirrors the row's visible content and column widths.
1539
+ */
1540
+ protected renderRowDragGhost(): import("lit-html").TemplateResult<1> | typeof nothing;
1202
1541
  protected render(): import("lit-html").TemplateResult<1>;
1203
1542
  /**
1204
1543
  * Sets the live region's announcement text. Screen readers configured to