@skyux/data-grid 0.0.1-alpha.0 → 14.5.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.
@@ -0,0 +1,833 @@
1
+ import { coerceBooleanProperty, coerceNumberProperty, coerceStringArray, coerceArray } from '@angular/cdk/coercion';
2
+ import * as i0 from '@angular/core';
3
+ import { input, booleanAttribute, numberAttribute, contentChild, TemplateRef, computed, inject, afterRenderEffect, ChangeDetectionStrategy, Component, model, contentChildren, signal, untracked, linkedSignal, effect } from '@angular/core';
4
+ import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { ActivatedRoute, Router } from '@angular/router';
6
+ import * as i1$1 from '@skyux/ag-grid';
7
+ import { SkyAgGridHeaderInfo, SkyAgGridService, SkyCellType, SkyAgGridModule } from '@skyux/ag-grid';
8
+ import * as i3 from '@skyux/core';
9
+ import { SkyLogService, SkyViewkeeperModule } from '@skyux/core';
10
+ import * as i4 from '@skyux/indicators';
11
+ import { SkyWaitModule } from '@skyux/indicators';
12
+ import * as i2 from '@skyux/lists';
13
+ import { SkyPagingModule } from '@skyux/lists';
14
+ import { AgGridAngular } from 'ag-grid-angular';
15
+ import { ModuleRegistry, CellStyleModule, ClientSideRowModelApiModule, ClientSideRowModelModule, ColumnApiModule, ColumnAutoSizeModule, EventApiModule, GridStateModule, PaginationModule, RenderApiModule, RowApiModule, RowAutoHeightModule, RowSelectionModule, RowStyleModule, ValidationModule } from 'ag-grid-community';
16
+ import { Observable, filter, switchMap, takeUntil, map, startWith } from 'rxjs';
17
+ import * as i1 from '@skyux/help-inline';
18
+ import { SkyHelpInlineModule } from '@skyux/help-inline';
19
+
20
+ /**
21
+ * Defines a single column in a `SkyDataGrid`. Add one `sky-data-grid-column` for each
22
+ * column to render.
23
+ * @preview
24
+ */
25
+ class SkyDataGridColumn {
26
+ constructor() {
27
+ /**
28
+ * Whether the column is hidden.
29
+ * @default false
30
+ */
31
+ this.columnHidden = input(false, { ...(ngDevMode ? { debugName: "columnHidden" } : {}), transform: booleanAttribute });
32
+ /**
33
+ * The unique ID for the column. You must provide either the `columnId` or `field` property
34
+ * for every column, but do not provide both. Use `columnId` when the column does not map directly to a field
35
+ * in the data set.
36
+ */
37
+ this.columnId = input(...(ngDevMode ? [undefined, { debugName: "columnId" }] : []));
38
+ /**
39
+ * The data type of the column used for sorting and rendering when a template is not provided.
40
+ * @default 'text'
41
+ */
42
+ this.dataType = input('text', ...(ngDevMode ? [{ debugName: "dataType" }] : []));
43
+ /**
44
+ * The property to retrieve cell information from an entry on the grid `data` array.
45
+ * You must provide either the `columnId` or `field` property for every column,
46
+ * but do not provide both. When a column maps directly to a property on the data,
47
+ * use `field`; the column's ID defaults to the `field` value.
48
+ */
49
+ this.field = input(...(ngDevMode ? [undefined, { debugName: "field" }] : []));
50
+ /**
51
+ * When set, `flexWidth` takes precedence over `width` for sizing and works like
52
+ * [CSS flex-grow](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow), where a column
53
+ * with `flexWidth="2"` is twice the width of a column with `flexWidth="1"`, and `flexWidth="0"` does not auto-expand.
54
+ * If `width` is also set, it acts as the column's minimum width.
55
+ */
56
+ this.flexWidth = input(undefined, { ...(ngDevMode ? { debugName: "flexWidth" } : {}), transform: (value) => numberAttribute(value, undefined) });
57
+ /**
58
+ * Text to display in the column header.
59
+ * @required
60
+ */
61
+ this.headingText = input.required(...(ngDevMode ? [{ debugName: "headingText" }] : []));
62
+ /**
63
+ * Whether to visually hide `headingText` while keeping it available to
64
+ * assistive technologies. The header cell still renders, so its sorting and
65
+ * resizing controls remain available.
66
+ * @default false
67
+ */
68
+ this.headingHidden = input(false, { ...(ngDevMode ? { debugName: "headingHidden" } : {}), transform: booleanAttribute });
69
+ /**
70
+ * The title of the help popover. This property only applies when `helpPopoverContent` is
71
+ * also specified.
72
+ */
73
+ this.helpPopoverTitle = input(...(ngDevMode ? [undefined, { debugName: "helpPopoverTitle" }] : []));
74
+ /**
75
+ * The content of the help popover. When specified, a [help inline](https://developer.blackbaud.com/skyux/components/help-inline)
76
+ * button is added to the column header. The help inline button displays a [popover](https://developer.blackbaud.com/skyux/components/popover)
77
+ * when clicked using the specified content and optional title.
78
+ */
79
+ this.helpPopoverContent = input(...(ngDevMode ? [undefined, { debugName: "helpPopoverContent" }] : []));
80
+ /**
81
+ * Whether the column is locked. The intent is to display locked columns first
82
+ * on the left side of the grid. If set to `true`, then users cannot drag the column
83
+ * to another position or drag other columns before it.
84
+ * @default false
85
+ */
86
+ this.locked = input(false, { ...(ngDevMode ? { debugName: "locked" } : {}), transform: booleanAttribute });
87
+ /**
88
+ * Whether the column can be resized by dragging the column header border.
89
+ * @default true
90
+ */
91
+ this.resizable = input(true, { ...(ngDevMode ? { debugName: "resizable" } : {}), transform: booleanAttribute });
92
+ /**
93
+ * Whether the column sorts the grid when users click the column header.
94
+ * @default true
95
+ */
96
+ this.sortable = input(true, { ...(ngDevMode ? { debugName: "sortable" } : {}), transform: booleanAttribute });
97
+ /**
98
+ * The template for a column. This can be assigned as a reference
99
+ * to the `template` input, or it can be assigned as an `<ng-template>` child
100
+ * of the `sky-data-grid-column` component. The template has access to the `value` variable,
101
+ * which contains the value passed to the column, and the `row` variable, which contains
102
+ * the entire row data.
103
+ */
104
+ this.template = input(...(ngDevMode ? [undefined, { debugName: "template" }] : []));
105
+ /**
106
+ * The width of the column in pixels. Used as the column's initial width; the
107
+ * column can still be resized and is included when columns are sized to fit
108
+ * the grid's width. When `flexWidth` is also set, `width` instead acts as the
109
+ * column's minimum width. When no width is set, the column width is evenly distributed.
110
+ */
111
+ this.width = input(undefined, { ...(ngDevMode ? { debugName: "width" } : {}), transform: (value) => numberAttribute(value, undefined) });
112
+ /**
113
+ * Whether text in this column should wrap to multiple lines.
114
+ * @default false
115
+ */
116
+ this.wrapText = input(false, { ...(ngDevMode ? { debugName: "wrapText" } : {}), transform: booleanAttribute });
117
+ this.templateChild = contentChild(TemplateRef, ...(ngDevMode ? [{ debugName: "templateChild" }] : []));
118
+ /**
119
+ * @internal
120
+ */
121
+ this.cellTemplate = computed(() => {
122
+ const template = this.template();
123
+ const templateChild = this.templateChild();
124
+ return template || templateChild;
125
+ }, ...(ngDevMode ? [{ debugName: "cellTemplate" }] : []));
126
+ const logger = inject(SkyLogService);
127
+ afterRenderEffect(() => {
128
+ const columnId = this.columnId();
129
+ const field = this.field();
130
+ if (columnId && field) {
131
+ logger.warn(`A <sky-data-grid-column> should have either a columnId or a field, but not both.`);
132
+ }
133
+ if (!columnId && !field) {
134
+ logger.warn(`A <sky-data-grid-column> must have a columnId or a field.`);
135
+ }
136
+ });
137
+ }
138
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SkyDataGridColumn, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
139
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", 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 }, 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 }, 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 }); }
140
+ }
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SkyDataGridColumn, decorators: [{
142
+ type: Component,
143
+ args: [{
144
+ selector: 'sky-data-grid-column',
145
+ template: '',
146
+ changeDetection: ChangeDetectionStrategy.OnPush,
147
+ }]
148
+ }], 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 }] }], 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 }] }] } });
149
+
150
+ /**
151
+ * @internal
152
+ */
153
+ class SkyDataGridColumnInlineHelp {
154
+ constructor() {
155
+ this.info = inject(SkyAgGridHeaderInfo);
156
+ this.showHelpInline = computed(() => !!this.helpPopoverContent(), ...(ngDevMode ? [{ debugName: "showHelpInline" }] : []));
157
+ this.helpPopoverTitle = computed(() => this.#headerComponentParams()?.helpPopoverTitle, ...(ngDevMode ? [{ debugName: "helpPopoverTitle" }] : []));
158
+ this.helpPopoverContent = computed(() => this.#headerComponentParams()?.helpPopoverContent, ...(ngDevMode ? [{ debugName: "helpPopoverContent" }] : []));
159
+ this.#headerComponentParams = computed(() => this.info.column?.getColDef().headerComponentParams, ...(ngDevMode ? [{ debugName: "#headerComponentParams" }] : []));
160
+ }
161
+ #headerComponentParams;
162
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SkyDataGridColumnInlineHelp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
163
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: SkyDataGridColumnInlineHelp, isStandalone: true, selector: "sky-data-grid-column-inline-help", ngImport: i0, template: `@if (showHelpInline()) {
164
+ <sky-help-inline
165
+ [popoverTitle]="helpPopoverTitle()"
166
+ [popoverContent]="helpPopoverContent()"
167
+ />
168
+ }`, 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 }); }
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SkyDataGridColumnInlineHelp, decorators: [{
171
+ type: Component,
172
+ args: [{
173
+ selector: 'sky-data-grid-column-inline-help',
174
+ imports: [SkyHelpInlineModule],
175
+ template: `@if (showHelpInline()) {
176
+ <sky-help-inline
177
+ [popoverTitle]="helpPopoverTitle()"
178
+ [popoverContent]="helpPopoverContent()"
179
+ />
180
+ }`,
181
+ changeDetection: ChangeDetectionStrategy.OnPush,
182
+ }]
183
+ }] });
184
+
185
+ /**
186
+ * @internal
187
+ */
188
+ function fromGridEvent(target, eventType) {
189
+ return new Observable((subscriber) => {
190
+ const handler = (event) => subscriber.next(event);
191
+ target.addEventListener(eventType, handler);
192
+ return () => {
193
+ if (!target.isDestroyed || !target.isDestroyed()) {
194
+ target.removeEventListener(eventType, handler);
195
+ }
196
+ };
197
+ });
198
+ }
199
+
200
+ // Register only the AG Grid community modules this component actually uses,
201
+ // rather than `AllCommunityModule`, to keep the consumer's bundle lean. This
202
+ // covers the client-side row model, sorting, pagination, row selection, cell
203
+ // and row styling, column auto-sizing, auto-height (text wrap), the grid/column
204
+ // state and event APIs the component and its harness rely on, and dev-time
205
+ // validation messaging.
206
+ ModuleRegistry.registerModules([
207
+ CellStyleModule,
208
+ ClientSideRowModelApiModule,
209
+ ClientSideRowModelModule,
210
+ ColumnApiModule,
211
+ ColumnAutoSizeModule,
212
+ EventApiModule,
213
+ GridStateModule,
214
+ PaginationModule,
215
+ RenderApiModule,
216
+ RowApiModule,
217
+ RowAutoHeightModule,
218
+ RowSelectionModule,
219
+ RowStyleModule,
220
+ ValidationModule,
221
+ ]);
222
+ function arraySorted(arr) {
223
+ return arr.slice().sort((a, b) => a.localeCompare(b));
224
+ }
225
+ /**
226
+ * Displays tabular data in a grid using a declarative set of columns and inputs.
227
+ * Provide the `data` array and one `sky-data-grid-column` for each column to render.
228
+ * @preview
229
+ */
230
+ class SkyDataGrid {
231
+ #activatedRoute;
232
+ #gridService;
233
+ #logger;
234
+ #router;
235
+ #columnDefs;
236
+ #hasColumnDefs;
237
+ #gridDestroyed;
238
+ #gridSelectedRowIds;
239
+ #gridSortChange;
240
+ /**
241
+ * The pagination options passed to AG Grid; not used when `autoPage` is false.
242
+ */
243
+ #paginationOptions;
244
+ #queryParamPage;
245
+ constructor() {
246
+ /**
247
+ * Whether the grid sorts the data order when a column header is clicked.
248
+ * When `autoSort` is set to `false`, the data grid will not modify the sort
249
+ * order, `sort` will emit a new value, and `data` will need to be updated.
250
+ * Use this option when the data is returned from the server already sorted,
251
+ * such as sorting a "name" column using last name.
252
+ * @default true
253
+ */
254
+ this.autoSort = input(true, { ...(ngDevMode ? { debugName: "autoSort" } : {}), transform: coerceBooleanProperty });
255
+ /**
256
+ * Whether the items in `data` represent the full result set used for paging.
257
+ * This applies only when `pageSize` is greater than zero. When `true` (the
258
+ * default), the grid pages through `data` on the client. When `false`, the
259
+ * `rowCount` input is required to size the paging controls, and `data` should
260
+ * be updated to the rows for the current page whenever `page` emits a new
261
+ * value (server-side paging).
262
+ * @default true
263
+ */
264
+ this.autoPage = input(true, { ...(ngDevMode ? { debugName: "autoPage" } : {}), transform: coerceBooleanProperty });
265
+ /**
266
+ * How the grid columns are sized. The valid options are `container`, which
267
+ * attempts to fit the grid to the parent's full width, and `content`, which
268
+ * attempts to optimize columns to display their contents and may exceed the
269
+ * parent's width. If the grid does not have enough columns to fill
270
+ * the parent's width, it always stretches to the parent's full width.
271
+ * This property is applied when the grid initializes; changes after
272
+ * initialization are not reflected.
273
+ * @default 'container'
274
+ */
275
+ this.columnFit = input('container', ...(ngDevMode ? [{ debugName: "columnFit" }] : []));
276
+ /**
277
+ * Whether to enable a compact layout for the grid when using modern theme. Compact layout
278
+ * uses a smaller font size and row height to display more data in a smaller space.
279
+ * @default false
280
+ */
281
+ this.compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : {}), transform: coerceBooleanProperty });
282
+ /**
283
+ * The data for the grid. Each item must implement `SkyDataGridRowData`, and other properties should map to a `field` of the grid columns.
284
+ * When `data` is `null` or `undefined`, the grid will show a loading indicator, and when `data` is an empty array,
285
+ * the grid will show a "no rows" message.
286
+ */
287
+ this.data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : []));
288
+ /**
289
+ * The text to read to screen readers to describe the grid. This sets the `aria-label` attribute on the grid container.
290
+ */
291
+ this.labelText = input(...(ngDevMode ? [undefined, { debugName: "labelText" }] : []));
292
+ /**
293
+ * Whether data is being loaded. When `loading` is true or when `data` is nullish,
294
+ * the grid shows a waiting overlay and is not interactive.
295
+ * @default false
296
+ */
297
+ this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: coerceBooleanProperty });
298
+ /**
299
+ * The minimum height of the grid in pixels.
300
+ * @default 50
301
+ */
302
+ this.minHeight = input(50, { ...(ngDevMode ? { debugName: "minHeight" } : {}), transform: (value) => coerceNumberProperty(value, 50) });
303
+ /**
304
+ * Whether to enable the multiselect feature to display a column of
305
+ * checkboxes on the left side of the grid.
306
+ * @default false
307
+ */
308
+ this.multiselect = input(false, { ...(ngDevMode ? { debugName: "multiselect" } : {}), transform: coerceBooleanProperty });
309
+ /**
310
+ * The number of items to display per page. Setting a value greater than zero
311
+ * enables paging. When `autoPage` is `true` (the default), the grid pages
312
+ * through `data` on the client; when `autoPage` is `false`, set `rowCount` to
313
+ * the total number of rows and update `data` as `page` changes.
314
+ */
315
+ this.pageSize = input(undefined, { ...(ngDevMode ? { debugName: "pageSize" } : {}), transform: (value) => coerceNumberProperty(value, undefined) });
316
+ /**
317
+ * The query parameter name that stores the current page number.
318
+ * When set, the grid syncs page changes to the URL for deep linking, and there should only be one grid on the page.
319
+ */
320
+ this.pageQueryParam = input(...(ngDevMode ? [undefined, { debugName: "pageQueryParam" }] : []));
321
+ /**
322
+ * The total number of rows to page through, used to calculate how many pages
323
+ * the paging controls display. Required when `pageSize` is greater than zero
324
+ * and `autoPage` is `false`; ignored when `autoPage` is `true` because the
325
+ * length of `data` is used instead.
326
+ */
327
+ this.rowCount = input(undefined, { ...(ngDevMode ? { debugName: "rowCount" } : {}), transform: (value) => {
328
+ if (typeof value === 'undefined') {
329
+ return undefined;
330
+ }
331
+ return coerceNumberProperty(value, undefined);
332
+ } });
333
+ /**
334
+ * Whether the data grid is stacked with another element below it. When specified, the appropriate
335
+ * vertical spacing is automatically added to the data grid.
336
+ * @default false
337
+ */
338
+ this.stacked = input(false, { ...(ngDevMode ? { debugName: "stacked" } : {}), transform: coerceBooleanProperty });
339
+ /**
340
+ * Whether to move the horizontal scrollbar to just below the header row.
341
+ * This property is applied when the grid initializes; changes after
342
+ * initialization are not reflected.
343
+ * @default false
344
+ */
345
+ this.topScrollEnabled = input(false, { ...(ngDevMode ? { debugName: "topScrollEnabled" } : {}), transform: coerceBooleanProperty });
346
+ /**
347
+ * The current page number of the grid when `pageSize` has been set. This is two-way bindable:
348
+ * it updates as the user navigates pages, and you can set it to change the current page.
349
+ * When `autoPage` is `false`, update `data` to the rows for the new page whenever this changes.
350
+ * @default 1
351
+ */
352
+ this.page = model(1, ...(ngDevMode ? [{ debugName: "page" }] : []));
353
+ /**
354
+ * The set of IDs for the rows to select in a multiselect grid.
355
+ * Rows with IDs that are not included are de-selected in the grid. This is two-way bindable:
356
+ * it emits the updated set of IDs when the user changes the selection.
357
+ * @default []
358
+ */
359
+ this.selectedRowIds = model([], ...(ngDevMode ? [{ debugName: "selectedRowIds" }] : []));
360
+ /**
361
+ * The current sort applied to the grid. This is two-way bindable: it emits a new value
362
+ * whenever the user sorts a column, and you can set it to sort the grid programmatically.
363
+ * When `autoSort` is `false`, the grid emits the new value here but does not reorder the
364
+ * data itself, leaving it to you to update `data`.
365
+ */
366
+ this.sort = model(undefined, ...(ngDevMode ? [{ debugName: "sort" }] : []));
367
+ this.columns = contentChildren(SkyDataGridColumn, ...(ngDevMode ? [{ debugName: "columns" }] : []));
368
+ this.gridApi = signal(undefined, ...(ngDevMode ? [{ debugName: "gridApi" }] : []));
369
+ this.gridOptions = computed(() => {
370
+ const hasColumnDefs = this.#hasColumnDefs();
371
+ if (!hasColumnDefs) {
372
+ return undefined;
373
+ }
374
+ const columnDefs = untracked(() => this.#columnDefs());
375
+ const { pagination, paginationPageSize } = untracked(() => this.#paginationOptions());
376
+ const rowData = untracked(() => this.rowData());
377
+ // Seed the initial sort through AG Grid's own state so it is applied as the
378
+ // grid initializes (and re-applied when the grid is recreated). Subsequent
379
+ // sort changes are applied at runtime by the dedicated `sort` effect.
380
+ const sort = untracked(() => this.sort());
381
+ return this.#gridService.getGridOptions({
382
+ gridOptions: {
383
+ columnDefs,
384
+ context: {
385
+ enableTopScroll: untracked(() => this.topScrollEnabled()),
386
+ },
387
+ domLayout: 'autoHeight',
388
+ initialState: sort
389
+ ? {
390
+ sort: {
391
+ sortModel: [
392
+ { colId: sort.field, sort: sort.direction },
393
+ ],
394
+ },
395
+ }
396
+ : undefined,
397
+ loading: untracked(() => this.loading() || !Array.isArray(this.data())),
398
+ onGridReady: (args) => {
399
+ this.gridApi.set(args.api);
400
+ this.gridReady.set(true);
401
+ },
402
+ pagination,
403
+ paginationPageSize,
404
+ suppressMultiSort: true,
405
+ suppressPaginationPanel: true,
406
+ rowData: rowData.length ? rowData : null,
407
+ rowSelection: untracked(() => this.#getRowSelection()),
408
+ autoSizeStrategy: untracked(() => this.#getAutoSizeStrategy()),
409
+ },
410
+ });
411
+ }, ...(ngDevMode ? [{ debugName: "gridOptions" }] : []));
412
+ this.gridReady = signal(false, ...(ngDevMode ? [{ debugName: "gridReady" }] : []));
413
+ this.rowData = computed(() => {
414
+ const rowData = this.data() ?? [];
415
+ const pageSize = this.pageSize();
416
+ if (!this.autoPage() && pageSize && rowData.length > pageSize) {
417
+ this.#logger.warn('When using paging and `autoPage` is not enabled, the `data` input will be limited to the number of rows specified by `pageSize`. To display more rows, update the `data` input when the `page` changes.');
418
+ return rowData.slice(0, pageSize);
419
+ }
420
+ return rowData;
421
+ }, ...(ngDevMode ? [{ debugName: "rowData" }] : []));
422
+ this.pageCount = computed(() => {
423
+ const dataLength = this.pageItemsCount();
424
+ const pageSize = this.pageSize();
425
+ const gridReady = this.gridReady();
426
+ if (!gridReady || !pageSize) {
427
+ return 0;
428
+ }
429
+ return Math.ceil(dataLength / pageSize);
430
+ }, ...(ngDevMode ? [{ debugName: "pageCount" }] : []));
431
+ this.pageItemsCount = linkedSignal({ ...(ngDevMode ? { debugName: "pageItemsCount" } : {}), source: () => {
432
+ const pageSize = this.pageSize();
433
+ const gridReady = this.gridReady();
434
+ const rowCount = this.rowCount() ?? 0;
435
+ if (!gridReady || !pageSize) {
436
+ return 0;
437
+ }
438
+ const dataLength = this.rowData().length;
439
+ const autoPage = this.autoPage();
440
+ return autoPage ? dataLength : rowCount;
441
+ },
442
+ computation: (source, previous) => {
443
+ // Avoid flickering the pagination controls while data is updating.
444
+ if (this.loading()) {
445
+ return previous?.value || 0;
446
+ }
447
+ return source;
448
+ } });
449
+ this.skyViewkeeper = computed(() => {
450
+ // Only used when not using SkyDataManagerService because data manager handles SkyViewkeeper.
451
+ const classes = ['.ag-header'];
452
+ if (this.topScrollEnabled()) {
453
+ classes.push('.ag-body-horizontal-scroll');
454
+ }
455
+ return classes;
456
+ }, ...(ngDevMode ? [{ debugName: "skyViewkeeper" }] : []));
457
+ this.#activatedRoute = inject(ActivatedRoute, { optional: true });
458
+ this.#gridService = inject(SkyAgGridService);
459
+ this.#logger = inject(SkyLogService);
460
+ this.#router = inject(Router, { optional: true });
461
+ this.#columnDefs = computed(() => {
462
+ const columns = this.columns();
463
+ return columns.map((col) => this.#createColDef(col));
464
+ }, ...(ngDevMode ? [{ debugName: "#columnDefs" }] : []));
465
+ this.#hasColumnDefs = computed(() => this.#columnDefs().length > 0, ...(ngDevMode ? [{ debugName: "#hasColumnDefs" }] : []));
466
+ this.#gridDestroyed = toObservable(this.gridApi).pipe(filter(Boolean), switchMap((api) => fromGridEvent(api, 'gridPreDestroyed')));
467
+ this.#gridSelectedRowIds = toObservable(this.gridApi).pipe(filter(Boolean), switchMap((api) => fromGridEvent(api, 'selectionChanged').pipe(takeUntil(this.#gridDestroyed), map(() => arraySorted(this.#getRowIds(api.getSelectedNodes()))))));
468
+ this.#gridSortChange = toObservable(this.gridApi).pipe(filter(Boolean), switchMap((api) => fromGridEvent(api, 'sortChanged').pipe(takeUntil(this.#gridDestroyed), map((sortEvent) => {
469
+ const sortColumn = sortEvent?.columns?.find((col) => !!col.getSort());
470
+ if (sortColumn) {
471
+ return {
472
+ direction: sortColumn.getSort(),
473
+ field: sortColumn.getColId(),
474
+ };
475
+ }
476
+ return undefined;
477
+ }))));
478
+ /**
479
+ * The pagination options passed to AG Grid; not used when `autoPage` is false.
480
+ */
481
+ this.#paginationOptions = computed(() => {
482
+ const pageSize = this.pageSize();
483
+ const pagination = this.autoPage() && !!pageSize;
484
+ const paginationPageSize = (pagination && pageSize) || undefined;
485
+ return {
486
+ pagination,
487
+ paginationPageSize,
488
+ };
489
+ }, ...(ngDevMode ? [{ debugName: "#paginationOptions" }] : []));
490
+ this.#queryParamPage = toSignal(toObservable(this.pageQueryParam).pipe(switchMap((pageQueryParam) => pageQueryParam && this.#activatedRoute
491
+ ? this.#activatedRoute.queryParamMap.pipe(startWith(this.#activatedRoute.snapshot.queryParamMap), map((params) => coerceNumberProperty(params.get(pageQueryParam), NaN)))
492
+ : [])), { initialValue: NaN });
493
+ // Update specific grid options after the grid has been loaded. These read
494
+ // `gridApi` untracked because a recreated grid rebuilds its options from the
495
+ // `gridOptions` computed; the selection and page effects below instead track
496
+ // `gridApi` so they re-apply their state to a freshly created grid.
497
+ effect(() => {
498
+ const api = untracked(() => this.gridApi());
499
+ const columnDefs = this.#columnDefs();
500
+ api?.setGridOption('columnDefs', columnDefs);
501
+ });
502
+ effect(() => {
503
+ const api = untracked(() => this.gridApi());
504
+ const isLoading = this.loading() || !Array.isArray(this.data());
505
+ api?.setGridOption('loading', isLoading);
506
+ });
507
+ effect(() => {
508
+ const api = untracked(() => this.gridApi());
509
+ const { pagination, paginationPageSize } = this.#paginationOptions();
510
+ api?.setGridOption('pagination', pagination);
511
+ api?.setGridOption('paginationPageSize', paginationPageSize);
512
+ });
513
+ effect(() => {
514
+ const api = untracked(() => this.gridApi());
515
+ const rowData = this.rowData();
516
+ api?.setGridOption('rowData', rowData);
517
+ });
518
+ effect(() => {
519
+ const api = untracked(() => this.gridApi());
520
+ const rowSelection = this.#getRowSelection();
521
+ api?.setGridOption('rowSelection', rowSelection);
522
+ });
523
+ // Apply inputs once the grid is loaded and on subsequent changes.
524
+ effect(() => {
525
+ const api = this.gridApi();
526
+ const isLoading = this.loading() || !Array.isArray(this.data());
527
+ // Don't reconcile selection while data is still loading; pruning here
528
+ // would wipe a selection a consumer set before the rows arrived.
529
+ // An empty array is "loaded but no rows", so only `null`/`undefined` skip.
530
+ if (isLoading) {
531
+ return;
532
+ }
533
+ const validRowIds = new Set(this.rowData().map((row) => row.id));
534
+ const selectedRowIds = coerceStringArray(this.selectedRowIds());
535
+ const validSelectedRowIds = selectedRowIds.filter((id) => validRowIds.has(id));
536
+ if (this.autoPage() &&
537
+ validSelectedRowIds.length !== selectedRowIds.length) {
538
+ this.selectedRowIds.set(validSelectedRowIds);
539
+ }
540
+ if (!api) {
541
+ return;
542
+ }
543
+ // Diff against the grid's current selection; only touch nodes that
544
+ // change, so a no-op reconcile fires no selectionChanged event.
545
+ const desired = new Set(validSelectedRowIds);
546
+ const selectedNodes = api.getSelectedNodes();
547
+ const alreadySelected = new Set(this.#getRowIds(selectedNodes));
548
+ const toDeselect = selectedNodes.filter((node) => !desired.has(node.id));
549
+ const toSelect = validSelectedRowIds
550
+ .filter((id) => !alreadySelected.has(id))
551
+ .map((id) => api.getRowNode(id))
552
+ .filter((node) => !!node);
553
+ if (toDeselect.length) {
554
+ api.setNodesSelected({ nodes: toDeselect, newValue: false });
555
+ }
556
+ if (toSelect.length) {
557
+ api.setNodesSelected({ nodes: toSelect, newValue: true });
558
+ }
559
+ });
560
+ // Apply the sort as runtime column state rather than through `columnDefs`,
561
+ // so sorting never re-applies the declared column order and wipes a
562
+ // user's drag-reordered (or resized) columns. Tracks `gridApi` so the
563
+ // sort re-applies to a freshly created grid.
564
+ effect(() => {
565
+ const api = this.gridApi();
566
+ const sort = this.sort();
567
+ if (!api) {
568
+ return;
569
+ }
570
+ api.applyColumnState({
571
+ state: sort
572
+ ? [
573
+ {
574
+ colId: sort.field,
575
+ sort: sort.direction,
576
+ },
577
+ ]
578
+ : [],
579
+ defaultState: { sort: null },
580
+ });
581
+ });
582
+ effect(() => {
583
+ const api = this.gridApi();
584
+ const page = this.page();
585
+ const pageCount = this.pageCount();
586
+ if (!pageCount || !api) {
587
+ return;
588
+ }
589
+ if (page < 1) {
590
+ this.currentPageChange(1);
591
+ }
592
+ else if (page > pageCount) {
593
+ this.currentPageChange(pageCount);
594
+ }
595
+ else {
596
+ if (untracked(this.autoPage)) {
597
+ api.paginationGoToPage(page - 1);
598
+ }
599
+ // When the page is set programmatically (rather than through the
600
+ // paging controls), sync the change to the URL query parameter.
601
+ this.#syncPageQueryParam(page);
602
+ }
603
+ });
604
+ effect(() => {
605
+ const api = this.gridApi();
606
+ const label = this.labelText();
607
+ api?.setGridAriaProperty('label', label ?? null);
608
+ });
609
+ // Sync page from URL query parameter.
610
+ effect(() => {
611
+ const queryParamPage = this.#queryParamPage();
612
+ const pageSize = this.pageSize();
613
+ if (pageSize && Number.isInteger(queryParamPage)) {
614
+ this.page.set(queryParamPage);
615
+ }
616
+ });
617
+ // Warn when server-side paging is configured without the required
618
+ // `rowCount`. Without it, `pageItemsCount` resolves to zero and the paging
619
+ // controls silently disappear. Only warn once data has loaded so a grid
620
+ // that is still fetching its first page does not trigger a false positive.
621
+ effect(() => {
622
+ if (!this.autoPage() &&
623
+ this.pageSize() &&
624
+ this.rowCount() === undefined &&
625
+ !this.loading() &&
626
+ Array.isArray(this.data())) {
627
+ this.#logger.warn('When using paging and `autoPage` is not enabled, the `rowCount` input is required so the paging controls know how many pages to display. Set `rowCount` to the total number of rows available on the server.');
628
+ }
629
+ });
630
+ this.#gridDestroyed.pipe(takeUntilDestroyed()).subscribe(() => {
631
+ this.gridApi.set(undefined);
632
+ this.gridReady.set(false);
633
+ });
634
+ // Emit updates from the grid.
635
+ this.#gridSelectedRowIds
636
+ .pipe(takeUntilDestroyed(), map((ids) => coerceStringArray(ids)))
637
+ .subscribe((selectedRowIds) => {
638
+ // Maintain IDs not in the current dataset.
639
+ const validRowIds = new Set(this.rowData().map(({ id }) => id));
640
+ const selectedSet = new Set(selectedRowIds);
641
+ this.selectedRowIds.update((val) => {
642
+ const valSet = new Set(val);
643
+ const hasAddition = selectedRowIds.some((id) => !valSet.has(id));
644
+ const hasRemoval = val.some((id) => validRowIds.has(id) && !selectedSet.has(id));
645
+ if (hasAddition || hasRemoval) {
646
+ return [
647
+ ...new Set([
648
+ ...val.filter((id) => !validRowIds.has(id)),
649
+ ...selectedRowIds,
650
+ ]),
651
+ ].sort((a, b) => a.localeCompare(b));
652
+ }
653
+ return val;
654
+ });
655
+ });
656
+ this.#gridSortChange.pipe(takeUntilDestroyed()).subscribe((sortChange) => {
657
+ if (sortChange) {
658
+ this.sort.update((sort) => {
659
+ if (!!sort !== !!sortChange ||
660
+ sort?.direction !== sortChange?.direction ||
661
+ sort?.field !== sortChange?.field) {
662
+ return sortChange;
663
+ }
664
+ return sort;
665
+ });
666
+ }
667
+ else {
668
+ // Clear the sort when the grid no longer has a sorted column so the
669
+ // two-way bound model does not retain a stale value.
670
+ this.sort.update(() => undefined);
671
+ }
672
+ });
673
+ }
674
+ currentPageChange(page) {
675
+ if (page && page !== this.page()) {
676
+ const pageQueryParam = this.pageQueryParam();
677
+ if (pageQueryParam) {
678
+ // When using a query parameter, send the change through the router.
679
+ this.#navigateToPageQueryParam(pageQueryParam, page);
680
+ }
681
+ else {
682
+ this.page.set(page);
683
+ }
684
+ }
685
+ }
686
+ /**
687
+ * Updates the URL to reflect a programmatic page change so deep linking stays
688
+ * in sync when a consumer drives `page` directly instead of using the paging
689
+ * controls. Reads untracked so it does not add reactive dependencies to the
690
+ * effect that calls it.
691
+ */
692
+ #syncPageQueryParam(page) {
693
+ const pageQueryParam = untracked(this.pageQueryParam);
694
+ if (pageQueryParam && untracked(this.#queryParamPage) !== page) {
695
+ this.#navigateToPageQueryParam(pageQueryParam, page);
696
+ }
697
+ }
698
+ #navigateToPageQueryParam(pageQueryParam, page) {
699
+ void this.#router?.navigate([], {
700
+ relativeTo: this.#activatedRoute,
701
+ queryParams: {
702
+ [pageQueryParam]: page === 1 ? null : page,
703
+ },
704
+ queryParamsHandling: 'merge',
705
+ });
706
+ }
707
+ #createColDef(col) {
708
+ const field = col.field();
709
+ const colDef = {
710
+ colId: col.columnId(),
711
+ field,
712
+ headerName: col.headingText(),
713
+ headerComponentParams: this.#getHeaderComponentParams(col),
714
+ hide: col.columnHidden(),
715
+ initialHide: col.columnHidden(),
716
+ resizable: col.resizable(),
717
+ sortable: col.sortable(),
718
+ lockPosition: col.locked(),
719
+ suppressMovable: col.locked(),
720
+ type: [],
721
+ autoHeight: col.wrapText(),
722
+ wrapText: col.wrapText(),
723
+ };
724
+ if (col.dataType() === 'date') {
725
+ colDef.type.push(SkyCellType.Date);
726
+ colDef.cellDataType = 'dateString';
727
+ }
728
+ else if (field && col.dataType() === 'number') {
729
+ colDef.type.push(SkyCellType.Number);
730
+ colDef.cellDataType = 'number';
731
+ colDef.valueGetter = (params) => {
732
+ const n = Number(params.data?.[field]);
733
+ return Number.isFinite(n) ? n : null;
734
+ };
735
+ }
736
+ else if (col.dataType() === 'boolean') {
737
+ colDef.cellDataType = 'boolean';
738
+ }
739
+ else {
740
+ colDef.type.push(SkyCellType.Text);
741
+ colDef.cellDataType = 'text';
742
+ }
743
+ const colWithTemplate = col;
744
+ if (colWithTemplate.cellTemplate()) {
745
+ colDef.type.push(SkyCellType.Template);
746
+ colDef.cellRendererParams = { template: colWithTemplate.cellTemplate };
747
+ }
748
+ if (!this.autoSort()) {
749
+ colDef.comparator = () => 0;
750
+ }
751
+ this.#applyColumnWidthSettings(col, colDef);
752
+ return colDef;
753
+ }
754
+ #applyColumnWidthSettings(col, colDef) {
755
+ if (Number.isFinite(col.flexWidth())) {
756
+ colDef.flex = col.flexWidth();
757
+ colDef.initialFlex = col.flexWidth();
758
+ if (Number.isFinite(col.width())) {
759
+ colDef.minWidth = col.width();
760
+ }
761
+ }
762
+ else if (Number.isFinite(col.width())) {
763
+ colDef.initialWidth = col.width();
764
+ colDef.suppressAutoSize = true;
765
+ }
766
+ if (!col.resizable() || col.flexWidth() === 0) {
767
+ colDef.suppressSizeToFit = true;
768
+ colDef.suppressAutoSize = true;
769
+ if (!col.resizable() && Number.isFinite(col.width())) {
770
+ colDef.minWidth = col.width();
771
+ colDef.maxWidth = col.width();
772
+ }
773
+ }
774
+ }
775
+ #getHeaderComponentParams(col) {
776
+ return {
777
+ headerHidden: col.headingHidden(),
778
+ helpPopoverTitle: col.helpPopoverTitle(),
779
+ helpPopoverContent: col.helpPopoverContent(),
780
+ inlineHelpComponent: SkyDataGridColumnInlineHelp,
781
+ };
782
+ }
783
+ #getRowIds(rows) {
784
+ return coerceArray(rows)
785
+ .map((node) => node?.id)
786
+ .filter(Boolean);
787
+ }
788
+ #hasFlexColumns() {
789
+ return this.#columnDefs().some((col) => !!col.initialFlex);
790
+ }
791
+ #getAutoSizeStrategy() {
792
+ if (this.#hasFlexColumns()) {
793
+ // Avoid the console warning if `autoSizeColumns` is called on a grid with flex columns, so skip it.
794
+ return undefined;
795
+ }
796
+ return {
797
+ type: 'fitCellContents',
798
+ skipHeader: true,
799
+ scaleUpToFitGridWidth: this.columnFit() === 'container',
800
+ };
801
+ }
802
+ #getRowSelection() {
803
+ return this.multiselect()
804
+ ? {
805
+ checkboxes: true,
806
+ checkboxLocation: 'selectionColumn',
807
+ headerCheckbox: true,
808
+ mode: 'multiRow',
809
+ }
810
+ : { checkboxes: false, mode: 'singleRow' };
811
+ }
812
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SkyDataGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
813
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", 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", "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", "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", "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", "pagination", "paginationPageSize", "paginationPageSizeSelector", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "formulaDataSource", "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", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupLockGroupColumns", "groupAggFiltering", "groupTotalRow", "grandTotalRow", "suppressStickyTotalRow", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "groupAllowUnbalanced", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererParams", "treeData", "treeDataChildrenField", "treeDataParentIdField", "rowGroupPanelSuppressSort", "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", "columnHoverHighlight", "gridId", "deltaSort", "treeDataDisplayType", "enableGroupEdit", "initialState", "theme", "loadThemeGoogleFonts", "themeCssLayer", "styleNonce", "themeStyleContainer", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processUnpinnedColumns", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "focusGridInnerElement", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "getLocaleText", "getDocument", "paginationNumberFormatter", "getGroupRowAgg", "isGroupOpenByDefault", "ssrmExpandAllAffectsAllRows", "initialGroupOrderComparator", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "getChildCount", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthRow", "isRowValidDropPosition"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "columnMenuVisibleChanged", "contextMenuVisibleChanged", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "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 }); }
814
+ }
815
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SkyDataGrid, decorators: [{
816
+ type: Component,
817
+ args: [{ selector: 'sky-data-grid', imports: [
818
+ AgGridAngular,
819
+ SkyAgGridModule,
820
+ SkyPagingModule,
821
+ SkyViewkeeperModule,
822
+ SkyWaitModule,
823
+ ], host: {
824
+ '[class.sky-margin-stacked-lg]': 'stacked()',
825
+ }, changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
826
+ }], 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"] }], selectedRowIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedRowIds", required: false }] }, { type: i0.Output, args: ["selectedRowIdsChange"] }], 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 }] }] } });
827
+
828
+ /**
829
+ * Generated bundle index. Do not edit.
830
+ */
831
+
832
+ export { SkyDataGrid, SkyDataGridColumn };
833
+ //# sourceMappingURL=skyux-data-grid.mjs.map