@pecb-ui/components 1.1.9 → 1.1.10
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/fesm2022/pecb-ui-components.mjs +281 -141
- package/fesm2022/pecb-ui-components.mjs.map +1 -1
- package/index.d.ts +72 -43
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, input, output, HostBinding, Component, ChangeDetectionStrategy, model, computed, signal, HostListener, ContentChild, effect, forwardRef, ViewChild, viewChild, Directive, untracked, ElementRef, ApplicationRef, EnvironmentInjector, createComponent, contentChildren,
|
|
2
|
+
import { Injectable, inject, input, output, HostBinding, Component, ChangeDetectionStrategy, model, computed, signal, HostListener, ContentChild, effect, forwardRef, ViewChild, ViewContainerRef, viewChild, ViewEncapsulation, Directive, untracked, ElementRef, ApplicationRef, EnvironmentInjector, createComponent, contentChildren, PLATFORM_ID, Inject, ViewChildren, Renderer2, NgZone } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, NgOptimizedImage, isPlatformBrowser } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@angular/platform-browser';
|
|
@@ -8,7 +8,9 @@ import * as i2 from '@angular/cdk/overlay';
|
|
|
8
8
|
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
9
9
|
import * as i1$2 from '@angular/forms';
|
|
10
10
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
11
|
-
import {
|
|
11
|
+
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
12
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
13
|
+
import { Subscription, Subject, BehaviorSubject } from 'rxjs';
|
|
12
14
|
import { map } from 'rxjs/operators';
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -5591,41 +5593,32 @@ class RightModalComponent {
|
|
|
5591
5593
|
this.ariaDescribedBy = input(...(ngDevMode ? [undefined, { debugName: "ariaDescribedBy" }] : []));
|
|
5592
5594
|
this.closed = output();
|
|
5593
5595
|
this.opened = output();
|
|
5594
|
-
this.
|
|
5595
|
-
this.
|
|
5596
|
-
this
|
|
5596
|
+
this.overlay = inject(Overlay);
|
|
5597
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
5598
|
+
// The panel + projected slots live in this template so they can be attached
|
|
5599
|
+
// to a CDK overlay (rendered in the global overlay container on <body>),
|
|
5600
|
+
// which escapes any `transform`/`filter` containing-block trap on ancestors.
|
|
5601
|
+
this.modalTemplate = viewChild('modalTemplate', ...(ngDevMode ? [{ debugName: "modalTemplate" }] : []));
|
|
5602
|
+
this.overlayRef = null;
|
|
5603
|
+
this.portal = null;
|
|
5604
|
+
this.subscriptions = new Subscription();
|
|
5597
5605
|
this.previousActiveElement = null;
|
|
5598
|
-
|
|
5599
|
-
//
|
|
5600
|
-
//
|
|
5601
|
-
// correctly on every toggle — not just the initial mount.
|
|
5606
|
+
// Open/close the overlay reactively from the isOpen model. The template
|
|
5607
|
+
// signal is read so the effect re-runs once the @ViewChild resolves (e.g.
|
|
5608
|
+
// when a consumer renders the modal already open).
|
|
5602
5609
|
effect(() => {
|
|
5603
5610
|
const open = this.isOpen();
|
|
5604
|
-
const
|
|
5605
|
-
if (open) {
|
|
5606
|
-
|
|
5607
|
-
this.currentlyOpen = true;
|
|
5608
|
-
this.onOpen();
|
|
5609
|
-
}
|
|
5610
|
-
if (panel && !this.cleanupFocusTrap) {
|
|
5611
|
-
this.setupFocusTrap(panel.nativeElement);
|
|
5612
|
-
}
|
|
5611
|
+
const template = this.modalTemplate();
|
|
5612
|
+
if (open && template) {
|
|
5613
|
+
this.openOverlay(template);
|
|
5613
5614
|
}
|
|
5614
|
-
else if (
|
|
5615
|
-
this.
|
|
5616
|
-
this.cleanup();
|
|
5617
|
-
this.closed.emit();
|
|
5615
|
+
else if (!open) {
|
|
5616
|
+
this.closeOverlay();
|
|
5618
5617
|
}
|
|
5619
5618
|
});
|
|
5620
5619
|
}
|
|
5621
5620
|
ngOnDestroy() {
|
|
5622
|
-
this.
|
|
5623
|
-
}
|
|
5624
|
-
get modalClasses() {
|
|
5625
|
-
return [
|
|
5626
|
-
'pecb-right-modal',
|
|
5627
|
-
this.isOpen() ? 'pecb-right-modal--open' : ''
|
|
5628
|
-
].filter(Boolean);
|
|
5621
|
+
this.destroyOverlay();
|
|
5629
5622
|
}
|
|
5630
5623
|
get panelClasses() {
|
|
5631
5624
|
return [
|
|
@@ -5633,49 +5626,71 @@ class RightModalComponent {
|
|
|
5633
5626
|
`pecb-right-modal__panel--${this.size()}`
|
|
5634
5627
|
];
|
|
5635
5628
|
}
|
|
5636
|
-
onBackdropClick(event) {
|
|
5637
|
-
if (this.closeOnBackdropClick() && event.target === event.currentTarget) {
|
|
5638
|
-
this.close();
|
|
5639
|
-
}
|
|
5640
|
-
}
|
|
5641
|
-
onKeydown(event) {
|
|
5642
|
-
if (this.closeOnEscape() && event.key === 'Escape') {
|
|
5643
|
-
event.preventDefault();
|
|
5644
|
-
this.close();
|
|
5645
|
-
}
|
|
5646
|
-
}
|
|
5647
5629
|
close() {
|
|
5648
|
-
// The effect
|
|
5630
|
+
// The effect tears down the overlay and emits `closed` when isOpen flips.
|
|
5649
5631
|
this.isOpen.set(false);
|
|
5650
5632
|
}
|
|
5651
|
-
|
|
5633
|
+
openOverlay(template) {
|
|
5634
|
+
if (this.overlayRef) {
|
|
5635
|
+
return; // already open
|
|
5636
|
+
}
|
|
5652
5637
|
this.previousActiveElement = document.activeElement;
|
|
5653
|
-
this.
|
|
5638
|
+
this.overlayRef = this.overlay.create({
|
|
5639
|
+
hasBackdrop: true,
|
|
5640
|
+
backdropClass: 'pecb-right-modal__backdrop',
|
|
5641
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
5642
|
+
// Full-height drawer pinned to the right edge of the viewport.
|
|
5643
|
+
positionStrategy: this.overlay.position().global().top('0').right('0')
|
|
5644
|
+
});
|
|
5645
|
+
this.portal = new TemplatePortal(template, this.viewContainerRef);
|
|
5646
|
+
this.overlayRef.attach(this.portal);
|
|
5647
|
+
this.subscriptions = new Subscription();
|
|
5648
|
+
this.subscriptions.add(this.overlayRef.backdropClick().subscribe(() => {
|
|
5649
|
+
if (this.closeOnBackdropClick()) {
|
|
5650
|
+
this.close();
|
|
5651
|
+
}
|
|
5652
|
+
}));
|
|
5653
|
+
this.subscriptions.add(this.overlayRef.keydownEvents().subscribe((event) => {
|
|
5654
|
+
if (this.closeOnEscape() && event.key === 'Escape') {
|
|
5655
|
+
event.preventDefault();
|
|
5656
|
+
this.close();
|
|
5657
|
+
}
|
|
5658
|
+
}));
|
|
5659
|
+
// Focus the dialog panel itself (tabindex="-1") rather than the close
|
|
5660
|
+
// button, so opening the modal doesn't render a focus ring on the × icon.
|
|
5661
|
+
// cdkTrapFocus on the panel keeps Tab navigation contained within it.
|
|
5662
|
+
const panel = this.overlayRef.overlayElement.querySelector('.pecb-right-modal__panel');
|
|
5663
|
+
panel?.focus();
|
|
5654
5664
|
this.opened.emit();
|
|
5655
5665
|
}
|
|
5656
|
-
|
|
5657
|
-
this.
|
|
5658
|
-
|
|
5659
|
-
cleanup() {
|
|
5660
|
-
if (this.cleanupFocusTrap) {
|
|
5661
|
-
this.cleanupFocusTrap();
|
|
5662
|
-
this.cleanupFocusTrap = null;
|
|
5663
|
-
}
|
|
5664
|
-
if (this.cleanupBodyScroll) {
|
|
5665
|
-
this.cleanupBodyScroll();
|
|
5666
|
-
this.cleanupBodyScroll = null;
|
|
5666
|
+
closeOverlay() {
|
|
5667
|
+
if (!this.overlayRef) {
|
|
5668
|
+
return;
|
|
5667
5669
|
}
|
|
5670
|
+
this.destroyOverlay();
|
|
5668
5671
|
if (this.previousActiveElement instanceof HTMLElement) {
|
|
5669
5672
|
this.previousActiveElement.focus();
|
|
5670
5673
|
}
|
|
5674
|
+
this.closed.emit();
|
|
5675
|
+
}
|
|
5676
|
+
destroyOverlay() {
|
|
5677
|
+
this.subscriptions.unsubscribe();
|
|
5678
|
+
if (this.portal?.isAttached) {
|
|
5679
|
+
this.portal.detach();
|
|
5680
|
+
}
|
|
5681
|
+
this.portal = null;
|
|
5682
|
+
if (this.overlayRef) {
|
|
5683
|
+
this.overlayRef.dispose();
|
|
5684
|
+
this.overlayRef = null;
|
|
5685
|
+
}
|
|
5671
5686
|
}
|
|
5672
5687
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RightModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5673
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.16", type: RightModalComponent, isStandalone: true, selector: "pecb-right-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closed: "closed", opened: "opened" }, viewQueries: [{ propertyName: "
|
|
5688
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.16", type: RightModalComponent, isStandalone: true, selector: "pecb-right-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closed: "closed", opened: "opened" }, viewQueries: [{ propertyName: "modalTemplate", first: true, predicate: ["modalTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #modalTemplate>\n <div\n [id]=\"id()\"\n [class]=\"panelClasses.join(' ')\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n tabindex=\"-1\"\n cdkTrapFocus\n >\n <button\n *ngIf=\"showCloseButton()\"\n type=\"button\"\n class=\"pecb-right-modal__close-btn\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M18 6L6 18M6 6L18 18\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <ng-content select=\"[pecbRightModalHeader]\"></ng-content>\n <ng-content select=\"[pecbRightModalContent]\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"[pecbRightModalFooter]\"></ng-content>\n </div>\n</ng-template>\n", styles: [".pecb-right-modal__backdrop{background-color:#00000080}.pecb-right-modal__panel{position:relative;display:flex;width:516.23px;max-width:100vw;height:100vh;padding:24px;animation:slideInRight .25s ease-in-out forwards;flex-direction:column;align-items:stretch;gap:16px;border-radius:24px 0 0 24px;background:#fff;box-shadow:0 5px 16px -4px #10182826;overflow:hidden}.pecb-right-modal__panel:focus{outline:none}.pecb-right-modal__panel--sm{width:400px}.pecb-right-modal__panel--md{width:516.23px}.pecb-right-modal__panel--lg{width:700px}.pecb-right-modal__close-btn{padding:0;border:none;background:none;cursor:pointer;font:inherit;color:inherit;position:absolute;top:24px;right:24px;z-index:20;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:#616161;border-radius:6px;transition-property:color,background-color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-right-modal__close-btn:focus{outline:none}.pecb-right-modal__close-btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px}.pecb-right-modal__close-btn:hover{color:#313131;background-color:#ececec}.pecb-right-modal__close-btn svg{width:20px;height:20px}.pecb-right-modal__header{position:sticky;top:0;z-index:10;width:100%;padding-right:32px;background:#fff}.pecb-right-modal__content{flex:1;min-height:0;min-width:0;width:100%;display:flex;flex-direction:column;align-items:stretch;overflow:auto}.pecb-right-modal__content::-webkit-scrollbar{width:8px;height:8px}.pecb-right-modal__content::-webkit-scrollbar-track{background:#ececec}.pecb-right-modal__content::-webkit-scrollbar-thumb{background:#c2c2c2;border-radius:12px}.pecb-right-modal__content::-webkit-scrollbar-thumb:hover{background:#a9a9a9}.pecb-right-modal__footer{position:sticky;bottom:0;width:100%;margin-top:auto;background:#fff}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@media (prefers-reduced-motion: reduce){.pecb-right-modal__panel{animation:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5674
5689
|
}
|
|
5675
5690
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RightModalComponent, decorators: [{
|
|
5676
5691
|
type: Component,
|
|
5677
|
-
args: [{ selector: 'pecb-right-modal', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<
|
|
5678
|
-
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closeOnBackdropClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdropClick", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], opened: [{ type: i0.Output, args: ["opened"] }],
|
|
5692
|
+
args: [{ selector: 'pecb-right-modal', imports: [CommonModule, CdkTrapFocus], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template #modalTemplate>\n <div\n [id]=\"id()\"\n [class]=\"panelClasses.join(' ')\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n tabindex=\"-1\"\n cdkTrapFocus\n >\n <button\n *ngIf=\"showCloseButton()\"\n type=\"button\"\n class=\"pecb-right-modal__close-btn\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M18 6L6 18M6 6L18 18\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <ng-content select=\"[pecbRightModalHeader]\"></ng-content>\n <ng-content select=\"[pecbRightModalContent]\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"[pecbRightModalFooter]\"></ng-content>\n </div>\n</ng-template>\n", styles: [".pecb-right-modal__backdrop{background-color:#00000080}.pecb-right-modal__panel{position:relative;display:flex;width:516.23px;max-width:100vw;height:100vh;padding:24px;animation:slideInRight .25s ease-in-out forwards;flex-direction:column;align-items:stretch;gap:16px;border-radius:24px 0 0 24px;background:#fff;box-shadow:0 5px 16px -4px #10182826;overflow:hidden}.pecb-right-modal__panel:focus{outline:none}.pecb-right-modal__panel--sm{width:400px}.pecb-right-modal__panel--md{width:516.23px}.pecb-right-modal__panel--lg{width:700px}.pecb-right-modal__close-btn{padding:0;border:none;background:none;cursor:pointer;font:inherit;color:inherit;position:absolute;top:24px;right:24px;z-index:20;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:#616161;border-radius:6px;transition-property:color,background-color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-right-modal__close-btn:focus{outline:none}.pecb-right-modal__close-btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px}.pecb-right-modal__close-btn:hover{color:#313131;background-color:#ececec}.pecb-right-modal__close-btn svg{width:20px;height:20px}.pecb-right-modal__header{position:sticky;top:0;z-index:10;width:100%;padding-right:32px;background:#fff}.pecb-right-modal__content{flex:1;min-height:0;min-width:0;width:100%;display:flex;flex-direction:column;align-items:stretch;overflow:auto}.pecb-right-modal__content::-webkit-scrollbar{width:8px;height:8px}.pecb-right-modal__content::-webkit-scrollbar-track{background:#ececec}.pecb-right-modal__content::-webkit-scrollbar-thumb{background:#c2c2c2;border-radius:12px}.pecb-right-modal__content::-webkit-scrollbar-thumb:hover{background:#a9a9a9}.pecb-right-modal__footer{position:sticky;bottom:0;width:100%;margin-top:auto;background:#fff}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@media (prefers-reduced-motion: reduce){.pecb-right-modal__panel{animation:none}}\n"] }]
|
|
5693
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closeOnBackdropClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdropClick", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], opened: [{ type: i0.Output, args: ["opened"] }], modalTemplate: [{ type: i0.ViewChild, args: ['modalTemplate', { isSignal: true }] }] } });
|
|
5679
5694
|
class RightModalHeaderDirective {
|
|
5680
5695
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RightModalHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5681
5696
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: RightModalHeaderDirective, isStandalone: true, selector: "[pecbRightModalHeader]", host: { classAttribute: "pecb-right-modal__header" }, ngImport: i0 }); }
|
|
@@ -5845,31 +5860,29 @@ class ConfirmationComponent {
|
|
|
5845
5860
|
this.confirmed = output();
|
|
5846
5861
|
this.cancelled = output();
|
|
5847
5862
|
this.closed = output();
|
|
5848
|
-
this.
|
|
5849
|
-
this.
|
|
5863
|
+
this.overlay = inject(Overlay);
|
|
5864
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
5865
|
+
// The dialog panel lives in this template so it can be attached to a CDK
|
|
5866
|
+
// overlay (rendered in the global overlay container on <body>), which escapes
|
|
5867
|
+
// any `transform`/`filter` containing-block trap on an ancestor.
|
|
5868
|
+
this.dialogTemplate = viewChild('dialogTemplate', ...(ngDevMode ? [{ debugName: "dialogTemplate" }] : []));
|
|
5869
|
+
this.overlayRef = null;
|
|
5870
|
+
this.portal = null;
|
|
5871
|
+
this.subscriptions = new Subscription();
|
|
5850
5872
|
this.previousActiveElement = null;
|
|
5851
5873
|
effect(() => {
|
|
5852
|
-
|
|
5853
|
-
|
|
5874
|
+
const open = this.isOpen();
|
|
5875
|
+
const template = this.dialogTemplate();
|
|
5876
|
+
if (open && template) {
|
|
5877
|
+
this.openOverlay(template);
|
|
5854
5878
|
}
|
|
5855
|
-
else {
|
|
5856
|
-
this.
|
|
5879
|
+
else if (!open) {
|
|
5880
|
+
this.destroyOverlay();
|
|
5857
5881
|
}
|
|
5858
5882
|
});
|
|
5859
5883
|
}
|
|
5860
|
-
ngAfterViewInit() {
|
|
5861
|
-
if (this.isOpen()) {
|
|
5862
|
-
this.setupFocusTrap();
|
|
5863
|
-
}
|
|
5864
|
-
}
|
|
5865
5884
|
ngOnDestroy() {
|
|
5866
|
-
this.
|
|
5867
|
-
}
|
|
5868
|
-
get dialogClasses() {
|
|
5869
|
-
return [
|
|
5870
|
-
'pecb-confirmation',
|
|
5871
|
-
this.isOpen() ? 'pecb-confirmation--open' : ''
|
|
5872
|
-
].filter(Boolean);
|
|
5885
|
+
this.destroyOverlay();
|
|
5873
5886
|
}
|
|
5874
5887
|
get iconContainerClass() {
|
|
5875
5888
|
return `pecb-confirmation__icon pecb-confirmation__icon--${this.iconType()}`;
|
|
@@ -5880,17 +5893,6 @@ class ConfirmationComponent {
|
|
|
5880
5893
|
get messageId() {
|
|
5881
5894
|
return `${this.id()}-message`;
|
|
5882
5895
|
}
|
|
5883
|
-
onBackdropClick(event) {
|
|
5884
|
-
if (this.closeOnBackdropClick() && event.target === event.currentTarget) {
|
|
5885
|
-
this.close();
|
|
5886
|
-
}
|
|
5887
|
-
}
|
|
5888
|
-
onKeydown(event) {
|
|
5889
|
-
if (this.closeOnEscape() && event.key === 'Escape') {
|
|
5890
|
-
event.preventDefault();
|
|
5891
|
-
this.close();
|
|
5892
|
-
}
|
|
5893
|
-
}
|
|
5894
5896
|
onConfirm() {
|
|
5895
5897
|
this.confirmed.emit();
|
|
5896
5898
|
this.close();
|
|
@@ -5903,39 +5905,58 @@ class ConfirmationComponent {
|
|
|
5903
5905
|
this.isOpen.set(false);
|
|
5904
5906
|
this.closed.emit();
|
|
5905
5907
|
}
|
|
5906
|
-
|
|
5907
|
-
this.
|
|
5908
|
-
|
|
5909
|
-
this.setupFocusTrap();
|
|
5910
|
-
}
|
|
5911
|
-
setupFocusTrap() {
|
|
5912
|
-
if (this.dialogPanel?.nativeElement && !this.cleanupFocusTrap) {
|
|
5913
|
-
this.cleanupFocusTrap = trapFocus(this.dialogPanel.nativeElement);
|
|
5914
|
-
}
|
|
5915
|
-
}
|
|
5916
|
-
cleanup() {
|
|
5917
|
-
if (this.cleanupFocusTrap) {
|
|
5918
|
-
this.cleanupFocusTrap();
|
|
5919
|
-
this.cleanupFocusTrap = null;
|
|
5908
|
+
openOverlay(template) {
|
|
5909
|
+
if (this.overlayRef) {
|
|
5910
|
+
return; // already open
|
|
5920
5911
|
}
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5912
|
+
this.previousActiveElement = document.activeElement;
|
|
5913
|
+
this.overlayRef = this.overlay.create({
|
|
5914
|
+
hasBackdrop: true,
|
|
5915
|
+
backdropClass: 'pecb-confirmation__backdrop',
|
|
5916
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
5917
|
+
// Centered dialog.
|
|
5918
|
+
positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically()
|
|
5919
|
+
});
|
|
5920
|
+
this.portal = new TemplatePortal(template, this.viewContainerRef);
|
|
5921
|
+
this.overlayRef.attach(this.portal);
|
|
5922
|
+
this.subscriptions = new Subscription();
|
|
5923
|
+
this.subscriptions.add(this.overlayRef.backdropClick().subscribe(() => {
|
|
5924
|
+
if (this.closeOnBackdropClick()) {
|
|
5925
|
+
this.close();
|
|
5926
|
+
}
|
|
5927
|
+
}));
|
|
5928
|
+
this.subscriptions.add(this.overlayRef.keydownEvents().subscribe((event) => {
|
|
5929
|
+
if (this.closeOnEscape() && event.key === 'Escape') {
|
|
5930
|
+
event.preventDefault();
|
|
5931
|
+
this.close();
|
|
5932
|
+
}
|
|
5933
|
+
}));
|
|
5934
|
+
// Focus the dialog panel itself (tabindex="-1"); cdkTrapFocus keeps Tab
|
|
5935
|
+
// navigation contained within the dialog.
|
|
5936
|
+
const panel = this.overlayRef.overlayElement.querySelector('.pecb-confirmation__panel');
|
|
5937
|
+
panel?.focus();
|
|
5938
|
+
}
|
|
5939
|
+
destroyOverlay() {
|
|
5940
|
+
this.subscriptions.unsubscribe();
|
|
5941
|
+
if (this.portal?.isAttached) {
|
|
5942
|
+
this.portal.detach();
|
|
5924
5943
|
}
|
|
5925
|
-
|
|
5926
|
-
|
|
5944
|
+
this.portal = null;
|
|
5945
|
+
if (this.overlayRef) {
|
|
5946
|
+
this.overlayRef.dispose();
|
|
5947
|
+
this.overlayRef = null;
|
|
5948
|
+
if (this.previousActiveElement instanceof HTMLElement) {
|
|
5949
|
+
this.previousActiveElement.focus();
|
|
5950
|
+
}
|
|
5927
5951
|
}
|
|
5928
5952
|
}
|
|
5929
5953
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfirmationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5930
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ConfirmationComponent, isStandalone: true, selector: "pecb-confirmation", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, iconType: { classPropertyName: "iconType", publicName: "iconType", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", confirmed: "confirmed", cancelled: "cancelled", closed: "closed" }, viewQueries: [{ propertyName: "dialogPanel", first: true, predicate: ["dialogPanel"], descendants: true }], ngImport: i0, template: "@if (isOpen()) {\n <div\n [id]=\"id()\"\n [class]=\"dialogClasses.join(' ')\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"message() ? messageId : ariaDescribedBy() || null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n (click)=\"onBackdropClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div\n #dialogPanel\n class=\"pecb-confirmation__panel\"\n tabindex=\"-1\"\n >\n \n @if (showCloseButton()) {\n <div class=\"pecb-confirmation__header\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__close-btn\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M9 1L1 9M1 1L9 9\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n }\n\n \n <div [class]=\"iconContainerClass\" aria-hidden=\"true\">\n @switch (iconType()) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F4EA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M31.9991 9.84625C19.7635 9.84625 9.84521 19.7645 9.84521 32.0001C9.84521 44.2357 19.7635 54.1539 31.9991 54.1539C44.2347 54.1539 54.1529 44.2357 54.1529 32.0001C54.1426 19.7645 44.2244 9.84625 31.9991 9.84625ZM43.8227 26.3458L31.8137 41.3725C31.2781 42.0316 30.4954 42.4436 29.6508 42.4951C29.5993 42.4951 29.5375 42.4951 29.486 42.4951C28.693 42.4951 27.9308 42.1861 27.3747 41.6197L20.3917 34.6367C19.2279 33.4729 19.2279 31.5778 20.3917 30.414C21.5555 29.2502 23.4506 29.2502 24.6144 30.414L29.2285 35.0281L39.1571 22.6174C40.187 21.33 42.0615 21.1137 43.3592 22.1539C44.6466 23.1736 44.8526 25.0584 43.8227 26.3458Z\" fill=\"#57BC57\"/>\n </svg>\n }\n @case ('warning') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FFF4E5\"/>\n <circle cx=\"32.5303\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M32.0012 9.84668C44.2362 9.84668 54.1543 19.765 54.1545 32C54.1545 44.2352 44.2364 54.1543 32.0012 54.1543C19.766 54.1543 9.8479 44.2352 9.8479 32C9.84815 19.765 19.7662 9.84668 32.0012 9.84668ZM32.0823 40.2266C30.0029 40.2266 28.3108 41.9187 28.3108 43.998C28.5007 48.9935 35.6636 48.9922 35.8528 43.998C35.8528 41.9188 34.1615 40.2266 32.0823 40.2266ZM35.7727 18.9727C33.9014 16.6513 30.1067 16.6501 28.2346 18.9727C27.2974 20.0886 26.9044 21.5514 27.1555 22.9863C27.9048 27.2673 28.9622 33.3099 29.4368 36.0234C29.9687 38.8793 34.0404 38.8785 34.5715 36.0234L36.8528 22.9863C37.1039 21.5514 36.7101 20.0887 35.7727 18.9727Z\" fill=\"#FF9C4A\"/>\n </svg>\n }\n @case ('error') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FDECEA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M47.6652 16.3349C56.3168 24.9865 56.3168 39.0136 47.6652 47.6652C39.0136 56.3168 24.9865 56.3168 16.3349 47.6652C7.68329 39.0136 7.68329 24.9865 16.3349 16.3349C24.9865 7.68329 39.0136 7.68329 47.6652 16.3349ZM40.2677 22.862C39.3666 21.9609 37.9053 21.9609 37.0042 22.862L31.4561 28.4101C31.2759 28.5903 30.9836 28.5903 30.8034 28.4101L25.2553 22.862C24.3542 21.9609 22.8929 21.9609 21.9918 22.862C21.0906 23.7632 21.0906 25.2245 21.9918 26.1256L27.5398 31.6737C27.7201 31.8539 27.7201 32.1462 27.5398 32.3264L21.9918 37.8745C21.0906 38.7756 21.0906 40.2369 21.9918 41.138C22.8929 42.0392 24.3542 42.0392 25.2553 41.138L30.8034 35.59C30.9836 35.4097 31.2759 35.4097 31.4561 35.59L37.0042 41.138C37.9053 42.0392 39.3666 42.0392 40.2677 41.138C41.1689 40.2369 41.1689 38.7756 40.2677 37.8745L34.7197 32.3264C34.5394 32.1462 34.5394 31.8539 34.7197 31.6737L40.2677 26.1256C41.1689 25.2245 41.1689 23.7632 40.2677 22.862Z\" fill=\"#FF606F\"/>\n </svg>\n }\n @case ('info') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F0FA\"/>\n <circle cx=\"32.5283\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M31.9995 9.84668C44.2348 9.84668 54.1534 19.7653 54.1534 32.0005C54.1534 44.2358 44.2348 54.1544 31.9995 54.1544C19.7643 54.1544 9.8457 44.2358 9.8457 32.0005C9.8457 19.7653 19.7643 9.84668 31.9995 9.84668ZM28.3072 26.0943C26.8347 26.0945 25.8457 27.0832 25.8457 28.5558C25.8459 30.0282 26.8349 31.0171 28.3072 31.0174H31.758L28.3072 42.5835C28.0603 43.8088 28.3077 45.2811 29.0488 46.2698C29.7903 47.4952 31.0265 47.9896 32.252 47.9897H36.187C37.67 47.9896 38.6486 47.0112 38.6486 45.5282C38.6484 44.0558 37.6595 43.0668 36.187 43.0666H33.2303L36.681 31.5005C36.9281 30.2751 36.6808 28.8028 35.9395 27.8142C35.1979 26.5886 33.9619 26.0943 32.7363 26.0943H28.3072ZM33.4779 16.0005C31.4387 16.0006 29.7904 17.6488 29.7904 19.688C29.7906 21.7271 31.4388 23.3743 33.4779 23.3743C35.5171 23.3743 37.1652 21.7271 37.1654 19.688C37.1654 17.6488 35.5172 16.0005 33.4779 16.0005Z\" fill=\"#5EACFF\"/>\n </svg>\n }\n }\n </div>\n\n \n <div class=\"pecb-confirmation__content\">\n <h2 [id]=\"titleId\" class=\"pecb-confirmation__title\">{{ title() }}</h2>\n\n @if (message()) {\n <p [id]=\"messageId\" class=\"pecb-confirmation__message\">{{ message() }}</p>\n }\n </div>\n\n \n <div class=\"pecb-confirmation__actions\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--confirm\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText() }}\n </button>\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--cancel\"\n (click)=\"onCancel()\"\n >\n {{ cancelText() }}\n </button>\n </div>\n </div>\n </div>\n}\n", styles: [".pecb-confirmation{position:fixed;inset:0;z-index:1050;display:flex;align-items:center;justify-content:center;background-color:#00000080;animation:fadeIn .15s ease-in-out forwards}.pecb-confirmation__panel{display:flex;width:616px;max-width:calc(100vw - 32px);padding:22px 20px 30px;flex-direction:column;align-items:center;gap:27px;background:#fff;border-radius:12px;box-shadow:0 10px 10px #0000000d;animation:scaleIn .25s ease-in-out forwards;outline:none}.pecb-confirmation__header{display:flex;justify-content:flex-end;align-items:center;width:100%;height:20px}.pecb-confirmation__close-btn{padding:0;border:none;background:none;cursor:pointer;font:inherit;color:inherit;display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:#616161;border-radius:6px;outline:none;transition-property:color,background-color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__close-btn:focus{outline:none}.pecb-confirmation__close-btn:hover{color:#313131;background-color:#ececec}.pecb-confirmation__close-btn svg{width:10px;height:10px}.pecb-confirmation__icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:12px;flex-shrink:0}.pecb-confirmation__icon--success{background-color:transparent}.pecb-confirmation__icon--warning{background-color:#fff4e5}.pecb-confirmation__icon--error{background-color:#fdecea}.pecb-confirmation__icon--info{background-color:#e6f0fa}.pecb-confirmation__content{display:flex;flex-direction:column;align-items:center;gap:9px;padding:0 17px;width:100%}.pecb-confirmation__title{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:24px;font-weight:700;line-height:1.2;color:#313131;text-align:center}.pecb-confirmation__message{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:16px;font-weight:400;line-height:1.6;color:#616161;text-align:center}.pecb-confirmation__actions{display:flex;align-items:center;justify-content:center;gap:16px;width:100%}.pecb-confirmation__btn{border:none;background:none;font:inherit;color:inherit;display:inline-flex;align-items:center;justify-content:center;height:38px;padding:10px 40px;border-radius:6px;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;cursor:pointer;white-space:nowrap;transition-property:background-color,border-color,color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__btn:focus{outline:none}.pecb-confirmation__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px}.pecb-confirmation__btn--confirm{background-color:#212427;color:#fff;border:1px solid #212427}.pecb-confirmation__btn--confirm:hover{background-color:#616161;border-color:#616161}.pecb-confirmation__btn--confirm:active{background-color:#000;border-color:#000}.pecb-confirmation__btn--cancel{background-color:#fff;color:#212427;border:1px solid #c2c2c2}.pecb-confirmation__btn--cancel:hover{background-color:#ececec;border-color:#616161}.pecb-confirmation__btn--cancel:active{background-color:#c2c2c2;border-color:#616161}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion: reduce){.pecb-confirmation,.pecb-confirmation__panel{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5954
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ConfirmationComponent, isStandalone: true, selector: "pecb-confirmation", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, iconType: { classPropertyName: "iconType", publicName: "iconType", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", confirmed: "confirmed", cancelled: "cancelled", closed: "closed" }, viewQueries: [{ propertyName: "dialogTemplate", first: true, predicate: ["dialogTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #dialogTemplate>\n <div\n #dialogPanel\n [id]=\"id()\"\n class=\"pecb-confirmation__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"message() ? messageId : ariaDescribedBy() || null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n tabindex=\"-1\"\n cdkTrapFocus\n >\n @if (showCloseButton()) {\n <div class=\"pecb-confirmation__header\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__close-btn\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M9 1L1 9M1 1L9 9\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n }\n\n <div [class]=\"iconContainerClass\" aria-hidden=\"true\">\n @switch (iconType()) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F4EA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M31.9991 9.84625C19.7635 9.84625 9.84521 19.7645 9.84521 32.0001C9.84521 44.2357 19.7635 54.1539 31.9991 54.1539C44.2347 54.1539 54.1529 44.2357 54.1529 32.0001C54.1426 19.7645 44.2244 9.84625 31.9991 9.84625ZM43.8227 26.3458L31.8137 41.3725C31.2781 42.0316 30.4954 42.4436 29.6508 42.4951C29.5993 42.4951 29.5375 42.4951 29.486 42.4951C28.693 42.4951 27.9308 42.1861 27.3747 41.6197L20.3917 34.6367C19.2279 33.4729 19.2279 31.5778 20.3917 30.414C21.5555 29.2502 23.4506 29.2502 24.6144 30.414L29.2285 35.0281L39.1571 22.6174C40.187 21.33 42.0615 21.1137 43.3592 22.1539C44.6466 23.1736 44.8526 25.0584 43.8227 26.3458Z\" fill=\"#57BC57\"/>\n </svg>\n }\n @case ('warning') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FFF4E5\"/>\n <circle cx=\"32.5303\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M32.0012 9.84668C44.2362 9.84668 54.1543 19.765 54.1545 32C54.1545 44.2352 44.2364 54.1543 32.0012 54.1543C19.766 54.1543 9.8479 44.2352 9.8479 32C9.84815 19.765 19.7662 9.84668 32.0012 9.84668ZM32.0823 40.2266C30.0029 40.2266 28.3108 41.9187 28.3108 43.998C28.5007 48.9935 35.6636 48.9922 35.8528 43.998C35.8528 41.9188 34.1615 40.2266 32.0823 40.2266ZM35.7727 18.9727C33.9014 16.6513 30.1067 16.6501 28.2346 18.9727C27.2974 20.0886 26.9044 21.5514 27.1555 22.9863C27.9048 27.2673 28.9622 33.3099 29.4368 36.0234C29.9687 38.8793 34.0404 38.8785 34.5715 36.0234L36.8528 22.9863C37.1039 21.5514 36.7101 20.0887 35.7727 18.9727Z\" fill=\"#FF9C4A\"/>\n </svg>\n }\n @case ('error') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FDECEA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M47.6652 16.3349C56.3168 24.9865 56.3168 39.0136 47.6652 47.6652C39.0136 56.3168 24.9865 56.3168 16.3349 47.6652C7.68329 39.0136 7.68329 24.9865 16.3349 16.3349C24.9865 7.68329 39.0136 7.68329 47.6652 16.3349ZM40.2677 22.862C39.3666 21.9609 37.9053 21.9609 37.0042 22.862L31.4561 28.4101C31.2759 28.5903 30.9836 28.5903 30.8034 28.4101L25.2553 22.862C24.3542 21.9609 22.8929 21.9609 21.9918 22.862C21.0906 23.7632 21.0906 25.2245 21.9918 26.1256L27.5398 31.6737C27.7201 31.8539 27.7201 32.1462 27.5398 32.3264L21.9918 37.8745C21.0906 38.7756 21.0906 40.2369 21.9918 41.138C22.8929 42.0392 24.3542 42.0392 25.2553 41.138L30.8034 35.59C30.9836 35.4097 31.2759 35.4097 31.4561 35.59L37.0042 41.138C37.9053 42.0392 39.3666 42.0392 40.2677 41.138C41.1689 40.2369 41.1689 38.7756 40.2677 37.8745L34.7197 32.3264C34.5394 32.1462 34.5394 31.8539 34.7197 31.6737L40.2677 26.1256C41.1689 25.2245 41.1689 23.7632 40.2677 22.862Z\" fill=\"#FF606F\"/>\n </svg>\n }\n @case ('info') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F0FA\"/>\n <circle cx=\"32.5283\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M31.9995 9.84668C44.2348 9.84668 54.1534 19.7653 54.1534 32.0005C54.1534 44.2358 44.2348 54.1544 31.9995 54.1544C19.7643 54.1544 9.8457 44.2358 9.8457 32.0005C9.8457 19.7653 19.7643 9.84668 31.9995 9.84668ZM28.3072 26.0943C26.8347 26.0945 25.8457 27.0832 25.8457 28.5558C25.8459 30.0282 26.8349 31.0171 28.3072 31.0174H31.758L28.3072 42.5835C28.0603 43.8088 28.3077 45.2811 29.0488 46.2698C29.7903 47.4952 31.0265 47.9896 32.252 47.9897H36.187C37.67 47.9896 38.6486 47.0112 38.6486 45.5282C38.6484 44.0558 37.6595 43.0668 36.187 43.0666H33.2303L36.681 31.5005C36.9281 30.2751 36.6808 28.8028 35.9395 27.8142C35.1979 26.5886 33.9619 26.0943 32.7363 26.0943H28.3072ZM33.4779 16.0005C31.4387 16.0006 29.7904 17.6488 29.7904 19.688C29.7906 21.7271 31.4388 23.3743 33.4779 23.3743C35.5171 23.3743 37.1652 21.7271 37.1654 19.688C37.1654 17.6488 35.5172 16.0005 33.4779 16.0005Z\" fill=\"#5EACFF\"/>\n </svg>\n }\n }\n </div>\n\n <div class=\"pecb-confirmation__content\">\n <h2 [id]=\"titleId\" class=\"pecb-confirmation__title\">{{ title() }}</h2>\n\n @if (message()) {\n <p [id]=\"messageId\" class=\"pecb-confirmation__message\">{{ message() }}</p>\n }\n </div>\n\n <div class=\"pecb-confirmation__actions\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--confirm\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText() }}\n </button>\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--cancel\"\n (click)=\"onCancel()\"\n >\n {{ cancelText() }}\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [".pecb-confirmation__backdrop{background-color:#00000080}.pecb-confirmation__panel{display:flex;width:616px;max-width:calc(100vw - 32px);padding:22px 20px 30px;flex-direction:column;align-items:center;gap:27px;background:#fff;border-radius:12px;box-shadow:0 10px 10px #0000000d;animation:scaleIn .25s ease-in-out forwards;outline:none}.pecb-confirmation__header{display:flex;justify-content:flex-end;align-items:center;width:100%;height:20px}.pecb-confirmation__close-btn{padding:0;border:none;background:none;cursor:pointer;font:inherit;color:inherit;display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:#616161;border-radius:6px;outline:none;transition-property:color,background-color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__close-btn:focus{outline:none}.pecb-confirmation__close-btn:hover{color:#313131;background-color:#ececec}.pecb-confirmation__close-btn svg{width:10px;height:10px}.pecb-confirmation__icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:12px;flex-shrink:0}.pecb-confirmation__icon--success{background-color:transparent}.pecb-confirmation__icon--warning{background-color:#fff4e5}.pecb-confirmation__icon--error{background-color:#fdecea}.pecb-confirmation__icon--info{background-color:#e6f0fa}.pecb-confirmation__content{display:flex;flex-direction:column;align-items:center;gap:9px;padding:0 17px;width:100%}.pecb-confirmation__title{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:24px;font-weight:700;line-height:1.2;color:#313131;text-align:center}.pecb-confirmation__message{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:16px;font-weight:400;line-height:1.6;color:#616161;text-align:center}.pecb-confirmation__actions{display:flex;align-items:center;justify-content:center;gap:16px;width:100%}.pecb-confirmation__btn{border:none;background:none;font:inherit;color:inherit;display:inline-flex;align-items:center;justify-content:center;height:38px;padding:10px 40px;border-radius:6px;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;cursor:pointer;white-space:nowrap;transition-property:background-color,border-color,color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__btn:focus{outline:none}.pecb-confirmation__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px}.pecb-confirmation__btn--confirm{background-color:#212427;color:#fff;border:1px solid #212427}.pecb-confirmation__btn--confirm:hover{background-color:#616161;border-color:#616161}.pecb-confirmation__btn--confirm:active{background-color:#000;border-color:#000}.pecb-confirmation__btn--cancel{background-color:#fff;color:#212427;border:1px solid #c2c2c2}.pecb-confirmation__btn--cancel:hover{background-color:#ececec;border-color:#616161}.pecb-confirmation__btn--cancel:active{background-color:#c2c2c2;border-color:#616161}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion: reduce){.pecb-confirmation__panel{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5931
5955
|
}
|
|
5932
5956
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfirmationComponent, decorators: [{
|
|
5933
5957
|
type: Component,
|
|
5934
|
-
args: [{ selector: 'pecb-confirmation', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isOpen()) {\n <div\n [id]=\"id()\"\n [class]=\"dialogClasses.join(' ')\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"message() ? messageId : ariaDescribedBy() || null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n (click)=\"onBackdropClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div\n #dialogPanel\n class=\"pecb-confirmation__panel\"\n tabindex=\"-1\"\n >\n \n @if (showCloseButton()) {\n <div class=\"pecb-confirmation__header\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__close-btn\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M9 1L1 9M1 1L9 9\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n }\n\n \n <div [class]=\"iconContainerClass\" aria-hidden=\"true\">\n @switch (iconType()) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F4EA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M31.9991 9.84625C19.7635 9.84625 9.84521 19.7645 9.84521 32.0001C9.84521 44.2357 19.7635 54.1539 31.9991 54.1539C44.2347 54.1539 54.1529 44.2357 54.1529 32.0001C54.1426 19.7645 44.2244 9.84625 31.9991 9.84625ZM43.8227 26.3458L31.8137 41.3725C31.2781 42.0316 30.4954 42.4436 29.6508 42.4951C29.5993 42.4951 29.5375 42.4951 29.486 42.4951C28.693 42.4951 27.9308 42.1861 27.3747 41.6197L20.3917 34.6367C19.2279 33.4729 19.2279 31.5778 20.3917 30.414C21.5555 29.2502 23.4506 29.2502 24.6144 30.414L29.2285 35.0281L39.1571 22.6174C40.187 21.33 42.0615 21.1137 43.3592 22.1539C44.6466 23.1736 44.8526 25.0584 43.8227 26.3458Z\" fill=\"#57BC57\"/>\n </svg>\n }\n @case ('warning') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FFF4E5\"/>\n <circle cx=\"32.5303\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M32.0012 9.84668C44.2362 9.84668 54.1543 19.765 54.1545 32C54.1545 44.2352 44.2364 54.1543 32.0012 54.1543C19.766 54.1543 9.8479 44.2352 9.8479 32C9.84815 19.765 19.7662 9.84668 32.0012 9.84668ZM32.0823 40.2266C30.0029 40.2266 28.3108 41.9187 28.3108 43.998C28.5007 48.9935 35.6636 48.9922 35.8528 43.998C35.8528 41.9188 34.1615 40.2266 32.0823 40.2266ZM35.7727 18.9727C33.9014 16.6513 30.1067 16.6501 28.2346 18.9727C27.2974 20.0886 26.9044 21.5514 27.1555 22.9863C27.9048 27.2673 28.9622 33.3099 29.4368 36.0234C29.9687 38.8793 34.0404 38.8785 34.5715 36.0234L36.8528 22.9863C37.1039 21.5514 36.7101 20.0887 35.7727 18.9727Z\" fill=\"#FF9C4A\"/>\n </svg>\n }\n @case ('error') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FDECEA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M47.6652 16.3349C56.3168 24.9865 56.3168 39.0136 47.6652 47.6652C39.0136 56.3168 24.9865 56.3168 16.3349 47.6652C7.68329 39.0136 7.68329 24.9865 16.3349 16.3349C24.9865 7.68329 39.0136 7.68329 47.6652 16.3349ZM40.2677 22.862C39.3666 21.9609 37.9053 21.9609 37.0042 22.862L31.4561 28.4101C31.2759 28.5903 30.9836 28.5903 30.8034 28.4101L25.2553 22.862C24.3542 21.9609 22.8929 21.9609 21.9918 22.862C21.0906 23.7632 21.0906 25.2245 21.9918 26.1256L27.5398 31.6737C27.7201 31.8539 27.7201 32.1462 27.5398 32.3264L21.9918 37.8745C21.0906 38.7756 21.0906 40.2369 21.9918 41.138C22.8929 42.0392 24.3542 42.0392 25.2553 41.138L30.8034 35.59C30.9836 35.4097 31.2759 35.4097 31.4561 35.59L37.0042 41.138C37.9053 42.0392 39.3666 42.0392 40.2677 41.138C41.1689 40.2369 41.1689 38.7756 40.2677 37.8745L34.7197 32.3264C34.5394 32.1462 34.5394 31.8539 34.7197 31.6737L40.2677 26.1256C41.1689 25.2245 41.1689 23.7632 40.2677 22.862Z\" fill=\"#FF606F\"/>\n </svg>\n }\n @case ('info') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F0FA\"/>\n <circle cx=\"32.5283\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M31.9995 9.84668C44.2348 9.84668 54.1534 19.7653 54.1534 32.0005C54.1534 44.2358 44.2348 54.1544 31.9995 54.1544C19.7643 54.1544 9.8457 44.2358 9.8457 32.0005C9.8457 19.7653 19.7643 9.84668 31.9995 9.84668ZM28.3072 26.0943C26.8347 26.0945 25.8457 27.0832 25.8457 28.5558C25.8459 30.0282 26.8349 31.0171 28.3072 31.0174H31.758L28.3072 42.5835C28.0603 43.8088 28.3077 45.2811 29.0488 46.2698C29.7903 47.4952 31.0265 47.9896 32.252 47.9897H36.187C37.67 47.9896 38.6486 47.0112 38.6486 45.5282C38.6484 44.0558 37.6595 43.0668 36.187 43.0666H33.2303L36.681 31.5005C36.9281 30.2751 36.6808 28.8028 35.9395 27.8142C35.1979 26.5886 33.9619 26.0943 32.7363 26.0943H28.3072ZM33.4779 16.0005C31.4387 16.0006 29.7904 17.6488 29.7904 19.688C29.7906 21.7271 31.4388 23.3743 33.4779 23.3743C35.5171 23.3743 37.1652 21.7271 37.1654 19.688C37.1654 17.6488 35.5172 16.0005 33.4779 16.0005Z\" fill=\"#5EACFF\"/>\n </svg>\n }\n }\n </div>\n\n \n <div class=\"pecb-confirmation__content\">\n <h2 [id]=\"titleId\" class=\"pecb-confirmation__title\">{{ title() }}</h2>\n\n @if (message()) {\n <p [id]=\"messageId\" class=\"pecb-confirmation__message\">{{ message() }}</p>\n }\n </div>\n\n \n <div class=\"pecb-confirmation__actions\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--confirm\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText() }}\n </button>\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--cancel\"\n (click)=\"onCancel()\"\n >\n {{ cancelText() }}\n </button>\n </div>\n </div>\n </div>\n}\n", styles: [".pecb-confirmation{position:fixed;inset:0;z-index:1050;display:flex;align-items:center;justify-content:center;background-color:#00000080;animation:fadeIn .15s ease-in-out forwards}.pecb-confirmation__panel{display:flex;width:616px;max-width:calc(100vw - 32px);padding:22px 20px 30px;flex-direction:column;align-items:center;gap:27px;background:#fff;border-radius:12px;box-shadow:0 10px 10px #0000000d;animation:scaleIn .25s ease-in-out forwards;outline:none}.pecb-confirmation__header{display:flex;justify-content:flex-end;align-items:center;width:100%;height:20px}.pecb-confirmation__close-btn{padding:0;border:none;background:none;cursor:pointer;font:inherit;color:inherit;display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:#616161;border-radius:6px;outline:none;transition-property:color,background-color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__close-btn:focus{outline:none}.pecb-confirmation__close-btn:hover{color:#313131;background-color:#ececec}.pecb-confirmation__close-btn svg{width:10px;height:10px}.pecb-confirmation__icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:12px;flex-shrink:0}.pecb-confirmation__icon--success{background-color:transparent}.pecb-confirmation__icon--warning{background-color:#fff4e5}.pecb-confirmation__icon--error{background-color:#fdecea}.pecb-confirmation__icon--info{background-color:#e6f0fa}.pecb-confirmation__content{display:flex;flex-direction:column;align-items:center;gap:9px;padding:0 17px;width:100%}.pecb-confirmation__title{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:24px;font-weight:700;line-height:1.2;color:#313131;text-align:center}.pecb-confirmation__message{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:16px;font-weight:400;line-height:1.6;color:#616161;text-align:center}.pecb-confirmation__actions{display:flex;align-items:center;justify-content:center;gap:16px;width:100%}.pecb-confirmation__btn{border:none;background:none;font:inherit;color:inherit;display:inline-flex;align-items:center;justify-content:center;height:38px;padding:10px 40px;border-radius:6px;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;cursor:pointer;white-space:nowrap;transition-property:background-color,border-color,color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__btn:focus{outline:none}.pecb-confirmation__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px}.pecb-confirmation__btn--confirm{background-color:#212427;color:#fff;border:1px solid #212427}.pecb-confirmation__btn--confirm:hover{background-color:#616161;border-color:#616161}.pecb-confirmation__btn--confirm:active{background-color:#000;border-color:#000}.pecb-confirmation__btn--cancel{background-color:#fff;color:#212427;border:1px solid #c2c2c2}.pecb-confirmation__btn--cancel:hover{background-color:#ececec;border-color:#616161}.pecb-confirmation__btn--cancel:active{background-color:#c2c2c2;border-color:#616161}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion: reduce){.pecb-confirmation,.pecb-confirmation__panel{animation:none}}\n"] }]
|
|
5935
|
-
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], iconType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconType", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], closeOnBackdropClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdropClick", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }], closed: [{ type: i0.Output, args: ["closed"] }],
|
|
5936
|
-
type: ViewChild,
|
|
5937
|
-
args: ['dialogPanel']
|
|
5938
|
-
}] } });
|
|
5958
|
+
args: [{ selector: 'pecb-confirmation', imports: [CdkTrapFocus], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template #dialogTemplate>\n <div\n #dialogPanel\n [id]=\"id()\"\n class=\"pecb-confirmation__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"titleId\"\n [attr.aria-describedby]=\"message() ? messageId : ariaDescribedBy() || null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n tabindex=\"-1\"\n cdkTrapFocus\n >\n @if (showCloseButton()) {\n <div class=\"pecb-confirmation__header\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__close-btn\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M9 1L1 9M1 1L9 9\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n }\n\n <div [class]=\"iconContainerClass\" aria-hidden=\"true\">\n @switch (iconType()) {\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F4EA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M31.9991 9.84625C19.7635 9.84625 9.84521 19.7645 9.84521 32.0001C9.84521 44.2357 19.7635 54.1539 31.9991 54.1539C44.2347 54.1539 54.1529 44.2357 54.1529 32.0001C54.1426 19.7645 44.2244 9.84625 31.9991 9.84625ZM43.8227 26.3458L31.8137 41.3725C31.2781 42.0316 30.4954 42.4436 29.6508 42.4951C29.5993 42.4951 29.5375 42.4951 29.486 42.4951C28.693 42.4951 27.9308 42.1861 27.3747 41.6197L20.3917 34.6367C19.2279 33.4729 19.2279 31.5778 20.3917 30.414C21.5555 29.2502 23.4506 29.2502 24.6144 30.414L29.2285 35.0281L39.1571 22.6174C40.187 21.33 42.0615 21.1137 43.3592 22.1539C44.6466 23.1736 44.8526 25.0584 43.8227 26.3458Z\" fill=\"#57BC57\"/>\n </svg>\n }\n @case ('warning') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FFF4E5\"/>\n <circle cx=\"32.5303\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M32.0012 9.84668C44.2362 9.84668 54.1543 19.765 54.1545 32C54.1545 44.2352 44.2364 54.1543 32.0012 54.1543C19.766 54.1543 9.8479 44.2352 9.8479 32C9.84815 19.765 19.7662 9.84668 32.0012 9.84668ZM32.0823 40.2266C30.0029 40.2266 28.3108 41.9187 28.3108 43.998C28.5007 48.9935 35.6636 48.9922 35.8528 43.998C35.8528 41.9188 34.1615 40.2266 32.0823 40.2266ZM35.7727 18.9727C33.9014 16.6513 30.1067 16.6501 28.2346 18.9727C27.2974 20.0886 26.9044 21.5514 27.1555 22.9863C27.9048 27.2673 28.9622 33.3099 29.4368 36.0234C29.9687 38.8793 34.0404 38.8785 34.5715 36.0234L36.8528 22.9863C37.1039 21.5514 36.7101 20.0887 35.7727 18.9727Z\" fill=\"#FF9C4A\"/>\n </svg>\n }\n @case ('error') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#FDECEA\"/>\n <circle cx=\"31.8243\" cy=\"31.8243\" r=\"18.2857\" fill=\"white\"/>\n <path d=\"M47.6652 16.3349C56.3168 24.9865 56.3168 39.0136 47.6652 47.6652C39.0136 56.3168 24.9865 56.3168 16.3349 47.6652C7.68329 39.0136 7.68329 24.9865 16.3349 16.3349C24.9865 7.68329 39.0136 7.68329 47.6652 16.3349ZM40.2677 22.862C39.3666 21.9609 37.9053 21.9609 37.0042 22.862L31.4561 28.4101C31.2759 28.5903 30.9836 28.5903 30.8034 28.4101L25.2553 22.862C24.3542 21.9609 22.8929 21.9609 21.9918 22.862C21.0906 23.7632 21.0906 25.2245 21.9918 26.1256L27.5398 31.6737C27.7201 31.8539 27.7201 32.1462 27.5398 32.3264L21.9918 37.8745C21.0906 38.7756 21.0906 40.2369 21.9918 41.138C22.8929 42.0392 24.3542 42.0392 25.2553 41.138L30.8034 35.59C30.9836 35.4097 31.2759 35.4097 31.4561 35.59L37.0042 41.138C37.9053 42.0392 39.3666 42.0392 40.2677 41.138C41.1689 40.2369 41.1689 38.7756 40.2677 37.8745L34.7197 32.3264C34.5394 32.1462 34.5394 31.8539 34.7197 31.6737L40.2677 26.1256C41.1689 25.2245 41.1689 23.7632 40.2677 22.862Z\" fill=\"#FF606F\"/>\n </svg>\n }\n @case ('info') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12C0 5.37258 5.37258 0 12 0H52C58.6274 0 64 5.37258 64 12V52C64 58.6274 58.6274 64 52 64H12C5.37258 64 0 58.6274 0 52V12Z\" fill=\"#E6F0FA\"/>\n <circle cx=\"32.5283\" cy=\"32.5281\" r=\"18.989\" fill=\"white\"/>\n <path d=\"M31.9995 9.84668C44.2348 9.84668 54.1534 19.7653 54.1534 32.0005C54.1534 44.2358 44.2348 54.1544 31.9995 54.1544C19.7643 54.1544 9.8457 44.2358 9.8457 32.0005C9.8457 19.7653 19.7643 9.84668 31.9995 9.84668ZM28.3072 26.0943C26.8347 26.0945 25.8457 27.0832 25.8457 28.5558C25.8459 30.0282 26.8349 31.0171 28.3072 31.0174H31.758L28.3072 42.5835C28.0603 43.8088 28.3077 45.2811 29.0488 46.2698C29.7903 47.4952 31.0265 47.9896 32.252 47.9897H36.187C37.67 47.9896 38.6486 47.0112 38.6486 45.5282C38.6484 44.0558 37.6595 43.0668 36.187 43.0666H33.2303L36.681 31.5005C36.9281 30.2751 36.6808 28.8028 35.9395 27.8142C35.1979 26.5886 33.9619 26.0943 32.7363 26.0943H28.3072ZM33.4779 16.0005C31.4387 16.0006 29.7904 17.6488 29.7904 19.688C29.7906 21.7271 31.4388 23.3743 33.4779 23.3743C35.5171 23.3743 37.1652 21.7271 37.1654 19.688C37.1654 17.6488 35.5172 16.0005 33.4779 16.0005Z\" fill=\"#5EACFF\"/>\n </svg>\n }\n }\n </div>\n\n <div class=\"pecb-confirmation__content\">\n <h2 [id]=\"titleId\" class=\"pecb-confirmation__title\">{{ title() }}</h2>\n\n @if (message()) {\n <p [id]=\"messageId\" class=\"pecb-confirmation__message\">{{ message() }}</p>\n }\n </div>\n\n <div class=\"pecb-confirmation__actions\">\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--confirm\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText() }}\n </button>\n <button\n type=\"button\"\n class=\"pecb-confirmation__btn pecb-confirmation__btn--cancel\"\n (click)=\"onCancel()\"\n >\n {{ cancelText() }}\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [".pecb-confirmation__backdrop{background-color:#00000080}.pecb-confirmation__panel{display:flex;width:616px;max-width:calc(100vw - 32px);padding:22px 20px 30px;flex-direction:column;align-items:center;gap:27px;background:#fff;border-radius:12px;box-shadow:0 10px 10px #0000000d;animation:scaleIn .25s ease-in-out forwards;outline:none}.pecb-confirmation__header{display:flex;justify-content:flex-end;align-items:center;width:100%;height:20px}.pecb-confirmation__close-btn{padding:0;border:none;background:none;cursor:pointer;font:inherit;color:inherit;display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:#616161;border-radius:6px;outline:none;transition-property:color,background-color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__close-btn:focus{outline:none}.pecb-confirmation__close-btn:hover{color:#313131;background-color:#ececec}.pecb-confirmation__close-btn svg{width:10px;height:10px}.pecb-confirmation__icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:12px;flex-shrink:0}.pecb-confirmation__icon--success{background-color:transparent}.pecb-confirmation__icon--warning{background-color:#fff4e5}.pecb-confirmation__icon--error{background-color:#fdecea}.pecb-confirmation__icon--info{background-color:#e6f0fa}.pecb-confirmation__content{display:flex;flex-direction:column;align-items:center;gap:9px;padding:0 17px;width:100%}.pecb-confirmation__title{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:24px;font-weight:700;line-height:1.2;color:#313131;text-align:center}.pecb-confirmation__message{margin:0;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:16px;font-weight:400;line-height:1.6;color:#616161;text-align:center}.pecb-confirmation__actions{display:flex;align-items:center;justify-content:center;gap:16px;width:100%}.pecb-confirmation__btn{border:none;background:none;font:inherit;color:inherit;display:inline-flex;align-items:center;justify-content:center;height:38px;padding:10px 40px;border-radius:6px;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;cursor:pointer;white-space:nowrap;transition-property:background-color,border-color,color;transition-duration:.25s ease-in-out;transition-timing-function:ease-in-out}.pecb-confirmation__btn:focus{outline:none}.pecb-confirmation__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px}.pecb-confirmation__btn--confirm{background-color:#212427;color:#fff;border:1px solid #212427}.pecb-confirmation__btn--confirm:hover{background-color:#616161;border-color:#616161}.pecb-confirmation__btn--confirm:active{background-color:#000;border-color:#000}.pecb-confirmation__btn--cancel{background-color:#fff;color:#212427;border:1px solid #c2c2c2}.pecb-confirmation__btn--cancel:hover{background-color:#ececec;border-color:#616161}.pecb-confirmation__btn--cancel:active{background-color:#c2c2c2;border-color:#616161}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion: reduce){.pecb-confirmation__panel{animation:none}}\n"] }]
|
|
5959
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], iconType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconType", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], closeOnBackdropClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdropClick", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }], closed: [{ type: i0.Output, args: ["closed"] }], dialogTemplate: [{ type: i0.ViewChild, args: ['dialogTemplate', { isSignal: true }] }] } });
|
|
5939
5960
|
|
|
5940
5961
|
class AlertComponent {
|
|
5941
5962
|
// Duration of the leave animation; keep in sync with $transition-base (250ms)
|
|
@@ -6328,6 +6349,16 @@ class TooltipComponent {
|
|
|
6328
6349
|
this.primaryCta = input(undefined, ...(ngDevMode ? [{ debugName: "primaryCta" }] : []));
|
|
6329
6350
|
this.secondaryCta = input(undefined, ...(ngDevMode ? [{ debugName: "secondaryCta" }] : []));
|
|
6330
6351
|
this.showClose = input(true, ...(ngDevMode ? [{ debugName: "showClose" }] : []));
|
|
6352
|
+
/**
|
|
6353
|
+
* Optional explicit width of the tooltip box (any CSS length, e.g. '330px',
|
|
6354
|
+
* '20rem'). Leave undefined to size to content.
|
|
6355
|
+
*/
|
|
6356
|
+
this.width = input(undefined, ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
6357
|
+
/**
|
|
6358
|
+
* Optional explicit height of the tooltip box (any CSS length, e.g. '120px').
|
|
6359
|
+
* Leave undefined to size to content.
|
|
6360
|
+
*/
|
|
6361
|
+
this.height = input(undefined, ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
6331
6362
|
/**
|
|
6332
6363
|
* Whether the tooltip is visible. Manages its own state internally —
|
|
6333
6364
|
* no consumer binding required. Supports [(visible)] for controlled mode.
|
|
@@ -6366,12 +6397,12 @@ class TooltipComponent {
|
|
|
6366
6397
|
].join(' ');
|
|
6367
6398
|
}
|
|
6368
6399
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6369
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TooltipComponent, isStandalone: true, selector: "pecb-tooltip", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, pointerPosition: { classPropertyName: "pointerPosition", publicName: "pointerPosition", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, primaryCta: { classPropertyName: "primaryCta", publicName: "primaryCta", isSignal: true, isRequired: false, transformFunction: null }, secondaryCta: { classPropertyName: "secondaryCta", publicName: "secondaryCta", isSignal: true, isRequired: false, transformFunction: null }, showClose: { classPropertyName: "showClose", publicName: "showClose", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", closed: "closed", primaryCtaClick: "primaryCtaClick", secondaryCtaClick: "secondaryCtaClick" }, ngImport: i0, template: "@if (visible()) {\n <div [class]=\"hostClasses\">\n\n <!-- \u2500\u2500 Pointer TOP (above container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'top') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--top\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 12L10 0L20 12Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 12L10 1.8L18.2 12Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer LEFT (left of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'left') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--left\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M12 0L0 10L12 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M12 1.8L1.8 10L12 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Main container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"pecb-tooltip__container\">\n <div class=\"pecb-tooltip__body\">\n\n <div class=\"pecb-tooltip__content\">\n <div class=\"pecb-tooltip__texts\">\n @if (title()) {\n <p class=\"pecb-tooltip__title\">{{ title() }}</p>\n }\n <p class=\"pecb-tooltip__message\">{{ message() }}</p>\n </div>\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"pecb-tooltip__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path class=\"pecb-tooltip__close-icon\" d=\"M15 5L5 15M5 5L15 15\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n }\n </div>\n\n @if (hasButtons) {\n <div class=\"pecb-tooltip__buttons\">\n @if (secondaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--secondary\" (click)=\"secondaryCtaClick.emit()\">{{ secondaryCta() }}</button>\n }\n @if (primaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--primary\" (click)=\"primaryCtaClick.emit()\">{{ primaryCta() }}</button>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- \u2500\u2500 Pointer RIGHT (right of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'right') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--right\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L12 10L0 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M0 1.8L10.2 10L0 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer BOTTOM (below container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'bottom') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--bottom\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L10 12L20 0Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 0L10 10.2L18.2 0Z\"/>\n </svg>\n </div>\n }\n\n </div>\n}\n", styles: [".pecb-tooltip{display:inline-flex;flex-direction:column;width:330px}.pecb-tooltip--left-top,.pecb-tooltip--left-center,.pecb-tooltip--left-bottom,.pecb-tooltip--right-top,.pecb-tooltip--right-center,.pecb-tooltip--right-bottom{flex-direction:row;align-items:stretch;width:auto}.pecb-tooltip--left-top>.pecb-tooltip__container,.pecb-tooltip--left-center>.pecb-tooltip__container,.pecb-tooltip--left-bottom>.pecb-tooltip__container,.pecb-tooltip--right-top>.pecb-tooltip__container,.pecb-tooltip--right-center>.pecb-tooltip__container,.pecb-tooltip--right-bottom>.pecb-tooltip__container{width:330px}.pecb-tooltip__pointer--top{display:flex;align-items:flex-end;padding:0 16px;position:relative;z-index:2;margin-bottom:-1px}.pecb-tooltip--top-left>.pecb-tooltip__pointer--top{justify-content:flex-start}.pecb-tooltip--top-center>.pecb-tooltip__pointer--top{justify-content:center}.pecb-tooltip--top-right>.pecb-tooltip__pointer--top{justify-content:flex-end}.pecb-tooltip__pointer--bottom{display:flex;align-items:flex-start;padding:0 16px;position:relative;z-index:2;margin-top:-1px}.pecb-tooltip--bottom-left>.pecb-tooltip__pointer--bottom{justify-content:flex-start}.pecb-tooltip--bottom-center>.pecb-tooltip__pointer--bottom{justify-content:center}.pecb-tooltip--bottom-right>.pecb-tooltip__pointer--bottom{justify-content:flex-end}.pecb-tooltip__container{display:flex;flex-direction:row;align-items:stretch;border-radius:8px;position:relative;z-index:1}.pecb-tooltip--dark .pecb-tooltip__container{background-color:#313131}.pecb-tooltip--light .pecb-tooltip__container{background-color:#fff;border:1px solid #ececec}.pecb-tooltip__pointer--left{display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;position:relative;z-index:2;margin-right:-1px}.pecb-tooltip--left-top>.pecb-tooltip__pointer--left{justify-content:flex-start;padding-top:16px}.pecb-tooltip--left-center>.pecb-tooltip__pointer--left{justify-content:center}.pecb-tooltip--left-bottom>.pecb-tooltip__pointer--left{justify-content:flex-end;padding-bottom:16px}.pecb-tooltip__pointer--right{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;position:relative;z-index:2;margin-left:-1px}.pecb-tooltip--right-top>.pecb-tooltip__pointer--right{justify-content:flex-start;padding-top:16px}.pecb-tooltip--right-center>.pecb-tooltip__pointer--right{justify-content:center}.pecb-tooltip--right-bottom>.pecb-tooltip__pointer--right{justify-content:flex-end;padding-bottom:16px}.pecb-tooltip__body{flex:1;display:flex;flex-direction:column;gap:16px;padding:16px}.pecb-tooltip__content{display:flex;gap:8px;align-items:flex-start;width:100%}.pecb-tooltip__texts{flex:1;display:flex;flex-direction:column;gap:4px}.pecb-tooltip__title{font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:700;line-height:normal;margin:0}.pecb-tooltip--dark .pecb-tooltip__title{color:#fff}.pecb-tooltip--light .pecb-tooltip__title{color:#212427}.pecb-tooltip__message{font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.5;margin:0}.pecb-tooltip--dark .pecb-tooltip__message{color:#ececec}.pecb-tooltip--light .pecb-tooltip__message{color:#919191}.pecb-tooltip__close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;padding:0;background:none;border:none;cursor:pointer;transition:opacity .15s ease-in-out}.pecb-tooltip__close:hover{opacity:.7}.pecb-tooltip__close:focus-visible{outline:2px solid #a11e29;outline-offset:2px;border-radius:2px}.pecb-tooltip__close-icon{stroke:#ececec}.pecb-tooltip--light .pecb-tooltip__close-icon{stroke:#212427}.pecb-tooltip__buttons{display:flex;align-items:center;gap:24px}.pecb-tooltip__btn{display:inline-flex;align-items:center;justify-content:center;padding:0;background:none;border:none;cursor:pointer;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;transition:opacity .15s ease-in-out}.pecb-tooltip__btn:hover{opacity:.8}.pecb-tooltip__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px;border-radius:2px}.pecb-tooltip__btn--primary{color:#a11e29}.pecb-tooltip__btn--secondary{color:#919191}.pecb-tooltip--light .pecb-tooltip__btn--secondary{color:#212427}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6400
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TooltipComponent, isStandalone: true, selector: "pecb-tooltip", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, pointerPosition: { classPropertyName: "pointerPosition", publicName: "pointerPosition", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, primaryCta: { classPropertyName: "primaryCta", publicName: "primaryCta", isSignal: true, isRequired: false, transformFunction: null }, secondaryCta: { classPropertyName: "secondaryCta", publicName: "secondaryCta", isSignal: true, isRequired: false, transformFunction: null }, showClose: { classPropertyName: "showClose", publicName: "showClose", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", closed: "closed", primaryCtaClick: "primaryCtaClick", secondaryCtaClick: "secondaryCtaClick" }, ngImport: i0, template: "@if (visible()) {\n <div [class]=\"hostClasses\">\n\n <!-- \u2500\u2500 Pointer TOP (above container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'top') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--top\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 12L10 0L20 12Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 12L10 1.8L18.2 12Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer LEFT (left of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'left') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--left\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M12 0L0 10L12 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M12 1.8L1.8 10L12 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Main container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"pecb-tooltip__container\" [style.width]=\"width()\" [style.height]=\"height()\">\n <div class=\"pecb-tooltip__body\">\n\n <div class=\"pecb-tooltip__content\">\n <div class=\"pecb-tooltip__texts\">\n @if (title()) {\n <p class=\"pecb-tooltip__title\">{{ title() }}</p>\n }\n <p class=\"pecb-tooltip__message\">{{ message() }}</p>\n </div>\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"pecb-tooltip__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path class=\"pecb-tooltip__close-icon\" d=\"M15 5L5 15M5 5L15 15\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n }\n </div>\n\n @if (hasButtons) {\n <div class=\"pecb-tooltip__buttons\">\n @if (secondaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--secondary\" (click)=\"secondaryCtaClick.emit()\">{{ secondaryCta() }}</button>\n }\n @if (primaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--primary\" (click)=\"primaryCtaClick.emit()\">{{ primaryCta() }}</button>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- \u2500\u2500 Pointer RIGHT (right of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'right') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--right\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L12 10L0 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M0 1.8L10.2 10L0 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer BOTTOM (below container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'bottom') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--bottom\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L10 12L20 0Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 0L10 10.2L18.2 0Z\"/>\n </svg>\n </div>\n }\n\n </div>\n}\n", styles: [".pecb-tooltip{display:inline-flex;flex-direction:column;width:auto;height:auto}.pecb-tooltip--left-top,.pecb-tooltip--left-center,.pecb-tooltip--left-bottom,.pecb-tooltip--right-top,.pecb-tooltip--right-center,.pecb-tooltip--right-bottom{flex-direction:row;align-items:stretch;width:auto}.pecb-tooltip--left-top>.pecb-tooltip__container,.pecb-tooltip--left-center>.pecb-tooltip__container,.pecb-tooltip--left-bottom>.pecb-tooltip__container,.pecb-tooltip--right-top>.pecb-tooltip__container,.pecb-tooltip--right-center>.pecb-tooltip__container,.pecb-tooltip--right-bottom>.pecb-tooltip__container{width:auto}.pecb-tooltip__pointer--top{display:flex;align-items:flex-end;padding:0 16px;position:relative;z-index:2;margin-bottom:-1px}.pecb-tooltip--top-left>.pecb-tooltip__pointer--top{justify-content:flex-start}.pecb-tooltip--top-center>.pecb-tooltip__pointer--top{justify-content:center}.pecb-tooltip--top-right>.pecb-tooltip__pointer--top{justify-content:flex-end}.pecb-tooltip__pointer--bottom{display:flex;align-items:flex-start;padding:0 16px;position:relative;z-index:2;margin-top:-1px}.pecb-tooltip--bottom-left>.pecb-tooltip__pointer--bottom{justify-content:flex-start}.pecb-tooltip--bottom-center>.pecb-tooltip__pointer--bottom{justify-content:center}.pecb-tooltip--bottom-right>.pecb-tooltip__pointer--bottom{justify-content:flex-end}.pecb-tooltip__container{display:flex;flex-direction:row;align-items:stretch;border-radius:8px;position:relative;z-index:1}.pecb-tooltip--dark .pecb-tooltip__container{background-color:#313131}.pecb-tooltip--light .pecb-tooltip__container{background-color:#fff;border:1px solid #ececec}.pecb-tooltip__pointer--left{display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;position:relative;z-index:2;margin-right:-1px}.pecb-tooltip--left-top>.pecb-tooltip__pointer--left{justify-content:flex-start;padding-top:16px}.pecb-tooltip--left-center>.pecb-tooltip__pointer--left{justify-content:center}.pecb-tooltip--left-bottom>.pecb-tooltip__pointer--left{justify-content:flex-end;padding-bottom:16px}.pecb-tooltip__pointer--right{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;position:relative;z-index:2;margin-left:-1px}.pecb-tooltip--right-top>.pecb-tooltip__pointer--right{justify-content:flex-start;padding-top:16px}.pecb-tooltip--right-center>.pecb-tooltip__pointer--right{justify-content:center}.pecb-tooltip--right-bottom>.pecb-tooltip__pointer--right{justify-content:flex-end;padding-bottom:16px}.pecb-tooltip__body{flex:1;display:flex;flex-direction:column;gap:16px;padding:16px}.pecb-tooltip__content{display:flex;gap:8px;align-items:flex-start;width:100%}.pecb-tooltip__texts{flex:1;display:flex;flex-direction:column;gap:4px}.pecb-tooltip__title{font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:700;line-height:normal;margin:0}.pecb-tooltip--dark .pecb-tooltip__title{color:#fff}.pecb-tooltip--light .pecb-tooltip__title{color:#212427}.pecb-tooltip__message{font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.5;margin:0}.pecb-tooltip--dark .pecb-tooltip__message{color:#ececec}.pecb-tooltip--light .pecb-tooltip__message{color:#919191}.pecb-tooltip__close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;padding:0;background:none;border:none;cursor:pointer;transition:opacity .15s ease-in-out}.pecb-tooltip__close:hover{opacity:.7}.pecb-tooltip__close:focus-visible{outline:2px solid #a11e29;outline-offset:2px;border-radius:2px}.pecb-tooltip__close-icon{stroke:#ececec}.pecb-tooltip--light .pecb-tooltip__close-icon{stroke:#212427}.pecb-tooltip__buttons{display:flex;align-items:center;gap:24px}.pecb-tooltip__btn{display:inline-flex;align-items:center;justify-content:center;padding:0;background:none;border:none;cursor:pointer;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;transition:opacity .15s ease-in-out}.pecb-tooltip__btn:hover{opacity:.8}.pecb-tooltip__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px;border-radius:2px}.pecb-tooltip__btn--primary{color:#a11e29}.pecb-tooltip__btn--secondary{color:#919191}.pecb-tooltip--light .pecb-tooltip__btn--secondary{color:#212427}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6370
6401
|
}
|
|
6371
6402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
6372
6403
|
type: Component,
|
|
6373
|
-
args: [{ selector: 'pecb-tooltip', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible()) {\n <div [class]=\"hostClasses\">\n\n <!-- \u2500\u2500 Pointer TOP (above container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'top') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--top\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 12L10 0L20 12Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 12L10 1.8L18.2 12Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer LEFT (left of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'left') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--left\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M12 0L0 10L12 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M12 1.8L1.8 10L12 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Main container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"pecb-tooltip__container\">\n <div class=\"pecb-tooltip__body\">\n\n <div class=\"pecb-tooltip__content\">\n <div class=\"pecb-tooltip__texts\">\n @if (title()) {\n <p class=\"pecb-tooltip__title\">{{ title() }}</p>\n }\n <p class=\"pecb-tooltip__message\">{{ message() }}</p>\n </div>\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"pecb-tooltip__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path class=\"pecb-tooltip__close-icon\" d=\"M15 5L5 15M5 5L15 15\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n }\n </div>\n\n @if (hasButtons) {\n <div class=\"pecb-tooltip__buttons\">\n @if (secondaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--secondary\" (click)=\"secondaryCtaClick.emit()\">{{ secondaryCta() }}</button>\n }\n @if (primaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--primary\" (click)=\"primaryCtaClick.emit()\">{{ primaryCta() }}</button>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- \u2500\u2500 Pointer RIGHT (right of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'right') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--right\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L12 10L0 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M0 1.8L10.2 10L0 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer BOTTOM (below container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'bottom') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--bottom\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L10 12L20 0Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 0L10 10.2L18.2 0Z\"/>\n </svg>\n </div>\n }\n\n </div>\n}\n", styles: [".pecb-tooltip{display:inline-flex;flex-direction:column;width:
|
|
6374
|
-
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], pointerPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "pointerPosition", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], primaryCta: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryCta", required: false }] }], secondaryCta: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryCta", required: false }] }], showClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClose", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], primaryCtaClick: [{ type: i0.Output, args: ["primaryCtaClick"] }], secondaryCtaClick: [{ type: i0.Output, args: ["secondaryCtaClick"] }] } });
|
|
6404
|
+
args: [{ selector: 'pecb-tooltip', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible()) {\n <div [class]=\"hostClasses\">\n\n <!-- \u2500\u2500 Pointer TOP (above container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'top') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--top\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 12L10 0L20 12Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 12L10 1.8L18.2 12Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer LEFT (left of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'left') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--left\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M12 0L0 10L12 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M12 1.8L1.8 10L12 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Main container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"pecb-tooltip__container\" [style.width]=\"width()\" [style.height]=\"height()\">\n <div class=\"pecb-tooltip__body\">\n\n <div class=\"pecb-tooltip__content\">\n <div class=\"pecb-tooltip__texts\">\n @if (title()) {\n <p class=\"pecb-tooltip__title\">{{ title() }}</p>\n }\n <p class=\"pecb-tooltip__message\">{{ message() }}</p>\n </div>\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"pecb-tooltip__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path class=\"pecb-tooltip__close-icon\" d=\"M15 5L5 15M5 5L15 15\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n }\n </div>\n\n @if (hasButtons) {\n <div class=\"pecb-tooltip__buttons\">\n @if (secondaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--secondary\" (click)=\"secondaryCtaClick.emit()\">{{ secondaryCta() }}</button>\n }\n @if (primaryCta()) {\n <button type=\"button\" class=\"pecb-tooltip__btn pecb-tooltip__btn--primary\" (click)=\"primaryCtaClick.emit()\">{{ primaryCta() }}</button>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- \u2500\u2500 Pointer RIGHT (right of container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'right') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--right\">\n <svg width=\"12\" height=\"20\" viewBox=\"0 0 12 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L12 10L0 20Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M0 1.8L10.2 10L0 18.2Z\"/>\n </svg>\n </div>\n }\n\n <!-- \u2500\u2500 Pointer BOTTOM (below container) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (pointerSide === 'bottom') {\n <div class=\"pecb-tooltip__pointer pecb-tooltip__pointer--bottom\">\n <svg width=\"20\" height=\"12\" viewBox=\"0 0 20 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path [attr.fill]=\"ptrBorderFill\" d=\"M0 0L10 12L20 0Z\"/>\n <path [attr.fill]=\"ptrBodyFill\" d=\"M1.8 0L10 10.2L18.2 0Z\"/>\n </svg>\n </div>\n }\n\n </div>\n}\n", styles: [".pecb-tooltip{display:inline-flex;flex-direction:column;width:auto;height:auto}.pecb-tooltip--left-top,.pecb-tooltip--left-center,.pecb-tooltip--left-bottom,.pecb-tooltip--right-top,.pecb-tooltip--right-center,.pecb-tooltip--right-bottom{flex-direction:row;align-items:stretch;width:auto}.pecb-tooltip--left-top>.pecb-tooltip__container,.pecb-tooltip--left-center>.pecb-tooltip__container,.pecb-tooltip--left-bottom>.pecb-tooltip__container,.pecb-tooltip--right-top>.pecb-tooltip__container,.pecb-tooltip--right-center>.pecb-tooltip__container,.pecb-tooltip--right-bottom>.pecb-tooltip__container{width:auto}.pecb-tooltip__pointer--top{display:flex;align-items:flex-end;padding:0 16px;position:relative;z-index:2;margin-bottom:-1px}.pecb-tooltip--top-left>.pecb-tooltip__pointer--top{justify-content:flex-start}.pecb-tooltip--top-center>.pecb-tooltip__pointer--top{justify-content:center}.pecb-tooltip--top-right>.pecb-tooltip__pointer--top{justify-content:flex-end}.pecb-tooltip__pointer--bottom{display:flex;align-items:flex-start;padding:0 16px;position:relative;z-index:2;margin-top:-1px}.pecb-tooltip--bottom-left>.pecb-tooltip__pointer--bottom{justify-content:flex-start}.pecb-tooltip--bottom-center>.pecb-tooltip__pointer--bottom{justify-content:center}.pecb-tooltip--bottom-right>.pecb-tooltip__pointer--bottom{justify-content:flex-end}.pecb-tooltip__container{display:flex;flex-direction:row;align-items:stretch;border-radius:8px;position:relative;z-index:1}.pecb-tooltip--dark .pecb-tooltip__container{background-color:#313131}.pecb-tooltip--light .pecb-tooltip__container{background-color:#fff;border:1px solid #ececec}.pecb-tooltip__pointer--left{display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;position:relative;z-index:2;margin-right:-1px}.pecb-tooltip--left-top>.pecb-tooltip__pointer--left{justify-content:flex-start;padding-top:16px}.pecb-tooltip--left-center>.pecb-tooltip__pointer--left{justify-content:center}.pecb-tooltip--left-bottom>.pecb-tooltip__pointer--left{justify-content:flex-end;padding-bottom:16px}.pecb-tooltip__pointer--right{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;position:relative;z-index:2;margin-left:-1px}.pecb-tooltip--right-top>.pecb-tooltip__pointer--right{justify-content:flex-start;padding-top:16px}.pecb-tooltip--right-center>.pecb-tooltip__pointer--right{justify-content:center}.pecb-tooltip--right-bottom>.pecb-tooltip__pointer--right{justify-content:flex-end;padding-bottom:16px}.pecb-tooltip__body{flex:1;display:flex;flex-direction:column;gap:16px;padding:16px}.pecb-tooltip__content{display:flex;gap:8px;align-items:flex-start;width:100%}.pecb-tooltip__texts{flex:1;display:flex;flex-direction:column;gap:4px}.pecb-tooltip__title{font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:700;line-height:normal;margin:0}.pecb-tooltip--dark .pecb-tooltip__title{color:#fff}.pecb-tooltip--light .pecb-tooltip__title{color:#212427}.pecb-tooltip__message{font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.5;margin:0}.pecb-tooltip--dark .pecb-tooltip__message{color:#ececec}.pecb-tooltip--light .pecb-tooltip__message{color:#919191}.pecb-tooltip__close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;padding:0;background:none;border:none;cursor:pointer;transition:opacity .15s ease-in-out}.pecb-tooltip__close:hover{opacity:.7}.pecb-tooltip__close:focus-visible{outline:2px solid #a11e29;outline-offset:2px;border-radius:2px}.pecb-tooltip__close-icon{stroke:#ececec}.pecb-tooltip--light .pecb-tooltip__close-icon{stroke:#212427}.pecb-tooltip__buttons{display:flex;align-items:center;gap:24px}.pecb-tooltip__btn{display:inline-flex;align-items:center;justify-content:center;padding:0;background:none;border:none;cursor:pointer;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:normal;transition:opacity .15s ease-in-out}.pecb-tooltip__btn:hover{opacity:.8}.pecb-tooltip__btn:focus-visible{outline:2px solid #a11e29;outline-offset:2px;border-radius:2px}.pecb-tooltip__btn--primary{color:#a11e29}.pecb-tooltip__btn--secondary{color:#919191}.pecb-tooltip--light .pecb-tooltip__btn--secondary{color:#212427}\n"] }]
|
|
6405
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], pointerPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "pointerPosition", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], primaryCta: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryCta", required: false }] }], secondaryCta: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryCta", required: false }] }], showClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClose", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], primaryCtaClick: [{ type: i0.Output, args: ["primaryCtaClick"] }], secondaryCtaClick: [{ type: i0.Output, args: ["secondaryCtaClick"] }] } });
|
|
6375
6406
|
|
|
6376
6407
|
const GAP = 2; // px gap between tooltip pointer tip and the host element
|
|
6377
6408
|
class TooltipDirective {
|
|
@@ -10625,11 +10656,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
10625
10656
|
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], socialStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "socialStyle", required: false }] }], flagShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "flagShape", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], defaultAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultAriaLabel", required: false }] }], copiedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copiedLabel", required: false }] }], copyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyLabel", required: false }] }] } });
|
|
10626
10657
|
|
|
10627
10658
|
/**
|
|
10628
|
-
*
|
|
10659
|
+
* An injectable, Toastr-style notification service.
|
|
10629
10660
|
*
|
|
10630
|
-
*
|
|
10631
|
-
*
|
|
10632
|
-
*
|
|
10661
|
+
* Calling any of the helpers renders a `pecb-alert` toast in a CDK overlay
|
|
10662
|
+
* stack on `<body>` — no template wiring, host component, or module setup is
|
|
10663
|
+
* required. Just inject and call:
|
|
10633
10664
|
*
|
|
10634
10665
|
* @example
|
|
10635
10666
|
* ```typescript
|
|
@@ -10637,14 +10668,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
10637
10668
|
*
|
|
10638
10669
|
* @Component({...})
|
|
10639
10670
|
* export class MyComponent {
|
|
10640
|
-
*
|
|
10641
|
-
*
|
|
10642
|
-
* showSuccess(): void {
|
|
10643
|
-
* this.notificationService.success('Operation completed successfully!');
|
|
10644
|
-
* }
|
|
10671
|
+
* private notify = inject(NotificationService);
|
|
10645
10672
|
*
|
|
10646
|
-
*
|
|
10647
|
-
* this.
|
|
10673
|
+
* save(): void {
|
|
10674
|
+
* this.notify.success('Saved!');
|
|
10675
|
+
* this.notify.error('Something went wrong', 'Error');
|
|
10648
10676
|
* }
|
|
10649
10677
|
* }
|
|
10650
10678
|
* ```
|
|
@@ -10653,6 +10681,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
10653
10681
|
*/
|
|
10654
10682
|
class NotificationService {
|
|
10655
10683
|
constructor() {
|
|
10684
|
+
this.overlay = inject(Overlay);
|
|
10685
|
+
this.appRef = inject(ApplicationRef);
|
|
10686
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
10687
|
+
// Legacy reactive streams — kept for backward compatibility. Rendering is now
|
|
10688
|
+
// handled directly by this service, so subscribing to these is no longer
|
|
10689
|
+
// required to display notifications.
|
|
10656
10690
|
this.notificationSubject = new Subject();
|
|
10657
10691
|
this.dismissSubject = new Subject();
|
|
10658
10692
|
this.clearSubject = new Subject();
|
|
@@ -10660,22 +10694,22 @@ class NotificationService {
|
|
|
10660
10694
|
this.defaultDuration = 5000;
|
|
10661
10695
|
/** Default position for notifications */
|
|
10662
10696
|
this.defaultPosition = 'top-right';
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10697
|
+
/** Time to keep a toast mounted after dismiss so its leave animation can play. */
|
|
10698
|
+
this.leaveAnimationMs = 300;
|
|
10699
|
+
/** One shared overlay (a vertical stack) per on-screen position. */
|
|
10700
|
+
this.stacks = new Map();
|
|
10701
|
+
/** All live toasts, keyed by their id. */
|
|
10702
|
+
this.toasts = new Map();
|
|
10703
|
+
}
|
|
10704
|
+
/** @deprecated Notifications now render automatically; no need to subscribe. */
|
|
10667
10705
|
get notifications$() {
|
|
10668
10706
|
return this.notificationSubject.asObservable();
|
|
10669
10707
|
}
|
|
10670
|
-
/**
|
|
10671
|
-
* Observable stream of dismissed notification IDs
|
|
10672
|
-
*/
|
|
10708
|
+
/** @deprecated Notifications now render automatically; no need to subscribe. */
|
|
10673
10709
|
get dismiss$() {
|
|
10674
10710
|
return this.dismissSubject.asObservable();
|
|
10675
10711
|
}
|
|
10676
|
-
/**
|
|
10677
|
-
* Observable stream for clear all events
|
|
10678
|
-
*/
|
|
10712
|
+
/** @deprecated Notifications now render automatically; no need to subscribe. */
|
|
10679
10713
|
get clear$() {
|
|
10680
10714
|
return this.clearSubject.asObservable();
|
|
10681
10715
|
}
|
|
@@ -10722,18 +10756,58 @@ class NotificationService {
|
|
|
10722
10756
|
*/
|
|
10723
10757
|
show(config) {
|
|
10724
10758
|
const id = config.id || this.generateId();
|
|
10725
|
-
const
|
|
10759
|
+
const position = config.position ?? this.defaultPosition;
|
|
10760
|
+
const duration = config.duration ?? this.defaultDuration;
|
|
10761
|
+
const dismissible = config.dismissible ?? true;
|
|
10762
|
+
// Legacy stream for any pre-existing subscribers.
|
|
10763
|
+
this.notificationSubject.next({
|
|
10726
10764
|
id,
|
|
10727
10765
|
message: config.message,
|
|
10728
10766
|
title: config.title,
|
|
10729
10767
|
type: config.type,
|
|
10730
|
-
duration
|
|
10731
|
-
dismissible
|
|
10732
|
-
position
|
|
10768
|
+
duration,
|
|
10769
|
+
dismissible,
|
|
10770
|
+
position,
|
|
10733
10771
|
customClass: config.customClass,
|
|
10734
10772
|
timestamp: new Date()
|
|
10735
|
-
};
|
|
10736
|
-
this.
|
|
10773
|
+
});
|
|
10774
|
+
const overlayRef = this.getStack(position);
|
|
10775
|
+
// Build the alert imperatively and drop it into the stack's pane.
|
|
10776
|
+
const componentRef = createComponent(AlertComponent, {
|
|
10777
|
+
environmentInjector: this.environmentInjector
|
|
10778
|
+
});
|
|
10779
|
+
componentRef.setInput('type', config.type);
|
|
10780
|
+
componentRef.setInput('variant', config.variant ?? 'banner');
|
|
10781
|
+
componentRef.setInput('title', config.title ?? '');
|
|
10782
|
+
componentRef.setInput('message', config.message);
|
|
10783
|
+
componentRef.setInput('dismissible', dismissible);
|
|
10784
|
+
componentRef.setInput('primaryAction', config.primaryAction);
|
|
10785
|
+
componentRef.setInput('secondaryAction', config.secondaryAction);
|
|
10786
|
+
const host = componentRef.location.nativeElement;
|
|
10787
|
+
host.style.pointerEvents = 'auto';
|
|
10788
|
+
if (config.customClass) {
|
|
10789
|
+
host.classList.add(config.customClass);
|
|
10790
|
+
}
|
|
10791
|
+
this.appRef.attachView(componentRef.hostView);
|
|
10792
|
+
overlayRef.overlayElement.appendChild(host);
|
|
10793
|
+
// User clicked the × — start the removal (leave animation + unmount).
|
|
10794
|
+
componentRef.instance.dismissed.subscribe(() => this.remove(id));
|
|
10795
|
+
// Action buttons: run the callback, then dismiss unless it returns false.
|
|
10796
|
+
componentRef.instance.primaryActionClick.subscribe(() => {
|
|
10797
|
+
if (config.onPrimaryAction?.() !== false) {
|
|
10798
|
+
this.remove(id);
|
|
10799
|
+
}
|
|
10800
|
+
});
|
|
10801
|
+
componentRef.instance.secondaryActionClick.subscribe(() => {
|
|
10802
|
+
if (config.onSecondaryAction?.() !== false) {
|
|
10803
|
+
this.remove(id);
|
|
10804
|
+
}
|
|
10805
|
+
});
|
|
10806
|
+
const toast = { componentRef, position };
|
|
10807
|
+
this.toasts.set(id, toast);
|
|
10808
|
+
if (duration > 0) {
|
|
10809
|
+
toast.removeTimer = setTimeout(() => this.remove(id), duration);
|
|
10810
|
+
}
|
|
10737
10811
|
return id;
|
|
10738
10812
|
}
|
|
10739
10813
|
/**
|
|
@@ -10742,12 +10816,78 @@ class NotificationService {
|
|
|
10742
10816
|
*/
|
|
10743
10817
|
dismiss(id) {
|
|
10744
10818
|
this.dismissSubject.next(id);
|
|
10819
|
+
this.remove(id);
|
|
10745
10820
|
}
|
|
10746
10821
|
/**
|
|
10747
10822
|
* Clear all notifications
|
|
10748
10823
|
*/
|
|
10749
10824
|
clearAll() {
|
|
10750
10825
|
this.clearSubject.next();
|
|
10826
|
+
for (const id of [...this.toasts.keys()]) {
|
|
10827
|
+
this.remove(id);
|
|
10828
|
+
}
|
|
10829
|
+
}
|
|
10830
|
+
/** Get (or lazily create) the overlay stack for a screen position. */
|
|
10831
|
+
getStack(position) {
|
|
10832
|
+
let overlayRef = this.stacks.get(position);
|
|
10833
|
+
if (overlayRef) {
|
|
10834
|
+
return overlayRef;
|
|
10835
|
+
}
|
|
10836
|
+
const [vertical, horizontal] = position.split('-');
|
|
10837
|
+
overlayRef = this.overlay.create({
|
|
10838
|
+
// Toasts must never block the page underneath.
|
|
10839
|
+
hasBackdrop: false,
|
|
10840
|
+
scrollStrategy: this.overlay.scrollStrategies.noop()
|
|
10841
|
+
});
|
|
10842
|
+
// We position the stack manually rather than via a CDK position strategy:
|
|
10843
|
+
// the strategy's apply() only runs once a portal is attached, but we append
|
|
10844
|
+
// toast elements straight into the pane (so several can share one stack).
|
|
10845
|
+
// The `cdk-global-overlay-wrapper` class (normally added by the global
|
|
10846
|
+
// strategy) makes the host a full-viewport flexbox; aligning it then places
|
|
10847
|
+
// the pane in the chosen corner.
|
|
10848
|
+
const wrapper = overlayRef.hostElement;
|
|
10849
|
+
wrapper.classList.add('cdk-global-overlay-wrapper');
|
|
10850
|
+
wrapper.style.justifyContent =
|
|
10851
|
+
horizontal === 'center' ? 'center' : horizontal === 'right' ? 'flex-end' : 'flex-start';
|
|
10852
|
+
wrapper.style.alignItems = vertical === 'top' ? 'flex-start' : 'flex-end';
|
|
10853
|
+
// Lay the toasts out as a vertical, non-blocking column. Bottom positions
|
|
10854
|
+
// grow upward so the newest toast sits nearest the edge.
|
|
10855
|
+
const pane = overlayRef.overlayElement;
|
|
10856
|
+
pane.style.position = 'static'; // let the flex wrapper place it
|
|
10857
|
+
pane.style.margin = '16px';
|
|
10858
|
+
pane.style.display = 'flex';
|
|
10859
|
+
pane.style.flexDirection = vertical === 'top' ? 'column' : 'column-reverse';
|
|
10860
|
+
pane.style.gap = '12px';
|
|
10861
|
+
pane.style.width = '380px';
|
|
10862
|
+
pane.style.maxWidth = 'calc(100vw - 32px)';
|
|
10863
|
+
pane.style.pointerEvents = 'none';
|
|
10864
|
+
this.stacks.set(position, overlayRef);
|
|
10865
|
+
return overlayRef;
|
|
10866
|
+
}
|
|
10867
|
+
/** Play the leave animation, then unmount the toast and tidy up its stack. */
|
|
10868
|
+
remove(id) {
|
|
10869
|
+
const toast = this.toasts.get(id);
|
|
10870
|
+
if (!toast) {
|
|
10871
|
+
return;
|
|
10872
|
+
}
|
|
10873
|
+
this.toasts.delete(id);
|
|
10874
|
+
clearTimeout(toast.removeTimer);
|
|
10875
|
+
// Triggers the alert's leave animation (see AlertComponent.visible/leaving).
|
|
10876
|
+
toast.componentRef.instance.visible.set(false);
|
|
10877
|
+
setTimeout(() => {
|
|
10878
|
+
this.appRef.detachView(toast.componentRef.hostView);
|
|
10879
|
+
toast.componentRef.destroy();
|
|
10880
|
+
this.disposeStackIfEmpty(toast.position);
|
|
10881
|
+
}, this.leaveAnimationMs);
|
|
10882
|
+
}
|
|
10883
|
+
/** Dispose a position's overlay once it holds no more toasts. */
|
|
10884
|
+
disposeStackIfEmpty(position) {
|
|
10885
|
+
const stillUsed = [...this.toasts.values()].some((t) => t.position === position);
|
|
10886
|
+
if (stillUsed) {
|
|
10887
|
+
return;
|
|
10888
|
+
}
|
|
10889
|
+
this.stacks.get(position)?.dispose();
|
|
10890
|
+
this.stacks.delete(position);
|
|
10751
10891
|
}
|
|
10752
10892
|
/**
|
|
10753
10893
|
* Generate a unique notification ID
|