ngx-toastr 14.1.4 → 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 (37) 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/{esm2015/toastr/toastr-config.js → esm2020/toastr/toastr-config.mjs} +0 -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} +338 -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.module.d.ts +9 -0
  27. package/toastr/toastr.service.d.ts +3 -0
  28. package/bundles/ngx-toastr.umd.js +0 -1508
  29. package/bundles/ngx-toastr.umd.js.map +0 -1
  30. package/esm2015/overlay/overlay-container.js +0 -45
  31. package/esm2015/toastr/toast-noanimation.component.js +0 -204
  32. package/esm2015/toastr/toast.component.js +0 -216
  33. package/esm2015/toastr/toast.directive.js +0 -27
  34. package/esm2015/toastr/toastr.module.js +0 -51
  35. package/esm2015/toastr/toastr.service.js +0 -196
  36. package/fesm2015/ngx-toastr.js.map +0 -1
  37. 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
@@ -104,59 +164,86 @@ const DefaultNoComponentGlobalConfig = {
104
164
  const TOAST_CONFIG = new InjectionToken('ToastConfig');
105
165
 
106
166
  /**
107
- * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
167
+ * Reference to a toast opened via the Toastr service.
108
168
  */
109
- class ComponentPortal {
110
- constructor(component, injector) {
111
- this.component = component;
112
- 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();
113
184
  }
114
- /** Attach this portal to a host. */
115
- attach(host, newestOnTop) {
116
- this._attachedHost = host;
117
- return host.attach(this, newestOnTop);
185
+ manualClose() {
186
+ this._manualClose.next();
187
+ this._manualClose.complete();
118
188
  }
119
- /** Detach this portal from its host */
120
- detach() {
121
- const host = this._attachedHost;
122
- if (host) {
123
- this._attachedHost = undefined;
124
- return host.detach();
125
- }
189
+ manualClosed() {
190
+ return this._manualClose.asObservable();
126
191
  }
127
- /** Whether this portal is attached to a host. */
128
- get isAttached() {
129
- return this._attachedHost != null;
192
+ timeoutReset() {
193
+ return this._resetTimeout.asObservable();
194
+ }
195
+ countDuplicate() {
196
+ return this._countDuplicate.asObservable();
130
197
  }
131
198
  /**
132
- * Sets the PortalHost reference without performing `attach()`. This is used directly by
133
- * the PortalHost when it is performing an `attach()` or `detach()`.
199
+ * Close the toast.
134
200
  */
135
- setAttachedHost(host) {
136
- 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();
137
210
  }
138
- }
139
- /**
140
- * Partial implementation of PortalHost that only deals with attaching a
141
- * ComponentPortal
142
- */
143
- class BasePortalHost {
144
- attach(portal, newestOnTop) {
145
- this._attachedPortal = portal;
146
- 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();
147
214
  }
148
- detach() {
149
- if (this._attachedPortal) {
150
- 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();
151
230
  }
152
- this._attachedPortal = undefined;
153
- if (this._disposeFn) {
154
- this._disposeFn();
155
- this._disposeFn = undefined;
231
+ if (countDuplicate) {
232
+ this._countDuplicate.next(++this.duplicatesCount);
156
233
  }
157
234
  }
158
- setDisposeFn(fn) {
159
- 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);
160
247
  }
161
248
  }
162
249
 
@@ -211,6 +298,26 @@ class DomPortalHost extends BasePortalHost {
211
298
  }
212
299
  }
213
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
+
214
321
  /** Container inside which all toasts will render. */
215
322
  class OverlayContainer {
216
323
  constructor(_document) {
@@ -244,33 +351,17 @@ class OverlayContainer {
244
351
  this._containerElement = container;
245
352
  }
246
353
  }
247
- OverlayContainer.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(i0.ɵɵinject(i1.DOCUMENT)); }, token: OverlayContainer, providedIn: "root" });
248
- OverlayContainer.decorators = [
249
- { type: Injectable, args: [{ providedIn: 'root' },] }
250
- ];
251
- OverlayContainer.ctorParameters = () => [
252
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
253
- ];
254
-
255
- /**
256
- * Reference to an overlay that has been created with the Overlay service.
257
- * Used to manipulate or dispose of said overlay.
258
- */
259
- class OverlayRef {
260
- constructor(_portalHost) {
261
- this._portalHost = _portalHost;
262
- }
263
- attach(portal, newestOnTop = true) {
264
- return this._portalHost.attach(portal, newestOnTop);
265
- }
266
- /**
267
- * Detaches an overlay from a portal.
268
- * @returns Resolves when the overlay has been detached.
269
- */
270
- detach() {
271
- return this._portalHost.detach();
272
- }
273
- }
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
+ } });
274
365
 
