@coreui/angular-pro 5.7.19 → 5.7.21
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.
|
@@ -10,7 +10,7 @@ import * as i1$2 from '@angular/cdk/a11y';
|
|
|
10
10
|
import { FocusKeyManager, FocusMonitor, A11yModule } from '@angular/cdk/a11y';
|
|
11
11
|
import { createPopper } from '@popperjs/core';
|
|
12
12
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
13
|
-
import { DomPortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
13
|
+
import { DomPortal, CdkPortalOutlet, DomPortalOutlet } from '@angular/cdk/portal';
|
|
14
14
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
15
15
|
import * as i1$1 from '@angular/router';
|
|
16
16
|
import { RouterModule, Router, ActivatedRoute, NavigationEnd, RouterLink } from '@angular/router';
|
|
@@ -13363,6 +13363,14 @@ class ModalComponent {
|
|
|
13363
13363
|
*/
|
|
13364
13364
|
backdrop = input(true, /* @ts-ignore */
|
|
13365
13365
|
...(ngDevMode ? [{ debugName: "backdrop" }] : /* istanbul ignore next */ []));
|
|
13366
|
+
/**
|
|
13367
|
+
* Appends the angular modal to a specific element. You can pass an HTML element or function that returns a single element. By default, `document.body`.
|
|
13368
|
+
* @since 5.7.20
|
|
13369
|
+
* @returns Element | (() => Element | null) | null
|
|
13370
|
+
* @default document.body
|
|
13371
|
+
*/
|
|
13372
|
+
container = input(this.#document.body, /* @ts-ignore */
|
|
13373
|
+
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
13366
13374
|
/**
|
|
13367
13375
|
* Set modal to cover the entire user viewport.
|
|
13368
13376
|
* @returns {boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'}
|
|
@@ -13377,13 +13385,20 @@ class ModalComponent {
|
|
|
13377
13385
|
*/
|
|
13378
13386
|
keyboard = input(true, { ...(ngDevMode ? { debugName: "keyboard" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13379
13387
|
/**
|
|
13380
|
-
*
|
|
13388
|
+
* HTML id attribute, required for programmatic visibility change.
|
|
13381
13389
|
* @returns string
|
|
13382
13390
|
*/
|
|
13383
13391
|
attrId = input(undefined, { ...(ngDevMode ? { debugName: "attrId" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
13384
13392
|
get id() {
|
|
13385
13393
|
return this.attrId();
|
|
13386
13394
|
}
|
|
13395
|
+
/**
|
|
13396
|
+
* Generates modal using a portal
|
|
13397
|
+
* @since 5.7.20
|
|
13398
|
+
* @returns boolean
|
|
13399
|
+
* @default false
|
|
13400
|
+
*/
|
|
13401
|
+
portal = input(false, { ...(ngDevMode ? { debugName: "portal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13387
13402
|
/**
|
|
13388
13403
|
* Size the component small, large, or extra large.
|
|
13389
13404
|
* @returns {'sm' | 'lg' | 'xl'}
|
|
@@ -13426,6 +13441,30 @@ class ModalComponent {
|
|
|
13426
13441
|
visibleInput = input(false, { ...(ngDevMode ? { debugName: "visibleInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'visible' });
|
|
13427
13442
|
visible = linkedSignal(this.visibleInput, /* @ts-ignore */
|
|
13428
13443
|
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
13444
|
+
domPortal = new DomPortal(this.#hostElement.nativeElement);
|
|
13445
|
+
domPortalOutlet;
|
|
13446
|
+
domPortalCleanup = () => {
|
|
13447
|
+
if (this.domPortalOutlet?.hasAttached()) {
|
|
13448
|
+
this.domPortalOutlet.detach();
|
|
13449
|
+
}
|
|
13450
|
+
};
|
|
13451
|
+
#portalEffect = effect(() => {
|
|
13452
|
+
const visible = this.visible();
|
|
13453
|
+
const containerInput = this.container();
|
|
13454
|
+
const portalEnabled = this.portal();
|
|
13455
|
+
untracked(() => {
|
|
13456
|
+
if (!visible) {
|
|
13457
|
+
return;
|
|
13458
|
+
}
|
|
13459
|
+
const container = typeof containerInput === 'function' ? containerInput() : containerInput;
|
|
13460
|
+
this.domPortalCleanup();
|
|
13461
|
+
if (container && portalEnabled) {
|
|
13462
|
+
this.domPortalOutlet = new DomPortalOutlet(container);
|
|
13463
|
+
this.domPortalOutlet.attach(this.domPortal);
|
|
13464
|
+
}
|
|
13465
|
+
});
|
|
13466
|
+
}, /* @ts-ignore */
|
|
13467
|
+
...(ngDevMode ? [{ debugName: "#portalEffect" }] : /* istanbul ignore next */ []));
|
|
13429
13468
|
#visibleInputEffect = effect(() => {
|
|
13430
13469
|
const visible = this.visible();
|
|
13431
13470
|
untracked(() => {
|
|
@@ -13470,9 +13509,6 @@ class ModalComponent {
|
|
|
13470
13509
|
* @returns boolean
|
|
13471
13510
|
*/
|
|
13472
13511
|
visibleChange = output();
|
|
13473
|
-
// @ViewChild(ModalContentComponent, { read: ElementRef }) modalContent!: ElementRef;
|
|
13474
|
-
// @ViewChild('modalContentRef', { read: ElementRef }) modalContentRef!: ElementRef;
|
|
13475
|
-
// readonly modalContentRef = viewChild(ModalContentComponent, { read: ElementRef });
|
|
13476
13512
|
modalContentRef = viewChild('modalContentRef', { ...(ngDevMode ? { debugName: "modalContentRef" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
13477
13513
|
modalDialogRef = viewChild.required(ModalDialogComponent, { ...(ngDevMode ? { debugName: "modalDialogRef" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
13478
13514
|
#modalDialogEffect = effect((OnCleanup) => {
|
|
@@ -13488,6 +13524,7 @@ class ModalComponent {
|
|
|
13488
13524
|
const modalDialogElement = this.modalDialogRef().nativeElement;
|
|
13489
13525
|
if (event.target === modalDialogElement && event.propertyName === 'transform') {
|
|
13490
13526
|
if (!this.visible()) {
|
|
13527
|
+
this.domPortalCleanup();
|
|
13491
13528
|
this.#renderer.setStyle(this.#hostElement.nativeElement, 'display', 'none');
|
|
13492
13529
|
}
|
|
13493
13530
|
}
|
|
@@ -13521,6 +13558,7 @@ class ModalComponent {
|
|
|
13521
13558
|
}
|
|
13522
13559
|
else {
|
|
13523
13560
|
if (!this.transition()) {
|
|
13561
|
+
this.domPortalCleanup();
|
|
13524
13562
|
this.#renderer.setStyle(this.#hostElement.nativeElement, 'display', 'none');
|
|
13525
13563
|
}
|
|
13526
13564
|
}
|
|
@@ -13568,6 +13606,7 @@ class ModalComponent {
|
|
|
13568
13606
|
this.#modalService.toggle({ show: false, modal: this });
|
|
13569
13607
|
this.#afterViewInit.set(false);
|
|
13570
13608
|
this.setBackdrop(false);
|
|
13609
|
+
this.domPortalCleanup();
|
|
13571
13610
|
}
|
|
13572
13611
|
stateToggleSubscribe() {
|
|
13573
13612
|
this.#modalService.modalState$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((action) => {
|
|
@@ -13609,7 +13648,7 @@ class ModalComponent {
|
|
|
13609
13648
|
}
|
|
13610
13649
|
}
|
|
13611
13650
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13612
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.3", type: ModalComponent, isStandalone: true, selector: "c-modal", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, attrId: { classPropertyName: "attrId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModalInput: { classPropertyName: "ariaModalInput", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "mousedown": "onMouseDownHandler($event)", "click": "onClickHandler($event)", "document:keydown": "onKeyDownHandler($event)" }, properties: { "class": "hostClasses()", "attr.role": "visible() ? role() : null", "attr.inert": "ariaHidden()", "attr.id": "id", "attr.aria-modal": "ariaModal()", "attr.aria-hidden": "ariaHidden()", "attr.tabindex": "-1" }, classAttribute: "modal" }, viewQueries: [{ propertyName: "modalContentRef", first: true, predicate: ["modalContentRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "modalDialogRef", first: true, predicate: ModalDialogComponent, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["cModal"], ngImport: i0, template: "@let isVisible = visible();\n<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div #modalContentRef [cdkTrapFocusAutoCapture]=\"isVisible\" [cdkTrapFocus]=\"isVisible\" style=\"display: contents;\">\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n", dependencies: [{ kind: "component", type: ModalDialogComponent, selector: "c-modal-dialog", inputs: ["alignment", "fullscreen", "scrollable", "size"] }, { kind: "component", type: ModalContentComponent, selector: "c-modal-content" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
13651
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.3", type: ModalComponent, isStandalone: true, selector: "c-modal", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, attrId: { classPropertyName: "attrId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, portal: { classPropertyName: "portal", publicName: "portal", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModalInput: { classPropertyName: "ariaModalInput", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "mousedown": "onMouseDownHandler($event)", "click": "onClickHandler($event)", "document:keydown": "onKeyDownHandler($event)" }, properties: { "class": "hostClasses()", "attr.role": "visible() ? role() : null", "attr.inert": "ariaHidden()", "attr.id": "id", "attr.aria-modal": "ariaModal()", "attr.aria-hidden": "ariaHidden()", "attr.tabindex": "-1" }, classAttribute: "modal" }, viewQueries: [{ propertyName: "modalContentRef", first: true, predicate: ["modalContentRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "modalDialogRef", first: true, predicate: ModalDialogComponent, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["cModal"], ngImport: i0, template: "@let isVisible = visible();\n<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div #modalContentRef [cdkTrapFocusAutoCapture]=\"isVisible\" [cdkTrapFocus]=\"isVisible\" style=\"display: contents;\">\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n", dependencies: [{ kind: "component", type: ModalDialogComponent, selector: "c-modal-dialog", inputs: ["alignment", "fullscreen", "scrollable", "size"] }, { kind: "component", type: ModalContentComponent, selector: "c-modal-content" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
13613
13652
|
}
|
|
13614
13653
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ModalComponent, decorators: [{
|
|
13615
13654
|
type: Component,
|
|
@@ -13626,7 +13665,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
13626
13665
|
'(click)': 'onClickHandler($event)',
|
|
13627
13666
|
'(document:keydown)': 'onKeyDownHandler($event)'
|
|
13628
13667
|
}, template: "@let isVisible = visible();\n<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div #modalContentRef [cdkTrapFocusAutoCapture]=\"isVisible\" [cdkTrapFocus]=\"isVisible\" style=\"display: contents;\">\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n" }]
|
|
13629
|
-
}], propDecorators: { alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], attrId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], transition: [{ type: i0.Input, args: [{ isSignal: true, alias: "transition", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaModalInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaModal", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], modalContentRef: [{ type: i0.ViewChild, args: ['modalContentRef', { ...{ read: ElementRef }, isSignal: true }] }], modalDialogRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ModalDialogComponent), { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
13668
|
+
}], propDecorators: { alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], attrId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], portal: [{ type: i0.Input, args: [{ isSignal: true, alias: "portal", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], transition: [{ type: i0.Input, args: [{ isSignal: true, alias: "transition", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaModalInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaModal", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], modalContentRef: [{ type: i0.ViewChild, args: ['modalContentRef', { ...{ read: ElementRef }, isSignal: true }] }], modalDialogRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ModalDialogComponent), { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
13630
13669
|
|
|
13631
13670
|
class ModalModule {
|
|
13632
13671
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -13712,6 +13751,14 @@ class OffcanvasComponent {
|
|
|
13712
13751
|
*/
|
|
13713
13752
|
backdrop = input(true, /* @ts-ignore */
|
|
13714
13753
|
...(ngDevMode ? [{ debugName: "backdrop" }] : /* istanbul ignore next */ []));
|
|
13754
|
+
/**
|
|
13755
|
+
* Appends the offcanvas to a specific element. You can pass an HTML element or function that returns a single element. By default, `document.body`.
|
|
13756
|
+
* @since 5.7.21
|
|
13757
|
+
* @returns Element | (() => Element | null) | null
|
|
13758
|
+
* @default document.body
|
|
13759
|
+
*/
|
|
13760
|
+
container = input(this.#document.body, /* @ts-ignore */
|
|
13761
|
+
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
13715
13762
|
/**
|
|
13716
13763
|
* Closes the offcanvas when the escape key is pressed
|
|
13717
13764
|
* @returns boolean
|
|
@@ -13725,6 +13772,13 @@ class OffcanvasComponent {
|
|
|
13725
13772
|
*/
|
|
13726
13773
|
placement = input('start', /* @ts-ignore */
|
|
13727
13774
|
...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
13775
|
+
/**
|
|
13776
|
+
* Generates offcanvas using a portal
|
|
13777
|
+
* @since 5.7.21
|
|
13778
|
+
* @returns boolean
|
|
13779
|
+
* @default false
|
|
13780
|
+
*/
|
|
13781
|
+
portal = input(false, { ...(ngDevMode ? { debugName: "portal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13728
13782
|
/**
|
|
13729
13783
|
* Responsive offcanvas property hides content outside the viewport from a specified breakpoint and down.
|
|
13730
13784
|
* @returns boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
@@ -13755,6 +13809,8 @@ class OffcanvasComponent {
|
|
|
13755
13809
|
#activeBackdrop;
|
|
13756
13810
|
#backdropClickSubscription;
|
|
13757
13811
|
#layoutChangeSubscription;
|
|
13812
|
+
#hideFallbackId;
|
|
13813
|
+
#isShown = false;
|
|
13758
13814
|
/**
|
|
13759
13815
|
* Allow body scrolling while offcanvas is visible.
|
|
13760
13816
|
* @returns boolean
|
|
@@ -13769,6 +13825,33 @@ class OffcanvasComponent {
|
|
|
13769
13825
|
visibleInput = input(false, { ...(ngDevMode ? { debugName: "visibleInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'visible' });
|
|
13770
13826
|
visible = linkedSignal({ ...(ngDevMode ? { debugName: "visible" } : /* istanbul ignore next */ {}), source: this.visibleInput,
|
|
13771
13827
|
computation: (value) => value });
|
|
13828
|
+
domPortal = new DomPortal(this.#hostElement.nativeElement);
|
|
13829
|
+
domPortalOutlet;
|
|
13830
|
+
domPortalCleanup = () => {
|
|
13831
|
+
if (this.domPortalOutlet?.hasAttached()) {
|
|
13832
|
+
this.domPortalOutlet.detach();
|
|
13833
|
+
}
|
|
13834
|
+
};
|
|
13835
|
+
#portalEffect = effect(() => {
|
|
13836
|
+
const visible = this.visible();
|
|
13837
|
+
const containerInput = this.container();
|
|
13838
|
+
const portalEnabled = this.portal();
|
|
13839
|
+
untracked(() => {
|
|
13840
|
+
if (!visible) {
|
|
13841
|
+
return;
|
|
13842
|
+
}
|
|
13843
|
+
const container = typeof containerInput === 'function' ? containerInput() : containerInput;
|
|
13844
|
+
this.domPortalCleanup();
|
|
13845
|
+
if (container && portalEnabled) {
|
|
13846
|
+
this.domPortalOutlet = new DomPortalOutlet(container);
|
|
13847
|
+
this.domPortalOutlet.attach(this.domPortal);
|
|
13848
|
+
// Re-inserting the host drops its computed style, so the show classes applied later in
|
|
13849
|
+
// this same cycle would have no starting point to animate from. Force a reflow to commit it.
|
|
13850
|
+
void this.#hostElement.nativeElement.offsetHeight;
|
|
13851
|
+
}
|
|
13852
|
+
});
|
|
13853
|
+
}, /* @ts-ignore */
|
|
13854
|
+
...(ngDevMode ? [{ debugName: "#portalEffect" }] : /* istanbul ignore next */ []));
|
|
13772
13855
|
visibleEffect = effect(() => {
|
|
13773
13856
|
const visible = this.visible();
|
|
13774
13857
|
this.animateStart(visible);
|
|
@@ -13825,6 +13908,9 @@ class OffcanvasComponent {
|
|
|
13825
13908
|
return breakpointValue ? `${parseFloat(breakpointValue.trim()) - 0.02}px` : false;
|
|
13826
13909
|
}
|
|
13827
13910
|
animateStart(visible = this.visible()) {
|
|
13911
|
+
const wasShown = this.#isShown;
|
|
13912
|
+
this.#isShown = visible;
|
|
13913
|
+
this.#clearHideFallback();
|
|
13828
13914
|
if (visible) {
|
|
13829
13915
|
if (!this.scroll()) {
|
|
13830
13916
|
this.#backdropService.hideScrollbar();
|
|
@@ -13835,6 +13921,9 @@ class OffcanvasComponent {
|
|
|
13835
13921
|
else {
|
|
13836
13922
|
this.#renderer.removeClass(this.#hostElement.nativeElement, 'showing');
|
|
13837
13923
|
this.#renderer.addClass(this.#hostElement.nativeElement, 'hiding');
|
|
13924
|
+
if (wasShown) {
|
|
13925
|
+
this.#scheduleHideFallback();
|
|
13926
|
+
}
|
|
13838
13927
|
}
|
|
13839
13928
|
}
|
|
13840
13929
|
onKeyDownHandler(event) {
|
|
@@ -13853,6 +13942,8 @@ class OffcanvasComponent {
|
|
|
13853
13942
|
ngOnDestroy() {
|
|
13854
13943
|
this.#offcanvasService.toggle({ show: false, id: this.id() });
|
|
13855
13944
|
this.#removeEventListeners();
|
|
13945
|
+
this.#clearHideFallback();
|
|
13946
|
+
this.domPortalCleanup();
|
|
13856
13947
|
}
|
|
13857
13948
|
#removeEventListeners = () => {
|
|
13858
13949
|
this.#hostElement.nativeElement.removeEventListener('transitionend', this.#handleTransitionEnd);
|
|
@@ -13864,12 +13955,30 @@ class OffcanvasComponent {
|
|
|
13864
13955
|
this.#renderer.removeClass(offcanvasElement, 'showing');
|
|
13865
13956
|
}
|
|
13866
13957
|
else {
|
|
13867
|
-
this.#
|
|
13868
|
-
this.#renderer.removeStyle(this.#document.body, 'overflow');
|
|
13869
|
-
this.#renderer.removeStyle(this.#document.body, 'paddingRight');
|
|
13958
|
+
this.#completeHide();
|
|
13870
13959
|
}
|
|
13871
13960
|
}
|
|
13872
13961
|
};
|
|
13962
|
+
#completeHide() {
|
|
13963
|
+
this.#clearHideFallback();
|
|
13964
|
+
this.#renderer.removeClass(this.#hostElement.nativeElement, 'hiding');
|
|
13965
|
+
this.#renderer.removeStyle(this.#document.body, 'overflow');
|
|
13966
|
+
this.#renderer.removeStyle(this.#document.body, 'paddingRight');
|
|
13967
|
+
this.domPortalCleanup();
|
|
13968
|
+
}
|
|
13969
|
+
// `transitionend` never fires when there is nothing to animate — reduced motion, or a responsive
|
|
13970
|
+
// offcanvas above its breakpoint — which would leave the body scroll-locked and the host parked
|
|
13971
|
+
// in the portal container.
|
|
13972
|
+
#scheduleHideFallback() {
|
|
13973
|
+
const style = this.#document.defaultView?.getComputedStyle(this.#hostElement.nativeElement);
|
|
13974
|
+
const duration = Number.parseFloat(style?.transitionDuration ?? '') || 0;
|
|
13975
|
+
const delay = Number.parseFloat(style?.transitionDelay ?? '') || 0;
|
|
13976
|
+
this.#hideFallbackId = setTimeout(() => this.#completeHide(), (duration + delay) * 1000 + 5);
|
|
13977
|
+
}
|
|
13978
|
+
#clearHideFallback() {
|
|
13979
|
+
clearTimeout(this.#hideFallbackId);
|
|
13980
|
+
this.#hideFallbackId = undefined;
|
|
13981
|
+
}
|
|
13873
13982
|
setFocus() {
|
|
13874
13983
|
if (isPlatformBrowser(this.#platformId)) {
|
|
13875
13984
|
setTimeout(() => this.#hostElement.nativeElement.focus());
|
|
@@ -13920,12 +14029,11 @@ class OffcanvasComponent {
|
|
|
13920
14029
|
}
|
|
13921
14030
|
}
|
|
13922
14031
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: OffcanvasComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13923
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: OffcanvasComponent, isStandalone: true, selector: "c-offcanvas", inputs: { backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModal: { classPropertyName: "ariaModal", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scroll: { classPropertyName: "scroll", publicName: "scroll", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: {
|
|
14032
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: OffcanvasComponent, isStandalone: true, selector: "c-offcanvas", inputs: { backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, portal: { classPropertyName: "portal", publicName: "portal", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModal: { classPropertyName: "ariaModal", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scroll: { classPropertyName: "scroll", publicName: "scroll", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "document:keydown": "onKeyDownHandler($event)" }, properties: { "attr.id": "id()", "attr.inert": "ariaHidden() || null", "attr.role": "role()", "attr.aria-modal": "ariaModal()", "attr.tabindex": "tabIndex", "class": "hostClasses()" } }, exportAs: ["cOffcanvas"], hostDirectives: [{ directive: ThemeDirective, inputs: ["dark", "dark"] }], ngImport: i0, template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content />\n</div>\n\n", styles: [":host{display:none}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
13924
14033
|
}
|
|
13925
14034
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: OffcanvasComponent, decorators: [{
|
|
13926
14035
|
type: Component,
|
|
13927
14036
|
args: [{ selector: 'c-offcanvas', exportAs: 'cOffcanvas', imports: [A11yModule], hostDirectives: [{ directive: ThemeDirective, inputs: ['dark'] }], host: {
|
|
13928
|
-
ngSkipHydration: 'true',
|
|
13929
14037
|
'[attr.id]': 'id()',
|
|
13930
14038
|
'[attr.inert]': 'ariaHidden() || null',
|
|
13931
14039
|
'[attr.role]': 'role()',
|
|
@@ -13934,7 +14042,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
13934
14042
|
'[class]': 'hostClasses()',
|
|
13935
14043
|
'(document:keydown)': 'onKeyDownHandler($event)'
|
|
13936
14044
|
}, template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content />\n</div>\n\n", styles: [":host{display:none}\n"] }]
|
|
13937
|
-
}], propDecorators: { backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaModal", required: false }] }], scroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "scroll", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
14045
|
+
}], propDecorators: { backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], portal: [{ type: i0.Input, args: [{ isSignal: true, alias: "portal", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaModal", required: false }] }], scroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "scroll", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
13938
14046
|
|
|
13939
14047
|
class OffcanvasBodyComponent {
|
|
13940
14048
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: OffcanvasBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|