@skyux/flyout 5.7.2 → 6.0.0-beta.2

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 (59) hide show
  1. package/documentation.json +2 -2
  2. package/esm2020/index.mjs +14 -0
  3. package/esm2020/lib/modules/flyout/flyout-adapter.service.mjs +64 -0
  4. package/esm2020/lib/modules/flyout/flyout-instance.mjs +109 -0
  5. package/esm2020/lib/modules/flyout/flyout-iterator.component.mjs +55 -0
  6. package/esm2020/lib/modules/flyout/flyout-media-query.service.mjs +72 -0
  7. package/esm2020/lib/modules/flyout/flyout.component.mjs +499 -0
  8. package/esm2020/lib/modules/flyout/flyout.module.mjs +55 -0
  9. package/esm2020/lib/modules/flyout/flyout.service.mjs +169 -0
  10. package/esm2020/lib/modules/flyout/types/flyout-action.mjs +2 -0
  11. package/esm2020/lib/modules/flyout/types/flyout-before-close-handler.mjs +9 -0
  12. package/esm2020/lib/modules/flyout/types/flyout-close-args.mjs +2 -0
  13. package/esm2020/lib/modules/flyout/types/flyout-config.mjs +2 -0
  14. package/esm2020/lib/modules/flyout/types/flyout-message-type.mjs +13 -0
  15. package/esm2020/lib/modules/flyout/types/flyout-message.mjs +2 -0
  16. package/esm2020/lib/modules/flyout/types/flyout-permalink.mjs +2 -0
  17. package/esm2020/lib/modules/shared/sky-flyout-resources.module.mjs +54 -0
  18. package/esm2020/skyux-flyout.mjs +5 -0
  19. package/fesm2015/skyux-flyout.mjs +1065 -0
  20. package/fesm2015/skyux-flyout.mjs.map +1 -0
  21. package/{fesm2015/skyux-flyout.js → fesm2020/skyux-flyout.mjs} +30 -44
  22. package/fesm2020/skyux-flyout.mjs.map +1 -0
  23. package/package.json +34 -18
  24. package/bundles/skyux-flyout.umd.js +0 -1179
  25. package/esm2015/index.js +0 -14
  26. package/esm2015/index.js.map +0 -1
  27. package/esm2015/lib/modules/flyout/flyout-adapter.service.js +0 -64
  28. package/esm2015/lib/modules/flyout/flyout-adapter.service.js.map +0 -1
  29. package/esm2015/lib/modules/flyout/flyout-instance.js +0 -109
  30. package/esm2015/lib/modules/flyout/flyout-instance.js.map +0 -1
  31. package/esm2015/lib/modules/flyout/flyout-iterator.component.js +0 -59
  32. package/esm2015/lib/modules/flyout/flyout-iterator.component.js.map +0 -1
  33. package/esm2015/lib/modules/flyout/flyout-media-query.service.js +0 -72
  34. package/esm2015/lib/modules/flyout/flyout-media-query.service.js.map +0 -1
  35. package/esm2015/lib/modules/flyout/flyout.component.js +0 -508
  36. package/esm2015/lib/modules/flyout/flyout.component.js.map +0 -1
  37. package/esm2015/lib/modules/flyout/flyout.module.js +0 -56
  38. package/esm2015/lib/modules/flyout/flyout.module.js.map +0 -1
  39. package/esm2015/lib/modules/flyout/flyout.service.js +0 -169
  40. package/esm2015/lib/modules/flyout/flyout.service.js.map +0 -1
  41. package/esm2015/lib/modules/flyout/types/flyout-action.js +0 -2
  42. package/esm2015/lib/modules/flyout/types/flyout-action.js.map +0 -1
  43. package/esm2015/lib/modules/flyout/types/flyout-before-close-handler.js +0 -9
  44. package/esm2015/lib/modules/flyout/types/flyout-before-close-handler.js.map +0 -1
  45. package/esm2015/lib/modules/flyout/types/flyout-close-args.js +0 -2
  46. package/esm2015/lib/modules/flyout/types/flyout-close-args.js.map +0 -1
  47. package/esm2015/lib/modules/flyout/types/flyout-config.js +0 -2
  48. package/esm2015/lib/modules/flyout/types/flyout-config.js.map +0 -1
  49. package/esm2015/lib/modules/flyout/types/flyout-message-type.js +0 -13
  50. package/esm2015/lib/modules/flyout/types/flyout-message-type.js.map +0 -1
  51. package/esm2015/lib/modules/flyout/types/flyout-message.js +0 -2
  52. package/esm2015/lib/modules/flyout/types/flyout-message.js.map +0 -1
  53. package/esm2015/lib/modules/flyout/types/flyout-permalink.js +0 -2
  54. package/esm2015/lib/modules/flyout/types/flyout-permalink.js.map +0 -1
  55. package/esm2015/lib/modules/shared/sky-flyout-resources.module.js +0 -54
  56. package/esm2015/lib/modules/shared/sky-flyout-resources.module.js.map +0 -1
  57. package/esm2015/skyux-flyout.js +0 -5
  58. package/esm2015/skyux-flyout.js.map +0 -1
  59. package/fesm2015/skyux-flyout.js.map +0 -1
