@skyux/data-grid 14.23.0 → 14.25.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.
@@ -1,5 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { OnInit, TemplateRef, Signal } from '@angular/core';
3
+ import { SkyDataColumnSource, SkyDataSelectionSource, SkyDataSortSource, SkyDataColumnOption } from '@skyux/lists';
3
4
  import { GridApi, GridOptions } from 'ag-grid-community';
4
5
 
5
6
  /**
@@ -31,6 +32,12 @@ interface SkyDataGridSort {
31
32
  field: string;
32
33
  }
33
34
 
35
+ /**
36
+ * How a `SkyDataGrid` docks to its container.
37
+ * @preview
38
+ */
39
+ type SkyDataGridDockType = 'none' | 'fill';
40
+
34
41
  /**
35
42
  * Defines a single column in a `SkyDataGrid`. Add one `sky-data-grid-column` for each
36
43
  * column to render.
@@ -39,7 +46,9 @@ interface SkyDataGridSort {
39
46
  declare class SkyDataGridColumn implements OnInit {
40
47
  #private;
41
48
  /**
42
- * Whether the column is hidden.
49
+ * Whether the column is hidden. When the grid's `selectedColumnIds` is set,
50
+ * it determines which columns display instead. In a data manager's column
51
+ * picker, the column starts hidden and users can choose to display it.
43
52
  * @default false
44
53
  */
