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