275
366
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
276
367
  /**
@@ -340,100 +431,17 @@ class Overlay {
340
431
  return new OverlayRef(this._createPortalHost(pane));
341
432
  }
342
433
  }
343
- 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" });
344
- Overlay.decorators = [
345
- { type: Injectable, args: [{ providedIn: 'root' },] }
346
- ];
347
- Overlay.ctorParameters = () => [
348
- { type: OverlayContainer },
349
- { type: ComponentFactoryResolver },
350
- { type: ApplicationRef },
351
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
352
- ];
353
-
354
- /**
355
- * Reference to a toast opened via the Toastr service.
356
- */
357
- class ToastRef {
358
- constructor(_overlayRef) {
359
- this._overlayRef = _overlayRef;
360
- /** Count of duplicates of this toast */
361
- this.duplicatesCount = 0;
362
- /** Subject for notifying the user that the toast has finished closing. */
363
- this._afterClosed = new Subject();
364
- /** triggered when toast is activated */
365
- this._activate = new Subject();
366
- /** notifies the toast that it should close before the timeout */
367
- this._manualClose = new Subject();
368
- /** notifies the toast that it should reset the timeouts */
369
- this._resetTimeout = new Subject();
370
- /** notifies the toast that it should count a duplicate toast */
371
- this._countDuplicate = new Subject();
372
- }
373
- manualClose() {
374
- this._manualClose.next();
375
- this._manualClose.complete();
376
- }
377
- manualClosed() {
378
- return this._manualClose.asObservable();
379
- }
380
- timeoutReset() {
381
- return this._resetTimeout.asObservable();
382
- }
383
- countDuplicate() {
384
- return this._countDuplicate.asObservable();
385
- }
386
- /**
387
- * Close the toast.
388
- */
389
- close() {
390
- this._overlayRef.detach();
391
- this._afterClosed.next();
392
- this._manualClose.next();
393
- this._afterClosed.complete();
394
- this._manualClose.complete();
395
- this._activate.complete();
396
- this._resetTimeout.complete();
397
- this._countDuplicate.complete();
398
- }
399
- /** Gets an observable that is notified when the toast is finished closing. */
400
- afterClosed() {
401
- return this._afterClosed.asObservable();
402
- }
403
- isInactive() {
404
- return this._activate.isStopped;
405
- }
406
- activate() {
407
- this._activate.next();
408
- this._activate.complete();
409
- }
410
- /** Gets an observable that is notified when the toast has started opening. */
411
- afterActivate() {
412
- return this._activate.asObservable();
413
- }
414
- /** Reset the toast timouts and count duplicates */
415
- onDuplicate(resetTimeout, countDuplicate) {
416
- if (resetTimeout) {
417
- this._resetTimeout.next();
418
- }
419
- if (countDuplicate) {
420
- this._countDuplicate.next(++this.duplicatesCount);
421
- }
422
- }
423
- }
424
- /** Custom injector type specifically for instantiating components with a toast. */
425
- class ToastInjector {
426
- constructor(_toastPackage, _parentInjector) {
427
- this._toastPackage = _toastPackage;
428
- this._parentInjector = _parentInjector;
429
- }
430
- get(token, notFoundValue, flags) {
431
- if (token === ToastPackage) {
432
- return this._toastPackage;
433
- }
434
- return this._parentInjector.get(token, notFoundValue, flags);
435
- }
436
- }
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
+ } });
437
445
 
438
446
  class ToastrService {
439
447
  constructor(token, overlay, _injector, sanitizer, ngZone) {
@@ -609,17 +617,17 @@ class ToastrService {
609
617
  return ins;
610
618
  }
611
619
  }
612
- 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" });
613
- ToastrService.decorators = [
614
- { type: Injectable, args: [{ providedIn: 'root' },] }
615
- ];
616
- ToastrService.ctorParameters = () => [
617
- { type: undefined, decorators: [{ type: Inject, args: [TOAST_CONFIG,] }] },
618
- { type: Overlay },
619
- { type: Injector },
620
- { type: DomSanitizer },
621
- { type: NgZone }
622
- ];
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
+ } });
623
631
 
624
632
  class Toast {
625
633
  constructor(toastrService, toastPackage, ngZone) {
@@ -786,10 +794,38 @@ class Toast {
786
794
  }
787
795
  }
788
796
  }
