apex-grid 3.4.0 → 3.6.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 (217) hide show
  1. package/CHANGELOG.md +439 -0
  2. package/LICENSE.md +125 -0
  3. package/README.md +107 -14
  4. package/components/cell.d.ts +30 -4
  5. package/components/cell.js +199 -53
  6. package/components/cell.js.map +1 -1
  7. package/components/filter-row.d.ts +2 -0
  8. package/components/filter-row.js +82 -28
  9. package/components/filter-row.js.map +1 -1
  10. package/components/grid.d.ts +257 -20
  11. package/components/grid.js +463 -99
  12. package/components/grid.js.map +1 -1
  13. package/components/group-header-row.js +28 -25
  14. package/components/group-header-row.js.map +1 -1
  15. package/components/header-row.d.ts +7 -5
  16. package/components/header-row.js +19 -9
  17. package/components/header-row.js.map +1 -1
  18. package/components/header.js +36 -22
  19. package/components/header.js.map +1 -1
  20. package/components/row.d.ts +19 -3
  21. package/components/row.js +96 -22
  22. package/components/row.js.map +1 -1
  23. package/components/toolbar.js +2 -1
  24. package/components/toolbar.js.map +1 -1
  25. package/components/virtualizer.d.ts +45 -1
  26. package/components/virtualizer.js +184 -3
  27. package/components/virtualizer.js.map +1 -1
  28. package/controllers/dom.d.ts +4 -4
  29. package/controllers/dom.js +40 -22
  30. package/controllers/dom.js.map +1 -1
  31. package/controllers/editing.d.ts +104 -37
  32. package/controllers/editing.js +230 -78
  33. package/controllers/editing.js.map +1 -1
  34. package/controllers/expansion.d.ts +14 -5
  35. package/controllers/expansion.js +24 -1
  36. package/controllers/expansion.js.map +1 -1
  37. package/controllers/filter.d.ts +10 -2
  38. package/controllers/filter.js +62 -17
  39. package/controllers/filter.js.map +1 -1
  40. package/controllers/history.d.ts +45 -8
  41. package/controllers/history.js +58 -20
  42. package/controllers/history.js.map +1 -1
  43. package/controllers/navigation.d.ts +68 -13
  44. package/controllers/navigation.js +196 -51
  45. package/controllers/navigation.js.map +1 -1
  46. package/controllers/pagination.d.ts +6 -0
  47. package/controllers/pagination.js +10 -2
  48. package/controllers/pagination.js.map +1 -1
  49. package/controllers/reorder.js +42 -24
  50. package/controllers/reorder.js.map +1 -1
  51. package/controllers/resize.d.ts +17 -2
  52. package/controllers/resize.js +16 -6
  53. package/controllers/resize.js.map +1 -1
  54. package/controllers/row-pin.d.ts +20 -2
  55. package/controllers/row-pin.js +16 -9
  56. package/controllers/row-pin.js.map +1 -1
  57. package/controllers/row-reorder.d.ts +31 -11
  58. package/controllers/row-reorder.js +117 -37
  59. package/controllers/row-reorder.js.map +1 -1
  60. package/controllers/selection.d.ts +11 -4
  61. package/controllers/selection.js +26 -11
  62. package/controllers/selection.js.map +1 -1
  63. package/controllers/sort.d.ts +22 -2
  64. package/controllers/sort.js +29 -23
  65. package/controllers/sort.js.map +1 -1
  66. package/controllers/state.d.ts +65 -10
  67. package/controllers/state.js +86 -6
  68. package/controllers/state.js.map +1 -1
  69. package/controllers/tree.d.ts +15 -10
  70. package/controllers/tree.js +0 -0
  71. package/controllers/tree.js.map +1 -1
  72. package/custom-elements.json +3589 -452
  73. package/docs/assets/hierarchy.js +1 -1
  74. package/docs/assets/highlight.css +15 -8
  75. package/docs/assets/navigation.js +1 -1
  76. package/docs/assets/search.js +1 -1
  77. package/docs/classes/ApexGrid.html +660 -0
  78. package/docs/classes/ApexGridPaginator.html +36 -0
  79. package/docs/classes/ApexGridToolbar.html +67 -0
  80. package/docs/functions/localize.html +2 -2
  81. package/docs/functions/setup.html +1 -2
  82. package/docs/hierarchy.html +1 -1
  83. package/docs/index.html +105 -15
  84. package/docs/interfaces/ApexCellValidationFailedEvent.html +3 -2
  85. package/docs/interfaces/ApexCellValueChangedEvent.html +4 -2
  86. package/docs/interfaces/ApexCellValueChangingEvent.html +3 -2
  87. package/docs/interfaces/ApexColumnMovedEvent.html +2 -2
  88. package/docs/interfaces/ApexColumnMovingEvent.html +1 -1
  89. package/docs/interfaces/ApexDetailContext.html +2 -2
  90. package/docs/interfaces/ApexGridEventMap.html +9 -6
  91. package/docs/interfaces/ApexRowEditEndedEvent.html +2 -1
  92. package/docs/interfaces/ApexRowEditStartedEvent.html +2 -1
  93. package/docs/interfaces/ApexRowMovingEvent.html +9 -3
  94. package/docs/interfaces/ApexRowPinningEvent.html +1 -1
  95. package/docs/interfaces/ApexTreeRowExpandedEvent.html +4 -1
  96. package/docs/interfaces/ApexTreeRowExpandingEvent.html +4 -1
  97. package/docs/interfaces/BaseApexCellContext.html +1 -1
  98. package/docs/interfaces/BaseApexEditorContext.html +1 -1
  99. package/docs/interfaces/BaseColumnConfiguration.html +3 -3
  100. package/docs/interfaces/BaseFilterExpression.html +2 -2
  101. package/docs/interfaces/CSVExportOptions.html +13 -5
  102. package/docs/interfaces/DataPipelineConfiguration.html +2 -2
  103. package/docs/interfaces/EditingHistoryConfiguration.html +1 -1
  104. package/docs/interfaces/ExportFormat.html +2 -2
  105. package/docs/interfaces/ExportOptions.html +5 -3
  106. package/docs/interfaces/GridExpansionConfiguration.html +6 -2
  107. package/docs/interfaces/GridRowPinningConfiguration.html +1 -1
  108. package/docs/interfaces/GridRowReorderingConfiguration.html +2 -2
  109. package/docs/interfaces/PaginationConfiguration.html +1 -1
  110. package/docs/interfaces/PaginationState.html +1 -1
  111. package/docs/interfaces/SetStateResult.html +3 -2
  112. package/docs/interfaces/ValidatorContext.html +7 -2
  113. package/docs/media/_token-values.scss +118 -0
  114. package/docs/media/package.json +5 -5
  115. package/docs/media/state-persistence.html +0 -10
  116. package/docs/modules.html +1 -1
  117. package/docs/types/DataPipelineParams.html +2 -2
  118. package/docs/types/EditMode.html +2 -2
  119. package/docs/types/ExportSource.html +6 -4
  120. package/docs/types/GridLocaleText.html +1 -1
  121. package/docs/types/OperandKeys.html +9 -0
  122. package/docs/types/PaginationMode.html +1 -1
  123. package/docs/variables/EN_LOCALE.html +3 -3
  124. package/docs/variables/esLocale.html +1 -1
  125. package/i18n/en.d.ts +19 -0
  126. package/i18n/en.js +19 -0
  127. package/i18n/en.js.map +1 -1
  128. package/i18n/es.js +19 -0
  129. package/i18n/es.js.map +1 -1
  130. package/index.d.ts +2 -0
  131. package/index.js +2 -0
  132. package/index.js.map +1 -1
  133. package/internal/column-types.d.ts +27 -1
  134. package/internal/column-types.js +75 -49
  135. package/internal/column-types.js.map +1 -1
  136. package/internal/constants.d.ts +1 -2
  137. package/internal/constants.js +0 -4
  138. package/internal/constants.js.map +1 -1
  139. package/internal/document-styles.d.ts +30 -0
  140. package/internal/document-styles.js +48 -0
  141. package/internal/document-styles.js.map +1 -0
  142. package/internal/export.d.ts +39 -7
  143. package/internal/export.js +35 -34
  144. package/internal/export.js.map +1 -1
  145. package/internal/feature-module.d.ts +82 -3
  146. package/internal/feature-module.js +11 -0
  147. package/internal/feature-module.js.map +1 -1
  148. package/internal/index.d.ts +6 -4
  149. package/internal/index.js +5 -3
  150. package/internal/index.js.map +1 -1
  151. package/internal/normalize-case.d.ts +8 -1
  152. package/internal/normalize-case.js +3 -2
  153. package/internal/normalize-case.js.map +1 -1
  154. package/internal/state-snapshot.d.ts +60 -8
  155. package/internal/state-snapshot.js +87 -19
  156. package/internal/state-snapshot.js.map +1 -1
  157. package/internal/types.d.ts +17 -2
  158. package/internal/types.js.map +1 -1
  159. package/internal/utils.d.ts +48 -6
  160. package/internal/utils.js +35 -21
  161. package/internal/utils.js.map +1 -1
  162. package/internal/validators.js +1 -0
  163. package/internal/validators.js.map +1 -1
  164. package/operations/filter/operands/number.js +9 -6
  165. package/operations/filter/operands/number.js.map +1 -1
  166. package/operations/filter/operands/string.js +2 -3
  167. package/operations/filter/operands/string.js.map +1 -1
  168. package/operations/filter/types.d.ts +13 -1
  169. package/operations/filter/types.js.map +1 -1
  170. package/operations/filter.d.ts +6 -0
  171. package/operations/filter.js +23 -7
  172. package/operations/filter.js.map +1 -1
  173. package/operations/quick-filter.js +2 -5
  174. package/operations/quick-filter.js.map +1 -1
  175. package/operations/sort.d.ts +21 -2
  176. package/operations/sort.js +41 -14
  177. package/operations/sort.js.map +1 -1
  178. package/package.json +8 -4
  179. package/setup.d.ts +23 -11
  180. package/setup.js +19 -21
  181. package/setup.js.map +1 -1
  182. package/styles/_common.css.js +1 -1
  183. package/styles/_common.css.js.map +1 -1
  184. package/styles/_token-values.css.d.ts +1 -0
  185. package/styles/_token-values.css.js +3 -0
  186. package/styles/_token-values.css.js.map +1 -0
  187. package/styles/_tokens.css.js +1 -1
  188. package/styles/_tokens.css.js.map +1 -1
  189. package/styles/body-cell/body-cell.css.js +1 -1
  190. package/styles/body-cell/body-cell.css.js.map +1 -1
  191. package/styles/body-cell/cell-renderers.css.js +1 -1
  192. package/styles/body-cell/cell-renderers.css.js.map +1 -1
  193. package/styles/body-row/body-row.css.js +1 -1
  194. package/styles/body-row/body-row.css.js.map +1 -1
  195. package/styles/document-tokens.css.d.ts +1 -0
  196. package/styles/document-tokens.css.js +3 -0
  197. package/styles/document-tokens.css.js.map +1 -0
  198. package/styles/filter-row/filter-row.css.js +1 -1
  199. package/styles/filter-row/filter-row.css.js.map +1 -1
  200. package/styles/grid/_grid.base.css.js +1 -1
  201. package/styles/grid/_grid.base.css.js.map +1 -1
  202. package/styles/grid/grid.css.js +1 -1
  203. package/styles/grid/grid.css.js.map +1 -1
  204. package/styles/group-header-row/group-header-row.css.js +1 -1
  205. package/styles/group-header-row/group-header-row.css.js.map +1 -1
  206. package/styles/header-cell/header-cell.css.js +1 -1
  207. package/styles/header-cell/header-cell.css.js.map +1 -1
  208. package/styles/header-row/header-row.base.css.js +1 -1
  209. package/styles/header-row/header-row.base.css.js.map +1 -1
  210. package/styles/paginator/paginator.css.js +1 -1
  211. package/styles/paginator/paginator.css.js.map +1 -1
  212. package/styles/toolbar/toolbar.css.js +1 -1
  213. package/styles/toolbar/toolbar.css.js.map +1 -1
  214. package/tokens.css +78 -0
  215. package/LICENSE +0 -80
  216. package/docs/media/LICENSE +0 -80
  217. package/docs/media/_tokens.scss +0 -193
