apex-grid 1.1.0 → 3.0.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 (231) hide show
  1. package/LICENSE +76 -5
  2. package/README.md +523 -10
  3. package/components/cell.d.ts +39 -0
  4. package/components/cell.js +334 -5
  5. package/components/cell.js.map +1 -1
  6. package/components/filter-row.d.ts +7 -5
  7. package/components/filter-row.js +151 -68
  8. package/components/filter-row.js.map +1 -1
  9. package/components/grid.d.ts +955 -4
  10. package/components/grid.js +412 -40
  11. package/components/grid.js.map +1 -1
  12. package/components/header-row.d.ts +21 -1
  13. package/components/header-row.js +140 -7
  14. package/components/header-row.js.map +1 -1
  15. package/components/header.d.ts +7 -0
  16. package/components/header.js +151 -31
  17. package/components/header.js.map +1 -1
  18. package/components/paginator.d.ts +56 -0
  19. package/components/paginator.js +148 -0
  20. package/components/paginator.js.map +1 -0
  21. package/components/row.d.ts +21 -2
  22. package/components/row.js +185 -10
  23. package/components/row.js.map +1 -1
  24. package/components/toolbar.d.ts +60 -0
  25. package/components/toolbar.js +259 -0
  26. package/components/toolbar.js.map +1 -0
  27. package/components/virtualizer.js +1 -1
  28. package/components/virtualizer.js.map +1 -1
  29. package/controllers/data-operation.d.ts +14 -0
  30. package/controllers/data-operation.js +19 -2
  31. package/controllers/data-operation.js.map +1 -1
  32. package/controllers/dom.d.ts +37 -1
  33. package/controllers/dom.js +176 -9
  34. package/controllers/dom.js.map +1 -1
  35. package/controllers/editing.d.ts +130 -0
  36. package/controllers/editing.js +197 -0
  37. package/controllers/editing.js.map +1 -0
  38. package/controllers/expansion.d.ts +68 -0
  39. package/controllers/expansion.js +126 -0
  40. package/controllers/expansion.js.map +1 -0
  41. package/controllers/navigation.d.ts +17 -6
  42. package/controllers/navigation.js +24 -8
  43. package/controllers/navigation.js.map +1 -1
  44. package/controllers/pagination.d.ts +102 -0
  45. package/controllers/pagination.js +106 -0
  46. package/controllers/pagination.js.map +1 -0
  47. package/controllers/reorder.d.ts +78 -0
  48. package/controllers/reorder.js +124 -0
  49. package/controllers/reorder.js.map +1 -0
  50. package/controllers/selection.d.ts +109 -0
  51. package/controllers/selection.js +168 -0
  52. package/controllers/selection.js.map +1 -0
  53. package/controllers/sort.js +28 -0
  54. package/controllers/sort.js.map +1 -1
  55. package/controllers/state.d.ts +47 -1
  56. package/controllers/state.js +48 -1
  57. package/controllers/state.js.map +1 -1
  58. package/controllers/tree.d.ts +87 -0
  59. package/controllers/tree.js +0 -0
  60. package/controllers/tree.js.map +1 -0
  61. package/custom-elements.json +6491 -1355
  62. package/define.js.map +1 -1
  63. package/docs/assets/hierarchy.js +1 -1
  64. package/docs/assets/highlight.css +77 -14
  65. package/docs/assets/icons.js +1 -1
  66. package/docs/assets/icons.svg +1 -1
  67. package/docs/assets/main.js +4 -4
  68. package/docs/assets/navigation.js +1 -1
  69. package/docs/assets/search.js +1 -1
  70. package/docs/assets/style.css +3 -3
  71. package/docs/classes/ApexGrid.html +320 -24
  72. package/docs/functions/setup.html +16 -0
  73. package/docs/hierarchy.html +1 -1
  74. package/docs/index.html +543 -9
  75. package/docs/interfaces/ApexCellValueChangedEvent.html +11 -0
  76. package/docs/interfaces/ApexCellValueChangingEvent.html +13 -0
  77. package/docs/interfaces/ApexColumnMovedEvent.html +8 -0
  78. package/docs/interfaces/ApexColumnMovingEvent.html +11 -0
  79. package/docs/interfaces/ApexColumnPinnedEvent.html +6 -0
  80. package/docs/interfaces/ApexColumnPinningEvent.html +8 -0
  81. package/docs/interfaces/ApexDetailContext.html +8 -0
  82. package/docs/interfaces/ApexFilteredEvent.html +4 -4
  83. package/docs/interfaces/ApexFilteringEvent.html +4 -4
  84. package/docs/interfaces/ApexGridEventMap.html +60 -9
  85. package/docs/interfaces/ApexHeaderContext.html +4 -4
  86. package/docs/interfaces/ApexPageChangedEvent.html +10 -0
  87. package/docs/interfaces/ApexPageChangingEvent.html +10 -0
  88. package/docs/interfaces/ApexQuickFilterChangedEvent.html +4 -0
  89. package/docs/interfaces/ApexQuickFilterChangingEvent.html +6 -0
  90. package/docs/interfaces/ApexRowEditEndedEvent.html +6 -0
  91. package/docs/interfaces/ApexRowEditStartedEvent.html +4 -0
  92. package/docs/interfaces/ApexRowExpandedEvent.html +8 -0
  93. package/docs/interfaces/ApexRowExpandingEvent.html +11 -0
  94. package/docs/interfaces/ApexRowSelectedEvent.html +8 -0
  95. package/docs/interfaces/ApexRowSelectingEvent.html +11 -0
  96. package/docs/interfaces/ApexTreeRowExpandedEvent.html +8 -0
  97. package/docs/interfaces/ApexTreeRowExpandingEvent.html +10 -0
  98. package/docs/interfaces/BaseApexCellContext.html +12 -6
  99. package/docs/interfaces/BaseApexEditorContext.html +19 -0
  100. package/docs/interfaces/BaseColumnConfiguration.html +88 -14
  101. package/docs/interfaces/BaseColumnSortConfiguration.html +4 -4
  102. package/docs/interfaces/BaseFilterExpression.html +5 -5
  103. package/docs/interfaces/BaseSortExpression.html +4 -4
  104. package/docs/interfaces/CSVExportOptions.html +22 -0
  105. package/docs/interfaces/ColumnFilterConfiguration.html +3 -3
  106. package/docs/interfaces/DataPipelineConfiguration.html +13 -4
  107. package/docs/interfaces/ExportFormat.html +10 -0
  108. package/docs/interfaces/ExportOptions.html +15 -0
  109. package/docs/interfaces/GridEditingConfiguration.html +10 -0
  110. package/docs/interfaces/GridExpansionConfiguration.html +15 -0
  111. package/docs/interfaces/GridSelectionConfiguration.html +11 -0
  112. package/docs/interfaces/GridSortConfiguration.html +4 -4
  113. package/docs/interfaces/GridTreeConfiguration.html +33 -0
  114. package/docs/interfaces/PaginationConfiguration.html +18 -0
  115. package/docs/interfaces/PaginationState.html +10 -0
  116. package/docs/media/LICENSE +80 -0
  117. package/docs/media/_tokens.scss +106 -0
  118. package/docs/media/package.json +85 -0
  119. package/docs/modules.html +1 -1
  120. package/docs/types/ApexCellContext.html +2 -2
  121. package/docs/types/ApexEditorContext.html +2 -0
  122. package/docs/types/BasePropertyType.html +2 -2
  123. package/docs/types/BaseSortComparer.html +2 -2
  124. package/docs/types/ColumnConfiguration.html +2 -2
  125. package/docs/types/ColumnDropPosition.html +2 -0
  126. package/docs/types/ColumnSortConfiguration.html +2 -2
  127. package/docs/types/DataPipelineHook.html +2 -2
  128. package/docs/types/DataPipelineParams.html +5 -5
  129. package/docs/types/DataType.html +47 -2
  130. package/docs/types/EditMode.html +6 -0
  131. package/docs/types/EditTrigger.html +4 -0
  132. package/docs/types/ExportCellValue.html +5 -0
  133. package/docs/types/ExportSource.html +8 -0
  134. package/docs/types/FilterCriteria.html +2 -2
  135. package/docs/types/FilterExpression.html +2 -2
  136. package/docs/types/Keys.html +2 -2
  137. package/docs/types/PaginationMode.html +6 -0
  138. package/docs/types/PinPosition.html +5 -0
  139. package/docs/types/PropertyType.html +2 -2
  140. package/docs/types/SelectionMode.html +7 -0
  141. package/docs/types/SortComparer.html +2 -2
  142. package/docs/types/SortExpression.html +2 -2
  143. package/docs/types/SortState.html +2 -2
  144. package/docs/types/SortingDirection.html +1 -1
  145. package/index.d.ts +5 -2
  146. package/index.js +1 -0
  147. package/index.js.map +1 -1
  148. package/internal/column-types.d.ts +94 -0
  149. package/internal/column-types.js +428 -0
  150. package/internal/column-types.js.map +1 -0
  151. package/internal/export.d.ts +114 -0
  152. package/internal/export.js +122 -0
  153. package/internal/export.js.map +1 -0
  154. package/internal/feature-module.d.ts +27 -0
  155. package/internal/feature-module.js +2 -0
  156. package/internal/feature-module.js.map +1 -0
  157. package/internal/flip.d.ts +80 -0
  158. package/internal/flip.js +52 -0
  159. package/internal/flip.js.map +1 -0
  160. package/internal/icons.d.ts +31 -0
  161. package/internal/icons.js +145 -0
  162. package/internal/icons.js.map +1 -0
  163. package/internal/index.d.ts +20 -0
  164. package/internal/index.js +6 -0
  165. package/internal/index.js.map +1 -0
  166. package/internal/tags.d.ts +2 -0
  167. package/internal/tags.js +2 -0
  168. package/internal/tags.js.map +1 -1
  169. package/internal/types.d.ts +473 -3
  170. package/internal/types.js.map +1 -1
  171. package/internal/utils.d.ts +24 -1
  172. package/internal/utils.js +48 -7
  173. package/internal/utils.js.map +1 -1
  174. package/operations/filter/tree.d.ts +1 -1
  175. package/operations/filter/types.js.map +1 -1
  176. package/operations/pagination.d.ts +19 -0
  177. package/operations/pagination.js +12 -0
  178. package/operations/pagination.js.map +1 -0
  179. package/operations/quick-filter.d.ts +21 -0
  180. package/operations/quick-filter.js +26 -0
  181. package/operations/quick-filter.js.map +1 -0
  182. package/operations/sort/types.js.map +1 -1
  183. package/package.json +10 -5
  184. package/setup.d.ts +51 -0
  185. package/setup.js +31 -0
  186. package/setup.js.map +1 -0
  187. package/styles/_checkbox.css.js +3 -0
  188. package/styles/_checkbox.css.js.map +1 -0
  189. package/styles/_tokens.css.js +3 -0
  190. package/styles/_tokens.css.js.map +1 -0
  191. package/styles/body-cell/body-cell.css.js +1 -1
  192. package/styles/body-cell/body-cell.css.js.map +1 -1
  193. package/styles/body-cell/cell-renderers.css.js +3 -0
  194. package/styles/body-cell/cell-renderers.css.js.map +1 -0
  195. package/styles/body-row/body-row.css.js +1 -1
  196. package/styles/body-row/body-row.css.js.map +1 -1
  197. package/styles/filter-row/filter-row.css.js +1 -1
  198. package/styles/filter-row/filter-row.css.js.map +1 -1
  199. package/styles/grid/_grid.base.css.js +1 -1
  200. package/styles/grid/_grid.base.css.js.map +1 -1
  201. package/styles/grid/grid.css.js +3 -0
  202. package/styles/grid/grid.css.js.map +1 -0
  203. package/styles/header-cell/header-cell.css.js +1 -1
  204. package/styles/header-cell/header-cell.css.js.map +1 -1
  205. package/styles/header-row/header-row.base.css.js +1 -1
  206. package/styles/header-row/header-row.base.css.js.map +1 -1
  207. package/styles/paginator/paginator.css.d.ts +1 -0
  208. package/styles/paginator/paginator.css.js +3 -0
  209. package/styles/paginator/paginator.css.js.map +1 -0
  210. package/styles/toolbar/toolbar.css.d.ts +1 -0
  211. package/styles/toolbar/toolbar.css.js +3 -0
  212. package/styles/toolbar/toolbar.css.js.map +1 -0
  213. package/styles.css +17 -0
  214. package/internal/icon-registry.d.ts +0 -1
  215. package/internal/icon-registry.js +0 -29
  216. package/internal/icon-registry.js.map +0 -1
  217. package/internal/theming.d.ts +0 -34
  218. package/internal/theming.js +0 -123
  219. package/internal/theming.js.map +0 -1
  220. package/styles/grid/themes/light/grid.bootstrap.css.js +0 -3
  221. package/styles/grid/themes/light/grid.bootstrap.css.js.map +0 -1
  222. package/styles/grid/themes/light/grid.fluent.css.js +0 -3
  223. package/styles/grid/themes/light/grid.fluent.css.js.map +0 -1
  224. package/styles/grid/themes/light/grid.indigo.css.js +0 -3
  225. package/styles/grid/themes/light/grid.indigo.css.js.map +0 -1
  226. package/styles/grid/themes/light/grid.material.css.js +0 -3
  227. package/styles/grid/themes/light/grid.material.css.js.map +0 -1
  228. /package/styles/{grid/themes/light/grid.bootstrap.css.d.ts → _checkbox.css.d.ts} +0 -0
  229. /package/styles/{grid/themes/light/grid.fluent.css.d.ts → _tokens.css.d.ts} +0 -0
  230. /package/styles/{grid/themes/light/grid.indigo.css.d.ts → body-cell/cell-renderers.css.d.ts} +0 -0
  231. /package/styles/grid/{themes/light/grid.material.css.d.ts → grid.css.d.ts} +0 -0