@@ -1,1179 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@angular/cdk/a11y'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@skyux/i18n'), require('@skyux/indicators'), require('@skyux/router'), require('@skyux/theme'), require('@angular/animations'), require('@skyux/core'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@skyux/flyout', ['exports', '@angular/core', 'rxjs', '@angular/cdk/a11y', '@angular/common', '@angular/forms', '@angular/router', '@skyux/i18n', '@skyux/indicators', '@skyux/router', '@skyux/theme', '@angular/animations', '@skyux/core', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.flyout = {}), global.ng.core, global.rxjs, global.ng.cdk.a11y, global.ng.common, global.ng.forms, global.ng.router, global.i2, global.i1, global.i10, global.i2$1, global.ng.animations, global.i1$1, global.rxjs.operators));
5
- })(this, (function (exports, i0, rxjs, i9, i7, forms, i2$2, i2, i1, i10, i2$1, animations, i1$1, operators) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
27
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
28
- var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
29
- var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2);
30
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
31
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
32
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2$1);
33
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
34
-
35
- /**
36
- * @internal
37
- */
38
- exports.SkyFlyoutMessageType = void 0;
39
- (function (SkyFlyoutMessageType) {
40
- SkyFlyoutMessageType[SkyFlyoutMessageType["Open"] = 0] = "Open";
41
- SkyFlyoutMessageType[SkyFlyoutMessageType["Close"] = 1] = "Close";
42
- SkyFlyoutMessageType[SkyFlyoutMessageType["EnableIteratorNextButton"] = 2] = "EnableIteratorNextButton";
43
- SkyFlyoutMessageType[SkyFlyoutMessageType["EnableIteratorPreviousButton"] = 3] = "EnableIteratorPreviousButton";
44
- SkyFlyoutMessageType[SkyFlyoutMessageType["DisableIteratorNextButton"] = 4] = "DisableIteratorNextButton";
45
- SkyFlyoutMessageType[SkyFlyoutMessageType["DisableIteratorPreviousButton"] = 5] = "DisableIteratorPreviousButton";
46
- })(exports.SkyFlyoutMessageType || (exports.SkyFlyoutMessageType = {}));
47
-
48
- /**
49
- * Represents a single displayed flyout.
50
- */
51
- var SkyFlyoutInstance = /** @class */ (function () {
52
- function SkyFlyoutInstance() {
53
- var _this = this;
54
- /**
55
- * An event that the flyout instance emits when it closes.
56
- */
57
- this.closed = new i0.EventEmitter();
58
- /**
59
- * A `boolean` value that returns `true` if the flyout is open.
60
- * @default true
61
- */
62
- this.isOpen = true;
63
- this._beforeClose = new rxjs.Subject();
64
- this._iteratorNextButtonClick = new i0.EventEmitter();
65
- this._iteratorPreviousButtonClick = new i0.EventEmitter();
66
- this._iteratorNextButtonDisabled = false;
67
- this._iteratorPreviousButtonDisabled = false;
68
- this._hostController = new rxjs.Subject();
69
- this.closed.subscribe(function () {
70
- _this.isOpen = false;
71
- });
72
- }
73
- Object.defineProperty(SkyFlyoutInstance.prototype, "beforeClose", {
74
- /**
75
- * An event that the modal instance emits when it is about to close.
76
- * If a subscription exists for this event,
77
- * the modal does not close until the subscriber calls the handler's `closeModal` method.
78
- */
79
- get: function () {
80
- return this._beforeClose;
81
- },
82
- enumerable: false,
83
- configurable: true
84
- });
85
- Object.defineProperty(SkyFlyoutInstance.prototype, "hostController", {
86
- /**
87
- * Used to communicate with the host component.
88
- * @internal
89
- */
90
- get: function () {
91
- return this._hostController;
92
- },
93
- enumerable: false,
94
- configurable: true
95
- });
96
- Object.defineProperty(SkyFlyoutInstance.prototype, "iteratorNextButtonClick", {
97
- /**
98
- * An event that the flyout instance emits when users click the next iterator button.
99
- */
100
- get: function () {
101
- return this._iteratorNextButtonClick;
102
- },
103
- enumerable: false,
104
- configurable: true
105
- });
106
- Object.defineProperty(SkyFlyoutInstance.prototype, "iteratorPreviousButtonClick", {
107
- /**
108
- * An event that the flyout instance emits when users click the previous iterator button.
109
- */
110
- get: function () {
111
- return this._iteratorPreviousButtonClick;
112
- },
113
- enumerable: false,
114
- configurable: true
115
- });
116
- Object.defineProperty(SkyFlyoutInstance.prototype, "iteratorNextButtonDisabled", {
117
- get: function () {
118
- return this._iteratorNextButtonDisabled;
119
- },
120
- /**
121
- * Disables the next iterator button.
122
- * @default false
123
- */
124
- set: function (newValue) {
125
- this._iteratorNextButtonDisabled = newValue;
126
- if (newValue) {
127
- this.hostController.next({
128
- type: exports.SkyFlyoutMessageType.DisableIteratorNextButton,
129
- });
130
- }
131
- else {
132
- this.hostController.next({
133
- type: exports.SkyFlyoutMessageType.EnableIteratorNextButton,
134
- });
135
- }
136
- },
137
- enumerable: false,
138
- configurable: true
139
- });
140
- Object.defineProperty(SkyFlyoutInstance.prototype, "iteratorPreviousButtonDisabled", {
141
- get: function () {
142
- return this._iteratorPreviousButtonDisabled;
143
- },
144
- /**
145
- * Disables the previous iterator button.
146
- * @default false
147
- */
148
- set: function (newValue) {
149
- this._iteratorPreviousButtonDisabled = newValue;
150
- if (newValue) {
151
- this.hostController.next({
152
- type: exports.SkyFlyoutMessageType.DisableIteratorPreviousButton,
153
- });
154
- }
155
- else {
156
- this.hostController.next({
157
- type: exports.SkyFlyoutMessageType.EnableIteratorPreviousButton,
158
- });
159
- }
160
- },
161
- enumerable: false,
162
- configurable: true
163
- });
164
- /**
165
- * Closes the flyout instance and emits its `closed` event.
166
- * @param args Arguments used when closing the flyout.
167
- */
168
- SkyFlyoutInstance.prototype.close = function (args) {
169
- this.hostController.next({
170
- type: exports.SkyFlyoutMessageType.Close,
171
- data: { ignoreBeforeClose: args ? args.ignoreBeforeClose : false },
172
- });
173
- this._iteratorPreviousButtonClick.complete();
174
- this._iteratorNextButtonClick.complete();
175
- this.hostController.complete();
176
- };
177
- return SkyFlyoutInstance;
178
- }());
179
-
180
- /**
181
- * NOTICE: DO NOT MODIFY THIS FILE!
182
- * The contents of this file were automatically generated by
183
- * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-flyout' schematic.
184
- * To update this file, simply rerun the command.
185
- */
186
- var RESOURCES = {
187
- 'EN-US': {
188
- skyux_flyout_close: { message: 'Close flyout' },
189
- skyux_flyout_iterator_previous_button: { message: 'Previous' },
190
- skyux_flyout_iterator_next_button: { message: 'Next' },
191
- skyux_flyout_permalink_button: { message: 'View record' },
192
- skyux_flyout_primary_action_button: { message: 'Create list' },
193
- skyux_flyout_resize_handle: {
194
- message: 'Resize the flyout window. Press the enter or space key to activate, then use left arrow key to expand the flyout window and right arrow key to shrink the flyout window. Press the enter, space, or tab key to deactivate.',
195
- },
196
- },
197
- };
198
- var SkyFlyoutResourcesProvider = /** @class */ (function () {
199
- function SkyFlyoutResourcesProvider() {
200
- }
201
- SkyFlyoutResourcesProvider.prototype.getString = function (localeInfo, name) {
202
- return i2.getLibStringForLocale(RESOURCES, localeInfo.locale, name);
203
- };
204
- return SkyFlyoutResourcesProvider;
205
- }());
206
- /**
207
- * Import into any component library module that needs to use resource strings.
208
- */
209
- var SkyFlyoutResourcesModule = /** @class */ (function () {
210
- function SkyFlyoutResourcesModule() {
211
- }
212
- return SkyFlyoutResourcesModule;
213
- }());
214
- SkyFlyoutResourcesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutResourcesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
215
- SkyFlyoutResourcesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutResourcesModule, exports: [i2.SkyI18nModule] });
216
- SkyFlyoutResourcesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutResourcesModule, providers: [
217
- {
218
- provide: i2.SKY_LIB_RESOURCES_PROVIDERS,
219
- useClass: SkyFlyoutResourcesProvider,
220
- multi: true,
221
- },
222
- ], imports: [i2.SkyI18nModule] });
223
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutResourcesModule, decorators: [{
224
- type: i0.NgModule,
225
- args: [{
226
- exports: [i2.SkyI18nModule],
227
- providers: [
228
- {
229
- provide: i2.SKY_LIB_RESOURCES_PROVIDERS,
230
- useClass: SkyFlyoutResourcesProvider,
231
- multi: true,
232
- },
233
- ],
234
- }]
235
- }] });
236
-
237
- /**
238
- * @internal
239
- */
240
- var SkyFlyoutIteratorComponent = /** @class */ (function () {
241
- function SkyFlyoutIteratorComponent() {
242
- this.ngUnsubscribe = new rxjs.Subject();
243
- this._nextButtonClick = new i0.EventEmitter();
244
- this._previousButtonClick = new i0.EventEmitter();
245
- }
246
- Object.defineProperty(SkyFlyoutIteratorComponent.prototype, "previousButtonClick", {
247
- get: function () {
248
- return this._previousButtonClick;
249
- },
250
- enumerable: false,
251
- configurable: true
252
- });
253
- Object.defineProperty(SkyFlyoutIteratorComponent.prototype, "nextButtonClick", {
254
- get: function () {
255
- return this._nextButtonClick;
256
- },
257
- enumerable: false,
258
- configurable: true
259
- });
260
- SkyFlyoutIteratorComponent.prototype.ngOnDestroy = function () {
261
- this.ngUnsubscribe.next();
262
- this.ngUnsubscribe.complete();
263
- this._previousButtonClick.complete();
264
- this._nextButtonClick.complete();
265
- };
266
- SkyFlyoutIteratorComponent.prototype.onIteratorPreviousClick = function () {
267
- /* istanbul ignore else */
268
- if (!this.previousButtonDisabled) {
269
- this._previousButtonClick.emit();
270
- }
271
- };
272
- SkyFlyoutIteratorComponent.prototype.onIteratorNextClick = function () {
273
- /* istanbul ignore else */
274
- if (!this.nextButtonDisabled) {
275
- this._nextButtonClick.emit();
276
- }
277
- };
278
- return SkyFlyoutIteratorComponent;
279
- }());
280
- SkyFlyoutIteratorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutIteratorComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
281
- SkyFlyoutIteratorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFlyoutIteratorComponent, selector: "sky-flyout-iterator", inputs: { nextButtonDisabled: "nextButtonDisabled", previousButtonDisabled: "previousButtonDisabled" }, outputs: { previousButtonClick: "previousButtonClick", nextButtonClick: "nextButtonClick" }, ngImport: i0__namespace, template: "<div id=\"iterators\" class=\"sky-flyout-iterators\">\n <button\n class=\"sky-btn\"\n [attr.aria-label]=\"\n 'skyux_flyout_iterator_previous_button' | skyLibResources\n \"\n [disabled]=\"previousButtonDisabled\"\n [skyThemeClass]=\"{\n 'sky-btn-default sky-margin-inline-compact': 'default',\n 'sky-btn-icon-borderless sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onIteratorPreviousClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"chevron-up\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-up\"\n iconType=\"skyux\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n <button\n class=\"sky-btn\"\n [attr.aria-label]=\"'skyux_flyout_iterator_next_button' | skyLibResources\"\n [disabled]=\"nextButtonDisabled\"\n [skyThemeClass]=\"{\n 'sky-btn-default sky-margin-inline-compact': 'default',\n 'sky-btn-icon-borderless sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onIteratorNextClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"chevron-down\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n</div>\n", styles: [":host-context(.sky-theme-modern) .sky-flyout-iterators{display:inline}.sky-theme-modern .sky-flyout-iterators{display:inline}\n"], components: [{ type: i1__namespace.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i2__namespace.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i2__namespace.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], pipes: { "skyLibResources": i2__namespace$1.SkyLibResourcesPipe } });
282
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutIteratorComponent, decorators: [{
283
- type: i0.Component,
284
- args: [{
285
- selector: 'sky-flyout-iterator',
286
- template: "<div id=\"iterators\" class=\"sky-flyout-iterators\">\n <button\n class=\"sky-btn\"\n [attr.aria-label]=\"\n 'skyux_flyout_iterator_previous_button' | skyLibResources\n \"\n [disabled]=\"previousButtonDisabled\"\n [skyThemeClass]=\"{\n 'sky-btn-default sky-margin-inline-compact': 'default',\n 'sky-btn-icon-borderless sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onIteratorPreviousClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"chevron-up\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-up\"\n iconType=\"skyux\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n <button\n class=\"sky-btn\"\n [attr.aria-label]=\"'skyux_flyout_iterator_next_button' | skyLibResources\"\n [disabled]=\"nextButtonDisabled\"\n [skyThemeClass]=\"{\n 'sky-btn-default sky-margin-inline-compact': 'default',\n 'sky-btn-icon-borderless sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onIteratorNextClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"chevron-down\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n</div>\n",
287
- styles: [":host-context(.sky-theme-modern) .sky-flyout-iterators{display:inline}.sky-theme-modern .sky-flyout-iterators{display:inline}\n"],
288
- }]
289
- }], propDecorators: { nextButtonDisabled: [{
290
- type: i0.Input
291
- }], previousButtonDisabled: [{
292
- type: i0.Input
293
- }], previousButtonClick: [{
294
- type: i0.Output
295
- }], nextButtonClick: [{
296
- type: i0.Output
297
- }] } });
298
-
299
- /**
300
- * @internal
301
- */
302
- var SkyFlyoutAdapterService = /** @class */ (function () {
303
- function SkyFlyoutAdapterService(rendererFactory, windowRef) {
304
- this.rendererFactory = rendererFactory;
305
- this.windowRef = windowRef;
306
- this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
307
- }
308
- SkyFlyoutAdapterService.prototype.adjustHeaderForHelp = function (header) {
309
- var windowObj = this.windowRef.nativeWindow;
310
- var helpWidget = windowObj.document.getElementById('bb-help-invoker');
311
- if (helpWidget) {
312
- this.renderer.addClass(header.nativeElement, 'sky-flyout-help-shim');
313
- }
314
- };
315
- SkyFlyoutAdapterService.prototype.setResponsiveClass = function (element, breakpoint) {
316
- var nativeEl = element.nativeElement;
317
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');
318
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');
319
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');
320
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');
321
- var newClass;
322
- switch (breakpoint) {
323
- case i1$1.SkyMediaBreakpoints.xs: {
324
- newClass = 'sky-responsive-container-xs';
325
- break;
326
- }
327
- case i1$1.SkyMediaBreakpoints.sm: {
328
- newClass = 'sky-responsive-container-sm';
329
- break;
330
- }
331
- case i1$1.SkyMediaBreakpoints.md: {
332
- newClass = 'sky-responsive-container-md';
333
- break;
334
- }
335
- default: {
336
- newClass = 'sky-responsive-container-lg';
337
- break;
338
- }
339
- }
340
- this.renderer.addClass(nativeEl, newClass);
341
- };
342
- SkyFlyoutAdapterService.prototype.toggleIframePointerEvents = function (enable) {
343
- // When iframes are present on the page, they may interfere with dragging
344
- // temporarily disable pointer events in iframes when dragging starts.
345
- // When re-enabling we set to the empty string as it will remove the element styling
346
- // and fall back to any css originally given to iframe
347
- var iframes = document.querySelectorAll('iframe');
348
- for (var i = 0; i < iframes.length; i++) {
349
- iframes[i].style.pointerEvents = enable ? '' : 'none';
350
- }
351
- };
352
- return SkyFlyoutAdapterService;
353
- }());
354
- SkyFlyoutAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutAdapterService, deps: [{ token: i0__namespace.RendererFactory2 }, { token: i1__namespace$1.SkyAppWindowRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
355
- SkyFlyoutAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutAdapterService });
356
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutAdapterService, decorators: [{
357
- type: i0.Injectable
358
- }], ctorParameters: function () { return [{ type: i0__namespace.RendererFactory2 }, { type: i1__namespace$1.SkyAppWindowRef }]; } });
359
-
360
- /**
361
- * @internal
362
- */
363
- var SkyFlyoutMediaQueryService = /** @class */ (function () {
364
- function SkyFlyoutMediaQueryService() {
365
- this.currentSubject = new rxjs.BehaviorSubject(this.current);
366
- this._current = i1$1.SkyMediaBreakpoints.xs;
367
- this.currentSubject.next(this._current);
368
- }
369
- Object.defineProperty(SkyFlyoutMediaQueryService.prototype, "current", {
370
- get: function () {
371
- return this._current;
372
- },
373
- enumerable: false,
374
- configurable: true
375
- });
376
- SkyFlyoutMediaQueryService.prototype.subscribe = function (listener) {
377
- return this.currentSubject.subscribe({
378
- next: function (breakpoints) {
379
- listener(breakpoints);
380
- },
381
- });
382
- };
383
- SkyFlyoutMediaQueryService.prototype.setBreakpointForWidth = function (width) {
384
- var breakpoint;
385
- if (this.isWidthWithinBreakpiont(width, i1$1.SkyMediaBreakpoints.xs)) {
386
- breakpoint = i1$1.SkyMediaBreakpoints.xs;
387
- }
388
- else if (this.isWidthWithinBreakpiont(width, i1$1.SkyMediaBreakpoints.sm)) {
389
- breakpoint = i1$1.SkyMediaBreakpoints.sm;
390
- }
391
- else if (this.isWidthWithinBreakpiont(width, i1$1.SkyMediaBreakpoints.md)) {
392
- breakpoint = i1$1.SkyMediaBreakpoints.md;
393
- }
394
- else {
395
- breakpoint = i1$1.SkyMediaBreakpoints.lg;
396
- }
397
- this._current = breakpoint;
398
- this.currentSubject.next(this._current);
399
- };
400
- SkyFlyoutMediaQueryService.prototype.isWidthWithinBreakpiont = function (width, breakpoint) {
401
- var xsBreakpointMaxPixels = 767;
402
- var smBreakpointMinPixels = 768;
403
- var smBreakpointMaxPixels = 991;
404
- var mdBreakpointMinPixels = 992;
405
- var mdBreakpointMaxPixels = 1199;
406
- var lgBreakpointMinPixels = 1200;
407
- switch (breakpoint) {
408
- case i1$1.SkyMediaBreakpoints.xs: {
409
- return width <= xsBreakpointMaxPixels;
410
- }
411
- case i1$1.SkyMediaBreakpoints.sm: {
412
- return width >= smBreakpointMinPixels && width <= smBreakpointMaxPixels;
413
- }
414
- case i1$1.SkyMediaBreakpoints.md: {
415
- return width >= mdBreakpointMinPixels && width <= mdBreakpointMaxPixels;
416
- }
417
- default: {
418
- return width >= lgBreakpointMinPixels;
419
- }
420
- }
421
- };
422
- SkyFlyoutMediaQueryService.prototype.destroy = function () {
423
- this.currentSubject.complete();
424
- };
425
- return SkyFlyoutMediaQueryService;
426
- }());
427
- SkyFlyoutMediaQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutMediaQueryService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
428
- SkyFlyoutMediaQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutMediaQueryService });
429
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutMediaQueryService, decorators: [{
430
- type: i0.Injectable
431
- }], ctorParameters: function () { return []; } });
432
-
433
- /**
434
- * Handler for notifying the flyout when it is appropriate to close the flyout. This will be returned from the flyout instance's `beforeClose` observable.
435
- */
436
- var SkyFlyoutBeforeCloseHandler = /** @class */ (function () {
437
- function SkyFlyoutBeforeCloseHandler(closeFlyoutFunction) {
438
- this.closeFlyout = closeFlyoutFunction;
439
- }
440
- return SkyFlyoutBeforeCloseHandler;
441
- }());
442
-
443
- var FLYOUT_OPEN_STATE = 'flyoutOpen';
444
- var FLYOUT_CLOSED_STATE = 'flyoutClosed';
445
- var nextId = 0;
446
- /**
447
- * @internal
448
- */
449
- var SkyFlyoutComponent = /** @class */ (function () {
450
- function SkyFlyoutComponent(adapter, changeDetector, injector, resolver, resourcesService, flyoutMediaQueryService, elementRef, uiConfigService, _ngZone) {
451
- var _this = this;
452
- this.adapter = adapter;
453
- this.changeDetector = changeDetector;
454
- this.injector = injector;
455
- this.resolver = resolver;
456
- this.resourcesService = resourcesService;
457
- this.flyoutMediaQueryService = flyoutMediaQueryService;
458
- this.elementRef = elementRef;
459
- this.uiConfigService = uiConfigService;
460
- this._ngZone = _ngZone;
461
- this.flyoutId = "sky-flyout-" + ++nextId;
462
- this.flyoutState = FLYOUT_CLOSED_STATE;
463
- this.isOpen = false;
464
- this.isOpening = false;
465
- this.flyoutWidth = 0;
466
- this.instanceReady = false;
467
- this.isDragging = false;
468
- this.isFullscreen = false;
469
- this.resizeKeyControlActive = false;
470
- this.xCoord = 0;
471
- this.windowBufferSize = 20;
472
- /**
473
- * @internal
474
- */
475
- this.widthStep = 10;
476
- this.ngUnsubscribe = new rxjs.Subject();
477
- this._messageStream = new rxjs.Subject();
478
- // All commands flow through the message stream.
479
- this.messageStream
480
- .pipe(operators.takeUntil(this.ngUnsubscribe))
481
- .subscribe(function (message) {
482
- _this.handleIncomingMessages(message);
483
- });
484
- }
485
- Object.defineProperty(SkyFlyoutComponent.prototype, "messageStream", {
486
- get: function () {
487
- return this._messageStream;
488
- },
489
- enumerable: false,
490
- configurable: true
491
- });
492
- Object.defineProperty(SkyFlyoutComponent.prototype, "permalink", {
493
- get: function () {
494
- var permalink = this.config.permalink;
495
- if (permalink) {
496
- return permalink;
497
- }
498
- return {};
499
- },
500
- enumerable: false,
501
- configurable: true
502
- });
503
- Object.defineProperty(SkyFlyoutComponent.prototype, "permalinkLabel", {
504
- get: function () {
505
- if (this.permalink.label) {
506
- return this.permalink.label;
507
- }
508
- return this.getString('skyux_flyout_permalink_button');
509
- },
510
- enumerable: false,
511
- configurable: true
512
- });
513
- Object.defineProperty(SkyFlyoutComponent.prototype, "primaryAction", {
514
- get: function () {
515
- var primaryAction = this.config.primaryAction;
516
- if (primaryAction) {
517
- return primaryAction;
518
- }
519
- return {};
520
- },
521
- enumerable: false,
522
- configurable: true
523
- });
524
- Object.defineProperty(SkyFlyoutComponent.prototype, "primaryActionLabel", {
525
- get: function () {
526
- if (this.config.primaryAction && this.config.primaryAction.label) {
527
- return this.config.primaryAction.label;
528
- }
529
- return this.getString('skyux_flyout_primary_action_button');
530
- },
531
- enumerable: false,
532
- configurable: true
533
- });
534
- SkyFlyoutComponent.prototype.ngOnInit = function () {
535
- this.adapter.adjustHeaderForHelp(this.flyoutHeader);
536
- };
537
- SkyFlyoutComponent.prototype.ngOnDestroy = function () {
538
- this.ngUnsubscribe.next();
539
- this.ngUnsubscribe.complete();
540
- };
541
- SkyFlyoutComponent.prototype.onWindowResize = function (event) {
542
- if (this.flyoutMediaQueryService.isWidthWithinBreakpiont(event.target.innerWidth, i1$1.SkyMediaBreakpoints.xs)) {
543
- this.updateBreakpointAndResponsiveClass(event.target.innerWidth);
544
- }
545
- else {
546
- this.updateBreakpointAndResponsiveClass(this.flyoutWidth);
547
- }
548
- this.setFullscreen();
549
- if (event.target.innerWidth - this.flyoutWidth < this.windowBufferSize) {
550
- this.flyoutWidth = event.target.innerWidth - this.windowBufferSize;
551
- this.xCoord = this.windowBufferSize;
552
- this.setUserData();
553
- }
554
- };
555
- SkyFlyoutComponent.prototype.attach = function (component, config) {
556
- var _this = this;
557
- this.cleanTemplate();
558
- // Emit the closed event on any previously opened flyout instance
559
- if (this.flyoutInstance) {
560
- this.notifyClosed();
561
- }
562
- this.config = Object.assign({ providers: [] }, config);
563
- this.config.defaultWidth =
564
- this.config.defaultWidth || window.innerWidth / 2;
565
- this.config.minWidth = this.config.minWidth || 320;
566
- this.config.maxWidth = this.config.maxWidth || this.config.defaultWidth;
567
- this.config.showIterator = this.config.showIterator || false;
568
- this.config.iteratorNextButtonDisabled =
569
- this.config.iteratorNextButtonDisabled || false;
570
- this.config.iteratorPreviousButtonDisabled =
571
- this.config.iteratorPreviousButtonDisabled || false;
572
- var factory = this.resolver.resolveComponentFactory(component);
573
- var injector = i0.Injector.create({
574
- parent: this.injector,
575
- providers: this.config.providers,
576
- });
577
- var componentRef = this.target.createComponent(factory, undefined, injector);
578
- this.flyoutInstance = this.createFlyoutInstance(componentRef.instance);
579
- // This is used to ensure we do not render the flyout until we have attached the component.
580
- // This allows the aria-labelledby to function correctly.
581
- this.instanceReady = true;
582
- this.changeDetector.markForCheck();
583
- // Open the flyout immediately.
584
- this.messageStream.next({
585
- type: exports.SkyFlyoutMessageType.Open,
586
- });
587
- if (this.config.settingsKey) {
588
- this.uiConfigService
589
- .getConfig(this.config.settingsKey)
590
- .pipe(operators.take(1))
591
- .subscribe(function (value) {
592
- if (value && value.flyoutWidth) {
593
- _this.flyoutWidth = value.flyoutWidth;
594
- }
595
- else {
596
- // Bad data, or config is the default config.
597
- _this.flyoutWidth = _this.config.defaultWidth;
598
- }
599
- _this.checkInitialSize();
600
- });
601
- }
602
- else {
603
- this.flyoutWidth = this.config.defaultWidth;
604
- this.checkInitialSize();
605
- }
606
- return this.flyoutInstance;
607
- };
608
- SkyFlyoutComponent.prototype.close = function () {
609
- this.messageStream.next({
610
- type: exports.SkyFlyoutMessageType.Close,
611
- });
612
- };
613
- SkyFlyoutComponent.prototype.invokePrimaryAction = function () {
614
- this.primaryAction.callback();
615
- if (this.primaryAction.closeAfterInvoking) {
616
- this.close();
617
- }
618
- return false;
619
- };
620
- SkyFlyoutComponent.prototype.getAnimationState = function () {
621
- return this.instanceReady && this.isOpening
622
- ? FLYOUT_OPEN_STATE
623
- : FLYOUT_CLOSED_STATE;
624
- };
625
- SkyFlyoutComponent.prototype.animationDone = function (event) {
626
- if (event.toState === FLYOUT_OPEN_STATE) {
627
- this.isOpen = true;
628
- }
629
- if (event.toState === FLYOUT_CLOSED_STATE) {
630
- this.isOpen = false;
631
- this.notifyClosed();
632
- this.cleanTemplate();
633
- }
634
- };
635
- SkyFlyoutComponent.prototype.onHeaderGrabHandleMouseDown = function (event) {
636
- this.onResizeHandleMouseDown(event);
637
- };
638
- SkyFlyoutComponent.prototype.onHeaderGrabHandleKeyDown = function (event) {
639
- this.handleResizeKeyDown(event);
640
- };
641
- SkyFlyoutComponent.prototype.onResizeHandleKeyDown = function (event) {
642
- this.handleResizeKeyDown(event);
643
- };
644
- SkyFlyoutComponent.prototype.onResizeHandleMouseDown = function (event) {
645
- var _this = this;
646
- event.preventDefault();
647
- event.stopPropagation();
648
- if (this.isFullscreen) {
649
- return;
650
- }
651
- this.isDragging = true;
652
- this.xCoord = event.clientX;
653
- this.adapter.toggleIframePointerEvents(false);
654
- rxjs.fromEvent(document, 'mousemove')
655
- .pipe(operators.takeWhile(function () {
656
- return _this.isDragging;
657
- }))
658
- .subscribe(function (moveEvent) {
659
- _this.onMouseMove(moveEvent);
660
- });
661
- rxjs.fromEvent(document, 'mouseup')
662
- .pipe(operators.takeWhile(function () {
663
- return _this.isDragging;
664
- }))
665
- .subscribe(function (mouseUpEvent) {
666
- _this.onHandleRelease(mouseUpEvent);
667
- });
668
- };
669
- SkyFlyoutComponent.prototype.onMouseMove = function (event) {
670
- /* Sanity check */
671
- /* istanbul ignore if */
672
- if (!this.isDragging) {
673
- return;
674
- }
675
- var offsetX = event.clientX - this.xCoord;
676
- var width = this.flyoutWidth;
677
- width -= offsetX;
678
- if (width < this.config.minWidth || width > this.config.maxWidth) {
679
- return;
680
- }
681
- if (window.innerWidth - width < this.windowBufferSize) {
682
- width = window.innerWidth - this.windowBufferSize;
683
- this.xCoord = this.windowBufferSize;
684
- }
685
- else {
686
- this.xCoord = event.clientX;
687
- }
688
- this.flyoutWidth = width;
689
- this.updateBreakpointAndResponsiveClass(this.flyoutWidth);
690
- this.changeDetector.markForCheck();
691
- };
692
- SkyFlyoutComponent.prototype.onHandleRelease = function (event) {
693
- var _this = this;
694
- rxjs.fromEvent(document, 'click')
695
- .pipe(operators.take(1))
696
- .subscribe(function () {
697
- _this.isDragging = false;
698
- _this.adapter.toggleIframePointerEvents(true);
699
- _this.setUserData();
700
- });
701
- };
702
- SkyFlyoutComponent.prototype.onIteratorPreviousButtonClick = function () {
703
- this.flyoutInstance.iteratorPreviousButtonClick.emit();
704
- };
705
- SkyFlyoutComponent.prototype.onIteratorNextButtonClick = function () {
706
- this.flyoutInstance.iteratorNextButtonClick.emit();
707
- };
708
- SkyFlyoutComponent.prototype.createFlyoutInstance = function (component) {
709
- var _this = this;
710
- var instance = new SkyFlyoutInstance();
711
- instance.componentInstance = component;
712
- instance.hostController
713
- .pipe(operators.takeUntil(this.ngUnsubscribe))
714
- .subscribe(function (message) {
715
- _this.messageStream.next(message);
716
- });
717
- return instance;
718
- };
719
- SkyFlyoutComponent.prototype.handleIncomingMessages = function (message) {
720
- var _this = this;
721
- var _a;
722
- /* tslint:disable-next-line:switch-default */
723
- switch (message.type) {
724
- case exports.SkyFlyoutMessageType.Open:
725
- if (!this.isOpen) {
726
- this.isOpen = false;
727
- this.isOpening = true;
728
- }
729
- this.initFocusTrap();
730
- break;
731
- case exports.SkyFlyoutMessageType.Close:
732
- if (this.flyoutInstance.beforeClose.observers.length ===
733
- 0 ||
734
- ((_a = message.data) === null || _a === void 0 ? void 0 : _a.ignoreBeforeClose)) {
735
- this.isOpen = true;
736
- this.isOpening = false;
737
- }
738
- else {
739
- this.flyoutInstance.beforeClose.next(new SkyFlyoutBeforeCloseHandler(function () {
740
- _this.isOpen = true;
741
- _this.isOpening = false;
742
- }));
743
- }
744
- break;
745
- case exports.SkyFlyoutMessageType.EnableIteratorNextButton:
746
- this.config.iteratorNextButtonDisabled = false;
747
- break;
748
- case exports.SkyFlyoutMessageType.EnableIteratorPreviousButton:
749
- this.config.iteratorPreviousButtonDisabled = false;
750
- break;
751
- case exports.SkyFlyoutMessageType.DisableIteratorNextButton:
752
- this.config.iteratorNextButtonDisabled = true;
753
- break;
754
- case exports.SkyFlyoutMessageType.DisableIteratorPreviousButton:
755
- this.config.iteratorPreviousButtonDisabled = true;
756
- break;
757
- }
758
- this.changeDetector.markForCheck();
759
- };
760
- SkyFlyoutComponent.prototype.notifyClosed = function () {
761
- this.flyoutInstance.closed.emit();
762
- this.flyoutInstance.closed.complete();
763
- };
764
- SkyFlyoutComponent.prototype.cleanTemplate = function () {
765
- this.target.clear();
766
- };
767
- SkyFlyoutComponent.prototype.updateBreakpointAndResponsiveClass = function (width) {
768
- this.flyoutMediaQueryService.setBreakpointForWidth(width);
769
- var newBreakpiont = this.flyoutMediaQueryService.current;
770
- this.adapter.setResponsiveClass(this.elementRef, newBreakpiont);
771
- };
772
- SkyFlyoutComponent.prototype.setFullscreen = function () {
773
- if (window.innerWidth - this.windowBufferSize < this.config.minWidth) {
774
- this.isFullscreen = true;
775
- }
776
- else {
777
- this.isFullscreen = false;
778
- }
779
- };
780
- SkyFlyoutComponent.prototype.setUserData = function () {
781
- if (this.config.settingsKey) {
782
- this.uiConfigService
783
- .setConfig(this.config.settingsKey, {
784
- flyoutWidth: this.flyoutWidth,
785
- })
786
- .pipe(operators.take(1))
787
- .subscribe(
788
- // eslint-disable-next-line @typescript-eslint/no-empty-function
789
- function () { }, function (err) {
790
- console.warn('Could not save flyout data.');
791
- console.warn(err);
792
- });
793
- }
794
- };
795
- SkyFlyoutComponent.prototype.checkInitialSize = function () {
796
- if (this.flyoutWidth < this.config.minWidth) {
797
- this.flyoutWidth = this.config.minWidth;
798
- this.setUserData();
799
- }
800
- else if (this.flyoutWidth > this.config.maxWidth) {
801
- this.flyoutWidth = this.config.maxWidth;
802
- this.setUserData();
803
- }
804
- // Ensure flyout does not load larger than the window and its buffer
805
- if (window.innerWidth - this.flyoutWidth < this.windowBufferSize) {
806
- this.flyoutWidth = window.innerWidth - this.windowBufferSize;
807
- this.xCoord = this.windowBufferSize;
808
- this.setUserData();
809
- }
810
- if (this.flyoutMediaQueryService.isWidthWithinBreakpiont(window.innerWidth, i1$1.SkyMediaBreakpoints.xs)) {
811
- this.updateBreakpointAndResponsiveClass(window.innerWidth);
812
- }
813
- else {
814
- this.updateBreakpointAndResponsiveClass(this.flyoutWidth);
815
- }
816
- this.setFullscreen();
817
- };
818
- SkyFlyoutComponent.prototype.getString = function (key) {
819
- // TODO: Need to implement the async `getString` method in a breaking change.
820
- return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);
821
- };
822
- SkyFlyoutComponent.prototype.handleResizeKeyDown = function (event) {
823
- /* istanbul ignore else */
824
- if (event.key) {
825
- var keyPressed = event.key.toLowerCase().replace('arrow', '');
826
- switch (keyPressed) {
827
- case 'enter':
828
- case ' ':
829
- this.resizeKeyControlActive = !this.resizeKeyControlActive;
830
- break;
831
- case 'tab':
832
- /* istanbul ignore else */
833
- if (this.resizeKeyControlActive) {
834
- this.resizeKeyControlActive = false;
835
- }
836
- break;
837
- case 'left':
838
- if (this.resizeKeyControlActive) {
839
- /* istanbul ignore else */
840
- if (this.flyoutWidth < this.config.maxWidth) {
841
- this.flyoutWidth = Math.min(this.flyoutWidth + this.widthStep, this.config.maxWidth);
842
- }
843
- }
844
- break;
845
- case 'right':
846
- if (this.resizeKeyControlActive) {
847
- /* istanbul ignore else */
848
- if (this.flyoutWidth > this.config.minWidth) {
849
- this.flyoutWidth = Math.max(this.flyoutWidth - this.widthStep, this.config.minWidth);
850
- }
851
- }
852
- break;
853
- /* istanbul ignore next */
854
- default:
855
- break;
856
- }
857
- }
858
- };
859
- /** Executes a function when the zone is stable. */
860
- SkyFlyoutComponent.prototype._executeOnStable = function (fn) {
861
- if (this._ngZone.isStable) {
862
- fn();
863
- }
864
- else {
865
- this._ngZone.onStable.pipe(operators.take(1)).subscribe(fn);
866
- }
867
- };
868
- SkyFlyoutComponent.prototype.initFocusTrap = function () {
869
- var _this = this;
870
- this.enableTrapFocusAutoCapture = false;
871
- this.enableTrapFocus = false;
872
- // Waiting for zone to be stable will avoid ExpressionChangeAfterCheckedError.
873
- this._executeOnStable(function () {
874
- _this.enableTrapFocusAutoCapture = true;
875
- _this.enableTrapFocus = true;
876
- });
877
- };
878
- return SkyFlyoutComponent;
879
- }());
880
- SkyFlyoutComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutComponent, deps: [{ token: SkyFlyoutAdapterService }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.Injector }, { token: i0__namespace.ComponentFactoryResolver }, { token: i2__namespace$1.SkyLibResourcesService }, { token: SkyFlyoutMediaQueryService }, { token: i0__namespace.ElementRef }, { token: i1__namespace$1.SkyUIConfigService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
881
- SkyFlyoutComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFlyoutComponent, selector: "sky-flyout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [
882
- SkyFlyoutAdapterService,
883
- SkyFlyoutMediaQueryService,
884
- { provide: i1$1.SkyMediaQueryService, useExisting: SkyFlyoutMediaQueryService },
885
- ], viewQueries: [{ propertyName: "flyoutRef", first: true, predicate: ["flyoutRef"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "target", first: true, predicate: ["target"], descendants: true, read: i0.ViewContainerRef, static: true }, { propertyName: "flyoutCloseButton", first: true, predicate: ["flyoutCloseButton"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "flyoutContent", first: true, predicate: ["flyoutContent"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "flyoutHeader", first: true, predicate: ["flyoutHeader"], descendants: true, read: i0.ElementRef, static: true }], ngImport: i0__namespace, template: "<div\n class=\"sky-flyout\"\n tabindex=\"-1\"\n [attr.role]=\"config?.ariaRole ? config.ariaRole : 'dialog'\"\n [attr.aria-describedby]=\"config?.ariaDescribedBy\"\n [attr.aria-label]=\"config?.ariaLabel\"\n [attr.aria-labelledby]=\"config?.ariaLabelledBy\"\n [attr.aria-modal]=\"\n config?.ariaRole === 'dialog' || !config?.ariaRole ? true : false\n \"\n [attr.hidden]=\"!instanceReady ? true : undefined\"\n [id]=\"flyoutId\"\n [ngClass]=\"{\n 'sky-flyout-hidden': !isOpen && !isOpening,\n 'sky-flyout-fullscreen': isFullscreen\n }\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-8': 'modern'\n }\"\n (@flyoutState.done)=\"animationDone($event)\"\n [@flyoutState]=\"getAnimationState()\"\n [style.width.px]=\"flyoutWidth\"\n #flyoutRef\n [cdkTrapFocus]=\"enableTrapFocus\"\n [cdkTrapFocusAutoCapture]=\"enableTrapFocusAutoCapture\"\n>\n <div\n class=\"sky-flyout-header\"\n [skyThemeClass]=\"{\n 'sky-padding-squish-large': 'default'\n }\"\n #flyoutHeader\n >\n <div class=\"sky-flyout-header-content\">\n <button\n *skyThemeIf=\"'modern'\"\n class=\"\n sky-btn\n sky-btn-icon-borderless\n sky-margin-inline-sm\n sky-flyout-header-grab-handle\n \"\n [attr.aria-label]=\"'skyux_flyout_resize_handle' | skyLibResources\"\n (keydown)=\"onHeaderGrabHandleKeyDown($event)\"\n (mousedown)=\"onHeaderGrabHandleMouseDown($event)\"\n >\n <sky-icon icon=\"tile-drag\" iconType=\"skyux\" size=\"lg\"> </sky-icon>\n </button>\n\n <sky-flyout-iterator\n *ngIf=\"config.showIterator\"\n [nextButtonDisabled]=\"config.iteratorNextButtonDisabled\"\n [previousButtonDisabled]=\"config.iteratorPreviousButtonDisabled\"\n (nextButtonClick)=\"onIteratorNextButtonClick()\"\n (previousButtonClick)=\"onIteratorPreviousButtonClick()\"\n >\n </sky-flyout-iterator>\n </div>\n <div class=\"sky-flyout-header-buttons\">\n <ng-container *ngTemplateOutlet=\"permalinkTemplate\"> </ng-container>\n <ng-container *ngTemplateOutlet=\"primaryActionTemplate\"> </ng-container>\n <button\n class=\"sky-btn sky-flyout-btn-close sky-label-icon-theme-default\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_flyout_close' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-btn-default': 'default',\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"close()\"\n #flyoutCloseButton\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"close\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"close\"\n iconType=\"skyux\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n </div>\n </div>\n <div class=\"sky-flyout-content\" #flyoutContent>\n <div #target></div>\n </div>\n <div\n class=\"sky-flyout-resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n type=\"range\"\n [attr.aria-controls]=\"flyoutId\"\n [attr.aria-label]=\"'skyux_flyout_resize_handle' | skyLibResources\"\n [attr.aria-valuemax]=\"config.maxWidth\"\n [attr.aria-valuemin]=\"config.minWidth\"\n [attr.aria-valuenow]=\"flyoutWidth\"\n (keydown)=\"onResizeHandleKeyDown($event)\"\n (mousedown)=\"onResizeHandleMouseDown($event)\"\n ></div>\n</div>\n\n<ng-template #permalinkTemplate>\n <ng-template [ngIf]=\"permalink\">\n <ng-template [ngIf]=\"permalink.url\">\n <a\n class=\"sky-btn sky-flyout-btn-permalink sky-margin-inline-default\"\n [skyHref]=\"permalink.url\"\n [skyThemeClass]=\"{\n 'sky-btn-default': 'default',\n 'sky-btn-borderless': 'modern'\n }\"\n (click)=\"close()\"\n >\n {{ permalinkLabel }}\n </a>\n </ng-template>\n <ng-template [ngIf]=\"permalink.route\">\n <a\n class=\"sky-btn sky-flyout-btn-permalink sky-margin-inline-default\"\n [routerLink]=\"permalink.route.commands\"\n [fragment]=\"permalink.route.extras?.fragment\"\n [skyThemeClass]=\"{\n 'sky-btn-default': 'default',\n 'sky-btn-borderless': 'modern'\n }\"\n [queryParams]=\"permalink.route.extras?.queryParams\"\n [queryParamsHandling]=\"permalink.route.extras?.queryParamsHandling\"\n [state]=\"permalink.route.extras?.state\"\n (click)=\"close()\"\n >\n {{ permalinkLabel }}\n </a>\n </ng-template>\n </ng-template>\n</ng-template>\n\n<ng-template #primaryActionTemplate>\n <ng-template [ngIf]=\"primaryAction && primaryAction.callback\">\n <button\n type=\"button\"\n class=\"\n sky-btn\n sky-btn-default\n sky-flyout-btn-primary-action\n sky-margin-inline-default\n \"\n (click)=\"invokePrimaryAction()\"\n >\n {{ primaryActionLabel }}\n </button>\n </ng-template>\n</ng-template>\n", styles: [".sky-flyout{position:fixed;right:0;top:0;bottom:0;height:100%;background-color:#fff;border-left:6px solid #0974a1;z-index:1001}.sky-flyout:focus{outline:none}.sky-flyout.sky-flyout-fullscreen{min-width:100%;max-width:100%}.sky-flyout.sky-flyout-fullscreen .sky-flyout-resize-handle{cursor:initial}.sky-flyout.sky-flyout-hidden{visibility:hidden}.sky-flyout .sky-flyout-input-aria-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0 0 0 0);outline:none}.sky-flyout-resize-handle{-webkit-appearance:none;-moz-appearance:none;height:100%;width:14px;position:absolute;left:-10px;cursor:ew-resize;padding:0;border:0;background:transparent;display:block;top:0;bottom:0;direction:rtl}.sky-flyout-resize-handle::-moz-range-thumb,.sky-flyout-resize-handle::-moz-range-track{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-flyout-resize-handle::-ms-thumb,.sky-flyout-resize-handle::-ms-track{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-flyout-resize-handle::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-flyout-header{border-bottom:1px solid #cdcfd2;width:100%;background:#eeeeef;height:50px;display:flex;align-items:flex-start}.sky-flyout-header-content{flex-grow:1}.sky-flyout-btn-permalink:hover{text-decoration:none}.sky-flyout-help-shim{padding-right:8px}@media (min-width: 768px){.sky-flyout-help-shim{padding-right:50px}}.sky-flyout-content{overflow-y:auto;height:calc(100% - 50px)}:host-context(.sky-theme-modern) .sky-flyout{border-left:0}:host-context(.sky-theme-modern) .sky-flyout-header{border-bottom:none;background:#fff;padding:15px 10px}:host-context(.sky-theme-modern) .sky-flyout-header-grab-handle{cursor:move;cursor:-moz-grab}.sky-theme-modern .sky-flyout{border-left:0}.sky-theme-modern .sky-flyout-header{border-bottom:none;background:#fff;padding:15px 10px}.sky-theme-modern .sky-flyout-header-grab-handle{cursor:move;cursor:-moz-grab}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-flyout{background:#000}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-flyout-header{background:#000}.sky-theme-modern.sky-theme-mode-dark .sky-flyout{background:#000}.sky-theme-modern.sky-theme-mode-dark .sky-flyout-header{background:#000}\n"], components: [{ type: i1__namespace.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: SkyFlyoutIteratorComponent, selector: "sky-flyout-iterator", inputs: ["nextButtonDisabled", "previousButtonDisabled"], outputs: ["previousButtonClick", "nextButtonClick"] }], directives: [{ type: i7__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2__namespace.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i9__namespace.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i2__namespace.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10__namespace.λ1, selector: "[skyHref]", inputs: ["skyHref", "skyHrefElse"] }, { type: i2__namespace$2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "skyLibResources": i2__namespace$1.SkyLibResourcesPipe }, animations: [
886
- animations.trigger('flyoutState', [
887
- animations.state(FLYOUT_OPEN_STATE, animations.style({ transform: 'initial' })),
888
- animations.state(FLYOUT_CLOSED_STATE, animations.style({ transform: 'translateX(100%)' })),
889
- animations.transition('void => *', [
890
- animations.style({ transform: 'translateX(100%)' }),
891
- animations.animate(250),
892
- ]),
893
- animations.transition("* <=> *", animations.animate('250ms ease-in')),
894
- ]),
895
- ], changeDetection: i0__namespace.ChangeDetectionStrategy.Default });
896
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutComponent, decorators: [{
897
- type: i0.Component,
898
- args: [{
899
- selector: 'sky-flyout',
900
- template: "<div\n class=\"sky-flyout\"\n tabindex=\"-1\"\n [attr.role]=\"config?.ariaRole ? config.ariaRole : 'dialog'\"\n [attr.aria-describedby]=\"config?.ariaDescribedBy\"\n [attr.aria-label]=\"config?.ariaLabel\"\n [attr.aria-labelledby]=\"config?.ariaLabelledBy\"\n [attr.aria-modal]=\"\n config?.ariaRole === 'dialog' || !config?.ariaRole ? true : false\n \"\n [attr.hidden]=\"!instanceReady ? true : undefined\"\n [id]=\"flyoutId\"\n [ngClass]=\"{\n 'sky-flyout-hidden': !isOpen && !isOpening,\n 'sky-flyout-fullscreen': isFullscreen\n }\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-8': 'modern'\n }\"\n (@flyoutState.done)=\"animationDone($event)\"\n [@flyoutState]=\"getAnimationState()\"\n [style.width.px]=\"flyoutWidth\"\n #flyoutRef\n [cdkTrapFocus]=\"enableTrapFocus\"\n [cdkTrapFocusAutoCapture]=\"enableTrapFocusAutoCapture\"\n>\n <div\n class=\"sky-flyout-header\"\n [skyThemeClass]=\"{\n 'sky-padding-squish-large': 'default'\n }\"\n #flyoutHeader\n >\n <div class=\"sky-flyout-header-content\">\n <button\n *skyThemeIf=\"'modern'\"\n class=\"\n sky-btn\n sky-btn-icon-borderless\n sky-margin-inline-sm\n sky-flyout-header-grab-handle\n \"\n [attr.aria-label]=\"'skyux_flyout_resize_handle' | skyLibResources\"\n (keydown)=\"onHeaderGrabHandleKeyDown($event)\"\n (mousedown)=\"onHeaderGrabHandleMouseDown($event)\"\n >\n <sky-icon icon=\"tile-drag\" iconType=\"skyux\" size=\"lg\"> </sky-icon>\n </button>\n\n <sky-flyout-iterator\n *ngIf=\"config.showIterator\"\n [nextButtonDisabled]=\"config.iteratorNextButtonDisabled\"\n [previousButtonDisabled]=\"config.iteratorPreviousButtonDisabled\"\n (nextButtonClick)=\"onIteratorNextButtonClick()\"\n (previousButtonClick)=\"onIteratorPreviousButtonClick()\"\n >\n </sky-flyout-iterator>\n </div>\n <div class=\"sky-flyout-header-buttons\">\n <ng-container *ngTemplateOutlet=\"permalinkTemplate\"> </ng-container>\n <ng-container *ngTemplateOutlet=\"primaryActionTemplate\"> </ng-container>\n <button\n class=\"sky-btn sky-flyout-btn-close sky-label-icon-theme-default\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_flyout_close' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-btn-default': 'default',\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"close()\"\n #flyoutCloseButton\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"close\"> </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"close\"\n iconType=\"skyux\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n </div>\n </div>\n <div class=\"sky-flyout-content\" #flyoutContent>\n <div #target></div>\n </div>\n <div\n class=\"sky-flyout-resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n type=\"range\"\n [attr.aria-controls]=\"flyoutId\"\n [attr.aria-label]=\"'skyux_flyout_resize_handle' | skyLibResources\"\n [attr.aria-valuemax]=\"config.maxWidth\"\n [attr.aria-valuemin]=\"config.minWidth\"\n [attr.aria-valuenow]=\"flyoutWidth\"\n (keydown)=\"onResizeHandleKeyDown($event)\"\n (mousedown)=\"onResizeHandleMouseDown($event)\"\n ></div>\n</div>\n\n<ng-template #permalinkTemplate>\n <ng-template [ngIf]=\"permalink\">\n <ng-template [ngIf]=\"permalink.url\">\n <a\n class=\"sky-btn sky-flyout-btn-permalink sky-margin-inline-default\"\n [skyHref]=\"permalink.url\"\n [skyThemeClass]=\"{\n 'sky-btn-default': 'default',\n 'sky-btn-borderless': 'modern'\n }\"\n (click)=\"close()\"\n >\n {{ permalinkLabel }}\n </a>\n </ng-template>\n <ng-template [ngIf]=\"permalink.route\">\n <a\n class=\"sky-btn sky-flyout-btn-permalink sky-margin-inline-default\"\n [routerLink]=\"permalink.route.commands\"\n [fragment]=\"permalink.route.extras?.fragment\"\n [skyThemeClass]=\"{\n 'sky-btn-default': 'default',\n 'sky-btn-borderless': 'modern'\n }\"\n [queryParams]=\"permalink.route.extras?.queryParams\"\n [queryParamsHandling]=\"permalink.route.extras?.queryParamsHandling\"\n [state]=\"permalink.route.extras?.state\"\n (click)=\"close()\"\n >\n {{ permalinkLabel }}\n </a>\n </ng-template>\n </ng-template>\n</ng-template>\n\n<ng-template #primaryActionTemplate>\n <ng-template [ngIf]=\"primaryAction && primaryAction.callback\">\n <button\n type=\"button\"\n class=\"\n sky-btn\n sky-btn-default\n sky-flyout-btn-primary-action\n sky-margin-inline-default\n \"\n (click)=\"invokePrimaryAction()\"\n >\n {{ primaryActionLabel }}\n </button>\n </ng-template>\n</ng-template>\n",
901
- styles: [".sky-flyout{position:fixed;right:0;top:0;bottom:0;height:100%;background-color:#fff;border-left:6px solid #0974a1;z-index:1001}.sky-flyout:focus{outline:none}.sky-flyout.sky-flyout-fullscreen{min-width:100%;max-width:100%}.sky-flyout.sky-flyout-fullscreen .sky-flyout-resize-handle{cursor:initial}.sky-flyout.sky-flyout-hidden{visibility:hidden}.sky-flyout .sky-flyout-input-aria-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0 0 0 0);outline:none}.sky-flyout-resize-handle{-webkit-appearance:none;-moz-appearance:none;height:100%;width:14px;position:absolute;left:-10px;cursor:ew-resize;padding:0;border:0;background:transparent;display:block;top:0;bottom:0;direction:rtl}.sky-flyout-resize-handle::-moz-range-thumb,.sky-flyout-resize-handle::-moz-range-track{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-flyout-resize-handle::-ms-thumb,.sky-flyout-resize-handle::-ms-track{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-flyout-resize-handle::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-flyout-header{border-bottom:1px solid #cdcfd2;width:100%;background:#eeeeef;height:50px;display:flex;align-items:flex-start}.sky-flyout-header-content{flex-grow:1}.sky-flyout-btn-permalink:hover{text-decoration:none}.sky-flyout-help-shim{padding-right:8px}@media (min-width: 768px){.sky-flyout-help-shim{padding-right:50px}}.sky-flyout-content{overflow-y:auto;height:calc(100% - 50px)}:host-context(.sky-theme-modern) .sky-flyout{border-left:0}:host-context(.sky-theme-modern) .sky-flyout-header{border-bottom:none;background:#fff;padding:15px 10px}:host-context(.sky-theme-modern) .sky-flyout-header-grab-handle{cursor:move;cursor:-moz-grab}.sky-theme-modern .sky-flyout{border-left:0}.sky-theme-modern .sky-flyout-header{border-bottom:none;background:#fff;padding:15px 10px}.sky-theme-modern .sky-flyout-header-grab-handle{cursor:move;cursor:-moz-grab}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-flyout{background:#000}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-flyout-header{background:#000}.sky-theme-modern.sky-theme-mode-dark .sky-flyout{background:#000}.sky-theme-modern.sky-theme-mode-dark .sky-flyout-header{background:#000}\n"],
902
- providers: [
903
- SkyFlyoutAdapterService,
904
- SkyFlyoutMediaQueryService,
905
- { provide: i1$1.SkyMediaQueryService, useExisting: SkyFlyoutMediaQueryService },
906
- ],
907
- animations: [
908
- animations.trigger('flyoutState', [
909
- animations.state(FLYOUT_OPEN_STATE, animations.style({ transform: 'initial' })),
910
- animations.state(FLYOUT_CLOSED_STATE, animations.style({ transform: 'translateX(100%)' })),
911
- animations.transition('void => *', [
912
- animations.style({ transform: 'translateX(100%)' }),
913
- animations.animate(250),
914
- ]),
915
- animations.transition("* <=> *", animations.animate('250ms ease-in')),
916
- ]),
917
- ],
918
- // Allow automatic change detection for child components.
919
- changeDetection: i0.ChangeDetectionStrategy.Default,
920
- }]
921
- }], ctorParameters: function () { return [{ type: SkyFlyoutAdapterService }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.Injector }, { type: i0__namespace.ComponentFactoryResolver }, { type: i2__namespace$1.SkyLibResourcesService }, { type: SkyFlyoutMediaQueryService }, { type: i0__namespace.ElementRef }, { type: i1__namespace$1.SkyUIConfigService }, { type: i0__namespace.NgZone }]; }, propDecorators: { flyoutRef: [{
922
- type: i0.ViewChild,
923
- args: ['flyoutRef', {
924
- read: i0.ElementRef,
925
- static: true,
926
- }]
927
- }], target: [{
928
- type: i0.ViewChild,
929
- args: ['target', {
930
- read: i0.ViewContainerRef,
931
- static: true,
932
- }]
933
- }], flyoutCloseButton: [{
934
- type: i0.ViewChild,
935
- args: ['flyoutCloseButton', {
936
- read: i0.ElementRef,
937
- static: true,
938
- }]
939
- }], flyoutContent: [{
940
- type: i0.ViewChild,
941
- args: ['flyoutContent', {
942
- read: i0.ElementRef,
943
- static: true,
944
- }]
945
- }], flyoutHeader: [{
946
- type: i0.ViewChild,
947
- args: ['flyoutHeader', {
948
- read: i0.ElementRef,
949
- static: true,
950
- }]
951
- }], onWindowResize: [{
952
- type: i0.HostListener,
953
- args: ['window:resize', ['$event']]
954
- }] } });
955
-
956
- var SkyFlyoutModule = /** @class */ (function () {
957
- function SkyFlyoutModule() {
958
- }
959
- return SkyFlyoutModule;
960
- }());
961
- SkyFlyoutModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
962
- SkyFlyoutModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutModule, declarations: [SkyFlyoutComponent, SkyFlyoutIteratorComponent], imports: [i9.A11yModule,
963
- i7.CommonModule,
964
- forms.FormsModule,
965
- i2$2.RouterModule,
966
- i2.SkyI18nModule,
967
- i1.SkyIconModule,
968
- SkyFlyoutResourcesModule,
969
- i2$1.SkyThemeModule,
970
- i10.SkyHrefModule], exports: [SkyFlyoutComponent] });
971
- SkyFlyoutModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutModule, imports: [[
972
- i9.A11yModule,
973
- i7.CommonModule,
974
- forms.FormsModule,
975
- i2$2.RouterModule,
976
- i2.SkyI18nModule,
977
- i1.SkyIconModule,
978
- SkyFlyoutResourcesModule,
979
- i2$1.SkyThemeModule,
980
- i10.SkyHrefModule,
981
- ]] });
982
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutModule, decorators: [{
983
- type: i0.NgModule,
984
- args: [{
985
- declarations: [SkyFlyoutComponent, SkyFlyoutIteratorComponent],
986
- imports: [
987
- i9.A11yModule,
988
- i7.CommonModule,
989
- forms.FormsModule,
990
- i2$2.RouterModule,
991
- i2.SkyI18nModule,
992
- i1.SkyIconModule,
993
- SkyFlyoutResourcesModule,
994
- i2$1.SkyThemeModule,
995
- i10.SkyHrefModule,
996
- ],
997
- exports: [SkyFlyoutComponent],
998
- entryComponents: [SkyFlyoutComponent],
999
- }]
1000
- }] });
1001
-
1002
- /**
1003
- * Launches flyouts and provides a common look and feel.
1004
- * This service dynamically generates the flyout component and appends it directly to the
1005
- * document's `body` element. The `SkyFlyoutInstance` class watches for and triggers flyout events.
1006
- */
1007
- var SkyFlyoutService = /** @class */ (function () {
1008
- function SkyFlyoutService(coreAdapter, windowRef, dynamicComponentService, router, _ngZone,
1009
- // NOTE: This used to be used for an `applicationRef.tick` which has since been removed.
1010
- // We can not remove this due to it being a breaking change for those manually constructing the service.
1011
- applicationRef) {
1012
- this.coreAdapter = coreAdapter;
1013
- this.windowRef = windowRef;
1014
- this.dynamicComponentService = dynamicComponentService;
1015
- this.router = router;
1016
- this._ngZone = _ngZone;
1017
- this.applicationRef = applicationRef;
1018
- this.removeAfterClosed = false;
1019
- this.isOpening = false;
1020
- this.ngUnsubscribe = new rxjs.Subject();
1021
- }
1022
- SkyFlyoutService.prototype.ngOnDestroy = function () {
1023
- this.removeListners();
1024
- if (this.host) {
1025
- this.removeHostComponent();
1026
- }
1027
- };
1028
- /**
1029
- * Closes the flyout. This method also removes the flyout's HTML elements from the DOM.
1030
- * @param args Arguments used when closing the flyout.
1031
- */
1032
- SkyFlyoutService.prototype.close = function (args) {
1033
- if (this.host && !this.isOpening) {
1034
- this.host.instance.messageStream.next({
1035
- type: exports.SkyFlyoutMessageType.Close,
1036
- data: {
1037
- ignoreBeforeClose: args ? args.ignoreBeforeClose : false,
1038
- },
1039
- });
1040
- }
1041
- };
1042
- /**
1043
- * Opens a flyout and displays the specified component.
1044
- * @param component Specifies the component to render.
1045
- * @param config Specifies the flyout configuration passed to the specified component's constructor.
1046
- */
1047
- SkyFlyoutService.prototype.open = function (component, config) {
1048
- var _this = this;
1049
- // isOpening flag will prevent close() from firing when open() is also fired.
1050
- this.isOpening = true;
1051
- this.windowRef.nativeWindow.setTimeout(function () {
1052
- _this.isOpening = false;
1053
- });
1054
- if (!this.host) {
1055
- this.host = this.createHostComponent();
1056
- this.router.events
1057
- .pipe(operators.takeWhile(function () { return _this.host !== undefined; }))
1058
- .subscribe(function (event) {
1059
- if (event instanceof i2$2.NavigationStart) {
1060
- _this.close();
1061
- // Sanity check - if the host still exists after animations should have completed - remove host
1062
- _this._ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
1063
- if (_this.host) {
1064
- _this.removeHostComponent();
1065
- }
1066
- });
1067
- }
1068
- });
1069
- }
1070
- var flyout = this.host.instance.attach(component, config);
1071
- this.addListeners(flyout);
1072
- return flyout;
1073
- };
1074
- SkyFlyoutService.prototype.createHostComponent = function () {
1075
- this.host =
1076
- this.dynamicComponentService.createComponent(SkyFlyoutComponent);
1077
- return this.host;
1078
- };
1079
- SkyFlyoutService.prototype.removeHostComponent = function () {
1080
- if (this.host) {
1081
- this.dynamicComponentService.removeComponent(this.host);
1082
- this.host = undefined;
1083
- }
1084
- };
1085
- SkyFlyoutService.prototype.addListeners = function (flyout) {
1086
- var _this = this;
1087
- /* istanbul ignore else */
1088
- if (this.host) {
1089
- var flyoutInstance_1 = this.host.instance;
1090
- var doClose_1 = false;
1091
- /**
1092
- * Handles when to close a flyout.
1093
- * Note: We're using `mouseup` in order to capture the parent of certain targets that will be
1094
- * deleted immediately after being clicked. If we use `click`, the event is fired after the
1095
- * element is removed from the DOM making it impossible to check the parent's z-index
1096
- * relative to the flyout's container.
1097
- */
1098
- rxjs.fromEvent(document, 'mouseup')
1099
- .pipe(operators.takeUntil(this.ngUnsubscribe))
1100
- .subscribe(function (event) {
1101
- doClose_1 = false;
1102
- if (_this.host.instance.isDragging) {
1103
- return;
1104
- }
1105
- if (flyoutInstance_1.flyoutRef.nativeElement.contains(event.target)) {
1106
- return;
1107
- }
1108
- var isAbove = event.target === document
1109
- ? false
1110
- : _this.coreAdapter.isTargetAboveElement(event.target, flyoutInstance_1.flyoutRef.nativeElement);
1111
- /* istanbul ignore else */
1112
- if (!isAbove) {
1113
- doClose_1 = true;
1114
- }
1115
- });
1116
- /**
1117
- * Check if we should close the flyout specifically on a `click` event so that we can keep
1118
- * it open when consumers fire another `click` event on a trigger button. Since the consumer
1119
- * will likely use a `click` event to open the flyout, we want to wait for that event to fire
1120
- * before determining if the flyout should be closed.
1121
- */
1122
- rxjs.fromEvent(document, 'click')
1123
- .pipe(operators.takeUntil(this.ngUnsubscribe))
1124
- .subscribe(function () {
1125
- if (doClose_1) {
1126
- _this.close();
1127
- }
1128
- });
1129
- this.removeAfterClosed = false;
1130
- flyoutInstance_1.messageStream
1131
- .pipe(operators.takeUntil(this.ngUnsubscribe))
1132
- .subscribe(function (message) {
1133
- if (message.type === exports.SkyFlyoutMessageType.Close) {
1134
- _this.removeAfterClosed = true;
1135
- _this.isOpening = false;
1136
- }
1137
- });
1138
- flyout.closed.pipe(operators.take(1)).subscribe(function () {
1139
- _this.removeListners();
1140
- if (_this.removeAfterClosed) {
1141
- _this.removeHostComponent();
1142
- }
1143
- });
1144
- }
1145
- };
1146
- SkyFlyoutService.prototype.removeListners = function () {
1147
- this.ngUnsubscribe.next(true);
1148
- this.ngUnsubscribe.unsubscribe();
1149
- this.ngUnsubscribe = new rxjs.Subject();
1150
- };
1151
- return SkyFlyoutService;
1152
- }());
1153
- SkyFlyoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutService, deps: [{ token: i1__namespace$1.SkyCoreAdapterService }, { token: i1__namespace$1.SkyAppWindowRef }, { token: i1__namespace$1.SkyDynamicComponentService }, { token: i2__namespace$2.Router }, { token: i0__namespace.NgZone }, { token: i0__namespace.ApplicationRef, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1154
- SkyFlyoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutService, providedIn: 'any' });
1155
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFlyoutService, decorators: [{
1156
- type: i0.Injectable,
1157
- args: [{
1158
- providedIn: 'any',
1159
- }]
1160
- }], ctorParameters: function () {
1161
- return [{ type: i1__namespace$1.SkyCoreAdapterService }, { type: i1__namespace$1.SkyAppWindowRef }, { type: i1__namespace$1.SkyDynamicComponentService }, { type: i2__namespace$2.Router }, { type: i0__namespace.NgZone }, { type: i0__namespace.ApplicationRef, decorators: [{
1162
- type: i0.Optional
1163
- }] }];
1164
- } });
1165
-
1166
- /**
1167
- * Generated bundle index. Do not edit.
1168
- */
1169
-
1170
- exports.SkyFlyoutBeforeCloseHandler = SkyFlyoutBeforeCloseHandler;
1171
- exports.SkyFlyoutInstance = SkyFlyoutInstance;
1172
- exports.SkyFlyoutModule = SkyFlyoutModule;
1173
- exports.SkyFlyoutService = SkyFlyoutService;
1174
- exports["λ1"] = SkyFlyoutComponent;
1175
-
1176
- Object.defineProperty(exports, '__esModule', { value: true });
1177
-
1178
- }));
1179
- //# sourceMappingURL=skyux-flyout.umd.js.map