789
- Toast.decorators = [
790
- { type: Component, args: [{
791
- selector: '[toast-component]',
792
- 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: `
793
829
  <button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
794
830
  <span aria-hidden="true">&times;</span>
795
831
  </button>
@@ -807,31 +843,36 @@ Toast.decorators = [
807
843
  <div class="toast-progress" [style.width]="width + '%'"></div>
808
844
  </div>
809
845
  `,
810
- animations: [
811
- trigger('flyInOut', [
812
- state('inactive', style({ opacity: 0 })),
813
- state('active', style({ opacity: 1 })),
814
- state('removed', style({ opacity: 0 })),
815
- transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
816
- transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
817
- ])
818
- ],
819
- preserveWhitespaces: false
820
- },] }
821
- ];
822
- Toast.ctorParameters = () => [
823
- { type: ToastrService },
824
- { type: ToastPackage },
825
- { type: NgZone }
826
- ];
827
- Toast.propDecorators = {
828
- toastClasses: [{ type: HostBinding, args: ['class',] }],
829
- state: [{ type: HostBinding, args: ['@flyInOut',] }],
830
- displayStyle: [{ type: HostBinding, args: ['style.display',] }],
831
- tapToast: [{ type: HostListener, args: ['click',] }],
832
- stickAround: [{ type: HostListener, args: ['mouseenter',] }],
833
- delayedHideToast: [{ type: HostListener, args: ['mouseleave',] }]
834
- };
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
+ }] } });
835
876
 
836
877
  const DefaultGlobalConfig = Object.assign(Object.assign({}, DefaultNoComponentGlobalConfig), { toastComponent: Toast });
837
878
  class ToastrModule {
@@ -850,14 +891,18 @@ class ToastrModule {
850
891
  };
851
892
  }
852
893
  }
853
- ToastrModule.decorators = [
854
- { type: NgModule, args: [{
855
- imports: [CommonModule],
856
- declarations: [Toast],
857
- exports: [Toast],
858
- entryComponents: [Toast],
859
- },] }
860
- ];
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
+ }] });
861
906
  class ToastrComponentlessModule {
862
907
  static forRoot(config = {}) {
863
908
  return {
@@ -874,11 +919,15 @@ class ToastrComponentlessModule {
874
919
  };
875
920
  }
876
921
  }
877
- ToastrComponentlessModule.decorators = [
878
- { type: NgModule, args: [{
879
- imports: [CommonModule],
880
- },] }
881
- ];
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
+ }] });
882
931
 
883
932
  class ToastNoAnimation {
884
933
  constructor(toastrService, toastPackage, appRef) {
@@ -1019,10 +1068,8 @@ class ToastNoAnimation {
1019
1068
  }
1020
1069
  }
1021
1070
  }
1022
- ToastNoAnimation.decorators = [
1023
- { type: Component, args: [{
1024
- selector: '[toast-component]',
1025
- 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: `
1026
1073
  <button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
1027
1074
  <span aria-hidden="true">&times;</span>
1028
1075
  </button>
@@ -1039,21 +1086,46 @@ ToastNoAnimation.decorators = [
1039
1086
  <div *ngIf="options.progressBar">
1040
1087
  <div class="toast-progress" [style.width]="width + '%'"></div>
1041
1088
  </div>
1042
- `
1043
- },] }
1044
- ];
1045
- ToastNoAnimation.ctorParameters = () => [
1046
- { type: ToastrService },
1047
- { type: ToastPackage },
1048
- { type: ApplicationRef }
1049
- ];
1050
- ToastNoAnimation.propDecorators = {
1051
- toastClasses: [{ type: HostBinding, args: ['class',] }],
1052
- displayStyle: [{ type: HostBinding, args: ['style.display',] }],
1053
- tapToast: [{ type: HostListener, args: ['click',] }],
1054
- stickAround: [{ type: HostListener, args: ['mouseenter',] }],
1055
- delayedHideToast: [{ type: HostListener, args: ['mouseleave',] }]
1056
- };
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
+ }] } });
1057
1129
  const DefaultNoAnimationsGlobalConfig = Object.assign(Object.assign({}, DefaultNoComponentGlobalConfig), { toastComponent: ToastNoAnimation });
1058
1130
  class ToastNoAnimationModule {
1059
1131
  static forRoot(config = {}) {
@@ -1071,18 +1143,22 @@ class ToastNoAnimationModule {
1071
1143
  };
1072
1144
  }
1073
1145
  }
1074
- ToastNoAnimationModule.decorators = [
1075
- { type: NgModule, args: [{
1076
- imports: [CommonModule],
1077
- declarations: [ToastNoAnimation],
1078
- exports: [ToastNoAnimation],
1079
- entryComponents: [ToastNoAnimation],
1080
- },] }
1081
- ];
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
+ }] });
1082
1158
 
1083
1159
  /**
1084
1160
  * Generated bundle index. Do not edit.
1085
1161
  */
1086
1162
 
1087
1163
  export { BasePortalHost, ComponentPortal, DefaultGlobalConfig, DefaultNoAnimationsGlobalConfig, DefaultNoComponentGlobalConfig, Overlay, OverlayContainer, OverlayRef, TOAST_CONFIG, Toast, ToastContainerDirective, ToastContainerModule, ToastInjector, ToastNoAnimation, ToastNoAnimationModule, ToastPackage, ToastRef, ToastrComponentlessModule, ToastrModule, ToastrService };
1088
- //# sourceMappingURL=ngx-toastr.js.map
1164
+ //# sourceMappingURL=ngx-toastr.mjs.map