@@ -1,5 +1,5 @@
1
1
  import { ContextProvider } from '@lit/context';
2
- import { nothing } from 'lit';
2
+ import { nothing, type PropertyDeclaration } from 'lit';
3
3
  import { DataOperationsController } from '../controllers/data-operation.js';
4
4
  import { GridDOMController } from '../controllers/dom.js';
5
5
  import type { RowPinPosition } from '../controllers/row-pin.js';
@@ -116,7 +116,8 @@ export interface ApexCellValueChangingEvent<T extends object> {
116
116
  */
117
117
  key: Keys<T>;
118
118
  /**
119
- * The view-relative row index (matches {@link ApexGrid.pageItems}).
119
+ * The view-relative row index (matches {@link ApexGrid.pageItems}), or
120
+ * -1 when the record is pinned or on another page.
120
121
  */
121
122
  rowIndex: number;
122
123
  /**
@@ -142,7 +143,9 @@ export interface ApexCellValueChangedEvent<T extends object> {
142
143
  */
143
144
  key: Keys<T>;
144
145
  /**
145
- * The view-relative row index after the change.
146
+ * The view-relative row index after the change (matches
147
+ * {@link ApexGrid.pageItems}), or -1 when the record is pinned or on
148
+ * another page. Use `data` to identify the row.
146
149
  */
147
150
  rowIndex: number;
148
151
  /**
@@ -164,7 +167,8 @@ export interface ApexCellValidationFailedEvent<T extends object> {
164
167
  */
165
168
  key: Keys<T>;
166
169
  /**
167
- * The view-relative row index of the rejected cell.
170
+ * The view-relative row index of the rejected cell, or -1 when the record
171
+ * is pinned or on another page.
168
172
  */
169
173
  rowIndex: number;
170
174
  /**
@@ -203,6 +207,14 @@ export interface ApexRowMovingEvent<T extends object> {
203
207
  from: number;
204
208
  /** The target row's view index. */
205
209
  to: number;
210
+ /** Whether the row lands before or after the target row. */
211
+ position: RowDropPosition;
212
+ /**
213
+ * The view index the row lands at, resolved from `to` and `position`
214
+ * (`moveRow(0, 3)` lands the row at 2). Splice the row out of `from` and in
215
+ * at `toIndex` to mirror the move.
216
+ */
217
+ toIndex: number;
206
218
  /** The row being moved (a live reference into {@link ApexGrid.data}). */
207
219
  data: T;
208
220
  }
