@skyux/tiles 8.7.2 → 9.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/documentation.json +39 -39
  2. package/esm2022/lib/modules/shared/sky-tiles-resources.module.mjs +60 -0
  3. package/{esm2020 → esm2022}/lib/modules/tiles/tile/tile-summary.component.mjs +4 -4
  4. package/{esm2020 → esm2022}/lib/modules/tiles/tile/tile-title.component.mjs +4 -4
  5. package/esm2022/lib/modules/tiles/tile/tile.component.mjs +164 -0
  6. package/{esm2020 → esm2022}/lib/modules/tiles/tile/tile.module.mjs +21 -21
  7. package/{esm2020 → esm2022}/lib/modules/tiles/tile-content/tile-content-section.component.mjs +4 -4
  8. package/{esm2020 → esm2022}/lib/modules/tiles/tile-content/tile-content.component.mjs +4 -4
  9. package/{esm2020 → esm2022}/lib/modules/tiles/tile-content/tile-content.module.mjs +5 -5
  10. package/esm2022/lib/modules/tiles/tile-dashboard/tile-dashboard.component.mjs +137 -0
  11. package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard/tile-dashboard.module.mjs +9 -9
  12. package/esm2022/lib/modules/tiles/tile-dashboard/tile-dashboard.service.mjs +560 -0
  13. package/esm2022/lib/modules/tiles/tile-dashboard-column/tile-dashboard-column.component.mjs +30 -0
  14. package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-column/tile-dashboard-column.module.mjs +5 -5
  15. package/{esm2020 → esm2022}/lib/modules/tiles/tiles.module.mjs +11 -11
  16. package/fesm2022/skyux-tiles.mjs +1123 -0
  17. package/{fesm2020 → fesm2022}/skyux-tiles.mjs.map +1 -1
  18. package/lib/modules/tiles/tile/tile.component.d.ts +1 -1
  19. package/lib/modules/tiles/tile-dashboard/tile-dashboard.component.d.ts +1 -1
  20. package/package.json +13 -19
  21. package/esm2020/lib/modules/shared/sky-tiles-resources.module.mjs +0 -60
  22. package/esm2020/lib/modules/tiles/tile/tile.component.mjs +0 -165
  23. package/esm2020/lib/modules/tiles/tile-dashboard/tile-dashboard.component.mjs +0 -136
  24. package/esm2020/lib/modules/tiles/tile-dashboard/tile-dashboard.service.mjs +0 -540
  25. package/esm2020/lib/modules/tiles/tile-dashboard-column/tile-dashboard-column.component.mjs +0 -33
  26. package/fesm2015/skyux-tiles.mjs +0 -1115
  27. package/fesm2015/skyux-tiles.mjs.map +0 -1
  28. package/fesm2020/skyux-tiles.mjs +0 -1103
  29. /package/{esm2020 → esm2022}/index.mjs +0 -0
  30. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard/tile-dashboard-message-type.mjs +0 -0
  31. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard/tile-dashboard-message.mjs +0 -0
  32. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-config/tile-dashboard-config-layout-column.mjs +0 -0
  33. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-config/tile-dashboard-config-layout-tile.mjs +0 -0
  34. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-config/tile-dashboard-config-layout.mjs +0 -0
  35. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-config/tile-dashboard-config-reorder-data.mjs +0 -0
  36. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-config/tile-dashboard-config-tile.mjs +0 -0
  37. /package/{esm2020 → esm2022}/lib/modules/tiles/tile-dashboard-config/tile-dashboard-config.mjs +0 -0
  38. /package/{esm2020 → esm2022}/skyux-tiles.mjs +0 -0
