@skyux/flyout 5.0.2 → 5.1.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/bundles/skyux-flyout.umd.js +186 -78
- package/documentation.json +440 -151
- package/esm2015/modules/flyout/flyout-adapter.service.js +3 -3
- package/esm2015/modules/flyout/flyout-instance.js +13 -2
- package/esm2015/modules/flyout/flyout-iterator.component.js +3 -3
- package/esm2015/modules/flyout/flyout-media-query.service.js +3 -3
- package/esm2015/modules/flyout/flyout.component.js +108 -41
- package/esm2015/modules/flyout/flyout.module.js +10 -6
- package/esm2015/modules/flyout/flyout.service.js +24 -13
- package/esm2015/modules/flyout/types/flyout-before-close-handler.js +9 -0
- package/esm2015/modules/flyout/types/flyout-close-args.js +2 -0
- package/esm2015/modules/flyout/types/flyout-config.js +1 -1
- package/esm2015/modules/flyout/types/flyout-message.js +1 -1
- package/esm2015/modules/shared/sky-flyout-resources.module.js +54 -0
- package/esm2015/public-api.js +3 -1
- package/fesm2015/skyux-flyout.js +173 -72
- package/fesm2015/skyux-flyout.js.map +1 -1
- package/modules/flyout/flyout-instance.d.ts +12 -2
- package/modules/flyout/flyout.component.d.ts +14 -2
- package/modules/flyout/flyout.module.d.ts +10 -9
- package/modules/flyout/flyout.service.d.ts +8 -7
- package/modules/flyout/types/flyout-before-close-handler.d.ts +10 -0
- package/modules/flyout/types/flyout-close-args.d.ts +9 -0
- package/modules/flyout/types/flyout-config.d.ts +10 -0
- package/modules/flyout/types/flyout-message.d.ts +3 -0
- package/modules/shared/{flyout-resources.module.d.ts → sky-flyout-resources.module.d.ts} +0 -0
- package/package.json +12 -11
- package/public-api.d.ts +2 -0
- package/bundles/skyux-flyout.umd.js.map +0 -1
- package/esm2015/modules/shared/flyout-resources.module.js +0 -54
package/fesm2015/skyux-flyout.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, NgModule, Injectable, Component, Input, Output,
|
|
2
|
+
import { EventEmitter, NgModule, Injectable, Component, Input, Output, Injector, ElementRef, ViewContainerRef, ChangeDetectionStrategy, ViewChild, HostListener } from '@angular/core';
|
|
3
3
|
import { Subject, BehaviorSubject, fromEvent } from 'rxjs';
|
|
4
|
+
import * as i9 from '@angular/cdk/a11y';
|
|
5
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
4
6
|
import * as i7 from '@angular/common';
|
|
5
7
|
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i9 from '@angular/forms';
|
|
7
8
|
import { FormsModule } from '@angular/forms';
|
|
8
9
|
import * as i2$2 from '@angular/router';
|
|
9
10
|
import { RouterModule, NavigationStart } from '@angular/router';
|
|
@@ -47,6 +48,7 @@ class SkyFlyoutInstance {
|
|
|
47
48
|
* @default true
|
|
48
49
|
*/
|
|
49
50
|
this.isOpen = true;
|
|
51
|
+
this._beforeClose = new Subject();
|
|
50
52
|
this._iteratorNextButtonClick = new EventEmitter();
|
|
51
53
|
this._iteratorPreviousButtonClick = new EventEmitter();
|
|
52
54
|
this._iteratorNextButtonDisabled = false;
|
|
@@ -56,6 +58,14 @@ class SkyFlyoutInstance {
|
|
|
56
58
|
this.isOpen = false;
|
|
57
59
|
});
|
|
58
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* An event that the modal instance emits when it is about to close.
|
|
63
|
+
* If a subscription exists for this event,
|
|
64
|
+
* the modal does not close until the subscriber calls the handler's `closeModal` method.
|
|
65
|
+
*/
|
|
66
|
+
get beforeClose() {
|
|
67
|
+
return this._beforeClose;
|
|
68
|
+
}
|
|
59
69
|
/**
|
|
60
70
|
* Used to communicate with the host component.
|
|
61
71
|
* @internal
|
|
@@ -117,10 +127,12 @@ class SkyFlyoutInstance {
|
|
|
117
127
|
}
|
|
118
128
|
/**
|
|
119
129
|
* Closes the flyout instance and emits its `closed` event.
|
|
130
|
+
* @param args Arguments used when closing the flyout.
|
|
120
131
|
*/
|
|
121
|
-
close() {
|
|
132
|
+
close(args) {
|
|
122
133
|
this.hostController.next({
|
|
123
134
|
type: SkyFlyoutMessageType.Close,
|
|
135
|
+
data: { ignoreBeforeClose: args ? args.ignoreBeforeClose : false },
|
|
124
136
|
});
|
|
125
137
|
this._iteratorPreviousButtonClick.complete();
|
|
126
138
|
this._iteratorNextButtonClick.complete();
|
|
@@ -131,7 +143,7 @@ class SkyFlyoutInstance {
|
|
|
131
143
|
/**
|
|
132
144
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
133
145
|
* The contents of this file were automatically generated by
|
|
134
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/
|
|
146
|
+
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-flyout' schematic.
|
|
135
147
|
* To update this file, simply rerun the command.
|
|
136
148
|
*/
|
|
137
149
|
const RESOURCES = {
|
|
@@ -142,7 +154,7 @@ const RESOURCES = {
|
|
|
142
154
|
skyux_flyout_permalink_button: { message: 'View record' },
|
|
143
155
|
skyux_flyout_primary_action_button: { message: 'Create list' },
|
|
144
156
|
skyux_flyout_resize_handle: {
|
|
145
|
-
message: 'Resize the flyout window.
|
|
157
|
+
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.',
|
|
146
158
|
},
|
|
147
159
|
},
|
|
148
160
|
};
|
|
@@ -156,16 +168,16 @@ class SkyFlyoutResourcesProvider {
|
|
|
156
168
|
*/
|
|
157
169
|
class SkyFlyoutResourcesModule {
|
|
158
170
|
}
|
|
159
|
-
SkyFlyoutResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
160
|
-
SkyFlyoutResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
161
|
-
SkyFlyoutResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
171
|
+
SkyFlyoutResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
172
|
+
SkyFlyoutResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutResourcesModule, exports: [SkyI18nModule] });
|
|
173
|
+
SkyFlyoutResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutResourcesModule, providers: [
|
|
162
174
|
{
|
|
163
175
|
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
164
176
|
useClass: SkyFlyoutResourcesProvider,
|
|
165
177
|
multi: true,
|
|
166
178
|
},
|
|
167
179
|
], imports: [SkyI18nModule] });
|
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutResourcesModule, decorators: [{
|
|
169
181
|
type: NgModule,
|
|
170
182
|
args: [{
|
|
171
183
|
exports: [SkyI18nModule],
|
|
@@ -233,9 +245,9 @@ class SkyFlyoutAdapterService {
|
|
|
233
245
|
}
|
|
234
246
|
}
|
|
235
247
|
}
|
|
236
|
-
SkyFlyoutAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
237
|
-
SkyFlyoutAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
248
|
+
SkyFlyoutAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutAdapterService, deps: [{ token: i0.RendererFactory2 }, { token: i1.SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
249
|
+
SkyFlyoutAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutAdapterService });
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutAdapterService, decorators: [{
|
|
239
251
|
type: Injectable
|
|
240
252
|
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }, { type: i1.SkyAppWindowRef }]; } });
|
|
241
253
|
|
|
@@ -301,12 +313,21 @@ class SkyFlyoutMediaQueryService {
|
|
|
301
313
|
this.currentSubject.complete();
|
|
302
314
|
}
|
|
303
315
|
}
|
|
304
|
-
SkyFlyoutMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
305
|
-
SkyFlyoutMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
306
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
316
|
+
SkyFlyoutMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutMediaQueryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
317
|
+
SkyFlyoutMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutMediaQueryService });
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutMediaQueryService, decorators: [{
|
|
307
319
|
type: Injectable
|
|
308
320
|
}], ctorParameters: function () { return []; } });
|
|
309
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Handler for notifying the flyout when it is appropriate to close the flyout. This will be returned from the flyout instance's `beforeClose` observable.
|
|
324
|
+
*/
|
|
325
|
+
class SkyFlyoutBeforeCloseHandler {
|
|
326
|
+
constructor(closeFlyoutFunction) {
|
|
327
|
+
this.closeFlyout = closeFlyoutFunction;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
310
331
|
/**
|
|
311
332
|
* @internal
|
|
312
333
|
*/
|
|
@@ -341,9 +362,9 @@ class SkyFlyoutIteratorComponent {
|
|
|
341
362
|
}
|
|
342
363
|
}
|
|
343
364
|
}
|
|
344
|
-
SkyFlyoutIteratorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
345
|
-
SkyFlyoutIteratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
365
|
+
SkyFlyoutIteratorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutIteratorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
366
|
+
SkyFlyoutIteratorComponent.ɵcmp = i0.ɵɵ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, 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$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i2.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i2.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], pipes: { "skyLibResources": i2$1.SkyLibResourcesPipe } });
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutIteratorComponent, decorators: [{
|
|
347
368
|
type: Component,
|
|
348
369
|
args: [{
|
|
349
370
|
selector: 'sky-flyout-iterator',
|
|
@@ -367,7 +388,7 @@ let nextId = 0;
|
|
|
367
388
|
* @internal
|
|
368
389
|
*/
|
|
369
390
|
class SkyFlyoutComponent {
|
|
370
|
-
constructor(adapter, changeDetector, injector, resolver, resourcesService, flyoutMediaQueryService, elementRef, uiConfigService) {
|
|
391
|
+
constructor(adapter, changeDetector, injector, resolver, resourcesService, flyoutMediaQueryService, elementRef, uiConfigService, _ngZone) {
|
|
371
392
|
this.adapter = adapter;
|
|
372
393
|
this.changeDetector = changeDetector;
|
|
373
394
|
this.injector = injector;
|
|
@@ -376,13 +397,16 @@ class SkyFlyoutComponent {
|
|
|
376
397
|
this.flyoutMediaQueryService = flyoutMediaQueryService;
|
|
377
398
|
this.elementRef = elementRef;
|
|
378
399
|
this.uiConfigService = uiConfigService;
|
|
400
|
+
this._ngZone = _ngZone;
|
|
379
401
|
this.flyoutId = `sky-flyout-${++nextId}`;
|
|
380
402
|
this.flyoutState = FLYOUT_CLOSED_STATE;
|
|
381
403
|
this.isOpen = false;
|
|
382
404
|
this.isOpening = false;
|
|
383
405
|
this.flyoutWidth = 0;
|
|
406
|
+
this.instanceReady = false;
|
|
384
407
|
this.isDragging = false;
|
|
385
408
|
this.isFullscreen = false;
|
|
409
|
+
this.resizeKeyControlActive = false;
|
|
386
410
|
this.xCoord = 0;
|
|
387
411
|
this.windowBufferSize = 20;
|
|
388
412
|
/**
|
|
@@ -465,16 +489,16 @@ class SkyFlyoutComponent {
|
|
|
465
489
|
this.config.iteratorPreviousButtonDisabled =
|
|
466
490
|
this.config.iteratorPreviousButtonDisabled || false;
|
|
467
491
|
const factory = this.resolver.resolveComponentFactory(component);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
*/
|
|
473
|
-
const providers = ReflectiveInjector.resolve(this.config.providers);
|
|
474
|
-
const injector = ReflectiveInjector.fromResolvedProviders(providers, this.injector);
|
|
475
|
-
/* tslint:enable:deprecation */
|
|
492
|
+
const injector = Injector.create({
|
|
493
|
+
parent: this.injector,
|
|
494
|
+
providers: this.config.providers,
|
|
495
|
+
});
|
|
476
496
|
const componentRef = this.target.createComponent(factory, undefined, injector);
|
|
477
497
|
this.flyoutInstance = this.createFlyoutInstance(componentRef.instance);
|
|
498
|
+
// This is used to ensure we do not render the flyout until we have attached the component.
|
|
499
|
+
// This allows the aria-labelledby to function correctly.
|
|
500
|
+
this.instanceReady = true;
|
|
501
|
+
this.changeDetector.markForCheck();
|
|
478
502
|
// Open the flyout immediately.
|
|
479
503
|
this.messageStream.next({
|
|
480
504
|
type: SkyFlyoutMessageType.Open,
|
|
@@ -513,7 +537,9 @@ class SkyFlyoutComponent {
|
|
|
513
537
|
return false;
|
|
514
538
|
}
|
|
515
539
|
getAnimationState() {
|
|
516
|
-
return this.
|
|
540
|
+
return this.instanceReady && this.isOpening
|
|
541
|
+
? FLYOUT_OPEN_STATE
|
|
542
|
+
: FLYOUT_CLOSED_STATE;
|
|
517
543
|
}
|
|
518
544
|
animationDone(event) {
|
|
519
545
|
if (event.toState === FLYOUT_OPEN_STATE) {
|
|
@@ -529,27 +555,10 @@ class SkyFlyoutComponent {
|
|
|
529
555
|
this.onResizeHandleMouseDown(event);
|
|
530
556
|
}
|
|
531
557
|
onHeaderGrabHandleKeyDown(event) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
case 'left':
|
|
537
|
-
/* istanbul ignore else */
|
|
538
|
-
if (this.flyoutWidth < this.config.maxWidth) {
|
|
539
|
-
this.flyoutWidth = Math.min(this.flyoutWidth + this.widthStep, this.config.maxWidth);
|
|
540
|
-
}
|
|
541
|
-
break;
|
|
542
|
-
case 'right':
|
|
543
|
-
/* istanbul ignore else */
|
|
544
|
-
if (this.flyoutWidth > this.config.minWidth) {
|
|
545
|
-
this.flyoutWidth = Math.max(this.flyoutWidth - this.widthStep, this.config.minWidth);
|
|
546
|
-
}
|
|
547
|
-
break;
|
|
548
|
-
/* istanbul ignore next */
|
|
549
|
-
default:
|
|
550
|
-
break;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
558
|
+
this.handleResizeKeyDown(event);
|
|
559
|
+
}
|
|
560
|
+
onResizeHandleKeyDown(event) {
|
|
561
|
+
this.handleResizeKeyDown(event);
|
|
553
562
|
}
|
|
554
563
|
onResizeHandleMouseDown(event) {
|
|
555
564
|
event.preventDefault();
|
|
@@ -624,6 +633,7 @@ class SkyFlyoutComponent {
|
|
|
624
633
|
return instance;
|
|
625
634
|
}
|
|
626
635
|
handleIncomingMessages(message) {
|
|
636
|
+
var _a;
|
|
627
637
|
/* tslint:disable-next-line:switch-default */
|
|
628
638
|
switch (message.type) {
|
|
629
639
|
case SkyFlyoutMessageType.Open:
|
|
@@ -631,10 +641,21 @@ class SkyFlyoutComponent {
|
|
|
631
641
|
this.isOpen = false;
|
|
632
642
|
this.isOpening = true;
|
|
633
643
|
}
|
|
644
|
+
this.initFocusTrap();
|
|
634
645
|
break;
|
|
635
646
|
case SkyFlyoutMessageType.Close:
|
|
636
|
-
this.
|
|
637
|
-
|
|
647
|
+
if (this.flyoutInstance.beforeClose.observers.length ===
|
|
648
|
+
0 ||
|
|
649
|
+
((_a = message.data) === null || _a === void 0 ? void 0 : _a.ignoreBeforeClose)) {
|
|
650
|
+
this.isOpen = true;
|
|
651
|
+
this.isOpening = false;
|
|
652
|
+
}
|
|
653
|
+
else {
|
|
654
|
+
this.flyoutInstance.beforeClose.next(new SkyFlyoutBeforeCloseHandler(() => {
|
|
655
|
+
this.isOpen = true;
|
|
656
|
+
this.isOpening = false;
|
|
657
|
+
}));
|
|
658
|
+
}
|
|
638
659
|
break;
|
|
639
660
|
case SkyFlyoutMessageType.EnableIteratorNextButton:
|
|
640
661
|
this.config.iteratorNextButtonDisabled = false;
|
|
@@ -711,13 +732,67 @@ class SkyFlyoutComponent {
|
|
|
711
732
|
// TODO: Need to implement the async `getString` method in a breaking change.
|
|
712
733
|
return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);
|
|
713
734
|
}
|
|
735
|
+
handleResizeKeyDown(event) {
|
|
736
|
+
/* istanbul ignore else */
|
|
737
|
+
if (event.key) {
|
|
738
|
+
const keyPressed = event.key.toLowerCase().replace('arrow', '');
|
|
739
|
+
switch (keyPressed) {
|
|
740
|
+
case 'enter':
|
|
741
|
+
case ' ':
|
|
742
|
+
this.resizeKeyControlActive = !this.resizeKeyControlActive;
|
|
743
|
+
break;
|
|
744
|
+
case 'tab':
|
|
745
|
+
/* istanbul ignore else */
|
|
746
|
+
if (this.resizeKeyControlActive) {
|
|
747
|
+
this.resizeKeyControlActive = false;
|
|
748
|
+
}
|
|
749
|
+
case 'left':
|
|
750
|
+
if (this.resizeKeyControlActive) {
|
|
751
|
+
/* istanbul ignore else */
|
|
752
|
+
if (this.flyoutWidth < this.config.maxWidth) {
|
|
753
|
+
this.flyoutWidth = Math.min(this.flyoutWidth + this.widthStep, this.config.maxWidth);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
break;
|
|
757
|
+
case 'right':
|
|
758
|
+
if (this.resizeKeyControlActive) {
|
|
759
|
+
/* istanbul ignore else */
|
|
760
|
+
if (this.flyoutWidth > this.config.minWidth) {
|
|
761
|
+
this.flyoutWidth = Math.max(this.flyoutWidth - this.widthStep, this.config.minWidth);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
break;
|
|
765
|
+
/* istanbul ignore next */
|
|
766
|
+
default:
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
/** Executes a function when the zone is stable. */
|
|
772
|
+
_executeOnStable(fn) {
|
|
773
|
+
if (this._ngZone.isStable) {
|
|
774
|
+
fn();
|
|
775
|
+
}
|
|
776
|
+
else {
|
|
777
|
+
this._ngZone.onStable.pipe(take(1)).subscribe(fn);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
initFocusTrap() {
|
|
781
|
+
this.enableTrapFocusAutoCapture = false;
|
|
782
|
+
this.enableTrapFocus = false;
|
|
783
|
+
// Waiting for zone to be stable will avoid ExpressionChangeAfterCheckedError.
|
|
784
|
+
this._executeOnStable(() => {
|
|
785
|
+
this.enableTrapFocusAutoCapture = true;
|
|
786
|
+
this.enableTrapFocus = true;
|
|
787
|
+
});
|
|
788
|
+
}
|
|
714
789
|
}
|
|
715
|
-
SkyFlyoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
716
|
-
SkyFlyoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
790
|
+
SkyFlyoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", 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.SkyUIConfigService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
791
|
+
SkyFlyoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFlyoutComponent, selector: "sky-flyout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [
|
|
717
792
|
SkyFlyoutAdapterService,
|
|
718
793
|
SkyFlyoutMediaQueryService,
|
|
719
794
|
{ provide: SkyMediaQueryService, useExisting: SkyFlyoutMediaQueryService },
|
|
720
|
-
], 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\"\n [attr.aria-describedby]=\"config?.ariaDescribedBy\"\n [attr.aria-labelledby]=\"config?.ariaLabelledBy\"\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
|
|
795
|
+
], 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: "flyoutCloseButton", first: true, predicate: ["flyoutCloseButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "flyoutContent", first: true, predicate: ["flyoutContent"], descendants: true, read: ElementRef, 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 [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$1.λ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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i9.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i2.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10.λ1, selector: "[skyHref]", inputs: ["skyHref", "skyHrefElse"] }, { type: i2$2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "skyLibResources": i2$1.SkyLibResourcesPipe }, animations: [
|
|
721
796
|
trigger('flyoutState', [
|
|
722
797
|
state(FLYOUT_OPEN_STATE, style({ transform: 'initial' })),
|
|
723
798
|
state(FLYOUT_CLOSED_STATE, style({ transform: 'translateX(100%)' })),
|
|
@@ -728,7 +803,7 @@ SkyFlyoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
728
803
|
transition(`* <=> *`, animate('250ms ease-in')),
|
|
729
804
|
]),
|
|
730
805
|
], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
731
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutComponent, decorators: [{
|
|
732
807
|
type: Component,
|
|
733
808
|
args: [{
|
|
734
809
|
selector: 'sky-flyout',
|
|
@@ -753,7 +828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
753
828
|
// Allow automatic change detection for child components.
|
|
754
829
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
755
830
|
}]
|
|
756
|
-
}], 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.SkyUIConfigService }]; }, propDecorators: { flyoutRef: [{
|
|
831
|
+
}], 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.SkyUIConfigService }, { type: i0.NgZone }]; }, propDecorators: { flyoutRef: [{
|
|
757
832
|
type: ViewChild,
|
|
758
833
|
args: ['flyoutRef', {
|
|
759
834
|
read: ElementRef,
|
|
@@ -765,6 +840,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
765
840
|
read: ViewContainerRef,
|
|
766
841
|
static: true,
|
|
767
842
|
}]
|
|
843
|
+
}], flyoutCloseButton: [{
|
|
844
|
+
type: ViewChild,
|
|
845
|
+
args: ['flyoutCloseButton', {
|
|
846
|
+
read: ElementRef,
|
|
847
|
+
static: true,
|
|
848
|
+
}]
|
|
849
|
+
}], flyoutContent: [{
|
|
850
|
+
type: ViewChild,
|
|
851
|
+
args: ['flyoutContent', {
|
|
852
|
+
read: ElementRef,
|
|
853
|
+
static: true,
|
|
854
|
+
}]
|
|
768
855
|
}], flyoutHeader: [{
|
|
769
856
|
type: ViewChild,
|
|
770
857
|
args: ['flyoutHeader', {
|
|
@@ -778,8 +865,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
778
865
|
|
|
779
866
|
class SkyFlyoutModule {
|
|
780
867
|
}
|
|
781
|
-
SkyFlyoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
782
|
-
SkyFlyoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
868
|
+
SkyFlyoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
869
|
+
SkyFlyoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutModule, declarations: [SkyFlyoutComponent, SkyFlyoutIteratorComponent], imports: [A11yModule,
|
|
870
|
+
CommonModule,
|
|
783
871
|
FormsModule,
|
|
784
872
|
RouterModule,
|
|
785
873
|
SkyI18nModule,
|
|
@@ -787,7 +875,8 @@ SkyFlyoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
787
875
|
SkyFlyoutResourcesModule,
|
|
788
876
|
SkyThemeModule,
|
|
789
877
|
SkyHrefModule], exports: [SkyFlyoutComponent] });
|
|
790
|
-
SkyFlyoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
878
|
+
SkyFlyoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutModule, imports: [[
|
|
879
|
+
A11yModule,
|
|
791
880
|
CommonModule,
|
|
792
881
|
FormsModule,
|
|
793
882
|
RouterModule,
|
|
@@ -797,11 +886,12 @@ SkyFlyoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
797
886
|
SkyThemeModule,
|
|
798
887
|
SkyHrefModule,
|
|
799
888
|
]] });
|
|
800
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
889
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutModule, decorators: [{
|
|
801
890
|
type: NgModule,
|
|
802
891
|
args: [{
|
|
803
892
|
declarations: [SkyFlyoutComponent, SkyFlyoutIteratorComponent],
|
|
804
893
|
imports: [
|
|
894
|
+
A11yModule,
|
|
805
895
|
CommonModule,
|
|
806
896
|
FormsModule,
|
|
807
897
|
RouterModule,
|
|
@@ -822,11 +912,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
822
912
|
* document's `body` element. The `SkyFlyoutInstance` class watches for and triggers flyout events.
|
|
823
913
|
*/
|
|
824
914
|
class SkyFlyoutService {
|
|
825
|
-
constructor(coreAdapter, windowRef, dynamicComponentService, router) {
|
|
915
|
+
constructor(coreAdapter, windowRef, dynamicComponentService, router, _ngZone, applicationRef) {
|
|
826
916
|
this.coreAdapter = coreAdapter;
|
|
827
917
|
this.windowRef = windowRef;
|
|
828
918
|
this.dynamicComponentService = dynamicComponentService;
|
|
829
919
|
this.router = router;
|
|
920
|
+
this._ngZone = _ngZone;
|
|
921
|
+
this.applicationRef = applicationRef;
|
|
830
922
|
this.removeAfterClosed = false;
|
|
831
923
|
this.isOpening = false;
|
|
832
924
|
this.ngUnsubscribe = new Subject();
|
|
@@ -839,21 +931,22 @@ class SkyFlyoutService {
|
|
|
839
931
|
}
|
|
840
932
|
/**
|
|
841
933
|
* Closes the flyout. This method also removes the flyout's HTML elements from the DOM.
|
|
934
|
+
* @param args Arguments used when closing the flyout.
|
|
842
935
|
*/
|
|
843
|
-
close() {
|
|
936
|
+
close(args) {
|
|
844
937
|
if (this.host && !this.isOpening) {
|
|
845
938
|
this.removeAfterClosed = true;
|
|
846
939
|
this.host.instance.messageStream.next({
|
|
847
940
|
type: SkyFlyoutMessageType.Close,
|
|
941
|
+
data: {
|
|
942
|
+
ignoreBeforeClose: args ? args.ignoreBeforeClose : false,
|
|
943
|
+
},
|
|
848
944
|
});
|
|
849
945
|
}
|
|
850
946
|
}
|
|
851
947
|
/**
|
|
852
948
|
* Opens a flyout and displays the specified component.
|
|
853
|
-
* @param component Specifies the component to render.
|
|
854
|
-
* with HTML selectors, you must register it with the `entryComponents` property in the
|
|
855
|
-
* `app-extras.module.ts` file. For more information, see the
|
|
856
|
-
* [entry components tutorial](https://developer.blackbaud.com/skyux/learn/get-started/advanced/entry-components).
|
|
949
|
+
* @param component Specifies the component to render.
|
|
857
950
|
* @param config Specifies the flyout configuration passed to the specified component's constructor.
|
|
858
951
|
*/
|
|
859
952
|
open(component, config) {
|
|
@@ -869,6 +962,14 @@ class SkyFlyoutService {
|
|
|
869
962
|
.subscribe((event) => {
|
|
870
963
|
if (event instanceof NavigationStart) {
|
|
871
964
|
this.close();
|
|
965
|
+
// Sanity check - if the host still exists after animations should have completed - remove host
|
|
966
|
+
this._ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
967
|
+
if (this.host) {
|
|
968
|
+
this.removeHostComponent();
|
|
969
|
+
// Without this tick - the host does not actually get removed on initial navigation in this case.
|
|
970
|
+
this.applicationRef.tick();
|
|
971
|
+
}
|
|
972
|
+
});
|
|
872
973
|
}
|
|
873
974
|
});
|
|
874
975
|
}
|
|
@@ -932,7 +1033,7 @@ class SkyFlyoutService {
|
|
|
932
1033
|
});
|
|
933
1034
|
this.removeAfterClosed = false;
|
|
934
1035
|
flyoutInstance.messageStream
|
|
935
|
-
.pipe(
|
|
1036
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
936
1037
|
.subscribe((message) => {
|
|
937
1038
|
if (message.type === SkyFlyoutMessageType.Close) {
|
|
938
1039
|
this.removeAfterClosed = true;
|
|
@@ -953,18 +1054,18 @@ class SkyFlyoutService {
|
|
|
953
1054
|
this.ngUnsubscribe = new Subject();
|
|
954
1055
|
}
|
|
955
1056
|
}
|
|
956
|
-
SkyFlyoutService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
957
|
-
SkyFlyoutService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
958
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
1057
|
+
SkyFlyoutService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutService, deps: [{ token: i1.SkyCoreAdapterService }, { token: i1.SkyAppWindowRef }, { token: i1.SkyDynamicComponentService }, { token: i2$2.Router }, { token: i0.NgZone }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1058
|
+
SkyFlyoutService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutService, providedIn: 'any' });
|
|
1059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFlyoutService, decorators: [{
|
|
959
1060
|
type: Injectable,
|
|
960
1061
|
args: [{
|
|
961
1062
|
providedIn: 'any',
|
|
962
1063
|
}]
|
|
963
|
-
}], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }, { type: i1.SkyAppWindowRef }, { type: i1.SkyDynamicComponentService }, { type: i2$2.Router }]; } });
|
|
1064
|
+
}], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }, { type: i1.SkyAppWindowRef }, { type: i1.SkyDynamicComponentService }, { type: i2$2.Router }, { type: i0.NgZone }, { type: i0.ApplicationRef }]; } });
|
|
964
1065
|
|
|
965
1066
|
/**
|
|
966
1067
|
* Generated bundle index. Do not edit.
|
|
967
1068
|
*/
|
|
968
1069
|
|
|
969
|
-
export { SkyFlyoutInstance, SkyFlyoutMessageType, SkyFlyoutModule, SkyFlyoutService, SkyFlyoutComponent as λ1 };
|
|
1070
|
+
export { SkyFlyoutBeforeCloseHandler, SkyFlyoutInstance, SkyFlyoutMessageType, SkyFlyoutModule, SkyFlyoutService, SkyFlyoutComponent as λ1 };
|
|
970
1071
|
//# sourceMappingURL=skyux-flyout.js.map
|