@@ -3,13 +3,16 @@ import { nothing } from 'lit';
3
3
  import { DataOperationsController } from '../controllers/data-operation.js';
4
4
  import { GridDOMController } from '../controllers/dom.js';
5
5
  import { StateController } from '../controllers/state.js';
6
+ import { type CSVExportOptions, type ExportFormat, type ExportOptions } from '../internal/export.js';
6
7
  import { EventEmitterBase } from '../internal/mixins/event-emitter.js';
7
- import type { ColumnConfiguration, DataPipelineConfiguration, GridSortConfiguration, Keys } from '../internal/types.js';
8
+ import type { ColumnConfiguration, DataPipelineConfiguration, GridEditingConfiguration, GridExpansionConfiguration, GridSelectionConfiguration, GridSortConfiguration, GridTreeConfiguration, Keys, PaginationConfiguration, PaginationState, PinPosition } from '../internal/types.js';
8
9
  import type { FilterExpression } from '../operations/filter/types.js';
9
10
  import type { SortExpression } from '../operations/sort/types.js';
10
11
  import ApexFilterRow from './filter-row.js';
11
12
  import ApexGridHeaderRow from './header-row.js';
13
+ import ApexGridPaginator from './paginator.js';
12
14
  import ApexGridRow from './row.js';
