@siemens/element-ng 48.0.0-next.1 → 48.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,10 +2,10 @@ import { Overlay } from '@angular/cdk/overlay';
|
|
|
2
2
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
3
3
|
import { NgClass, AsyncPipe, isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject, input, computed,
|
|
5
|
+
import { inject, input, computed, signal, output, HostListener, Component, ChangeDetectionStrategy, Injector, PLATFORM_ID, Injectable } from '@angular/core';
|
|
6
6
|
import { t, SiTranslatePipe, SiTranslateService, SiNoTranslateService } from '@siemens/element-translate-ng/translate';
|
|
7
7
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
8
|
-
import {
|
|
8
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
9
9
|
import { areAnimationsDisabled } from '@siemens/element-ng/common';
|
|
10
10
|
import { STATUS_ICON_CONFIG, addIcons, elementCancel, SiIconNextComponent, SiStatusIconComponent } from '@siemens/element-ng/icon';
|
|
11
11
|
import * as i1 from '@siemens/element-ng/link';
|
|
@@ -32,18 +32,27 @@ class SiToastNotificationComponent {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
statusColor = computed(() => this.statusIcons[this.status()].color);
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
toastTimeoutInSeconds = computed(() => {
|
|
36
|
+
const toast = this.toast();
|
|
37
|
+
return toast.timeout ? toast.timeout / 1000 : SI_TOAST_AUTO_HIDE_DELAY / 1000;
|
|
38
|
+
});
|
|
39
|
+
animationMode = signal('running');
|
|
40
|
+
paused = output();
|
|
41
|
+
resumed = output();
|
|
42
|
+
onMouseEnter() {
|
|
43
|
+
if (!this.toast().disableAutoClose) {
|
|
44
|
+
this.animationMode.set('paused');
|
|
45
|
+
this.paused.emit();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
onMouseLeave() {
|
|
49
|
+
if (!this.toast().disableAutoClose) {
|
|
50
|
+
this.animationMode.set('running');
|
|
51
|
+
this.resumed.emit();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
37
54
|
ngOnChanges(changes) {
|
|
38
55
|
if (changes?.toast.currentValue) {
|
|
39
|
-
const toast = this.toast();
|
|
40
|
-
if (!toast.disableAutoClose && toast.timeout) {
|
|
41
|
-
const animation = this.animationBuilder.build([
|
|
42
|
-
style({ width: '100%' }),
|
|
43
|
-
animate(toast.timeout, style({ width: '0%' }))
|
|
44
|
-
]);
|
|
45
|
-
animation.create(this.autoCloseBar().nativeElement).play();
|
|
46
|
-
}
|
|
47
56
|
this.closeAriaLabel = this.toast().closeAriaLabel ?? this.closeAriaLabel;
|
|
48
57
|
}
|
|
49
58
|
}
|
|
@@ -51,12 +60,18 @@ class SiToastNotificationComponent {
|
|
|
51
60
|
this.toast().close();
|
|
52
61
|
}
|
|
53
62
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiToastNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiToastNotificationComponent, isStandalone: true, selector: "si-toast-notification", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } },
|
|
63
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiToastNotificationComponent, isStandalone: true, selector: "si-toast-notification", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { paused: "paused", resumed: "resumed" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, usesOnChanges: true, ngImport: i0, template: "@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div class=\"bar\" [ngClass]=\"statusColor()\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-circle btn-sm btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n", styles: [".si-toast-timer-bar,.si-toast.si-toast-auto-close:before{position:absolute;inset-block-end:0;inset-inline-start:0;block-size:2px}:host{display:block}.si-toast{block-size:auto;position:relative;display:flex;align-items:flex-start;color:var(--element-text-primary);background:var(--element-base-3);border-radius:var(--element-radius-2);padding-inline:12px 8px;padding-block:8px;margin-block-end:20px;font-size:1rem;pointer-events:all;overflow:hidden;min-inline-size:250px;max-inline-size:calc(100vw - 40px)}@media (min-width: 768px){.si-toast{max-inline-size:400px}}.si-toast.si-toast-auto-close{padding-block-end:10px}.si-toast.si-toast-auto-close:before{content:\"\";background:var(--element-ui-4);inset-inline-end:0}.bar{inset-block-start:0;inset-inline-start:0;position:absolute;inline-size:4px;block-size:100%;background:currentColor}@keyframes si-toast-auto-close-animation{0%{inline-size:100%}to{inline-size:0}}.si-toast-timer-bar{animation:si-toast-auto-close-animation var(--toast-timer-duration, 4s) linear forwards;animation-play-state:var(--play-state, running);background-color:var(--element-ui-0)}.toast-content{flex:1;overflow:hidden;white-space:nowrap}.toast-content p{margin-block:0;line-height:1.125rem;white-space:pre-line;overflow-wrap:break-word;word-wrap:break-word}.toast-content .toast-title{line-height:1.5rem}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SiLinkModule }, { kind: "directive", type: i1.SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }, { kind: "component", type: SiStatusIconComponent, selector: "si-status-icon", inputs: ["status"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
55
64
|
}
|
|
56
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiToastNotificationComponent, decorators: [{
|
|
57
66
|
type: Component,
|
|
58
|
-
args: [{ selector: 'si-toast-notification', imports: [NgClass, SiLinkModule, SiIconNextComponent, SiStatusIconComponent, SiTranslatePipe], template: "<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"
|
|
59
|
-
}]
|
|
67
|
+
args: [{ selector: 'si-toast-notification', imports: [NgClass, SiLinkModule, SiIconNextComponent, SiStatusIconComponent, SiTranslatePipe], template: "@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div class=\"bar\" [ngClass]=\"statusColor()\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-circle btn-sm btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n", styles: [".si-toast-timer-bar,.si-toast.si-toast-auto-close:before{position:absolute;inset-block-end:0;inset-inline-start:0;block-size:2px}:host{display:block}.si-toast{block-size:auto;position:relative;display:flex;align-items:flex-start;color:var(--element-text-primary);background:var(--element-base-3);border-radius:var(--element-radius-2);padding-inline:12px 8px;padding-block:8px;margin-block-end:20px;font-size:1rem;pointer-events:all;overflow:hidden;min-inline-size:250px;max-inline-size:calc(100vw - 40px)}@media (min-width: 768px){.si-toast{max-inline-size:400px}}.si-toast.si-toast-auto-close{padding-block-end:10px}.si-toast.si-toast-auto-close:before{content:\"\";background:var(--element-ui-4);inset-inline-end:0}.bar{inset-block-start:0;inset-inline-start:0;position:absolute;inline-size:4px;block-size:100%;background:currentColor}@keyframes si-toast-auto-close-animation{0%{inline-size:100%}to{inline-size:0}}.si-toast-timer-bar{animation:si-toast-auto-close-animation var(--toast-timer-duration, 4s) linear forwards;animation-play-state:var(--play-state, running);background-color:var(--element-ui-0)}.toast-content{flex:1;overflow:hidden;white-space:nowrap}.toast-content p{margin-block:0;line-height:1.125rem;white-space:pre-line;overflow-wrap:break-word;word-wrap:break-word}.toast-content .toast-title{line-height:1.5rem}\n"] }]
|
|
68
|
+
}], propDecorators: { onMouseEnter: [{
|
|
69
|
+
type: HostListener,
|
|
70
|
+
args: ['mouseenter']
|
|
71
|
+
}], onMouseLeave: [{
|
|
72
|
+
type: HostListener,
|
|
73
|
+
args: ['mouseleave']
|
|
74
|
+
}] } });
|
|
60
75
|
|
|
61
76
|
/**
|
|
62
77
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -64,9 +79,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
64
79
|
*/
|
|
65
80
|
class SiToastNotificationDrawerComponent {
|
|
66
81
|
toasts = input();
|
|
82
|
+
paused = output();
|
|
83
|
+
resumed = output();
|
|
67
84
|
animationsDisabled = areAnimationsDisabled();
|
|
68
85
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiToastNotificationDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiToastNotificationDrawerComponent, isStandalone: true, selector: "si-toast-notification-drawer", inputs: { toasts: { classPropertyName: "toasts", publicName: "toasts", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-live": "polite" } }, ngImport: i0, template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: SiToastNotificationComponent, selector: "si-toast-notification", inputs: ["toast"] }], animations: [
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiToastNotificationDrawerComponent, isStandalone: true, selector: "si-toast-notification-drawer", inputs: { toasts: { classPropertyName: "toasts", publicName: "toasts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { paused: "paused", resumed: "resumed" }, host: { attributes: { "aria-live": "polite" } }, ngImport: i0, template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: SiToastNotificationComponent, selector: "si-toast-notification", inputs: ["toast"], outputs: ["paused", "resumed"] }], animations: [
|
|
70
87
|
trigger('toastTrigger', [
|
|
71
88
|
transition(':enter', [
|
|
72
89
|
style({ opacity: 0, transform: 'translateY(100%)' }),
|
|
@@ -94,7 +111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
94
111
|
animate('300ms', style({ 'opacity': 0, 'inset-inline-end': '-100%' }))
|
|
95
112
|
])
|
|
96
113
|
])
|
|
97
|
-
], template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}\n"] }]
|
|
114
|
+
], template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}\n"] }]
|
|
98
115
|
}] });
|
|
99
116
|
|
|
100
117
|
/**
|
|
@@ -115,6 +132,8 @@ class SiToastNotificationService {
|
|
|
115
132
|
overlayRef;
|
|
116
133
|
injector = inject(Injector);
|
|
117
134
|
overlay = inject(Overlay);
|
|
135
|
+
toastTimeoutMap = new Map();
|
|
136
|
+
toastTimerDefaults = new Map();
|
|
118
137
|
constructor() {
|
|
119
138
|
const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
120
139
|
this.queuedToastSubject.subscribe((toast) => {
|
|
@@ -124,7 +143,11 @@ class SiToastNotificationService {
|
|
|
124
143
|
}
|
|
125
144
|
this.activeToastsSubject.next(this.activeToasts);
|
|
126
145
|
if (!toast.disableAutoClose && toast.timeout) {
|
|
127
|
-
|
|
146
|
+
this.toastTimerDefaults.set(toast, {
|
|
147
|
+
pendingTimeout: toast.timeout,
|
|
148
|
+
initializeTime: Date.now()
|
|
149
|
+
});
|
|
150
|
+
this.toastTimeoutMap.set(toast, setTimeout(() => this.hideToastNotification(toast), toast.timeout));
|
|
128
151
|
}
|
|
129
152
|
});
|
|
130
153
|
if (isBrowser) {
|
|
@@ -183,8 +206,26 @@ class SiToastNotificationService {
|
|
|
183
206
|
hiddenToasts.forEach(item => {
|
|
184
207
|
item.hidden?.next();
|
|
185
208
|
item.hidden?.complete();
|
|
209
|
+
this.toastTimerDefaults.delete(item);
|
|
210
|
+
this.toastTimeoutMap.delete(item);
|
|
186
211
|
});
|
|
187
212
|
}
|
|
213
|
+
pauseToastNotification(toast) {
|
|
214
|
+
if (!toast.disableAutoClose) {
|
|
215
|
+
clearTimeout(this.toastTimeoutMap.get(toast));
|
|
216
|
+
const initialTimeout = this.toastTimerDefaults.get(toast)?.initializeTime;
|
|
217
|
+
const elapsedTime = initialTimeout ? Date.now() - initialTimeout : 0;
|
|
218
|
+
this.toastTimerDefaults.get(toast).pendingTimeout -= elapsedTime;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
resumeToastNotification(toast) {
|
|
222
|
+
if (!toast.disableAutoClose) {
|
|
223
|
+
this.toastTimerDefaults.get(toast).initializeTime = Date.now();
|
|
224
|
+
this.toastTimeoutMap.set(toast, setTimeout(() => {
|
|
225
|
+
this.hideToastNotification(this.activeToasts.find(t => t === toast));
|
|
226
|
+
}, this.toastTimerDefaults.get(toast).pendingTimeout));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
188
229
|
addToastDrawer() {
|
|
189
230
|
this.overlayRef = this.overlay.create({
|
|
190
231
|
positionStrategy: this.overlay.position().global().end('20px').bottom()
|
|
@@ -192,6 +233,12 @@ class SiToastNotificationService {
|
|
|
192
233
|
const portal = new ComponentPortal(SiToastNotificationDrawerComponent, null, this.buildInjector());
|
|
193
234
|
this.componentRef = this.overlayRef.attach(portal);
|
|
194
235
|
this.componentRef.setInput('toasts', this.activeToastsSubject);
|
|
236
|
+
this.componentRef.instance.paused.subscribe(toast => {
|
|
237
|
+
this.pauseToastNotification(toast);
|
|
238
|
+
});
|
|
239
|
+
this.componentRef.instance.resumed.subscribe(toast => {
|
|
240
|
+
this.resumeToastNotification(toast);
|
|
241
|
+
});
|
|
195
242
|
}
|
|
196
243
|
// TODO remove once translation must be defined at application start
|
|
197
244
|
// Notification service is provided in 'root'. If no translation is defined, SiNoTranslateService is not provided
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-element-ng-toast-notification.mjs","sources":["../../../../projects/element-ng/toast-notification/si-toast.model.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification.service.ts","../../../../projects/element-ng/toast-notification/index.ts","../../../../projects/element-ng/toast-notification/siemens-element-ng-toast-notification.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { StatusType } from '@siemens/element-ng/common';\nimport { Link } from '@siemens/element-ng/link';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { Subject } from 'rxjs';\n\nexport interface SiToast {\n state: ToastStateName;\n title: TranslatableString;\n message: TranslatableString;\n disableManualClose?: boolean;\n disableAutoClose?: boolean;\n timeout?: number;\n action?: Link;\n close?: () => void;\n translationParams?: { [key: string]: any };\n hidden?: Subject<void>;\n closeAriaLabel?: TranslatableString;\n}\n\nexport type ToastStateName = StatusType | 'connection';\n\nexport const SI_TOAST_AUTO_HIDE_DELAY = 6000;\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { animate, AnimationBuilder, style } from '@angular/animations';\nimport { NgClass } from '@angular/common';\nimport {\n Component,\n computed,\n ElementRef,\n inject,\n input,\n OnChanges,\n SimpleChanges,\n viewChild\n} from '@angular/core';\nimport {\n addIcons,\n elementCancel,\n SiIconNextComponent,\n SiStatusIconComponent,\n STATUS_ICON_CONFIG\n} from '@siemens/element-ng/icon';\nimport { SiLinkModule } from '@siemens/element-ng/link';\nimport { SiTranslatePipe, t } from '@siemens/element-translate-ng/translate';\n\nimport { SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification',\n imports: [NgClass, SiLinkModule, SiIconNextComponent, SiStatusIconComponent, SiTranslatePipe],\n templateUrl: './si-toast-notification.component.html',\n styleUrl: './si-toast-notification.component.scss'\n})\nexport class SiToastNotificationComponent implements OnChanges {\n private readonly statusIcons = inject(STATUS_ICON_CONFIG);\n readonly toast = input.required<SiToast>();\n\n protected closeAriaLabel = t(() => $localize`:@@SI_TOAST.CLOSE:Close`);\n protected readonly icons = addIcons({ elementCancel });\n protected readonly status = computed(() => {\n const toast = this.toast();\n if (toast.state === 'connection') {\n return 'danger';\n } else {\n return Object.keys(this.statusIcons).includes(toast.state) ? toast.state : 'info';\n }\n });\n protected readonly statusColor = computed(() => this.statusIcons[this.status()].color);\n\n private readonly autoCloseBar = viewChild.required<ElementRef<HTMLDivElement>>('autoCloseBar');\n\n private animationBuilder = inject(AnimationBuilder);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes?.toast.currentValue) {\n const toast = this.toast();\n\n if (!toast.disableAutoClose && toast.timeout) {\n const animation = this.animationBuilder.build([\n style({ width: '100%' }),\n animate(toast.timeout, style({ width: '0%' }))\n ]);\n animation.create(this.autoCloseBar().nativeElement).play();\n }\n\n this.closeAriaLabel = this.toast().closeAriaLabel ?? this.closeAriaLabel;\n }\n }\n\n protected close(): void {\n this.toast().close!();\n }\n}\n","<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"!toast().disableAutoClose\">\n <div #autoCloseBar class=\"si-toast-timer-bar\"></div>\n <div class=\"bar\" [ngClass]=\"statusColor()\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toast().title | translate: toast().translationParams }}</b></p\n >\n @if (toast().message) {\n <p class=\"mt-4\">{{ toast().message | translate: toast().translationParams }}</p>\n }\n @if (toast().action) {\n <p [class.mt-3]=\"toast().message\" [class.mt-4]=\"!toast().message\">\n <a [siLink]=\"toast().action\">{{\n toast().action!.title | translate: toast().translationParams\n }}</a>\n </p>\n }\n </div>\n @if (!toast().disableManualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-circle btn-sm btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { areAnimationsDisabled } from '@siemens/element-ng/common';\nimport { Observable } from 'rxjs';\n\nimport { SiToastNotificationComponent } from '../si-toast-notification/si-toast-notification.component';\nimport { SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification-drawer',\n imports: [AsyncPipe, SiToastNotificationComponent],\n templateUrl: './si-toast-notification-drawer.component.html',\n // workaround for cdk-overlay not supporting the order of overlays\n styles: `\n ::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer) {\n z-index: 2000;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'aria-live': 'polite'\n },\n animations: [\n trigger('toastTrigger', [\n transition(':enter', [\n style({ opacity: 0, transform: 'translateY(100%)' }),\n animate(\n '500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n style({ opacity: 1, transform: 'translateY(0%)' })\n )\n ]),\n transition(':leave', [\n style({ 'opacity': 1, 'inset-inline-end': '0%' }),\n animate('300ms', style({ 'opacity': 0, 'inset-inline-end': '-100%' }))\n ])\n ])\n ]\n})\nexport class SiToastNotificationDrawerComponent {\n readonly toasts = input<Observable<SiToast[]>>();\n\n protected animationsDisabled = areAnimationsDisabled();\n}\n","@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n />\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport { ComponentRef, inject, Injectable, Injector, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { Link } from '@siemens/element-ng/link';\nimport { SiNoTranslateService, SiTranslateService } from '@siemens/element-translate-ng/translate';\nimport { ReplaySubject, Subject } from 'rxjs';\n\nimport { SiToastNotificationDrawerComponent } from './si-toast-notification-drawer/si-toast-notification-drawer.component';\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast, ToastStateName } from './si-toast.model';\n\n@Injectable({ providedIn: 'root' })\nexport class SiToastNotificationService implements OnDestroy {\n /**\n * List of currently active toasts to see details or close them.\n *\n * @defaultValue []\n */\n activeToasts: SiToast[] = [];\n\n private activeToastsSubject = new ReplaySubject<SiToast[]>(1);\n private queuedToastSubject = new Subject<SiToast>();\n private readonly maxToasts = 3;\n\n private componentRef?: ComponentRef<SiToastNotificationDrawerComponent>;\n private overlayRef?: OverlayRef;\n\n private injector = inject(Injector);\n private overlay = inject(Overlay);\n\n constructor() {\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n this.queuedToastSubject.subscribe((toast: SiToast) => {\n this.activeToasts.push(toast);\n if (this.activeToasts.length > this.maxToasts) {\n this.hideToastNotification(this.activeToasts[0]);\n }\n this.activeToastsSubject.next(this.activeToasts);\n if (!toast.disableAutoClose && toast.timeout) {\n setTimeout(() => this.hideToastNotification(toast), toast.timeout);\n }\n });\n\n if (isBrowser) {\n this.addToastDrawer();\n }\n }\n\n ngOnDestroy(): void {\n this.overlayRef?.dispose();\n this.componentRef?.destroy();\n }\n\n /**\n * Queue a new toast to be shown.\n * @param action - Passing a Link object will optionally add a clickable link to the toast which can contain an action.\n * @returns the toast object\n */\n queueToastNotification(\n state: ToastStateName,\n title: string,\n message: string,\n disableAutoClose?: boolean,\n disableManualClose?: boolean,\n action?: Link\n ): SiToast {\n const toast: SiToast = {\n state,\n title,\n message,\n disableAutoClose,\n disableManualClose,\n action,\n hidden: new Subject()\n };\n return this.showToastNotification(toast);\n }\n\n /**\n * Show a toast notification\n * @param toast - The toast object of the toast to be shown, can also be constructed while calling this.\n */\n showToastNotification(toast: SiToast): SiToast {\n toast.timeout ??= SI_TOAST_AUTO_HIDE_DELAY;\n toast.hidden ??= new Subject();\n toast.close = () => this.hideToastNotification(toast);\n this.queuedToastSubject.next(toast);\n return toast;\n }\n\n /**\n * Hide a toast notification\n * @param toast - The toast object of the toast to be hidden, can be retrieved from {@link activeToasts} and is returned by {@link queueToastNotification}.\n */\n hideToastNotification(toast?: SiToast): void {\n const hiddenToasts: SiToast[] = [];\n const activeToasts: SiToast[] = [];\n this.activeToasts.forEach(item => {\n if (!toast || item === toast) {\n hiddenToasts.push(item);\n } else {\n activeToasts.push(item);\n }\n });\n\n this.activeToasts = activeToasts;\n this.activeToastsSubject.next(this.activeToasts);\n\n hiddenToasts.forEach(item => {\n item.hidden?.next();\n item.hidden?.complete();\n });\n }\n\n private addToastDrawer(): void {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global().end('20px').bottom()\n });\n const portal = new ComponentPortal(\n SiToastNotificationDrawerComponent,\n null,\n this.buildInjector()\n );\n this.componentRef = this.overlayRef.attach(portal);\n this.componentRef.setInput('toasts', this.activeToastsSubject);\n }\n\n // TODO remove once translation must be defined at application start\n // Notification service is provided in 'root'. If no translation is defined, SiNoTranslateService is not provided\n private buildInjector(): Injector {\n let injector = this.injector;\n if (!injector.get(SiTranslateService, null)) {\n injector = Injector.create({\n providers: [{ provide: SiTranslateService, useClass: SiNoTranslateService, deps: [] }],\n parent: this.injector\n });\n }\n return injector;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-toast.model';\nexport * from './si-toast-notification.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyBO,MAAM,wBAAwB,GAAG;;ACzBxC;;;AAGG;MA+BU,4BAA4B,CAAA;AACtB,IAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAChD,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAW;IAEhC,cAAc,GAAG,CAAC,CAAC,MAAM,SAAS,CAAA,CAAA,uBAAA,CAAyB,CAAC;AACnD,IAAA,KAAK,GAAG,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;AACnC,IAAA,MAAM,GAAG,QAAQ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;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACflC;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-toast-notification.mjs","sources":["../../../../projects/element-ng/toast-notification/si-toast.model.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification.service.ts","../../../../projects/element-ng/toast-notification/index.ts","../../../../projects/element-ng/toast-notification/siemens-element-ng-toast-notification.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { StatusType } from '@siemens/element-ng/common';\nimport { Link } from '@siemens/element-ng/link';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { Subject } from 'rxjs';\n\nexport interface SiToast {\n state: ToastStateName;\n title: TranslatableString;\n message: TranslatableString;\n disableManualClose?: boolean;\n disableAutoClose?: boolean;\n timeout?: number;\n action?: Link;\n close?: () => void;\n translationParams?: { [key: string]: any };\n hidden?: Subject<void>;\n closeAriaLabel?: TranslatableString;\n}\n\nexport type ToastStateName = StatusType | 'connection';\n\nexport const SI_TOAST_AUTO_HIDE_DELAY = 6000;\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { NgClass } from '@angular/common';\nimport {\n Component,\n computed,\n HostListener,\n inject,\n input,\n OnChanges,\n output,\n signal,\n SimpleChanges\n} from '@angular/core';\nimport {\n addIcons,\n elementCancel,\n SiIconNextComponent,\n SiStatusIconComponent,\n STATUS_ICON_CONFIG\n} from '@siemens/element-ng/icon';\nimport { SiLinkModule } from '@siemens/element-ng/link';\nimport { SiTranslatePipe, t } from '@siemens/element-translate-ng/translate';\n\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification',\n imports: [NgClass, SiLinkModule, SiIconNextComponent, SiStatusIconComponent, SiTranslatePipe],\n templateUrl: './si-toast-notification.component.html',\n styleUrl: './si-toast-notification.component.scss'\n})\nexport class SiToastNotificationComponent implements OnChanges {\n private readonly statusIcons = inject(STATUS_ICON_CONFIG);\n readonly toast = input.required<SiToast>();\n\n protected closeAriaLabel = t(() => $localize`:@@SI_TOAST.CLOSE:Close`);\n protected readonly icons = addIcons({ elementCancel });\n protected readonly status = computed(() => {\n const toast = this.toast();\n if (toast.state === 'connection') {\n return 'danger';\n } else {\n return Object.keys(this.statusIcons).includes(toast.state) ? toast.state : 'info';\n }\n });\n protected readonly statusColor = computed(() => this.statusIcons[this.status()].color);\n protected readonly toastTimeoutInSeconds = computed(() => {\n const toast = this.toast();\n return toast.timeout ? toast.timeout / 1000 : SI_TOAST_AUTO_HIDE_DELAY / 1000;\n });\n protected readonly animationMode = signal('running');\n readonly paused = output<void>();\n readonly resumed = output<void>();\n\n @HostListener('mouseenter')\n protected onMouseEnter(): void {\n if (!this.toast().disableAutoClose) {\n this.animationMode.set('paused');\n this.paused.emit();\n }\n }\n\n @HostListener('mouseleave')\n protected onMouseLeave(): void {\n if (!this.toast().disableAutoClose) {\n this.animationMode.set('running');\n this.resumed.emit();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes?.toast.currentValue) {\n this.closeAriaLabel = this.toast().closeAriaLabel ?? this.closeAriaLabel;\n }\n }\n\n protected close(): void {\n this.toast().close!();\n }\n}\n","@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div class=\"bar\" [ngClass]=\"statusColor()\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-circle btn-sm btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { areAnimationsDisabled } from '@siemens/element-ng/common';\nimport { Observable } from 'rxjs';\n\nimport { SiToastNotificationComponent } from '../si-toast-notification/si-toast-notification.component';\nimport { SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification-drawer',\n imports: [AsyncPipe, SiToastNotificationComponent],\n templateUrl: './si-toast-notification-drawer.component.html',\n // workaround for cdk-overlay not supporting the order of overlays\n styles: `\n ::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer) {\n z-index: 2000;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'aria-live': 'polite'\n },\n animations: [\n trigger('toastTrigger', [\n transition(':enter', [\n style({ opacity: 0, transform: 'translateY(100%)' }),\n animate(\n '500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n style({ opacity: 1, transform: 'translateY(0%)' })\n )\n ]),\n transition(':leave', [\n style({ 'opacity': 1, 'inset-inline-end': '0%' }),\n animate('300ms', style({ 'opacity': 0, 'inset-inline-end': '-100%' }))\n ])\n ])\n ]\n})\nexport class SiToastNotificationDrawerComponent {\n readonly toasts = input<Observable<SiToast[]>>();\n readonly paused = output<SiToast>();\n readonly resumed = output<SiToast>();\n\n protected animationsDisabled = areAnimationsDisabled();\n}\n","@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport { ComponentRef, inject, Injectable, Injector, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { Link } from '@siemens/element-ng/link';\nimport { SiNoTranslateService, SiTranslateService } from '@siemens/element-translate-ng/translate';\nimport { ReplaySubject, Subject } from 'rxjs';\n\nimport { SiToastNotificationDrawerComponent } from './si-toast-notification-drawer/si-toast-notification-drawer.component';\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast, ToastStateName } from './si-toast.model';\n\n@Injectable({ providedIn: 'root' })\nexport class SiToastNotificationService implements OnDestroy {\n /**\n * List of currently active toasts to see details or close them.\n *\n * @defaultValue []\n */\n activeToasts: SiToast[] = [];\n\n private activeToastsSubject = new ReplaySubject<SiToast[]>(1);\n private queuedToastSubject = new Subject<SiToast>();\n private readonly maxToasts = 3;\n\n private componentRef?: ComponentRef<SiToastNotificationDrawerComponent>;\n private overlayRef?: OverlayRef;\n\n private injector = inject(Injector);\n private overlay = inject(Overlay);\n private toastTimeoutMap = new Map<SiToast, any>();\n private toastTimerDefaults = new Map<\n SiToast,\n { pendingTimeout: number; initializeTime: number }\n >();\n\n constructor() {\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n this.queuedToastSubject.subscribe((toast: SiToast) => {\n this.activeToasts.push(toast);\n if (this.activeToasts.length > this.maxToasts) {\n this.hideToastNotification(this.activeToasts[0]);\n }\n this.activeToastsSubject.next(this.activeToasts);\n if (!toast.disableAutoClose && toast.timeout) {\n this.toastTimerDefaults.set(toast, {\n pendingTimeout: toast.timeout,\n initializeTime: Date.now()\n });\n this.toastTimeoutMap.set(\n toast,\n setTimeout(() => this.hideToastNotification(toast), toast.timeout)\n );\n }\n });\n\n if (isBrowser) {\n this.addToastDrawer();\n }\n }\n\n ngOnDestroy(): void {\n this.overlayRef?.dispose();\n this.componentRef?.destroy();\n }\n\n /**\n * Queue a new toast to be shown.\n * @param action - Passing a Link object will optionally add a clickable link to the toast which can contain an action.\n * @returns the toast object\n */\n queueToastNotification(\n state: ToastStateName,\n title: string,\n message: string,\n disableAutoClose?: boolean,\n disableManualClose?: boolean,\n action?: Link\n ): SiToast {\n const toast: SiToast = {\n state,\n title,\n message,\n disableAutoClose,\n disableManualClose,\n action,\n hidden: new Subject()\n };\n return this.showToastNotification(toast);\n }\n\n /**\n * Show a toast notification\n * @param toast - The toast object of the toast to be shown, can also be constructed while calling this.\n */\n showToastNotification(toast: SiToast): SiToast {\n toast.timeout ??= SI_TOAST_AUTO_HIDE_DELAY;\n toast.hidden ??= new Subject();\n toast.close = () => this.hideToastNotification(toast);\n this.queuedToastSubject.next(toast);\n return toast;\n }\n\n /**\n * Hide a toast notification\n * @param toast - The toast object of the toast to be hidden, can be retrieved from {@link activeToasts} and is returned by {@link queueToastNotification}.\n */\n hideToastNotification(toast?: SiToast): void {\n const hiddenToasts: SiToast[] = [];\n const activeToasts: SiToast[] = [];\n this.activeToasts.forEach(item => {\n if (!toast || item === toast) {\n hiddenToasts.push(item);\n } else {\n activeToasts.push(item);\n }\n });\n\n this.activeToasts = activeToasts;\n this.activeToastsSubject.next(this.activeToasts);\n\n hiddenToasts.forEach(item => {\n item.hidden?.next();\n item.hidden?.complete();\n this.toastTimerDefaults.delete(item);\n this.toastTimeoutMap.delete(item);\n });\n }\n\n private pauseToastNotification(toast: SiToast): void {\n if (!toast.disableAutoClose) {\n clearTimeout(this.toastTimeoutMap.get(toast));\n\n const initialTimeout = this.toastTimerDefaults.get(toast)?.initializeTime;\n const elapsedTime = initialTimeout ? Date.now() - initialTimeout : 0;\n this.toastTimerDefaults.get(toast)!.pendingTimeout -= elapsedTime;\n }\n }\n\n private resumeToastNotification(toast: SiToast): void {\n if (!toast.disableAutoClose) {\n this.toastTimerDefaults.get(toast)!.initializeTime = Date.now();\n this.toastTimeoutMap.set(\n toast,\n setTimeout(() => {\n this.hideToastNotification(this.activeToasts.find(t => t === toast));\n }, this.toastTimerDefaults.get(toast)!.pendingTimeout)\n );\n }\n }\n\n private addToastDrawer(): void {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global().end('20px').bottom()\n });\n const portal = new ComponentPortal(\n SiToastNotificationDrawerComponent,\n null,\n this.buildInjector()\n );\n this.componentRef = this.overlayRef.attach(portal);\n this.componentRef.setInput('toasts', this.activeToastsSubject);\n this.componentRef.instance.paused.subscribe(toast => {\n this.pauseToastNotification(toast);\n });\n this.componentRef.instance.resumed.subscribe(toast => {\n this.resumeToastNotification(toast);\n });\n }\n\n // TODO remove once translation must be defined at application start\n // Notification service is provided in 'root'. If no translation is defined, SiNoTranslateService is not provided\n private buildInjector(): Injector {\n let injector = this.injector;\n if (!injector.get(SiTranslateService, null)) {\n injector = Injector.create({\n providers: [{ provide: SiTranslateService, useClass: SiNoTranslateService, deps: [] }],\n parent: this.injector\n });\n }\n return injector;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-toast.model';\nexport * from './si-toast-notification.service';\n","/**\n * Generated bundle index.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HANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siemens/element-ng",
|
|
3
3
|
"description": "Element Angular component library, implementing the Siemens Design Language",
|
|
4
|
-
"version": "48.0.0-next.
|
|
4
|
+
"version": "48.0.0-next.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,17 +26,14 @@
|
|
|
26
26
|
"@angular/router": "20",
|
|
27
27
|
"@ngx-formly/bootstrap": "^6.2.2",
|
|
28
28
|
"@ngx-formly/core": "^6.2.2",
|
|
29
|
-
"@siemens/element-translate-ng": "48.0.0-next.
|
|
30
|
-
"@siemens/element-theme": "48.0.0-next.
|
|
29
|
+
"@siemens/element-translate-ng": "48.0.0-next.2",
|
|
30
|
+
"@siemens/element-theme": "48.0.0-next.2",
|
|
31
31
|
"@siemens/ngx-datatable": "22 - 24",
|
|
32
32
|
"flag-icons": "^7.3.2",
|
|
33
33
|
"google-libphonenumber": "^3.2.40",
|
|
34
34
|
"ngx-image-cropper": "^9.0.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
|
-
"@angular/animations": {
|
|
38
|
-
"optional": true
|
|
39
|
-
},
|
|
40
37
|
"@ngx-formly/bootstrap": {
|
|
41
38
|
"optional": true
|
|
42
39
|
},
|
|
@@ -42,6 +42,8 @@ declare class SiToastNotificationService implements OnDestroy {
|
|
|
42
42
|
private overlayRef?;
|
|
43
43
|
private injector;
|
|
44
44
|
private overlay;
|
|
45
|
+
private toastTimeoutMap;
|
|
46
|
+
private toastTimerDefaults;
|
|
45
47
|
constructor();
|
|
46
48
|
ngOnDestroy(): void;
|
|
47
49
|
/**
|
|
@@ -60,6 +62,8 @@ declare class SiToastNotificationService implements OnDestroy {
|
|
|
60
62
|
* @param toast - The toast object of the toast to be hidden, can be retrieved from {@link activeToasts} and is returned by {@link queueToastNotification}.
|
|
61
63
|
*/
|
|
62
64
|
hideToastNotification(toast?: SiToast): void;
|
|
65
|
+
private pauseToastNotification;
|
|
66
|
+
private resumeToastNotification;
|
|
63
67
|
private addToastDrawer;
|
|
64
68
|
private buildInjector;
|
|
65
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<SiToastNotificationService, never>;
|