@filip.mazev/toastr 0.0.2 → 0.0.4
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.
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, signal, Injectable, computed, ViewContainerRef, ViewChild, Component, inject, Injector, ApplicationRef, EnvironmentInjector, createComponent } from '@angular/core';
|
|
3
3
|
import { NgClass, DOCUMENT } from '@angular/common';
|
|
4
|
-
import { Subject } from 'rxjs';
|
|
4
|
+
import { Subject, take } from 'rxjs';
|
|
5
5
|
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
6
|
class ToastRef {
|
|
8
|
-
closeFn;
|
|
9
7
|
afterClosedSubject = new Subject();
|
|
10
8
|
afterClosed$ = this.afterClosedSubject.asObservable();
|
|
11
|
-
constructor(closeFn) {
|
|
12
|
-
this.closeFn = closeFn;
|
|
13
|
-
}
|
|
14
9
|
close(result) {
|
|
15
|
-
this.closeFn(result);
|
|
16
10
|
this.afterClosedSubject.next(result);
|
|
17
11
|
this.afterClosedSubject.complete();
|
|
18
12
|
}
|
|
@@ -24,7 +18,7 @@ const TOAST_DATA = new InjectionToken('TOAST_DATA');
|
|
|
24
18
|
class ToastrGlobalSettingsService {
|
|
25
19
|
position = signal('top-right', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
26
20
|
animate = signal(true, ...(ngDevMode ? [{ debugName: "animate" }] : []));
|
|
27
|
-
|
|
21
|
+
wrapperClass = signal(undefined, ...(ngDevMode ? [{ debugName: "wrapperClass" }] : []));
|
|
28
22
|
durationInMs = signal(5000, ...(ngDevMode ? [{ debugName: "durationInMs" }] : []));
|
|
29
23
|
swipeToDismiss = signal(true, ...(ngDevMode ? [{ debugName: "swipeToDismiss" }] : []));
|
|
30
24
|
maxOpened = signal(4, ...(ngDevMode ? [{ debugName: "maxOpened" }] : []));
|
|
@@ -37,8 +31,8 @@ class ToastrGlobalSettingsService {
|
|
|
37
31
|
this.position.set(settings.position);
|
|
38
32
|
if (settings.animate !== undefined)
|
|
39
33
|
this.animate.set(settings.animate);
|
|
40
|
-
if (settings.
|
|
41
|
-
this.
|
|
34
|
+
if (settings.wrapperClass !== undefined)
|
|
35
|
+
this.wrapperClass.set(settings.wrapperClass);
|
|
42
36
|
if (settings.durationInMs !== undefined)
|
|
43
37
|
this.durationInMs.set(settings.durationInMs);
|
|
44
38
|
if (settings.swipeToDismiss !== undefined)
|
|
@@ -68,7 +62,9 @@ class ToastCore {
|
|
|
68
62
|
toastSwipeTarget;
|
|
69
63
|
wrapperClasses = computed(() => {
|
|
70
64
|
const isTop = (this.config?.position ?? 'top-right').includes('top');
|
|
71
|
-
|
|
65
|
+
const animClass = isTop ? 'anim-dir-top' : 'anim-dir-bottom';
|
|
66
|
+
const wrapperClass = this.config?.wrapperClass ?? 'default-wrapper';
|
|
67
|
+
return `${animClass} ${wrapperClass}`;
|
|
72
68
|
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : []));
|
|
73
69
|
modalTransform = computed(() => {
|
|
74
70
|
if (!this.isAnimated())
|
|
@@ -150,7 +146,7 @@ class ToastCore {
|
|
|
150
146
|
const deltaY = event.clientY - startY;
|
|
151
147
|
const duration = event.timeStamp - startTime || 1;
|
|
152
148
|
const velocityY = Math.abs(deltaY / duration);
|
|
153
|
-
const crossedLimit = isTop ?
|
|
149
|
+
const crossedLimit = isTop ? deltaY < -limit : deltaY > limit;
|
|
154
150
|
if (crossedLimit || velocityY > 0.3) {
|
|
155
151
|
this.closeToast();
|
|
156
152
|
}
|
|
@@ -180,11 +176,11 @@ class ToastCore {
|
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
178
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ToastCore, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
183
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.4", type: ToastCore, isStandalone: true, selector: "app-toast-core", viewQueries: [{ propertyName: "dynamicContainer", first: true, predicate: ["dynamicContainer"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "toastSwipeTarget", first: true, predicate: ["toastSwipeTarget"], descendants: true, static: true }], ngImport: i0, template: "<div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [
|
|
179
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.4", type: ToastCore, isStandalone: true, selector: "app-toast-core", viewQueries: [{ propertyName: "dynamicContainer", first: true, predicate: ["dynamicContainer"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "toastSwipeTarget", first: true, predicate: ["toastSwipeTarget"], descendants: true, static: true }], ngImport: i0, template: "<div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"modalTransform()\">\n <ng-container #dynamicContainer></ng-container>\n</div>", styles: ["::ng-deep .toast-container{position:fixed;z-index:9999;display:flex;gap:1rem;pointer-events:none}@media(max-width:768px){::ng-deep .toast-container{left:1rem!important;right:1rem!important;width:calc(100% - 2rem)}}::ng-deep .toast-container-top-right{top:1rem;right:1rem;flex-direction:column}::ng-deep .toast-container-top-left{top:1rem;left:1rem;flex-direction:column}::ng-deep .toast-container-top-center{top:1rem;left:50%;transform:translate(-50%);flex-direction:column}::ng-deep .toast-container-bottom-right{bottom:1rem;right:1rem;flex-direction:column-reverse}::ng-deep .toast-container-bottom-left{bottom:1rem;left:1rem;flex-direction:column-reverse}::ng-deep .toast-container-bottom-center{bottom:1rem;left:50%;transform:translate(-50%);flex-direction:column-reverse}@media(max-width:768px){::ng-deep .toast-container[class*=-top-]{top:1rem!important;bottom:auto!important;flex-direction:column!important;transform:none!important}::ng-deep .toast-container[class*=-bottom-]{bottom:1rem!important;top:auto!important;flex-direction:column-reverse!important;transform:none!important}}.toast-wrapper{position:relative;pointer-events:auto;opacity:0;transition:opacity .4s cubic-bezier(.25,.8,.25,1),transform .4s cubic-bezier(.25,.8,.25,1);transition-duration:calc(.4s * (1 - var(--a11y-reduced-motion, 0)))}.toast-wrapper.default-wrapper{background-color:var(--toast-bg, #fff);color:var(--toast-text, #000);border-radius:8px;box-shadow:0 4px 12px #00000026;padding:1rem;width:24rem;max-width:100%}.toast-wrapper.anim-dir-top{transform:translateY(-30px)}.toast-wrapper.anim-dir-bottom{transform:translateY(30px)}.toast-wrapper.show{opacity:1;transform:translateY(0)}.toast-wrapper.no-animate{transition:none!important;transform:none!important}@media(max-width:768px){.toast-wrapper{width:90vw}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
184
180
|
}
|
|
185
181
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ToastCore, decorators: [{
|
|
186
182
|
type: Component,
|
|
187
|
-
args: [{ selector: 'app-toast-core', imports: [NgClass], template: "<div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [
|
|
183
|
+
args: [{ selector: 'app-toast-core', imports: [NgClass], template: "<div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"modalTransform()\">\n <ng-container #dynamicContainer></ng-container>\n</div>", styles: ["::ng-deep .toast-container{position:fixed;z-index:9999;display:flex;gap:1rem;pointer-events:none}@media(max-width:768px){::ng-deep .toast-container{left:1rem!important;right:1rem!important;width:calc(100% - 2rem)}}::ng-deep .toast-container-top-right{top:1rem;right:1rem;flex-direction:column}::ng-deep .toast-container-top-left{top:1rem;left:1rem;flex-direction:column}::ng-deep .toast-container-top-center{top:1rem;left:50%;transform:translate(-50%);flex-direction:column}::ng-deep .toast-container-bottom-right{bottom:1rem;right:1rem;flex-direction:column-reverse}::ng-deep .toast-container-bottom-left{bottom:1rem;left:1rem;flex-direction:column-reverse}::ng-deep .toast-container-bottom-center{bottom:1rem;left:50%;transform:translate(-50%);flex-direction:column-reverse}@media(max-width:768px){::ng-deep .toast-container[class*=-top-]{top:1rem!important;bottom:auto!important;flex-direction:column!important;transform:none!important}::ng-deep .toast-container[class*=-bottom-]{bottom:1rem!important;top:auto!important;flex-direction:column-reverse!important;transform:none!important}}.toast-wrapper{position:relative;pointer-events:auto;opacity:0;transition:opacity .4s cubic-bezier(.25,.8,.25,1),transform .4s cubic-bezier(.25,.8,.25,1);transition-duration:calc(.4s * (1 - var(--a11y-reduced-motion, 0)))}.toast-wrapper.default-wrapper{background-color:var(--toast-bg, #fff);color:var(--toast-text, #000);border-radius:8px;box-shadow:0 4px 12px #00000026;padding:1rem;width:24rem;max-width:100%}.toast-wrapper.anim-dir-top{transform:translateY(-30px)}.toast-wrapper.anim-dir-bottom{transform:translateY(30px)}.toast-wrapper.show{opacity:1;transform:translateY(0)}.toast-wrapper.no-animate{transition:none!important;transform:none!important}@media(max-width:768px){.toast-wrapper{width:90vw}}\n"] }]
|
|
188
184
|
}], propDecorators: { dynamicContainer: [{
|
|
189
185
|
type: ViewChild,
|
|
190
186
|
args: ['dynamicContainer', { read: ViewContainerRef, static: true }]
|
|
@@ -202,20 +198,29 @@ class ToastrService {
|
|
|
202
198
|
toastQueue = [];
|
|
203
199
|
activeToasts = [];
|
|
204
200
|
containers = new Map();
|
|
201
|
+
/**
|
|
202
|
+
* Displays a toast notification with the specified component and configuration.
|
|
203
|
+
* @param componentType
|
|
204
|
+
* @param config
|
|
205
|
+
* @returns
|
|
206
|
+
*/
|
|
205
207
|
queueToast(componentType, config) {
|
|
206
208
|
const resolvedConfig = this.resolveConfig(config);
|
|
207
|
-
|
|
209
|
+
const toastRef = new ToastRef();
|
|
210
|
+
this.toastQueue.push(() => this.buildAndAttachToast(componentType, resolvedConfig, toastRef));
|
|
208
211
|
this.processQueue();
|
|
212
|
+
return toastRef;
|
|
209
213
|
}
|
|
210
214
|
processQueue() {
|
|
211
215
|
const max = this.globalSettings.maxOpened();
|
|
212
216
|
while (this.activeToasts.length < max && this.toastQueue.length > 0) {
|
|
213
217
|
const buildNext = this.toastQueue.shift();
|
|
214
|
-
if (buildNext)
|
|
218
|
+
if (buildNext) {
|
|
215
219
|
buildNext();
|
|
220
|
+
}
|
|
216
221
|
}
|
|
217
222
|
}
|
|
218
|
-
buildAndAttachToast(componentType, config) {
|
|
223
|
+
buildAndAttachToast(componentType, config, toastRef) {
|
|
219
224
|
const dataInjector = Injector.create({
|
|
220
225
|
providers: [{ provide: TOAST_DATA, useValue: config.data }],
|
|
221
226
|
parent: this.injector
|
|
@@ -224,12 +229,9 @@ class ToastrService {
|
|
|
224
229
|
environmentInjector: this.environmentInjector,
|
|
225
230
|
elementInjector: dataInjector
|
|
226
231
|
});
|
|
227
|
-
const toastRef = new ToastRef(() => this.cleanupToast(wrapperRef));
|
|
228
232
|
if (this.isIToast(contentRef.instance)) {
|
|
229
233
|
contentRef.instance.toast = toastRef;
|
|
230
|
-
|
|
231
|
-
contentRef.instance.onToastInit();
|
|
232
|
-
}
|
|
234
|
+
contentRef.instance.onToastInit?.();
|
|
233
235
|
}
|
|
234
236
|
const wrapperInjector = Injector.create({
|
|
235
237
|
providers: [{ provide: ToastRef, useValue: toastRef }],
|
|
@@ -243,11 +245,12 @@ class ToastrService {
|
|
|
243
245
|
wrapperRef.instance.config = config;
|
|
244
246
|
wrapperRef.instance.toastRef = toastRef;
|
|
245
247
|
this.appRef.attachView(wrapperRef.hostView);
|
|
246
|
-
const container = this.getContainer(config.position);
|
|
248
|
+
const container = this.getContainer(config.position || 'top-right');
|
|
247
249
|
container.appendChild(wrapperRef.location.nativeElement);
|
|
248
250
|
this.activeToasts.push(wrapperRef);
|
|
251
|
+
toastRef.afterClosed$.pipe(take(1)).subscribe(() => this.finalizeToast(wrapperRef));
|
|
249
252
|
}
|
|
250
|
-
|
|
253
|
+
finalizeToast(wrapperRef) {
|
|
251
254
|
const index = this.activeToasts.indexOf(wrapperRef);
|
|
252
255
|
if (index > -1) {
|
|
253
256
|
this.activeToasts.splice(index, 1);
|
|
@@ -255,7 +258,7 @@ class ToastrService {
|
|
|
255
258
|
this.appRef.detachView(wrapperRef.hostView);
|
|
256
259
|
wrapperRef.location.nativeElement.remove();
|
|
257
260
|
wrapperRef.destroy();
|
|
258
|
-
|
|
261
|
+
this.processQueue();
|
|
259
262
|
}
|
|
260
263
|
getContainer(position) {
|
|
261
264
|
if (this.containers.has(position)) {
|
|
@@ -272,9 +275,9 @@ class ToastrService {
|
|
|
272
275
|
...config,
|
|
273
276
|
position: config?.position ?? this.globalSettings.position(),
|
|
274
277
|
animate: config?.animate ?? this.globalSettings.animate(),
|
|
275
|
-
|
|
278
|
+
wrapperClass: config?.wrapperClass ?? this.globalSettings.wrapperClass(),
|
|
276
279
|
durationInMs: config?.durationInMs ?? this.globalSettings.durationInMs(),
|
|
277
|
-
swipeToDismiss: config?.swipeToDismiss ?? this.globalSettings.swipeToDismiss()
|
|
280
|
+
swipeToDismiss: config?.swipeToDismiss ?? this.globalSettings.swipeToDismiss()
|
|
278
281
|
};
|
|
279
282
|
}
|
|
280
283
|
isIToast(component) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filip.mazev-toastr.mjs","sources":["../../../projects/toastr/src/lib/classes/toast-ref.ts","../../../projects/toastr/src/lib/tokens/toast-data.token.ts","../../../projects/toastr/src/lib/services/toastr-global-settings.service.ts","../../../projects/toastr/src/lib/components/toast-core.ts","../../../projects/toastr/src/lib/components/toast-core.html","../../../projects/toastr/src/lib/services/toastr.service.ts","../../../projects/toastr/src/lib/classes/toast.ts","../../../projects/toastr/src/public-api.ts","../../../projects/toastr/src/filip.mazev-toastr.ts"],"sourcesContent":["import { Subject } from 'rxjs';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class ToastRef<R = any> {\n private afterClosedSubject = new Subject<R | undefined>();\n public afterClosed$ = this.afterClosedSubject.asObservable();\n\n constructor(private readonly closeFn: (result?: R) => void) {}\n\n public close(result?: R): void {\n this.closeFn(result);\n this.afterClosedSubject.next(result);\n this.afterClosedSubject.complete();\n }\n}","import { InjectionToken } from '@angular/core';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const TOAST_DATA = new InjectionToken<any>('TOAST_DATA');","import { Injectable, signal } from '@angular/core';\nimport { ToastPosition } from '../types/toastr.types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ToastrGlobalSettingsService {\n public readonly position = signal<ToastPosition>('top-right');\n public readonly animate = signal<boolean>(true);\n public readonly useDefaultWrapperClass = signal<boolean>(true);\n public readonly durationInMs = signal<number>(5000);\n public readonly swipeToDismiss = signal<boolean>(true);\n public readonly maxOpened = signal<number>(4);\n\n /**\n * Updates the global toast settings with the provided values.\n * @param settings An object containing the settings to be updated.\n */\n public update(settings: Partial<{\n position: ToastPosition;\n animate: boolean;\n useDefaultWrapperClass: boolean;\n durationInMs: number;\n swipeToDismiss: boolean;\n maxOpened: number;\n }>): void {\n if (settings.position !== undefined) this.position.set(settings.position);\n if (settings.animate !== undefined) this.animate.set(settings.animate);\n if (settings.useDefaultWrapperClass !== undefined) this.useDefaultWrapperClass.set(settings.useDefaultWrapperClass);\n if (settings.durationInMs !== undefined) this.durationInMs.set(settings.durationInMs);\n if (settings.swipeToDismiss !== undefined) this.swipeToDismiss.set(settings.swipeToDismiss);\n if (settings.maxOpened !== undefined) this.maxOpened.set(settings.maxOpened);\n }\n}","import { Component, ViewChild, ViewContainerRef, ComponentRef, ElementRef, OnInit, OnDestroy, signal, computed, inject } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { IToastConfig } from '../interfaces/itoast-config.interface';\nimport { ToastRef } from '../classes/toast-ref';\nimport { IToast } from '../interfaces/itoast.interface';\n\n@Component({\n selector: 'app-toast-core',\n imports: [NgClass],\n templateUrl: './toast-core.html',\n styleUrl: './toast-core.scss'\n})\nexport class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements OnInit, OnDestroy {\n public componentRef!: ComponentRef<C>;\n public config?: IToastConfig<D>;\n public toastRef!: ToastRef<R>;\n\n public isVisible = signal(false);\n public currentTranslateY = signal(0);\n public isSwipingFinished = signal(false);\n \n protected isAnimated = computed(() => this.config?.animate !== false);\n\n @ViewChild('dynamicContainer', { read: ViewContainerRef, static: true }) protected dynamicContainer!: ViewContainerRef;\n @ViewChild('toastSwipeTarget', { static: true }) protected toastSwipeTarget!: ElementRef;\n\n protected wrapperClasses = computed(() => {\n const isTop = (this.config?.position ?? 'top-right').includes('top');\n return isTop ? 'anim-dir-top' : 'anim-dir-bottom';\n });\n\n protected modalTransform = computed(() => {\n if (!this.isAnimated()) return null;\n\n const isTop = (this.config?.position ?? 'top-right').includes('top');\n\n if (this.isSwipingFinished()) {\n return isTop ? 'translateY(-120%)' : 'translateY(120%)';\n }\n\n if (this.currentTranslateY() !== 0) {\n return `translateY(${this.currentTranslateY()}px)`;\n }\n\n return null;\n });\n\n private isTrackingSwipe = false;\n private cleanupListeners: (() => void) | null = null;\n private autoCloseTimeout?: ReturnType<typeof setTimeout>;\n\n public ngOnInit(): void {\n this.dynamicContainer.insert(this.componentRef.hostView);\n\n setTimeout(() => this.isVisible.set(true), 10);\n\n if (this.config?.swipeToDismiss !== false) {\n this.startVerticalSwipeDetection();\n }\n\n if (this.config?.durationInMs) {\n this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.config.durationInMs);\n }\n }\n\n public ngOnDestroy(): void {\n this.stopVerticalSwipeDetection();\n clearTimeout(this.autoCloseTimeout);\n }\n\n public closeToast(): void {\n this.isVisible.set(false);\n this.isSwipingFinished.set(true);\n \n const delay = this.isAnimated() ? 500 : 0;\n\n setTimeout(() => {\n this.toastRef.close();\n }, delay);\n }\n\n //#region Swipe Logic\n\n private startVerticalSwipeDetection(): void {\n if (this.isTrackingSwipe) return;\n\n const hasTouch = typeof window !== 'undefined' && (window.matchMedia('(pointer: coarse)').matches || navigator.maxTouchPoints > 0);\n if (!hasTouch) return;\n\n this.isTrackingSwipe = true;\n const target = this.toastSwipeTarget.nativeElement;\n const isTop = (this.config?.position ?? 'top-right').includes('top');\n\n let startY = 0;\n let startTime = 0;\n let isPointerDown = false;\n let limit = 0;\n\n const pointerDown = (event: PointerEvent) => {\n if (event.button !== 0 && event.pointerType === 'mouse') return;\n \n const toastHeight = target.offsetHeight || 0;\n limit = toastHeight / 3;\n\n isPointerDown = true;\n startY = event.clientY;\n startTime = event.timeStamp;\n \n clearTimeout(this.autoCloseTimeout);\n target.setPointerCapture(event.pointerId);\n };\n\n const pointerMove = (event: PointerEvent) => {\n if (!isPointerDown) return;\n const currentY = event.clientY - startY;\n \n if ((isTop && currentY < 0) || (!isTop && currentY > 0)) {\n if (event.cancelable) event.preventDefault();\n this.currentTranslateY.set(currentY);\n }\n };\n\n const pointerUp = (event: PointerEvent) => {\n if (!isPointerDown) return;\n isPointerDown = false;\n target.releasePointerCapture(event.pointerId);\n\n const deltaY = event.clientY - startY;\n const duration = event.timeStamp - startTime || 1;\n const velocityY = Math.abs(deltaY / duration);\n\n const crossedLimit = isTop ? (deltaY < -limit) : (deltaY > limit);\n\n if (crossedLimit || velocityY > 0.3) {\n this.closeToast();\n } else {\n this.currentTranslateY.set(0);\n if (this.config?.durationInMs) {\n this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.config.durationInMs);\n }\n }\n };\n\n target.addEventListener('pointerdown', pointerDown, { passive: false });\n target.addEventListener('pointermove', pointerMove, { passive: false });\n target.addEventListener('pointerup', pointerUp);\n target.addEventListener('pointercancel', pointerUp);\n\n this.cleanupListeners = () => {\n target.removeEventListener('pointerdown', pointerDown);\n target.removeEventListener('pointermove', pointerMove);\n target.removeEventListener('pointerup', pointerUp);\n target.removeEventListener('pointercancel', pointerUp);\n };\n }\n\n private stopVerticalSwipeDetection(): void {\n this.isTrackingSwipe = false;\n if (this.cleanupListeners) {\n this.cleanupListeners();\n this.cleanupListeners = null;\n }\n }\n\n //#endregion\n}","<div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [class.default-wrapper]=\"config?.useDefaultWrapperClass !== false\"\n [style.transform]=\"modalTransform()\">\n <ng-container #dynamicContainer></ng-container>\n</div>","import { Injectable, inject, Injector, ApplicationRef, EnvironmentInjector, createComponent, ComponentRef } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { IToastConfig } from '../interfaces/itoast-config.interface';\nimport { ToastRef } from '../classes/toast-ref';\nimport { TOAST_DATA } from '../tokens/toast-data.token';\nimport { IToast } from '../interfaces/itoast.interface';\nimport { ToastrGlobalSettingsService } from './toastr-global-settings.service';\nimport { ToastPosition } from '../types/toastr.types';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { ToastCore } from '../components/toast-core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ToastrService {\n private readonly injector = inject(Injector);\n private readonly appRef = inject(ApplicationRef);\n private readonly environmentInjector = inject(EnvironmentInjector);\n private readonly document = inject(DOCUMENT);\n private readonly globalSettings = inject(ToastrGlobalSettingsService);\n\n private toastQueue: (() => void)[] = [];\n private activeToasts: ComponentRef<unknown>[] = [];\n private containers: Map<ToastPosition, HTMLElement> = new Map();\n\n public queueToast<D, R, C extends IToast<D, R> = IToast<D, R>>(\n componentType: ComponentType<C>, \n config?: IToastConfig<D>\n ): void {\n const resolvedConfig = this.resolveConfig(config);\n \n this.toastQueue.push(() => this.buildAndAttachToast<D, R, C>(componentType, resolvedConfig));\n \n this.processQueue();\n }\n\n private processQueue(): void {\n const max = this.globalSettings.maxOpened();\n\n while (this.activeToasts.length < max && this.toastQueue.length > 0) {\n const buildNext = this.toastQueue.shift();\n if (buildNext) buildNext();\n }\n }\n\n private buildAndAttachToast<D, R, C extends IToast<D, R> = IToast<D, R>>(\n componentType: ComponentType<C>, \n config: IToastConfig<D>\n ): void {\n const dataInjector = Injector.create({\n providers: [{ provide: TOAST_DATA, useValue: config.data }],\n parent: this.injector\n });\n\n const contentRef = createComponent(componentType, {\n environmentInjector: this.environmentInjector,\n elementInjector: dataInjector\n });\n\n const toastRef = new ToastRef<R>(() => this.cleanupToast(wrapperRef));\n\n if (this.isIToast<D, R, C>(contentRef.instance)) {\n contentRef.instance.toast = toastRef;\n if (typeof contentRef.instance.onToastInit === 'function') {\n contentRef.instance.onToastInit();\n }\n }\n\n const wrapperInjector = Injector.create({\n providers: [{ provide: ToastRef, useValue: toastRef }],\n parent: this.injector\n });\n\n const wrapperRef = createComponent<ToastCore<D, R, C>>(ToastCore, {\n environmentInjector: this.environmentInjector,\n elementInjector: wrapperInjector\n });\n\n wrapperRef.instance.componentRef = contentRef;\n wrapperRef.instance.config = config;\n wrapperRef.instance.toastRef = toastRef;\n\n this.appRef.attachView(wrapperRef.hostView);\n\n const container = this.getContainer(config.position!);\n container.appendChild(wrapperRef.location.nativeElement);\n \n this.activeToasts.push(wrapperRef);\n }\n\n private cleanupToast<D, R, C extends IToast<D, R> = IToast<D, R>>(wrapperRef: ComponentRef<ToastCore<D, R, C>>): void {\n const index = this.activeToasts.indexOf(wrapperRef);\n if (index > -1) {\n this.activeToasts.splice(index, 1);\n }\n\n this.appRef.detachView(wrapperRef.hostView);\n wrapperRef.location.nativeElement.remove();\n wrapperRef.destroy();\n\n setTimeout(() => this.processQueue(), 200); \n }\n\n private getContainer(position: ToastPosition): HTMLElement {\n if (this.containers.has(position)) {\n return this.containers.get(position)!;\n }\n\n const container = this.document.createElement('div');\n container.classList.add('toast-container', `toast-container-${position}`);\n this.document.body.appendChild(container);\n this.containers.set(position, container);\n\n return container;\n }\n\n private resolveConfig<D>(config?: IToastConfig<D>): IToastConfig<D> {\n return {\n ...config,\n position: config?.position ?? this.globalSettings.position(),\n animate: config?.animate ?? this.globalSettings.animate(),\n useDefaultWrapperClass: config?.useDefaultWrapperClass ?? this.globalSettings.useDefaultWrapperClass(),\n durationInMs: config?.durationInMs ?? this.globalSettings.durationInMs(),\n swipeToDismiss: config?.swipeToDismiss ?? this.globalSettings.swipeToDismiss(),\n };\n }\n\n private isIToast<D, R, C extends IToast<D, R> = IToast<D, R>>(component: unknown): component is C {\n return typeof component === 'object' && component !== null && 'toast' in component;\n }\n}","import { inject, Injectable } from '@angular/core';\nimport { ToastRef } from './toast-ref';\nimport { TOAST_DATA } from '../tokens/toast-data.token';\nimport { IToast } from '../interfaces/itoast.interface';\n\n@Injectable()\nexport abstract class Toast<D = unknown, R = unknown> implements IToast<D, R> {\n /**\n * Data injected into the toast component.\n */\n public data = inject<D>(TOAST_DATA);\n\n /**\n * Reference to the ToastRef instance associated with this toast.\n */\n public toast!: ToastRef<R>;\n\n /**\n * Called when the toast is initialized.\n */\n public onToastInit(): void {}\n\n /**\n * Closes the toast with an optional result.\n * @param result The result to be passed when closing the toast.\n */\n public close(result?: R): void {\n this.toast?.close(result);\n }\n}","/*\n * Public API Surface of toastr\n */\n\nexport * from './lib/services/toastr.service';\nexport * from './lib/services/toastr-global-settings.service';\n\nexport * from './lib/components/toast-core';\n\nexport * from './lib/interfaces/itoast-config.interface';\nexport * from './lib/interfaces/itoast.interface';\n\nexport * from './lib/types/toastr.types';\n\nexport * from './lib/tokens/toast-data.token';\n\nexport * from './lib/classes/toast-ref';\nexport * from './lib/classes/toast';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;MACa,QAAQ,CAAA;AAIU,IAAA,OAAA;AAHrB,IAAA,kBAAkB,GAAG,IAAI,OAAO,EAAiB;AAClD,IAAA,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;AAE5D,IAAA,WAAA,CAA6B,OAA6B,EAAA;QAA7B,IAAA,CAAA,OAAO,GAAP,OAAO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A,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;MCPqB,KAAK,CAAA;AACzB;;AAEG;AACI,IAAA,IAAI,GAAG,MAAM,CAAI,UAAU,CAAC;AAEnC;;AAEG;AACI,IAAA,KAAK;AAEZ;;AAEG;AACI,IAAA,WAAW,KAAU;AAE5B;;;AAGG;AACI,IAAA,KAAK,CAAC,MAAU,EAAA;AACrB,QAAA,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IAC3B;uGAtBoB,KAAK,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAL,KAAK,EAAA,CAAA;;2FAAL,KAAK,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACLD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"filip.mazev-toastr.mjs","sources":["../../../projects/toastr/src/lib/classes/toast-ref.ts","../../../projects/toastr/src/lib/tokens/toast-data.token.ts","../../../projects/toastr/src/lib/services/toastr-global-settings.service.ts","../../../projects/toastr/src/lib/components/toast-core.ts","../../../projects/toastr/src/lib/components/toast-core.html","../../../projects/toastr/src/lib/services/toastr.service.ts","../../../projects/toastr/src/lib/classes/toast.ts","../../../projects/toastr/src/public-api.ts","../../../projects/toastr/src/filip.mazev-toastr.ts"],"sourcesContent":["import { Subject } from 'rxjs';\n\nexport class ToastRef<R = unknown> {\n private readonly afterClosedSubject = new Subject<R | undefined>();\n public readonly afterClosed$ = this.afterClosedSubject.asObservable();\n\n public close(result?: R): void {\n this.afterClosedSubject.next(result);\n this.afterClosedSubject.complete();\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const TOAST_DATA = new InjectionToken<any>('TOAST_DATA');\n","import { Injectable, signal } from '@angular/core';\nimport { ToastPosition } from '../types/toastr.types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ToastrGlobalSettingsService {\n public readonly position = signal<ToastPosition>('top-right');\n public readonly animate = signal<boolean>(true);\n public readonly wrapperClass = signal<string | undefined>(undefined);\n public readonly durationInMs = signal<number>(5000);\n public readonly swipeToDismiss = signal<boolean>(true);\n public readonly maxOpened = signal<number>(4);\n\n /**\n * Updates the global toast settings with the provided values.\n * @param settings An object containing the settings to be updated.\n */\n public update(\n settings: Partial<{\n position: ToastPosition;\n animate: boolean;\n wrapperClass: string;\n durationInMs: number;\n swipeToDismiss: boolean;\n maxOpened: number;\n }>\n ): void {\n if (settings.position !== undefined) this.position.set(settings.position);\n if (settings.animate !== undefined) this.animate.set(settings.animate);\n if (settings.wrapperClass !== undefined) this.wrapperClass.set(settings.wrapperClass);\n if (settings.durationInMs !== undefined) this.durationInMs.set(settings.durationInMs);\n if (settings.swipeToDismiss !== undefined) this.swipeToDismiss.set(settings.swipeToDismiss);\n if (settings.maxOpened !== undefined) this.maxOpened.set(settings.maxOpened);\n }\n}\n","import { Component, ViewChild, ViewContainerRef, ComponentRef, ElementRef, OnInit, OnDestroy, signal, computed } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { IToastConfig } from '../interfaces/itoast-config.interface';\nimport { ToastRef } from '../classes/toast-ref';\nimport { IToast } from '../interfaces/itoast.interface';\n\n@Component({\n selector: 'app-toast-core',\n imports: [NgClass],\n templateUrl: './toast-core.html',\n styleUrl: './toast-core.scss'\n})\nexport class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements OnInit, OnDestroy {\n public componentRef!: ComponentRef<C>;\n public config?: IToastConfig<D>;\n public toastRef!: ToastRef<R>;\n\n public isVisible = signal(false);\n public currentTranslateY = signal(0);\n public isSwipingFinished = signal(false);\n\n protected isAnimated = computed(() => this.config?.animate !== false);\n\n @ViewChild('dynamicContainer', { read: ViewContainerRef, static: true }) protected dynamicContainer!: ViewContainerRef;\n @ViewChild('toastSwipeTarget', { static: true }) protected toastSwipeTarget!: ElementRef;\n\n protected wrapperClasses = computed(() => {\n const isTop = (this.config?.position ?? 'top-right').includes('top');\n const animClass = isTop ? 'anim-dir-top' : 'anim-dir-bottom';\n const wrapperClass = this.config?.wrapperClass ?? 'default-wrapper';\n return `${animClass} ${wrapperClass}`;\n });\n\n protected modalTransform = computed(() => {\n if (!this.isAnimated()) return null;\n\n const isTop = (this.config?.position ?? 'top-right').includes('top');\n\n if (this.isSwipingFinished()) {\n return isTop ? 'translateY(-120%)' : 'translateY(120%)';\n }\n\n if (this.currentTranslateY() !== 0) {\n return `translateY(${this.currentTranslateY()}px)`;\n }\n\n return null;\n });\n\n private isTrackingSwipe = false;\n private cleanupListeners: (() => void) | null = null;\n private autoCloseTimeout?: ReturnType<typeof setTimeout>;\n\n public ngOnInit(): void {\n this.dynamicContainer.insert(this.componentRef.hostView);\n\n setTimeout(() => this.isVisible.set(true), 10);\n\n if (this.config?.swipeToDismiss !== false) {\n this.startVerticalSwipeDetection();\n }\n\n if (this.config?.durationInMs) {\n this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.config.durationInMs);\n }\n }\n\n public ngOnDestroy(): void {\n this.stopVerticalSwipeDetection();\n clearTimeout(this.autoCloseTimeout);\n }\n\n public closeToast(): void {\n this.isVisible.set(false);\n this.isSwipingFinished.set(true);\n\n const delay = this.isAnimated() ? 500 : 0;\n\n setTimeout(() => {\n this.toastRef.close();\n }, delay);\n }\n\n //#region Swipe Logic\n\n private startVerticalSwipeDetection(): void {\n if (this.isTrackingSwipe) return;\n\n const hasTouch = typeof window !== 'undefined' && (window.matchMedia('(pointer: coarse)').matches || navigator.maxTouchPoints > 0);\n if (!hasTouch) return;\n\n this.isTrackingSwipe = true;\n const target = this.toastSwipeTarget.nativeElement;\n const isTop = (this.config?.position ?? 'top-right').includes('top');\n\n let startY = 0;\n let startTime = 0;\n let isPointerDown = false;\n let limit = 0;\n\n const pointerDown = (event: PointerEvent) => {\n if (event.button !== 0 && event.pointerType === 'mouse') return;\n\n const toastHeight = target.offsetHeight || 0;\n limit = toastHeight / 3;\n\n isPointerDown = true;\n startY = event.clientY;\n startTime = event.timeStamp;\n\n clearTimeout(this.autoCloseTimeout);\n target.setPointerCapture(event.pointerId);\n };\n\n const pointerMove = (event: PointerEvent) => {\n if (!isPointerDown) return;\n const currentY = event.clientY - startY;\n\n if ((isTop && currentY < 0) || (!isTop && currentY > 0)) {\n if (event.cancelable) event.preventDefault();\n this.currentTranslateY.set(currentY);\n }\n };\n\n const pointerUp = (event: PointerEvent) => {\n if (!isPointerDown) return;\n isPointerDown = false;\n target.releasePointerCapture(event.pointerId);\n\n const deltaY = event.clientY - startY;\n const duration = event.timeStamp - startTime || 1;\n const velocityY = Math.abs(deltaY / duration);\n\n const crossedLimit = isTop ? deltaY < -limit : deltaY > limit;\n\n if (crossedLimit || velocityY > 0.3) {\n this.closeToast();\n } else {\n this.currentTranslateY.set(0);\n if (this.config?.durationInMs) {\n this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.config.durationInMs);\n }\n }\n };\n\n target.addEventListener('pointerdown', pointerDown, { passive: false });\n target.addEventListener('pointermove', pointerMove, { passive: false });\n target.addEventListener('pointerup', pointerUp);\n target.addEventListener('pointercancel', pointerUp);\n\n this.cleanupListeners = () => {\n target.removeEventListener('pointerdown', pointerDown);\n target.removeEventListener('pointermove', pointerMove);\n target.removeEventListener('pointerup', pointerUp);\n target.removeEventListener('pointercancel', pointerUp);\n };\n }\n\n private stopVerticalSwipeDetection(): void {\n this.isTrackingSwipe = false;\n if (this.cleanupListeners) {\n this.cleanupListeners();\n this.cleanupListeners = null;\n }\n }\n\n //#endregion\n}\n","<div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"modalTransform()\">\n <ng-container #dynamicContainer></ng-container>\n</div>","import { Injectable, inject, Injector, ApplicationRef, EnvironmentInjector, createComponent, ComponentRef } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { IToastConfig } from '../interfaces/itoast-config.interface';\nimport { ToastRef } from '../classes/toast-ref';\nimport { TOAST_DATA } from '../tokens/toast-data.token';\nimport { IToast } from '../interfaces/itoast.interface';\nimport { ToastrGlobalSettingsService } from './toastr-global-settings.service';\nimport { ToastPosition } from '../types/toastr.types';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { ToastCore } from '../components/toast-core';\nimport { take } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ToastrService {\n private readonly injector = inject(Injector);\n private readonly appRef = inject(ApplicationRef);\n private readonly environmentInjector = inject(EnvironmentInjector);\n private readonly document = inject(DOCUMENT);\n private readonly globalSettings = inject(ToastrGlobalSettingsService);\n\n private readonly toastQueue: Array<() => void> = [];\n private readonly activeToasts: Array<ComponentRef<ToastCore<unknown, unknown, IToast<unknown, unknown>>>> = [];\n private readonly containers = new Map<ToastPosition, HTMLElement>();\n\n /**\n * Displays a toast notification with the specified component and configuration.\n * @param componentType\n * @param config\n * @returns\n */\n public queueToast<D, R, C extends IToast<D, R>>(componentType: ComponentType<C>, config?: IToastConfig<D>): ToastRef<R> {\n const resolvedConfig = this.resolveConfig(config);\n const toastRef = new ToastRef<R>();\n\n this.toastQueue.push(() => this.buildAndAttachToast(componentType, resolvedConfig, toastRef));\n\n this.processQueue();\n\n return toastRef;\n }\n\n private processQueue(): void {\n const max = this.globalSettings.maxOpened();\n\n while (this.activeToasts.length < max && this.toastQueue.length > 0) {\n const buildNext = this.toastQueue.shift();\n if (buildNext) {\n buildNext();\n }\n }\n }\n\n private buildAndAttachToast<D, R, C extends IToast<D, R>>(componentType: ComponentType<C>, config: IToastConfig<D>, toastRef: ToastRef<R>): void {\n const dataInjector = Injector.create({\n providers: [{ provide: TOAST_DATA, useValue: config.data }],\n parent: this.injector\n });\n\n const contentRef = createComponent(componentType, {\n environmentInjector: this.environmentInjector,\n elementInjector: dataInjector\n });\n\n if (this.isIToast<D, R, C>(contentRef.instance)) {\n contentRef.instance.toast = toastRef;\n contentRef.instance.onToastInit?.();\n }\n\n const wrapperInjector = Injector.create({\n providers: [{ provide: ToastRef, useValue: toastRef }],\n parent: this.injector\n });\n\n const wrapperRef = createComponent<ToastCore<D, R, C>>(ToastCore, {\n environmentInjector: this.environmentInjector,\n elementInjector: wrapperInjector\n });\n\n wrapperRef.instance.componentRef = contentRef;\n wrapperRef.instance.config = config;\n wrapperRef.instance.toastRef = toastRef;\n\n this.appRef.attachView(wrapperRef.hostView);\n\n const container = this.getContainer(config.position || 'top-right');\n container.appendChild(wrapperRef.location.nativeElement);\n\n this.activeToasts.push(wrapperRef as ComponentRef<ToastCore<unknown, unknown, IToast<unknown, unknown>>>);\n\n toastRef.afterClosed$.pipe(take(1)).subscribe(() => this.finalizeToast(wrapperRef));\n }\n\n private finalizeToast<D, R, C extends IToast<D, R>>(wrapperRef: ComponentRef<ToastCore<D, R, C>>): void {\n const index = this.activeToasts.indexOf(wrapperRef as ComponentRef<ToastCore<unknown, unknown, IToast<unknown, unknown>>>);\n\n if (index > -1) {\n this.activeToasts.splice(index, 1);\n }\n\n this.appRef.detachView(wrapperRef.hostView);\n wrapperRef.location.nativeElement.remove();\n wrapperRef.destroy();\n\n this.processQueue();\n }\n\n private getContainer(position: ToastPosition): HTMLElement {\n if (this.containers.has(position)) {\n return this.containers.get(position) as HTMLElement;\n }\n\n const container = this.document.createElement('div');\n container.classList.add('toast-container', `toast-container-${position}`);\n this.document.body.appendChild(container);\n\n this.containers.set(position, container);\n\n return container;\n }\n\n private resolveConfig<D>(config?: IToastConfig<D>): IToastConfig<D> {\n return {\n ...config,\n position: config?.position ?? this.globalSettings.position(),\n animate: config?.animate ?? this.globalSettings.animate(),\n wrapperClass: config?.wrapperClass ?? this.globalSettings.wrapperClass(),\n durationInMs: config?.durationInMs ?? this.globalSettings.durationInMs(),\n swipeToDismiss: config?.swipeToDismiss ?? this.globalSettings.swipeToDismiss()\n };\n }\n\n private isIToast<D, R, C extends IToast<D, R>>(component: unknown): component is C {\n return typeof component === 'object' && component !== null && 'toast' in component;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { ToastRef } from './toast-ref';\nimport { TOAST_DATA } from '../tokens/toast-data.token';\nimport { IToast } from '../interfaces/itoast.interface';\n\n@Injectable()\nexport abstract class Toast<D = unknown, R = unknown> implements IToast<D, R> {\n /**\n * Data injected into the toast component.\n */\n public data = inject<D>(TOAST_DATA);\n\n /**\n * Reference to the ToastRef instance associated with this toast.\n */\n public toast!: ToastRef<R>;\n\n /**\n * Called when the toast is initialized.\n */\n public onToastInit(): void {}\n\n /**\n * Closes the toast with an optional result.\n * @param result The result to be passed when closing the toast.\n */\n public close(result?: R): void {\n this.toast?.close(result);\n }\n}\n","/*\n * Public API Surface of toastr\n */\n\nexport * from './lib/services/toastr.service';\nexport * from './lib/services/toastr-global-settings.service';\n\nexport * from './lib/components/toast-core';\n\nexport * from './lib/interfaces/itoast-config.interface';\nexport * from './lib/interfaces/itoast.interface';\n\nexport * from './lib/types/toastr.types';\n\nexport * from './lib/tokens/toast-data.token';\n\nexport * from './lib/classes/toast-ref';\nexport * from './lib/classes/toast';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAEa,QAAQ,CAAA;AACF,IAAA,kBAAkB,GAAG,IAAI,OAAO,EAAiB;AAClD,IAAA,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;AAE9D,IAAA,KAAK,CAAC,MAAU,EAAA;AACrB,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;AACpC,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,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;MCRqB,KAAK,CAAA;AACzB;;AAEG;AACI,IAAA,IAAI,GAAG,MAAM,CAAI,UAAU,CAAC;AAEnC;;AAEG;AACI,IAAA,KAAK;AAEZ;;AAEG;AACI,IAAA,WAAW,KAAU;AAE5B;;;AAGG;AACI,IAAA,KAAK,CAAC,MAAU,EAAA;AACrB,QAAA,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IAC3B;uGAtBoB,KAAK,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAL,KAAK,EAAA,CAAA;;2FAAL,KAAK,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACLD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -8,18 +8,16 @@ type ToastPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' |
|
|
|
8
8
|
interface IToastConfig<D = unknown> {
|
|
9
9
|
data?: D;
|
|
10
10
|
position?: ToastPosition;
|
|
11
|
-
|
|
11
|
+
wrapperClass?: string;
|
|
12
12
|
durationInMs?: number;
|
|
13
13
|
swipeToDismiss?: boolean;
|
|
14
14
|
animate?: boolean;
|
|
15
15
|
maxOpened?: number;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
declare class ToastRef<R =
|
|
19
|
-
private readonly
|
|
20
|
-
|
|
21
|
-
afterClosed$: rxjs.Observable<R | undefined>;
|
|
22
|
-
constructor(closeFn: (result?: R) => void);
|
|
18
|
+
declare class ToastRef<R = unknown> {
|
|
19
|
+
private readonly afterClosedSubject;
|
|
20
|
+
readonly afterClosed$: rxjs.Observable<R | undefined>;
|
|
23
21
|
close(result?: R): void;
|
|
24
22
|
}
|
|
25
23
|
|
|
@@ -35,13 +33,19 @@ declare class ToastrService {
|
|
|
35
33
|
private readonly environmentInjector;
|
|
36
34
|
private readonly document;
|
|
37
35
|
private readonly globalSettings;
|
|
38
|
-
private toastQueue;
|
|
39
|
-
private activeToasts;
|
|
40
|
-
private containers;
|
|
41
|
-
|
|
36
|
+
private readonly toastQueue;
|
|
37
|
+
private readonly activeToasts;
|
|
38
|
+
private readonly containers;
|
|
39
|
+
/**
|
|
40
|
+
* Displays a toast notification with the specified component and configuration.
|
|
41
|
+
* @param componentType
|
|
42
|
+
* @param config
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
queueToast<D, R, C extends IToast<D, R>>(componentType: ComponentType<C>, config?: IToastConfig<D>): ToastRef<R>;
|
|
42
46
|
private processQueue;
|
|
43
47
|
private buildAndAttachToast;
|
|
44
|
-
private
|
|
48
|
+
private finalizeToast;
|
|
45
49
|
private getContainer;
|
|
46
50
|
private resolveConfig;
|
|
47
51
|
private isIToast;
|
|
@@ -52,7 +56,7 @@ declare class ToastrService {
|
|
|
52
56
|
declare class ToastrGlobalSettingsService {
|
|
53
57
|
readonly position: _angular_core.WritableSignal<ToastPosition>;
|
|
54
58
|
readonly animate: _angular_core.WritableSignal<boolean>;
|
|
55
|
-
readonly
|
|
59
|
+
readonly wrapperClass: _angular_core.WritableSignal<string | undefined>;
|
|
56
60
|
readonly durationInMs: _angular_core.WritableSignal<number>;
|
|
57
61
|
readonly swipeToDismiss: _angular_core.WritableSignal<boolean>;
|
|
58
62
|
readonly maxOpened: _angular_core.WritableSignal<number>;
|
|
@@ -63,7 +67,7 @@ declare class ToastrGlobalSettingsService {
|
|
|
63
67
|
update(settings: Partial<{
|
|
64
68
|
position: ToastPosition;
|
|
65
69
|
animate: boolean;
|
|
66
|
-
|
|
70
|
+
wrapperClass: string;
|
|
67
71
|
durationInMs: number;
|
|
68
72
|
swipeToDismiss: boolean;
|
|
69
73
|
maxOpened: number;
|
|
@@ -82,7 +86,7 @@ declare class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements
|
|
|
82
86
|
protected isAnimated: _angular_core.Signal<boolean>;
|
|
83
87
|
protected dynamicContainer: ViewContainerRef;
|
|
84
88
|
protected toastSwipeTarget: ElementRef;
|
|
85
|
-
protected wrapperClasses: _angular_core.Signal<
|
|
89
|
+
protected wrapperClasses: _angular_core.Signal<string>;
|
|
86
90
|
protected modalTransform: _angular_core.Signal<string | null>;
|
|
87
91
|
private isTrackingSwipe;
|
|
88
92
|
private cleanupListeners;
|