ngx-toastr 14.1.1 → 14.2.0

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.
Files changed (40) hide show
  1. package/{esm2015/ngx-toastr.js → esm2020/ngx-toastr.mjs} +0 -0
  2. package/esm2020/overlay/overlay-container.mjs +46 -0
  3. package/{esm2015/overlay/overlay-ref.js → esm2020/overlay/overlay-ref.mjs} +0 -0
  4. package/{esm2015/overlay/overlay.js → esm2020/overlay/overlay.mjs} +11 -14
  5. package/{esm2015/portal/dom-portal-host.js → esm2020/portal/dom-portal-host.mjs} +0 -0
  6. package/{esm2015/portal/portal.js → esm2020/portal/portal.mjs} +0 -0
  7. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  8. package/{esm2015/toastr/toast-injector.js → esm2020/toastr/toast-injector.mjs} +0 -0
  9. package/esm2020/toastr/toast-noanimation.component.mjs +237 -0
  10. package/esm2020/toastr/toast.component.mjs +251 -0
  11. package/esm2020/toastr/toast.directive.mjs +32 -0
  12. package/esm2020/toastr/toastr-config.mjs +72 -0
  13. package/esm2020/toastr/toastr.module.mjs +63 -0
  14. package/esm2020/toastr/toastr.service.mjs +197 -0
  15. package/fesm2015/{ngx-toastr.js → ngx-toastr.mjs} +339 -262
  16. package/fesm2015/ngx-toastr.mjs.map +1 -0
  17. package/fesm2020/ngx-toastr.mjs +1170 -0
  18. package/fesm2020/ngx-toastr.mjs.map +1 -0
  19. package/ngx-toastr.d.ts +1 -0
  20. package/overlay/overlay-container.d.ts +3 -0
  21. package/overlay/overlay.d.ts +3 -0
  22. package/package.json +20 -8
  23. package/toastr/toast-noanimation.component.d.ts +7 -0
  24. package/toastr/toast.component.d.ts +3 -0
  25. package/toastr/toast.directive.d.ts +6 -0
  26. package/toastr/toastr-config.d.ts +5 -0
  27. package/toastr/toastr.module.d.ts +9 -0
  28. package/toastr/toastr.service.d.ts +3 -0
  29. package/toastr.css +4 -4
  30. package/bundles/ngx-toastr.umd.js +0 -1507
  31. package/bundles/ngx-toastr.umd.js.map +0 -1
  32. package/esm2015/overlay/overlay-container.js +0 -45
  33. package/esm2015/toastr/toast-noanimation.component.js +0 -204
  34. package/esm2015/toastr/toast.component.js +0 -216
  35. package/esm2015/toastr/toast.directive.js +0 -27
  36. package/esm2015/toastr/toastr-config.js +0 -71
  37. package/esm2015/toastr/toastr.module.js +0 -51
  38. package/esm2015/toastr/toastr.service.js +0 -196
  39. package/fesm2015/ngx-toastr.js.map +0 -1
  40. package/ngx-toastr.metadata.json +0 -1
@@ -1,11 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, ElementRef, NgModule, InjectionToken, Injectable, Inject, ComponentFactoryResolver, ApplicationRef, SecurityContext, Injector, NgZone, Component, HostBinding, HostListener } from '@angular/core';
2
+ import { Directive, NgModule, InjectionToken, Injectable, Inject, SecurityContext, Component, HostBinding, HostListener } from '@angular/core';
3
3
  import { trigger, state, style, transition, animate } from '@angular/animations';
4
4
  import { Subject } from 'rxjs';
5
- import * as i3 from '@angular/platform-browser';
6
- import { DomSanitizer } from '@angular/platform-browser';
7
- import * as i1 from '@angular/common';
5
+ import * as i3 from '@angular/common';
8
6
  import { DOCUMENT, CommonModule } from '@angular/common';
7
+ import * as i2 from '@angular/platform-browser';
9
8
 