15
+ import ApexGridToolbar from './toolbar.js';
13
16
  import ApexVirtualizer from './virtualizer.js';
14
17
  /**
15
18
  * Event object for the filtering event of the grid.
@@ -47,6 +50,287 @@ export interface ApexFilteredEvent<T extends object> {
47
50
  */
48
51
  state: FilterExpression<T>[];
49
52
  }
53
+ /**
54
+ * Event payload for the cancellable `pageChanging` event.
55
+ */
56
+ export interface ApexPageChangingEvent {
57
+ /**
58
+ * The current page (zero-based) before the change.
59
+ */
60
+ page: number;
61
+ /**
62
+ * The current page size before the change.
63
+ */
64
+ pageSize: number;
65
+ /**
66
+ * The proposed page (zero-based) the grid will navigate to.
67
+ */
68
+ nextPage: number;
69
+ /**
70
+ * The proposed page size after the change.
71
+ */
72
+ nextPageSize: number;
73
+ }
74
+ /**
75
+ * Event payload for the `pageChanged` event. Mirrors {@link PaginationState}.
76
+ */
77
+ export interface ApexPageChangedEvent extends PaginationState {
78
+ }
79
+ /**
80
+ * Event payload for the cancellable `quickFilterChanging` event.
81
+ */
82
+ export interface ApexQuickFilterChangingEvent {
83
+ /**
84
+ * The current quick-filter value before the change.
85
+ */
86
+ value: string;
87
+ /**
88
+ * The proposed quick-filter value.
89
+ */
90
+ nextValue: string;
91
+ }
92
+ /**
93
+ * Event payload for the `quickFilterChanged` event.
94
+ */
95
+ export interface ApexQuickFilterChangedEvent {
96
+ /**
97
+ * The resolved quick-filter value after the change.
98
+ */
99
+ value: string;
100
+ }
101
+ /**
102
+ * Drop position relative to a target column when reordering.
103
+ */
104
+ export type ColumnDropPosition = 'before' | 'after';
105
+ /**
106
+ * Event payload for the cancellable `cellValueChanging` event.
107
+ */
108
+ export interface ApexCellValueChangingEvent<T extends object> {
109
+ /**
110
+ * The column key of the edited cell.
111
+ */
112
+ key: Keys<T>;
113
+ /**
114
+ * The view-relative row index (matches {@link ApexGrid.pageItems}).
115
+ */
116
+ rowIndex: number;
117
+ /**
118
+ * The data record being edited (a live reference to the row in
119
+ * {@link ApexGrid.data}).
120
+ */
121
+ data: T;
122
+ /**
123
+ * The value before the edit.
124
+ */
125
+ oldValue: unknown;
126
+ /**
127
+ * The candidate new value.
128
+ */
129
+ newValue: unknown;
130
+ }
131
+ /**
132
+ * Event payload for the `cellValueChanged` event.
133
+ */
134
+ export interface ApexCellValueChangedEvent<T extends object> {
135
+ /**
136
+ * The column key of the edited cell.
137
+ */
138
+ key: Keys<T>;
139
+ /**
140
+ * The view-relative row index after the change.
141
+ */
142
+ rowIndex: number;
143
+ /**
144
+ * The data record after the change (a live reference to the row in
145
+ * {@link ApexGrid.data}).
146
+ */
147
+ data: T;
148
+ /**
149
+ * The applied value.
150
+ */
151
+ value: unknown;
152
+ }
153
+ /**
154
+ * Event payload for the `rowEditStarted` event.
155
+ */
156
+ export interface ApexRowEditStartedEvent {
157
+ /**
158
+ * The view-relative row index entering edit mode.
159
+ */
160
+ rowIndex: number;
161
+ }
162
+ /**
163
+ * Event payload for the `rowEditEnded` event.
164
+ */
165
+ export interface ApexRowEditEndedEvent {
166
+ /**
167
+ * The view-relative row index that left edit mode.
168
+ */
169
+ rowIndex: number;
170
+ /**
171
+ * `true` when pending edits were applied, `false` when discarded.
172
+ */
173
+ committed: boolean;
174
+ }
175
+ /**
176
+ * Event payload for the cancellable `columnMoving` event.
177
+ */
178
+ export interface ApexColumnMovingEvent<T extends object> {
179
+ /**
180
+ * The column being moved.
181
+ */
182
+ key: Keys<T>;
183
+ /**
184
+ * The current index of the moving column in {@link ApexGrid.columns}.
185
+ */
186
+ fromIndex: number;
187
+ /**
188
+ * The target column key. The dragged column will be placed `position`
189
+ * (before/after) this column.
190
+ */
191
+ toKey: Keys<T>;
192
+ /**
193
+ * Whether the dragged column is being placed before or after `toKey`.
194
+ */
195
+ position: ColumnDropPosition;
196
+ }
197
+ /**
198
+ * Event payload for the `columnMoved` event.
199
+ */
200
+ export interface ApexColumnMovedEvent<T extends object> {
201
+ /**
202
+ * The column that was moved.
203
+ */
204
+ key: Keys<T>;
205
+ /**
206
+ * The original index in {@link ApexGrid.columns}.
207
+ */
208
+ fromIndex: number;
209
+ /**
210
+ * The resolved index in {@link ApexGrid.columns} after the move.
211
+ */
212
+ toIndex: number;
213
+ }
214
+ /**
215
+ * Event payload for the cancellable `rowSelecting` event.
216
+ */
217
+ export interface ApexRowSelectingEvent<T extends object> {
218
+ /**
219
+ * The rows that will become selected by this change.
220
+ */
221
+ added: T[];
222
+ /**
223
+ * The rows that will become deselected by this change.
224
+ */
225
+ removed: T[];
226
+ /**
227
+ * The full current selection before this change is applied.
228
+ */
229
+ current: T[];
230
+ /**
231
+ * The full selection after this change would be applied. Listeners can
232
+ * inspect this to decide whether to cancel.
233
+ */
234
+ next: T[];
235
+ }
236
+ /**
237
+ * Event payload for the `rowSelected` event.
238
+ */
239
+ export interface ApexRowSelectedEvent<T extends object> {
240
+ /**
241
+ * The rows that became selected in this change.
242
+ */
243
+ added: T[];
244
+ /**
245
+ * The rows that became deselected in this change.
246
+ */
247
+ removed: T[];
248
+ /**
249
+ * The full current selection after the change has been applied.
250
+ */
251
+ selected: T[];
252
+ }
253
+ /**
254
+ * Event payload for the cancellable `treeRowExpanding` event.
255
+ */
256
+ export interface ApexTreeRowExpandingEvent<T extends object> {
257
+ /** Rows that will become expanded by this change. */
258
+ added: T[];
259
+ /** Rows that will become collapsed by this change. */
260
+ removed: T[];
261
+ /** The full current tree-expansion set before this change is applied. */
262
+ current: T[];
263
+ /** The full set after this change would be applied. */
264
+ next: T[];
265
+ }
266
+ /**
267
+ * Event payload for the `treeRowExpanded` event.
268
+ */
269
+ export interface ApexTreeRowExpandedEvent<T extends object> {
270
+ /** Rows that became expanded in this change. */
271
+ added: T[];
272
+ /** Rows that became collapsed in this change. */
273
+ removed: T[];
274
+ /** The full tree-expansion set after the change has been applied. */
275
+ expanded: T[];
276
+ }
277
+ /**
278
+ * Event payload for the cancellable `rowExpanding` event.
279
+ */
280
+ export interface ApexRowExpandingEvent<T extends object> {
281
+ /** The rows that will become expanded by this change. */
282
+ added: T[];
283
+ /** The rows that will become collapsed by this change. */
284
+ removed: T[];
285
+ /** The full current expansion set before this change is applied. */
286
+ current: T[];
287
+ /**
288
+ * The full expansion set after this change would be applied. Listeners can
289
+ * inspect this to decide whether to cancel.
290
+ */
291
+ next: T[];
292
+ }
293
+ /**
294
+ * Event payload for the `rowExpanded` event.
295
+ */
296
+ export interface ApexRowExpandedEvent<T extends object> {
297
+ /** The rows that became expanded in this change. */
298
+ added: T[];
299
+ /** The rows that became collapsed in this change. */
300
+ removed: T[];
301
+ /** The full expansion set after the change has been applied. */
302
+ expanded: T[];
303
+ }
304
+ /**
305
+ * Event payload for the cancellable `columnPinning` event.
306
+ */
307
+ export interface ApexColumnPinningEvent<T extends object> {
308
+ /**
309
+ * The target column key.
310
+ */
311
+ key: Keys<T>;
312
+ /**
313
+ * The current pin position before the change (`null` if unpinned).
314
+ */
315
+ previous: PinPosition;
316
+ /**
317
+ * The proposed pin position (`null` to unpin).
318
+ */
319
+ next: PinPosition;
320
+ }
321
+ /**
322
+ * Event payload for the `columnPinned` event.
323
+ */
324
+ export interface ApexColumnPinnedEvent<T extends object> {
325
+ /**
326
+ * The target column key.
327
+ */
328
+ key: Keys<T>;
329
+ /**
330
+ * The resolved pin position after the change.
331
+ */
332
+ pinned: PinPosition;
333
+ }
50
334
  /**
51
335
  * Events for the apex-grid.
52
336
  */
