@skyux/data-grid 15.2.0 → 15.4.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/fesm2022/skyux-data-grid-testing.mjs +8 -0
- package/fesm2022/skyux-data-grid-testing.mjs.map +1 -1
- package/fesm2022/skyux-data-grid.mjs +489 -51
- package/fesm2022/skyux-data-grid.mjs.map +1 -1
- package/package.json +12 -11
- package/types/skyux-data-grid-testing.d.ts +7 -0
- package/types/skyux-data-grid.d.ts +123 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { coerceBooleanProperty, coerceNumberProperty, coerceStringArray, coerceArray } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, booleanAttribute, numberAttribute, signal, contentChild, TemplateRef, computed, inject, afterRenderEffect, ChangeDetectionStrategy, Component, model, contentChildren, untracked, linkedSignal, ChangeDetectorRef, effect } from '@angular/core';
|
|
3
|
+
import { input, booleanAttribute, numberAttribute, signal, contentChild, TemplateRef, computed, inject, afterRenderEffect, ChangeDetectionStrategy, Component, model, output, contentChildren, untracked, linkedSignal, ChangeDetectorRef, effect } from '@angular/core';
|
|
4
4
|
import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
6
6
|
import * as i1$1 from '@skyux/ag-grid';
|
|
@@ -11,9 +11,9 @@ import { SkyAppLocaleProvider } from '@skyux/i18n';
|
|
|
11
11
|
import * as i4 from '@skyux/indicators';
|
|
12
12
|
import { SkyWaitModule } from '@skyux/indicators';
|
|
13
13
|
import * as i2 from '@skyux/lists';
|
|
14
|
-
import { SkyPagingModule } from '@skyux/lists';
|
|
14
|
+
import { SkyPagingModule, SkyDataColumnSource, SkyDataSelectionSource, SkyDataSortSource } from '@skyux/lists';
|
|
15
15
|
import { AgGridAngular } from 'ag-grid-angular';
|
|
16
|
-
import { ModuleRegistry, CellStyleModule, ClientSideRowModelModule, ColumnApiModule, ColumnAutoSizeModule, CustomEditorModule, EventApiModule, GridStateModule, LocaleModule, PaginationModule, RenderApiModule, RowApiModule, RowAutoHeightModule, RowSelectionModule, RowStyleModule } from 'ag-grid-community';
|
|
16
|
+
import { ModuleRegistry, CellStyleModule, ClientSideRowModelModule, ColumnApiModule, ColumnAutoSizeModule, CustomEditorModule, EventApiModule, GridStateModule, LocaleModule, PaginationModule, RenderApiModule, RowApiModule, RowAutoHeightModule, RowSelectionModule, RowStyleModule, SELECTION_COLUMN_ID } from 'ag-grid-community';
|
|
17
17
|
import { Observable, map, distinctUntilChanged, filter, switchMap, takeUntil, startWith } from 'rxjs';
|
|
18
18
|
import * as i1 from '@skyux/help-inline';
|
|
19
19
|
import { SkyHelpInlineModule } from '@skyux/help-inline';
|
|
@@ -27,7 +27,9 @@ class SkyDataGridColumn {
|
|
|
27
27
|
#initialized;
|
|
28
28
|
constructor() {
|
|
29
29
|
/**
|
|
30
|
-
* Whether the column is hidden.
|
|
30
|
+
* Whether the column is hidden. When the grid's `selectedColumnIds` is set,
|
|
31
|
+
* it determines which columns display instead. In a data manager's column
|
|
32
|
+
* picker, the column starts hidden and users can choose to display it.
|
|
31
33
|
* @default false
|
|
32
34
|
*/
|
|
33
35
|
this.columnHidden = input(false, { ...(ngDevMode ? { debugName: "columnHidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -44,6 +46,12 @@ class SkyDataGridColumn {
|
|
|
44
46
|
*/
|
|
45
47
|
this.dataType = input('text', /* @ts-ignore */
|
|
46
48
|
...(ngDevMode ? [{ debugName: "dataType" }] : /* istanbul ignore next */ []));
|
|
49
|
+
/**
|
|
50
|
+
* The text to display beneath the column's `headingText` in a data
|
|
51
|
+
* manager's column picker.
|
|
52
|
+
*/
|
|
53
|
+
this.description = input(/* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
|
|
47
55
|
/**
|
|
48
56
|
* The property to retrieve cell information from an entry on the grid `data` array.
|
|
49
57
|
* You must provide either the `columnId` or `field` property for every column,
|
|
@@ -95,7 +103,9 @@ class SkyDataGridColumn {
|
|
|
95
103
|
/**
|
|
96
104
|
* Whether the column is locked. The intent is to display locked columns first
|
|
97
105
|
* on the left side of the grid. If set to `true`, then users cannot drag the column
|
|
98
|
-
* to another position or drag other columns before it.
|
|
106
|
+
* to another position or drag other columns before it. In a data manager's
|
|
107
|
+
* column picker, a locked column always displays and is not offered as an
|
|
108
|
+
* option.
|
|
99
109
|
* @default false
|
|
100
110
|
*/
|
|
101
111
|
this.locked = input(false, { ...(ngDevMode ? { debugName: "locked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -159,17 +169,17 @@ class SkyDataGridColumn {
|
|
|
159
169
|
ngOnInit() {
|
|
160
170
|
this.#initialized.set(true);
|
|
161
171
|
}
|
|
162
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
163
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.
|
|
172
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: SkyDataGridColumn, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
173
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.3", type: SkyDataGridColumn, isStandalone: true, selector: "sky-data-grid-column", inputs: { columnHidden: { classPropertyName: "columnHidden", publicName: "columnHidden", isSignal: true, isRequired: false, transformFunction: null }, columnId: { classPropertyName: "columnId", publicName: "columnId", isSignal: true, isRequired: false, transformFunction: null }, dataType: { classPropertyName: "dataType", publicName: "dataType", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, flexWidth: { classPropertyName: "flexWidth", publicName: "flexWidth", isSignal: true, isRequired: false, transformFunction: null }, headingText: { classPropertyName: "headingText", publicName: "headingText", isSignal: true, isRequired: true, transformFunction: null }, headingHidden: { classPropertyName: "headingHidden", publicName: "headingHidden", isSignal: true, isRequired: false, transformFunction: null }, helpPopoverTitle: { classPropertyName: "helpPopoverTitle", publicName: "helpPopoverTitle", isSignal: true, isRequired: false, transformFunction: null }, helpPopoverContent: { classPropertyName: "helpPopoverContent", publicName: "helpPopoverContent", isSignal: true, isRequired: false, transformFunction: null }, helpKey: { classPropertyName: "helpKey", publicName: "helpKey", isSignal: true, isRequired: false, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, wrapText: { classPropertyName: "wrapText", publicName: "wrapText", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "templateChild", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
164
174
|
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: SkyDataGridColumn, decorators: [{
|
|
166
176
|
type: Component,
|
|
167
177
|
args: [{
|
|
168
178
|
selector: 'sky-data-grid-column',
|
|
169
179
|
template: '',
|
|
170
180
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
171
181
|
}]
|
|
172
|
-
}], ctorParameters: () => [], propDecorators: { columnHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnHidden", required: false }] }], columnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnId", required: false }] }], dataType: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataType", required: false }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], flexWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "flexWidth", required: false }] }], headingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingText", required: true }] }], headingHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingHidden", required: false }] }], helpPopoverTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpPopoverTitle", required: false }] }], helpPopoverContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpPopoverContent", required: false }] }], helpKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpKey", required: false }] }], locked: [{ type: i0.Input, args: [{ isSignal: true, alias: "locked", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], wrapText: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapText", required: false }] }], templateChild: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
182
|
+
}], ctorParameters: () => [], propDecorators: { columnHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnHidden", required: false }] }], columnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnId", required: false }] }], dataType: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataType", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], flexWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "flexWidth", required: false }] }], headingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingText", required: true }] }], headingHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingHidden", required: false }] }], helpPopoverTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpPopoverTitle", required: false }] }], helpPopoverContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpPopoverContent", required: false }] }], helpKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpKey", required: false }] }], locked: [{ type: i0.Input, args: [{ isSignal: true, alias: "locked", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], wrapText: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapText", required: false }] }], templateChild: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
173
183
|
|
|
174
184
|
/**
|
|
175
185
|
* @internal
|
|
@@ -189,8 +199,8 @@ class SkyDataGridColumnInlineHelp {
|
|
|
189
199
|
...(ngDevMode ? [{ debugName: "#headerComponentParams" }] : /* istanbul ignore next */ []));
|
|
190
200
|
}
|
|
191
201
|
#headerComponentParams;
|
|
192
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
193
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: SkyDataGridColumnInlineHelp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
203
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.3", type: SkyDataGridColumnInlineHelp, isStandalone: true, selector: "sky-data-grid-column-inline-help", ngImport: i0, template: `@if (showHelpInline()) {
|
|
194
204
|
<sky-help-inline
|
|
195
205
|
[helpKey]="helpKey()"
|
|
196
206
|
[popoverTitle]="helpPopoverTitle()"
|
|
@@ -198,7 +208,7 @@ class SkyDataGridColumnInlineHelp {
|
|
|
198
208
|
/>
|
|
199
209
|
}`, isInline: true, dependencies: [{ kind: "ngmodule", type: SkyHelpInlineModule }, { kind: "component", type: i1.λ1, selector: "sky-help-inline", inputs: ["ariaControls", "ariaExpanded", "ariaLabel", "helpKey", "labelledBy", "labelText", "popoverContent", "popoverTitle"], outputs: ["actionClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
200
210
|
}
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: SkyDataGridColumnInlineHelp, decorators: [{
|
|
202
212
|
type: Component,
|
|
203
213
|
args: [{
|
|
204
214
|
selector: 'sky-data-grid-column-inline-help',
|
|
@@ -253,6 +263,16 @@ ModuleRegistry.registerModules([
|
|
|
253
263
|
function arraySorted(arr) {
|
|
254
264
|
return arr.slice().sort((a, b) => a.localeCompare(b));
|
|
255
265
|
}
|
|
266
|
+
function arraysEqual(a, b) {
|
|
267
|
+
return a.length === b.length && a.every((value, i) => value === b[i]);
|
|
268
|
+
}
|
|
269
|
+
// The data manager has its own copy of this function, because the two
|
|
270
|
+
// libraries cannot share an internal function without exporting it.
|
|
271
|
+
function columnWidthsEqual(a, b) {
|
|
272
|
+
const keys = Object.keys(a);
|
|
273
|
+
return (keys.length === Object.keys(b).length &&
|
|
274
|
+
keys.every((key) => a[key] === b[key]));
|
|
275
|
+
}
|
|
256
276
|
/**
|
|
257
277
|
* Displays tabular data in a grid using a declarative set of columns and inputs.
|
|
258
278
|
* Provide the `data` array and one `sky-data-grid-column` for each column to render.
|
|
@@ -261,6 +281,20 @@ function arraySorted(arr) {
|
|
|
261
281
|
class SkyDataGrid {
|
|
262
282
|
#activatedRoute;
|
|
263
283
|
#changeDetector;
|
|
284
|
+
/**
|
|
285
|
+
* The widths in pixels of the columns users resized, keyed by column ID.
|
|
286
|
+
* This is `undefined` until a data manager integration sets the widths, so a
|
|
287
|
+
* grid outside a data manager neither tracks nor restores them.
|
|
288
|
+
*/
|
|
289
|
+
#columnWidths;
|
|
290
|
+
/**
|
|
291
|
+
* The widths the grid gave the columns that have neither a flex nor a
|
|
292
|
+
* width, from before a column width replaced them.
|
|
293
|
+
*/
|
|
294
|
+
#gridSizedWidths;
|
|
295
|
+
#selectionPruningDisabled;
|
|
296
|
+
#viewkeeperDisabled;
|
|
297
|
+
#awaitingInitialAutoSize;
|
|
264
298
|
#gridService;
|
|
265
299
|
#logger;
|
|
266
300
|
#router;
|
|
@@ -272,6 +306,18 @@ class SkyDataGrid {
|
|
|
272
306
|
#localeChange;
|
|
273
307
|
#columnDefs;
|
|
274
308
|
#hasColumnDefs;
|
|
309
|
+
/**
|
|
310
|
+
* The IDs of the columns that display, in a fixed order, so that moving a
|
|
311
|
+
* column does not change it.
|
|
312
|
+
*/
|
|
313
|
+
#displayedColumnIdSet;
|
|
314
|
+
/**
|
|
315
|
+
* The declared columns that have a usable ID, in declaration order. Columns
|
|
316
|
+
* missing both `columnId` and `field` are omitted; `SkyDataGridColumn`
|
|
317
|
+
* already warns about them. A repeated ID is suffixed the way AG Grid
|
|
318
|
+
* suffixes it (`name_1`), so that every column can be addressed.
|
|
319
|
+
*/
|
|
320
|
+
#columnCatalog;
|
|
275
321
|
#gridDestroyed;
|
|
276
322
|
#gridSelectedRowIds;
|
|
277
323
|
#gridSortChange;
|
|
@@ -394,6 +440,23 @@ class SkyDataGrid {
|
|
|
394
440
|
*/
|
|
395
441
|
this.page = model(1, /* @ts-ignore */
|
|
396
442
|
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
443
|
+
/**
|
|
444
|
+
* The IDs of the rows that display an inline delete confirmation. This is
|
|
445
|
+
* two-way bindable: an ID is removed when the user cancels the deletion of
|
|
446
|
+
* its row, or when its row is no longer in the grid.
|
|
447
|
+
* @default []
|
|
448
|
+
*/
|
|
449
|
+
this.rowDeleteIds = model([], /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "rowDeleteIds" }] : /* istanbul ignore next */ []));
|
|
451
|
+
/**
|
|
452
|
+
* Fires when the user cancels the deletion of a row.
|
|
453
|
+
*/
|
|
454
|
+
this.rowDeleteCancel = output();
|
|
455
|
+
/**
|
|
456
|
+
* Fires when the user confirms the deletion of a row. To complete the
|
|
457
|
+
* deletion, remove the row from `data`.
|
|
458
|
+
*/
|
|
459
|
+
this.rowDeleteConfirm = output();
|
|
397
460
|
/**
|
|
398
461
|
* The set of IDs for the rows to select in a multiselect grid.
|
|
399
462
|
* Rows with IDs that are not included are de-selected in the grid. This is two-way bindable:
|
|
@@ -402,6 +465,16 @@ class SkyDataGrid {
|
|
|
402
465
|
*/
|
|
403
466
|
this.selectedRowIds = model([], /* @ts-ignore */
|
|
404
467
|
...(ngDevMode ? [{ debugName: "selectedRowIds" }] : /* istanbul ignore next */ []));
|
|
468
|
+
/**
|
|
469
|
+
* The IDs of the columns to display, in display order. Columns that are not
|
|
470
|
+
* included are hidden. An ID that does not match a column is ignored until a
|
|
471
|
+
* column with that ID is declared. This is two-way bindable: once set, it
|
|
472
|
+
* emits a new value when the user reorders columns. When `undefined`, every
|
|
473
|
+
* column displays in declaration order except those marked `columnHidden`.
|
|
474
|
+
* Displayed locked columns come first.
|
|
475
|
+
*/
|
|
476
|
+
this.selectedColumnIds = model(/* @ts-ignore */
|
|
477
|
+
...(ngDevMode ? [undefined, { debugName: "selectedColumnIds" }] : /* istanbul ignore next */ []));
|
|
405
478
|
/**
|
|
406
479
|
* The current sort applied to the grid. This is two-way bindable: it emits a new value
|
|
407
480
|
* whenever the user sorts a column, and you can set it to sort the grid programmatically.
|
|
@@ -412,6 +485,65 @@ class SkyDataGrid {
|
|
|
412
485
|
...(ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []));
|
|
413
486
|
this.columns = contentChildren(SkyDataGridColumn, /* @ts-ignore */
|
|
414
487
|
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
488
|
+
/**
|
|
489
|
+
* The columns the grid can display, in declaration order. Read by column
|
|
490
|
+
* picker integrations through `SkyDataColumnSource`.
|
|
491
|
+
* @internal
|
|
492
|
+
*/
|
|
493
|
+
this.columnOptions = computed(() => this.#columnCatalog().map(({ id, column }) => ({
|
|
494
|
+
alwaysDisplayed: column.locked(),
|
|
495
|
+
description: column.description(),
|
|
496
|
+
id,
|
|
497
|
+
initialHide: column.columnHidden(),
|
|
498
|
+
labelText: column.headingText(),
|
|
499
|
+
})), /* @ts-ignore */
|
|
500
|
+
...(ngDevMode ? [{ debugName: "columnOptions" }] : /* istanbul ignore next */ []));
|
|
501
|
+
/**
|
|
502
|
+
* The widths in pixels of the columns users resized, keyed by column ID.
|
|
503
|
+
* Read by data manager integrations through `SkyDataColumnSource`.
|
|
504
|
+
* @internal
|
|
505
|
+
*/
|
|
506
|
+
this.columnWidths = computed(() => this.#columnWidths() ?? {}, /* @ts-ignore */
|
|
507
|
+
...(ngDevMode ? [{ debugName: "columnWidths" }] : /* istanbul ignore next */ []));
|
|
508
|
+
/**
|
|
509
|
+
* The IDs of the columns that display, in display order: the
|
|
510
|
+
* `selectedColumnIds` that match a declared column or, when
|
|
511
|
+
* `selectedColumnIds` is `undefined`, every column not marked `columnHidden`.
|
|
512
|
+
* Locked columns come first, as the grid displays them. Read by column
|
|
513
|
+
* picker integrations through `SkyDataColumnSource`.
|
|
514
|
+
* @internal
|
|
515
|
+
*/
|
|
516
|
+
this.displayedColumnIds = computed(() => {
|
|
517
|
+
const catalog = this.#columnCatalog();
|
|
518
|
+
const selectedColumnIds = this.selectedColumnIds();
|
|
519
|
+
const declaredIds = catalog.map(({ id }) => id);
|
|
520
|
+
const lockedIds = catalog
|
|
521
|
+
.filter(({ column }) => column.locked())
|
|
522
|
+
.map(({ id }) => id);
|
|
523
|
+
const columnIds = selectedColumnIds
|
|
524
|
+
? selectedColumnIds.filter((id) => declaredIds.includes(id))
|
|
525
|
+
: catalog
|
|
526
|
+
.filter(({ column }) => !column.columnHidden())
|
|
527
|
+
.map(({ id }) => id);
|
|
528
|
+
return [
|
|
529
|
+
...columnIds.filter((id) => lockedIds.includes(id)),
|
|
530
|
+
...columnIds.filter((id) => !lockedIds.includes(id)),
|
|
531
|
+
];
|
|
532
|
+
}, { ...(ngDevMode ? { debugName: "displayedColumnIds" } : /* istanbul ignore next */ {}), equal: arraysEqual });
|
|
533
|
+
/**
|
|
534
|
+
* The selectors of the elements the grid keeps visible at the top of the
|
|
535
|
+
* viewport while the page scrolls. Read by column picker integrations
|
|
536
|
+
* through `SkyDataColumnSource`.
|
|
537
|
+
* @internal
|
|
538
|
+
*/
|
|
539
|
+
this.viewkeeperClasses = computed(() => {
|
|
540
|
+
const classes = ['.ag-header'];
|
|
541
|
+
if (this.topScrollEnabled()) {
|
|
542
|
+
classes.push('.ag-body-horizontal-scroll');
|
|
543
|
+
}
|
|
544
|
+
return classes;
|
|
545
|
+
}, /* @ts-ignore */
|
|
546
|
+
...(ngDevMode ? [{ debugName: "viewkeeperClasses" }] : /* istanbul ignore next */ []));
|
|
415
547
|
this.gridApi = signal(undefined, /* @ts-ignore */
|
|
416
548
|
...(ngDevMode ? [{ debugName: "gridApi" }] : /* istanbul ignore next */ []));
|
|
417
549
|
this.gridOptions = computed(() => {
|
|
@@ -448,7 +580,45 @@ class SkyDataGrid {
|
|
|
448
580
|
}
|
|
449
581
|
: undefined,
|
|
450
582
|
loading: untracked(() => this.loading() || !Array.isArray(this.data())),
|
|
583
|
+
// A user moves columns with the keyboard or by dragging a column
|
|
584
|
+
// header. A drag moves columns as it goes, and a drag released outside
|
|
585
|
+
// the grid or cancelled with Escape reports no finished move, so sync
|
|
586
|
+
// when any drag ends too.
|
|
587
|
+
onColumnMoved: (event) => {
|
|
588
|
+
if (event.finished) {
|
|
589
|
+
this.#syncColumnOrderFromGrid(event.api);
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
// The grid's initial content sizing runs after the grid is ready and
|
|
593
|
+
// would replace the widths applied then, so apply them again. Content
|
|
594
|
+
// sizing after that is a user double-clicking a column's edge.
|
|
595
|
+
onColumnResized: (event) => {
|
|
596
|
+
if (event.source === 'autosizeColumns' &&
|
|
597
|
+
this.#awaitingInitialAutoSize) {
|
|
598
|
+
this.#awaitingInitialAutoSize = false;
|
|
599
|
+
this.#gridSizedWidths.clear();
|
|
600
|
+
this.#rememberGridSizedWidths(event.api);
|
|
601
|
+
this.#reapplyColumnWidths(event.api);
|
|
602
|
+
}
|
|
603
|
+
else if ((event.source === 'uiColumnResized' && event.finished) ||
|
|
604
|
+
event.source === 'autosizeColumns') {
|
|
605
|
+
// AG Grid reports the resized columns with every resize it
|
|
606
|
+
// dispatches from these sources.
|
|
607
|
+
/* istanbul ignore next */
|
|
608
|
+
this.#syncColumnWidthsFromGrid(event.columns ?? []);
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
onDragCancelled: (event) => this.#syncColumnOrderFromGrid(event.api),
|
|
612
|
+
onDragStopped: (event) => this.#syncColumnOrderFromGrid(event.api),
|
|
451
613
|
onGridReady: (args) => {
|
|
614
|
+
// The displayed columns may have changed since the column
|
|
615
|
+
// definitions were created.
|
|
616
|
+
this.#applyDisplayedColumns(args.api, this.displayedColumnIds());
|
|
617
|
+
this.#awaitingInitialAutoSize =
|
|
618
|
+
!!args.api.getGridOption('autoSizeStrategy');
|
|
619
|
+
this.#gridSizedWidths.clear();
|
|
620
|
+
this.#rememberGridSizedWidths(args.api);
|
|
621
|
+
this.#reapplyColumnWidths(args.api);
|
|
452
622
|
this.gridApi.set(args.api);
|
|
453
623
|
this.gridReady.set(true);
|
|
454
624
|
// AG Grid dispatches `onGridReady` outside the Angular zone, so
|
|
@@ -507,17 +677,27 @@ class SkyDataGrid {
|
|
|
507
677
|
}
|
|
508
678
|
return source;
|
|
509
679
|
} });
|
|
510
|
-
this.skyViewkeeper = computed(() =>
|
|
511
|
-
// Only used when not using SkyDataManagerService because data manager handles SkyViewkeeper.
|
|
512
|
-
const classes = ['.ag-header'];
|
|
513
|
-
if (this.topScrollEnabled()) {
|
|
514
|
-
classes.push('.ag-body-horizontal-scroll');
|
|
515
|
-
}
|
|
516
|
-
return classes;
|
|
517
|
-
}, /* @ts-ignore */
|
|
680
|
+
this.skyViewkeeper = computed(() => this.#viewkeeperDisabled() ? [] : this.viewkeeperClasses(), /* @ts-ignore */
|
|
518
681
|
...(ngDevMode ? [{ debugName: "skyViewkeeper" }] : /* istanbul ignore next */ []));
|
|
519
682
|
this.#activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
520
683
|
this.#changeDetector = inject(ChangeDetectorRef);
|
|
684
|
+
/**
|
|
685
|
+
* The widths in pixels of the columns users resized, keyed by column ID.
|
|
686
|
+
* This is `undefined` until a data manager integration sets the widths, so a
|
|
687
|
+
* grid outside a data manager neither tracks nor restores them.
|
|
688
|
+
*/
|
|
689
|
+
this.#columnWidths = signal(undefined, /* @ts-ignore */
|
|
690
|
+
...(ngDevMode ? [{ debugName: "#columnWidths" }] : /* istanbul ignore next */ []));
|
|
691
|
+
/**
|
|
692
|
+
* The widths the grid gave the columns that have neither a flex nor a
|
|
693
|
+
* width, from before a column width replaced them.
|
|
694
|
+
*/
|
|
695
|
+
this.#gridSizedWidths = new Map();
|
|
696
|
+
this.#selectionPruningDisabled = signal(false, /* @ts-ignore */
|
|
697
|
+
...(ngDevMode ? [{ debugName: "#selectionPruningDisabled" }] : /* istanbul ignore next */ []));
|
|
698
|
+
this.#viewkeeperDisabled = signal(false, /* @ts-ignore */
|
|
699
|
+
...(ngDevMode ? [{ debugName: "#viewkeeperDisabled" }] : /* istanbul ignore next */ []));
|
|
700
|
+
this.#awaitingInitialAutoSize = false;
|
|
521
701
|
this.#gridService = inject(SkyAgGridService);
|
|
522
702
|
this.#logger = inject(SkyLogService);
|
|
523
703
|
this.#router = inject(Router, { optional: true });
|
|
@@ -531,14 +711,54 @@ class SkyDataGrid {
|
|
|
531
711
|
.getLocaleInfo()
|
|
532
712
|
.pipe(map((localeInfo) => localeInfo.locale), distinctUntilChanged());
|
|
533
713
|
this.#columnDefs = computed(() => {
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
714
|
+
const catalog = this.#columnCatalog();
|
|
715
|
+
// Read untracked so that showing, hiding, or reordering columns does not
|
|
716
|
+
// rebuild the column definitions, which would reset flex columns the user
|
|
717
|
+
// resized. An effect applies those changes as runtime column state instead.
|
|
718
|
+
const displayedIds = untracked(this.displayedColumnIds);
|
|
719
|
+
const entriesById = new Map(catalog.map((entry) => [entry.id, entry]));
|
|
720
|
+
// Displayed columns first, in display order, followed by the hidden
|
|
721
|
+
// columns. Hidden columns keep their column definitions so AG Grid retains
|
|
722
|
+
// their state and they can be shown again without being recreated.
|
|
723
|
+
const displayedColDefs = displayedIds
|
|
724
|
+
.map((id) => entriesById.get(id))
|
|
725
|
+
.filter((entry) => !!entry)
|
|
726
|
+
.map(({ column, id }) => this.#createColDef(column, id, false));
|
|
727
|
+
const hiddenColDefs = catalog
|
|
728
|
+
.filter(({ id }) => !displayedIds.includes(id))
|
|
729
|
+
.map(({ column, id }) => this.#createColDef(column, id, true));
|
|
730
|
+
return [...displayedColDefs, ...hiddenColDefs];
|
|
538
731
|
}, /* @ts-ignore */
|
|
539
732
|
...(ngDevMode ? [{ debugName: "#columnDefs" }] : /* istanbul ignore next */ []));
|
|
540
733
|
this.#hasColumnDefs = computed(() => this.#columnDefs().length > 0, /* @ts-ignore */
|
|
541
734
|
...(ngDevMode ? [{ debugName: "#hasColumnDefs" }] : /* istanbul ignore next */ []));
|
|
735
|
+
/**
|
|
736
|
+
* The IDs of the columns that display, in a fixed order, so that moving a
|
|
737
|
+
* column does not change it.
|
|
738
|
+
*/
|
|
739
|
+
this.#displayedColumnIdSet = computed(() => arraySorted(this.displayedColumnIds()), { ...(ngDevMode ? { debugName: "#displayedColumnIdSet" } : /* istanbul ignore next */ {}), equal: arraysEqual });
|
|
740
|
+
/**
|
|
741
|
+
* The declared columns that have a usable ID, in declaration order. Columns
|
|
742
|
+
* missing both `columnId` and `field` are omitted; `SkyDataGridColumn`
|
|
743
|
+
* already warns about them. A repeated ID is suffixed the way AG Grid
|
|
744
|
+
* suffixes it (`name_1`), so that every column can be addressed.
|
|
745
|
+
*/
|
|
746
|
+
this.#columnCatalog = computed(() => {
|
|
747
|
+
const catalog = [];
|
|
748
|
+
for (const column of this.columns()) {
|
|
749
|
+
const declaredId = column.columnId() ?? column.field();
|
|
750
|
+
if (declaredId &&
|
|
751
|
+
column.initialized()) {
|
|
752
|
+
let id = declaredId;
|
|
753
|
+
for (let i = 1; catalog.some((entry) => entry.id === id); i++) {
|
|
754
|
+
id = `${declaredId}_${i}`;
|
|
755
|
+
}
|
|
756
|
+
catalog.push({ column, id });
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
return catalog;
|
|
760
|
+
}, /* @ts-ignore */
|
|
761
|
+
...(ngDevMode ? [{ debugName: "#columnCatalog" }] : /* istanbul ignore next */ []));
|
|
542
762
|
this.#gridDestroyed = toObservable(this.gridApi).pipe(filter(Boolean), switchMap((api) => fromGridEvent(api, 'gridPreDestroyed')));
|
|
543
763
|
this.#gridSelectedRowIds = toObservable(this.gridApi).pipe(filter(Boolean), switchMap((api) => fromGridEvent(api, 'selectionChanged').pipe(takeUntil(this.#gridDestroyed), map(() => arraySorted(this.#getRowIds(api.getSelectedNodes()))))));
|
|
544
764
|
this.#gridSortChange = toObservable(this.gridApi).pipe(filter(Boolean), switchMap((api) => fromGridEvent(api, 'sortChanged').pipe(takeUntil(this.#gridDestroyed), map((sortEvent) => {
|
|
@@ -602,7 +822,14 @@ class SkyDataGrid {
|
|
|
602
822
|
effect(() => {
|
|
603
823
|
const api = this.gridApi();
|
|
604
824
|
const columnDefs = this.#columnDefs();
|
|
605
|
-
api
|
|
825
|
+
if (api) {
|
|
826
|
+
api.setGridOption('columnDefs', columnDefs);
|
|
827
|
+
untracked(() => {
|
|
828
|
+
this.#rememberGridSizedWidths(api);
|
|
829
|
+
// New column definitions make columns users resized flex again.
|
|
830
|
+
this.#reapplyColumnWidths(api);
|
|
831
|
+
});
|
|
832
|
+
}
|
|
606
833
|
});
|
|
607
834
|
effect(() => {
|
|
608
835
|
const api = this.gridApi();
|
|
@@ -638,7 +865,10 @@ class SkyDataGrid {
|
|
|
638
865
|
const validRowIds = new Set(this.rowData().map((row) => row.id));
|
|
639
866
|
const selectedRowIds = coerceStringArray(this.selectedRowIds());
|
|
640
867
|
const validSelectedRowIds = selectedRowIds.filter((id) => validRowIds.has(id));
|
|
868
|
+
// A data manager integration keeps the IDs of rows its search or
|
|
869
|
+
// filters hide, so they are selected again when the rows return.
|
|
641
870
|
if (this.autoPage() &&
|
|
871
|
+
!this.#selectionPruningDisabled() &&
|
|
642
872
|
validSelectedRowIds.length !== selectedRowIds.length) {
|
|
643
873
|
this.selectedRowIds.set(validSelectedRowIds);
|
|
644
874
|
}
|
|
@@ -684,6 +914,32 @@ class SkyDataGrid {
|
|
|
684
914
|
defaultState: { sort: null },
|
|
685
915
|
});
|
|
686
916
|
});
|
|
917
|
+
// Apply changes to the displayed columns as runtime column state rather
|
|
918
|
+
// than through `columnDefs`, so showing, hiding, or reordering columns does
|
|
919
|
+
// not reset flex columns the user resized. Only a change to the displayed
|
|
920
|
+
// columns re-runs this, so a column order the user set by dragging a header
|
|
921
|
+
// is otherwise left alone.
|
|
922
|
+
effect(() => {
|
|
923
|
+
const displayedIds = this.displayedColumnIds();
|
|
924
|
+
const api = untracked(() => this.gridApi());
|
|
925
|
+
if (api) {
|
|
926
|
+
this.#applyDisplayedColumns(api, displayedIds);
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
// A grid that fits its columns to the container, and has no flex columns
|
|
930
|
+
// to take up the space, does not otherwise resize them when a column is
|
|
931
|
+
// hidden or shown. Moving a column leaves the displayed set alone, so it
|
|
932
|
+
// does not discard the widths a user set in a grid that is not tracking
|
|
933
|
+
// them.
|
|
934
|
+
effect(() => {
|
|
935
|
+
this.#displayedColumnIdSet();
|
|
936
|
+
const api = untracked(() => this.gridApi());
|
|
937
|
+
if (api &&
|
|
938
|
+
untracked(this.columnFit) === 'container' &&
|
|
939
|
+
!untracked(() => this.#hasFlexColumns())) {
|
|
940
|
+
this.#fitColumnsToContainer(api);
|
|
941
|
+
}
|
|
942
|
+
});
|
|
687
943
|
effect(() => {
|
|
688
944
|
const api = this.gridApi();
|
|
689
945
|
const page = this.page();
|
|
@@ -792,23 +1048,82 @@ class SkyDataGrid {
|
|
|
792
1048
|
return val;
|
|
793
1049
|
});
|
|
794
1050
|
});
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
1051
|
+
// Emit the grid's sort, including no sort once no column is sorted, so
|
|
1052
|
+
// the two-way bound model does not retain a stale value.
|
|
1053
|
+
this.#gridSortChange
|
|
1054
|
+
.pipe(takeUntilDestroyed())
|
|
1055
|
+
.subscribe((sortChange) => this.setSort(sortChange));
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Stops the grid from removing the IDs of rows that are not in `data` from
|
|
1059
|
+
* `selectedRowIds`. Called by data manager integrations through
|
|
1060
|
+
* `SkyDataSelectionSource` when they keep rows that a search or filter hides
|
|
1061
|
+
* selected.
|
|
1062
|
+
* @internal
|
|
1063
|
+
*/
|
|
1064
|
+
disableSelectionPruning() {
|
|
1065
|
+
this.#selectionPruningDisabled.set(true);
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Stops the grid from keeping the `viewkeeperClasses` elements visible
|
|
1069
|
+
* itself. Called by column picker integrations through `SkyDataColumnSource`
|
|
1070
|
+
* when a container keeps them visible instead.
|
|
1071
|
+
* @internal
|
|
1072
|
+
*/
|
|
1073
|
+
disableViewkeeper() {
|
|
1074
|
+
this.#viewkeeperDisabled.set(true);
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Sets the columns that display and their order. Called by column picker
|
|
1078
|
+
* integrations through `SkyDataColumnSource`.
|
|
1079
|
+
* @internal
|
|
1080
|
+
*/
|
|
1081
|
+
setDisplayedColumnIds(columnIds) {
|
|
1082
|
+
const selectedColumnIds = this.selectedColumnIds();
|
|
1083
|
+
if (!selectedColumnIds || !arraysEqual(selectedColumnIds, columnIds)) {
|
|
1084
|
+
this.selectedColumnIds.set([...columnIds]);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Sets the widths in pixels of columns, keyed by column ID, and starts
|
|
1089
|
+
* tracking the widths users give columns. Columns that are not included
|
|
1090
|
+
* return to the widths they are declared with or, when declared without
|
|
1091
|
+
* one, the widths the grid gave them. Called by data manager
|
|
1092
|
+
* integrations through `SkyDataColumnSource`.
|
|
1093
|
+
* @internal
|
|
1094
|
+
*/
|
|
1095
|
+
setColumnWidths(columnWidths) {
|
|
1096
|
+
const currentWidths = this.#columnWidths();
|
|
1097
|
+
if (currentWidths && columnWidthsEqual(currentWidths, columnWidths)) {
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
this.#columnWidths.set({ ...columnWidths });
|
|
1101
|
+
const api = untracked(this.gridApi);
|
|
1102
|
+
if (api) {
|
|
1103
|
+
this.#applyColumnWidths(api, columnWidths);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Sets the selected rows. Called by data manager integrations through
|
|
1108
|
+
* `SkyDataSelectionSource`.
|
|
1109
|
+
* @internal
|
|
1110
|
+
*/
|
|
1111
|
+
setSelectedRowIds(selectedRowIds) {
|
|
1112
|
+
if (!arraysEqual(coerceStringArray(this.selectedRowIds()), selectedRowIds)) {
|
|
1113
|
+
this.selectedRowIds.set([...selectedRowIds]);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Sets the sort the grid applies. Called by data manager integrations
|
|
1118
|
+
* through `SkyDataSortSource`.
|
|
1119
|
+
* @internal
|
|
1120
|
+
*/
|
|
1121
|
+
setSort(sort) {
|
|
1122
|
+
const currentSort = this.sort();
|
|
1123
|
+
if (currentSort?.field !== sort?.field ||
|
|
1124
|
+
currentSort?.direction !== sort?.direction) {
|
|
1125
|
+
this.sort.set(sort);
|
|
1126
|
+
}
|
|
812
1127
|
}
|
|
813
1128
|
currentPageChange(page) {
|
|
814
1129
|
if (page && page !== this.page()) {
|
|
@@ -843,15 +1158,15 @@ class SkyDataGrid {
|
|
|
843
1158
|
queryParamsHandling: 'merge',
|
|
844
1159
|
});
|
|
845
1160
|
}
|
|
846
|
-
#createColDef(col) {
|
|
1161
|
+
#createColDef(col, colId, hide) {
|
|
847
1162
|
const field = col.field();
|
|
848
1163
|
const colDef = {
|
|
849
|
-
colId
|
|
1164
|
+
colId,
|
|
850
1165
|
field,
|
|
851
1166
|
headerName: col.headingText(),
|
|
852
1167
|
headerComponentParams: this.#getHeaderComponentParams(col),
|
|
853
|
-
hide
|
|
854
|
-
initialHide:
|
|
1168
|
+
hide,
|
|
1169
|
+
initialHide: hide,
|
|
855
1170
|
resizable: col.resizable(),
|
|
856
1171
|
sortable: col.sortable(),
|
|
857
1172
|
lockPosition: col.locked(),
|
|
@@ -920,6 +1235,121 @@ class SkyDataGrid {
|
|
|
920
1235
|
inlineHelpComponent: SkyDataGridColumnInlineHelp,
|
|
921
1236
|
};
|
|
922
1237
|
}
|
|
1238
|
+
#applyDisplayedColumns(api, displayedIds) {
|
|
1239
|
+
const hiddenIds = untracked(this.#columnCatalog)
|
|
1240
|
+
.map(({ id }) => id)
|
|
1241
|
+
.filter((id) => !displayedIds.includes(id));
|
|
1242
|
+
api.applyColumnState({
|
|
1243
|
+
state: [
|
|
1244
|
+
// AG Grid moves columns missing from the state to the end, which
|
|
1245
|
+
// would put the multiselect column after any locked columns.
|
|
1246
|
+
{ colId: SELECTION_COLUMN_ID },
|
|
1247
|
+
...displayedIds.map((colId) => ({ colId, hide: false })),
|
|
1248
|
+
...hiddenIds.map((colId) => ({ colId, hide: true })),
|
|
1249
|
+
],
|
|
1250
|
+
applyOrder: true,
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
#syncColumnOrderFromGrid(api) {
|
|
1254
|
+
// Column moves are tracked only once `selectedColumnIds` is set, so a grid
|
|
1255
|
+
// without it keeps following each column's `columnHidden` setting. Applying
|
|
1256
|
+
// a column layout moves columns too, so compare against what the grid
|
|
1257
|
+
// should display; only a move the user made differs.
|
|
1258
|
+
const selectedColumnIds = this.selectedColumnIds();
|
|
1259
|
+
if (!selectedColumnIds) {
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
const displayedColumnIds = api
|
|
1263
|
+
.getColumnState()
|
|
1264
|
+
.filter((state) => !state.hide && state.colId !== SELECTION_COLUMN_ID)
|
|
1265
|
+
.map((state) => state.colId);
|
|
1266
|
+
if (!arraysEqual(this.displayedColumnIds(), displayedColumnIds)) {
|
|
1267
|
+
// Keep the IDs of columns that are not declared, such as a column
|
|
1268
|
+
// rendered conditionally, so they display once the column is declared.
|
|
1269
|
+
const declaredIds = this.#columnCatalog().map(({ id }) => id);
|
|
1270
|
+
this.selectedColumnIds.set([
|
|
1271
|
+
...displayedColumnIds,
|
|
1272
|
+
...selectedColumnIds.filter((id) => !declaredIds.includes(id)),
|
|
1273
|
+
]);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Applies the column widths, and returns columns without one to the widths
|
|
1278
|
+
* they are declared with.
|
|
1279
|
+
*/
|
|
1280
|
+
#applyColumnWidths(api, columnWidths) {
|
|
1281
|
+
api.applyColumnState({
|
|
1282
|
+
state: untracked(this.#columnDefs).map(({ colId, flex, initialWidth }) => {
|
|
1283
|
+
const width = columnWidths[colId];
|
|
1284
|
+
// A width stops a column flexing, as a user resizing it does.
|
|
1285
|
+
return width === undefined
|
|
1286
|
+
? {
|
|
1287
|
+
colId: colId,
|
|
1288
|
+
flex: flex || null,
|
|
1289
|
+
width: initialWidth ?? this.#gridSizedWidths.get(colId),
|
|
1290
|
+
}
|
|
1291
|
+
: { colId: colId, flex: null, width };
|
|
1292
|
+
}),
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Remembers the widths of columns that have neither a flex nor a width, so
|
|
1297
|
+
* they can return to them. AG Grid ignores a column state without a width,
|
|
1298
|
+
* so it leaves a column at the width a user gave it.
|
|
1299
|
+
*/
|
|
1300
|
+
#rememberGridSizedWidths(api) {
|
|
1301
|
+
const gridSizedColumnIds = untracked(this.#columnDefs)
|
|
1302
|
+
.filter(({ flex, initialWidth }) => !flex && initialWidth === undefined)
|
|
1303
|
+
.map(({ colId }) => colId);
|
|
1304
|
+
for (const column of api.getAllGridColumns()) {
|
|
1305
|
+
const colId = column.getColId();
|
|
1306
|
+
if (gridSizedColumnIds.includes(colId) &&
|
|
1307
|
+
!this.#gridSizedWidths.has(colId)) {
|
|
1308
|
+
this.#gridSizedWidths.set(colId, column.getActualWidth());
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Fits the columns to the container, the way the grid does when it
|
|
1314
|
+
* initializes: the columns the grid does not size to their content, such as
|
|
1315
|
+
* those with a declared width and the multiselect column, and the columns
|
|
1316
|
+
* with a width a data manager integration tracks, keep their widths.
|
|
1317
|
+
*/
|
|
1318
|
+
#fitColumnsToContainer(api) {
|
|
1319
|
+
const columnWidths = untracked(this.columnWidths);
|
|
1320
|
+
api.sizeColumnsToFit({
|
|
1321
|
+
columnLimits: api
|
|
1322
|
+
.getAllDisplayedColumns()
|
|
1323
|
+
.filter((column) => column.getColDef().suppressAutoSize ||
|
|
1324
|
+
columnWidths[column.getColId()] !== undefined)
|
|
1325
|
+
.map((column) => ({
|
|
1326
|
+
key: column.getColId(),
|
|
1327
|
+
minWidth: column.getActualWidth(),
|
|
1328
|
+
maxWidth: column.getActualWidth(),
|
|
1329
|
+
})),
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
#reapplyColumnWidths(api) {
|
|
1333
|
+
const columnWidths = this.#columnWidths();
|
|
1334
|
+
if (columnWidths && Object.keys(columnWidths).length > 0) {
|
|
1335
|
+
this.#applyColumnWidths(api, columnWidths);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
#syncColumnWidthsFromGrid(columns) {
|
|
1339
|
+
const columnWidths = this.#columnWidths();
|
|
1340
|
+
if (!columnWidths) {
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
// A column a user resizes stops flexing. The flex columns that only filled
|
|
1344
|
+
// the space it left keep flexing, so their widths are not the user's.
|
|
1345
|
+
const updatedWidths = { ...columnWidths };
|
|
1346
|
+
for (const column of columns.filter((col) => !col.getFlex())) {
|
|
1347
|
+
updatedWidths[column.getColId()] = column.getActualWidth();
|
|
1348
|
+
}
|
|
1349
|
+
if (!columnWidthsEqual(columnWidths, updatedWidths)) {
|
|
1350
|
+
this.#columnWidths.set(updatedWidths);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
923
1353
|
#getRowIds(rows) {
|
|
924
1354
|
return coerceArray(rows)
|
|
925
1355
|
.map((node) => node?.id)
|
|
@@ -939,10 +1369,14 @@ class SkyDataGrid {
|
|
|
939
1369
|
scaleUpToFitGridWidth: this.columnFit() === 'container',
|
|
940
1370
|
};
|
|
941
1371
|
}
|
|
942
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
943
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: SkyDataGrid, isStandalone: true, selector: "sky-data-grid", inputs: { autoSort: { classPropertyName: "autoSort", publicName: "autoSort", isSignal: true, isRequired: false, transformFunction: null }, autoPage: { classPropertyName: "autoPage", publicName: "autoPage", isSignal: true, isRequired: false, transformFunction: null }, columnFit: { classPropertyName: "columnFit", publicName: "columnFit", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labelText: { classPropertyName: "labelText", publicName: "labelText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageQueryParam: { classPropertyName: "pageQueryParam", publicName: "pageQueryParam", isSignal: true, isRequired: false, transformFunction: null }, rowCount: { classPropertyName: "rowCount", publicName: "rowCount", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, topScrollEnabled: { classPropertyName: "topScrollEnabled", publicName: "topScrollEnabled", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, selectedRowIds: { classPropertyName: "selectedRowIds", publicName: "selectedRowIds", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", selectedRowIds: "selectedRowIdsChange", sort: "sortChange" }, host: { properties: { "class.sky-margin-stacked-lg": "stacked()" } }, queries: [{ propertyName: "columns", predicate: SkyDataGridColumn, isSignal: true }], ngImport: i0, template: "<sky-wait [isWaiting]=\"!gridReady()\" />\n@if (gridOptions(); as gridOptions) {\n <sky-ag-grid-wrapper [compact]=\"compact()\" [minHeight]=\"minHeight()\">\n <ag-grid-angular\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n [skyViewkeeper]=\"skyViewkeeper()\"\n [gridOptions]=\"gridOptions\"\n />\n </sky-ag-grid-wrapper>\n\n @if (pageCount() && pageSize(); as pageSize) {\n <sky-paging\n [currentPage]=\"page()\"\n [itemCount]=\"pageItemsCount()\"\n [pageSize]=\"pageSize\"\n (currentPageChange)=\"currentPageChange($event)\"\n />\n }\n}\n", styles: [":host{display:block;max-width:100%}\n"], dependencies: [{ kind: "component", type: AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "toolbar", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipSwitchShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipShowMode", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "calculatedColumns", "columnHeaderEdit", "maintainColumnOrder", "enableStrictPivotColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "hidePaddedHeaderRows", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressMoveWhenColumnDragging", "suppressDragLeaveHidesColumns", "suppressGroupChangesColumnVisibility", "suppressMakeColumnVisibleAfterUnGroup", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "animateColumnResizing", "components", "editType", "suppressStartEditOnTab", "getFullRowEditValidationErrors", "invalidEditValueMode", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "findSearchValue", "findOptions", "quickFilterText", "cacheQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "applyQuickFilterBeforePivotOrAgg", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "alwaysPassFilter", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "advancedFilterParams", "suppressAdvancedFilterEval", "suppressSetFilterByDefault", "enableFilterHandlers", "filterHandlers", "enableCharts", "includeHiddenColumnsInCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "chartToolPanelsDef", "chartMenuItems", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressTouch", "suppressFocusAfterRefresh", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "loading", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "suppressOverlays", "overlayComponent", "overlayComponentParams", "overlayComponentSelector", "activeOverlay", "activeOverlayParams", "processFileInput", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "paginationPanels", "pivotMode", "pivotPanelShow", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "formulaDataSource", "notesDataSource", "noteTrigger", "noteShowDelay", "noteHideDelay", "formulaFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "cellFlashDuration", "cellFadeDuration", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableCellSpan", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "refreshAfterGroupEdit", "rowDragInsertDelay", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "dragAndDropImageComponent", "dragAndDropImageComponentParams", "fullWidthCellRenderer", "fullWidthCellRendererParams", "embedFullWidthRows", "groupDisplayType", "groupDefaultExpanded", "masterDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupLockGroupColumns", "groupAggFiltering", "groupTotalRow", "grandTotalRow", "suppressStickyTotalRow", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "groupHideColumnsUntilExpanded", "groupAllowUnbalanced", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererParams", "treeData", "treeDataChildrenField", "treeDataParentIdField", "rowGroupPanelSuppressSort", "pivotPanelSuppressSort", "suppressGroupRowsSticky", "groupHierarchyConfig", "pinnedTopRowData", "pinnedBottomRowData", "enableRowPinning", "isRowPinnable", "isRowPinned", "rowModelType", "rowData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "suppressServerSideFullWidthLoadingRow", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "cellSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "selectionColumnDef", "rowNumbers", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "suppressContentVisibilityAuto", "enableContentVisibilityAuto", "contentVisibilityAutoDelay", "columnHoverHighlight", "gridId", "deltaSort", "treeDataDisplayType", "enableGroupEdit", "initialState", "theme", "loadThemeGoogleFonts", "themeCssLayer", "styleNonce", "themeStyleContainer", "getContextMenuItems", "getMainMenuItems", "getColumnMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "focusGridInnerElement", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "tabToNextGridContainer", "getLocaleText", "getDocument", "paginationNumberFormatter", "getGroupRowAgg", "isGroupOpenByDefault", "isMasterOpenByDefault", "ssrmExpandAllAffectsAllRows", "initialGroupOrderComparator", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "getChildCount", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowId", "resetRowDataOnUpdate", "autoGenerateColumnDefs", "processAutoGeneratedColumnDefs", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthRow", "isRowValidDropPosition"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "columnMenuVisibleChanged", "contextMenuVisibleChanged", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "calculatedColumnCreated", "calculatedColumnExpressionChanged", "calculatedColumnRemoved", "calculatedColumnValidationStateChanged", "columnVisible", "columnPinned", "columnHeaderNameChanged", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "columnsReset", "columnHeaderMouseOver", "columnHeaderMouseLeave", "columnHeaderClicked", "columnHeaderContextMenu", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "bulkEditingStarted", "bulkEditingStopped", "batchEditingStarted", "batchEditingStopped", "undoStarted", "undoEnded", "redoStarted", "redoEnded", "cellSelectionDeleteStart", "cellSelectionDeleteEnd", "rangeDeleteStart", "rangeDeleteEnd", "fillStart", "fillEnd", "filterOpened", "filterChanged", "filterModified", "filterUiChanged", "floatingFilterUiChanged", "advancedFilterBuilderVisibleChanged", "findChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "dragCancelled", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "rowDragCancel", "rowResizeStarted", "rowResizeEnded", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pivotMaxColumnsExceeded", "pinnedRowDataChanged", "pinnedRowsChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "headerFocused", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "cellSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged"] }, { kind: "ngmodule", type: SkyAgGridModule }, { kind: "component", type: i1$1.λ12, selector: "sky-ag-grid-wrapper", inputs: ["compact", "minHeight"] }, { kind: "ngmodule", type: SkyPagingModule }, { kind: "component", type: i2.λ7, selector: "sky-paging", inputs: ["currentPage", "itemCount", "maxPages", "pageSize", "pagingLabel"], outputs: ["currentPageChange", "contentChange"] }, { kind: "ngmodule", type: SkyViewkeeperModule }, { kind: "directive", type: i3.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper", "skyViewkeeperOmitShadow"] }, { kind: "ngmodule", type: SkyWaitModule }, { kind: "component", type: i4.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking", "screenReaderCompletedText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1372
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: SkyDataGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1373
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.3", type: SkyDataGrid, isStandalone: true, selector: "sky-data-grid", inputs: { autoSort: { classPropertyName: "autoSort", publicName: "autoSort", isSignal: true, isRequired: false, transformFunction: null }, autoPage: { classPropertyName: "autoPage", publicName: "autoPage", isSignal: true, isRequired: false, transformFunction: null }, columnFit: { classPropertyName: "columnFit", publicName: "columnFit", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labelText: { classPropertyName: "labelText", publicName: "labelText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageQueryParam: { classPropertyName: "pageQueryParam", publicName: "pageQueryParam", isSignal: true, isRequired: false, transformFunction: null }, rowCount: { classPropertyName: "rowCount", publicName: "rowCount", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, topScrollEnabled: { classPropertyName: "topScrollEnabled", publicName: "topScrollEnabled", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, rowDeleteIds: { classPropertyName: "rowDeleteIds", publicName: "rowDeleteIds", isSignal: true, isRequired: false, transformFunction: null }, selectedRowIds: { classPropertyName: "selectedRowIds", publicName: "selectedRowIds", isSignal: true, isRequired: false, transformFunction: null }, selectedColumnIds: { classPropertyName: "selectedColumnIds", publicName: "selectedColumnIds", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", rowDeleteIds: "rowDeleteIdsChange", rowDeleteCancel: "rowDeleteCancel", rowDeleteConfirm: "rowDeleteConfirm", selectedRowIds: "selectedRowIdsChange", selectedColumnIds: "selectedColumnIdsChange", sort: "sortChange" }, host: { properties: { "class.sky-margin-stacked-lg": "stacked()" } }, providers: [
|
|
1374
|
+
{ provide: SkyDataColumnSource, useExisting: SkyDataGrid },
|
|
1375
|
+
{ provide: SkyDataSelectionSource, useExisting: SkyDataGrid },
|
|
1376
|
+
{ provide: SkyDataSortSource, useExisting: SkyDataGrid },
|
|
1377
|
+
], queries: [{ propertyName: "columns", predicate: SkyDataGridColumn, isSignal: true }], ngImport: i0, template: "<sky-wait [isWaiting]=\"!gridReady()\" />\n@if (gridOptions(); as gridOptions) {\n <sky-ag-grid-wrapper\n skyAgGridRowDelete\n viewkeeperDisabled\n [compact]=\"compact()\"\n [minHeight]=\"minHeight()\"\n [(rowDeleteIds)]=\"rowDeleteIds\"\n (rowDeleteCancel)=\"rowDeleteCancel.emit($event)\"\n (rowDeleteConfirm)=\"rowDeleteConfirm.emit($event)\"\n >\n <ag-grid-angular\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n [skyViewkeeper]=\"skyViewkeeper()\"\n [gridOptions]=\"gridOptions\"\n />\n </sky-ag-grid-wrapper>\n\n @if (pageCount() && pageSize(); as pageSize) {\n <sky-paging\n [currentPage]=\"page()\"\n [itemCount]=\"pageItemsCount()\"\n [pageSize]=\"pageSize\"\n (currentPageChange)=\"currentPageChange($event)\"\n />\n }\n}\n", styles: [":host{display:block;max-width:100%}\n"], dependencies: [{ kind: "component", type: AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "toolbar", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "columnMenu", "suppressMenuHide", "enableBrowserTooltips", "tooltipTrigger", "tooltipShowDelay", "tooltipSwitchShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "tooltipShowMode", "tooltipInteraction", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "suppressCutToClipboard", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "dataTypeDefinitions", "calculatedColumns", "columnHeaderEdit", "maintainColumnOrder", "enableStrictPivotColumnOrder", "suppressFieldDotNotation", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "hidePaddedHeaderRows", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressMoveWhenColumnDragging", "suppressDragLeaveHidesColumns", "suppressGroupChangesColumnVisibility", "suppressMakeColumnVisibleAfterUnGroup", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "autoSizeStrategy", "animateColumnResizing", "components", "editType", "suppressStartEditOnTab", "getFullRowEditValidationErrors", "invalidEditValueMode", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterNavigatesVertically", "enterNavigatesVerticallyAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "findSearchValue", "findOptions", "quickFilterText", "cacheQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "applyQuickFilterBeforePivotOrAgg", "excludeChildrenWhenTreeDataFiltering", "enableAdvancedFilter", "alwaysPassFilter", "includeHiddenColumnsInAdvancedFilter", "advancedFilterParent", "advancedFilterBuilderParams", "advancedFilterParams", "suppressAdvancedFilterEval", "suppressSetFilterByDefault", "enableFilterHandlers", "filterHandlers", "enableCharts", "includeHiddenColumnsInCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "chartToolPanelsDef", "chartMenuItems", "loadingCellRenderer", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressTouch", "suppressFocusAfterRefresh", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "loading", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "suppressOverlays", "overlayComponent", "overlayComponentParams", "overlayComponentSelector", "activeOverlay", "activeOverlayParams", "processFileInput", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "paginationPanels", "pivotMode", "pivotPanelShow", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "formulaDataSource", "notesDataSource", "noteTrigger", "noteShowDelay", "noteHideDelay", "formulaFuncs", "suppressAggFuncInHeader", "alwaysAggregateAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "cellFlashDuration", "cellFadeDuration", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableCellSpan", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "refreshAfterGroupEdit", "rowDragInsertDelay", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "dragAndDropImageComponent", "dragAndDropImageComponentParams", "fullWidthCellRenderer", "fullWidthCellRendererParams", "embedFullWidthRows", "groupDisplayType", "groupDefaultExpanded", "masterDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupLockGroupColumns", "groupAggFiltering", "groupTotalRow", "grandTotalRow", "suppressStickyTotalRow", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "groupHideColumnsUntilExpanded", "groupAllowUnbalanced", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererParams", "treeData", "treeDataChildrenField", "treeDataParentIdField", "rowGroupPanelSuppressSort", "pivotPanelSuppressSort", "suppressGroupRowsSticky", "groupHierarchyConfig", "pinnedTopRowData", "pinnedBottomRowData", "enableRowPinning", "isRowPinnable", "isRowPinned", "rowModelType", "rowData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "suppressServerSideFullWidthLoadingRow", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "serverSidePivotResultFieldSeparator", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "cellSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "selectionColumnDef", "rowNumbers", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "suppressContentVisibilityAuto", "enableContentVisibilityAuto", "contentVisibilityAutoDelay", "columnHoverHighlight", "gridId", "deltaSort", "treeDataDisplayType", "enableGroupEdit", "initialState", "theme", "loadThemeGoogleFonts", "themeCssLayer", "styleNonce", "themeStyleContainer", "getContextMenuItems", "getMainMenuItems", "getColumnMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "focusGridInnerElement", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "tabToNextGridContainer", "getLocaleText", "getDocument", "paginationNumberFormatter", "getGroupRowAgg", "isGroupOpenByDefault", "isMasterOpenByDefault", "ssrmExpandAllAffectsAllRows", "initialGroupOrderComparator", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "getChildCount", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowId", "resetRowDataOnUpdate", "autoGenerateColumnDefs", "processAutoGeneratedColumnDefs", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthRow", "isRowValidDropPosition"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "columnMenuVisibleChanged", "contextMenuVisibleChanged", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "calculatedColumnCreated", "calculatedColumnExpressionChanged", "calculatedColumnRemoved", "calculatedColumnValidationStateChanged", "columnVisible", "columnPinned", "columnHeaderNameChanged", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "columnsReset", "columnHeaderMouseOver", "columnHeaderMouseLeave", "columnHeaderClicked", "columnHeaderContextMenu", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "bulkEditingStarted", "bulkEditingStopped", "batchEditingStarted", "batchEditingStopped", "undoStarted", "undoEnded", "redoStarted", "redoEnded", "cellSelectionDeleteStart", "cellSelectionDeleteEnd", "rangeDeleteStart", "rangeDeleteEnd", "fillStart", "fillEnd", "filterOpened", "filterChanged", "filterModified", "filterUiChanged", "floatingFilterUiChanged", "advancedFilterBuilderVisibleChanged", "findChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "dragCancelled", "stateUpdated", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "rowDragCancel", "rowResizeStarted", "rowResizeEnded", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pivotMaxColumnsExceeded", "pinnedRowDataChanged", "pinnedRowsChanged", "rowDataUpdated", "asyncTransactionsFlushed", "storeRefreshed", "headerFocused", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "cellSelectionChanged", "tooltipShow", "tooltipHide", "sortChanged"] }, { kind: "ngmodule", type: SkyAgGridModule }, { kind: "directive", type: i1$1.λ13, selector: "[skyAgGridRowDelete]", inputs: ["rowDeleteIds"], outputs: ["rowDeleteIdsChange", "rowDeleteCancel", "rowDeleteConfirm"] }, { kind: "component", type: i1$1.λ12, selector: "sky-ag-grid-wrapper", inputs: ["compact", "minHeight", "viewkeeperDisabled"] }, { kind: "ngmodule", type: SkyPagingModule }, { kind: "component", type: i2.λ7, selector: "sky-paging", inputs: ["currentPage", "itemCount", "maxPages", "pageSize", "pagingLabel"], outputs: ["currentPageChange", "contentChange"] }, { kind: "ngmodule", type: SkyViewkeeperModule }, { kind: "directive", type: i3.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper", "skyViewkeeperOmitShadow"] }, { kind: "ngmodule", type: SkyWaitModule }, { kind: "component", type: i4.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking", "screenReaderCompletedText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
944
1378
|
}
|
|
945
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
1379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: SkyDataGrid, decorators: [{
|
|
946
1380
|
type: Component,
|
|
947
1381
|
args: [{ selector: 'sky-data-grid', imports: [
|
|
948
1382
|
AgGridAngular,
|
|
@@ -952,8 +1386,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
|
|
|
952
1386
|
SkyWaitModule,
|
|
953
1387
|
], host: {
|
|
954
1388
|
'[class.sky-margin-stacked-lg]': 'stacked()',
|
|
955
|
-
},
|
|
956
|
-
|
|
1389
|
+
}, providers: [
|
|
1390
|
+
{ provide: SkyDataColumnSource, useExisting: SkyDataGrid },
|
|
1391
|
+
{ provide: SkyDataSelectionSource, useExisting: SkyDataGrid },
|
|
1392
|
+
{ provide: SkyDataSortSource, useExisting: SkyDataGrid },
|
|
1393
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-wait [isWaiting]=\"!gridReady()\" />\n@if (gridOptions(); as gridOptions) {\n <sky-ag-grid-wrapper\n skyAgGridRowDelete\n viewkeeperDisabled\n [compact]=\"compact()\"\n [minHeight]=\"minHeight()\"\n [(rowDeleteIds)]=\"rowDeleteIds\"\n (rowDeleteCancel)=\"rowDeleteCancel.emit($event)\"\n (rowDeleteConfirm)=\"rowDeleteConfirm.emit($event)\"\n >\n <ag-grid-angular\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n [skyViewkeeper]=\"skyViewkeeper()\"\n [gridOptions]=\"gridOptions\"\n />\n </sky-ag-grid-wrapper>\n\n @if (pageCount() && pageSize(); as pageSize) {\n <sky-paging\n [currentPage]=\"page()\"\n [itemCount]=\"pageItemsCount()\"\n [pageSize]=\"pageSize\"\n (currentPageChange)=\"currentPageChange($event)\"\n />\n }\n}\n", styles: [":host{display:block;max-width:100%}\n"] }]
|
|
1394
|
+
}], ctorParameters: () => [], propDecorators: { autoSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoSort", required: false }] }], autoPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoPage", required: false }] }], columnFit: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFit", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelText", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], multiselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiselect", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageQueryParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageQueryParam", required: false }] }], rowCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowCount", required: false }] }], stacked: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacked", required: false }] }], topScrollEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "topScrollEnabled", required: false }] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], rowDeleteIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDeleteIds", required: false }] }, { type: i0.Output, args: ["rowDeleteIdsChange"] }], rowDeleteCancel: [{ type: i0.Output, args: ["rowDeleteCancel"] }], rowDeleteConfirm: [{ type: i0.Output, args: ["rowDeleteConfirm"] }], selectedRowIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedRowIds", required: false }] }, { type: i0.Output, args: ["selectedRowIdsChange"] }], selectedColumnIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedColumnIds", required: false }] }, { type: i0.Output, args: ["selectedColumnIdsChange"] }], sort: [{ type: i0.Input, args: [{ isSignal: true, alias: "sort", required: false }] }, { type: i0.Output, args: ["sortChange"] }], columns: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SkyDataGridColumn), { isSignal: true }] }] } });
|
|
957
1395
|
|
|
958
1396
|
/**
|
|
959
1397
|
* Generated bundle index. Do not edit.
|