@@ -227,7 +239,8 @@ export interface ApexStateChangedEvent {
227
239
  */
228
240
  export interface ApexRowEditStartedEvent {
229
241
  /**
230
- * The view-relative row index entering edit mode.
242
+ * The view-relative row index entering edit mode, or -1 when the record is
243
+ * pinned or on another page.
231
244
  */
232
245
  rowIndex: number;
233
246
  }
@@ -236,7 +249,8 @@ export interface ApexRowEditStartedEvent {
236
249
  */
237
250
  export interface ApexRowEditEndedEvent {
238
251
  /**
239
- * The view-relative row index that left edit mode.
252
+ * The view-relative row index that left edit mode, or -1 when the record is
253
+ * pinned or on another page.
240
254
  */
241
255
  rowIndex: number;
242
256
  /**
@@ -324,6 +338,11 @@ export interface ApexRowSelectedEvent<T extends object> {
324
338
  }
325
339
  /**
326
340
  * Event payload for the cancellable `treeRowExpanding` event.
341
+ *
342
+ * @remarks
343
+ * A parent that exists only as a path segment (no row of its own in
344
+ * {@link ApexGrid.data}) appears in these arrays as a synthesized placeholder
345
+ * row, not as one of your records.
327
346
  */
328
347
  export interface ApexTreeRowExpandingEvent<T extends object> {
329
348
  /** Rows that will become expanded by this change. */
@@ -337,6 +356,11 @@ export interface ApexTreeRowExpandingEvent<T extends object> {
337
356
  }
338
357
  /**
339
358
  * Event payload for the `treeRowExpanded` event.
359
+ *
360
+ * @remarks
361
+ * A parent that exists only as a path segment (no row of its own in
362
+ * {@link ApexGrid.data}) appears in these arrays as a synthesized placeholder
363
+ * row, not as one of your records.
340
364
  */
341
365
  export interface ApexTreeRowExpandedEvent<T extends object> {
342
366
  /** Rows that became expanded in this change. */
@@ -550,6 +574,9 @@ export interface ApexGridEventMap<T extends object> {
550
574
  * Fires for programmatic changes (including `setState`) as well as user
551
575
  * interaction. To avoid a save loop, compare the snapshot to your last-saved
552
576
  * one before persisting (identical snapshots never fire a second time).
577
+ * Attach the listener to the grid element itself: the snapshot is computed
578
+ * only for listeners registered on the grid, so a listener on an ancestor
579
+ * (event delegation) receives nothing while none is attached to the grid.
553
580
  *
554
581
  * @event
555
582
  */
@@ -649,6 +676,99 @@ export interface ApexGridEventMap<T extends object> {
649
676
  */
650
677
  rowSelected: CustomEvent<ApexRowSelectedEvent<T>>;
651
678
  }
679
+ /**
680
+ * Apex grid is a web component for displaying data in a tabular format quick and easy.
681
+ *
682
+ * Out of the box it provides row virtualization, sort and filter operations (client and server side),
683
+ * the ability to template cells and headers and column hiding.
684
+ *
685
+ * @remarks
686
+ * A working, styled grid requires three things:
687
+ * 1. Register the element: `import 'apex-grid/define'` (or `ApexGrid.register()`).
688
+ * 2. Give the host element a bounded height, e.g. `apex-grid { height: 480px }` —
689
+ * the virtualizer collapses without one.
690
+ * 3. Do NOT set `display` on the host — the component declares `:host { display: grid }`
691
+ * internally and any override breaks the track layout.
692
+ *
693
+ * The grid is styled out of the box through `--ag-*` CSS custom properties —
694
+ * there is no theme to import and no `configureTheme()` call. Override `--ag-*`
695
+ * tokens on the host (or any ancestor) to rebrand; where an Ignite UI palette is
696
+ * present, the brand tokens auto-tint from it. For dark mode, set
697
+ * the `theme="dark"` attribute on the host for the built-in slate dark palette
698
+ * (further `--ag-*` overrides still compose on top). Add `tinted` (e.g.
699
+ * `theme="tinted"` or `theme="dark tinted"`) to mix the brand into the chrome
700
+ * so the grid wears its brand even at rest. See the README "Getting Started"
701
+ * and "Theming" sections for the full example and token list.
702
+ *
703
+ * @element apex-grid
704
+ *
705
+ * @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"`.
706
+ *
707
+ * @fires sorting - Emitted when sorting is initiated through the UI.
708
+ * @fires sorted - Emitted when a sort operation initiated through the UI has completed.
709
+ * @fires filtering - Emitted when filtering is initiated through the UI.
710
+ * @fires filtered - Emitted when a filter operation initiated through the UI has completed.
711
+ * @fires pageChanging - Cancellable. Emitted before page/page-size changes are applied.
712
+ * @fires pageChanged - Emitted after a page/page-size change has been applied.
713
+ * @fires quickFilterChanging - Cancellable. Emitted before a quick-filter value is applied.
714
+ * @fires quickFilterChanged - Emitted after a quick-filter change has been applied.
715
+ * @fires columnPinning - Cancellable. Emitted before a column's pin position changes.
716
+ * @fires columnPinned - Emitted after a column's pin position has changed.
717
+ * @fires columnMoving - Cancellable. Emitted before a column is moved.
718
+ * @fires columnMoved - Emitted after a column has been moved.
719
+ * @fires cellValueChanging - Cancellable. Emitted before a cell value is committed.
720
+ * @fires cellValueChanged - Emitted after a cell value has been committed.
721
+ * @fires rowEditStarted - Emitted when a row enters edit mode (row mode only).
722
+ * @fires rowEditEnded - Emitted when a row leaves edit mode (row mode only).
723
+ * @fires rowSelecting - Cancellable. Emitted before a selection-set change is applied.
724
+ * @fires rowSelected - Emitted after a selection-set change has been applied.
725
+ * @fires rowExpanding - Cancellable. Emitted before the row-expansion set changes (master-detail).
726
+ * @fires rowExpanded - Emitted after a row-expansion change has been applied.
727
+ * @fires treeRowExpanding - Cancellable. Emitted before a tree-row expansion change (tree mode).
728
+ * @fires treeRowExpanded - Emitted after a tree-row expansion change has been applied.
729
+ *
730
+ * @csspart live-region - Visually-hidden ARIA live region used for screen-reader announcements.
731
+ *
732
+ * @cssprop [--ag-brand] - Brand color for selection, focus rings, and accents. Auto-tints from `--ig-primary-500` where an Ignite UI palette is present.
733
+ * @cssprop [--ag-brand-strong] - Brand color for hover / pressed states.
734
+ * @cssprop [--ag-grid-shadow] - Grid edge/shadow override. Default is a flat 1px hairline edge; set to `var(--ag-shadow-card)` (`var(--ag-dark-shadow-card)` on a dark grid) for the elevated card look, or `none` to remove it.
735
+ * @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.
736
+ * @cssprop [--ag-surface] - Grid card background (must be opaque).
737
+ * @cssprop [--ag-surface-alt] - Alternating row tint.
738
+ * @cssprop [--ag-surface-elevated] - Header background.
739
+ * @cssprop [--ag-hairline] - Header / structural gridline color.
740
+ * @cssprop [--ag-border] - Row separator color.
741
+ * @cssprop [--ag-text] - Primary text color.
742
+ * @cssprop [--ag-text-body] - Row text color.
743
+ * @cssprop [--ag-text-muted] - Muted text (roles, labels).
744
+ * @cssprop [--ag-row-hover] - Row hover wash.
745
+ * @cssprop [--ag-dark-grid-bg] - Host card background on `theme="dark"` grids. Dark grids read the `--ag-dark-*` colours instead of the light ones.
746
+ * @cssprop [--ag-dark-surface] - Grid card background on dark grids (must be opaque).
747
+ * @cssprop [--ag-dark-surface-alt] - Alternating row tint on dark grids.
748
+ * @cssprop [--ag-dark-surface-elevated] - Header background on dark grids.
749
+ * @cssprop [--ag-dark-hairline] - Header / structural gridline color on dark grids.
750
+ * @cssprop [--ag-dark-border] - Row separator color on dark grids.
751
+ * @cssprop [--ag-dark-text] - Primary text color on dark grids.
752
+ * @cssprop [--ag-dark-text-body] - Row text color on dark grids.
753
+ * @cssprop [--ag-dark-text-muted] - Muted text (roles, labels) on dark grids.
754
+ * @cssprop [--ag-dark-row-hover] - Row hover wash on dark grids.
755
+ * @cssprop [--ag-dark-shadow-card] - Elevated card shadow for dark grids (see `--ag-grid-shadow`).
756
+ * @cssprop [--ag-row-h] - Row height.
757
+ * @cssprop [--ag-header-h] - Header height.
758
+ * @cssprop [--ag-radius] - Outer card corner radius.
759
+ * @cssprop [--ag-font] - Grid font family.
760
+ * @cssprop [--ag-fs-cell] - Cell font size.
761
+ *
762
+ * @see {@link https://github.com/apexcharts/apex-grid/blob/main/packages/core/src/styles/_tokens.scss | _tokens.scss} for the complete `--ag-*` token list.
763
+ *
764
+ * @fires cellValidationFailed - Emitted when a candidate cell value is rejected by a column validator; the value is not written.
765
+ * @fires historyChanged - Emitted after the undo / redo stacks change; carries the current `canUndo` / `canRedo`.
766
+ * @fires stateChanged - Emitted (debounced) whenever the grid's restorable state changes; carries the new `getState` snapshot.
767
+ * @fires rowPinning - Cancellable. Emitted before a row is pinned, moved between bands, or unpinned.
768
+ * @fires rowPinned - Emitted after a row's pin state has changed.
769
+ * @fires rowMoving - Cancellable. Emitted before a row is moved via drag, keyboard, or `moveRow`.
770
+ * @fires rowMoved - Emitted after a row has been moved.
771
+ */
652
772
  export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMap<T>> {
653
773
  #private;
654
774
  static get tagName(): string;
@@ -687,8 +807,14 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
687
807
  protected _rows: NodeListOf<ApexGridRow<T>>;
688
808
  /** Column configuration for the grid. */
689
809
  columns: Array<ColumnConfiguration<T>>;
690
- /** The data source for the grid. */
691
- data: Array<T>;
810
+ /**
811
+ * The data source for the grid. `null` or `undefined` (a framework prop that
812
+ * is still loading) is stored as an empty array.
813
+ *
814
+ * @default []
815
+ */
816
+ get data(): Array<T>;
817
+ set data(value: Array<T>);
692
818
  /**
693
819
  * Optional stable row-identity resolver.
694
820
  *
@@ -759,8 +885,10 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
759
885
  * {@link DataPipelineConfiguration.quickFilter}.
760
886
  *
761
887
  * @attr quick-filter
888
+ * @default ''
762
889
  */
763
- quickFilter: string;
890
+ get quickFilter(): string;
891
+ set quickFilter(value: string);
764
892
  /**
765
893
  * Whether the built-in quick-filter input is rendered in the toolbar.
766
894
  *
@@ -1083,16 +1211,24 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1083
1211
  isTreeRowExpanded(row: T): boolean;
1084
1212
  /**
1085
1213
  * Set the sort state for the grid.
1214
+ *
1215
+ * @remarks
1216
+ * Replaces the current sort; `[]`, `null` or `undefined` clears it. Applied
1217
+ * at the next update, against the columns as they are then.
1086
1218
  */
1087
- set sortExpressions(expressions: SortExpression<T>[]);
1219
+ set sortExpressions(expressions: SortExpression<T>[] | null | undefined);
1088
1220
  /**
1089
1221
  * Get the sort state for the grid.
1090
1222
  */
1091
1223
  get sortExpressions(): SortExpression<T>[];
1092
1224
  /**
1093
1225
  * Set the filter state for the grid.
1226
+ *
1227
+ * @remarks
1228
+ * Replaces the current filter; `[]`, `null` or `undefined` clears it. Applied
1229
+ * at the next update, against the columns as they are then.
1094
1230
  */
1095
- set filterExpressions(expressions: FilterExpression<T>[]);
1231
+ set filterExpressions(expressions: FilterExpression<T>[] | null | undefined);
1096
1232
  /**
1097
1233
  * Get the filter state for the grid.
1098
1234
  */
@@ -1139,9 +1275,17 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1139
1275
  get pageItems(): ReadonlyArray<T>;
1140
1276
  /**
1141
1277
  * The current zero-based page index.
1278
+ *
1279
+ * @remarks
1280
+ * Navigates like {@link ApexGrid.gotoPage}, with the cancellable
1281
+ * `pageChanging` and the `pageChanged` events. Assigned before the first
1282
+ * render, or while a data, filter or quick filter change has yet to render,
1283
+ * the page is kept as given and clamped once the view settles, without those
1284
+ * events.
1142
1285
  */
1143
1286
  get page(): number;
1144
1287
  set page(value: number);
1288
+ requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration, useNewValue?: boolean, newValue?: unknown): void;
1145
1289
  /**
1146
1290
  * The current page size.
1147
1291
  */
@@ -1152,13 +1296,33 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1152
1296
  */
1153
1297
  get pageCount(): number;
1154
1298
  protected watchColumns(_: ColumnConfiguration<T>[], newConfig?: ColumnConfiguration<T>[]): void;
1299
+ /**
1300
+ * The records undo history, the manual row order and row pins may still
1301
+ * name after {@link ApexGrid.data} changes; anything naming another record is
1302
+ * dropped. Defaults to `data`. A row model that writes only part of a larger
1303
+ * record set into `data` (rows under a collapsed group leave `data` but stay
1304
+ * cached and come back as the same objects) overrides this to also yield the
1305
+ * records it keeps, so a collapse does not wipe them. Read only while there
1306
+ * is history, a manual order or a pin to reconcile.
1307
+ */
1308
+ protected historyRecords(): Iterable<T>;
1155
1309
  protected dataChanged(): void;
1156
- protected pipeline(): Promise<void>;
1157
1310
  protected paginationChanged(): void;
1158
1311
  protected quickFilterChanged(): void;
1312
+ /** The first render shapes the tree in dataChanged; later changes rebuild it. */
1313
+ protected treeChanged(previous?: GridTreeConfiguration<T>): void;
1314
+ protected pipeline(): Promise<void>;
1315
+ /**
1316
+ * Resolves once the pending update, the pipeline runs it started and the
1317
+ * render of their result have settled. Events that report the new view
1318
+ * (`sorted`, `filtered`, `pageChanged`, `quickFilterChanged`) await this,
1319
+ * so with an async pipeline hook they fire after the rows changed.
1320
+ */
1321
+ protected pipelineSettled(): Promise<void>;
1159
1322
  protected updated(): void;
1160
1323
  addEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
1161
1324
  removeEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | EventListenerOptions): void;
1325
+ connectedCallback(): void;
1162
1326
  protected firstUpdated(): void;
1163
1327
  /**
1164
1328
  * Performs a filter operation in the grid based on the passed expression(s).
@@ -1275,7 +1439,7 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1275
1439
  /**
1276
1440
  * Applies a new quick-filter (global search) value, emitting the cancellable
1277
1441
  * `quickFilterChanging` event first and the `quickFilterChanged` event after the
1278
- * pipeline has run.
1442
+ * pipeline has run. Moving back to the first page fires `pageChanged` too.
1279
1443
  *
1280
1444
  * @param value - The new quick-filter value. Pass `''` to clear.
1281
1445
  * @returns `true` if the change was applied, `false` if cancelled or a no-op.
@@ -1327,7 +1491,9 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1327
1491
  */
1328
1492
  unpinColumn(key: Keys<T>): Promise<boolean>;
1329
1493
  /**
1330
- * The cell currently in edit mode, or `null`.
1494
+ * The cell currently in edit mode, or `null`. `rowIndex` is view-relative
1495
+ * (matches {@link ApexGrid.pageItems}), or -1 when the edited record is
1496
+ * pinned or on another page.
1331
1497
  */
1332
1498
  get editingCell(): {
1333
1499
  rowIndex: number;
@@ -1335,7 +1501,8 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1335
1501
  } | null;
1336
1502
  /**
1337
1503
  * The view-relative index of the row currently in edit mode (row edit mode
1338
- * only), or `null`.
1504
+ * only), or `null`. It is -1 when the edited record is pinned or on another
1505
+ * page.
1339
1506
  */
1340
1507
  get editingRow(): number | null;
1341
1508
  /**
@@ -1365,6 +1532,58 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1365
1532
  * `rowEditEnded` in row mode.
1366
1533
  */
1367
1534
  commitEdit(): Promise<boolean>;
1535
+ /**
1536
+ * Applies many cell edits as a **single** operation.
1537
+ *
1538
+ * Every write goes through the same choke point interactive editing uses, so
1539
+ * each one emits the cancellable `cellValueChanging` and then
1540
+ * `cellValueChanged`, and runs the column's validators. What differs from
1541
+ * calling {@link editCell} + {@link commitEdit} in a loop is that the whole
1542
+ * set lands as one undo step and triggers one pipeline run, which is the
1543
+ * point: a thousand `editCell` round-trips would be a thousand entries in the
1544
+ * undo stack and a thousand re-renders.
1545
+ *
1546
+ * Name each target cell's row in one of two ways. `rowIndex` is
1547
+ * view-relative and matches {@link ApexGrid.pageItems}, the same as
1548
+ * {@link editCell}, so it reaches the current page only. `row` is the record
1549
+ * itself (a live reference into {@link ApexGrid.data}), which also reaches
1550
+ * rows on other pages, pinned rows and rows under a collapsed tree parent;
1551
+ * their events and validators see `rowIndex` -1. A `rowIndex` must be a
1552
+ * whole number from 0 to `pageItems.length - 1`. Edits naming an unknown
1553
+ * column, any other row index (negative, fractional or past the end of the
1554
+ * page), a row a feature synthesized (a group header, a total, a row a
1555
+ * server has not sent yet), or a column the user could not edit
1556
+ * either (editing off, not `editable`, or hidden: the same gate interactive
1557
+ * editing uses) are skipped rather than throwing, so a partially-stale batch
1558
+ * still applies what it can.
1559
+ *
1560
+ * @param edits Cells to write. Order is preserved, so later edits to the same
1561
+ * cell win.
1562
+ * @returns A per-outcome tally. `applied` counts cells whose value actually
1563
+ * changed; `unchanged`, `invalid` and `cancelled` explain the rest, so a caller
1564
+ * can tell a rejected batch from a no-op one.
1565
+ *
1566
+ * @example Bulk-clear a column for the rows the user selected, on any page
1567
+ * ```ts
1568
+ * grid.applyEdits(grid.selectedRows.map((row) => ({ row, column: 'discount', value: 0 })));
1569
+ * ```
1570
+ */
1571
+ applyEdits(edits: ReadonlyArray<{
1572
+ column: Keys<T>;
1573
+ value: unknown;
1574
+ } & ({
1575
+ rowIndex: number;
1576
+ row?: never;
1577
+ } | {
1578
+ row: T;
1579
+ rowIndex?: never;
1580
+ })>): {
1581
+ applied: number;
1582
+ unchanged: number;
1583
+ invalid: number;
1584
+ cancelled: number;
1585
+ skipped: number;
1586
+ };
1368
1587
  /**
1369
1588
  * Discards the current edit without writing back to {@link ApexGrid.data}.
1370
1589
  */
@@ -1427,12 +1646,13 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1427
1646
  * {@link ApexGrid.pageItems}.
1428
1647
  *
1429
1648
  * @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.
1649
+ * Requires `rowReordering.enabled`. Establishes a manual order and clears
1650
+ * any column sort (the two are mutually exclusive), goes through the
1651
+ * cancellable `rowMoving` event, emits `rowMoved`, and animates the affected
1652
+ * rows. Rows hidden by a filter keep their place in the order.
1433
1653
  *
1434
- * @returns `true` when applied, `false` when disabled, out of range, or
1435
- * cancelled.
1654
+ * @returns `true` when applied, `false` when disabled, out of range, a no-op
1655
+ * (the row would land where it already is), or cancelled.
1436
1656
  */
1437
1657
  moveRow(from: number, to: number, position?: RowDropPosition): boolean;
1438
1658
  /**
@@ -1504,6 +1724,23 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1504
1724
  * ```
1505
1725
  */
1506
1726
  moveColumn(fromKey: Keys<T>, toKey: Keys<T>, position?: ColumnDropPosition): Promise<boolean>;
1727
+ /**
1728
+ * Whether `event` belongs to this grid, rather than to a grid nested inside
1729
+ * it (the grid in a master-detail panel renders inside one of this grid's
1730
+ * rows, so its events cross this grid's body on their way out). The first
1731
+ * grid, or grid body, on the composed path from the event origin outward is
1732
+ * the one that owns it.
1733
+ *
1734
+ * @param event - an event that reached this grid.
1735
+ */
1736
+ ownsEvent(event: Event): boolean;
1737
+ /**
1738
+ * The virtualizer is about to re-render a new range of rows. When the row
1739
+ * holding focus leaves it, its cell is removed and focus would fall to the
1740
+ * document, so the scroll container takes focus first and the keyboard
1741
+ * keeps working from the active cell.
1742
+ */
1743
+ protected bodyRangeChanged(event: Event): void;
1507
1744
  protected bodyClickHandler(event: MouseEvent): void;
1508
1745
  protected bodyKeydownHandler(event: KeyboardEvent): void;
1509
1746
  /**