@@ -86,6 +370,150 @@ export interface ApexGridEventMap<T extends object> {
86
370
  * @event
87
371
  */
88
372
  filtered: CustomEvent<ApexFilteredEvent<T>>;
373
+ /**
374
+ * Emitted before the grid navigates to a new page or applies a new page size.
375
+ *
376
+ * @remarks
377
+ * Cancellable — calling `preventDefault()` (or returning a falsy result from
378
+ * `addEventListener` synchronously) aborts the page change.
379
+ *
380
+ * @event
381
+ */
382
+ pageChanging: CustomEvent<ApexPageChangingEvent>;
383
+ /**
384
+ * Emitted after a page or page-size change has been applied and the pipeline has run.
385
+ *
386
+ * @event
387
+ */
388
+ pageChanged: CustomEvent<ApexPageChangedEvent>;
389
+ /**
390
+ * Emitted before the quick-filter value is applied.
391
+ *
392
+ * @remarks
393
+ * Cancellable — calling `preventDefault()` aborts the change. The value can
394
+ * be replaced inside the listener by reassigning {@link ApexGrid.quickFilter}.
395
+ *
396
+ * @event
397
+ */
398
+ quickFilterChanging: CustomEvent<ApexQuickFilterChangingEvent>;
399
+ /**
400
+ * Emitted after a quick-filter change has been applied and the pipeline has run.
401
+ *
402
+ * @event
403
+ */
404
+ quickFilterChanged: CustomEvent<ApexQuickFilterChangedEvent>;
405
+ /**
406
+ * Emitted before a column's pin position changes.
407
+ *
408
+ * @remarks
409
+ * Cancellable — calling `preventDefault()` aborts the change.
410
+ *
411
+ * @event
412
+ */
413
+ columnPinning: CustomEvent<ApexColumnPinningEvent<T>>;
414
+ /**
415
+ * Emitted after a column's pin position change has been applied.
416
+ *
417
+ * @event
418
+ */
419
+ columnPinned: CustomEvent<ApexColumnPinnedEvent<T>>;
420
+ /**
421
+ * Emitted before a column is moved through the UI or {@link ApexGrid.moveColumn}.
422
+ *
423
+ * @remarks
424
+ * Cancellable — calling `preventDefault()` aborts the move. The event detail
425
+ * carries the source column key, its current array index, the target column
426
+ * key and the drop position.
427
+ *
428
+ * @event
429
+ */
430
+ columnMoving: CustomEvent<ApexColumnMovingEvent<T>>;
431
+ /**
432
+ * Emitted after a column has been moved.
433
+ *
434
+ * @event
435
+ */
436
+ columnMoved: CustomEvent<ApexColumnMovedEvent<T>>;
437
+ /**
438
+ * Emitted before a cell value is committed.
439
+ *
440
+ * @remarks
441
+ * Cancellable — `preventDefault()` rolls back the candidate value. In row
442
+ * edit mode the event still fires per-cell at commit time.
443
+ *
444
+ * @event
445
+ */
446
+ cellValueChanging: CustomEvent<ApexCellValueChangingEvent<T>>;
447
+ /**
448
+ * Emitted after a cell value has been committed.
449
+ *
450
+ * @event
451
+ */
452
+ cellValueChanged: CustomEvent<ApexCellValueChangedEvent<T>>;
453
+ /**
454
+ * Emitted when a row enters edit mode (row edit mode only).
455
+ *
456
+ * @event
457
+ */
458
+ rowEditStarted: CustomEvent<ApexRowEditStartedEvent>;
459
+ /**
460
+ * Emitted when a row leaves edit mode, with `committed` reporting whether
461
+ * pending edits were applied (row edit mode only).
462
+ *
463
+ * @event
464
+ */
465
+ rowEditEnded: CustomEvent<ApexRowEditEndedEvent>;
466
+ /**
467
+ * Emitted before the row selection set changes.
468
+ *
469
+ * @remarks
470
+ * Cancellable — calling `preventDefault()` aborts the selection change.
471
+ * Fires for every selection-mutating call (toggle, range select, select-all,
472
+ * programmatic `selectedRows = ...`).
473
+ *
474
+ * @event
475
+ */
476
+ /**
477
+ * Emitted before the tree-row expansion set changes.
478
+ *
479
+ * @remarks
480
+ * Fires only when {@link ApexGrid.tree} is enabled and a row's tree
481
+ * expansion is toggled (via the chevron, the public API, or
482
+ * `expand-all/collapse-all`). Cancellable.
483
+ *
484
+ * @event
485
+ */
486
+ treeRowExpanding: CustomEvent<ApexTreeRowExpandingEvent<T>>;
487
+ /**
488
+ * Emitted after a tree-row expansion change has been applied.
489
+ *
490
+ * @event
491
+ */
492
+ treeRowExpanded: CustomEvent<ApexTreeRowExpandedEvent<T>>;
493
+ /**
494
+ * Emitted before the row expansion set changes.
495
+ *
496
+ * @remarks
497
+ * Cancellable — calling `preventDefault()` aborts the change. Fires for
498
+ * every expansion-mutating call (toggle, expand-all, programmatic
499
+ * `expandedRows = ...`).
500
+ *
501
+ * @event
502
+ */
503
+ rowExpanding: CustomEvent<ApexRowExpandingEvent<T>>;
504
+ /**
505
+ * Emitted after a row-expansion change has been applied.
506
+ *
507
+ * @event
508
+ */
509
+ rowExpanded: CustomEvent<ApexRowExpandedEvent<T>>;
510
+ rowSelecting: CustomEvent<ApexRowSelectingEvent<T>>;
511
+ /**
512
+ * Emitted after a row-selection change has been applied.
513
+ *
514
+ * @event
515
+ */
516
+ rowSelected: CustomEvent<ApexRowSelectedEvent<T>>;
89
517
  }