@@ -0,0 +1,1123 @@
1
+ import * as i4 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { NgModule, Component, EventEmitter, inject, Injectable, Output, ElementRef, Optional, Input, ViewChild, ViewContainerRef, ViewChildren } from '@angular/core';
5
+ import * as i2 from '@skyux/core';
6
+ import { SkyDynamicComponentService, SkyMediaQueryService, SkyUIConfigService, SkyMediaBreakpoints, SkyDynamicComponentLocation, SkyIdModule, SkyTrimModule } from '@skyux/core';
7
+ import * as i3$1 from '@skyux/i18n';
8
+ import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
9
+ import * as i3 from '@skyux/indicators';
10
+ import { SkyChevronModule, SkyIconModule } from '@skyux/indicators';
11
+ import * as i5 from '@skyux/theme';
12
+ import { SkyThemeModule } from '@skyux/theme';
13
+ import { skyAnimationSlide } from '@skyux/animations';
14
+ import { Subject } from 'rxjs';
15
+ import { take, takeUntil } from 'rxjs/operators';
16
+ import * as i2$1 from 'ng2-dragula';
17
+ import { DragulaService, DragulaModule } from 'ng2-dragula';
18
+
19
+ /**
20
+ * NOTICE: DO NOT MODIFY THIS FILE!
21
+ * The contents of this file were automatically generated by
22
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-tiles' schematic.
23
+ * To update this file, simply rerun the command.
24
+ */
25
+ const RESOURCES = {
26
+ 'EN-US': {
27
+ skyux_tile_expand: { message: 'Expand or collapse {0}' },
28
+ skyux_tile_expand_default: { message: 'Expand or collapse' },
29
+ skyux_tile_help: { message: '{0} help' },
30
+ skyux_tile_help_default: { message: 'Help' },
31
+ skyux_tile_settings: { message: '{0} settings' },
32
+ skyux_tile_settings_default: { message: 'Settings' },
33
+ skyux_tile_move: { message: 'Move {0}' },
34
+ skyux_tile_move_default: { message: 'Move' },
35
+ skyux_tile_move_instructions: {
36
+ message: "When focus is placed on a tile's move button, use the arrow keys to move it. The up and down keys change its position within a column. The left and right keys move it between columns.",
37
+ },
38
+ skyux_tile_moved_assistive_text: {
39
+ message: '{0} moved. Current column: {1} of {2}. Current position in column: {3} of {4}',
40
+ },
41
+ },
42
+ };
43
+ class SkyTilesResourcesProvider {
44
+ getString(localeInfo, name) {
45
+ return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
46
+ }
47
+ }
48
+ /**
49
+ * Import into any component library module that needs to use resource strings.
50
+ */
51
+ class SkyTilesResourcesModule {
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
53
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesResourcesModule, exports: [SkyI18nModule] }); }
54
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesResourcesModule, providers: [
55
+ {
56
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
57
+ useClass: SkyTilesResourcesProvider,
58
+ multi: true,
59
+ },
60
+ ], imports: [SkyI18nModule] }); }
61
+ }
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesResourcesModule, decorators: [{
63
+ type: NgModule,
64
+ args: [{
65
+ exports: [SkyI18nModule],
66
+ providers: [
67
+ {
68
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
69
+ useClass: SkyTilesResourcesProvider,
70
+ multi: true,
71
+ },
72
+ ],
73
+ }]
74
+ }] });
75
+
76
+ /**
77
+ * Specifies content to display in the tile's summary.
78
+ */
79
+ /* istanbul ignore next */
80
+ /* Code coverage having problems with no statements in classes */
81
+ class SkyTileSummaryComponent {
82
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
83
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileSummaryComponent, selector: "sky-tile-summary", ngImport: i0, template: "<ng-content></ng-content>\n" }); }
84
+ }
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileSummaryComponent, decorators: [{
86
+ type: Component,
87
+ args: [{ selector: 'sky-tile-summary', template: "<ng-content></ng-content>\n" }]
88
+ }] });
89
+
90
+ /**
91
+ * Specifies content to display in the tile's title.
92
+ */
93
+ class SkyTileTitleComponent {
94
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
95
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileTitleComponent, selector: "sky-tile-title", ngImport: i0, template: "<h2 class=\"sky-tile-title sky-font-heading-2\">\n <span skyTrim><ng-content></ng-content></span\n ><span class=\"sky-control-help-container\"\n ><ng-content select=\".sky-control-help\"></ng-content\n ></span>\n</h2>\n", styles: [".sky-tile-title{margin:0;padding:10px 15px}:host-context(.sky-theme-modern) .sky-tile-title{margin:0 30px 0 0;padding:0}.sky-theme-modern .sky-tile-title{margin:0 30px 0 0;padding:0}\n"], dependencies: [{ kind: "directive", type: i2.λ4, selector: "[skyTrim]" }] }); }
96
+ }
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileTitleComponent, decorators: [{
98
+ type: Component,
99
+ args: [{ selector: 'sky-tile-title', template: "<h2 class=\"sky-tile-title sky-font-heading-2\">\n <span skyTrim><ng-content></ng-content></span\n ><span class=\"sky-control-help-container\"\n ><ng-content select=\".sky-control-help\"></ng-content\n ></span>\n</h2>\n", styles: [".sky-tile-title{margin:0;padding:10px 15px}:host-context(.sky-theme-modern) .sky-tile-title{margin:0 30px 0 0;padding:0}.sky-theme-modern .sky-tile-title{margin:0 30px 0 0;padding:0}\n"] }]
100
+ }] });
101
+
102
+ const ATTR_TILE_ID = '_sky-tile-dashboard-tile-id';
103
+ let bagIdIndex = 0;
104
+ class SkyTileDashboardService {
105
+ #columns;
106
+ #config;
107
+ #mediaSubscription;
108
+ #singleColumn;
109
+ #settingsKey;
110
+ #tileComponents;
111
+ #dragulaService;
112
+ #dynamicComponentService;
113
+ #mediaQuery;
114
+ #uiConfigService;
115
+ constructor() {
116
+ /**
117
+ * @internal
118
+ */
119
+ this.configChange = new EventEmitter();
120
+ /**
121
+ * Fires when the tile dashboard's initialization is complete.
122
+ */
123
+ this.dashboardInitialized = new EventEmitter();
124
+ this.#dragulaService = inject(DragulaService);
125
+ this.#dynamicComponentService = inject(SkyDynamicComponentService);
126
+ this.#mediaQuery = inject(SkyMediaQueryService);
127
+ this.#uiConfigService = inject(SkyUIConfigService);
128
+ this.bagId = `sky-tile-dashboard-bag-${++bagIdIndex}`;
129
+ this.#initDragula();
130
+ }
131
+ /**
132
+ * @internal
133
+ */
134
+ init(config, columns, singleColumn, settingsKey) {
135
+ if (settingsKey) {
136
+ // Clone this so changes to the config object outside of this class don't modify
137
+ // the config used inside and vice versa.
138
+ this.#config = Object.assign({}, config);
139
+ this.#settingsKey = settingsKey;
140
+ this.#uiConfigService
141
+ .getConfig(settingsKey, config)
142
+ .pipe(take(1))
143
+ .subscribe((value) => {
144
+ if (this.#config && value.persisted) {
145
+ this.#config.layout = value.layout;
146
+ this.#checkForNewTiles(value.tileIds);
147
+ this.configChange.emit(this.#config);
148
+ this.#columns = columns;
149
+ this.#singleColumn = singleColumn;
150
+ this.#checkReadyAndLoadTiles();
151
+ }
152
+ else {
153
+ // Bad data, or config is the default config.
154
+ this.#initToDefaults(config, columns, singleColumn);
155
+ }
156
+ }, (error) => {
157
+ // Config setting key doesn't exist or other config service error
158
+ this.#initToDefaults(config, columns, singleColumn);
159
+ });
160
+ }
161
+ else {
162
+ this.#initToDefaults(config, columns, singleColumn);
163
+ }
164
+ }
165
+ /**
166
+ * Adds a new tile to the tile dashboard.
167
+ * @param tile Specifies the tile configuration.
168
+ * @param component Specifies the tile component to add.
169
+ */
170
+ addTileComponent(tile, component) {
171
+ this.#tileComponents = this.#tileComponents || [];
172
+ this.#tileComponents.push(component);
173
+ component.location.nativeElement.setAttribute(ATTR_TILE_ID, tile.id);
174
+ }
175
+ /**
176
+ * Checks whether a specified tile is collapsed.
177
+ * @param tile Specifies the tile component to check.
178
+ */
179
+ tileIsCollapsed(tile) {
180
+ const tileConfig = this.#findTile(this.#getTileId(tile));
181
+ if (tileConfig) {
182
+ return tileConfig.isCollapsed;
183
+ }
184
+ return false;
185
+ }
186
+ /**
187
+ * Sets the collapsed state of all tiles.
188
+ * @param isCollapsed Indicates whether tiles are collapsed.
189
+ */
190
+ setAllTilesCollapsed(isCollapsed) {
191
+ /*istanbul ignore else */
192
+ if (this.#config && this.#config.layout.multiColumn) {
193
+ for (const column of this.#config.layout.multiColumn) {
194
+ for (const tile of column.tiles) {
195
+ tile.isCollapsed = isCollapsed;
196
+ }
197
+ }
198
+ for (const tile of this.#config.layout.singleColumn.tiles) {
199
+ tile.isCollapsed = isCollapsed;
200
+ }
201
+ }
202
+ if (this.#settingsKey) {
203
+ this.#setUserConfig(this.#config);
204
+ }
205
+ this.configChange.emit(this.#config);
206
+ }
207
+ /**
208
+ * Sets the collapsed state of a specified tile.
209
+ * @param tile Specifies the tile component.
210
+ * @param isCollapsed Indicates whether the tile is collapsed.
211
+ */
212
+ setTileCollapsed(tile, isCollapsed) {
213
+ const tileConfig = this.#findTile(this.#getTileId(tile));
214
+ if (tileConfig) {
215
+ tileConfig.isCollapsed = isCollapsed;
216
+ if (this.#settingsKey) {
217
+ this.#setUserConfig(this.#config);
218
+ }
219
+ this.configChange.emit(this.#config);
220
+ }
221
+ }
222
+ /**
223
+ * @internal
224
+ */
225
+ getTileComponentType(layoutTile) {
226
+ if (layoutTile && this.#config) {
227
+ for (const tile of this.#config.tiles) {
228
+ if (tile.id === layoutTile.id) {
229
+ return tile.componentType;
230
+ }
231
+ }
232
+ }
233
+ return undefined;
234
+ }
235
+ /**
236
+ * @internal
237
+ */
238
+ changeColumnMode(isSingleColumn) {
239
+ /*istanbul ignore else */
240
+ if (this.#config) {
241
+ if (isSingleColumn) {
242
+ this.#moveTilesToSingleColumn();
243
+ }
244
+ else {
245
+ this.#moveTilesToMultiColumn();
246
+ }
247
+ }
248
+ }
249
+ /**
250
+ * @internal
251
+ */
252
+ getTileComponent(tileId) {
253
+ if (this.#tileComponents) {
254
+ for (const tileComponent of this.#tileComponents) {
255
+ if (tileComponent.location.nativeElement.getAttribute(ATTR_TILE_ID) ===
256
+ tileId) {
257
+ return tileComponent;
258
+ }
259
+ }
260
+ }
261
+ /*istanbul ignore next */
262
+ return undefined;
263
+ }
264
+ /**
265
+ * @internal
266
+ */
267
+ destroy() {
268
+ /*istanbul ignore else */
269
+ if (this.#mediaSubscription) {
270
+ this.#mediaSubscription.unsubscribe();
271
+ }
272
+ }
273
+ /**
274
+ * @internal
275
+ */
276
+ moveTileOnKeyDown(tileCmp, direction, tileDescription) {
277
+ if (this.#config) {
278
+ const isSingleColumnMode = this.#mediaQuery.current === SkyMediaBreakpoints.xs ||
279
+ this.#mediaQuery.current === SkyMediaBreakpoints.sm;
280
+ const tileId = this.#getTileId(tileCmp);
281
+ const tile = this.#findTile(tileId);
282
+ let column;
283
+ let colIndex = 0;
284
+ if (isSingleColumnMode) {
285
+ column = this.#config.layout.singleColumn;
286
+ }
287
+ else {
288
+ column = this.#findTileColumn(tileId);
289
+ colIndex = this.#config.layout.multiColumn.findIndex((value) => value === column);
290
+ }
291
+ if (column && tile && tileId) {
292
+ if ((direction === 'left' || direction === 'right') &&
293
+ !isSingleColumnMode) {
294
+ const operator = direction === 'left' ? -1 : 1;
295
+ const newColumn = this.#config.layout.multiColumn[colIndex + operator];
296
+ if (newColumn) {
297
+ // Move the tile to the end of the new column
298
+ newColumn.tiles.push(tile);
299
+ column.tiles = column.tiles.filter((item) => item !== tile);
300
+ this.#moveTilesToColumn(this.#columns?.toArray()[colIndex + operator], [tile]);
301
+ // Report the change in configuration
302
+ const reportConfig = this.#config;
303
+ reportConfig.movedTile = {
304
+ tileDescription: tileDescription || /* istanbul ignore next */ tile.id,
305
+ column: colIndex + operator + 1,
306
+ position: newColumn.tiles.length,
307
+ };
308
+ this.configChange.emit(reportConfig);
309
+ }
310
+ }
311
+ else {
312
+ const operator = direction === 'up' ? -1 : 1;
313
+ const curIndex = column.tiles.findIndex((value) => value.id === tile.id);
314
+ const tileComponentInstance = this.getTileComponent(tileId);
315
+ if (tileComponentInstance && column.tiles[curIndex + operator]) {
316
+ const temp = column.tiles[curIndex + operator];
317
+ column.tiles[curIndex + operator] = tile;
318
+ column.tiles[curIndex] = temp;
319
+ // Get the column element
320
+ let columnEl;
321
+ if (isSingleColumnMode) {
322
+ columnEl = this.#getColumnEl(this.#singleColumn);
323
+ }
324
+ else {
325
+ columnEl = this.#getColumnEl(this.#columns?.toArray()[colIndex]);
326
+ }
327
+ // Move the tile element in the document
328
+ if (curIndex + operator === column.tiles.length - 1) {
329
+ columnEl?.appendChild(tileComponentInstance.location.nativeElement);
330
+ }
331
+ else {
332
+ columnEl?.insertBefore(tileComponentInstance.location.nativeElement, this.getTileComponent(column.tiles[curIndex + operator + 1].id)
333
+ ?.location.nativeElement);
334
+ }
335
+ // Report the change in configuration
336
+ const reportConfig = this.#config;
337
+ reportConfig.movedTile = {
338
+ tileDescription: tileDescription || /* istanbul ignore next */ tile.id,
339
+ column: isSingleColumnMode ? 1 : colIndex + 1,
340
+ position: curIndex + operator + 1,
341
+ };
342
+ this.configChange.emit(reportConfig);
343
+ }
344
+ }
345
+ }
346
+ }
347
+ }
348
+ #getTileId(tile) {
349
+ if (tile) {
350
+ let el = tile.elementRef.nativeElement;
351
+ let tileId;
352
+ while (el) {
353
+ tileId = el.getAttribute(ATTR_TILE_ID);
354
+ if (tileId) {
355
+ return tileId;
356
+ }
357
+ el = el.parentElement;
358
+ }
359
+ }
360
+ return undefined;
361
+ }
362
+ #getTileOrRemoveFromLayout(layoutTile) {
363
+ /*istanbul ignore else */
364
+ if (layoutTile && this.#config) {
365
+ for (const tile of this.#config.tiles) {
366
+ if (tile.id === layoutTile.id) {
367
+ return tile;
368
+ }
369
+ }
370
+ // If the layout tile was not found in the list of tiles, it was removed since last the user updated settings
371
+ /*istanbul ignore else */
372
+ if (this.#config?.layout.singleColumn) {
373
+ this.#config.layout.singleColumn.tiles =
374
+ this.#config.layout.singleColumn.tiles.filter((elem) => elem.id !== layoutTile.id);
375
+ }
376
+ /*istanbul ignore else */
377
+ if (this.#config?.layout.multiColumn) {
378
+ this.#config.layout.multiColumn.forEach((elem) => {
379
+ elem.tiles = elem.tiles.filter((res) => res.id !== layoutTile.id);
380
+ });
381
+ }
382
+ }
383
+ /*istanbul ignore next */
384
+ return undefined;
385
+ }
386
+ #checkReadyAndLoadTiles() {
387
+ if (this.#config && this.#columns) {
388
+ this.#loadTiles(this.#config);
389
+ this.#initMediaQueries();
390
+ this.dashboardInitialized.emit();
391
+ }
392
+ }
393
+ #loadTiles(config) {
394
+ const layout = config.layout;
395
+ if (this.#mediaQuery.current === SkyMediaBreakpoints.xs ||
396
+ this.#mediaQuery.current === SkyMediaBreakpoints.sm) {
397
+ for (const tile of layout.singleColumn.tiles) {
398
+ this.#loadTileIntoColumn(this.#singleColumn, tile);
399
+ }
400
+ }
401
+ else {
402
+ let columns = [];
403
+ /*istanbul ignore else */
404
+ if (this.#columns) {
405
+ columns = this.#columns?.toArray();
406
+ }
407
+ for (let i = 0, n = layout.multiColumn.length; i < n; i++) {
408
+ const column = columns[i];
409
+ for (const tile of layout.multiColumn[i].tiles) {
410
+ this.#loadTileIntoColumn(column, tile);
411
+ }
412
+ }
413
+ }
414
+ }
415
+ #loadTileIntoColumn(column, layoutTile) {
416
+ if (column) {
417
+ const tile = this.#getTileOrRemoveFromLayout(layoutTile);
418
+ /*istanbul ignore else */
419
+ if (tile && this.#dynamicComponentService) {
420
+ const componentType = tile.componentType;
421
+ const providers = tile.providers /* istanbul ignore next */ || [];
422
+ const componentRef = this.#dynamicComponentService.createComponent(componentType, {
423
+ location: SkyDynamicComponentLocation.ElementBottom,
424
+ providers: providers,
425
+ viewContainerRef: column.content,
426
+ parentInjector: column.injector,
427
+ });
428
+ this.addTileComponent(layoutTile, componentRef);
429
+ // Make sure the component is marked for changes in case the parent component uses
430
+ // the OnPush change detection strategy.
431
+ componentRef.changeDetectorRef.markForCheck();
432
+ }
433
+ }
434
+ }
435
+ #moveTilesToSingleColumn() {
436
+ this.#moveTilesToColumn(this.#singleColumn, this.#config?.layout.singleColumn.tiles);
437
+ }
438
+ #moveTilesToMultiColumn() {
439
+ let layoutColumns = [];
440
+ /*istanbul ignore else */
441
+ if (this.#config) {
442
+ layoutColumns = this.#config.layout.multiColumn;
443
+ }
444
+ let columns = [];
445
+ /*istanbul ignore else */
446
+ if (this.#columns) {
447
+ columns = this.#columns?.toArray();
448
+ }
449
+ for (let i = 0, n = layoutColumns.length; i < n; i++) {
450
+ this.#moveTilesToColumn(columns[i], layoutColumns[i].tiles);
451
+ }
452
+ }
453
+ #moveTilesToColumn(column, layoutTiles) {
454
+ if (column && layoutTiles) {
455
+ const columnEl = this.#getColumnEl(column);
456
+ for (const layoutTile of layoutTiles) {
457
+ const tileComponentInstance = this.getTileComponent(layoutTile.id);
458
+ /*istanbul ignore else */
459
+ if (tileComponentInstance) {
460
+ columnEl?.appendChild(tileComponentInstance.location.nativeElement);
461
+ }
462
+ }
463
+ }
464
+ }
465
+ #getConfigForUIState() {
466
+ /*istanbul ignore else */
467
+ if (this.#config) {
468
+ this.#config = {
469
+ tiles: this.#config.tiles,
470
+ layout: {
471
+ singleColumn: this.#getSingleColumnLayoutForUIState(this.#config),
472
+ multiColumn: this.#getMultiColumnLayoutForUIState(this.#config),
473
+ },
474
+ };
475
+ }
476
+ return this.#config;
477
+ }
478
+ #getSingleColumnLayoutForUIState(config) {
479
+ if (this.#mediaQuery.current === SkyMediaBreakpoints.xs ||
480
+ this.#mediaQuery.current === SkyMediaBreakpoints.sm) {
481
+ return {
482
+ tiles: this.#getTilesInEl(this.#getColumnEl(this.#singleColumn)),
483
+ };
484
+ }
485
+ return config.layout.singleColumn;
486
+ }
487
+ #getMultiColumnLayoutForUIState(config) {
488
+ if (!(this.#mediaQuery.current === SkyMediaBreakpoints.xs ||
489
+ this.#mediaQuery.current === SkyMediaBreakpoints.sm)) {
490
+ const layoutColumns = [];
491
+ let columns = [];
492
+ /*istanbul ignore else */
493
+ if (this.#columns) {
494
+ columns = this.#columns?.toArray();
495
+ }
496
+ for (const column of columns) {
497
+ if (column !== this.#singleColumn) {
498
+ const layoutColumn = {
499
+ tiles: this.#getTilesInEl(this.#getColumnEl(column)),
500
+ };
501
+ layoutColumns.push(layoutColumn);
502
+ }
503
+ }
504
+ return layoutColumns;
505
+ }
506
+ return config.layout.multiColumn;
507
+ }
508
+ #getTilesInEl(el) {
509
+ const tileEls = el?.querySelectorAll('[' + ATTR_TILE_ID + ']');
510
+ const layoutTiles = [];
511
+ /*istanbul ignore else */
512
+ if (tileEls) {
513
+ for (let i = 0, n = tileEls.length; i < n; i++) {
514
+ const tileEl = tileEls[i];
515
+ const tileId = tileEl.getAttribute(ATTR_TILE_ID);
516
+ const tile = this.#findTile(tileId);
517
+ /*istanbul ignore else */
518
+ if (tile) {
519
+ layoutTiles.push(tile);
520
+ }
521
+ }
522
+ }
523
+ return layoutTiles;
524
+ }
525
+ #initMediaQueries() {
526
+ /*istanbul ignore else */
527
+ if (!this.#mediaSubscription) {
528
+ this.#mediaSubscription = this.#mediaQuery.subscribe((args) => {
529
+ this.changeColumnMode(args === SkyMediaBreakpoints.xs || args === SkyMediaBreakpoints.sm);
530
+ });
531
+ }
532
+ }
533
+ #initDragula() {
534
+ this.#dragulaService.createGroup(this.bagId, {
535
+ moves: (el, container, handle) => {
536
+ const target = el?.querySelector('.sky-tile-grab-handle');
537
+ return !!target && target.contains(handle);
538
+ },
539
+ });
540
+ this.#dragulaService.drop(this.bagId).subscribe(() => {
541
+ const config = this.#getConfigForUIState();
542
+ /*istanbul ignore else */
543
+ if (config) {
544
+ if (this.#settingsKey) {
545
+ this.#setUserConfig(config);
546
+ }
547
+ this.configChange.emit(config);
548
+ }
549
+ });
550
+ }
551
+ #getColumnEl(column) {
552
+ return column?.content?.element.nativeElement.parentNode;
553
+ }
554
+ #findTile(tileId) {
555
+ /*istanbul ignore else */
556
+ if (this.#config && this.#config.layout.multiColumn) {
557
+ for (const column of this.#config.layout.multiColumn) {
558
+ /*istanbul ignore else */
559
+ if (column.tiles) {
560
+ for (const tile of column.tiles) {
561
+ if (tile.id === tileId) {
562
+ return tile;
563
+ }
564
+ }
565
+ }
566
+ }
567
+ }
568
+ return undefined;
569
+ }
570
+ #findTileColumn(tileId) {
571
+ /*istanbul ignore else */
572
+ if (this.#config && this.#config.layout.multiColumn) {
573
+ return this.#config.layout.multiColumn.find((col) => col.tiles && !!col.tiles.find((tile) => tile.id === tileId));
574
+ }
575
+ /*istanbul ignore next */
576
+ return undefined;
577
+ }
578
+ #initToDefaults(config, columns, singleColumn) {
579
+ this.#config = config;
580
+ this.#columns = columns;
581
+ this.#singleColumn = singleColumn;
582
+ this.#checkReadyAndLoadTiles();
583
+ }
584
+ #setUserConfig(config) {
585
+ if (config && this.#settingsKey)
586
+ this.#uiConfigService
587
+ .setConfig(this.#settingsKey, {
588
+ layout: config.layout,
589
+ persisted: true,
590
+ tileIds: config.tiles.map((elem) => elem.id),
591
+ })
592
+ .subscribe(
593
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
594
+ () => { }, (err) => {
595
+ console.warn('Could not save tile dashboard settings.');
596
+ console.warn(err);
597
+ });
598
+ }
599
+ #checkForNewTiles(oldUserTiles) {
600
+ // Get a list of tiles that are in the config's default list but not in the user's settings
601
+ const newTiles = this.#config?.tiles.filter((elem) => {
602
+ return oldUserTiles.indexOf(elem.id) === -1;
603
+ });
604
+ const multiColumn = this.#config?.layout.multiColumn;
605
+ const singleColumn = this.#config?.layout.singleColumn;
606
+ // Append new tiles to the end of the layouts
607
+ /*istanbul ignore else */
608
+ if (newTiles?.length) {
609
+ /*istanbul ignore else */
610
+ if (multiColumn) {
611
+ newTiles?.forEach((elem) => {
612
+ let locationToAdd = 0;
613
+ let smallest = multiColumn[0].tiles.length;
614
+ multiColumn.forEach((item, index) => {
615
+ if (item.tiles.length < smallest) {
616
+ locationToAdd = index;
617
+ smallest = item.tiles.length;
618
+ }
619
+ });
620
+ multiColumn[locationToAdd].tiles.push({
621
+ id: elem.id,
622
+ isCollapsed: false,
623
+ });
624
+ });
625
+ }
626
+ /*istanbul ignore else */
627
+ if (singleColumn) {
628
+ newTiles?.forEach((elem) => {
629
+ singleColumn.tiles.push({ id: elem.id, isCollapsed: false });
630
+ });
631
+ }
632
+ }
633
+ /*istanbul ignore else */
634
+ if (singleColumn) {
635
+ for (const tile of singleColumn.tiles) {
636
+ this.#getTileOrRemoveFromLayout(tile);
637
+ }
638
+ }
639
+ /*istanbul ignore else */
640
+ if (multiColumn) {
641
+ for (let i = 0, n = multiColumn.length; i < n; i++) {
642
+ for (const tile of multiColumn[i].tiles) {
643
+ this.#getTileOrRemoveFromLayout(tile);
644
+ }
645
+ }
646
+ }
647
+ }
648
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
649
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardService }); }
650
+ }
651
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardService, decorators: [{
652
+ type: Injectable
653
+ }], ctorParameters: function () { return []; }, propDecorators: { dashboardInitialized: [{
654
+ type: Output
655
+ }] } });
656
+
657
+ /**
658
+ * Provides a common look-and-feel for tab content.
659
+ */
660
+ class SkyTileComponent {
661
+ get isCollapsed() {
662
+ if (this.#dashboardService) {
663
+ const configCollapsedState = this.#dashboardService.tileIsCollapsed(this);
664
+ this.#_isCollapsed = configCollapsedState;
665
+ }
666
+ return this.#_isCollapsed;
667
+ }
668
+ /**
669
+ * Whether the tile is in a collapsed state.
670
+ * @default false
671
+ */
672
+ set isCollapsed(value) {
673
+ this.#_isCollapsed = !!value;
674
+ if (this.#dashboardService) {
675
+ this.#dashboardService.setTileCollapsed(this, this.#_isCollapsed);
676
+ }
677
+ this.isCollapsedChange.emit(this.#_isCollapsed);
678
+ }
679
+ #changeDetector;
680
+ #dashboardService;
681
+ #ngUnsubscribe;
682
+ #_isCollapsed;
683
+ constructor(elementRef, changeDetector, dashboardService) {
684
+ this.elementRef = elementRef;
685
+ /**
686
+ * Whether to display a settings button in the tile header. To display the
687
+ * button, you must also listen for the `settingsClick` event.
688
+ * @default true
689
+ */
690
+ this.showSettings = true;
691
+ /**
692
+ * Whether to display a help button in the tile header. To display the
693
+ * button, you must also listen for the `helpClick` event.
694
+ * @default true
695
+ */
696
+ this.showHelp = true;
697
+ /**
698
+ * Fires when users select the settings button in the tile header. The settings
699
+ * button only appears when the `showSettings` property is set to `true`.
700
+ */
701
+ this.settingsClick = new EventEmitter();
702
+ /**
703
+ * Fires when the tile's collapsed state changes. Returns `true` when the tile
704
+ * collapses and `false` when it expands.
705
+ */
706
+ this.isCollapsedChange = new EventEmitter();
707
+ /**
708
+ * Fires when users select the help button in the tile header. The help
709
+ * button only appears when the `showHelp` property is set to `true`.
710
+ */
711
+ this.helpClick = new EventEmitter();
712
+ this.isInDashboardColumn = false;
713
+ this.#ngUnsubscribe = new Subject();
714
+ this.#_isCollapsed = false;
715
+ this.#changeDetector = changeDetector;
716
+ this.#dashboardService = dashboardService;
717
+ this.isInDashboardColumn = !!this.#dashboardService;
718
+ if (this.#dashboardService) {
719
+ this.ariaDescribedBy = `${this.#dashboardService.bagId}-move-instructions`;
720
+ /**
721
+ * This subscription ensures that if any values which come in from the dashboard service are
722
+ * updated that the component will update if the tile's parent component utilizes OnPush
723
+ * change detection.
724
+ */
725
+ this.#dashboardService.configChange
726
+ .pipe(takeUntil(this.#ngUnsubscribe))
727
+ .subscribe(() => {
728
+ this.#changeDetector.markForCheck();
729
+ });
730
+ }
731
+ }
732
+ ngOnDestroy() {
733
+ this.#ngUnsubscribe.next();
734
+ this.#ngUnsubscribe.complete();
735
+ }
736
+ settingsButtonClicked() {
737
+ this.settingsClick.emit(undefined);
738
+ }
739
+ helpButtonClicked() {
740
+ this.helpClick.emit(undefined);
741
+ }
742
+ get hasSettings() {
743
+ return this.settingsClick.observers.length > 0 && this.showSettings;
744
+ }
745
+ get hasHelp() {
746
+ return this.helpClick.observers.length > 0 && this.showHelp;
747
+ }
748
+ titleClick() {
749
+ this.isCollapsed = !this.isCollapsed;
750
+ }
751
+ chevronDirectionChange(direction) {
752
+ this.isCollapsed = direction === 'down';
753
+ }
754
+ moveTile(event) {
755
+ /* istanbul ignore else */
756
+ if (this.#dashboardService) {
757
+ const direction = event.key.toLowerCase().replace('arrow', '');
758
+ /* istanbul ignore else */
759
+ if (direction === 'up' ||
760
+ direction === 'down' ||
761
+ direction === 'left' ||
762
+ direction === 'right') {
763
+ this.#dashboardService.moveTileOnKeyDown(this, direction, this.title
764
+ ? this.title.nativeElement.innerText
765
+ : /* istanbul ignore next */
766
+ undefined);
767
+ this.#focusHandle();
768
+ }
769
+ }
770
+ }
771
+ #focusHandle() {
772
+ this.grabHandle?.nativeElement.focus();
773
+ }
774
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: SkyTileDashboardService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
775
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileComponent, selector: "sky-tile", inputs: { showSettings: "showSettings", showHelp: "showHelp", tileName: "tileName", isCollapsed: "isCollapsed" }, outputs: { settingsClick: "settingsClick", isCollapsedChange: "isCollapsedChange", helpClick: "helpClick" }, viewQueries: [{ propertyName: "grabHandle", first: true, predicate: ["grabHandle"], descendants: true, read: ElementRef }, { propertyName: "title", first: true, predicate: ["titleContainer"], descendants: true, read: ElementRef }], ngImport: i0, template: "<section\n class=\"sky-tile\"\n [ngClass]=\"{\n 'sky-tile-collapsed': isCollapsed\n }\"\n [skyThemeClass]=\"{\n 'sky-box sky-elevation-1-bordered sky-padding-even-xl': 'modern'\n }\"\n>\n <header class=\"sky-tile-header\">\n <div class=\"sky-tile-header-content\" (click)=\"titleClick()\">\n <div class=\"sky-tile-header-title\" #titleContainer>\n <ng-content select=\"sky-tile-title\"></ng-content>\n </div>\n <div class=\"sky-tile-summary sky-font-display-3\">\n <ng-content select=\"sky-tile-summary\"></ng-content>\n </div>\n </div>\n <div class=\"sky-tile-header-column-tools\">\n <div class=\"sky-tile-tools\">\n <ng-container *skyThemeIf=\"'default'\">\n <button\n *ngIf=\"hasHelp\"\n class=\"sky-btn sky-tile-tools-control sky-tile-help\"\n type=\"button\"\n [attr.aria-label]=\"\n tileName\n ? ('skyux_tile_help' | skyLibResources : tileName)\n : ('skyux_tile_help_default' | skyLibResources)\n \"\n [skyThemeClass]=\"{\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"helpButtonClicked()\"\n >\n <sky-icon icon=\"question-circle\"></sky-icon>\n </button>\n </ng-container>\n <sky-chevron\n [ariaControls]=\"tileContent.id\"\n [ariaLabel]=\"\n tileName\n ? ('skyux_tile_expand' | skyLibResources : tileName)\n : ('skyux_tile_expand_default' | skyLibResources)\n \"\n [direction]=\"isCollapsed ? 'down' : 'up'\"\n [skyThemeClass]=\"{\n 'sky-tile-tools-control': 'default',\n 'sky-margin-inline-default': 'modern'\n }\"\n (directionChange)=\"chevronDirectionChange($event)\"\n >\n </sky-chevron>\n <button\n *ngIf=\"hasSettings\"\n class=\"sky-btn sky-tile-settings\"\n type=\"button\"\n [attr.aria-label]=\"\n tileName\n ? ('skyux_tile_settings' | skyLibResources : tileName)\n : ('skyux_tile_settings_default' | skyLibResources)\n \"\n [skyThemeClass]=\"{\n 'sky-tile-tools-control': 'default',\n 'sky-btn-icon-borderless sky-margin-inline-default': 'modern'\n }\"\n (click)=\"settingsButtonClicked()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"cog\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"cog-line\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n <button\n *ngIf=\"isInDashboardColumn\"\n class=\"sky-btn sky-tile-grab-handle\"\n [attr.aria-label]=\"\n tileName\n ? ('skyux_tile_move' | skyLibResources : tileName)\n : ('skyux_tile_move_default' | skyLibResources)\n \"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [skyThemeClass]=\"{\n 'sky-tile-tools-control': 'default',\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"moveTile($event)\"\n #grabHandle\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"th\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"tile-drag\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </div>\n </div>\n </header>\n <div\n class=\"sky-tile-content\"\n role=\"region\"\n skyId\n [attr.aria-label]=\"tileName\"\n [@skyAnimationSlide]=\"isCollapsed ? 'up' : 'down'\"\n #tileContent=\"skyId\"\n >\n <ng-content select=\"sky-tile-content\"></ng-content>\n </div>\n</section>\n", styles: [".sky-tile{background-color:#fff;margin-bottom:20px}.sky-tile-header{border-color:#cdcfd2;border-style:solid solid none;border-width:4px 0 0;display:flex}.sky-tile-header-content{display:flex;flex:1;align-items:baseline;cursor:pointer}.sky-tile-header-title{display:inline-flex}.sky-tile-summary{color:#0974a1;opacity:0;padding-right:15px;transition:opacity .25s;max-height:30px;overflow:hidden}.sky-tile-collapsed .sky-tile-summary{opacity:1}.sky-tile-header-column-tools{display:flex;align-items:center;flex:0 0 auto}.sky-tile-tools{display:flex;padding-right:15px}.sky-tile-tools-control{color:#cdcfd2;cursor:pointer;border:0;width:24px;height:24px;padding:0;display:block;margin:0 0 0 9px}.sky-tile-tools-control:hover{color:#979ba2;transition:color .15s}.sky-tile-grab-handle{cursor:move;cursor:-moz-grab;font-size:15px}.sky-tile-content{border-color:#e2e3e4;border-image:none;border-style:solid solid none;border-width:1px 0}:host-context(.sky-theme-modern) .sky-tile-header,:host-context(.sky-theme-modern) .sky-tile-content{border:none}:host-context(.sky-theme-modern) .sky-tile-header-column-tools{align-items:flex-start}:host-context(.sky-theme-modern) .sky-tile-tools{padding:0}:host-context(.sky-theme-modern) .sky-tile-tools-control{font-size:18px;color:#686c73}:host-context(.sky-theme-modern) .sky-tile-grab-handle{font-size:16px}:host-context(.sky-theme-modern) .sky-tile-content ::ng-deep .sky-tile-content-section{border-bottom:1px dotted #c0c2c5}:host-context(.sky-theme-modern) .sky-tile-content ::ng-deep sky-tile-content-section:first-child .sky-tile-content-section{margin-top:15px}:host-context(.sky-theme-modern) .sky-tile-content ::ng-deep sky-tile-content-section:last-child .sky-tile-content-section{padding-bottom:0;border-bottom:none}:host-context(.sky-theme-modern) :host .sky-tile{border-radius:0}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-xs) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:0}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-tile{border-radius:6px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:6px}.sky-theme-modern .sky-tile-header,.sky-theme-modern .sky-tile-content{border:none}.sky-theme-modern .sky-tile-header-column-tools{align-items:flex-start}.sky-theme-modern .sky-tile-tools{padding:0}.sky-theme-modern .sky-tile-tools-control{font-size:18px;color:#686c73}.sky-theme-modern .sky-tile-grab-handle{font-size:16px}.sky-theme-modern .sky-tile-content ::ng-deep .sky-tile-content-section{border-bottom:1px dotted #c0c2c5}.sky-theme-modern .sky-tile-content ::ng-deep sky-tile-content-section:first-child .sky-tile-content-section{margin-top:15px}.sky-theme-modern .sky-tile-content ::ng-deep sky-tile-content-section:last-child .sky-tile-content-section{padding-bottom:0;border-bottom:none}.sky-theme-modern :host .sky-tile{border-radius:0}.sky-theme-modern :host-context(.sky-responsive-container-xs) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:0}@media (min-width: 768px){.sky-theme-modern :host .sky-tile{border-radius:6px}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:6px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.λ2, selector: "sky-chevron", inputs: ["ariaControls", "ariaLabel", "direction", "disabled"], outputs: ["directionChange"] }, { kind: "directive", type: i2.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "component", type: i3.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "directive", type: i5.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "directive", type: i5.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { kind: "pipe", type: i3$1.SkyLibResourcesPipe, name: "skyLibResources" }], animations: [skyAnimationSlide] }); }
776
+ }
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileComponent, decorators: [{
778
+ type: Component,
779
+ args: [{ selector: 'sky-tile', animations: [skyAnimationSlide], template: "<section\n class=\"sky-tile\"\n [ngClass]=\"{\n 'sky-tile-collapsed': isCollapsed\n }\"\n [skyThemeClass]=\"{\n 'sky-box sky-elevation-1-bordered sky-padding-even-xl': 'modern'\n }\"\n>\n <header class=\"sky-tile-header\">\n <div class=\"sky-tile-header-content\" (click)=\"titleClick()\">\n <div class=\"sky-tile-header-title\" #titleContainer>\n <ng-content select=\"sky-tile-title\"></ng-content>\n </div>\n <div class=\"sky-tile-summary sky-font-display-3\">\n <ng-content select=\"sky-tile-summary\"></ng-content>\n </div>\n </div>\n <div class=\"sky-tile-header-column-tools\">\n <div class=\"sky-tile-tools\">\n <ng-container *skyThemeIf=\"'default'\">\n <button\n *ngIf=\"hasHelp\"\n class=\"sky-btn sky-tile-tools-control sky-tile-help\"\n type=\"button\"\n [attr.aria-label]=\"\n tileName\n ? ('skyux_tile_help' | skyLibResources : tileName)\n : ('skyux_tile_help_default' | skyLibResources)\n \"\n [skyThemeClass]=\"{\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"helpButtonClicked()\"\n >\n <sky-icon icon=\"question-circle\"></sky-icon>\n </button>\n </ng-container>\n <sky-chevron\n [ariaControls]=\"tileContent.id\"\n [ariaLabel]=\"\n tileName\n ? ('skyux_tile_expand' | skyLibResources : tileName)\n : ('skyux_tile_expand_default' | skyLibResources)\n \"\n [direction]=\"isCollapsed ? 'down' : 'up'\"\n [skyThemeClass]=\"{\n 'sky-tile-tools-control': 'default',\n 'sky-margin-inline-default': 'modern'\n }\"\n (directionChange)=\"chevronDirectionChange($event)\"\n >\n </sky-chevron>\n <button\n *ngIf=\"hasSettings\"\n class=\"sky-btn sky-tile-settings\"\n type=\"button\"\n [attr.aria-label]=\"\n tileName\n ? ('skyux_tile_settings' | skyLibResources : tileName)\n : ('skyux_tile_settings_default' | skyLibResources)\n \"\n [skyThemeClass]=\"{\n 'sky-tile-tools-control': 'default',\n 'sky-btn-icon-borderless sky-margin-inline-default': 'modern'\n }\"\n (click)=\"settingsButtonClicked()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"cog\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"cog-line\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n <button\n *ngIf=\"isInDashboardColumn\"\n class=\"sky-btn sky-tile-grab-handle\"\n [attr.aria-label]=\"\n tileName\n ? ('skyux_tile_move' | skyLibResources : tileName)\n : ('skyux_tile_move_default' | skyLibResources)\n \"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [skyThemeClass]=\"{\n 'sky-tile-tools-control': 'default',\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"moveTile($event)\"\n #grabHandle\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"th\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"tile-drag\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </div>\n </div>\n </header>\n <div\n class=\"sky-tile-content\"\n role=\"region\"\n skyId\n [attr.aria-label]=\"tileName\"\n [@skyAnimationSlide]=\"isCollapsed ? 'up' : 'down'\"\n #tileContent=\"skyId\"\n >\n <ng-content select=\"sky-tile-content\"></ng-content>\n </div>\n</section>\n", styles: [".sky-tile{background-color:#fff;margin-bottom:20px}.sky-tile-header{border-color:#cdcfd2;border-style:solid solid none;border-width:4px 0 0;display:flex}.sky-tile-header-content{display:flex;flex:1;align-items:baseline;cursor:pointer}.sky-tile-header-title{display:inline-flex}.sky-tile-summary{color:#0974a1;opacity:0;padding-right:15px;transition:opacity .25s;max-height:30px;overflow:hidden}.sky-tile-collapsed .sky-tile-summary{opacity:1}.sky-tile-header-column-tools{display:flex;align-items:center;flex:0 0 auto}.sky-tile-tools{display:flex;padding-right:15px}.sky-tile-tools-control{color:#cdcfd2;cursor:pointer;border:0;width:24px;height:24px;padding:0;display:block;margin:0 0 0 9px}.sky-tile-tools-control:hover{color:#979ba2;transition:color .15s}.sky-tile-grab-handle{cursor:move;cursor:-moz-grab;font-size:15px}.sky-tile-content{border-color:#e2e3e4;border-image:none;border-style:solid solid none;border-width:1px 0}:host-context(.sky-theme-modern) .sky-tile-header,:host-context(.sky-theme-modern) .sky-tile-content{border:none}:host-context(.sky-theme-modern) .sky-tile-header-column-tools{align-items:flex-start}:host-context(.sky-theme-modern) .sky-tile-tools{padding:0}:host-context(.sky-theme-modern) .sky-tile-tools-control{font-size:18px;color:#686c73}:host-context(.sky-theme-modern) .sky-tile-grab-handle{font-size:16px}:host-context(.sky-theme-modern) .sky-tile-content ::ng-deep .sky-tile-content-section{border-bottom:1px dotted #c0c2c5}:host-context(.sky-theme-modern) .sky-tile-content ::ng-deep sky-tile-content-section:first-child .sky-tile-content-section{margin-top:15px}:host-context(.sky-theme-modern) .sky-tile-content ::ng-deep sky-tile-content-section:last-child .sky-tile-content-section{padding-bottom:0;border-bottom:none}:host-context(.sky-theme-modern) :host .sky-tile{border-radius:0}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-xs) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:0}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-tile{border-radius:6px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:6px}.sky-theme-modern .sky-tile-header,.sky-theme-modern .sky-tile-content{border:none}.sky-theme-modern .sky-tile-header-column-tools{align-items:flex-start}.sky-theme-modern .sky-tile-tools{padding:0}.sky-theme-modern .sky-tile-tools-control{font-size:18px;color:#686c73}.sky-theme-modern .sky-tile-grab-handle{font-size:16px}.sky-theme-modern .sky-tile-content ::ng-deep .sky-tile-content-section{border-bottom:1px dotted #c0c2c5}.sky-theme-modern .sky-tile-content ::ng-deep sky-tile-content-section:first-child .sky-tile-content-section{margin-top:15px}.sky-theme-modern .sky-tile-content ::ng-deep sky-tile-content-section:last-child .sky-tile-content-section{padding-bottom:0;border-bottom:none}.sky-theme-modern :host .sky-tile{border-radius:0}.sky-theme-modern :host-context(.sky-responsive-container-xs) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:0}@media (min-width: 768px){.sky-theme-modern :host .sky-tile{border-radius:6px}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile{border-radius:6px}\n"] }]
780
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: SkyTileDashboardService, decorators: [{
781
+ type: Optional
782
+ }] }]; }, propDecorators: { showSettings: [{
783
+ type: Input
784
+ }], showHelp: [{
785
+ type: Input
786
+ }], tileName: [{
787
+ type: Input
788
+ }], settingsClick: [{
789
+ type: Output
790
+ }], isCollapsedChange: [{
791
+ type: Output
792
+ }], helpClick: [{
793
+ type: Output
794
+ }], isCollapsed: [{
795
+ type: Input
796
+ }], grabHandle: [{
797
+ type: ViewChild,
798
+ args: ['grabHandle', {
799
+ read: ElementRef,
800
+ static: false,
801
+ }]
802
+ }], title: [{
803
+ type: ViewChild,
804
+ args: ['titleContainer', {
805
+ read: ElementRef,
806
+ static: false,
807
+ }]
808
+ }] } });
809
+
810
+ class SkyTileModule {
811
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
812
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyTileModule, declarations: [SkyTileComponent,
813
+ SkyTileSummaryComponent,
814
+ SkyTileTitleComponent], imports: [CommonModule,
815
+ SkyChevronModule,
816
+ SkyIdModule,
817
+ SkyI18nModule,
818
+ SkyIconModule,
819
+ SkyThemeModule,
820
+ SkyTilesResourcesModule,
821
+ SkyTrimModule], exports: [SkyTileComponent, SkyTileSummaryComponent, SkyTileTitleComponent] }); }
822
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileModule, imports: [CommonModule,
823
+ SkyChevronModule,
824
+ SkyIdModule,
825
+ SkyI18nModule,
826
+ SkyIconModule,
827
+ SkyThemeModule,
828
+ SkyTilesResourcesModule,
829
+ SkyTrimModule] }); }
830
+ }
831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileModule, decorators: [{
832
+ type: NgModule,
833
+ args: [{
834
+ declarations: [
835
+ SkyTileComponent,
836
+ SkyTileSummaryComponent,
837
+ SkyTileTitleComponent,
838
+ ],
839
+ imports: [
840
+ CommonModule,
841
+ SkyChevronModule,
842
+ SkyIdModule,
843
+ SkyI18nModule,
844
+ SkyIconModule,
845
+ SkyThemeModule,
846
+ SkyTilesResourcesModule,
847
+ SkyTrimModule,
848
+ ],
849
+ exports: [SkyTileComponent, SkyTileSummaryComponent, SkyTileTitleComponent],
850
+ }]
851
+ }] });
852
+
853
+ /**
854
+ * Specifies content to display inside a padded section of a SkyTileContentComponent.
855
+ */
856
+ class SkyTileContentSectionComponent {
857
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
858
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileContentSectionComponent, selector: "sky-tile-content-section", ngImport: i0, template: "<div\n class=\"sky-tile-content-section\"\n [skyThemeClass]=\"{\n 'sky-padding-even-large': 'default'\n }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host-context(.sky-theme-modern) .sky-tile-content-section{padding:15px 0}.sky-theme-modern .sky-tile-content-section{padding:15px 0}\n"], dependencies: [{ kind: "directive", type: i5.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }] }); }
859
+ }
860
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentSectionComponent, decorators: [{
861
+ type: Component,
862
+ args: [{ selector: 'sky-tile-content-section', template: "<div\n class=\"sky-tile-content-section\"\n [skyThemeClass]=\"{\n 'sky-padding-even-large': 'default'\n }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host-context(.sky-theme-modern) .sky-tile-content-section{padding:15px 0}.sky-theme-modern .sky-tile-content-section{padding:15px 0}\n"] }]
863
+ }] });
864
+
865
+ /**
866
+ * Specifies content to display in the tile's body.
867
+ */
868
+ class SkyTileContentComponent {
869
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
870
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileContentComponent, selector: "sky-tile-content", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host ::ng-deep sky-tile-content-section:not(:last-child) .sky-tile-content-section{border-bottom:1px solid #e2e3e4}\n"] }); }
871
+ }
872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentComponent, decorators: [{
873
+ type: Component,
874
+ args: [{ selector: 'sky-tile-content', template: "<ng-content></ng-content>\n", styles: [":host ::ng-deep sky-tile-content-section:not(:last-child) .sky-tile-content-section{border-bottom:1px solid #e2e3e4}\n"] }]
875
+ }] });
876
+
877
+ class SkyTileContentModule {
878
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
879
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentModule, declarations: [SkyTileContentComponent, SkyTileContentSectionComponent], imports: [CommonModule, SkyThemeModule], exports: [SkyTileContentComponent, SkyTileContentSectionComponent] }); }
880
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentModule, imports: [CommonModule, SkyThemeModule] }); }
881
+ }
882
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileContentModule, decorators: [{
883
+ type: NgModule,
884
+ args: [{
885
+ declarations: [SkyTileContentComponent, SkyTileContentSectionComponent],
886
+ imports: [CommonModule, SkyThemeModule],
887
+ exports: [SkyTileContentComponent, SkyTileContentSectionComponent],
888
+ }]
889
+ }] });
890
+
891
+ /**
892
+ * The type of message to send to the tile dashboard component.
893
+ */
894
+ var SkyTileDashboardMessageType;
895
+ (function (SkyTileDashboardMessageType) {
896
+ /**
897
+ * Expands all tiles within the tile dashboard.
898
+ */
899
+ SkyTileDashboardMessageType[SkyTileDashboardMessageType["ExpandAll"] = 0] = "ExpandAll";
900
+ /**
901
+ * Collapses all tiles within the tile dashboard.
902
+ */
903
+ SkyTileDashboardMessageType[SkyTileDashboardMessageType["CollapseAll"] = 1] = "CollapseAll";
904
+ })(SkyTileDashboardMessageType || (SkyTileDashboardMessageType = {}));
905
+
906
+ let columnIdIndex = 0;
907
+ /**
908
+ * @internal
909
+ */
910
+ class SkyTileDashboardColumnComponent {
911
+ #dashboardService;
912
+ constructor(injector, dashboardService) {
913
+ this.injector = injector;
914
+ this.#dashboardService = dashboardService;
915
+ this.columnId = `tile-dashboard-column-${++columnIdIndex}`;
916
+ this.bagId = this.#dashboardService.bagId;
917
+ }
918
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardColumnComponent, deps: [{ token: i0.Injector }, { token: SkyTileDashboardService }], target: i0.ɵɵFactoryTarget.Component }); }
919
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileDashboardColumnComponent, selector: "sky-tile-dashboard-column", viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"sky-tile-dashboard-column\" [dragula]=\"bagId\">\n <div #content></div>\n</div>\n", styles: [":host{display:flex;flex-grow:1;overflow:hidden}:host{padding:0}:host-context(.sky-responsive-container-xs),:host-context(.sky-responsive-container-sm),:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){padding:0}@media (min-width: 768px){:host{padding:0 10px}}:host-context(.sky-responsive-container-sm),:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){padding:0 10px}.sky-tile-dashboard-column{min-height:100px;width:100%}@media (min-width: 768px){:host-context(.sky-theme-modern) :host{padding:0 15px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm),:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md),:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg){padding:0 15px}@media (min-width: 768px){.sky-theme-modern :host{padding:0 15px}}.sky-theme-modern :host-context(.sky-responsive-container-sm),.sky-theme-modern :host-context(.sky-responsive-container-md),.sky-theme-modern :host-context(.sky-responsive-container-lg){padding:0 15px}\n"], dependencies: [{ kind: "directive", type: i2$1.DragulaDirective, selector: "[dragula]", inputs: ["dragula", "dragulaModel"], outputs: ["dragulaModelChange"] }] }); }
920
+ }
921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardColumnComponent, decorators: [{
922
+ type: Component,
923
+ args: [{ selector: 'sky-tile-dashboard-column', template: "<div class=\"sky-tile-dashboard-column\" [dragula]=\"bagId\">\n <div #content></div>\n</div>\n", styles: [":host{display:flex;flex-grow:1;overflow:hidden}:host{padding:0}:host-context(.sky-responsive-container-xs),:host-context(.sky-responsive-container-sm),:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){padding:0}@media (min-width: 768px){:host{padding:0 10px}}:host-context(.sky-responsive-container-sm),:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){padding:0 10px}.sky-tile-dashboard-column{min-height:100px;width:100%}@media (min-width: 768px){:host-context(.sky-theme-modern) :host{padding:0 15px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm),:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md),:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg){padding:0 15px}@media (min-width: 768px){.sky-theme-modern :host{padding:0 15px}}.sky-theme-modern :host-context(.sky-responsive-container-sm),.sky-theme-modern :host-context(.sky-responsive-container-md),.sky-theme-modern :host-context(.sky-responsive-container-lg){padding:0 15px}\n"] }]
924
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: SkyTileDashboardService }]; }, propDecorators: { content: [{
925
+ type: ViewChild,
926
+ args: ['content', {
927
+ read: ViewContainerRef,
928
+ static: false,
929
+ }]
930
+ }] } });
931
+
932
+ class SkyTileDashboardColumnModule {
933
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardColumnModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
934
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardColumnModule, declarations: [SkyTileDashboardColumnComponent], imports: [CommonModule, DragulaModule], exports: [SkyTileDashboardColumnComponent] }); }
935
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardColumnModule, imports: [CommonModule, DragulaModule] }); }
936
+ }
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardColumnModule, decorators: [{
938
+ type: NgModule,
939
+ args: [{
940
+ declarations: [SkyTileDashboardColumnComponent],
941
+ imports: [CommonModule, DragulaModule],
942
+ exports: [SkyTileDashboardColumnComponent],
943
+ }]
944
+ }] });
945
+
946
+ /**
947
+ * Specifies a container to group multiple tiles.
948
+ */
949
+ class SkyTileDashboardComponent {
950
+ /**
951
+ * Populates the tile dashboard based on the `SkyTileDashboardConfig` object.
952
+ * @required
953
+ */
954
+ set config(value) {
955
+ if (value && !this.#configSet) {
956
+ this.#_config = value;
957
+ this.#configSet = true;
958
+ this.#checkReady();
959
+ }
960
+ }
961
+ get config() {
962
+ return this.#_config;
963
+ }
964
+ #configSet;
965
+ #dashboardService;
966
+ #mediaQueryService;
967
+ #ngUnsubscribe;
968
+ #resourcesService;
969
+ #viewReady;
970
+ #_config;
971
+ constructor(dashboardService, mediaQueryService, resourcesService) {
972
+ /**
973
+ * The observable to send commands to the tile dashboard. The commands must respect the
974
+ * `SkyTileDashboardMessage` type.
975
+ */
976
+ this.messageStream = new Subject();
977
+ /**
978
+ * Fires when the tile dashboard changes state and emits a SkyTileDashboardConfig
979
+ * object. This occurs when tiles collapse or expand and when users drag and drop
980
+ * tiles to rearrange them.
981
+ */
982
+ this.configChange = new EventEmitter();
983
+ this.tileMovedReport = '';
984
+ this.#configSet = false;
985
+ this.#ngUnsubscribe = new Subject();
986
+ this.#viewReady = false;
987
+ this.#dashboardService = dashboardService;
988
+ this.#mediaQueryService = mediaQueryService;
989
+ this.#resourcesService = resourcesService;
990
+ this.moveInstructionsId =
991
+ this.#dashboardService.bagId + '-move-instructions';
992
+ this.#dashboardService.configChange.subscribe((config) => {
993
+ this.configChange.emit(config);
994
+ // Update aria live region with tile drag info
995
+ if (config.movedTile && this.#resourcesService) {
996
+ let messageObservable;
997
+ if (this.#mediaQueryService.current === SkyMediaBreakpoints.xs ||
998
+ this.#mediaQueryService.current === SkyMediaBreakpoints.sm) {
999
+ messageObservable = this.#resourcesService.getString('skyux_tile_moved_assistive_text', config.movedTile.tileDescription, '1', '1', config.movedTile.position.toString(), config.layout.singleColumn.tiles.length.toString());
1000
+ }
1001
+ else {
1002
+ messageObservable = this.#resourcesService.getString('skyux_tile_moved_assistive_text', config.movedTile.tileDescription, config.movedTile.column.toString(), config.layout.multiColumn.length.toString(), config.movedTile.position.toString(), config.layout.multiColumn[config.movedTile.column - 1].tiles.length.toString());
1003
+ }
1004
+ messageObservable.pipe(take(1)).subscribe((message) => {
1005
+ this.tileMovedReport = message;
1006
+ });
1007
+ }
1008
+ });
1009
+ }
1010
+ ngAfterViewInit() {
1011
+ this.messageStream
1012
+ .pipe(takeUntil(this.#ngUnsubscribe))
1013
+ .subscribe((message) => {
1014
+ this.#handleIncomingMessages(message);
1015
+ });
1016
+ this.#viewReady = true;
1017
+ this.#checkReady();
1018
+ }
1019
+ ngOnDestroy() {
1020
+ this.#ngUnsubscribe.next();
1021
+ this.#ngUnsubscribe.complete();
1022
+ this.#dashboardService.destroy();
1023
+ }
1024
+ #checkReady() {
1025
+ if (this.#viewReady && this.config) {
1026
+ setTimeout(() => {
1027
+ if (this.config && this.columns && this.singleColumn) {
1028
+ this.#dashboardService.init(this.config, this.columns, this.singleColumn, this.settingsKey);
1029
+ }
1030
+ }, 0);
1031
+ }
1032
+ }
1033
+ #handleIncomingMessages(message) {
1034
+ switch (message.type) {
1035
+ case SkyTileDashboardMessageType.ExpandAll:
1036
+ this.#dashboardService.setAllTilesCollapsed(false);
1037
+ break;
1038
+ case SkyTileDashboardMessageType.CollapseAll:
1039
+ this.#dashboardService.setAllTilesCollapsed(true);
1040
+ break;
1041
+ }
1042
+ }
1043
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardComponent, deps: [{ token: SkyTileDashboardService }, { token: i2.SkyMediaQueryService }, { token: i3$1.SkyLibResourcesService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1044
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyTileDashboardComponent, selector: "sky-tile-dashboard", inputs: { config: "config", messageStream: "messageStream", settingsKey: "settingsKey" }, outputs: { configChange: "configChange" }, providers: [SkyTileDashboardService], viewQueries: [{ propertyName: "singleColumn", first: true, predicate: ["singleColumn"], descendants: true, read: SkyTileDashboardColumnComponent }, { propertyName: "columns", predicate: SkyTileDashboardColumnComponent, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"config\">\n <span aria-live=\"assertive\" class=\"sky-assistive-text\">\n {{ tileMovedReport }}\n </span>\n <sky-tile-dashboard-column\n *ngFor=\"let column of config.layout.multiColumn\"\n class=\"sky-tile-dashboard-layout-multi\"\n [ngStyle]=\"{\n 'flex-basis': 100 / config.layout.multiColumn.length + '%'\n }\"\n >\n </sky-tile-dashboard-column>\n <sky-tile-dashboard-column\n class=\"sky-tile-dashboard-layout-single\"\n #singleColumn\n >\n </sky-tile-dashboard-column>\n <span class=\"sky-screen-reader-only\" [id]=\"moveInstructionsId\">{{\n 'skyux_tile_move_instructions' | skyLibResources\n }}</span>\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{display:block;padding:0}:host .sky-tile-dashboard-layout-multi{display:none}:host .sky-tile-dashboard-layout-single{display:block}:host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:0}:host-context(.sky-responsive-container-xs),:host-context(.sky-responsive-container-sm),:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){display:block;padding:0}:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi{display:none}:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single{display:block}:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:0}@media (min-width: 768px){:host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:20px}:host :host-context(.sky-theme-default){padding-top:20px}}:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:20px}:host-context(.sky-responsive-container-sm) :host-context(.sky-theme-default),:host-context(.sky-responsive-container-md) :host-context(.sky-theme-default),:host-context(.sky-responsive-container-lg) :host-context(.sky-theme-default){padding-top:20px}@media (min-width: 992px){:host{display:flex;padding:0 10px}:host .sky-tile-dashboard-layout-multi{display:block}:host .sky-tile-dashboard-layout-single{display:none}}:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){display:flex;padding:0 10px}:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi{display:block}:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single{display:none}@media screen{.sky-assistive-text{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}}:host-context(.sky-theme-default){background-color:#eeeeef}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}@media (min-width: 768px){.sky-theme-modern :host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: SkyTileDashboardColumnComponent, selector: "sky-tile-dashboard-column" }, { kind: "pipe", type: i3$1.SkyLibResourcesPipe, name: "skyLibResources" }] }); }
1045
+ }
1046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardComponent, decorators: [{
1047
+ type: Component,
1048
+ args: [{ selector: 'sky-tile-dashboard', providers: [SkyTileDashboardService], template: "<ng-container *ngIf=\"config\">\n <span aria-live=\"assertive\" class=\"sky-assistive-text\">\n {{ tileMovedReport }}\n </span>\n <sky-tile-dashboard-column\n *ngFor=\"let column of config.layout.multiColumn\"\n class=\"sky-tile-dashboard-layout-multi\"\n [ngStyle]=\"{\n 'flex-basis': 100 / config.layout.multiColumn.length + '%'\n }\"\n >\n </sky-tile-dashboard-column>\n <sky-tile-dashboard-column\n class=\"sky-tile-dashboard-layout-single\"\n #singleColumn\n >\n </sky-tile-dashboard-column>\n <span class=\"sky-screen-reader-only\" [id]=\"moveInstructionsId\">{{\n 'skyux_tile_move_instructions' | skyLibResources\n }}</span>\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{display:block;padding:0}:host .sky-tile-dashboard-layout-multi{display:none}:host .sky-tile-dashboard-layout-single{display:block}:host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:0}:host-context(.sky-responsive-container-xs),:host-context(.sky-responsive-container-sm),:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){display:block;padding:0}:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi{display:none}:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single{display:block}:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-xs) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:0}@media (min-width: 768px){:host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:20px}:host :host-context(.sky-theme-default){padding-top:20px}}:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:20px}:host-context(.sky-responsive-container-sm) :host-context(.sky-theme-default),:host-context(.sky-responsive-container-md) :host-context(.sky-theme-default),:host-context(.sky-responsive-container-lg) :host-context(.sky-theme-default){padding-top:20px}@media (min-width: 992px){:host{display:flex;padding:0 10px}:host .sky-tile-dashboard-layout-multi{display:block}:host .sky-tile-dashboard-layout-single{display:none}}:host-context(.sky-responsive-container-md),:host-context(.sky-responsive-container-lg){display:flex;padding:0 10px}:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi{display:block}:host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single,:host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single{display:none}@media screen{.sky-assistive-text{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}}:host-context(.sky-theme-default){background-color:#eeeeef}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}@media (min-width: 768px){.sky-theme-modern :host .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-single ::ng-deep .sky-tile,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-tile-dashboard-layout-multi ::ng-deep .sky-tile{margin-bottom:30px}\n"] }]
1049
+ }], ctorParameters: function () { return [{ type: SkyTileDashboardService }, { type: i2.SkyMediaQueryService }, { type: i3$1.SkyLibResourcesService, decorators: [{
1050
+ type: Optional
1051
+ }] }]; }, propDecorators: { config: [{
1052
+ type: Input
1053
+ }], messageStream: [{
1054
+ type: Input
1055
+ }], settingsKey: [{
1056
+ type: Input
1057
+ }], configChange: [{
1058
+ type: Output
1059
+ }], columns: [{
1060
+ type: ViewChildren,
1061
+ args: [SkyTileDashboardColumnComponent]
1062
+ }], singleColumn: [{
1063
+ type: ViewChild,
1064
+ args: ['singleColumn', {
1065
+ read: SkyTileDashboardColumnComponent,
1066
+ static: false,
1067
+ }]
1068
+ }] } });
1069
+
1070
+ class SkyTileDashboardModule {
1071
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1072
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardModule, declarations: [SkyTileDashboardComponent], imports: [CommonModule,
1073
+ SkyTileDashboardColumnModule,
1074
+ SkyTilesResourcesModule], exports: [SkyTileDashboardComponent] }); }
1075
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardModule, providers: [DragulaService], imports: [CommonModule,
1076
+ SkyTileDashboardColumnModule,
1077
+ SkyTilesResourcesModule] }); }
1078
+ }
1079
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTileDashboardModule, decorators: [{
1080
+ type: NgModule,
1081
+ args: [{
1082
+ declarations: [SkyTileDashboardComponent],
1083
+ providers: [DragulaService],
1084
+ imports: [
1085
+ CommonModule,
1086
+ SkyTileDashboardColumnModule,
1087
+ SkyTilesResourcesModule,
1088
+ ],
1089
+ exports: [SkyTileDashboardComponent],
1090
+ }]
1091
+ }] });
1092
+
1093
+ class SkyTilesModule {
1094
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1095
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesModule, imports: [CommonModule], exports: [SkyTileContentModule,
1096
+ SkyTileModule,
1097
+ SkyTileDashboardColumnModule,
1098
+ SkyTileDashboardModule] }); }
1099
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesModule, providers: [DragulaService], imports: [CommonModule, SkyTileContentModule,
1100
+ SkyTileModule,
1101
+ SkyTileDashboardColumnModule,
1102
+ SkyTileDashboardModule] }); }
1103
+ }
1104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyTilesModule, decorators: [{
1105
+ type: NgModule,
1106
+ args: [{
1107
+ imports: [CommonModule],
1108
+ exports: [
1109
+ SkyTileContentModule,
1110
+ SkyTileModule,
1111
+ SkyTileDashboardColumnModule,
1112
+ SkyTileDashboardModule,
1113
+ ],
1114
+ providers: [DragulaService],
1115
+ }]
1116
+ }] });
1117
+
1118
+ /**
1119
+ * Generated bundle index. Do not edit.
1120
+ */
1121
+
1122
+ export { SkyTileContentModule, SkyTileDashboardColumnModule, SkyTileDashboardMessageType, SkyTileDashboardModule, SkyTileDashboardService, SkyTileModule, SkyTilesModule, SkyTileComponent as λ1, SkyTileSummaryComponent as λ2, SkyTileTitleComponent as λ3, SkyTileContentSectionComponent as λ4, SkyTileContentComponent as λ5, SkyTileDashboardColumnComponent as λ6, SkyTileDashboardComponent as λ7 };
1123
+ //# sourceMappingURL=skyux-tiles.mjs.map