apex-grid 3.5.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 (197) hide show
  1. package/CHANGELOG.md +338 -0
  2. package/LICENSE.md +125 -0
  3. package/README.md +64 -10
  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 +146 -36
  11. package/components/grid.js +442 -103
  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 +11 -9
  17. package/components/header-row.js.map +1 -1
  18. package/components/header.js +32 -20
  19. package/components/header.js.map +1 -1
  20. package/components/row.d.ts +19 -3
  21. package/components/row.js +69 -23
  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 +40 -0
  26. package/components/virtualizer.js +116 -5
  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 +67 -13
  44. package/controllers/navigation.js +191 -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 +38 -22
  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 +56 -7
  67. package/controllers/state.js +76 -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 +3156 -277
  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 +155 -81
  78. package/docs/classes/ApexGridPaginator.html +1 -1
  79. package/docs/classes/ApexGridToolbar.html +3 -3
  80. package/docs/functions/localize.html +2 -2
  81. package/docs/hierarchy.html +1 -1
  82. package/docs/index.html +74 -11
  83. package/docs/interfaces/ApexCellValidationFailedEvent.html +3 -2
  84. package/docs/interfaces/ApexCellValueChangedEvent.html +4 -2
  85. package/docs/interfaces/ApexCellValueChangingEvent.html +3 -2
  86. package/docs/interfaces/ApexGridEventMap.html +5 -2
  87. package/docs/interfaces/ApexRowEditEndedEvent.html +2 -1
  88. package/docs/interfaces/ApexRowEditStartedEvent.html +2 -1
  89. package/docs/interfaces/ApexRowMovingEvent.html +9 -3
  90. package/docs/interfaces/ApexRowPinningEvent.html +1 -1
  91. package/docs/interfaces/ApexTreeRowExpandedEvent.html +4 -1
  92. package/docs/interfaces/ApexTreeRowExpandingEvent.html +4 -1
  93. package/docs/interfaces/BaseApexCellContext.html +1 -1
  94. package/docs/interfaces/BaseApexEditorContext.html +1 -1
  95. package/docs/interfaces/BaseFilterExpression.html +2 -2
  96. package/docs/interfaces/CSVExportOptions.html +12 -4
  97. package/docs/interfaces/DataPipelineConfiguration.html +1 -1
  98. package/docs/interfaces/ExportOptions.html +5 -3
  99. package/docs/interfaces/GridExpansionConfiguration.html +6 -2
  100. package/docs/interfaces/GridRowReorderingConfiguration.html +1 -1
  101. package/docs/interfaces/PaginationState.html +1 -1
  102. package/docs/interfaces/SetStateResult.html +3 -2
  103. package/docs/interfaces/ValidatorContext.html +7 -2
  104. package/docs/media/_token-values.scss +118 -0
  105. package/docs/media/package.json +3 -2
  106. package/docs/modules.html +1 -1
  107. package/docs/types/ExportSource.html +6 -4
  108. package/docs/types/OperandKeys.html +9 -0
  109. package/docs/variables/EN_LOCALE.html +2 -2
  110. package/i18n/en.d.ts +5 -0
  111. package/i18n/en.js +5 -0
  112. package/i18n/en.js.map +1 -1
  113. package/i18n/es.js +5 -0
  114. package/i18n/es.js.map +1 -1
  115. package/internal/column-types.d.ts +27 -1
  116. package/internal/column-types.js +75 -49
  117. package/internal/column-types.js.map +1 -1
  118. package/internal/constants.d.ts +1 -2
  119. package/internal/constants.js +0 -4
  120. package/internal/constants.js.map +1 -1
  121. package/internal/document-styles.d.ts +30 -0
  122. package/internal/document-styles.js +48 -0
  123. package/internal/document-styles.js.map +1 -0
  124. package/internal/export.d.ts +39 -7
  125. package/internal/export.js +35 -34
  126. package/internal/export.js.map +1 -1
  127. package/internal/feature-module.d.ts +60 -3
  128. package/internal/feature-module.js +6 -0
  129. package/internal/feature-module.js.map +1 -1
  130. package/internal/index.d.ts +6 -4
  131. package/internal/index.js +5 -3
  132. package/internal/index.js.map +1 -1
  133. package/internal/normalize-case.d.ts +8 -1
  134. package/internal/normalize-case.js +3 -2
  135. package/internal/normalize-case.js.map +1 -1
  136. package/internal/state-snapshot.d.ts +60 -8
  137. package/internal/state-snapshot.js +87 -19
  138. package/internal/state-snapshot.js.map +1 -1
  139. package/internal/types.d.ts +17 -2
  140. package/internal/types.js.map +1 -1
  141. package/internal/utils.d.ts +34 -6
  142. package/internal/utils.js +30 -21
  143. package/internal/utils.js.map +1 -1
  144. package/internal/validators.js +1 -0
  145. package/internal/validators.js.map +1 -1
  146. package/operations/filter/operands/number.js +9 -6
  147. package/operations/filter/operands/number.js.map +1 -1
  148. package/operations/filter/operands/string.js +2 -3
  149. package/operations/filter/operands/string.js.map +1 -1
  150. package/operations/filter/types.d.ts +13 -1
  151. package/operations/filter/types.js.map +1 -1
  152. package/operations/filter.d.ts +6 -0
  153. package/operations/filter.js +23 -7
  154. package/operations/filter.js.map +1 -1
  155. package/operations/quick-filter.js +2 -5
  156. package/operations/quick-filter.js.map +1 -1
  157. package/operations/sort.d.ts +21 -2
  158. package/operations/sort.js +41 -14
  159. package/operations/sort.js.map +1 -1
  160. package/package.json +8 -3
  161. package/setup.d.ts +11 -0
  162. package/setup.js +9 -19
  163. package/setup.js.map +1 -1
  164. package/styles/_token-values.css.d.ts +1 -0
  165. package/styles/_token-values.css.js +3 -0
  166. package/styles/_token-values.css.js.map +1 -0
  167. package/styles/_tokens.css.js +1 -1
  168. package/styles/_tokens.css.js.map +1 -1
  169. package/styles/body-cell/body-cell.css.js +1 -1
  170. package/styles/body-cell/body-cell.css.js.map +1 -1
  171. package/styles/body-cell/cell-renderers.css.js +1 -1
  172. package/styles/body-cell/cell-renderers.css.js.map +1 -1
  173. package/styles/body-row/body-row.css.js +1 -1
  174. package/styles/body-row/body-row.css.js.map +1 -1
  175. package/styles/document-tokens.css.d.ts +1 -0
  176. package/styles/document-tokens.css.js +3 -0
  177. package/styles/document-tokens.css.js.map +1 -0
  178. package/styles/filter-row/filter-row.css.js +1 -1
  179. package/styles/filter-row/filter-row.css.js.map +1 -1
  180. package/styles/grid/_grid.base.css.js +1 -1
  181. package/styles/grid/_grid.base.css.js.map +1 -1
  182. package/styles/grid/grid.css.js +1 -1
  183. package/styles/grid/grid.css.js.map +1 -1
  184. package/styles/group-header-row/group-header-row.css.js +1 -1
  185. package/styles/group-header-row/group-header-row.css.js.map +1 -1
  186. package/styles/header-cell/header-cell.css.js +1 -1
  187. package/styles/header-cell/header-cell.css.js.map +1 -1
  188. package/styles/header-row/header-row.base.css.js +1 -1
  189. package/styles/header-row/header-row.base.css.js.map +1 -1
  190. package/styles/paginator/paginator.css.js +1 -1
  191. package/styles/paginator/paginator.css.js.map +1 -1
  192. package/styles/toolbar/toolbar.css.js +1 -1
  193. package/styles/toolbar/toolbar.css.js.map +1 -1
  194. package/tokens.css +78 -0
  195. package/LICENSE +0 -80
  196. package/docs/media/LICENSE +0 -80
  197. package/docs/media/_tokens.scss +0 -214