10
9
  class ToastContainerDirective {
11
10
  constructor(el) {
@@ -15,23 +14,84 @@ class ToastContainerDirective {
15
14
  return this.el.nativeElement;
16
15
  }
17
16
  }
18
- ToastContainerDirective.decorators = [
19
- { type: Directive, args: [{
20
- selector: '[toastContainer]',
21
- exportAs: 'toastContainer',
22
- },] }
23
- ];
24
- ToastContainerDirective.ctorParameters = () => [
25
- { type: ElementRef }
26
- ];
17
+ ToastContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastContainerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
18
+ ToastContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: ToastContainerDirective, selector: "[toastContainer]", exportAs: ["toastContainer"], ngImport: i0 });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastContainerDirective, decorators: [{
20
+ type: Directive,
21
+ args: [{
22
+ selector: '[toastContainer]',
23
+ exportAs: 'toastContainer',
24
+ }]
25
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
27
26
  class ToastContainerModule {
28
27
  }
29
- ToastContainerModule.decorators = [
30
- { type: NgModule, args: [{
31
- declarations: [ToastContainerDirective],
32
- exports: [ToastContainerDirective],
33
- },] }
34
- ];
28
+ ToastContainerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
29
+ ToastContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastContainerModule, declarations: [ToastContainerDirective], exports: [ToastContainerDirective] });
30
+ ToastContainerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastContainerModule });
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastContainerModule, decorators: [{
32
+ type: NgModule,
33
+ args: [{
34
+ declarations: [ToastContainerDirective],
35
+ exports: [ToastContainerDirective],
36
+ }]
37
+ }] });
38
+
39
+ /**
40
+ * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
41
+ */
42
+ class ComponentPortal {
43
+ constructor(component, injector) {
44
+ this.component = component;
45
+ this.injector = injector;
46
+ }
47
+ /** Attach this portal to a host. */
48
+ attach(host, newestOnTop) {
49
+ this._attachedHost = host;
50
+ return host.attach(this, newestOnTop);
51
+ }
52
+ /** Detach this portal from its host */
53
+ detach() {
54
+ const host = this._attachedHost;
55
+ if (host) {
56
+ this._attachedHost = undefined;
57
+ return host.detach();
58
+ }
59
+ }
60
+ /** Whether this portal is attached to a host. */
61
+ get isAttached() {
62
+ return this._attachedHost != null;
63
+ }
64
+ /**
65
+ * Sets the PortalHost reference without performing `attach()`. This is used directly by
66
+ * the PortalHost when it is performing an `attach()` or `detach()`.
67
+ */
68
+ setAttachedHost(host) {
69
+ this._attachedHost = host;
70
+ }
71
+ }
72
+ /**
73
+ * Partial implementation of PortalHost that only deals with attaching a
74
+ * ComponentPortal
75
+ */
76
+ class BasePortalHost {
77
+ attach(portal, newestOnTop) {
78
+ this._attachedPortal = portal;
79
+ return this.attachComponentPortal(portal, newestOnTop);
80
+ }
81
+ detach() {
82
+ if (this._attachedPortal) {
83
+ this._attachedPortal.setAttachedHost();
84
+ }
85
+ this._attachedPortal = undefined;
86
+ if (this._disposeFn) {
87
+ this._disposeFn();
88
+ this._disposeFn = undefined;
89
+ }
90
+ }
91
+ setDisposeFn(fn) {
92
+ this._disposeFn = fn;
93
+ }
94
+ }
35
95
 
36
96
  /**
37
97
  * Everything a toast needs to launch
@@ -99,63 +159,91 @@ const DefaultNoComponentGlobalConfig = {
99
159
  tapToDismiss: true,
100
160
  onActivateTick: false,
101
161
  progressAnimation: 'decreasing',
162
+ payload: null
102
163
  };
103
164
  const TOAST_CONFIG = new InjectionToken('ToastConfig');
104
165
 
105
166
  /**
106
- * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
167
+ * Reference to a toast opened via the Toastr service.
107
168
  */