45
54
  readonly columnHidden: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -54,6 +63,11 @@ declare class SkyDataGridColumn implements OnInit {
54
63
  * @default 'text'
55
64
  */
56
65
  readonly dataType: _angular_core.InputSignal<"number" | "boolean" | "text" | "date">;
66
+ /**
67
+ * The text to display beneath the column's `headingText` in a data
68
+ * manager's column picker.
69
+ */
70
+ readonly description: _angular_core.InputSignal<string | undefined>;
57
71
  /**
58
72
  * The property to retrieve cell information from an entry on the grid `data` array.
59
73
  * You must provide either the `columnId` or `field` property for every column,
@@ -94,7 +108,9 @@ declare class SkyDataGridColumn implements OnInit {
94
108
  /**
95
109
  * Whether the column is locked. The intent is to display locked columns first
96
110
  * on the left side of the grid. If set to `true`, then users cannot drag the column
97
- * to another position or drag other columns before it.
111
+ * to another position or drag other columns before it. In a data manager's
112
+ * column picker, a locked column always displays and is not offered as an
113
+ * option.
98
114
  * @default false
99
115
  */
100
116
  readonly locked: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -137,7 +153,7 @@ declare class SkyDataGridColumn implements OnInit {
137
153
  */
138
154
  protected readonly cellTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
139
155
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkyDataGridColumn, never>;
140
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkyDataGridColumn, "sky-data-grid-column", never, { "columnHidden": { "alias": "columnHidden"; "required": false; "isSignal": true; }; "columnId": { "alias": "columnId"; "required": false; "isSignal": true; }; "dataType": { "alias": "dataType"; "required": false; "isSignal": true; }; "field": { "alias": "field"; "required": false; "isSignal": true; }; "flexWidth": { "alias": "flexWidth"; "required": false; "isSignal": true; }; "headingText": { "alias": "headingText"; "required": true; "isSignal": true; }; "headingHidden": { "alias": "headingHidden"; "required": false; "isSignal": true; }; "helpPopoverTitle": { "alias": "helpPopoverTitle"; "required": false; "isSignal": true; }; "helpPopoverContent": { "alias": "helpPopoverContent"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "sortable": { "alias": "sortable"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "wrapText": { "alias": "wrapText"; "required": false; "isSignal": true; }; }, {}, ["templateChild"], never, true, never>;
156
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkyDataGridColumn, "sky-data-grid-column", never, { "columnHidden": { "alias": "columnHidden"; "required": false; "isSignal": true; }; "columnId": { "alias": "columnId"; "required": false; "isSignal": true; }; "dataType": { "alias": "dataType"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "field": { "alias": "field"; "required": false; "isSignal": true; }; "flexWidth": { "alias": "flexWidth"; "required": false; "isSignal": true; }; "headingText": { "alias": "headingText"; "required": true; "isSignal": true; }; "headingHidden": { "alias": "headingHidden"; "required": false; "isSignal": true; }; "helpPopoverTitle": { "alias": "helpPopoverTitle"; "required": false; "isSignal": true; }; "helpPopoverContent": { "alias": "helpPopoverContent"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "sortable": { "alias": "sortable"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "wrapText": { "alias": "wrapText"; "required": false; "isSignal": true; }; }, {}, ["templateChild"], never, true, never>;
141
157
  }
142
158
 
143
159
  /**
@@ -145,7 +161,7 @@ declare class SkyDataGridColumn implements OnInit {
145
161
  * Provide the `data` array and one `sky-data-grid-column` for each column to render.
146
162
  * @preview
147
163
  */
148
- declare class SkyDataGrid {
164
+ declare class SkyDataGrid implements SkyDataColumnSource, SkyDataSelectionSource, SkyDataSortSource {
149
165
  #private;
150
166
  /**
151
167
  * Whether the grid sorts the data order when a column header is clicked.
@@ -189,6 +205,14 @@ declare class SkyDataGrid {
189
205
  * the grid will show a "no rows" message.
190
206
  */
191
207
  readonly data: _angular_core.InputSignal<SkyDataGridRowData[] | null | undefined>;
208
+ /**
209
+ * How the data grid docks to the page. Use `fill` to dock the data grid to the container's size where the container
210
+ * is a `sky-page` component with its `layout` set to `fit`, or where the container is another element with a
211
+ * relative or absolute position and a fixed size. This property is applied when the grid initializes; changes
212
+ * after initialization are not reflected.
213
+ * @default "none"
214
+ */
215
+ readonly dock: _angular_core.InputSignal<SkyDataGridDockType>;
192
216
  /**
193
217
  * The text to read to screen readers to describe the grid. This sets the `aria-label` attribute on the grid container.
194
218
  */
@@ -200,7 +224,7 @@ declare class SkyDataGrid {
200
224
  */
201
225
  readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
202
226
  /**
203
- * The minimum height of the grid in pixels.
227
+ * The minimum height of the grid in pixels. This property does not apply when `dock` is set to `fill`.
204
228
  * @default 50
205
229
  */
206
230
  readonly minHeight: _angular_core.InputSignalWithTransform<number, unknown>;
@@ -231,7 +255,7 @@ declare class SkyDataGrid {
231
255
  readonly rowCount: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
232
256
  /**
233
257
  * Whether the data grid is stacked with another element below it. When specified, the appropriate
234
- * vertical spacing is automatically added to the data grid.
258
+ * vertical spacing is automatically added to the data grid. This property does not apply when `dock` is set to `fill`.
235
259
  * @default false
236
260
  */
237
261
  readonly stacked: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -256,6 +280,15 @@ declare class SkyDataGrid {
256
280
  * @default []
257
281
  */
258
282
  readonly selectedRowIds: _angular_core.ModelSignal<string[]>;
283
+ /**
284
+ * The IDs of the columns to display, in display order. Columns that are not
285
+ * included are hidden. An ID that does not match a column is ignored until a
286
+ * column with that ID is declared. This is two-way bindable: once set, it
287
+ * emits a new value when the user reorders columns. When `undefined`, every
288
+ * column displays in declaration order except those marked `columnHidden`.
289
+ * Displayed locked columns come first.
290
+ */
291
+ readonly selectedColumnIds: _angular_core.ModelSignal<string[] | undefined>;
259
292
  /**
260
293
  * The current sort applied to the grid. This is two-way bindable: it emits a new value
261
294
  * whenever the user sorts a column, and you can set it to sort the grid programmatically.
@@ -264,6 +297,34 @@ declare class SkyDataGrid {
264
297
  */
265
298
  readonly sort: _angular_core.ModelSignal<SkyDataGridSort | undefined>;
266
299
  protected readonly columns: Signal<readonly SkyDataGridColumn[]>;
300
+ /**
301
+ * The columns the grid can display, in declaration order. Read by column
302
+ * picker integrations through `SkyDataColumnSource`.
303
+ * @internal
304
+ */
305
+ readonly columnOptions: Signal<readonly SkyDataColumnOption[]>;
306
+ /**
307
+ * The widths in pixels of the columns users resized, keyed by column ID.
308
+ * Read by data manager integrations through `SkyDataColumnSource`.
309
+ * @internal
310
+ */
311
+ readonly columnWidths: Signal<Readonly<Record<string, number>>>;
312
+ /**
313
+ * The IDs of the columns that display, in display order: the
314
+ * `selectedColumnIds` that match a declared column or, when
315
+ * `selectedColumnIds` is `undefined`, every column not marked `columnHidden`.
316
+ * Locked columns come first, as the grid displays them. Read by column
317
+ * picker integrations through `SkyDataColumnSource`.
318
+ * @internal
319
+ */
320
+ readonly displayedColumnIds: Signal<string[]>;
321
+ /**
322
+ * The selectors of the elements the grid keeps visible at the top of the
323
+ * viewport while the page scrolls. Read by column picker integrations
324
+ * through `SkyDataColumnSource`.
325
+ * @internal
326
+ */
327
+ readonly viewkeeperClasses: Signal<string[]>;
267
328
  protected readonly gridApi: _angular_core.WritableSignal<GridApi<SkyDataGridRowData> | undefined>;
268
329
  protected readonly gridOptions: Signal<GridOptions<SkyDataGridRowData> | undefined>;
269
330
  protected readonly gridReady: _angular_core.WritableSignal<boolean>;
@@ -271,11 +332,55 @@ declare class SkyDataGrid {
271
332
  protected readonly pageCount: Signal<number>;
272
333
  protected readonly pageItemsCount: _angular_core.WritableSignal<number>;
273
334
  protected readonly skyViewkeeper: Signal<string[]>;
335
+ protected readonly useFillDock: Signal<boolean>;
336
+ protected readonly useStacked: Signal<boolean>;
274
337
  constructor();
338
+ /**
339
+ * Stops the grid from removing the IDs of rows that are not in `data` from
340
+ * `selectedRowIds`. Called by data manager integrations through
341
+ * `SkyDataSelectionSource` when they keep rows that a search or filter hides
342
+ * selected.
343
+ * @internal
344
+ */
345
+ disableSelectionPruning(): void;
346
+ /**
347
+ * Stops the grid from keeping the `viewkeeperClasses` elements visible
348
+ * itself. Called by column picker integrations through `SkyDataColumnSource`
349
+ * when a container keeps them visible instead.
350
+ * @internal
351
+ */
352
+ disableViewkeeper(): void;
353
+ /**
354
+ * Sets the columns that display and their order. Called by column picker
355
+ * integrations through `SkyDataColumnSource`.
356
+ * @internal
357
+ */
358
+ setDisplayedColumnIds(columnIds: readonly string[]): void;
359
+ /**
360
+ * Sets the widths in pixels of columns, keyed by column ID, and starts
361
+ * tracking the widths users give columns. Columns that are not included
362
+ * return to the widths they are declared with or, when declared without
363
+ * one, the widths the grid gave them. Called by data manager
364
+ * integrations through `SkyDataColumnSource`.
365
+ * @internal
366
+ */
367
+ setColumnWidths(columnWidths: Readonly<Record<string, number>>): void;
368
+ /**
369
+ * Sets the selected rows. Called by data manager integrations through
370
+ * `SkyDataSelectionSource`.
371
+ * @internal
372
+ */
373
+ setSelectedRowIds(selectedRowIds: readonly string[]): void;
374
+ /**
375
+ * Sets the sort the grid applies. Called by data manager integrations
376
+ * through `SkyDataSortSource`.
377
+ * @internal
378
+ */
379
+ setSort(sort: SkyDataGridSort | undefined): void;
275
380
  protected currentPageChange(page: number): void;
276
381
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkyDataGrid, never>;
277
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkyDataGrid, "sky-data-grid", never, { "autoSort": { "alias": "autoSort"; "required": false; "isSignal": true; }; "autoPage": { "alias": "autoPage"; "required": false; "isSignal": true; }; "columnFit": { "alias": "columnFit"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "labelText": { "alias": "labelText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "multiselect": { "alias": "multiselect"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageQueryParam": { "alias": "pageQueryParam"; "required": false; "isSignal": true; }; "rowCount": { "alias": "rowCount"; "required": false; "isSignal": true; }; "stacked": { "alias": "stacked"; "required": false; "isSignal": true; }; "topScrollEnabled": { "alias": "topScrollEnabled"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "selectedRowIds": { "alias": "selectedRowIds"; "required": false; "isSignal": true; }; "sort": { "alias": "sort"; "required": false; "isSignal": true; }; }, { "page": "pageChange"; "selectedRowIds": "selectedRowIdsChange"; "sort": "sortChange"; }, ["columns"], never, true, never>;
382
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkyDataGrid, "sky-data-grid", never, { "autoSort": { "alias": "autoSort"; "required": false; "isSignal": true; }; "autoPage": { "alias": "autoPage"; "required": false; "isSignal": true; }; "columnFit": { "alias": "columnFit"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "dock": { "alias": "dock"; "required": false; "isSignal": true; }; "labelText": { "alias": "labelText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "multiselect": { "alias": "multiselect"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageQueryParam": { "alias": "pageQueryParam"; "required": false; "isSignal": true; }; "rowCount": { "alias": "rowCount"; "required": false; "isSignal": true; }; "stacked": { "alias": "stacked"; "required": false; "isSignal": true; }; "topScrollEnabled": { "alias": "topScrollEnabled"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "selectedRowIds": { "alias": "selectedRowIds"; "required": false; "isSignal": true; }; "selectedColumnIds": { "alias": "selectedColumnIds"; "required": false; "isSignal": true; }; "sort": { "alias": "sort"; "required": false; "isSignal": true; }; }, { "page": "pageChange"; "selectedRowIds": "selectedRowIdsChange"; "selectedColumnIds": "selectedColumnIdsChange"; "sort": "sortChange"; }, ["columns"], never, true, never>;
278
383
  }
279
384
 
280
385
  export { SkyDataGrid, SkyDataGridColumn };
281
- export type { SkyDataGridRowData, SkyDataGridSort };
386
+ export type { SkyDataGridDockType, SkyDataGridRowData, SkyDataGridSort };