90
518
  /**
91
519
  * Apex grid is a web component for displaying data in a tabular format quick and easy.
@@ -93,27 +521,75 @@ export interface ApexGridEventMap<T extends object> {
93
521
  * Out of the box it provides row virtualization, sort and filter operations (client and server side),
94
522
  * the ability to template cells and headers and column hiding.
95
523
  *
524
+ * @remarks
525
+ * A working, styled grid requires four setup steps:
526
+ * 1. Register the element: `import 'apex-grid/define'` (or `ApexGrid.register()`).
527
+ * 2. Configure an Ignite UI theme + import the matching CSS, e.g.
528
+ * `import { configureTheme } from 'igniteui-webcomponents';`
529
+ * `import 'igniteui-webcomponents/themes/light/bootstrap.css';`
530
+ * `configureTheme('bootstrap');`
531
+ * 3. Give the host element a bounded height, e.g. `apex-grid { height: 480px }` —
532
+ * the virtualizer collapses without one.
533
+ * 4. Do NOT set `display` on the host — the component declares `:host { display: grid }`
534
+ * internally and any override breaks the track layout.
535
+ *
536
+ * See the README "Getting Started" section for the full example.
537
+ *
96
538
  * @element apex-grid
97
539
  *
98
540
  * @fires sorting - Emitted when sorting is initiated through the UI.
99
541
  * @fires sorted - Emitted when a sort operation initiated through the UI has completed.
100
542
  * @fires filtering - Emitted when filtering is initiated through the UI.
101
543
  * @fires filtered - Emitted when a filter operation initiated through the UI has completed.
544
+ * @fires pageChanging - Cancellable. Emitted before page/page-size changes are applied.
545
+ * @fires pageChanged - Emitted after a page/page-size change has been applied.
546
+ * @fires quickFilterChanging - Cancellable. Emitted before a quick-filter value is applied.
547
+ * @fires quickFilterChanged - Emitted after a quick-filter change has been applied.
548
+ * @fires columnPinning - Cancellable. Emitted before a column's pin position changes.
549
+ * @fires columnPinned - Emitted after a column's pin position has changed.
550
+ * @fires columnMoving - Cancellable. Emitted before a column is moved.
551
+ * @fires columnMoved - Emitted after a column has been moved.
552
+ * @fires cellValueChanging - Cancellable. Emitted before a cell value is committed.
553
+ * @fires cellValueChanged - Emitted after a cell value has been committed.
554
+ * @fires rowEditStarted - Emitted when a row enters edit mode (row mode only).
555
+ * @fires rowEditEnded - Emitted when a row leaves edit mode (row mode only).
556
+ * @fires rowSelecting - Cancellable. Emitted before a selection-set change is applied.
557
+ * @fires rowSelected - Emitted after a selection-set change has been applied.
102
558
  *
103
559
  */