108
- class ComponentPortal {
109
- constructor(component, injector) {
110
- this.component = component;
111
- this.injector = injector;
169
+ class ToastRef {
170
+ constructor(_overlayRef) {
171
+ this._overlayRef = _overlayRef;
172
+ /** Count of duplicates of this toast */
173
+ this.duplicatesCount = 0;
174
+ /** Subject for notifying the user that the toast has finished closing. */
175
+ this._afterClosed = new Subject();
176
+ /** triggered when toast is activated */
177
+ this._activate = new Subject();
178
+ /** notifies the toast that it should close before the timeout */
179
+ this._manualClose = new Subject();
180
+ /** notifies the toast that it should reset the timeouts */
181
+ this._resetTimeout = new Subject();
182
+ /** notifies the toast that it should count a duplicate toast */
183
+ this._countDuplicate = new Subject();
112
184
  }
113
- /** Attach this portal to a host. */
114
- attach(host, newestOnTop) {
115
- this._attachedHost = host;
116
- return host.attach(this, newestOnTop);
185
+ manualClose() {
186
+ this._manualClose.next();
187
+ this._manualClose.complete();
117
188
  }
118
- /** Detach this portal from its host */
119
- detach() {
120
- const host = this._attachedHost;
121
- if (host) {
122
- this._attachedHost = undefined;
123
- return host.detach();
124
- }
189
+ manualClosed() {
190
+ return this._manualClose.asObservable();
125
191
  }
126
- /** Whether this portal is attached to a host. */
127
- get isAttached() {
128
- return this._attachedHost != null;
192
+ timeoutReset() {
193
+ return this._resetTimeout.asObservable();
194
+ }
195
+ countDuplicate() {
196
+ return this._countDuplicate.asObservable();
129
197
  }
130
198
  /**
131
- * Sets the PortalHost reference without performing `attach()`. This is used directly by
132
- * the PortalHost when it is performing an `attach()` or `detach()`.
199
+ * Close the toast.
133
200
  */
134
- setAttachedHost(host) {
135
- this._attachedHost = host;
201
+ close() {
202
+ this._overlayRef.detach();
203
+ this._afterClosed.next();
204
+ this._manualClose.next();
205
+ this._afterClosed.complete();
206
+ this._manualClose.complete();
207
+ this._activate.complete();
208
+ this._resetTimeout.complete();
209
+ this._countDuplicate.complete();
136
210
  }
137
- }
138
- /**
139
- * Partial implementation of PortalHost that only deals with attaching a
140
- * ComponentPortal
141
- */
142
- class BasePortalHost {
143
- attach(portal, newestOnTop) {
144
- this._attachedPortal = portal;
145
- return this.attachComponentPortal(portal, newestOnTop);
211
+ /** Gets an observable that is notified when the toast is finished closing. */
212
+ afterClosed() {
213
+ return this._afterClosed.asObservable();
146
214
  }
147
- detach() {
148
- if (this._attachedPortal) {
149
- this._attachedPortal.setAttachedHost();
215
+ isInactive() {
216
+ return this._activate.isStopped;
217
+ }
218
+ activate() {
219
+ this._activate.next();
220
+ this._activate.complete();
221
+ }
222
+ /** Gets an observable that is notified when the toast has started opening. */
223
+ afterActivate() {
224
+ return this._activate.asObservable();
225
+ }
226
+ /** Reset the toast timouts and count duplicates */
227
+ onDuplicate(resetTimeout, countDuplicate) {
228
+ if (resetTimeout) {
229
+ this._resetTimeout.next();
150
230
  }
151
- this._attachedPortal = undefined;
152
- if (this._disposeFn) {
153
- this._disposeFn();
154
- this._disposeFn = undefined;
231
+ if (countDuplicate) {
232
+ this._countDuplicate.next(++this.duplicatesCount);
155
233
  }
156
234
  }
157
- setDisposeFn(fn) {
158
- this._disposeFn = fn;
235
+ }
236
+ /** Custom injector type specifically for instantiating components with a toast. */
237
+ class ToastInjector {
238
+ constructor(_toastPackage, _parentInjector) {
239
+ this._toastPackage = _toastPackage;
240
+ this._parentInjector = _parentInjector;
241
+ }
242
+ get(token, notFoundValue, flags) {
243
+ if (token === ToastPackage) {
244
+ return this._toastPackage;
245
+ }
246
+ return this._parentInjector.get(token, notFoundValue, flags);
159
247
  }
160
248
  }
161
249
 
@@ -210,6 +298,26 @@ class DomPortalHost extends BasePortalHost {
210
298
  }
211
299
  }
212
300
 
301
+ /**
302
+ * Reference to an overlay that has been created with the Overlay service.
303
+ * Used to manipulate or dispose of said overlay.
304
+ */
305
+ class OverlayRef {
306
+ constructor(_portalHost) {
307
+ this._portalHost = _portalHost;
308
+ }
309
+ attach(portal, newestOnTop = true) {
310
+ return this._portalHost.attach(portal, newestOnTop);
311
+ }
312
+ /**
313
+ * Detaches an overlay from a portal.
314
+ * @returns Resolves when the overlay has been detached.
315
+ */
316
+ detach() {
317
+ return this._portalHost.detach();
318
+ }
319
+ }
320
+
213
321
  /** Container inside which all toasts will render. */
214
322
  class OverlayContainer {
215
323
  constructor(_document) {
@@ -243,33 +351,17 @@ class OverlayContainer {
243
351
  this._containerElement = container;
244
352
  }
245
353
  }
246
- OverlayContainer.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(i0.ɵɵinject(i1.DOCUMENT)); }, token: OverlayContainer, providedIn: "root" });
247
- OverlayContainer.decorators = [
248
- { type: Injectable, args: [{ providedIn: 'root' },] }
249
- ];
250
- OverlayContainer.ctorParameters = () => [
251
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
252
- ];
253
-
254
- /**
255
- * Reference to an overlay that has been created with the Overlay service.
256
- * Used to manipulate or dispose of said overlay.
257
- */
258
- class OverlayRef {
259
- constructor(_portalHost) {
260
- this._portalHost = _portalHost;
261
- }
262
- attach(portal, newestOnTop = true) {
263
- return this._portalHost.attach(portal, newestOnTop);
264
- }
265
- /**
266
- * Detaches an overlay from a portal.
267
- * @returns Resolves when the overlay has been detached.
268
- */
269
- detach() {
270
- return this._portalHost.detach();
271
- }
272
- }
354
+ OverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: OverlayContainer, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
355
+ OverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: OverlayContainer, providedIn: 'root' });
356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: OverlayContainer, decorators: [{
357
+ type: Injectable,
358
+ args: [{ providedIn: 'root' }]
359
+ }], ctorParameters: function () {
360
+ return [{ type: undefined, decorators: [{
361
+ type: Inject,
362
+ args: [DOCUMENT]
363
+ }] }];
364
+ } });
273
365
 
274
366
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
275
367
  /**
@@ -339,100 +431,17 @@ class Overlay {
339
431
  return new OverlayRef(this._createPortalHost(pane));
340
432
  }
341
433
  }
342
- Overlay.ɵprov = i0.ɵɵdefineInjectable({ factory: function Overlay_Factory() { return new Overlay(i0.ɵɵinject(OverlayContainer), i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(i0.ApplicationRef), i0.ɵɵinject(i1.DOCUMENT)); }, token: Overlay, providedIn: "root" });
343
- Overlay.decorators = [
344
- { type: Injectable, args: [{ providedIn: 'root' },] }
345
- ];
346
- Overlay.ctorParameters = () => [
347
- { type: OverlayContainer },
348
- { type: ComponentFactoryResolver },
349
- { type: ApplicationRef },
350
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
351
- ];
352
-
353
- /**
354
- * Reference to a toast opened via the Toastr service.
355
- */
356
- class ToastRef {
357
- constructor(_overlayRef) {
358
- this._overlayRef = _overlayRef;
359
- /** Count of duplicates of this toast */
360
- this.duplicatesCount = 0;
361
- /** Subject for notifying the user that the toast has finished closing. */
362
- this._afterClosed = new Subject();
363
- /** triggered when toast is activated */
364
- this._activate = new Subject();
365
- /** notifies the toast that it should close before the timeout */
366
- this._manualClose = new Subject();
367
- /** notifies the toast that it should reset the timeouts */
368
- this._resetTimeout = new Subject();
369
- /** notifies the toast that it should count a duplicate toast */
370
- this._countDuplicate = new Subject();
371
- }
372
- manualClose() {
373
- this._manualClose.next();
374
- this._manualClose.complete();
375
- }
376
- manualClosed() {
377
- return this._manualClose.asObservable();
378
- }
379
- timeoutReset() {
380
- return this._resetTimeout.asObservable();
381
- }
382
- countDuplicate() {
383
- return this._countDuplicate.asObservable();
384
- }
385
- /**
386
- * Close the toast.
387
- */
388
- close() {
389
- this._overlayRef.detach();
390
- this._afterClosed.next();
391
- this._manualClose.next();
392
- this._afterClosed.complete();
393
- this._manualClose.complete();
394
- this._activate.complete();
395
- this._resetTimeout.complete();
396
- this._countDuplicate.complete();
397
- }
398
- /** Gets an observable that is notified when the toast is finished closing. */
399
- afterClosed() {
400
- return this._afterClosed.asObservable();
401
- }
402
- isInactive() {
403
- return this._activate.isStopped;
404
- }
405
- activate() {
406
- this._activate.next();
407
- this._activate.complete();
408
- }
409
- /** Gets an observable that is notified when the toast has started opening. */
410
- afterActivate() {
411
- return this._activate.asObservable();
412
- }
413
- /** Reset the toast timouts and count duplicates */
414
- onDuplicate(resetTimeout, countDuplicate) {
415
- if (resetTimeout) {
416
- this._resetTimeout.next();
417
- }
418
- if (countDuplicate) {
419
- this._countDuplicate.next(++this.duplicatesCount);
420
- }
421
- }
422
- }
423
- /** Custom injector type specifically for instantiating components with a toast. */
424
- class ToastInjector {
425
- constructor(_toastPackage, _parentInjector) {
426
- this._toastPackage = _toastPackage;
427
- this._parentInjector = _parentInjector;
428
- }
429
- get(token, notFoundValue, flags) {
430
- if (token === ToastPackage) {
431
- return this._toastPackage;
432
- }
433
- return this._parentInjector.get(token, notFoundValue, flags);
434
- }
435
- }
434
+ Overlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Overlay, deps: [{ token: OverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
435
+ Overlay.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Overlay, providedIn: 'root' });
436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Overlay, decorators: [{
437
+ type: Injectable,
438
+ args: [{ providedIn: 'root' }]
439
+ }], ctorParameters: function () {
440
+ return [{ type: OverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: undefined, decorators: [{
441
+ type: Inject,
442
+ args: [DOCUMENT]
443
+ }] }];
444
+ } });
436
445
 
437
446
  class ToastrService {
438
447
  constructor(token, overlay, _injector, sanitizer, ngZone) {
@@ -608,17 +617,17 @@ class ToastrService {
608
617
  return ins;
609
618
  }
610
619
  }
611
- ToastrService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ToastrService_Factory() { return new ToastrService(i0.ɵɵinject(TOAST_CONFIG), i0.ɵɵinject(Overlay), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i3.DomSanitizer), i0.ɵɵinject(i0.NgZone)); }, token: ToastrService, providedIn: "root" });
612
- ToastrService.decorators = [
613
- { type: Injectable, args: [{ providedIn: 'root' },] }
614
- ];
615
- ToastrService.ctorParameters = () => [
616
- { type: undefined, decorators: [{ type: Inject, args: [TOAST_CONFIG,] }] },
617
- { type: Overlay },
618
- { type: Injector },
619
- { type: DomSanitizer },
620
- { type: NgZone }
621
- ];
620
+ ToastrService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrService, deps: [{ token: TOAST_CONFIG }, { token: Overlay }, { token: i0.Injector }, { token: i2.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
621
+ ToastrService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrService, providedIn: 'root' });
622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrService, decorators: [{
623
+ type: Injectable,
624
+ args: [{ providedIn: 'root' }]
625
+ }], ctorParameters: function () {
626
+ return [{ type: undefined, decorators: [{
627
+ type: Inject,
628
+ args: [TOAST_CONFIG]
629
+ }] }, { type: Overlay }, { type: i0.Injector }, { type: i2.DomSanitizer }, { type: i0.NgZone }];
630
+ } });
622
631
 
