@filip.mazev/toastr 1.0.10 → 1.0.13
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/README.md
CHANGED
|
@@ -100,14 +100,19 @@ HTML (Template):
|
|
|
100
100
|
</div>
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
### About `ToastRef<R>`
|
|
103
|
+
### About `ToastRef<D, R>`
|
|
104
104
|
|
|
105
105
|
Accessible via `this.toast` inside any component that extends `Toast`. This reference provides programmatic control over the active toast instance.
|
|
106
106
|
|
|
107
107
|
#### Methods & Observables
|
|
108
108
|
|
|
109
109
|
* `close()`: Triggers the exit animation and safely removes the toast from the DOM, allowing the next queued toast to appear.
|
|
110
|
+
* `pause()`: Pauses the auto-dismiss timer, preventing the toast from closing until resumed.
|
|
111
|
+
* `resume()`: Resumes the auto-dismiss timer if it was previously paused.
|
|
112
|
+
* `config`: The resolved `IToastConfig<D>` for this toast instance, combining global defaults and any overrides provided during queuing.
|
|
110
113
|
* `afterClosed$`: An `Observable<void>` that emits once the toast has fully closed and animations have finished.
|
|
114
|
+
* `onPause$`: An `Observable<void>` that emits when the toast's auto-dismiss timer is paused (e.g., on mouse hover).
|
|
115
|
+
* `onResume$`: An `Observable<void>` that emits when the toast's auto-dismiss timer is resumed (e.g., on mouse leave).
|
|
111
116
|
|
|
112
117
|
### 2. Opening the Toast
|
|
113
118
|
|
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, signal, Injectable, computed, ViewContainerRef, ViewChild, Component, inject, Injector, ApplicationRef, EnvironmentInjector, createComponent } from '@angular/core';
|
|
2
|
+
import { InjectionToken, signal, Injectable, computed, ViewContainerRef, HostListener, ViewChild, Component, inject, Injector, ApplicationRef, EnvironmentInjector, createComponent } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { NgClass, CommonModule, DOCUMENT } from '@angular/common';
|
|
5
|
-
import { Subject, take } from 'rxjs';
|
|
5
|
+
import { Subject, Subscription, take } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
class ToastRef {
|
|
8
8
|
afterClosedSubject = new Subject();
|
|
9
|
+
pauseSubject = new Subject();
|
|
10
|
+
resumeSubject = new Subject();
|
|
9
11
|
afterClosed$ = this.afterClosedSubject.asObservable();
|
|
12
|
+
onPause$ = this.pauseSubject.asObservable();
|
|
13
|
+
onResume$ = this.resumeSubject.asObservable();
|
|
14
|
+
config;
|
|
10
15
|
close(result) {
|
|
11
16
|
this.afterClosedSubject.next(result);
|
|
12
17
|
this.afterClosedSubject.complete();
|
|
13
18
|
}
|
|
19
|
+
pause() {
|
|
20
|
+
this.pauseSubject.next();
|
|
21
|
+
}
|
|
22
|
+
resume() {
|
|
23
|
+
this.resumeSubject.next();
|
|
24
|
+
}
|
|
14
25
|
}
|
|
15
26
|
|
|
16
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
28
|
const TOAST_DATA = new InjectionToken('TOAST_DATA');
|
|
18
29
|
|
|
19
30
|
class ToastrGlobalSettingsService {
|
|
20
|
-
position = signal('top-right', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
21
|
-
animate = signal(true, ...(ngDevMode ? [{ debugName: "animate" }] : []));
|
|
22
|
-
wrapperClass = signal(undefined, ...(ngDevMode ? [{ debugName: "wrapperClass" }] : []));
|
|
23
|
-
durationInMs = signal(5000, ...(ngDevMode ? [{ debugName: "durationInMs" }] : []));
|
|
24
|
-
swipeToDismiss = signal(true, ...(ngDevMode ? [{ debugName: "swipeToDismiss" }] : []));
|
|
25
|
-
maxOpened = signal(4, ...(ngDevMode ? [{ debugName: "maxOpened" }] : []));
|
|
31
|
+
position = signal('top-right', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
32
|
+
animate = signal(true, ...(ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []));
|
|
33
|
+
wrapperClass = signal(undefined, ...(ngDevMode ? [{ debugName: "wrapperClass" }] : /* istanbul ignore next */ []));
|
|
34
|
+
durationInMs = signal(5000, ...(ngDevMode ? [{ debugName: "durationInMs" }] : /* istanbul ignore next */ []));
|
|
35
|
+
swipeToDismiss = signal(true, ...(ngDevMode ? [{ debugName: "swipeToDismiss" }] : /* istanbul ignore next */ []));
|
|
36
|
+
maxOpened = signal(4, ...(ngDevMode ? [{ debugName: "maxOpened" }] : /* istanbul ignore next */ []));
|
|
26
37
|
/**
|
|
27
38
|
* Updates the global toast settings with the provided values.
|
|
28
39
|
* @param settings An object containing the settings to be updated.
|
|
@@ -41,10 +52,10 @@ class ToastrGlobalSettingsService {
|
|
|
41
52
|
if (settings.maxOpened !== undefined)
|
|
42
53
|
this.maxOpened.set(settings.maxOpened);
|
|
43
54
|
}
|
|
44
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
45
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastrGlobalSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
56
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastrGlobalSettingsService, providedIn: 'root' });
|
|
46
57
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastrGlobalSettingsService, decorators: [{
|
|
48
59
|
type: Injectable,
|
|
49
60
|
args: [{
|
|
50
61
|
providedIn: 'root'
|
|
@@ -55,12 +66,12 @@ class ToastCore {
|
|
|
55
66
|
componentRef;
|
|
56
67
|
config;
|
|
57
68
|
toastRef;
|
|
58
|
-
isVisible = signal(false, ...(ngDevMode ? [{ debugName: "isVisible" }] : []));
|
|
59
|
-
currentTranslateY = signal(0, ...(ngDevMode ? [{ debugName: "currentTranslateY" }] : []));
|
|
60
|
-
isSwipingFinished = signal(false, ...(ngDevMode ? [{ debugName: "isSwipingFinished" }] : []));
|
|
61
|
-
isCollapsing = signal(false, ...(ngDevMode ? [{ debugName: "isCollapsing" }] : []));
|
|
62
|
-
isAnimated = computed(() => this.config?.animate !== false, ...(ngDevMode ? [{ debugName: "isAnimated" }] : []));
|
|
63
|
-
isBottom = computed(() => (this.config?.position ?? 'top-right').includes('bottom'), ...(ngDevMode ? [{ debugName: "isBottom" }] : []));
|
|
69
|
+
isVisible = signal(false, ...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
|
|
70
|
+
currentTranslateY = signal(0, ...(ngDevMode ? [{ debugName: "currentTranslateY" }] : /* istanbul ignore next */ []));
|
|
71
|
+
isSwipingFinished = signal(false, ...(ngDevMode ? [{ debugName: "isSwipingFinished" }] : /* istanbul ignore next */ []));
|
|
72
|
+
isCollapsing = signal(false, ...(ngDevMode ? [{ debugName: "isCollapsing" }] : /* istanbul ignore next */ []));
|
|
73
|
+
isAnimated = computed(() => this.config?.animate !== false, ...(ngDevMode ? [{ debugName: "isAnimated" }] : /* istanbul ignore next */ []));
|
|
74
|
+
isBottom = computed(() => (this.config?.position ?? 'top-right').includes('bottom'), ...(ngDevMode ? [{ debugName: "isBottom" }] : /* istanbul ignore next */ []));
|
|
64
75
|
dynamicContainer;
|
|
65
76
|
toastSwipeTarget;
|
|
66
77
|
animatorWrapper;
|
|
@@ -69,7 +80,7 @@ class ToastCore {
|
|
|
69
80
|
const animClass = isTop ? 'anim-dir-top' : 'anim-dir-bottom';
|
|
70
81
|
const wrapperClass = this.config?.wrapperClass ?? 'default-wrapper' + (this.config?.hasDefaultBackground === false ? ' no-bg' : '');
|
|
71
82
|
return `${animClass} ${wrapperClass}`;
|
|
72
|
-
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : []));
|
|
83
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : /* istanbul ignore next */ []));
|
|
73
84
|
toastrTransform = computed(() => {
|
|
74
85
|
if (!this.isAnimated())
|
|
75
86
|
return null;
|
|
@@ -81,7 +92,10 @@ class ToastCore {
|
|
|
81
92
|
return `translateY(${this.currentTranslateY()}px)`;
|
|
82
93
|
}
|
|
83
94
|
return null;
|
|
84
|
-
}, ...(ngDevMode ? [{ debugName: "toastrTransform" }] : []));
|
|
95
|
+
}, ...(ngDevMode ? [{ debugName: "toastrTransform" }] : /* istanbul ignore next */ []));
|
|
96
|
+
progressAnimation;
|
|
97
|
+
remainingMs = 0;
|
|
98
|
+
timerStartTime = 0;
|
|
85
99
|
originalCloseFn;
|
|
86
100
|
closeResult;
|
|
87
101
|
isTrackingSwipe = false;
|
|
@@ -102,9 +116,6 @@ class ToastCore {
|
|
|
102
116
|
this.startVerticalSwipeDetection();
|
|
103
117
|
this.monitorInputType();
|
|
104
118
|
}
|
|
105
|
-
if (this.config?.durationInMs) {
|
|
106
|
-
this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.config.durationInMs);
|
|
107
|
-
}
|
|
108
119
|
const animatorTarget = this.animatorWrapper.nativeElement;
|
|
109
120
|
const onAnimatorTransitionEnd = (event) => {
|
|
110
121
|
if (event.target !== animatorTarget || event.propertyName !== 'grid-template-rows')
|
|
@@ -117,12 +128,19 @@ class ToastCore {
|
|
|
117
128
|
animatorTarget.addEventListener('transitionend', onAnimatorTransitionEnd);
|
|
118
129
|
this.cleanupListeners.push(() => animatorTarget.removeEventListener('transitionend', onAnimatorTransitionEnd));
|
|
119
130
|
}
|
|
131
|
+
ngAfterViewInit() {
|
|
132
|
+
if (this.config?.durationInMs) {
|
|
133
|
+
this.remainingMs = this.config.durationInMs;
|
|
134
|
+
this.startTimer();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
120
137
|
ngOnDestroy() {
|
|
121
138
|
clearTimeout(this.autoCloseTimeout);
|
|
122
139
|
this.stopVerticalSwipeDetection();
|
|
123
140
|
this.globalResizeCleanup?.();
|
|
124
141
|
this.cleanupListeners.forEach((fn) => fn());
|
|
125
142
|
this.cleanupListeners = [];
|
|
143
|
+
this.progressAnimation?.cancel();
|
|
126
144
|
}
|
|
127
145
|
closeToast(result, fromSwipe = false) {
|
|
128
146
|
this.closeResult = result !== undefined ? result : this.closeResult;
|
|
@@ -139,6 +157,17 @@ class ToastCore {
|
|
|
139
157
|
this.isSwipingFinished.set(true);
|
|
140
158
|
}
|
|
141
159
|
}
|
|
160
|
+
onMouseEnter() {
|
|
161
|
+
if (!this.isTouchActive && this.config?.durationInMs && !this.isCollapsing()) {
|
|
162
|
+
this.pauseTimer();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
onMouseLeave() {
|
|
166
|
+
if (!this.isTouchActive && this.config?.durationInMs && !this.isCollapsing()) {
|
|
167
|
+
this.startTimer();
|
|
168
|
+
this.toastRef.resume();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
142
171
|
//#region Swipe Logic
|
|
143
172
|
startVerticalSwipeDetection() {
|
|
144
173
|
if (this.isTrackingSwipe)
|
|
@@ -230,10 +259,27 @@ class ToastCore {
|
|
|
230
259
|
window.addEventListener('pointerdown', handler);
|
|
231
260
|
this.globalResizeCleanup = () => window.removeEventListener('pointerdown', handler);
|
|
232
261
|
}
|
|
233
|
-
|
|
234
|
-
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region Timer Logic
|
|
264
|
+
startTimer() {
|
|
265
|
+
if (this.remainingMs <= 0)
|
|
266
|
+
return;
|
|
267
|
+
this.timerStartTime = Date.now();
|
|
268
|
+
this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.remainingMs);
|
|
269
|
+
}
|
|
270
|
+
pauseTimer() {
|
|
271
|
+
if (!this.autoCloseTimeout)
|
|
272
|
+
return;
|
|
273
|
+
clearTimeout(this.autoCloseTimeout);
|
|
274
|
+
this.autoCloseTimeout = undefined;
|
|
275
|
+
const elapsed = Date.now() - this.timerStartTime;
|
|
276
|
+
this.remainingMs -= elapsed;
|
|
277
|
+
this.toastRef.pause();
|
|
278
|
+
}
|
|
279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastCore, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.5", type: ToastCore, isStandalone: true, selector: "app-toast-core", host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, viewQueries: [{ propertyName: "dynamicContainer", first: true, predicate: ["dynamicContainer"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "toastSwipeTarget", first: true, predicate: ["toastSwipeTarget"], descendants: true, static: true }, { propertyName: "animatorWrapper", first: true, predicate: ["animatorWrapper"], descendants: true, static: true }], ngImport: i0, template: "<div #animatorWrapper class=\"toast-animator\" [class.collapsing]=\"isCollapsing()\" [class.is-bottom]=\"isBottom()\">\n <div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"toastrTransform()\">\n <ng-container #dynamicContainer></ng-container>\n </div>\n</div>", styles: [":host{display:block;width:100%}::ng-deep .toast-container{position:fixed;z-index:9999;display:flex;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;align-items:flex-end}::ng-deep .toast-container-top-left{top:1rem;left:1rem;flex-direction:column;align-items:flex-start}::ng-deep .toast-container-top-center{top:1rem;left:50%;transform:translate(-50%);flex-direction:column;align-items:center}::ng-deep .toast-container-bottom-right{bottom:1rem;right:1rem;flex-direction:column-reverse;align-items:flex-end}::ng-deep .toast-container-bottom-left{bottom:1rem;left:1rem;flex-direction:column-reverse;align-items:flex-start}::ng-deep .toast-container-bottom-center{bottom:1rem;left:50%;transform:translate(-50%);flex-direction:column-reverse;align-items:center}@media(max-width:768px){::ng-deep .toast-container[class*=-top-]{top:1rem!important;bottom:auto!important;flex-direction:column!important;transform:none!important;align-items:center!important}::ng-deep .toast-container[class*=-bottom-]{bottom:1rem!important;top:auto!important;flex-direction:column-reverse!important;transform:none!important;align-items:center!important}}.toast-animator{display:grid;grid-template-rows:1fr;transition:grid-template-rows .4s cubic-bezier(.25,.8,.25,1),margin .4s cubic-bezier(.25,.8,.25,1);margin-bottom:1rem}.toast-animator.is-bottom{margin-bottom:0;margin-top:1rem}.toast-animator.collapsing{grid-template-rows:0fr;margin-top:0!important;margin-bottom:0!important}.toast-wrapper{position:relative;pointer-events:auto;opacity:0;min-height:0;overflow:hidden;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;width:24rem;max-width:100%}.toast-wrapper.default-wrapper.no-bg{background-color:transparent}.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.default-wrapper{width:100%}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
235
281
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastCore, decorators: [{
|
|
237
283
|
type: Component,
|
|
238
284
|
args: [{ selector: 'app-toast-core', imports: [NgClass], template: "<div #animatorWrapper class=\"toast-animator\" [class.collapsing]=\"isCollapsing()\" [class.is-bottom]=\"isBottom()\">\n <div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"toastrTransform()\">\n <ng-container #dynamicContainer></ng-container>\n </div>\n</div>", styles: [":host{display:block;width:100%}::ng-deep .toast-container{position:fixed;z-index:9999;display:flex;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;align-items:flex-end}::ng-deep .toast-container-top-left{top:1rem;left:1rem;flex-direction:column;align-items:flex-start}::ng-deep .toast-container-top-center{top:1rem;left:50%;transform:translate(-50%);flex-direction:column;align-items:center}::ng-deep .toast-container-bottom-right{bottom:1rem;right:1rem;flex-direction:column-reverse;align-items:flex-end}::ng-deep .toast-container-bottom-left{bottom:1rem;left:1rem;flex-direction:column-reverse;align-items:flex-start}::ng-deep .toast-container-bottom-center{bottom:1rem;left:50%;transform:translate(-50%);flex-direction:column-reverse;align-items:center}@media(max-width:768px){::ng-deep .toast-container[class*=-top-]{top:1rem!important;bottom:auto!important;flex-direction:column!important;transform:none!important;align-items:center!important}::ng-deep .toast-container[class*=-bottom-]{bottom:1rem!important;top:auto!important;flex-direction:column-reverse!important;transform:none!important;align-items:center!important}}.toast-animator{display:grid;grid-template-rows:1fr;transition:grid-template-rows .4s cubic-bezier(.25,.8,.25,1),margin .4s cubic-bezier(.25,.8,.25,1);margin-bottom:1rem}.toast-animator.is-bottom{margin-bottom:0;margin-top:1rem}.toast-animator.collapsing{grid-template-rows:0fr;margin-top:0!important;margin-bottom:0!important}.toast-wrapper{position:relative;pointer-events:auto;opacity:0;min-height:0;overflow:hidden;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;width:24rem;max-width:100%}.toast-wrapper.default-wrapper.no-bg{background-color:transparent}.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.default-wrapper{width:100%}}\n"] }]
|
|
239
285
|
}], propDecorators: { dynamicContainer: [{
|
|
@@ -245,6 +291,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
245
291
|
}], animatorWrapper: [{
|
|
246
292
|
type: ViewChild,
|
|
247
293
|
args: ['animatorWrapper', { static: true }]
|
|
294
|
+
}], onMouseEnter: [{
|
|
295
|
+
type: HostListener,
|
|
296
|
+
args: ['mouseenter']
|
|
297
|
+
}], onMouseLeave: [{
|
|
298
|
+
type: HostListener,
|
|
299
|
+
args: ['mouseleave']
|
|
248
300
|
}] } });
|
|
249
301
|
|
|
250
302
|
class Toast {
|
|
@@ -267,24 +319,44 @@ class Toast {
|
|
|
267
319
|
close(result) {
|
|
268
320
|
this.toast?.close(result);
|
|
269
321
|
}
|
|
270
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
271
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
322
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: Toast, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
323
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: Toast });
|
|
272
324
|
}
|
|
273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: Toast, decorators: [{
|
|
274
326
|
type: Injectable
|
|
275
327
|
}] });
|
|
276
328
|
|
|
277
329
|
class SimpleToast extends Toast {
|
|
330
|
+
progressBar;
|
|
331
|
+
progressAnimation;
|
|
332
|
+
subs = new Subscription();
|
|
333
|
+
ngAfterViewInit() {
|
|
334
|
+
const duration = this.toast?.config?.durationInMs;
|
|
335
|
+
if (duration && this.progressBar?.nativeElement) {
|
|
336
|
+
this.progressAnimation = this.progressBar.nativeElement.animate([{ width: '100%' }, { width: '0%' }], { duration, fill: 'forwards' });
|
|
337
|
+
if (this.toast) {
|
|
338
|
+
this.subs.add(this.toast.onPause$.subscribe(() => this.progressAnimation?.pause()));
|
|
339
|
+
this.subs.add(this.toast.onResume$.subscribe(() => this.progressAnimation?.play()));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
ngOnDestroy() {
|
|
344
|
+
this.progressAnimation?.cancel();
|
|
345
|
+
this.subs.unsubscribe();
|
|
346
|
+
}
|
|
278
347
|
dismiss() {
|
|
279
348
|
this.toast?.close();
|
|
280
349
|
}
|
|
281
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
282
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SimpleToast, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
351
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SimpleToast, isStandalone: true, selector: "app-simple-toast", viewQueries: [{ propertyName: "progressBar", first: true, predicate: ["progressBar"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"simple-toast\" [ngClass]=\"data.type\">\n <button class=\"simple-toast-close-button\" (click)=\"dismiss()\" aria-label=\"Close toast\" [ngClass]=\"data.type\">\n \u2715\n </button>\n\n <div class=\"simple-toast-content\">\n @if(data.title ) {\n <h4 class=\"simple-toast-title\">{{ data.title }}</h4>\n <p class=\"simple-toast-message\">{{ data.message }}</p>\n } @else {\n <p class=\"simple-toast-message large-message\">{{ data.message }}</p>\n }\n </div>\n\n @if (toast.config.durationInMs) {\n <div class=\"toast-progress-container\" [ngClass]=\"data.type\">\n <div class=\"toast-progress-bar\" [ngClass]=\"data.type\" #progressBar></div>\n </div>\n }\n</div>", styles: [".simple-toast{display:flex;flex-direction:column;justify-content:center;position:relative;padding:1rem;border-radius:10px;box-shadow:0 2px 8px #00000026;border:1px solid var(--fm-border, #ccc);overflow:hidden}.simple-toast.info{color:var(--simple-toast-info-accent);background-color:var(--simple-toast-info-bg);border:1px solid var(--simple-toast-info-border)}.simple-toast.success{color:var(--simple-toast-success-accent);background-color:var(--simple-toast-success-bg);border:1px solid var(--simple-toast-success-border)}.simple-toast.warn{color:var(--simple-toast-warn-accent);background-color:var(--simple-toast-warn-bg);border:1px solid var(--simple-toast-warn-border)}.simple-toast.error{color:var(--simple-toast-error-accent);background-color:var(--simple-toast-error-bg);border:1px solid var(--simple-toast-error-border)}.simple-toast-content{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex-grow:1;padding-right:1.5rem;font-family:inherit}.simple-toast-title{margin:0 0 .25rem;font-size:1rem;font-weight:600}.simple-toast-message{margin:0;font-size:.875rem;line-height:1.4}.simple-toast-message.large-message{font-size:1rem}.simple-toast-close-button{position:absolute;top:.5rem;right:.5rem;background:none;border:none;cursor:pointer;width:1.5rem;height:1.5rem;font-size:1rem;display:flex;align-items:center;justify-content:center;transition:color .2s}.simple-toast-close-button.info{color:var(--simple-toast-info-accent)}.simple-toast-close-button.success{color:var(--simple-toast-success-accent)}.simple-toast-close-button.warn{color:var(--simple-toast-warn-accent)}.simple-toast-close-button.error{color:var(--simple-toast-error-accent)}.toast-progress-container{position:absolute;bottom:0;left:0;width:100%;height:4px;pointer-events:none}.toast-progress-container.info{background-color:var(--simple-toast-info-border)}.toast-progress-container.success{background-color:var(--simple-toast-success-border)}.toast-progress-container.warn{background-color:var(--simple-toast-warn-border)}.toast-progress-container.error{background-color:var(--simple-toast-error-border)}.toast-progress-bar{height:100%;width:100%;opacity:.6;transform-origin:left}.toast-progress-bar.info{background-color:var(--simple-toast-info-accent)}.toast-progress-bar.success{background-color:var(--simple-toast-success-accent)}.toast-progress-bar.warn{background-color:var(--simple-toast-warn-accent)}.toast-progress-bar.error{background-color:var(--simple-toast-error-accent)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
283
352
|
}
|
|
284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SimpleToast, decorators: [{
|
|
285
354
|
type: Component,
|
|
286
|
-
args: [{ selector: 'app-simple-toast', standalone: true, imports: [CommonModule], template: "<div class=\"simple-toast\" [ngClass]=\"data.type\">\n <button class=\"simple-toast-close-button\" (click)=\"dismiss()\" aria-label=\"Close toast\" [ngClass]=\"data.type\">\n \u2715\n </button>\n\n <div class=\"simple-toast-content\">\n @if(data.title ) {\n <h4 class=\"simple-toast-title\">{{ data.title }}</h4>\n <p class=\"simple-toast-message\">{{ data.message }}</p>\n } @else {\n <p class=\"simple-toast-message large-message\">{{ data.message }}</p>\n }\n </div>\n</div>", styles: [".simple-toast{display:flex;flex-direction:column;justify-content:center;position:relative;padding:1rem;border-radius:10px;box-shadow:0 2px 8px #00000026;border:1px solid var(--fm-border, #ccc)}.simple-toast.info{color:var(--simple-toast-info-accent);background-color:var(--simple-toast-info-bg);border:1px solid var(--simple-toast-info-
|
|
287
|
-
}]
|
|
355
|
+
args: [{ selector: 'app-simple-toast', standalone: true, imports: [CommonModule], template: "<div class=\"simple-toast\" [ngClass]=\"data.type\">\n <button class=\"simple-toast-close-button\" (click)=\"dismiss()\" aria-label=\"Close toast\" [ngClass]=\"data.type\">\n \u2715\n </button>\n\n <div class=\"simple-toast-content\">\n @if(data.title ) {\n <h4 class=\"simple-toast-title\">{{ data.title }}</h4>\n <p class=\"simple-toast-message\">{{ data.message }}</p>\n } @else {\n <p class=\"simple-toast-message large-message\">{{ data.message }}</p>\n }\n </div>\n\n @if (toast.config.durationInMs) {\n <div class=\"toast-progress-container\" [ngClass]=\"data.type\">\n <div class=\"toast-progress-bar\" [ngClass]=\"data.type\" #progressBar></div>\n </div>\n }\n</div>", styles: [".simple-toast{display:flex;flex-direction:column;justify-content:center;position:relative;padding:1rem;border-radius:10px;box-shadow:0 2px 8px #00000026;border:1px solid var(--fm-border, #ccc);overflow:hidden}.simple-toast.info{color:var(--simple-toast-info-accent);background-color:var(--simple-toast-info-bg);border:1px solid var(--simple-toast-info-border)}.simple-toast.success{color:var(--simple-toast-success-accent);background-color:var(--simple-toast-success-bg);border:1px solid var(--simple-toast-success-border)}.simple-toast.warn{color:var(--simple-toast-warn-accent);background-color:var(--simple-toast-warn-bg);border:1px solid var(--simple-toast-warn-border)}.simple-toast.error{color:var(--simple-toast-error-accent);background-color:var(--simple-toast-error-bg);border:1px solid var(--simple-toast-error-border)}.simple-toast-content{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex-grow:1;padding-right:1.5rem;font-family:inherit}.simple-toast-title{margin:0 0 .25rem;font-size:1rem;font-weight:600}.simple-toast-message{margin:0;font-size:.875rem;line-height:1.4}.simple-toast-message.large-message{font-size:1rem}.simple-toast-close-button{position:absolute;top:.5rem;right:.5rem;background:none;border:none;cursor:pointer;width:1.5rem;height:1.5rem;font-size:1rem;display:flex;align-items:center;justify-content:center;transition:color .2s}.simple-toast-close-button.info{color:var(--simple-toast-info-accent)}.simple-toast-close-button.success{color:var(--simple-toast-success-accent)}.simple-toast-close-button.warn{color:var(--simple-toast-warn-accent)}.simple-toast-close-button.error{color:var(--simple-toast-error-accent)}.toast-progress-container{position:absolute;bottom:0;left:0;width:100%;height:4px;pointer-events:none}.toast-progress-container.info{background-color:var(--simple-toast-info-border)}.toast-progress-container.success{background-color:var(--simple-toast-success-border)}.toast-progress-container.warn{background-color:var(--simple-toast-warn-border)}.toast-progress-container.error{background-color:var(--simple-toast-error-border)}.toast-progress-bar{height:100%;width:100%;opacity:.6;transform-origin:left}.toast-progress-bar.info{background-color:var(--simple-toast-info-accent)}.toast-progress-bar.success{background-color:var(--simple-toast-success-accent)}.toast-progress-bar.warn{background-color:var(--simple-toast-warn-accent)}.toast-progress-bar.error{background-color:var(--simple-toast-error-accent)}\n"] }]
|
|
356
|
+
}], propDecorators: { progressBar: [{
|
|
357
|
+
type: ViewChild,
|
|
358
|
+
args: ['progressBar']
|
|
359
|
+
}] } });
|
|
288
360
|
|
|
289
361
|
class ToastrService {
|
|
290
362
|
injector = inject(Injector);
|
|
@@ -295,6 +367,7 @@ class ToastrService {
|
|
|
295
367
|
toastQueue = [];
|
|
296
368
|
activeToasts = [];
|
|
297
369
|
containers = new Map();
|
|
370
|
+
activePauses = 0;
|
|
298
371
|
/**
|
|
299
372
|
* Displays a toast notification with the specified component and configuration.
|
|
300
373
|
* @param componentType
|
|
@@ -382,6 +455,9 @@ class ToastrService {
|
|
|
382
455
|
}
|
|
383
456
|
//#region Helper Methods
|
|
384
457
|
processQueue() {
|
|
458
|
+
if (this.activePauses > 0) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
385
461
|
const max = this.globalSettings.maxOpened();
|
|
386
462
|
while (this.activeToasts.length < max && this.toastQueue.length > 0) {
|
|
387
463
|
const buildNext = this.toastQueue.shift();
|
|
@@ -418,7 +494,30 @@ class ToastrService {
|
|
|
418
494
|
const container = this.getContainer(config.position || 'top-right');
|
|
419
495
|
container.appendChild(wrapperRef.location.nativeElement);
|
|
420
496
|
this.activeToasts.push(wrapperRef);
|
|
421
|
-
|
|
497
|
+
let isThisToastPausing = false;
|
|
498
|
+
toastRef.config = config;
|
|
499
|
+
toastRef.onPause$.subscribe(() => {
|
|
500
|
+
if (!isThisToastPausing) {
|
|
501
|
+
isThisToastPausing = true;
|
|
502
|
+
this.activePauses++;
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
toastRef.onResume$.subscribe(() => {
|
|
506
|
+
if (isThisToastPausing) {
|
|
507
|
+
isThisToastPausing = false;
|
|
508
|
+
this.activePauses = Math.max(0, this.activePauses - 1);
|
|
509
|
+
if (this.activePauses === 0) {
|
|
510
|
+
this.processQueue();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
toastRef.afterClosed$.pipe(take(1)).subscribe(() => {
|
|
515
|
+
if (isThisToastPausing) {
|
|
516
|
+
isThisToastPausing = false;
|
|
517
|
+
this.activePauses = Math.max(0, this.activePauses - 1);
|
|
518
|
+
}
|
|
519
|
+
this.finalizeToast(wrapperRef);
|
|
520
|
+
});
|
|
422
521
|
}
|
|
423
522
|
finalizeToast(wrapperRef) {
|
|
424
523
|
const index = this.activeToasts.indexOf(wrapperRef);
|
|
@@ -453,10 +552,10 @@ class ToastrService {
|
|
|
453
552
|
isIToast(component) {
|
|
454
553
|
return typeof component === 'object' && component !== null && 'toast' in component;
|
|
455
554
|
}
|
|
456
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
457
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
555
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastrService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
556
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastrService, providedIn: 'root' });
|
|
458
557
|
}
|
|
459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ToastrService, decorators: [{
|
|
460
559
|
type: Injectable,
|
|
461
560
|
args: [{
|
|
462
561
|
providedIn: 'root'
|
|
@@ -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/classes/toast.ts","../../../projects/toastr/src/lib/components/views/simple-toast/simple-toast.ts","../../../projects/toastr/src/lib/components/views/simple-toast/simple-toast.html","../../../projects/toastr/src/lib/services/toastr.service.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 public isCollapsing = signal(false);\n\n protected isAnimated = computed(() => this.config?.animate !== false);\n protected isBottom = computed(() => (this.config?.position ?? 'top-right').includes('bottom'));\n\n @ViewChild('dynamicContainer', { read: ViewContainerRef, static: true }) protected dynamicContainer!: ViewContainerRef;\n @ViewChild('toastSwipeTarget', { static: true }) protected toastSwipeTarget!: ElementRef;\n @ViewChild('animatorWrapper', { static: true }) protected animatorWrapper!: 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' + (this.config?.hasDefaultBackground === false ? ' no-bg' : '');\n return `${animClass} ${wrapperClass}`;\n });\n\n protected toastrTransform = 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(-150px)' : 'translateY(150px)';\n }\n\n if (this.currentTranslateY() !== 0) {\n return `translateY(${this.currentTranslateY()}px)`;\n }\n\n return null;\n });\n\n private originalCloseFn!: (result?: R) => void;\n private closeResult?: R;\n\n private isTrackingSwipe = false;\n private isTouchActive = false;\n private autoCloseTimeout?: ReturnType<typeof setTimeout>;\n private hasEmittedClose = false;\n\n private cleanupListeners: Array<() => void> = [];\n private swipeCleanupListeners: (() => void) | null = null;\n private globalResizeCleanup: (() => void) | null = null;\n\n public ngOnInit(): void {\n this.dynamicContainer.insert(this.componentRef.hostView);\n\n this.originalCloseFn = this.toastRef.close.bind(this.toastRef);\n this.toastRef.close = (result?: R) => {\n this.closeToast(result);\n };\n\n setTimeout(() => this.isVisible.set(true), 10);\n\n if (this.config?.swipeToDismiss !== false) {\n this.startVerticalSwipeDetection();\n this.monitorInputType();\n }\n\n if (this.config?.durationInMs) {\n this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.config.durationInMs);\n }\n\n const animatorTarget = this.animatorWrapper.nativeElement;\n\n const onAnimatorTransitionEnd = (event: TransitionEvent) => {\n if (event.target !== animatorTarget || event.propertyName !== 'grid-template-rows') return;\n if (this.isCollapsing() && !this.hasEmittedClose) {\n this.hasEmittedClose = true;\n this.originalCloseFn(this.closeResult);\n }\n };\n\n animatorTarget.addEventListener('transitionend', onAnimatorTransitionEnd);\n this.cleanupListeners.push(() => animatorTarget.removeEventListener('transitionend', onAnimatorTransitionEnd));\n }\n\n public ngOnDestroy(): void {\n clearTimeout(this.autoCloseTimeout);\n\n this.stopVerticalSwipeDetection();\n this.globalResizeCleanup?.();\n\n this.cleanupListeners.forEach((fn) => fn());\n this.cleanupListeners = [];\n }\n\n public closeToast(result?: R, fromSwipe = false): void {\n this.closeResult = result !== undefined ? result : this.closeResult;\n\n if (!this.isAnimated()) {\n if (!this.hasEmittedClose) {\n this.hasEmittedClose = true;\n this.originalCloseFn(this.closeResult);\n }\n return;\n }\n\n this.isVisible.set(false);\n this.isCollapsing.set(true);\n\n if (fromSwipe) {\n this.isSwipingFinished.set(true);\n }\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(undefined, true);\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.swipeCleanupListeners = () => {\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 if (!this.isTrackingSwipe) return;\n\n this.isTrackingSwipe = false;\n\n if (this.swipeCleanupListeners) {\n this.swipeCleanupListeners();\n this.swipeCleanupListeners = null;\n }\n }\n\n private monitorInputType(): void {\n if (this.globalResizeCleanup) return;\n\n const handler = (event: PointerEvent) => {\n const isTouch = event.pointerType === 'touch';\n\n if (isTouch && !this.isTouchActive) {\n this.isTouchActive = true;\n this.startVerticalSwipeDetection();\n } else if (!isTouch && this.isTouchActive) {\n this.isTouchActive = false;\n this.stopVerticalSwipeDetection();\n }\n };\n\n window.addEventListener('pointerdown', handler);\n this.globalResizeCleanup = () => window.removeEventListener('pointerdown', handler);\n }\n\n //#endregion\n}\n","<div #animatorWrapper class=\"toast-animator\" [class.collapsing]=\"isCollapsing()\" [class.is-bottom]=\"isBottom()\">\n <div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"toastrTransform()\">\n <ng-container #dynamicContainer></ng-container>\n </div>\n</div>","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","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { Toast } from '../../../classes/toast';\nimport { ISimpleToastData } from '../../../interfaces/isimple-toast.interface';\n\n@Component({\n selector: 'app-simple-toast',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './simple-toast.html',\n styleUrl: './simple-toast.scss'\n})\nexport class SimpleToast extends Toast<ISimpleToastData, undefined> {\n protected dismiss(): void {\n this.toast?.close();\n }\n}\n","<div class=\"simple-toast\" [ngClass]=\"data.type\">\n <button class=\"simple-toast-close-button\" (click)=\"dismiss()\" aria-label=\"Close toast\" [ngClass]=\"data.type\">\n ✕\n </button>\n\n <div class=\"simple-toast-content\">\n @if(data.title ) {\n <h4 class=\"simple-toast-title\">{{ data.title }}</h4>\n <p class=\"simple-toast-message\">{{ data.message }}</p>\n } @else {\n <p class=\"simple-toast-message large-message\">{{ data.message }}</p>\n }\n </div>\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';\nimport { SimpleToast } from '../components/views/simple-toast/simple-toast';\nimport { ISimpleToastData } from '../interfaces/isimple-toast.interface';\nimport { IQueueSimpleToastRequest } from '../interfaces/iqueue-simple-toast-request.interface';\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 /**\n * Queues a simple success toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueSuccess(request: IQueueSimpleToastRequest): ToastRef<undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'success'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n /**\n * Queues a simple info toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueInfo(request: IQueueSimpleToastRequest): ToastRef<undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'info'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n /**\n * Queues a simple warning toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueWarning(request: IQueueSimpleToastRequest): ToastRef<undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'warn'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n /**\n * Queues a simple error toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueError(request: IQueueSimpleToastRequest): ToastRef<undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'error'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n //#region Helper Methods\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 //#endregion\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';\nexport * from './lib/components/views/simple-toast/simple-toast';\n\nexport * from './lib/interfaces/itoast-config.interface';\nexport * from './lib/interfaces/itoast.interface';\nexport * from './lib/interfaces/isimple-toast.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,QAAA,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACpC;AACD;;ACRD;MACa,UAAU,GAAG,IAAI,cAAc,CAAM,YAAY;;MCGjD,2BAA2B,CAAA;AACtB,IAAA,QAAQ,GAAG,MAAM,CAAgB,WAAW,oDAAC;AAC7C,IAAA,OAAO,GAAG,MAAM,CAAU,IAAI,mDAAC;AAC/B,IAAA,YAAY,GAAG,MAAM,CAAqB,SAAS,wDAAC;AACpD,IAAA,YAAY,GAAG,MAAM,CAAS,IAAI,wDAAC;AACnC,IAAA,cAAc,GAAG,MAAM,CAAU,IAAI,0DAAC;AACtC,IAAA,SAAS,GAAG,MAAM,CAAS,CAAC,qDAAC;AAE7C;;;AAGG;AACI,IAAA,MAAM,CACX,QAOE,EAAA;AAEF,QAAA,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACzE,QAAA,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OA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AM,EAAE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YACzD,YAAY,EAAE,MAAM,EAAE,YAAY,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE;YACxE,YAAY,EAAE,MAAM,EAAE,YAAY,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE;YACxE,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,cAAc;SAC7E;IACH;AAEQ,IAAA,QAAQ,CAA+B,SAAkB,EAAA;AAC/D,QAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,IAAI,SAAS;IACpF;uGAtMW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,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;;;ACjBD;;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/classes/toast.ts","../../../projects/toastr/src/lib/components/views/simple-toast/simple-toast.ts","../../../projects/toastr/src/lib/components/views/simple-toast/simple-toast.html","../../../projects/toastr/src/lib/services/toastr.service.ts","../../../projects/toastr/src/public-api.ts","../../../projects/toastr/src/filip.mazev-toastr.ts"],"sourcesContent":["import { Subject } from 'rxjs';\nimport { IToastConfig } from '../interfaces/itoast-config.interface';\n\nexport class ToastRef<D = undefined, R = unknown> {\n private readonly afterClosedSubject = new Subject<R | undefined>();\n\n private readonly pauseSubject = new Subject<void>();\n private readonly resumeSubject = new Subject<void>();\n\n public readonly afterClosed$ = this.afterClosedSubject.asObservable();\n public readonly onPause$ = this.pauseSubject.asObservable();\n public readonly onResume$ = this.resumeSubject.asObservable();\n public config!: IToastConfig<D>;\n\n public close(result?: R): void {\n this.afterClosedSubject.next(result);\n this.afterClosedSubject.complete();\n }\n\n public pause(): void {\n this.pauseSubject.next();\n }\n\n public resume(): void {\n this.resumeSubject.next();\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 {\n Component,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n ElementRef,\n OnInit,\n OnDestroy,\n signal,\n computed,\n AfterViewInit,\n HostListener\n} 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, AfterViewInit, OnDestroy {\n public componentRef!: ComponentRef<C>;\n public config?: IToastConfig<D>;\n public toastRef!: ToastRef<D, R>;\n\n public isVisible = signal(false);\n public currentTranslateY = signal(0);\n public isSwipingFinished = signal(false);\n\n public isCollapsing = signal(false);\n\n protected isAnimated = computed(() => this.config?.animate !== false);\n protected isBottom = computed(() => (this.config?.position ?? 'top-right').includes('bottom'));\n\n @ViewChild('dynamicContainer', { read: ViewContainerRef, static: true }) protected dynamicContainer!: ViewContainerRef;\n @ViewChild('toastSwipeTarget', { static: true }) protected toastSwipeTarget!: ElementRef;\n @ViewChild('animatorWrapper', { static: true }) protected animatorWrapper!: ElementRef;\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' + (this.config?.hasDefaultBackground === false ? ' no-bg' : '');\n return `${animClass} ${wrapperClass}`;\n });\n\n protected toastrTransform = 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(-150px)' : 'translateY(150px)';\n }\n\n if (this.currentTranslateY() !== 0) {\n return `translateY(${this.currentTranslateY()}px)`;\n }\n\n return null;\n });\n\n private progressAnimation?: Animation;\n\n private remainingMs = 0;\n\n private timerStartTime = 0;\n\n private originalCloseFn!: (result?: R) => void;\n private closeResult?: R;\n\n private isTrackingSwipe = false;\n private isTouchActive = false;\n private autoCloseTimeout?: ReturnType<typeof setTimeout>;\n private hasEmittedClose = false;\n\n private cleanupListeners: Array<() => void> = [];\n private swipeCleanupListeners: (() => void) | null = null;\n private globalResizeCleanup: (() => void) | null = null;\n\n public ngOnInit(): void {\n this.dynamicContainer.insert(this.componentRef.hostView);\n\n this.originalCloseFn = this.toastRef.close.bind(this.toastRef);\n this.toastRef.close = (result?: R) => {\n this.closeToast(result);\n };\n\n setTimeout(() => this.isVisible.set(true), 10);\n\n if (this.config?.swipeToDismiss !== false) {\n this.startVerticalSwipeDetection();\n this.monitorInputType();\n }\n\n const animatorTarget = this.animatorWrapper.nativeElement;\n\n const onAnimatorTransitionEnd = (event: TransitionEvent) => {\n if (event.target !== animatorTarget || event.propertyName !== 'grid-template-rows') return;\n if (this.isCollapsing() && !this.hasEmittedClose) {\n this.hasEmittedClose = true;\n this.originalCloseFn(this.closeResult);\n }\n };\n\n animatorTarget.addEventListener('transitionend', onAnimatorTransitionEnd);\n this.cleanupListeners.push(() => animatorTarget.removeEventListener('transitionend', onAnimatorTransitionEnd));\n }\n\n public ngAfterViewInit(): void {\n if (this.config?.durationInMs) {\n this.remainingMs = this.config.durationInMs;\n this.startTimer();\n }\n }\n\n public ngOnDestroy(): void {\n clearTimeout(this.autoCloseTimeout);\n\n this.stopVerticalSwipeDetection();\n this.globalResizeCleanup?.();\n\n this.cleanupListeners.forEach((fn) => fn());\n this.cleanupListeners = [];\n\n this.progressAnimation?.cancel();\n }\n\n public closeToast(result?: R, fromSwipe = false): void {\n this.closeResult = result !== undefined ? result : this.closeResult;\n\n if (!this.isAnimated()) {\n if (!this.hasEmittedClose) {\n this.hasEmittedClose = true;\n this.originalCloseFn(this.closeResult);\n }\n return;\n }\n\n this.isVisible.set(false);\n this.isCollapsing.set(true);\n\n if (fromSwipe) {\n this.isSwipingFinished.set(true);\n }\n }\n\n @HostListener('mouseenter')\n protected onMouseEnter(): void {\n if (!this.isTouchActive && this.config?.durationInMs && !this.isCollapsing()) {\n this.pauseTimer();\n }\n }\n\n @HostListener('mouseleave')\n protected onMouseLeave(): void {\n if (!this.isTouchActive && this.config?.durationInMs && !this.isCollapsing()) {\n this.startTimer();\n this.toastRef.resume();\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(undefined, true);\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.swipeCleanupListeners = () => {\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 if (!this.isTrackingSwipe) return;\n\n this.isTrackingSwipe = false;\n\n if (this.swipeCleanupListeners) {\n this.swipeCleanupListeners();\n this.swipeCleanupListeners = null;\n }\n }\n\n private monitorInputType(): void {\n if (this.globalResizeCleanup) return;\n\n const handler = (event: PointerEvent) => {\n const isTouch = event.pointerType === 'touch';\n\n if (isTouch && !this.isTouchActive) {\n this.isTouchActive = true;\n this.startVerticalSwipeDetection();\n } else if (!isTouch && this.isTouchActive) {\n this.isTouchActive = false;\n this.stopVerticalSwipeDetection();\n }\n };\n\n window.addEventListener('pointerdown', handler);\n this.globalResizeCleanup = () => window.removeEventListener('pointerdown', handler);\n }\n\n //#endregion\n\n //#region Timer Logic\n\n private startTimer(): void {\n if (this.remainingMs <= 0) return;\n\n this.timerStartTime = Date.now();\n this.autoCloseTimeout = setTimeout(() => this.closeToast(), this.remainingMs);\n }\n\n private pauseTimer(): void {\n if (!this.autoCloseTimeout) return;\n\n clearTimeout(this.autoCloseTimeout);\n this.autoCloseTimeout = undefined;\n\n const elapsed = Date.now() - this.timerStartTime;\n this.remainingMs -= elapsed;\n\n this.toastRef.pause();\n }\n\n //#endregion\n}\n","<div #animatorWrapper class=\"toast-animator\" [class.collapsing]=\"isCollapsing()\" [class.is-bottom]=\"isBottom()\">\n <div #toastSwipeTarget class=\"toast-wrapper\" [ngClass]=\"wrapperClasses()\" [class.show]=\"isVisible()\"\n [class.no-animate]=\"!isAnimated()\" [style.transform]=\"toastrTransform()\">\n <ng-container #dynamicContainer></ng-container>\n </div>\n</div>","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<D, 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","import { CommonModule } from '@angular/common';\nimport { Component, ViewChild, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { Toast } from '../../../classes/toast';\nimport { ISimpleToastData } from '../../../interfaces/isimple-toast.interface';\n\n@Component({\n selector: 'app-simple-toast',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './simple-toast.html',\n styleUrl: './simple-toast.scss'\n})\nexport class SimpleToast extends Toast<ISimpleToastData, undefined> implements AfterViewInit, OnDestroy {\n @ViewChild('progressBar') protected progressBar?: ElementRef<HTMLElement>;\n\n private progressAnimation?: Animation;\n private subs = new Subscription();\n\n public ngAfterViewInit(): void {\n const duration = this.toast?.config?.durationInMs;\n\n if (duration && this.progressBar?.nativeElement) {\n this.progressAnimation = this.progressBar.nativeElement.animate([{ width: '100%' }, { width: '0%' }], { duration, fill: 'forwards' });\n\n if (this.toast) {\n this.subs.add(this.toast.onPause$.subscribe(() => this.progressAnimation?.pause()));\n this.subs.add(this.toast.onResume$.subscribe(() => this.progressAnimation?.play()));\n }\n }\n }\n\n public ngOnDestroy(): void {\n this.progressAnimation?.cancel();\n this.subs.unsubscribe();\n }\n\n protected dismiss(): void {\n this.toast?.close();\n }\n}\n","<div class=\"simple-toast\" [ngClass]=\"data.type\">\n <button class=\"simple-toast-close-button\" (click)=\"dismiss()\" aria-label=\"Close toast\" [ngClass]=\"data.type\">\n ✕\n </button>\n\n <div class=\"simple-toast-content\">\n @if(data.title ) {\n <h4 class=\"simple-toast-title\">{{ data.title }}</h4>\n <p class=\"simple-toast-message\">{{ data.message }}</p>\n } @else {\n <p class=\"simple-toast-message large-message\">{{ data.message }}</p>\n }\n </div>\n\n @if (toast.config.durationInMs) {\n <div class=\"toast-progress-container\" [ngClass]=\"data.type\">\n <div class=\"toast-progress-bar\" [ngClass]=\"data.type\" #progressBar></div>\n </div>\n }\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';\nimport { SimpleToast } from '../components/views/simple-toast/simple-toast';\nimport { ISimpleToastData } from '../interfaces/isimple-toast.interface';\nimport { IQueueSimpleToastRequest } from '../interfaces/iqueue-simple-toast-request.interface';\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 private activePauses = 0;\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<D, R> {\n const resolvedConfig = this.resolveConfig(config);\n const toastRef = new ToastRef<D, R>();\n\n this.toastQueue.push(() => this.buildAndAttachToast(componentType, resolvedConfig, toastRef));\n\n this.processQueue();\n\n return toastRef;\n }\n\n /**\n * Queues a simple success toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueSuccess(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'success'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n /**\n * Queues a simple info toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueInfo(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'info'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n /**\n * Queues a simple warning toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueWarning(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'warn'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n /**\n * Queues a simple error toast notification with the specified message and optional title, position, and duration.\n * @param request An object containing the message, optional title, optional position, and duration for the toast notification.\n * @returns A ToastRef instance representing the queued toast.\n */\n public queueError(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined> {\n return this.queueToast<ISimpleToastData, undefined, SimpleToast>(SimpleToast, {\n position: request.position ?? this.globalSettings.position(),\n data: {\n title: request.title,\n message: request.message,\n type: 'error'\n },\n hasDefaultBackground: false,\n durationInMs: request.durationInMs ?? this.globalSettings.durationInMs(),\n animate: this.globalSettings.animate()\n });\n }\n\n //#region Helper Methods\n\n private processQueue(): void {\n if (this.activePauses > 0) {\n return;\n }\n\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<D, 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 let isThisToastPausing = false;\n\n toastRef.config = config;\n\n toastRef.onPause$.subscribe(() => {\n if (!isThisToastPausing) {\n isThisToastPausing = true;\n this.activePauses++;\n }\n });\n\n toastRef.onResume$.subscribe(() => {\n if (isThisToastPausing) {\n isThisToastPausing = false;\n this.activePauses = Math.max(0, this.activePauses - 1);\n\n if (this.activePauses === 0) {\n this.processQueue();\n }\n }\n });\n\n toastRef.afterClosed$.pipe(take(1)).subscribe(() => {\n if (isThisToastPausing) {\n isThisToastPausing = false;\n this.activePauses = Math.max(0, this.activePauses - 1);\n }\n\n this.finalizeToast(wrapperRef);\n });\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 //#endregion\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';\nexport * from './lib/components/views/simple-toast/simple-toast';\n\nexport * from './lib/interfaces/itoast-config.interface';\nexport * from './lib/interfaces/itoast.interface';\nexport * from './lib/interfaces/isimple-toast.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":";;;;;;MAGa,QAAQ,CAAA;AACF,IAAA,kBAAkB,GAAG,IAAI,OAAO,EAAiB;AAEjD,IAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;AAClC,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AAEpC,IAAA,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;AACrD,IAAA,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;AAC3C,IAAA,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE;AACtD,IAAA,MAAM;AAEN,IAAA,KAAK,CAAC,MAAU,EAAA;AACrB,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;AACpC,QAAA,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACpC;IAEO,KAAK,GAAA;AACV,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IAC1B;IAEO,MAAM,GAAA;AACX,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;IAC3B;AACD;;ACxBD;MACa,UAAU,GAAG,IAAI,cAAc,CAAM,YAAY;;MCGjD,2BAA2B,CAAA;AACtB,IAAA,QAAQ,GAAG,MAAM,CAAgB,WAAW,+EAAC;AAC7C,IAAA,OAAO,GAAG,MAAM,CAAU,IAAI,8EAAC;AAC/B,IAAA,YAAY,GAAG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AAE;YAC5D,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YACzD,YAAY,EAAE,MAAM,EAAE,YAAY,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE;YACxE,YAAY,EAAE,MAAM,EAAE,YAAY,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE;YACxE,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,cAAc;SAC7E;IACH;AAEQ,IAAA,QAAQ,CAA+B,SAAkB,EAAA;AAC/D,QAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,IAAI,SAAS;IACpF;uGAzOW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,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;;;ACjBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -12,20 +12,36 @@
|
|
|
12
12
|
$fallback-toast-warn-bg: map.get($default-light-theme-config, 'toast-warn-bg');
|
|
13
13
|
$fallback-toast-error-bg: map.get($default-light-theme-config, 'toast-error-bg');
|
|
14
14
|
|
|
15
|
+
$fallback-toast-info-border: map.get($default-light-theme-config, 'toast-info-border');
|
|
16
|
+
$fallback-toast-success-border: map.get($default-light-theme-config, 'toast-success-border');
|
|
17
|
+
$fallback-toast-warn-border: map.get($default-light-theme-config, 'toast-warn-border');
|
|
18
|
+
$fallback-toast-error-border: map.get($default-light-theme-config, 'toast-error-border');
|
|
19
|
+
|
|
15
20
|
$fallback-toast-info-accent: map.get($default-light-theme-config, 'toast-info-accent');
|
|
16
21
|
$fallback-toast-success-accent: map.get($default-light-theme-config, 'toast-success-accent');
|
|
17
22
|
$fallback-toast-warn-accent: map.get($default-light-theme-config, 'toast-warn-accent');
|
|
18
23
|
$fallback-toast-error-accent: map.get($default-light-theme-config, 'toast-error-accent');
|
|
19
24
|
|
|
25
|
+
$fallback-border: map.get($default-light-theme-config, 'border');
|
|
26
|
+
$fallback-element: map.get($default-light-theme-config, 'element');
|
|
27
|
+
|
|
20
28
|
--toast-bg: var(--fm-surface, #{$fallback-bg});
|
|
21
29
|
--toast-text: var(--fm-text-primary, #{$fallback-text});
|
|
22
30
|
--toast-text-warn: var(--fm-text-warn, #{$fallback-text-warn});
|
|
23
31
|
|
|
32
|
+
--simple-toast-bg: var(--fm-element, #{$fallback-element});
|
|
33
|
+
--simple-toast-border: var(--fm-border, #{$fallback-border});
|
|
34
|
+
|
|
24
35
|
--simple-toast-info-bg: var(--fm-toast-info-bg, #{$fallback-toast-info-bg});
|
|
25
36
|
--simple-toast-success-bg: var(--fm-toast-success-bg, #{$fallback-toast-success-bg});
|
|
26
37
|
--simple-toast-warn-bg: var(--fm-toast-warn-bg, #{$fallback-toast-warn-bg});
|
|
27
38
|
--simple-toast-error-bg: var(--fm-toast-error-bg, #{$fallback-toast-error-bg});
|
|
28
39
|
|
|
40
|
+
--simple-toast-info-border: var(--fm-toast-info-border, #{$fallback-toast-info-border});
|
|
41
|
+
--simple-toast-success-border: var(--fm-toast-success-border, #{$fallback-toast-success-border});
|
|
42
|
+
--simple-toast-warn-border: var(--fm-toast-warn-border, #{$fallback-toast-warn-border});
|
|
43
|
+
--simple-toast-error-border: var(--fm-toast-error-border, #{$fallback-toast-error-border});
|
|
44
|
+
|
|
29
45
|
--simple-toast-info-accent: var(--fm-toast-info-accent, #{$fallback-toast-info-accent});
|
|
30
46
|
--simple-toast-success-accent: var(--fm-toast-success-accent, #{$fallback-toast-success-accent});
|
|
31
47
|
--simple-toast-warn-accent: var(--fm-toast-warn-accent, #{$fallback-toast-warn-accent});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filip.mazev/toastr",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./_toastr-theme": "./lib/styles/_toastr-theme.scss",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@angular/common": "^21.1.1",
|
|
20
20
|
"@angular/core": "^21.1.1",
|
|
21
|
-
"@filip.mazev/blocks-core": "^1.0.
|
|
21
|
+
"@filip.mazev/blocks-core": "^1.0.13"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"tslib": "^2.3.0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as rxjs from 'rxjs';
|
|
2
2
|
import { ComponentType } from '@angular/cdk/portal';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import { OnInit, OnDestroy, ComponentRef, ViewContainerRef, ElementRef, InjectionToken } from '@angular/core';
|
|
4
|
+
import { OnInit, AfterViewInit, OnDestroy, ComponentRef, ViewContainerRef, ElementRef, InjectionToken } from '@angular/core';
|
|
5
5
|
|
|
6
6
|
type ToastPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
|
|
7
7
|
type SimpleToastType = 'info' | 'success' | 'warn' | 'error';
|
|
@@ -16,18 +16,31 @@ interface IToastConfig<D = unknown> {
|
|
|
16
16
|
animate?: boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
declare class ToastRef<R = unknown> {
|
|
19
|
+
declare class ToastRef<D = undefined, R = unknown> {
|
|
20
20
|
private readonly afterClosedSubject;
|
|
21
|
+
private readonly pauseSubject;
|
|
22
|
+
private readonly resumeSubject;
|
|
21
23
|
readonly afterClosed$: rxjs.Observable<R | undefined>;
|
|
24
|
+
readonly onPause$: rxjs.Observable<void>;
|
|
25
|
+
readonly onResume$: rxjs.Observable<void>;
|
|
26
|
+
config: IToastConfig<D>;
|
|
22
27
|
close(result?: R): void;
|
|
28
|
+
pause(): void;
|
|
29
|
+
resume(): void;
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
interface IToast<D, R> {
|
|
26
33
|
data: D;
|
|
27
|
-
toast: ToastRef<R>;
|
|
34
|
+
toast: ToastRef<D, R>;
|
|
28
35
|
onToastInit?(): void;
|
|
29
36
|
}
|
|
30
37
|
|
|
38
|
+
interface ISimpleToastData {
|
|
39
|
+
title?: string;
|
|
40
|
+
message: string;
|
|
41
|
+
type: SimpleToastType;
|
|
42
|
+
}
|
|
43
|
+
|
|
31
44
|
interface IQueueSimpleToastRequest {
|
|
32
45
|
message: string;
|
|
33
46
|
title?: string;
|
|
@@ -44,37 +57,38 @@ declare class ToastrService {
|
|
|
44
57
|
private readonly toastQueue;
|
|
45
58
|
private readonly activeToasts;
|
|
46
59
|
private readonly containers;
|
|
60
|
+
private activePauses;
|
|
47
61
|
/**
|
|
48
62
|
* Displays a toast notification with the specified component and configuration.
|
|
49
63
|
* @param componentType
|
|
50
64
|
* @param config
|
|
51
65
|
* @returns
|
|
52
66
|
*/
|
|
53
|
-
queueToast<D, R, C extends IToast<D, R>>(componentType: ComponentType<C>, config?: IToastConfig<D>): ToastRef<R>;
|
|
67
|
+
queueToast<D, R, C extends IToast<D, R>>(componentType: ComponentType<C>, config?: IToastConfig<D>): ToastRef<D, R>;
|
|
54
68
|
/**
|
|
55
69
|
* Queues a simple success toast notification with the specified message and optional title, position, and duration.
|
|
56
70
|
* @param request An object containing the message, optional title, optional position, and duration for the toast notification.
|
|
57
71
|
* @returns A ToastRef instance representing the queued toast.
|
|
58
72
|
*/
|
|
59
|
-
queueSuccess(request: IQueueSimpleToastRequest): ToastRef<undefined>;
|
|
73
|
+
queueSuccess(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined>;
|
|
60
74
|
/**
|
|
61
75
|
* Queues a simple info toast notification with the specified message and optional title, position, and duration.
|
|
62
76
|
* @param request An object containing the message, optional title, optional position, and duration for the toast notification.
|
|
63
77
|
* @returns A ToastRef instance representing the queued toast.
|
|
64
78
|
*/
|
|
65
|
-
queueInfo(request: IQueueSimpleToastRequest): ToastRef<undefined>;
|
|
79
|
+
queueInfo(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined>;
|
|
66
80
|
/**
|
|
67
81
|
* Queues a simple warning toast notification with the specified message and optional title, position, and duration.
|
|
68
82
|
* @param request An object containing the message, optional title, optional position, and duration for the toast notification.
|
|
69
83
|
* @returns A ToastRef instance representing the queued toast.
|
|
70
84
|
*/
|
|
71
|
-
queueWarning(request: IQueueSimpleToastRequest): ToastRef<undefined>;
|
|
85
|
+
queueWarning(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined>;
|
|
72
86
|
/**
|
|
73
87
|
* Queues a simple error toast notification with the specified message and optional title, position, and duration.
|
|
74
88
|
* @param request An object containing the message, optional title, optional position, and duration for the toast notification.
|
|
75
89
|
* @returns A ToastRef instance representing the queued toast.
|
|
76
90
|
*/
|
|
77
|
-
queueError(request: IQueueSimpleToastRequest): ToastRef<undefined>;
|
|
91
|
+
queueError(request: IQueueSimpleToastRequest): ToastRef<ISimpleToastData, undefined>;
|
|
78
92
|
private processQueue;
|
|
79
93
|
private buildAndAttachToast;
|
|
80
94
|
private finalizeToast;
|
|
@@ -108,10 +122,10 @@ declare class ToastrGlobalSettingsService {
|
|
|
108
122
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToastrGlobalSettingsService>;
|
|
109
123
|
}
|
|
110
124
|
|
|
111
|
-
declare class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements OnInit, OnDestroy {
|
|
125
|
+
declare class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements OnInit, AfterViewInit, OnDestroy {
|
|
112
126
|
componentRef: ComponentRef<C>;
|
|
113
127
|
config?: IToastConfig<D>;
|
|
114
|
-
toastRef: ToastRef<R>;
|
|
128
|
+
toastRef: ToastRef<D, R>;
|
|
115
129
|
isVisible: _angular_core.WritableSignal<boolean>;
|
|
116
130
|
currentTranslateY: _angular_core.WritableSignal<number>;
|
|
117
131
|
isSwipingFinished: _angular_core.WritableSignal<boolean>;
|
|
@@ -123,6 +137,9 @@ declare class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements
|
|
|
123
137
|
protected animatorWrapper: ElementRef;
|
|
124
138
|
protected wrapperClasses: _angular_core.Signal<string>;
|
|
125
139
|
protected toastrTransform: _angular_core.Signal<string | null>;
|
|
140
|
+
private progressAnimation?;
|
|
141
|
+
private remainingMs;
|
|
142
|
+
private timerStartTime;
|
|
126
143
|
private originalCloseFn;
|
|
127
144
|
private closeResult?;
|
|
128
145
|
private isTrackingSwipe;
|
|
@@ -133,11 +150,16 @@ declare class ToastCore<D, R, C extends IToast<D, R> = IToast<D, R>> implements
|
|
|
133
150
|
private swipeCleanupListeners;
|
|
134
151
|
private globalResizeCleanup;
|
|
135
152
|
ngOnInit(): void;
|
|
153
|
+
ngAfterViewInit(): void;
|
|
136
154
|
ngOnDestroy(): void;
|
|
137
155
|
closeToast(result?: R, fromSwipe?: boolean): void;
|
|
156
|
+
protected onMouseEnter(): void;
|
|
157
|
+
protected onMouseLeave(): void;
|
|
138
158
|
private startVerticalSwipeDetection;
|
|
139
159
|
private stopVerticalSwipeDetection;
|
|
140
160
|
private monitorInputType;
|
|
161
|
+
private startTimer;
|
|
162
|
+
private pauseTimer;
|
|
141
163
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastCore<any, any, any>, never>;
|
|
142
164
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToastCore<any, any, any>, "app-toast-core", never, {}, {}, never, never, true, never>;
|
|
143
165
|
}
|
|
@@ -150,7 +172,7 @@ declare abstract class Toast<D = unknown, R = unknown> implements IToast<D, R> {
|
|
|
150
172
|
/**
|
|
151
173
|
* Reference to the ToastRef instance associated with this toast.
|
|
152
174
|
*/
|
|
153
|
-
toast: ToastRef<R>;
|
|
175
|
+
toast: ToastRef<D, R>;
|
|
154
176
|
/**
|
|
155
177
|
* Called when the toast is initialized.
|
|
156
178
|
*/
|
|
@@ -164,13 +186,12 @@ declare abstract class Toast<D = unknown, R = unknown> implements IToast<D, R> {
|
|
|
164
186
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<Toast<any, any>>;
|
|
165
187
|
}
|
|
166
188
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
declare class SimpleToast extends Toast<ISimpleToastData, undefined> {
|
|
189
|
+
declare class SimpleToast extends Toast<ISimpleToastData, undefined> implements AfterViewInit, OnDestroy {
|
|
190
|
+
protected progressBar?: ElementRef<HTMLElement>;
|
|
191
|
+
private progressAnimation?;
|
|
192
|
+
private subs;
|
|
193
|
+
ngAfterViewInit(): void;
|
|
194
|
+
ngOnDestroy(): void;
|
|
174
195
|
protected dismiss(): void;
|
|
175
196
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SimpleToast, never>;
|
|
176
197
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SimpleToast, "app-simple-toast", never, {}, {}, never, never, true, never>;
|