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.
- package/CHANGELOG.md +338 -0
- package/LICENSE.md +125 -0
- package/README.md +64 -10
- package/components/cell.d.ts +30 -4
- package/components/cell.js +199 -53
- package/components/cell.js.map +1 -1
- package/components/filter-row.d.ts +2 -0
- package/components/filter-row.js +82 -28
- package/components/filter-row.js.map +1 -1
- package/components/grid.d.ts +146 -36
- package/components/grid.js +442 -103
- package/components/grid.js.map +1 -1
- package/components/group-header-row.js +28 -25
- package/components/group-header-row.js.map +1 -1
- package/components/header-row.d.ts +7 -5
- package/components/header-row.js +11 -9
- package/components/header-row.js.map +1 -1
- package/components/header.js +32 -20
- package/components/header.js.map +1 -1
- package/components/row.d.ts +19 -3
- package/components/row.js +69 -23
- package/components/row.js.map +1 -1
- package/components/toolbar.js +2 -1
- package/components/toolbar.js.map +1 -1
- package/components/virtualizer.d.ts +40 -0
- package/components/virtualizer.js +116 -5
- package/components/virtualizer.js.map +1 -1
- package/controllers/dom.d.ts +4 -4
- package/controllers/dom.js +40 -22
- package/controllers/dom.js.map +1 -1
- package/controllers/editing.d.ts +104 -37
- package/controllers/editing.js +230 -78
- package/controllers/editing.js.map +1 -1
- package/controllers/expansion.d.ts +14 -5
- package/controllers/expansion.js +24 -1
- package/controllers/expansion.js.map +1 -1
- package/controllers/filter.d.ts +10 -2
- package/controllers/filter.js +62 -17
- package/controllers/filter.js.map +1 -1
- package/controllers/history.d.ts +45 -8
- package/controllers/history.js +58 -20
- package/controllers/history.js.map +1 -1
- package/controllers/navigation.d.ts +67 -13
- package/controllers/navigation.js +191 -51
- package/controllers/navigation.js.map +1 -1
- package/controllers/pagination.d.ts +6 -0
- package/controllers/pagination.js +10 -2
- package/controllers/pagination.js.map +1 -1
- package/controllers/reorder.js +38 -22
- package/controllers/reorder.js.map +1 -1
- package/controllers/resize.d.ts +17 -2
- package/controllers/resize.js +16 -6
- package/controllers/resize.js.map +1 -1
- package/controllers/row-pin.d.ts +20 -2
- package/controllers/row-pin.js +16 -9
- package/controllers/row-pin.js.map +1 -1
- package/controllers/row-reorder.d.ts +31 -11
- package/controllers/row-reorder.js +117 -37
- package/controllers/row-reorder.js.map +1 -1
- package/controllers/selection.d.ts +11 -4
- package/controllers/selection.js +26 -11
- package/controllers/selection.js.map +1 -1
- package/controllers/sort.d.ts +22 -2
- package/controllers/sort.js +29 -23
- package/controllers/sort.js.map +1 -1
- package/controllers/state.d.ts +56 -7
- package/controllers/state.js +76 -6
- package/controllers/state.js.map +1 -1
- package/controllers/tree.d.ts +15 -10
- package/controllers/tree.js +0 -0
- package/controllers/tree.js.map +1 -1
- package/custom-elements.json +3156 -277
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +15 -8
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ApexGrid.html +155 -81
- package/docs/classes/ApexGridPaginator.html +1 -1
- package/docs/classes/ApexGridToolbar.html +3 -3
- package/docs/functions/localize.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +74 -11
- package/docs/interfaces/ApexCellValidationFailedEvent.html +3 -2
- package/docs/interfaces/ApexCellValueChangedEvent.html +4 -2
- package/docs/interfaces/ApexCellValueChangingEvent.html +3 -2
- package/docs/interfaces/ApexGridEventMap.html +5 -2
- package/docs/interfaces/ApexRowEditEndedEvent.html +2 -1
- package/docs/interfaces/ApexRowEditStartedEvent.html +2 -1
- package/docs/interfaces/ApexRowMovingEvent.html +9 -3
- package/docs/interfaces/ApexRowPinningEvent.html +1 -1
- package/docs/interfaces/ApexTreeRowExpandedEvent.html +4 -1
- package/docs/interfaces/ApexTreeRowExpandingEvent.html +4 -1
- package/docs/interfaces/BaseApexCellContext.html +1 -1
- package/docs/interfaces/BaseApexEditorContext.html +1 -1
- package/docs/interfaces/BaseFilterExpression.html +2 -2
- package/docs/interfaces/CSVExportOptions.html +12 -4
- package/docs/interfaces/DataPipelineConfiguration.html +1 -1
- package/docs/interfaces/ExportOptions.html +5 -3
- package/docs/interfaces/GridExpansionConfiguration.html +6 -2
- package/docs/interfaces/GridRowReorderingConfiguration.html +1 -1
- package/docs/interfaces/PaginationState.html +1 -1
- package/docs/interfaces/SetStateResult.html +3 -2
- package/docs/interfaces/ValidatorContext.html +7 -2
- package/docs/media/_token-values.scss +118 -0
- package/docs/media/package.json +3 -2
- package/docs/modules.html +1 -1
- package/docs/types/ExportSource.html +6 -4
- package/docs/types/OperandKeys.html +9 -0
- package/docs/variables/EN_LOCALE.html +2 -2
- package/i18n/en.d.ts +5 -0
- package/i18n/en.js +5 -0
- package/i18n/en.js.map +1 -1
- package/i18n/es.js +5 -0
- package/i18n/es.js.map +1 -1
- package/internal/column-types.d.ts +27 -1
- package/internal/column-types.js +75 -49
- package/internal/column-types.js.map +1 -1
- package/internal/constants.d.ts +1 -2
- package/internal/constants.js +0 -4
- package/internal/constants.js.map +1 -1
- package/internal/document-styles.d.ts +30 -0
- package/internal/document-styles.js +48 -0
- package/internal/document-styles.js.map +1 -0
- package/internal/export.d.ts +39 -7
- package/internal/export.js +35 -34
- package/internal/export.js.map +1 -1
- package/internal/feature-module.d.ts +60 -3
- package/internal/feature-module.js +6 -0
- package/internal/feature-module.js.map +1 -1
- package/internal/index.d.ts +6 -4
- package/internal/index.js +5 -3
- package/internal/index.js.map +1 -1
- package/internal/normalize-case.d.ts +8 -1
- package/internal/normalize-case.js +3 -2
- package/internal/normalize-case.js.map +1 -1
- package/internal/state-snapshot.d.ts +60 -8
- package/internal/state-snapshot.js +87 -19
- package/internal/state-snapshot.js.map +1 -1
- package/internal/types.d.ts +17 -2
- package/internal/types.js.map +1 -1
- package/internal/utils.d.ts +34 -6
- package/internal/utils.js +30 -21
- package/internal/utils.js.map +1 -1
- package/internal/validators.js +1 -0
- package/internal/validators.js.map +1 -1
- package/operations/filter/operands/number.js +9 -6
- package/operations/filter/operands/number.js.map +1 -1
- package/operations/filter/operands/string.js +2 -3
- package/operations/filter/operands/string.js.map +1 -1
- package/operations/filter/types.d.ts +13 -1
- package/operations/filter/types.js.map +1 -1
- package/operations/filter.d.ts +6 -0
- package/operations/filter.js +23 -7
- package/operations/filter.js.map +1 -1
- package/operations/quick-filter.js +2 -5
- package/operations/quick-filter.js.map +1 -1
- package/operations/sort.d.ts +21 -2
- package/operations/sort.js +41 -14
- package/operations/sort.js.map +1 -1
- package/package.json +8 -3
- package/setup.d.ts +11 -0
- package/setup.js +9 -19
- package/setup.js.map +1 -1
- package/styles/_token-values.css.d.ts +1 -0
- package/styles/_token-values.css.js +3 -0
- package/styles/_token-values.css.js.map +1 -0
- package/styles/_tokens.css.js +1 -1
- package/styles/_tokens.css.js.map +1 -1
- package/styles/body-cell/body-cell.css.js +1 -1
- package/styles/body-cell/body-cell.css.js.map +1 -1
- package/styles/body-cell/cell-renderers.css.js +1 -1
- package/styles/body-cell/cell-renderers.css.js.map +1 -1
- package/styles/body-row/body-row.css.js +1 -1
- package/styles/body-row/body-row.css.js.map +1 -1
- package/styles/document-tokens.css.d.ts +1 -0
- package/styles/document-tokens.css.js +3 -0
- package/styles/document-tokens.css.js.map +1 -0
- package/styles/filter-row/filter-row.css.js +1 -1
- package/styles/filter-row/filter-row.css.js.map +1 -1
- package/styles/grid/_grid.base.css.js +1 -1
- package/styles/grid/_grid.base.css.js.map +1 -1
- package/styles/grid/grid.css.js +1 -1
- package/styles/grid/grid.css.js.map +1 -1
- package/styles/group-header-row/group-header-row.css.js +1 -1
- package/styles/group-header-row/group-header-row.css.js.map +1 -1
- package/styles/header-cell/header-cell.css.js +1 -1
- package/styles/header-cell/header-cell.css.js.map +1 -1
- package/styles/header-row/header-row.base.css.js +1 -1
- package/styles/header-row/header-row.base.css.js.map +1 -1
- package/styles/paginator/paginator.css.js +1 -1
- package/styles/paginator/paginator.css.js.map +1 -1
- package/styles/toolbar/toolbar.css.js +1 -1
- package/styles/toolbar/toolbar.css.js.map +1 -1
- package/tokens.css +78 -0
- package/LICENSE +0 -80
- package/docs/media/LICENSE +0 -80
- package/docs/media/_tokens.scss +0 -214
package/components/grid.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
773
|
-
|
|
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
|
-
*
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1464
|
-
*
|
|
1465
|
-
*
|
|
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
|
|
1558
|
-
*
|
|
1559
|
-
* event, emits `rowMoved`, and animates the affected
|
|
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,
|
|
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
|
/**
|