623
632
  class Toast {
624
633
  constructor(toastrService, toastPackage, ngZone) {
@@ -785,10 +794,38 @@ class Toast {
785
794
  }
786
795
  }
787
796
  }
788
- Toast.decorators = [
789
- { type: Component, args: [{
790
- selector: '[toast-component]',
791
- template: `
797
+ Toast.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Toast, deps: [{ token: ToastrService }, { token: ToastPackage }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
798
+ Toast.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: Toast, selector: "[toast-component]", host: { listeners: { "click": "tapToast()", "mouseenter": "stickAround()", "mouseleave": "delayedHideToast()" }, properties: { "class": "this.toastClasses", "@flyInOut": "this.state", "style.display": "this.displayStyle" } }, ngImport: i0, template: `
799
+ <button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
800
+ <span aria-hidden="true">&times;</span>
801
+ </button>
802
+ <div *ngIf="title" [class]="options.titleClass" [attr.aria-label]="title">
803
+ {{ title }} <ng-container *ngIf="duplicatesCount">[{{ duplicatesCount + 1 }}]</ng-container>
804
+ </div>
805
+ <div *ngIf="message && options.enableHtml" role="alertdialog" aria-live="polite"
806
+ [class]="options.messageClass" [innerHTML]="message">
807
+ </div>
808
+ <div *ngIf="message && !options.enableHtml" role="alertdialog" aria-live="polite"
809
+ [class]="options.messageClass" [attr.aria-label]="message">
810
+ {{ message }}
811
+ </div>
812
+ <div *ngIf="options.progressBar">
813
+ <div class="toast-progress" [style.width]="width + '%'"></div>
814
+ </div>
815
+ `, isInline: true, directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
816
+ trigger('flyInOut', [
817
+ state('inactive', style({ opacity: 0 })),
818
+ state('active', style({ opacity: 1 })),
819
+ state('removed', style({ opacity: 0 })),
820
+ transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
821
+ transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
822
+ ])
823
+ ] });
824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Toast, decorators: [{
825
+ type: Component,
826
+ args: [{
827
+ selector: '[toast-component]',
828
+ template: `
792
829
  <button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
793
830
  <span aria-hidden="true">&times;</span>
794
831
  </button>
@@ -806,31 +843,36 @@ Toast.decorators = [
806
843
  <div class="toast-progress" [style.width]="width + '%'"></div>
807
844
  </div>
808
845
  `,
809
- animations: [
810
- trigger('flyInOut', [
811
- state('inactive', style({ opacity: 0 })),
812
- state('active', style({ opacity: 1 })),
813
- state('removed', style({ opacity: 0 })),
814
- transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
815
- transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
816
- ])
817
- ],
818
- preserveWhitespaces: false
819
- },] }
820
- ];
821
- Toast.ctorParameters = () => [
822
- { type: ToastrService },
823
- { type: ToastPackage },
824
- { type: NgZone }
825
- ];
826
- Toast.propDecorators = {
827
- toastClasses: [{ type: HostBinding, args: ['class',] }],
828
- state: [{ type: HostBinding, args: ['@flyInOut',] }],
829
- displayStyle: [{ type: HostBinding, args: ['style.display',] }],
830
- tapToast: [{ type: HostListener, args: ['click',] }],
831
- stickAround: [{ type: HostListener, args: ['mouseenter',] }],
832
- delayedHideToast: [{ type: HostListener, args: ['mouseleave',] }]
833
- };
846
+ animations: [
847
+ trigger('flyInOut', [
848
+ state('inactive', style({ opacity: 0 })),
849
+ state('active', style({ opacity: 1 })),
850
+ state('removed', style({ opacity: 0 })),
851
+ transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
852
+ transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
853
+ ])
854
+ ],
855
+ preserveWhitespaces: false
856
+ }]
857
+ }], ctorParameters: function () { return [{ type: ToastrService }, { type: ToastPackage }, { type: i0.NgZone }]; }, propDecorators: { toastClasses: [{
858
+ type: HostBinding,
859
+ args: ['class']
860
+ }], state: [{
861
+ type: HostBinding,
862
+ args: ['@flyInOut']
863
+ }], displayStyle: [{
864
+ type: HostBinding,
865
+ args: ['style.display']
866
+ }], tapToast: [{
867
+ type: HostListener,
868
+ args: ['click']
869
+ }], stickAround: [{
870
+ type: HostListener,
871
+ args: ['mouseenter']
872
+ }], delayedHideToast: [{
873
+ type: HostListener,
874
+ args: ['mouseleave']
875
+ }] } });
834
876
 
835
877
  const DefaultGlobalConfig = Object.assign(Object.assign({}, DefaultNoComponentGlobalConfig), { toastComponent: Toast });
836
878
  class ToastrModule {
@@ -849,14 +891,18 @@ class ToastrModule {
849
891
  };
850
892
  }
851
893
  }
852
- ToastrModule.decorators = [
853
- { type: NgModule, args: [{
854
- imports: [CommonModule],
855
- declarations: [Toast],
856
- exports: [Toast],
857
- entryComponents: [Toast],
858
- },] }
859
- ];
894
+ ToastrModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
895
+ ToastrModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrModule, declarations: [Toast], imports: [CommonModule], exports: [Toast] });
896
+ ToastrModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrModule, imports: [[CommonModule]] });
897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrModule, decorators: [{
898
+ type: NgModule,
899
+ args: [{
900
+ imports: [CommonModule],
901
+ declarations: [Toast],
902
+ exports: [Toast],
903
+ entryComponents: [Toast],
904
+ }]
905
+ }] });
860
906
  class ToastrComponentlessModule {
861
907
  static forRoot(config = {}) {
862
908
  return {
@@ -873,11 +919,15 @@ class ToastrComponentlessModule {
873
919
  };
874
920
  }
875
921
  }
876
- ToastrComponentlessModule.decorators = [
877
- { type: NgModule, args: [{
878
- imports: [CommonModule],
879
- },] }
880
- ];
922
+ ToastrComponentlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrComponentlessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
923
+ ToastrComponentlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrComponentlessModule, imports: [CommonModule] });
924
+ ToastrComponentlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrComponentlessModule, imports: [[CommonModule]] });
925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastrComponentlessModule, decorators: [{
926
+ type: NgModule,
927
+ args: [{
928
+ imports: [CommonModule],
929
+ }]
930
+ }] });
881
931
 
882
932
  class ToastNoAnimation {
883
933
  constructor(toastrService, toastPackage, appRef) {
@@ -1018,10 +1068,8 @@ class ToastNoAnimation {
1018
1068
  }
1019
1069
  }
1020
1070
  }
1021
- ToastNoAnimation.decorators = [
1022
- { type: Component, args: [{
1023
- selector: '[toast-component]',
1024
- template: `
1071
+ ToastNoAnimation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastNoAnimation, deps: [{ token: ToastrService }, { token: ToastPackage }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Component });
1072
+ ToastNoAnimation.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ToastNoAnimation, selector: "[toast-component]", host: { listeners: { "click": "tapToast()", "mouseenter": "stickAround()", "mouseleave": "delayedHideToast()" }, properties: { "class": "this.toastClasses", "style.display": "this.displayStyle" } }, ngImport: i0, template: `
1025
1073
  <button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
1026
1074
  <span aria-hidden="true">&times;</span>
1027
1075
  </button>
@@ -1038,21 +1086,46 @@ ToastNoAnimation.decorators = [
1038
1086
  <div *ngIf="options.progressBar">
1039
1087
  <div class="toast-progress" [style.width]="width + '%'"></div>
1040
1088
  </div>
1041
- `
1042
- },] }
1043
- ];
1044
- ToastNoAnimation.ctorParameters = () => [
1045
- { type: ToastrService },
1046
- { type: ToastPackage },
1047
- { type: ApplicationRef }
1048
- ];
1049
- ToastNoAnimation.propDecorators = {
1050
- toastClasses: [{ type: HostBinding, args: ['class',] }],
1051
- displayStyle: [{ type: HostBinding, args: ['style.display',] }],
1052
- tapToast: [{ type: HostListener, args: ['click',] }],
1053
- stickAround: [{ type: HostListener, args: ['mouseenter',] }],
1054
- delayedHideToast: [{ type: HostListener, args: ['mouseleave',] }]
1055
- };
1089
+ `, isInline: true, directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastNoAnimation, decorators: [{
1091
+ type: Component,
1092
+ args: [{
1093
+ selector: '[toast-component]',
1094
+ template: `
1095
+ <button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
1096
+ <span aria-hidden="true">&times;</span>
1097
+ </button>
1098
+ <div *ngIf="title" [class]="options.titleClass" [attr.aria-label]="title">
1099
+ {{ title }} <ng-container *ngIf="duplicatesCount">[{{ duplicatesCount + 1 }}]</ng-container>
1100
+ </div>
1101
+ <div *ngIf="message && options.enableHtml" role="alert" aria-live="polite"
1102
+ [class]="options.messageClass" [innerHTML]="message">
1103
+ </div>
1104
+ <div *ngIf="message && !options.enableHtml" role="alert" aria-live="polite"
1105
+ [class]="options.messageClass" [attr.aria-label]="message">
1106
+ {{ message }}
1107
+ </div>
1108
+ <div *ngIf="options.progressBar">
1109
+ <div class="toast-progress" [style.width]="width + '%'"></div>
1110
+ </div>
1111
+ `,
1112
+ }]
1113
+ }], ctorParameters: function () { return [{ type: ToastrService }, { type: ToastPackage }, { type: i0.ApplicationRef }]; }, propDecorators: { toastClasses: [{
1114
+ type: HostBinding,
1115
+ args: ['class']
1116
+ }], displayStyle: [{
1117
+ type: HostBinding,
1118
+ args: ['style.display']
1119
+ }], tapToast: [{
1120
+ type: HostListener,
1121
+ args: ['click']
1122
+ }], stickAround: [{
1123
+ type: HostListener,
1124
+ args: ['mouseenter']
1125
+ }], delayedHideToast: [{
1126
+ type: HostListener,
1127
+ args: ['mouseleave']
1128
+ }] } });
1056
1129
  const DefaultNoAnimationsGlobalConfig = Object.assign(Object.assign({}, DefaultNoComponentGlobalConfig), { toastComponent: ToastNoAnimation });
1057
1130
  class ToastNoAnimationModule {
1058
1131
  static forRoot(config = {}) {
@@ -1070,18 +1143,22 @@ class ToastNoAnimationModule {
1070
1143
  };
1071
1144
  }
1072
1145
  }
1073
- ToastNoAnimationModule.decorators = [
1074
- { type: NgModule, args: [{
1075
- imports: [CommonModule],
1076
- declarations: [ToastNoAnimation],
1077
- exports: [ToastNoAnimation],
1078
- entryComponents: [ToastNoAnimation],
1079
- },] }
1080
- ];
1146
+ ToastNoAnimationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastNoAnimationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1147
+ ToastNoAnimationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastNoAnimationModule, declarations: [ToastNoAnimation], imports: [CommonModule], exports: [ToastNoAnimation] });
1148
+ ToastNoAnimationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastNoAnimationModule, imports: [[CommonModule]] });
1149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ToastNoAnimationModule, decorators: [{
1150
+ type: NgModule,
1151
+ args: [{
1152
+ imports: [CommonModule],
1153
+ declarations: [ToastNoAnimation],
1154
+ exports: [ToastNoAnimation],
1155
+ entryComponents: [ToastNoAnimation],
1156
+ }]
1157
+ }] });
1081
1158
 
1082
1159
  /**
1083
1160
  * Generated bundle index. Do not edit.
1084
1161
  */
1085
1162
 
1086
1163
  export { BasePortalHost, ComponentPortal, DefaultGlobalConfig, DefaultNoAnimationsGlobalConfig, DefaultNoComponentGlobalConfig, Overlay, OverlayContainer, OverlayRef, TOAST_CONFIG, Toast, ToastContainerDirective, ToastContainerModule, ToastInjector, ToastNoAnimation, ToastNoAnimationModule, ToastPackage, ToastRef, ToastrComponentlessModule, ToastrModule, ToastrService };
1087
- //# sourceMappingURL=ngx-toastr.js.map
1164
+ //# sourceMappingURL=ngx-toastr.mjs.map