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