ngx-toastr 16.1.0 → 16.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.
- package/esm2020/overlay/overlay-container.mjs +8 -11
- package/esm2020/overlay/overlay.mjs +12 -15
- package/esm2020/public_api.mjs +2 -1
- package/esm2020/toastr/toast-noanimation.component.mjs +19 -19
- package/esm2020/toastr/toast.component.mjs +21 -19
- package/esm2020/toastr/toast.directive.mjs +6 -17
- package/esm2020/toastr/toast.provider.mjs +40 -0
- package/esm2020/toastr/toastr.module.mjs +13 -28
- package/esm2020/toastr/toastr.service.mjs +3 -3
- package/fesm2015/ngx-toastr.mjs +124 -121
- package/fesm2015/ngx-toastr.mjs.map +1 -1
- package/fesm2020/ngx-toastr.mjs +124 -117
- package/fesm2020/ngx-toastr.mjs.map +1 -1
- package/overlay/overlay-container.d.ts +1 -2
- package/overlay/overlay.d.ts +0 -3
- package/package.json +2 -1
- package/public_api.d.ts +1 -0
- package/toastr/toast-noanimation.component.d.ts +2 -3
- package/toastr/toast.component.d.ts +1 -1
- package/toastr/toast.directive.d.ts +1 -6
- package/toastr/toast.provider.d.ts +24 -0
- package/toastr/toastr-config.d.ts +2 -2
- package/toastr/toastr.module.d.ts +2 -4
@@ -1,36 +1,23 @@
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
2
1
|
import { NgModule } from '@angular/core';
|
3
2
|
import { Toast } from './toast.component';
|
4
3
|
import { DefaultNoComponentGlobalConfig, TOAST_CONFIG } from './toastr-config';
|
4
|
+
import { provideToastr } from './toast.provider';
|
5
5
|
import * as i0 from "@angular/core";
|
6
|
-
export const DefaultGlobalConfig = {
|
7
|
-
...DefaultNoComponentGlobalConfig,
|
8
|
-
toastComponent: Toast,
|
9
|
-
};
|
10
6
|
export class ToastrModule {
|
11
7
|
static forRoot(config = {}) {
|
12
8
|
return {
|
13
9
|
ngModule: ToastrModule,
|
14
|
-
providers: [
|
15
|
-
{
|
16
|
-
provide: TOAST_CONFIG,
|
17
|
-
useValue: {
|
18
|
-
default: DefaultGlobalConfig,
|
19
|
-
config,
|
20
|
-
},
|
21
|
-
},
|
22
|
-
],
|
10
|
+
providers: [provideToastr(config)],
|
23
11
|
};
|
24
12
|
}
|
25
13
|
}
|
26
|
-
ToastrModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
27
|
-
ToastrModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
|
28
|
-
ToastrModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
14
|
+
ToastrModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
15
|
+
ToastrModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, imports: [Toast], exports: [Toast] });
|
16
|
+
ToastrModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, imports: [Toast] });
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, decorators: [{
|
30
18
|
type: NgModule,
|
31
19
|
args: [{
|
32
|
-
imports: [
|
33
|
-
declarations: [Toast],
|
20
|
+
imports: [Toast],
|
34
21
|
exports: [Toast],
|
35
22
|
}]
|
36
23
|
}] });
|
@@ -50,13 +37,11 @@ export class ToastrComponentlessModule {
|
|
50
37
|
};
|
51
38
|
}
|
52
39
|
}
|
53
|
-
ToastrComponentlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
54
|
-
ToastrComponentlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
|
55
|
-
ToastrComponentlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
40
|
+
ToastrComponentlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
41
|
+
ToastrComponentlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule });
|
42
|
+
ToastrComponentlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule });
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule, decorators: [{
|
57
44
|
type: NgModule,
|
58
|
-
args: [{
|
59
|
-
imports: [CommonModule],
|
60
|
-
}]
|
45
|
+
args: [{}]
|
61
46
|
}] });
|
62
|
-
//# sourceMappingURL=data:application/json;base64,
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9hc3RyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdG9hc3RyL3RvYXN0ci5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFOUQsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzFDLE9BQU8sRUFBRSw4QkFBOEIsRUFBZ0IsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDN0YsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGt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==
|
@@ -187,9 +187,9 @@ export class ToastrService {
|
|
187
187
|
return ins;
|
188
188
|
}
|
189
189
|
}
|
190
|
-
ToastrService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
191
|
-
ToastrService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
190
|
+
ToastrService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrService, deps: [{ token: TOAST_CONFIG }, { token: i1.Overlay }, { token: i0.Injector }, { token: i2.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
191
|
+
ToastrService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrService, providedIn: 'root' });
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrService, decorators: [{
|
193
193
|
type: Injectable,
|
194
194
|
args: [{ providedIn: 'root' }]
|
195
195
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
package/fesm2015/ngx-toastr.mjs
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Directive,
|
2
|
+
import { Directive, InjectionToken, inject, Injectable, ComponentFactoryResolver, ApplicationRef, SecurityContext, Injector, Inject, Component, HostBinding, HostListener, makeEnvironmentProviders, NgModule } from '@angular/core';
|
3
3
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
4
|
+
import { DOCUMENT, NgIf } from '@angular/common';
|
4
5
|
import { Subject } from 'rxjs';
|
5
|
-
import * as i3 from '@angular/common';
|
6
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
7
6
|
import * as i2 from '@angular/platform-browser';
|
8
7
|
|
9
8
|
class ToastContainerDirective {
|
@@ -14,27 +13,16 @@ class ToastContainerDirective {
|
|
14
13
|
return this.el.nativeElement;
|
15
14
|
}
|
16
15
|
}
|
17
|
-
ToastContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
18
|
-
ToastContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
16
|
+
ToastContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastContainerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
17
|
+
ToastContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: ToastContainerDirective, isStandalone: true, selector: "[toastContainer]", exportAs: ["toastContainer"], ngImport: i0 });
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastContainerDirective, decorators: [{
|
20
19
|
type: Directive,
|
21
20
|
args: [{
|
22
21
|
selector: '[toastContainer]',
|
23
22
|
exportAs: 'toastContainer',
|
23
|
+
standalone: true
|
24
24
|
}]
|
25
25
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
26
|
-
class ToastContainerModule {
|
27
|
-
}
|
28
|
-
ToastContainerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ToastContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
29
|
-
ToastContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: ToastContainerModule, declarations: [ToastContainerDirective], exports: [ToastContainerDirective] });
|
30
|
-
ToastContainerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ToastContainerModule });
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ToastContainerModule, decorators: [{
|
32
|
-
type: NgModule,
|
33
|
-
args: [{
|
34
|
-
declarations: [ToastContainerDirective],
|
35
|
-
exports: [ToastContainerDirective],
|
36
|
-
}]
|
37
|
-
}] });
|
38
26
|
|
39
27
|
/**
|
40
28
|
* A `ComponentPortal` is a portal that instantiates some Component upon attachment.
|
@@ -284,30 +272,10 @@ class DomPortalHost extends BasePortalHost {
|
|
284
272
|
}
|
285
273
|
}
|
286
274
|
|
287
|
-
/**
|
288
|
-
* Reference to an overlay that has been created with the Overlay service.
|
289
|
-
* Used to manipulate or dispose of said overlay.
|
290
|
-
*/
|
291
|
-
class OverlayRef {
|
292
|
-
constructor(_portalHost) {
|
293
|
-
this._portalHost = _portalHost;
|
294
|
-
}
|
295
|
-
attach(portal, newestOnTop = true) {
|
296
|
-
return this._portalHost.attach(portal, newestOnTop);
|
297
|
-
}
|
298
|
-
/**
|
299
|
-
* Detaches an overlay from a portal.
|
300
|
-
* @returns Resolves when the overlay has been detached.
|
301
|
-
*/
|
302
|
-
detach() {
|
303
|
-
return this._portalHost.detach();
|
304
|
-
}
|
305
|
-
}
|
306
|
-
|
307
275
|
/** Container inside which all toasts will render. */
|
308
276
|
class OverlayContainer {
|
309
|
-
constructor(
|
310
|
-
this._document =
|
277
|
+
constructor() {
|
278
|
+
this._document = inject(DOCUMENT);
|
311
279
|
}
|
312
280
|
ngOnDestroy() {
|
313
281
|
if (this._containerElement && this._containerElement.parentNode) {
|
@@ -339,17 +307,32 @@ class OverlayContainer {
|
|
339
307
|
this._containerElement = container;
|
340
308
|
}
|
341
309
|
}
|
342
|
-
OverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
343
|
-
OverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
310
|
+
OverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: OverlayContainer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
311
|
+
OverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: OverlayContainer, providedIn: 'root' });
|
312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: OverlayContainer, decorators: [{
|
345
313
|
type: Injectable,
|
346
314
|
args: [{ providedIn: 'root' }]
|
347
|
-
}]
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
315
|
+
}] });
|
316
|
+
|
317
|
+
/**
|
318
|
+
* Reference to an overlay that has been created with the Overlay service.
|
319
|
+
* Used to manipulate or dispose of said overlay.
|
320
|
+
*/
|
321
|
+
class OverlayRef {
|
322
|
+
constructor(_portalHost) {
|
323
|
+
this._portalHost = _portalHost;
|
324
|
+
}
|
325
|
+
attach(portal, newestOnTop = true) {
|
326
|
+
return this._portalHost.attach(portal, newestOnTop);
|
327
|
+
}
|
328
|
+
/**
|
329
|
+
* Detaches an overlay from a portal.
|
330
|
+
* @returns Resolves when the overlay has been detached.
|
331
|
+
*/
|
332
|
+
detach() {
|
333
|
+
return this._portalHost.detach();
|
334
|
+
}
|
335
|
+
}
|
353
336
|
|
354
337
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
355
338
|
/**
|
@@ -361,11 +344,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
361
344
|
* An overlay *is* a PortalHost, so any kind of Portal can be loaded into one.
|
362
345
|
*/
|
363
346
|
class Overlay {
|
364
|
-
constructor(
|
365
|
-
this._overlayContainer =
|
366
|
-
this._componentFactoryResolver =
|
367
|
-
this._appRef =
|
368
|
-
this._document =
|
347
|
+
constructor() {
|
348
|
+
this._overlayContainer = inject(OverlayContainer);
|
349
|
+
this._componentFactoryResolver = inject(ComponentFactoryResolver);
|
350
|
+
this._appRef = inject(ApplicationRef);
|
351
|
+
this._document = inject(DOCUMENT);
|
369
352
|
// Namespace panes by overlay container
|
370
353
|
this._paneElements = new Map();
|
371
354
|
}
|
@@ -419,17 +402,12 @@ class Overlay {
|
|
419
402
|
return new OverlayRef(this._createPortalHost(pane));
|
420
403
|
}
|
421
404
|
}
|
422
|
-
Overlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
423
|
-
Overlay.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
424
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
405
|
+
Overlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: Overlay, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
406
|
+
Overlay.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: Overlay, providedIn: 'root' });
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: Overlay, decorators: [{
|
425
408
|
type: Injectable,
|
426
409
|
args: [{ providedIn: 'root' }]
|
427
|
-
}]
|
428
|
-
return [{ type: OverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: undefined, decorators: [{
|
429
|
-
type: Inject,
|
430
|
-
args: [DOCUMENT]
|
431
|
-
}] }];
|
432
|
-
} });
|
410
|
+
}] });
|
433
411
|
|
434
412
|
class ToastrService {
|
435
413
|
constructor(token, overlay, _injector, sanitizer, ngZone) {
|
@@ -607,9 +585,9 @@ class ToastrService {
|
|
607
585
|
return ins;
|
608
586
|
}
|
609
587
|
}
|
610
|
-
ToastrService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
611
|
-
ToastrService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
612
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
588
|
+
ToastrService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrService, deps: [{ token: TOAST_CONFIG }, { token: Overlay }, { token: i0.Injector }, { token: i2.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
589
|
+
ToastrService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrService, providedIn: 'root' });
|
590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrService, decorators: [{
|
613
591
|
type: Injectable,
|
614
592
|
args: [{ providedIn: 'root' }]
|
615
593
|
}], ctorParameters: function () {
|
@@ -620,6 +598,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
620
598
|
} });
|
621
599
|
|
622
600
|
class Toast {
|
601
|
+
/** hides component when waiting to be displayed */
|
602
|
+
get displayStyle() {
|
603
|
+
if (this.state.value === 'inactive') {
|
604
|
+
return 'none';
|
605
|
+
}
|
606
|
+
return;
|
607
|
+
}
|
623
608
|
constructor(toastrService, toastPackage, ngZone) {
|
624
609
|
this.toastrService = toastrService;
|
625
610
|
this.toastPackage = toastPackage;
|
@@ -654,13 +639,6 @@ class Toast {
|
|
654
639
|
this.duplicatesCount = count;
|
655
640
|
});
|
656
641
|
}
|
657
|
-
/** hides component when waiting to be displayed */
|
658
|
-
get displayStyle() {
|
659
|
-
if (this.state.value === 'inactive') {
|
660
|
-
return 'none';
|
661
|
-
}
|
662
|
-
return;
|
663
|
-
}
|
664
642
|
ngOnDestroy() {
|
665
643
|
this.sub.unsubscribe();
|
666
644
|
this.sub1.unsubscribe();
|
@@ -786,8 +764,8 @@ class Toast {
|
|
786
764
|
}
|
787
765
|
}
|
788
766
|
}
|
789
|
-
Toast.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
790
|
-
Toast.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.
|
767
|
+
Toast.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: Toast, deps: [{ token: ToastrService }, { token: ToastPackage }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
768
|
+
Toast.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: Toast, isStandalone: true, 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: `
|
791
769
|
<button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
|
792
770
|
<span aria-hidden="true">×</span>
|
793
771
|
</button>
|
@@ -804,16 +782,16 @@ Toast.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4
|
|
804
782
|
<div *ngIf="options.progressBar">
|
805
783
|
<div class="toast-progress" [style.width]="width + '%'"></div>
|
806
784
|
</div>
|
807
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
785
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
808
786
|
trigger('flyInOut', [
|
809
787
|
state('inactive', style({ opacity: 0 })),
|
810
788
|
state('active', style({ opacity: 1 })),
|
811
789
|
state('removed', style({ opacity: 0 })),
|
812
790
|
transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
|
813
|
-
transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
|
814
|
-
])
|
791
|
+
transition('active => removed', animate('{{ easeTime }}ms {{ easing }}')),
|
792
|
+
]),
|
815
793
|
] });
|
816
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
794
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: Toast, decorators: [{
|
817
795
|
type: Component,
|
818
796
|
args: [{
|
819
797
|
selector: '[toast-component]',
|
@@ -841,10 +819,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
841
819
|
state('active', style({ opacity: 1 })),
|
842
820
|
state('removed', style({ opacity: 0 })),
|
843
821
|
transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
|
844
|
-
transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
|
845
|
-
])
|
822
|
+
transition('active => removed', animate('{{ easeTime }}ms {{ easing }}')),
|
823
|
+
]),
|
846
824
|
],
|
847
|
-
preserveWhitespaces: false
|
825
|
+
preserveWhitespaces: false,
|
826
|
+
standalone: true,
|
827
|
+
imports: [NgIf],
|
848
828
|
}]
|
849
829
|
}], ctorParameters: function () { return [{ type: ToastrService }, { type: ToastPackage }, { type: i0.NgZone }]; }, propDecorators: { toastClasses: [{
|
850
830
|
type: HostBinding,
|
@@ -867,30 +847,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
867
847
|
}] } });
|
868
848
|
|
869
849
|
const DefaultGlobalConfig = Object.assign(Object.assign({}, DefaultNoComponentGlobalConfig), { toastComponent: Toast });
|
850
|
+
/**
|
851
|
+
* @description
|
852
|
+
* Provides the `TOAST_CONFIG` token with the given config.
|
853
|
+
*
|
854
|
+
* @param config The config to configure toastr.
|
855
|
+
* @returns The environment providers.
|
856
|
+
*
|
857
|
+
* @example
|
858
|
+
* ```ts
|
859
|
+
* import { provideToastr } from 'ngx-toastr';
|
860
|
+
*
|
861
|
+
* bootstrap(AppComponent, {
|
862
|
+
* providers: [
|
863
|
+
* provideToastr({
|
864
|
+
* timeOut: 2000,
|
865
|
+
* positionClass: 'toast-top-right',
|
866
|
+
* }),
|
867
|
+
* ],
|
868
|
+
* })
|
869
|
+
*/
|
870
|
+
const provideToastr = (config = {}) => {
|
871
|
+
const providers = [
|
872
|
+
{
|
873
|
+
provide: TOAST_CONFIG,
|
874
|
+
useValue: {
|
875
|
+
default: DefaultGlobalConfig,
|
876
|
+
config,
|
877
|
+
}
|
878
|
+
}
|
879
|
+
];
|
880
|
+
return makeEnvironmentProviders(providers);
|
881
|
+
};
|
882
|
+
|
870
883
|
class ToastrModule {
|
871
884
|
static forRoot(config = {}) {
|
872
885
|
return {
|
873
886
|
ngModule: ToastrModule,
|
874
|
-
providers: [
|
875
|
-
{
|
876
|
-
provide: TOAST_CONFIG,
|
877
|
-
useValue: {
|
878
|
-
default: DefaultGlobalConfig,
|
879
|
-
config,
|
880
|
-
},
|
881
|
-
},
|
882
|
-
],
|
887
|
+
providers: [provideToastr(config)],
|
883
888
|
};
|
884
889
|
}
|
885
890
|
}
|
886
|
-
ToastrModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
887
|
-
ToastrModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
|
888
|
-
ToastrModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
891
|
+
ToastrModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
892
|
+
ToastrModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, imports: [Toast], exports: [Toast] });
|
893
|
+
ToastrModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, imports: [Toast] });
|
894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrModule, decorators: [{
|
890
895
|
type: NgModule,
|
891
896
|
args: [{
|
892
|
-
imports: [
|
893
|
-
declarations: [Toast],
|
897
|
+
imports: [Toast],
|
894
898
|
exports: [Toast],
|
895
899
|
}]
|
896
900
|
}] });
|
@@ -910,17 +914,21 @@ class ToastrComponentlessModule {
|
|
910
914
|
};
|
911
915
|
}
|
912
916
|
}
|
913
|
-
ToastrComponentlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
914
|
-
ToastrComponentlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
|
915
|
-
ToastrComponentlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
916
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
917
|
+
ToastrComponentlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
918
|
+
ToastrComponentlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule });
|
919
|
+
ToastrComponentlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule });
|
920
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastrComponentlessModule, decorators: [{
|
917
921
|
type: NgModule,
|
918
|
-
args: [{
|
919
|
-
imports: [CommonModule],
|
920
|
-
}]
|
922
|
+
args: [{}]
|
921
923
|
}] });
|
922
924
|
|
923
925
|
class ToastNoAnimation {
|
926
|
+
/** hides component when waiting to be displayed */
|
927
|
+
get displayStyle() {
|
928
|
+
if (this.state === 'inactive') {
|
929
|
+
return 'none';
|
930
|
+
}
|
931
|
+
}
|
924
932
|
constructor(toastrService, toastPackage, appRef) {
|
925
933
|
this.toastrService = toastrService;
|
926
934
|
this.toastPackage = toastPackage;
|
@@ -949,12 +957,6 @@ class ToastNoAnimation {
|
|
949
957
|
this.duplicatesCount = count;
|
950
958
|
});
|
951
959
|
}
|
952
|
-
/** hides component when waiting to be displayed */
|
953
|
-
get displayStyle() {
|
954
|
-
if (this.state === 'inactive') {
|
955
|
-
return 'none';
|
956
|
-
}
|
957
|
-
}
|
958
960
|
ngOnDestroy() {
|
959
961
|
this.sub.unsubscribe();
|
960
962
|
this.sub1.unsubscribe();
|
@@ -1059,8 +1061,8 @@ class ToastNoAnimation {
|
|
1059
1061
|
}
|
1060
1062
|
}
|
1061
1063
|
}
|
1062
|
-
ToastNoAnimation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
1063
|
-
ToastNoAnimation.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.
|
1064
|
+
ToastNoAnimation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastNoAnimation, deps: [{ token: ToastrService }, { token: ToastPackage }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Component });
|
1065
|
+
ToastNoAnimation.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ToastNoAnimation, isStandalone: true, selector: "[toast-component]", host: { listeners: { "click": "tapToast()", "mouseenter": "stickAround()", "mouseleave": "delayedHideToast()" }, properties: { "class": "this.toastClasses", "style.display": "this.displayStyle" } }, ngImport: i0, template: `
|
1064
1066
|
<button *ngIf="options.closeButton" (click)="remove()" type="button" class="toast-close-button" aria-label="Close">
|
1065
1067
|
<span aria-hidden="true">×</span>
|
1066
1068
|
</button>
|
@@ -1077,8 +1079,8 @@ ToastNoAnimation.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versi
|
|
1077
1079
|
<div *ngIf="options.progressBar">
|
1078
1080
|
<div class="toast-progress" [style.width]="width + '%'"></div>
|
1079
1081
|
</div>
|
1080
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
1081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
1082
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
1083
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastNoAnimation, decorators: [{
|
1082
1084
|
type: Component,
|
1083
1085
|
args: [{
|
1084
1086
|
selector: '[toast-component]',
|
@@ -1100,6 +1102,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
1100
1102
|
<div class="toast-progress" [style.width]="width + '%'"></div>
|
1101
1103
|
</div>
|
1102
1104
|
`,
|
1105
|
+
standalone: true,
|
1106
|
+
imports: [NgIf]
|
1103
1107
|
}]
|
1104
1108
|
}], ctorParameters: function () { return [{ type: ToastrService }, { type: ToastPackage }, { type: i0.ApplicationRef }]; }, propDecorators: { toastClasses: [{
|
1105
1109
|
type: HostBinding,
|
@@ -1134,14 +1138,13 @@ class ToastNoAnimationModule {
|
|
1134
1138
|
};
|
1135
1139
|
}
|
1136
1140
|
}
|
1137
|
-
ToastNoAnimationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
1138
|
-
ToastNoAnimationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
|
1139
|
-
ToastNoAnimationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
1140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
1141
|
+
ToastNoAnimationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastNoAnimationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1142
|
+
ToastNoAnimationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ToastNoAnimationModule, imports: [ToastNoAnimation], exports: [ToastNoAnimation] });
|
1143
|
+
ToastNoAnimationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastNoAnimationModule, imports: [ToastNoAnimation] });
|
1144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToastNoAnimationModule, decorators: [{
|
1141
1145
|
type: NgModule,
|
1142
1146
|
args: [{
|
1143
|
-
imports: [
|
1144
|
-
declarations: [ToastNoAnimation],
|
1147
|
+
imports: [ToastNoAnimation],
|
1145
1148
|
exports: [ToastNoAnimation],
|
1146
1149
|
}]
|
1147
1150
|
}] });
|
@@ -1150,5 +1153,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
1150
1153
|
* Generated bundle index. Do not edit.
|
1151
1154
|
*/
|
1152
1155
|
|
1153
|
-
export { BasePortalHost, ComponentPortal, DefaultGlobalConfig, DefaultNoAnimationsGlobalConfig, DefaultNoComponentGlobalConfig, Overlay, OverlayContainer, OverlayRef, TOAST_CONFIG, Toast, ToastContainerDirective,
|
1156
|
+
export { BasePortalHost, ComponentPortal, DefaultGlobalConfig, DefaultNoAnimationsGlobalConfig, DefaultNoComponentGlobalConfig, Overlay, OverlayContainer, OverlayRef, TOAST_CONFIG, Toast, ToastContainerDirective, ToastNoAnimation, ToastNoAnimationModule, ToastPackage, ToastRef, ToastrComponentlessModule, ToastrModule, ToastrService, provideToastr };
|
1154
1157
|
//# sourceMappingURL=ngx-toastr.mjs.map
|