@@ -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
  */
@@ -704,7 +731,7 @@ export interface ApexGridEventMap<T extends object> {
704
731
  *
705
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.
706
733
  * @cssprop [--ag-brand-strong] - Brand color for hover / pressed states.
707
- * @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.
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.
708
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.
709
736
  * @cssprop [--ag-surface] - Grid card background (must be opaque).
710
737
  * @cssprop [--ag-surface-alt] - Alternating row tint.
@@ -715,6 +742,17 @@ export interface ApexGridEventMap<T extends object> {
715
742
  * @cssprop [--ag-text-body] - Row text color.
716
743
  * @cssprop [--ag-text-muted] - Muted text (roles, labels).
717
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`).
718
756
  * @cssprop [--ag-row-h] - Row height.
719
757
  * @cssprop [--ag-header-h] - Header height.
720
758
  * @cssprop [--ag-radius] - Outer card corner radius.
@@ -769,8 +807,14 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
769
807
  protected _rows: NodeListOf<ApexGridRow<T>>;
770
808
  /** Column configuration for the grid. */
771
809
  columns: Array<ColumnConfiguration<T>>;
772
- /** The data source for the grid. */
773
- 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>);
774
818
  /**
775
819
  * Optional stable row-identity resolver.
776
820
  *
@@ -841,8 +885,10 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
841
885
  * {@link DataPipelineConfiguration.quickFilter}.
842
886
  *
843
887
  * @attr quick-filter
888
+ * @default ''
844
889
  */
845
- quickFilter: string;
890
+ get quickFilter(): string;
891
+ set quickFilter(value: string);
846
892
  /**
847
893
  * Whether the built-in quick-filter input is rendered in the toolbar.
848
894
  *
@@ -1165,16 +1211,24 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1165
1211
  isTreeRowExpanded(row: T): boolean;
1166
1212
  /**
1167
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.
1168
1218
  */
1169
- set sortExpressions(expressions: SortExpression<T>[]);
1219
+ set sortExpressions(expressions: SortExpression<T>[] | null | undefined);
1170
1220
  /**
1171
1221
  * Get the sort state for the grid.
1172
1222
  */
1173
1223
  get sortExpressions(): SortExpression<T>[];
1174
1224
  /**
1175
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.
1176
1230
  */
1177
- set filterExpressions(expressions: FilterExpression<T>[]);
1231
+ set filterExpressions(expressions: FilterExpression<T>[] | null | undefined);
1178
1232
  /**
1179
1233
  * Get the filter state for the grid.
1180
1234
  */
@@ -1221,9 +1275,17 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1221
1275
  get pageItems(): ReadonlyArray<T>;
1222
1276
  /**
1223
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.
1224
1285
  */
1225
1286
  get page(): number;
1226
1287
  set page(value: number);
1288
+ requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration, useNewValue?: boolean, newValue?: unknown): void;
1227
1289
  /**
1228
1290
  * The current page size.
1229
1291
  */
@@ -1234,13 +1296,33 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1234
1296
  */
1235
1297
  get pageCount(): number;
1236
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>;
1237
1309
  protected dataChanged(): void;
1238
- protected pipeline(): Promise<void>;
1239
1310
  protected paginationChanged(): void;
1240
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>;
1241
1322
  protected updated(): void;
1242
1323
  addEventListener<K extends keyof M, M extends ApexGridEventMap<T> & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
1243
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;
1244
1326
  protected firstUpdated(): void;
1245
1327
  /**
1246
1328
  * Performs a filter operation in the grid based on the passed expression(s).
@@ -1357,7 +1439,7 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1357
1439
  /**
1358
1440
  * Applies a new quick-filter (global search) value, emitting the cancellable
1359
1441
  * `quickFilterChanging` event first and the `quickFilterChanged` event after the
1360
- * pipeline has run.
1442
+ * pipeline has run. Moving back to the first page fires `pageChanged` too.
1361
1443
  *
1362
1444
  * @param value - The new quick-filter value. Pass `''` to clear.
1363
1445
  * @returns `true` if the change was applied, `false` if cancelled or a no-op.
@@ -1409,7 +1491,9 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1409
1491
  */
1410
1492
  unpinColumn(key: Keys<T>): Promise<boolean>;
1411
1493
  /**
1412
- * 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.
1413
1497
  */
1414
1498
  get editingCell(): {
1415
1499
  rowIndex: number;
@@ -1417,7 +1501,8 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1417
1501
  } | null;
1418
1502
  /**
1419
1503
  * The view-relative index of the row currently in edit mode (row edit mode
1420
- * only), or `null`.
1504
+ * only), or `null`. It is -1 when the edited record is pinned or on another
1505
+ * page.
1421
1506
  */
1422
1507
  get editingRow(): number | null;
1423
1508
  /**
@@ -1458,11 +1543,19 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1458
1543
  * point: a thousand `editCell` round-trips would be a thousand entries in the
1459
1544
  * undo stack and a thousand re-renders.
1460
1545
  *
1461
- * `rowIndex` is view-relative and matches {@link ApexGrid.pageItems}, the same
1462
- * as {@link editCell}. Edits naming an unknown column, a row index out of
1463
- * range, or a column the user could not edit either (editing off, not
1464
- * `editable`, or hidden — the same gate interactive editing uses) are skipped
1465
- * rather than throwing, so a partially-stale batch still applies what it can.
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.
1466
1559
  *
1467
1560
  * @param edits Cells to write. Order is preserved, so later edits to the same
1468
1561
  * cell win.
@@ -1470,22 +1563,21 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1470
1563
  * changed; `unchanged`, `invalid` and `cancelled` explain the rest, so a caller
1471
1564
  * can tell a rejected batch from a no-op one.
1472
1565
  *
1473
- * @example Bulk-clear a column for the rows the user selected
1566
+ * @example Bulk-clear a column for the rows the user selected, on any page
1474
1567
  * ```ts
1475
- * grid.applyEdits(
1476
- * grid.selectedRows.map((row) => ({
1477
- * rowIndex: grid.pageItems.indexOf(row),
1478
- * column: 'discount',
1479
- * value: 0,
1480
- * }))
1481
- * );
1568
+ * grid.applyEdits(grid.selectedRows.map((row) => ({ row, column: 'discount', value: 0 })));
1482
1569
  * ```
1483
1570
  */
1484
1571
  applyEdits(edits: ReadonlyArray<{
1485
- rowIndex: number;
1486
1572
  column: Keys<T>;
1487
1573
  value: unknown;
1488
- }>): {
1574
+ } & ({
1575
+ rowIndex: number;
1576
+ row?: never;
1577
+ } | {
1578
+ row: T;
1579
+ rowIndex?: never;
1580
+ })>): {
1489
1581
  applied: number;
1490
1582
  unchanged: number;
1491
1583
  invalid: number;
@@ -1554,12 +1646,13 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1554
1646
  * {@link ApexGrid.pageItems}.
1555
1647
  *
1556
1648
  * @remarks
1557
- * Requires `rowReordering.enabled`. Establishes a manual order (mutually
1558
- * exclusive with column sorting), goes through the cancellable `rowMoving`
1559
- * 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.
1560
1653
  *
1561
- * @returns `true` when applied, `false` when disabled, out of range, or
1562
- * 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.
1563
1656
  */
1564
1657
  moveRow(from: number, to: number, position?: RowDropPosition): boolean;
1565
1658
  /**
@@ -1631,6 +1724,23 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
1631
1724
  * ```
1632
1725
  */
1633
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;
1634
1744
  protected bodyClickHandler(event: MouseEvent): void;
1635
1745
  protected bodyKeydownHandler(event: KeyboardEvent): void;
1636
1746
  /**