104
560
  export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMap<T>> {
105
- static get tagName(): "apex-grid";
561
+ static get tagName(): string;
106
562
  static styles: import("lit").CSSResult;
563
+ /**
564
+ * Registers `<apex-grid>` and its internal dependencies with the custom-element
565
+ * registry. Idempotent — safe to call more than once.
566
+ *
567
+ * @remarks
568
+ * Registering the element is only step one of four required for a visible, styled
569
+ * grid. You must also configure an Ignite UI theme + CSS, give the host a bounded
570
+ * height, and avoid overriding `display` on the host. See the README
571
+ * "Getting Started" section for the full setup.
572
+ */
107
573
  static register(): void;
108
574
  protected stateController: StateController<T>;
109
575
  protected DOM: GridDOMController<T>;
110
576
  protected dataController: DataOperationsController<T>;
577
+ /**
578
+ * Builds the grid's {@link StateController}. This is the single construction
579
+ * site for `stateController` — overriding it (rather than re-declaring the
580
+ * field) is the supported seam for derived grids to inject optional
581
+ * {@link GridFeatureModule}s while preserving field-initializer ordering.
582
+ * The community grid registers no extra modules.
583
+ */
584
+ protected createStateController(): StateController<T>;
111
585
  protected stateProvider: ContextProvider<{
112
586
  __context__: StateController<any>;
113
587
  }, this>;
114
588
  protected scrollContainer: ApexVirtualizer;
115
589
  protected headerRow: ApexGridHeaderRow<T>;
116
590
  protected filterRow: ApexFilterRow<T>;
591
+ protected paginator: ApexGridPaginator<T>;
592
+ protected toolbar: ApexGridToolbar<T>;
117
593
  protected dataState: Array<T>;
118
594
  protected _rows: NodeListOf<ApexGridRow<T>>;
119
595
  /** Column configuration for the grid. */
@@ -151,6 +627,233 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
151
627
  * Configuration object which controls remote data operations for the grid.
152
628
  */
153
629
  dataPipelineConfiguration: DataPipelineConfiguration<T>;
630
+ /**
631
+ * Pagination configuration for the grid.
632
+ *
633
+ * @remarks
634
+ * Pagination is disabled by default. Set `enabled: true` and (optionally) `pageSize`
635
+ * to render the built-in `<apex-grid-paginator>` and slice the dataView. For
636
+ * server-side pagination set `mode: 'remote'` and supply `totalItems`. The grid
637
+ * emits the cancellable `pageChanging` event before applying a change and the
638
+ * `pageChanged` event after the pipeline has run.
639
+ *
640
+ * @example
641
+ * ```ts
642
+ * grid.pagination = { enabled: true, pageSize: 25 };
643
+ * grid.addEventListener('pageChanged', (event) => {
644
+ * console.log('Now on page', event.detail.page, 'of', event.detail.pageCount);
645
+ * });
646
+ * ```
647
+ */
648
+ pagination?: PaginationConfiguration;
649
+ /**
650
+ * The quick-filter (global search) value applied to the dataView.
651
+ *
652
+ * @remarks
653
+ * When non-empty, the grid filters records whose visible-column values contain
654
+ * the term (case-insensitive substring match). Customise by providing
655
+ * {@link DataPipelineConfiguration.quickFilter}.
656
+ *
657
+ * @attr quick-filter
658
+ */
659
+ quickFilter: string;
660
+ /**
661
+ * Whether the built-in quick-filter input is rendered in the toolbar.
662
+ *
663
+ * @remarks
664
+ * The {@link ApexGrid.quickFilter} value can be controlled programmatically
665
+ * regardless of this flag; this only controls the toolbar input UI.
666
+ *
667
+ * @attr show-quick-filter
668
+ */
669
+ showQuickFilter: boolean;
670
+ /**
671
+ * Whether the built-in export menu is rendered in the toolbar.
672
+ *
673
+ * @remarks
674
+ * When `true`, the toolbar shows a download button on the trailing side;
675
+ * clicking it opens a menu with one entry per {@link ApexGrid.exportFormats}
676
+ * (CSV in the community grid) that calls {@link ApexGrid.exportAs}.
677
+ * {@link ApexGrid.exportToCSV} remains callable programmatically regardless
678
+ * of this flag.
679
+ *
680
+ * @attr show-export
681
+ */
682
+ showExport: boolean;
683
+ /**
684
+ * Enables drag-and-drop column reordering on the column headers.
685
+ *
686
+ * @remarks
687
+ * Per-column opt-out is available through {@link BaseColumnConfiguration.reorderable}.
688
+ * Reordering is constrained to a column's own pinning group — start-pinned
689
+ * columns can only swap with start-pinned, unpinned with unpinned, and
690
+ * end-pinned with end-pinned.
691
+ *
692
+ * @attr column-reordering
693
+ */
694
+ columnReordering: boolean;
695
+ /**
696
+ * Inline editing configuration for the grid.
697
+ *
698
+ * @remarks
699
+ * Editing is disabled by default. Set `enabled: true` and (optionally) `mode`
700
+ * (`'cell' | 'row'`) and `trigger` (`'click' | 'doubleClick'`) to opt in.
701
+ * Per-column opt-in is required via {@link BaseColumnConfiguration.editable}.
702
+ *
703
+ * @example
704
+ * ```ts
705
+ * grid.editing = { enabled: true, mode: 'cell', trigger: 'doubleClick' };
706
+ * ```
707
+ */
708
+ editing?: GridEditingConfiguration;
709
+ /**
710
+ * Row selection configuration for the grid.
711
+ *
712
+ * @remarks
713
+ * Selection is disabled by default. Set `enabled: true` and (optionally)
714
+ * `mode` (`'single' | 'multiple'`) and `showCheckboxColumn` to opt in.
715
+ *
716
+ * @example
717
+ * ```ts
718
+ * grid.selection = { enabled: true, mode: 'multiple', showCheckboxColumn: true };
719
+ * ```
720
+ */
721
+ selection?: GridSelectionConfiguration;
722
+ /**
723
+ * The currently selected rows, in insertion order.
724
+ *
725
+ * @remarks
726
+ * Returned as a plain array snapshot — mutating the returned array does
727
+ * not change the grid's selection. Set this property to replace the
728
+ * selection programmatically (goes through the cancellable
729
+ * `rowSelecting` event).
730
+ */
731
+ get selectedRows(): T[];
732
+ set selectedRows(rows: ReadonlyArray<T>);
733
+ /**
734
+ * Selects `row`, replacing the existing selection in `'single'` mode or
735
+ * adding to it in `'multiple'` mode.
736
+ *
737
+ * @returns `true` if the selection changed, `false` if the change was
738
+ * rejected by a `rowSelecting` listener or selection is disabled.
739
+ */
740
+ selectRow(row: T): Promise<boolean>;
741
+ /**
742
+ * Deselects `row`. No-op if `row` is not currently selected.
743
+ */
744
+ deselectRow(row: T): Promise<boolean>;
745
+ /**
746
+ * Toggles selection of `row`.
747
+ */
748
+ toggleRowSelection(row: T): Promise<boolean>;
749
+ /**
750
+ * Selects every row in the current view ({@link dataView}). No-op in
751
+ * `'single'` selection mode.
752
+ */
753
+ selectAllRows(): Promise<boolean>;
754
+ /**
755
+ * Clears the row selection.
756
+ */
757
+ clearSelection(): Promise<boolean>;
758
+ /**
759
+ * Whether `row` is currently selected.
760
+ */
761
+ isRowSelected(row: T): boolean;
762
+ /**
763
+ * Row-expansion (master-detail) configuration for the grid.
764
+ *
765
+ * @remarks
766
+ * Expansion is disabled by default. Set `enabled: true` and supply a
767
+ * `detailTemplate` to opt in. The default UX renders a chevron toggle in a
768
+ * dedicated leading column; set `showToggleColumn: false` to drive
769
+ * expansion entirely through the public API or a custom cell template.
770
+ *
771
+ * @example
772
+ * ```ts
773
+ * grid.expansion = {
774
+ * enabled: true,
775
+ * detailTemplate: ({ data }) => html`<order-summary .order=${data}></order-summary>`,
776
+ * };
777
+ * ```
778
+ */
779
+ expansion?: GridExpansionConfiguration<T>;
780
+ /**
781
+ * The currently expanded rows, in insertion order.
782
+ *
783
+ * @remarks
784
+ * Returned as a plain array snapshot — mutating the returned array does
785
+ * not change the grid's expansion state. Set this property to replace the
786
+ * expansion set programmatically (goes through the cancellable
787
+ * `rowExpanding` event).
788
+ */
789
+ get expandedRows(): T[];
790
+ set expandedRows(rows: ReadonlyArray<T>);
791
+ /**
792
+ * Expands `row`. No-op when the row is already expanded, expansion is
793
+ * disabled, or the optional `isExpandable` predicate rejects it.
794
+ */
795
+ expandRow(row: T): Promise<boolean>;
796
+ /**
797
+ * Collapses `row`. No-op when the row is not currently expanded.
798
+ */
799
+ collapseRow(row: T): Promise<boolean>;
800
+ /**
801
+ * Toggles expansion of `row`.
802
+ */
803
+ toggleRowExpansion(row: T): Promise<boolean>;
804
+ /**
805
+ * Expands every row in {@link ApexGrid.dataView} that passes the optional
806
+ * `isExpandable` predicate.
807
+ */
808
+ expandAllRows(): Promise<boolean>;
809
+ /**
810
+ * Collapses every currently expanded row.
811
+ */
812
+ collapseAllRows(): Promise<boolean>;
813
+ /**
814
+ * Whether `row` is currently expanded.
815
+ */
816
+ isRowExpanded(row: T): boolean;
817
+ /**
818
+ * Tree-data (nested rows) configuration for the grid.
819
+ *
820
+ * @remarks
821
+ * Tree mode keeps {@link ApexGrid.data} flat; the grid derives the
822
+ * hierarchy from a user-supplied `getDataPath(row)` callback (AG Grid's
823
+ * "tree data" pattern). When enabled, the first visible data column (or
824
+ * the column referenced by `groupColumnKey`) renders a chevron toggle
825
+ * and depth-based indentation.
826
+ *
827
+ * @example
828
+ * ```ts
829
+ * grid.tree = {
830
+ * enabled: true,
831
+ * getDataPath: (row) => row.path, // e.g., ['Adrian'], ['Adrian', 'Bryan']
832
+ * defaultExpanded: true,
833
+ * };
834
+ * ```
835
+ */
836
+ tree?: GridTreeConfiguration<T>;
837
+ /**
838
+ * Toggles tree-expansion of `row`. No-op when tree mode is disabled or
839
+ * the row has no children.
840
+ */
841
+ toggleTreeRow(row: T): Promise<boolean>;
842
+ /**
843
+ * Expands a tree row. No-op when the row is already expanded, has no
844
+ * children, or tree mode is disabled.
845
+ */
846
+ expandTreeRow(row: T): Promise<boolean>;
847
+ /**
848
+ * Collapses a tree row. No-op when the row is not currently expanded.
849
+ */
850
+ collapseTreeRow(row: T): Promise<boolean>;
851
+ /** Expands every parent row in the current tree. */
852
+ expandAllTreeRows(): Promise<boolean>;
853
+ /** Collapses every currently-expanded tree row. */
854
+ collapseAllTreeRows(): Promise<boolean>;
855
+ /** Whether `row` is currently expanded in the tree. */
856
+ isTreeRowExpanded(row: T): boolean;
154
857
  /**
155
858
  * Set the sort state for the grid.
156
859
  */
@@ -180,14 +883,54 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
180
883
  * have been applied.
181
884
  */
182
885
  get dataView(): ReadonlyArray<T>;
886
+ /**
887
+ * The columns in visual render order: `'start'`-pinned columns first, then
888
+ * unpinned columns, then `'end'`-pinned columns.
889
+ *
890
+ * @remarks
891
+ * Use this when you need to iterate the columns in the same order the grid
892
+ * actually displays them (for example to build a column chooser). Public APIs
893
+ * like {@link ApexGrid.getColumn} continue to operate on the user-supplied
894
+ * {@link ApexGrid.columns} array.
895
+ */
896
+ get displayColumns(): ReadonlyArray<ColumnConfiguration<T>>;
183
897
  /**
184
898
  * The total number of items in the {@link ApexGrid.dataView} collection.
899
+ *
900
+ * @remarks
901
+ * This is always the post-filter, post-sort row count — pagination does not change it.
902
+ * Use {@link ApexGrid.pageItems} to read the rows currently rendered into the body.
185
903
  */
186
904
  get totalItems(): number;
905
+ /**
906
+ * The records currently rendered into the virtualized body.
907
+ *
908
+ * @remarks
909
+ * Equal to {@link ApexGrid.dataView} when pagination is disabled. With pagination
910
+ * enabled (`'local'` mode) this is the active page slice.
911
+ */
912
+ get pageItems(): ReadonlyArray<T>;
913
+ /**
914
+ * The current zero-based page index.
915
+ */
916
+ get page(): number;
917
+ set page(value: number);
918
+ /**
919
+ * The current page size.
920
+ */
921
+ get pageSize(): number;
922
+ set pageSize(value: number);
923
+ /**
924
+ * The total number of pages computed from {@link ApexGrid.totalItems} and {@link ApexGrid.pageSize}.
925
+ */
926
+ get pageCount(): number;
187
927
  protected watchColumns(_: ColumnConfiguration<T>[], newConfig?: ColumnConfiguration<T>[]): void;
188
928
  protected dataChanged(): void;
189
929
  protected pipeline(): Promise<void>;
190
- constructor();
930
+ protected paginationChanged(): void;
931
+ protected quickFilterChanged(): void;
932
+ protected updated(): void;
933
+ protected firstUpdated(): void;
191
934
  /**
192
935
  * Performs a filter operation in the grid based on the passed expression(s).
193
936
  */
@@ -204,23 +947,231 @@ export declare class ApexGrid<T extends object> extends EventEmitterBase<ApexGri
204
947
  * Resets the current filter state of the control.
205
948
  */
206
949
  clearFilter(key?: Keys<T>): void;
950
+ /**
951
+ * Navigates the grid to the given zero-based `page` index.
952
+ *
953
+ * @remarks
954
+ * Emits the cancellable `pageChanging` event before applying the change and the
955
+ * `pageChanged` event after. Out-of-range values are clamped into `[0, pageCount - 1]`.
956
+ *
957
+ * @param page - The target zero-based page index.
958
+ * @returns `true` if the change was applied, `false` if cancelled or a no-op.
959
+ *
960
+ * @example
961
+ * ```ts
962
+ * await grid.gotoPage(2);
963
+ * ```
964
+ */
965
+ gotoPage(page: number): Promise<boolean>;
966
+ /**
967
+ * Updates the grid's page size and returns to the first page.
968
+ *
969
+ * @remarks
970
+ * Emits the cancellable `pageChanging` event before applying the change and the
971
+ * `pageChanged` event after.
972
+ *
973
+ * @param size - The new page size (must be a positive integer).
974
+ * @returns `true` if the change was applied, `false` if cancelled or a no-op.
975
+ */
976
+ setPageSize(size: number): Promise<boolean>;
977
+ /**
978
+ * Navigates to the next page. No-op if already on the last page.
979
+ */
980
+ nextPage(): Promise<boolean>;
981
+ /**
982
+ * Navigates to the previous page. No-op if already on the first page.
983
+ */
984
+ previousPage(): Promise<boolean>;
985
+ /**
986
+ * Navigates to the first page.
987
+ */
988
+ firstPage(): Promise<boolean>;
989
+ /**
990
+ * Navigates to the last page.
991
+ */
992
+ lastPage(): Promise<boolean>;
993
+ /**
994
+ * Applies a new quick-filter (global search) value, emitting the cancellable
995
+ * `quickFilterChanging` event first and the `quickFilterChanged` event after the
996
+ * pipeline has run.
997
+ *
998
+ * @param value - The new quick-filter value. Pass `''` to clear.
999
+ * @returns `true` if the change was applied, `false` if cancelled or a no-op.
1000
+ *
1001
+ * @example
1002
+ * ```ts
1003
+ * await grid.setQuickFilter('john');
1004
+ * ```
1005
+ */
1006
+ setQuickFilter(value: string): Promise<boolean>;
207
1007
  /**
208
1008
  * Returns a {@link ColumnConfiguration} for a given column.
209
1009
  */
210
1010
  getColumn(id: Keys<T> | number): ColumnConfiguration<T> | undefined;
211
1011
  /**
212
1012
  * Updates the column configuration of the grid.
1013
+ *
1014
+ * @remarks
1015
+ * Each updated column is replaced with a fresh object reference so that cells
1016
+ * and headers re-render with the new template / configuration. The
1017
+ * user-supplied `columns` array is also reassigned for Lit reactivity.
213
1018
  */
214
1019
  updateColumns(columns: ColumnConfiguration<T> | ColumnConfiguration<T>[]): void;
1020
+ /**
1021
+ * Pins a column to one of the grid's edges, or unpins it when `position` is `null`.
1022
+ *
1023
+ * @remarks
1024
+ * Emits the cancellable `columnPinning` event first and the `columnPinned`
1025
+ * event after the update is applied. The user-supplied {@link ApexGrid.columns}
1026
+ * array is not reordered — only the visual render order changes.
1027
+ *
1028
+ * @param key - The target column key.
1029
+ * @param position - `'start'`, `'end'`, or `null` to unpin.
1030
+ * @returns `true` if the change was applied, `false` if cancelled or a no-op.
1031
+ *
1032
+ * @example
1033
+ * ```ts
1034
+ * await grid.pinColumn('name', 'start');
1035
+ * await grid.pinColumn('actions', 'end');
1036
+ * ```
1037
+ */
1038
+ pinColumn(key: Keys<T>, position: PinPosition): Promise<boolean>;
1039
+ /**
1040
+ * Unpins a column. Equivalent to {@link ApexGrid.pinColumn}(`key`, `null`).
1041
+ *
1042
+ * @param key - The target column key.
1043
+ * @returns `true` if the change was applied, `false` if the column was already
1044
+ * unpinned or the operation was cancelled.
1045
+ */
1046
+ unpinColumn(key: Keys<T>): Promise<boolean>;
1047
+ /**
1048
+ * The cell currently in edit mode, or `null`.
1049
+ */
1050
+ get editingCell(): {
1051
+ rowIndex: number;
1052
+ columnKey: Keys<T>;
1053
+ } | null;
1054
+ /**
1055
+ * The view-relative index of the row currently in edit mode (row edit mode
1056
+ * only), or `null`.
1057
+ */
1058
+ get editingRow(): number | null;
1059
+ /**
1060
+ * Begins editing the cell at `(rowIndex, columnKey)`.
1061
+ *
1062
+ * @remarks
1063
+ * `rowIndex` is the view-relative index (matches {@link ApexGrid.pageItems}).
1064
+ * Returns `false` when the column isn't editable, the row index is out of
1065
+ * range, or the request was rejected (for example in row mode with pending
1066
+ * changes that couldn't be committed).
1067
+ */
1068
+ editCell(rowIndex: number, columnKey: Keys<T>): Promise<boolean>;
1069
+ /**
1070
+ * Begins editing the entire row at `rowIndex` (row edit mode only).
1071
+ *
1072
+ * @returns `false` when editing is disabled, the grid is in cell mode, or
1073
+ * the row index is out of range.
1074
+ */
1075
+ editRow(rowIndex: number): Promise<boolean>;
1076
+ /**
1077
+ * Commits the current edit.
1078
+ *
1079
+ * @remarks
1080
+ * In cell mode this writes the active cell's pending value. In row mode it
1081
+ * flushes all pending values for the active row. Emits `cellValueChanging`
1082
+ * per changed cell (cancellable) and `cellValueChanged` after, followed by
1083
+ * `rowEditEnded` in row mode.
1084
+ */
1085
+ commitEdit(): Promise<boolean>;
1086
+ /**
1087
+ * Discards the current edit without writing back to {@link ApexGrid.data}.
1088
+ */
1089
+ cancelEdit(): void;
1090
+ /**
1091
+ * Exports the current grid contents as a CSV string and (in a browser
1092
+ * context) triggers a download.
1093
+ *
1094
+ * @remarks
1095
+ * By default the export uses the post-filter/post-sort `dataView`, includes
1096
+ * every visible column with `exportable !== false`, and prepends a UTF-8 BOM
1097
+ * so Excel opens the file with the right encoding. Pass `source: 'page'` to
1098
+ * export only the current page, `source: 'selected'` to export the current
1099
+ * row selection, or `source: 'all'` to export the raw `data` array. The
1100
+ * returned string is the same content written to the file — useful for
1101
+ * tests or routing the bytes elsewhere.
1102
+ *
1103
+ * @example
1104
+ * ```ts
1105
+ * grid.exportToCSV(); // download data.csv
1106
+ * grid.exportToCSV({ filename: 'users', source: 'selected' });
1107
+ * const text = grid.exportToCSV({ filename: '' }); // string only, no download
1108
+ * ```
1109
+ */
1110
+ exportToCSV(options?: CSVExportOptions<T>): string;
1111
+ /**
1112
+ * The export formats offered in the toolbar's export menu, in order.
1113
+ *
1114
+ * @remarks
1115
+ * The community grid offers CSV only. This is the seam derived grids use to
1116
+ * contribute more formats: `@apexcharts/grid-enterprise` overrides it to add
1117
+ * `'xlsx'`. The toolbar renders one menu item per entry and dispatches the
1118
+ * chosen id to {@link ApexGrid.exportAs}.
1119
+ */
1120
+ get exportFormats(): ReadonlyArray<ExportFormat>;
1121
+ /**
1122
+ * Exports the grid in the given format (one of {@link ApexGrid.exportFormats}).
1123
+ * Called by the toolbar's export menu. The community grid handles `'csv'`;
1124
+ * derived grids override to handle additional formats, delegating to `super`
1125
+ * for the ones they don't add.
1126
+ */
1127
+ exportAs(formatId: string, options?: ExportOptions<T>): void;
1128
+ /**
1129
+ * Moves a column relative to another column.
1130
+ *
1131
+ * @remarks
1132
+ * Emits the cancellable `columnMoving` event first and `columnMoved` after.
1133
+ * Reordering only succeeds when the source and target columns share the same
1134
+ * pinning group (start / unpinned / end) — cross-group moves return `false`.
1135
+ * Use {@link ApexGrid.pinColumn} to change a column's pinning group first.
1136
+ *
1137
+ * @param fromKey - The column to move.
1138
+ * @param toKey - The reference column.
1139
+ * @param position - Whether to place `fromKey` before or after `toKey`. Defaults to `'before'`.
1140
+ * @returns `true` if the move was applied, `false` if cancelled or a no-op.
1141
+ *
1142
+ * @example
1143
+ * ```ts
1144
+ * await grid.moveColumn('email', 'name', 'after');
1145
+ * ```
1146
+ */
1147
+ moveColumn(fromKey: Keys<T>, toKey: Keys<T>, position?: ColumnDropPosition): Promise<boolean>;
215
1148
  protected bodyClickHandler(event: MouseEvent): void;
216
1149
  protected bodyKeydownHandler(event: KeyboardEvent): void;
217
1150
  protected renderHeaderRow(): import("lit-html").TemplateResult<1>;
218
1151
  protected renderBody(): import("lit-html").TemplateResult<1>;
219
1152
  protected renderFilterRow(): typeof nothing | import("lit-html").TemplateResult<1>;
1153
+ protected renderToolbar(): typeof nothing | import("lit-html").TemplateResult<1>;
1154
+ protected renderPaginator(): typeof nothing | import("lit-html").TemplateResult<1>;
1155
+ /**
1156
+ * Renders a visually-hidden polite live region. Status messages set via
1157
+ * {@link announce} land here; screen readers will read them aloud without
1158
+ * stealing focus. We intentionally keep this in the shadow root so we
1159
+ * don't have to coordinate consumer DOM placement.
1160
+ */
1161
+ protected renderLiveRegion(): import("lit-html").TemplateResult<1>;
220
1162
  protected render(): import("lit-html").TemplateResult<1>;
1163
+ /**
1164
+ * Sets the live region's announcement text. Screen readers configured to
1165
+ * read polite live updates will read the new value aloud.
1166
+ *
1167
+ * @remarks
1168
+ * Use this from custom UI affordances (e.g. an "Apply filter" button) so
1169
+ * the change is announced. Built-in operations (sort / filter / page /
1170
+ * select / expand) call this internally already.
1171
+ */
1172
+ announce(message: string): void;
221
1173
  }
222
1174
  declare global {
223
1175
  interface HTMLElementTagNameMap {
224
- [ApexGrid.tagName]: ApexGrid<object>;
225
1176
  }
226
1177
  }