ngx-toastr 12.1.0 → 13.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 (43) hide show
  1. package/README.md +46 -41
  2. package/bundles/ngx-toastr.umd.js +454 -388
  3. package/bundles/ngx-toastr.umd.js.map +1 -1
  4. package/bundles/ngx-toastr.umd.min.js +1 -15
  5. package/bundles/ngx-toastr.umd.min.js.map +1 -1
  6. package/esm2015/ngx-toastr.js +1 -1
  7. package/esm2015/overlay/overlay-container.js +7 -10
  8. package/esm2015/overlay/overlay-ref.js +1 -1
  9. package/esm2015/overlay/overlay.js +9 -11
  10. package/esm2015/portal/dom-portal-host.js +1 -1
  11. package/esm2015/portal/portal.js +1 -1
  12. package/esm2015/public_api.js +1 -1
  13. package/esm2015/toastr/toast-injector.js +1 -1
  14. package/esm2015/toastr/toast-noanimation.component.js +34 -46
  15. package/esm2015/toastr/toast.component.js +35 -46
  16. package/esm2015/toastr/toast.directive.js +17 -20
  17. package/esm2015/toastr/toastr-config.js +2 -1
  18. package/esm2015/toastr/toastr.module.js +19 -23
  19. package/esm2015/toastr/toastr.service.js +21 -21
  20. package/fesm2015/ngx-toastr.js +130 -148
  21. package/fesm2015/ngx-toastr.js.map +1 -1
  22. package/ngx-toastr.metadata.json +1 -1
  23. package/package.json +7 -10
  24. package/portal/portal.d.ts +1 -1
  25. package/toastr/toast.component.d.ts +1 -1
  26. package/toastr/toastr-config.d.ts +8 -2
  27. package/toastr/toastr.service.d.ts +7 -5
  28. package/esm5/ngx-toastr.js +0 -5
  29. package/esm5/overlay/overlay-container.js +0 -49
  30. package/esm5/overlay/overlay-ref.js +0 -23
  31. package/esm5/overlay/overlay.js +0 -91
  32. package/esm5/portal/dom-portal-host.js +0 -58
  33. package/esm5/portal/portal.js +0 -67
  34. package/esm5/public_api.js +0 -12
  35. package/esm5/toastr/toast-injector.js +0 -90
  36. package/esm5/toastr/toast-noanimation.component.js +0 -216
  37. package/esm5/toastr/toast.component.js +0 -226
  38. package/esm5/toastr/toast.directive.js +0 -34
  39. package/esm5/toastr/toastr-config.js +0 -73
  40. package/esm5/toastr/toastr.module.js +0 -64
  41. package/esm5/toastr/toastr.service.js +0 -229
  42. package/fesm5/ngx-toastr.js +0 -1168
  43. package/fesm5/ngx-toastr.js.map +0 -1
@@ -1,1168 +0,0 @@
1
- import { __decorate, __extends, __param, __assign, __values } from 'tslib';
2
- import { ElementRef, Directive, NgModule, InjectionToken, Inject, ɵɵdefineInjectable, ɵɵinject, Injectable, ComponentFactoryResolver, ApplicationRef, SecurityContext, Injector, NgZone, INJECTOR, HostBinding, HostListener, Component } from '@angular/core';
3
- import { trigger, state, style, transition, animate } from '@angular/animations';
4
- import { Subject } from 'rxjs';
5
- import { DomSanitizer } from '@angular/platform-browser';
6
- import { DOCUMENT, CommonModule } from '@angular/common';
7
-
8
- var ToastContainerDirective = /** @class */ (function () {
9
- function ToastContainerDirective(el) {
10
- this.el = el;
11
- }
12
- ToastContainerDirective.prototype.getContainerElement = function () {
13
- return this.el.nativeElement;
14
- };
15
- ToastContainerDirective.ctorParameters = function () { return [
16
- { type: ElementRef }
17
- ]; };
18
- ToastContainerDirective = __decorate([
19
- Directive({
20
- selector: '[toastContainer]',
21
- exportAs: 'toastContainer',
22
- })
23
- ], ToastContainerDirective);
24
- return ToastContainerDirective;
25
- }());
26
- var ToastContainerModule = /** @class */ (function () {
27
- function ToastContainerModule() {
28
- }
29
- ToastContainerModule = __decorate([
30
- NgModule({
31
- declarations: [ToastContainerDirective],
32
- exports: [ToastContainerDirective],
33
- })
34
- ], ToastContainerModule);
35
- return ToastContainerModule;
36
- }());
37
-
38
- /**
39
- * Everything a toast needs to launch
40
- */
41
- var ToastPackage = /** @class */ (function () {
42
- function ToastPackage(toastId, config, message, title, toastType, toastRef) {
43
- var _this = this;
44
- this.toastId = toastId;
45
- this.config = config;
46
- this.message = message;
47
- this.title = title;
48
- this.toastType = toastType;
49
- this.toastRef = toastRef;
50
- this._onTap = new Subject();
51
- this._onAction = new Subject();
52
- this.toastRef.afterClosed().subscribe(function () {
53
- _this._onAction.complete();
54
- _this._onTap.complete();
55
- });
56
- }
57
- /** Fired on click */
58
- ToastPackage.prototype.triggerTap = function () {
59
- this._onTap.next();
60
- if (this.config.tapToDismiss) {
61
- this._onTap.complete();
62
- }
63
- };
64
- ToastPackage.prototype.onTap = function () {
65
- return this._onTap.asObservable();
66
- };
67
- /** available for use in custom toast */
68
- ToastPackage.prototype.triggerAction = function (action) {
69
- this._onAction.next(action);
70
- };
71
- ToastPackage.prototype.onAction = function () {
72
- return this._onAction.asObservable();
73
- };
74
- return ToastPackage;
75
- }());
76
- var DefaultNoComponentGlobalConfig = {
77
- maxOpened: 0,
78
- autoDismiss: false,
79
- newestOnTop: true,
80
- preventDuplicates: false,
81
- countDuplicates: false,
82
- resetTimeoutOnDuplicate: false,
83
- iconClasses: {
84
- error: 'toast-error',
85
- info: 'toast-info',
86
- success: 'toast-success',
87
- warning: 'toast-warning',
88
- },
89
- // Individual
90
- closeButton: false,
91
- disableTimeOut: false,
92
- timeOut: 5000,
93
- extendedTimeOut: 1000,
94
- enableHtml: false,
95
- progressBar: false,
96
- toastClass: 'ngx-toastr',
97
- positionClass: 'toast-top-right',
98
- titleClass: 'toast-title',
99
- messageClass: 'toast-message',
100
- easing: 'ease-in',
101
- easeTime: 300,
102
- tapToDismiss: true,
103
- onActivateTick: false,
104
- progressAnimation: 'decreasing',
105
- };
106
- var TOAST_CONFIG = new InjectionToken('ToastConfig');
107
-
108
- /**
109
- * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
110
- */
111
- var ComponentPortal = /** @class */ (function () {
112
- function ComponentPortal(component, injector) {
113
- this.component = component;
114
- this.injector = injector;
115
- }
116
- /** Attach this portal to a host. */
117
- ComponentPortal.prototype.attach = function (host, newestOnTop) {
118
- this._attachedHost = host;
119
- return host.attach(this, newestOnTop);
120
- };
121
- /** Detach this portal from its host */
122
- ComponentPortal.prototype.detach = function () {
123
- var host = this._attachedHost;
124
- if (host) {
125
- this._attachedHost = undefined;
126
- return host.detach();
127
- }
128
- };
129
- Object.defineProperty(ComponentPortal.prototype, "isAttached", {
130
- /** Whether this portal is attached to a host. */
131
- get: function () {
132
- return this._attachedHost != null;
133
- },
134
- enumerable: true,
135
- configurable: true
136
- });
137
- /**
138
- * Sets the PortalHost reference without performing `attach()`. This is used directly by
139
- * the PortalHost when it is performing an `attach()` or `detach()`.
140
- */
141
- ComponentPortal.prototype.setAttachedHost = function (host) {
142
- this._attachedHost = host;
143
- };
144
- return ComponentPortal;
145
- }());
146
- /**
147
- * Partial implementation of PortalHost that only deals with attaching a
148
- * ComponentPortal
149
- */
150
- var BasePortalHost = /** @class */ (function () {
151
- function BasePortalHost() {
152
- }
153
- BasePortalHost.prototype.attach = function (portal, newestOnTop) {
154
- this._attachedPortal = portal;
155
- return this.attachComponentPortal(portal, newestOnTop);
156
- };
157
- BasePortalHost.prototype.detach = function () {
158
- if (this._attachedPortal) {
159
- this._attachedPortal.setAttachedHost();
160
- }
161
- this._attachedPortal = undefined;
162
- if (this._disposeFn) {
163
- this._disposeFn();
164
- this._disposeFn = undefined;
165
- }
166
- };
167
- BasePortalHost.prototype.setDisposeFn = function (fn) {
168
- this._disposeFn = fn;
169
- };
170
- return BasePortalHost;
171
- }());
172
-
173
- /**
174
- * A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular
175
- * application context.
176
- *
177
- * This is the only part of the portal core that directly touches the DOM.
178
- */
179
- var DomPortalHost = /** @class */ (function (_super) {
180
- __extends(DomPortalHost, _super);
181
- function DomPortalHost(_hostDomElement, _componentFactoryResolver, _appRef) {
182
- var _this = _super.call(this) || this;
183
- _this._hostDomElement = _hostDomElement;
184
- _this._componentFactoryResolver = _componentFactoryResolver;
185
- _this._appRef = _appRef;
186
- return _this;
187
- }
188
- /**
189
- * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
190
- * @param portal Portal to be attached
191
- */
192
- DomPortalHost.prototype.attachComponentPortal = function (portal, newestOnTop) {
193
- var _this = this;
194
- var componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);
195
- var componentRef;
196
- // If the portal specifies a ViewContainerRef, we will use that as the attachment point
197
- // for the component (in terms of Angular's component tree, not rendering).
198
- // When the ViewContainerRef is missing, we use the factory to create the component directly
199
- // and then manually attach the ChangeDetector for that component to the application (which
200
- // happens automatically when using a ViewContainer).
201
- componentRef = componentFactory.create(portal.injector);
202
- // When creating a component outside of a ViewContainer, we need to manually register
203
- // its ChangeDetector with the application. This API is unfortunately not yet published
204
- // in Angular core. The change detector must also be deregistered when the component
205
- // is destroyed to prevent memory leaks.
206
- this._appRef.attachView(componentRef.hostView);
207
- this.setDisposeFn(function () {
208
- _this._appRef.detachView(componentRef.hostView);
209
- componentRef.destroy();
210
- });
211
- // At this point the component has been instantiated, so we move it to the location in the DOM
212
- // where we want it to be rendered.
213
- if (newestOnTop) {
214
- this._hostDomElement.insertBefore(this._getComponentRootNode(componentRef), this._hostDomElement.firstChild);
215
- }
216
- else {
217
- this._hostDomElement.appendChild(this._getComponentRootNode(componentRef));
218
- }
219
- return componentRef;
220
- };
221
- /** Gets the root HTMLElement for an instantiated component. */
222
- DomPortalHost.prototype._getComponentRootNode = function (componentRef) {
223
- return componentRef.hostView.rootNodes[0];
224
- };
225
- return DomPortalHost;
226
- }(BasePortalHost));
227
-
228
- /** Container inside which all toasts will render. */
229
- var OverlayContainer = /** @class */ (function () {
230
- function OverlayContainer(_document) {
231
- this._document = _document;
232
- }
233
- OverlayContainer.prototype.ngOnDestroy = function () {
234
- if (this._containerElement && this._containerElement.parentNode) {
235
- this._containerElement.parentNode.removeChild(this._containerElement);
236
- }
237
- };
238
- /**
239
- * This method returns the overlay container element. It will lazily
240
- * create the element the first time it is called to facilitate using
241
- * the container in non-browser environments.
242
- * @returns the container element
243
- */
244
- OverlayContainer.prototype.getContainerElement = function () {
245
- if (!this._containerElement) {
246
- this._createContainer();
247
- }
248
- return this._containerElement;
249
- };
250
- /**
251
- * Create the overlay container element, which is simply a div
252
- * with the 'cdk-overlay-container' class on the document body.
253
- */
254
- OverlayContainer.prototype._createContainer = function () {
255
- var container = this._document.createElement('div');
256
- container.classList.add('overlay-container');
257
- this._document.body.appendChild(container);
258
- this._containerElement = container;
259
- };
260
- OverlayContainer.ctorParameters = function () { return [
261
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
262
- ]; };
263
- OverlayContainer.ɵprov = ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(ɵɵinject(DOCUMENT)); }, token: OverlayContainer, providedIn: "root" });
264
- OverlayContainer = __decorate([
265
- Injectable({ providedIn: 'root' }),
266
- __param(0, Inject(DOCUMENT))
267
- ], OverlayContainer);
268
- return OverlayContainer;
269
- }());
270
-
271
- /**
272
- * Reference to an overlay that has been created with the Overlay service.
273
- * Used to manipulate or dispose of said overlay.
274
- */
275
- var OverlayRef = /** @class */ (function () {
276
- function OverlayRef(_portalHost) {
277
- this._portalHost = _portalHost;
278
- }
279
- OverlayRef.prototype.attach = function (portal, newestOnTop) {
280
- if (newestOnTop === void 0) { newestOnTop = true; }
281
- return this._portalHost.attach(portal, newestOnTop);
282
- };
283
- /**
284
- * Detaches an overlay from a portal.
285
- * @returns Resolves when the overlay has been detached.
286
- */
287
- OverlayRef.prototype.detach = function () {
288
- return this._portalHost.detach();
289
- };
290
- return OverlayRef;
291
- }());
292
-
293
- /**
294
- * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
295
- * used as a low-level building building block for other components. Dialogs, tooltips, menus,
296
- * selects, etc. can all be built using overlays. The service should primarily be used by authors
297
- * of re-usable components rather than developers building end-user applications.
298
- *
299
- * An overlay *is* a PortalHost, so any kind of Portal can be loaded into one.
300
- */
301
- var Overlay = /** @class */ (function () {
302
- function Overlay(_overlayContainer, _componentFactoryResolver, _appRef, _document) {
303
- this._overlayContainer = _overlayContainer;
304
- this._componentFactoryResolver = _componentFactoryResolver;
305
- this._appRef = _appRef;
306
- this._document = _document;
307
- // Namespace panes by overlay container
308
- this._paneElements = new Map();
309
- }
310
- /**
311
- * Creates an overlay.
312
- * @returns A reference to the created overlay.
313
- */
314
- Overlay.prototype.create = function (positionClass, overlayContainer) {
315
- // get existing pane if possible
316
- return this._createOverlayRef(this.getPaneElement(positionClass, overlayContainer));
317
- };
318
- Overlay.prototype.getPaneElement = function (positionClass, overlayContainer) {
319
- if (positionClass === void 0) { positionClass = ''; }
320
- if (!this._paneElements.get(overlayContainer)) {
321
- this._paneElements.set(overlayContainer, {});
322
- }
323
- if (!this._paneElements.get(overlayContainer)[positionClass]) {
324
- this._paneElements.get(overlayContainer)[positionClass] = this._createPaneElement(positionClass, overlayContainer);
325
- }
326
- return this._paneElements.get(overlayContainer)[positionClass];
327
- };
328
- /**
329
- * Creates the DOM element for an overlay and appends it to the overlay container.
330
- * @returns Newly-created pane element
331
- */
332
- Overlay.prototype._createPaneElement = function (positionClass, overlayContainer) {
333
- var pane = this._document.createElement('div');
334
- pane.id = 'toast-container';
335
- pane.classList.add(positionClass);
336
- pane.classList.add('toast-container');
337
- if (!overlayContainer) {
338
- this._overlayContainer.getContainerElement().appendChild(pane);
339
- }
340
- else {
341
- overlayContainer.getContainerElement().appendChild(pane);
342
- }
343
- return pane;
344
- };
345
- /**
346
- * Create a DomPortalHost into which the overlay content can be loaded.
347
- * @param pane The DOM element to turn into a portal host.
348
- * @returns A portal host for the given DOM element.
349
- */
350
- Overlay.prototype._createPortalHost = function (pane) {
351
- return new DomPortalHost(pane, this._componentFactoryResolver, this._appRef);
352
- };
353
- /**
354
- * Creates an OverlayRef for an overlay in the given DOM element.
355
- * @param pane DOM element for the overlay
356
- */
357
- Overlay.prototype._createOverlayRef = function (pane) {
358
- return new OverlayRef(this._createPortalHost(pane));
359
- };
360
- Overlay.ctorParameters = function () { return [
361
- { type: OverlayContainer },
362
- { type: ComponentFactoryResolver },
363
- { type: ApplicationRef },
364
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
365
- ]; };
366
- Overlay.ɵprov = ɵɵdefineInjectable({ factory: function Overlay_Factory() { return new Overlay(ɵɵinject(OverlayContainer), ɵɵinject(ComponentFactoryResolver), ɵɵinject(ApplicationRef), ɵɵinject(DOCUMENT)); }, token: Overlay, providedIn: "root" });
367
- Overlay = __decorate([
368
- Injectable({ providedIn: 'root' }),
369
- __param(3, Inject(DOCUMENT))
370
- ], Overlay);
371
- return Overlay;
372
- }());
373
-
374
- /**
375
- * Reference to a toast opened via the Toastr service.
376
- */
377
- var ToastRef = /** @class */ (function () {
378
- function ToastRef(_overlayRef) {
379
- this._overlayRef = _overlayRef;
380
- /** Count of duplicates of this toast */
381
- this.duplicatesCount = 0;
382
- /** Subject for notifying the user that the toast has finished closing. */
383
- this._afterClosed = new Subject();
384
- /** triggered when toast is activated */
385
- this._activate = new Subject();
386
- /** notifies the toast that it should close before the timeout */
387
- this._manualClose = new Subject();
388
- /** notifies the toast that it should reset the timeouts */
389
- this._resetTimeout = new Subject();
390
- /** notifies the toast that it should count a duplicate toast */
391
- this._countDuplicate = new Subject();
392
- }
393
- ToastRef.prototype.manualClose = function () {
394
- this._manualClose.next();
395
- this._manualClose.complete();
396
- };
397
- ToastRef.prototype.manualClosed = function () {
398
- return this._manualClose.asObservable();
399
- };
400
- ToastRef.prototype.timeoutReset = function () {
401
- return this._resetTimeout.asObservable();
402
- };
403
- ToastRef.prototype.countDuplicate = function () {
404
- return this._countDuplicate.asObservable();
405
- };
406
- /**
407
- * Close the toast.
408
- */
409
- ToastRef.prototype.close = function () {
410
- this._overlayRef.detach();
411
- this._afterClosed.next();
412
- this._manualClose.next();
413
- this._afterClosed.complete();
414
- this._manualClose.complete();
415
- this._activate.complete();
416
- this._resetTimeout.complete();
417
- this._countDuplicate.complete();
418
- };
419
- /** Gets an observable that is notified when the toast is finished closing. */
420
- ToastRef.prototype.afterClosed = function () {
421
- return this._afterClosed.asObservable();
422
- };
423
- ToastRef.prototype.isInactive = function () {
424
- return this._activate.isStopped;
425
- };
426
- ToastRef.prototype.activate = function () {
427
- this._activate.next();
428
- this._activate.complete();
429
- };
430
- /** Gets an observable that is notified when the toast has started opening. */
431
- ToastRef.prototype.afterActivate = function () {
432
- return this._activate.asObservable();
433
- };
434
- /** Reset the toast timouts and count duplicates */
435
- ToastRef.prototype.onDuplicate = function (resetTimeout, countDuplicate) {
436
- if (resetTimeout) {
437
- this._resetTimeout.next();
438
- }
439
- if (countDuplicate) {
440
- this._countDuplicate.next(++this.duplicatesCount);
441
- }
442
- };
443
- return ToastRef;
444
- }());
445
- /** Custom injector type specifically for instantiating components with a toast. */
446
- var ToastInjector = /** @class */ (function () {
447
- function ToastInjector(_toastPackage, _parentInjector) {
448
- this._toastPackage = _toastPackage;
449
- this._parentInjector = _parentInjector;
450
- }
451
- ToastInjector.prototype.get = function (token, notFoundValue, flags) {
452
- if (token === ToastPackage) {
453
- return this._toastPackage;
454
- }
455
- return this._parentInjector.get(token, notFoundValue, flags);
456
- };
457
- return ToastInjector;
458
- }());
459
-
460
- var ToastrService = /** @class */ (function () {
461
- function ToastrService(token, overlay, _injector, sanitizer, ngZone) {
462
- this.overlay = overlay;
463
- this._injector = _injector;
464
- this.sanitizer = sanitizer;
465
- this.ngZone = ngZone;
466
- this.currentlyActive = 0;
467
- this.toasts = [];
468
- this.index = 0;
469
- this.toastrConfig = __assign(__assign({}, token.default), token.config);
470
- if (token.config.iconClasses) {
471
- this.toastrConfig.iconClasses = __assign(__assign({}, token.default.iconClasses), token.config.iconClasses);
472
- }
473
- }
474
- /** show toast */
475
- ToastrService.prototype.show = function (message, title, override, type) {
476
- if (override === void 0) { override = {}; }
477
- if (type === void 0) { type = ''; }
478
- return this._preBuildNotification(type, message, title, this.applyConfig(override));
479
- };
480
- /** show successful toast */
481
- ToastrService.prototype.success = function (message, title, override) {
482
- if (override === void 0) { override = {}; }
483
- var type = this.toastrConfig.iconClasses.success || '';
484
- return this._preBuildNotification(type, message, title, this.applyConfig(override));
485
- };
486
- /** show error toast */
487
- ToastrService.prototype.error = function (message, title, override) {
488
- if (override === void 0) { override = {}; }
489
- var type = this.toastrConfig.iconClasses.error || '';
490
- return this._preBuildNotification(type, message, title, this.applyConfig(override));
491
- };
492
- /** show info toast */
493
- ToastrService.prototype.info = function (message, title, override) {
494
- if (override === void 0) { override = {}; }
495
- var type = this.toastrConfig.iconClasses.info || '';
496
- return this._preBuildNotification(type, message, title, this.applyConfig(override));
497
- };
498
- /** show warning toast */
499
- ToastrService.prototype.warning = function (message, title, override) {
500
- if (override === void 0) { override = {}; }
501
- var type = this.toastrConfig.iconClasses.warning || '';
502
- return this._preBuildNotification(type, message, title, this.applyConfig(override));
503
- };
504
- /**
505
- * Remove all or a single toast by id
506
- */
507
- ToastrService.prototype.clear = function (toastId) {
508
- var e_1, _a;
509
- try {
510
- // Call every toastRef manualClose function
511
- for (var _b = __values(this.toasts), _c = _b.next(); !_c.done; _c = _b.next()) {
512
- var toast = _c.value;
513
- if (toastId !== undefined) {
514
- if (toast.toastId === toastId) {
515
- toast.toastRef.manualClose();
516
- return;
517
- }
518
- }
519
- else {
520
- toast.toastRef.manualClose();
521
- }
522
- }
523
- }
524
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
525
- finally {
526
- try {
527
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
528
- }
529
- finally { if (e_1) throw e_1.error; }
530
- }
531
- };
532
- /**
533
- * Remove and destroy a single toast by id
534
- */
535
- ToastrService.prototype.remove = function (toastId) {
536
- var found = this._findToast(toastId);
537
- if (!found) {
538
- return false;
539
- }
540
- found.activeToast.toastRef.close();
541
- this.toasts.splice(found.index, 1);
542
- this.currentlyActive = this.currentlyActive - 1;
543
- if (!this.toastrConfig.maxOpened || !this.toasts.length) {
544
- return false;
545
- }
546
- if (this.currentlyActive < this.toastrConfig.maxOpened &&
547
- this.toasts[this.currentlyActive]) {
548
- var p = this.toasts[this.currentlyActive].toastRef;
549
- if (!p.isInactive()) {
550
- this.currentlyActive = this.currentlyActive + 1;
551
- p.activate();
552
- }
553
- }
554
- return true;
555
- };
556
- /**
557
- * Determines if toast message is already shown
558
- */
559
- ToastrService.prototype.findDuplicate = function (message, resetOnDuplicate, countDuplicates) {
560
- var e_2, _a;
561
- try {
562
- for (var _b = __values(this.toasts), _c = _b.next(); !_c.done; _c = _b.next()) {
563
- var toast = _c.value;
564
- if (toast.message === message) {
565
- toast.toastRef.onDuplicate(resetOnDuplicate, countDuplicates);
566
- return toast;
567
- }
568
- }
569
- }
570
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
571
- finally {
572
- try {
573
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
574
- }
575
- finally { if (e_2) throw e_2.error; }
576
- }
577
- return null;
578
- };
579
- /** create a clone of global config and apply individual settings */
580
- ToastrService.prototype.applyConfig = function (override) {
581
- if (override === void 0) { override = {}; }
582
- return __assign(__assign({}, this.toastrConfig), override);
583
- };
584
- /**
585
- * Find toast object by id
586
- */
587
- ToastrService.prototype._findToast = function (toastId) {
588
- for (var i = 0; i < this.toasts.length; i++) {
589
- if (this.toasts[i].toastId === toastId) {
590
- return { index: i, activeToast: this.toasts[i] };
591
- }
592
- }
593
- return null;
594
- };
595
- /**
596
- * Determines the need to run inside angular's zone then builds the toast
597
- */
598
- ToastrService.prototype._preBuildNotification = function (toastType, message, title, config) {
599
- var _this = this;
600
- if (config.onActivateTick) {
601
- return this.ngZone.run(function () {
602
- return _this._buildNotification(toastType, message, title, config);
603
- });
604
- }
605
- return this._buildNotification(toastType, message, title, config);
606
- };
607
- /**
608
- * Creates and attaches toast data to component
609
- * returns the active toast, or in case preventDuplicates is enabled the original/non-duplicate active toast.
610
- */
611
- ToastrService.prototype._buildNotification = function (toastType, message, title, config) {
612
- if (!config.toastComponent) {
613
- throw new Error('toastComponent required');
614
- }
615
- // max opened and auto dismiss = true
616
- // if timeout = 0 resetting it would result in setting this.hideTime = Date.now(). Hence, we only want to reset timeout if there is
617
- // a timeout at all
618
- var duplicate = this.findDuplicate(message, this.toastrConfig.resetTimeoutOnDuplicate && config.timeOut > 0, this.toastrConfig.countDuplicates);
619
- if (message && this.toastrConfig.preventDuplicates && duplicate !== null) {
620
- return duplicate;
621
- }
622
- this.previousToastMessage = message;
623
- var keepInactive = false;
624
- if (this.toastrConfig.maxOpened &&
625
- this.currentlyActive >= this.toastrConfig.maxOpened) {
626
- keepInactive = true;
627
- if (this.toastrConfig.autoDismiss) {
628
- this.clear(this.toasts[0].toastId);
629
- }
630
- }
631
- var overlayRef = this.overlay.create(config.positionClass, this.overlayContainer);
632
- this.index = this.index + 1;
633
- var sanitizedMessage = message;
634
- if (message && config.enableHtml) {
635
- sanitizedMessage = this.sanitizer.sanitize(SecurityContext.HTML, message);
636
- }
637
- var toastRef = new ToastRef(overlayRef);
638
- var toastPackage = new ToastPackage(this.index, config, sanitizedMessage, title, toastType, toastRef);
639
- var toastInjector = new ToastInjector(toastPackage, this._injector);
640
- var component = new ComponentPortal(config.toastComponent, toastInjector);
641
- var portal = overlayRef.attach(component, this.toastrConfig.newestOnTop);
642
- toastRef.componentInstance = portal.instance;
643
- var ins = {
644
- toastId: this.index,
645
- message: message || '',
646
- toastRef: toastRef,
647
- onShown: toastRef.afterActivate(),
648
- onHidden: toastRef.afterClosed(),
649
- onTap: toastPackage.onTap(),
650
- onAction: toastPackage.onAction(),
651
- portal: portal
652
- };
653
- if (!keepInactive) {
654
- this.currentlyActive = this.currentlyActive + 1;
655
- setTimeout(function () {
656
- ins.toastRef.activate();
657
- });
658
- }
659
- this.toasts.push(ins);
660
- return ins;
661
- };
662
- ToastrService.ctorParameters = function () { return [
663
- { type: undefined, decorators: [{ type: Inject, args: [TOAST_CONFIG,] }] },
664
- { type: Overlay },
665
- { type: Injector },
666
- { type: DomSanitizer },
667
- { type: NgZone }
668
- ]; };
669
- ToastrService.ɵprov = ɵɵdefineInjectable({ factory: function ToastrService_Factory() { return new ToastrService(ɵɵinject(TOAST_CONFIG), ɵɵinject(Overlay), ɵɵinject(INJECTOR), ɵɵinject(DomSanitizer), ɵɵinject(NgZone)); }, token: ToastrService, providedIn: "root" });
670
- ToastrService = __decorate([
671
- Injectable({ providedIn: 'root' }),
672
- __param(0, Inject(TOAST_CONFIG))
673
- ], ToastrService);
674
- return ToastrService;
675
- }());
676
-
677
- var Toast = /** @class */ (function () {
678
- function Toast(toastrService, toastPackage, ngZone) {
679
- var _this = this;
680
- this.toastrService = toastrService;
681
- this.toastPackage = toastPackage;
682
- this.ngZone = ngZone;
683
- /** width of progress bar */
684
- this.width = -1;
685
- /** a combination of toast type and options.toastClass */
686
- this.toastClasses = '';
687
- /** controls animation */
688
- this.state = {
689
- value: 'inactive',
690
- params: {
691
- easeTime: this.toastPackage.config.easeTime,
692
- easing: 'ease-in'
693
- }
694
- };
695
- this.message = toastPackage.message;
696
- this.title = toastPackage.title;
697
- this.options = toastPackage.config;
698
- this.originalTimeout = toastPackage.config.timeOut;
699
- this.toastClasses = toastPackage.toastType + " " + toastPackage.config.toastClass;
700
- this.sub = toastPackage.toastRef.afterActivate().subscribe(function () {
701
- _this.activateToast();
702
- });
703
- this.sub1 = toastPackage.toastRef.manualClosed().subscribe(function () {
704
- _this.remove();
705
- });
706
- this.sub2 = toastPackage.toastRef.timeoutReset().subscribe(function () {
707
- _this.resetTimeout();
708
- });
709
- this.sub3 = toastPackage.toastRef.countDuplicate().subscribe(function (count) {
710
- _this.duplicatesCount = count;
711
- });
712
- }
713
- Object.defineProperty(Toast.prototype, "displayStyle", {
714
- /** hides component when waiting to be displayed */
715
- get: function () {
716
- if (this.state.value === 'inactive') {
717
- return 'none';
718
- }
719
- },
720
- enumerable: true,
721
- configurable: true
722
- });
723
- Toast.prototype.ngOnDestroy = function () {
724
- this.sub.unsubscribe();
725
- this.sub1.unsubscribe();
726
- this.sub2.unsubscribe();
727
- this.sub3.unsubscribe();
728
- clearInterval(this.intervalId);
729
- clearTimeout(this.timeout);
730
- };
731
- /**
732
- * activates toast and sets timeout
733
- */
734
- Toast.prototype.activateToast = function () {
735
- var _this = this;
736
- this.state = __assign(__assign({}, this.state), { value: 'active' });
737
- if (!(this.options.disableTimeOut === true || this.options.disableTimeOut === 'timeOut') && this.options.timeOut) {
738
- this.outsideTimeout(function () { return _this.remove(); }, this.options.timeOut);
739
- this.hideTime = new Date().getTime() + this.options.timeOut;
740
- if (this.options.progressBar) {
741
- this.outsideInterval(function () { return _this.updateProgress(); }, 10);
742
- }
743
- }
744
- };
745
- /**
746
- * updates progress bar width
747
- */
748
- Toast.prototype.updateProgress = function () {
749
- if (this.width === 0 || this.width === 100 || !this.options.timeOut) {
750
- return;
751
- }
752
- var now = new Date().getTime();
753
- var remaining = this.hideTime - now;
754
- this.width = (remaining / this.options.timeOut) * 100;
755
- if (this.options.progressAnimation === 'increasing') {
756
- this.width = 100 - this.width;
757
- }
758
- if (this.width <= 0) {
759
- this.width = 0;
760
- }
761
- if (this.width >= 100) {
762
- this.width = 100;
763
- }
764
- };
765
- Toast.prototype.resetTimeout = function () {
766
- var _this = this;
767
- clearTimeout(this.timeout);
768
- clearInterval(this.intervalId);
769
- this.state = __assign(__assign({}, this.state), { value: 'active' });
770
- this.outsideTimeout(function () { return _this.remove(); }, this.originalTimeout);
771
- this.options.timeOut = this.originalTimeout;
772
- this.hideTime = new Date().getTime() + (this.options.timeOut || 0);
773
- this.width = -1;
774
- if (this.options.progressBar) {
775
- this.outsideInterval(function () { return _this.updateProgress(); }, 10);
776
- }
777
- };
778
- /**
779
- * tells toastrService to remove this toast after animation time
780
- */
781
- Toast.prototype.remove = function () {
782
- var _this = this;
783
- if (this.state.value === 'removed') {
784
- return;
785
- }
786
- clearTimeout(this.timeout);
787
- this.state = __assign(__assign({}, this.state), { value: 'removed' });
788
- this.outsideTimeout(function () { return _this.toastrService.remove(_this.toastPackage.toastId); }, +this.toastPackage.config.easeTime);
789
- };
790
- Toast.prototype.tapToast = function () {
791
- if (this.state.value === 'removed') {
792
- return;
793
- }
794
- this.toastPackage.triggerTap();
795
- if (this.options.tapToDismiss) {
796
- this.remove();
797
- }
798
- };
799
- Toast.prototype.stickAround = function () {
800
- if (this.state.value === 'removed') {
801
- return;
802
- }
803
- clearTimeout(this.timeout);
804
- this.options.timeOut = 0;
805
- this.hideTime = 0;
806
- // disable progressBar
807
- clearInterval(this.intervalId);
808
- this.width = 0;
809
- };
810
- Toast.prototype.delayedHideToast = function () {
811
- var _this = this;
812
- if ((this.options.disableTimeOut === true || this.options.disableTimeOut === 'extendedTimeOut') ||
813
- this.options.extendedTimeOut === 0 ||
814
- this.state.value === 'removed') {
815
- return;
816
- }
817
- this.outsideTimeout(function () { return _this.remove(); }, this.options.extendedTimeOut);
818
- this.options.timeOut = this.options.extendedTimeOut;
819
- this.hideTime = new Date().getTime() + (this.options.timeOut || 0);
820
- this.width = -1;
821
- if (this.options.progressBar) {
822
- this.outsideInterval(function () { return _this.updateProgress(); }, 10);
823
- }
824
- };
825
- Toast.prototype.outsideTimeout = function (func, timeout) {
826
- var _this = this;
827
- if (this.ngZone) {
828
- this.ngZone.runOutsideAngular(function () {
829
- return (_this.timeout = setTimeout(function () { return _this.runInsideAngular(func); }, timeout));
830
- });
831
- }
832
- else {
833
- this.timeout = setTimeout(function () { return func(); }, timeout);
834
- }
835
- };
836
- Toast.prototype.outsideInterval = function (func, timeout) {
837
- var _this = this;
838
- if (this.ngZone) {
839
- this.ngZone.runOutsideAngular(function () {
840
- return (_this.intervalId = setInterval(function () { return _this.runInsideAngular(func); }, timeout));
841
- });
842
- }
843
- else {
844
- this.intervalId = setInterval(function () { return func(); }, timeout);
845
- }
846
- };
847
- Toast.prototype.runInsideAngular = function (func) {
848
- if (this.ngZone) {
849
- this.ngZone.run(function () { return func(); });
850
- }
851
- else {
852
- func();
853
- }
854
- };
855
- Toast.ctorParameters = function () { return [
856
- { type: ToastrService },
857
- { type: ToastPackage },
858
- { type: NgZone }
859
- ]; };
860
- __decorate([
861
- HostBinding('class')
862
- ], Toast.prototype, "toastClasses", void 0);
863
- __decorate([
864
- HostBinding('@flyInOut')
865
- ], Toast.prototype, "state", void 0);
866
- __decorate([
867
- HostBinding('style.display')
868
- ], Toast.prototype, "displayStyle", null);
869
- __decorate([
870
- HostListener('click')
871
- ], Toast.prototype, "tapToast", null);
872
- __decorate([
873
- HostListener('mouseenter')
874
- ], Toast.prototype, "stickAround", null);
875
- __decorate([
876
- HostListener('mouseleave')
877
- ], Toast.prototype, "delayedHideToast", null);
878
- Toast = __decorate([
879
- Component({
880
- selector: '[toast-component]',
881
- template: "\n <button *ngIf=\"options.closeButton\" (click)=\"remove()\" class=\"toast-close-button\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div *ngIf=\"title\" [class]=\"options.titleClass\" [attr.aria-label]=\"title\">\n {{ title }} <ng-container *ngIf=\"duplicatesCount\">[{{ duplicatesCount + 1 }}]</ng-container>\n </div>\n <div *ngIf=\"message && options.enableHtml\" role=\"alertdialog\" aria-live=\"polite\"\n [class]=\"options.messageClass\" [innerHTML]=\"message\">\n </div>\n <div *ngIf=\"message && !options.enableHtml\" role=\"alertdialog\" aria-live=\"polite\"\n [class]=\"options.messageClass\" [attr.aria-label]=\"message\">\n {{ message }}\n </div>\n <div *ngIf=\"options.progressBar\">\n <div class=\"toast-progress\" [style.width]=\"width + '%'\"></div>\n </div>\n ",
882
- animations: [
883
- trigger('flyInOut', [
884
- state('inactive', style({ opacity: 0 })),
885
- state('active', style({ opacity: 1 })),
886
- state('removed', style({ opacity: 0 })),
887
- transition('inactive => active', animate('{{ easeTime }}ms {{ easing }}')),
888
- transition('active => removed', animate('{{ easeTime }}ms {{ easing }}'))
889
- ])
890
- ],
891
- preserveWhitespaces: false
892
- })
893
- ], Toast);
894
- return Toast;
895
- }());
896
-
897
- var DefaultGlobalConfig = __assign(__assign({}, DefaultNoComponentGlobalConfig), { toastComponent: Toast });
898
- var ToastrModule = /** @class */ (function () {
899
- function ToastrModule() {
900
- }
901
- ToastrModule_1 = ToastrModule;
902
- ToastrModule.forRoot = function (config) {
903
- if (config === void 0) { config = {}; }
904
- return {
905
- ngModule: ToastrModule_1,
906
- providers: [
907
- {
908
- provide: TOAST_CONFIG,
909
- useValue: {
910
- default: DefaultGlobalConfig,
911
- config: config,
912
- },
913
- },
914
- ],
915
- };
916
- };
917
- var ToastrModule_1;
918
- ToastrModule = ToastrModule_1 = __decorate([
919
- NgModule({
920
- imports: [CommonModule],
921
- declarations: [Toast],
922
- exports: [Toast],
923
- entryComponents: [Toast],
924
- })
925
- ], ToastrModule);
926
- return ToastrModule;
927
- }());
928
- var ToastrComponentlessModule = /** @class */ (function () {
929
- function ToastrComponentlessModule() {
930
- }
931
- ToastrComponentlessModule.forRoot = function (config) {
932
- if (config === void 0) { config = {}; }
933
- return {
934
- ngModule: ToastrModule,
935
- providers: [
936
- {
937
- provide: TOAST_CONFIG,
938
- useValue: {
939
- default: DefaultNoComponentGlobalConfig,
940
- config: config,
941
- },
942
- },
943
- ],
944
- };
945
- };
946
- ToastrComponentlessModule = __decorate([
947
- NgModule({
948
- imports: [CommonModule],
949
- })
950
- ], ToastrComponentlessModule);
951
- return ToastrComponentlessModule;
952
- }());
953
-
954
- var ToastNoAnimation = /** @class */ (function () {
955
- function ToastNoAnimation(toastrService, toastPackage, appRef) {
956
- var _this = this;
957
- this.toastrService = toastrService;
958
- this.toastPackage = toastPackage;
959
- this.appRef = appRef;
960
- /** width of progress bar */
961
- this.width = -1;
962
- /** a combination of toast type and options.toastClass */
963
- this.toastClasses = '';
964
- /** controls animation */
965
- this.state = 'inactive';
966
- this.message = toastPackage.message;
967
- this.title = toastPackage.title;
968
- this.options = toastPackage.config;
969
- this.originalTimeout = toastPackage.config.timeOut;
970
- this.toastClasses = toastPackage.toastType + " " + toastPackage.config.toastClass;
971
- this.sub = toastPackage.toastRef.afterActivate().subscribe(function () {
972
- _this.activateToast();
973
- });
974
- this.sub1 = toastPackage.toastRef.manualClosed().subscribe(function () {
975
- _this.remove();
976
- });
977
- this.sub2 = toastPackage.toastRef.timeoutReset().subscribe(function () {
978
- _this.resetTimeout();
979
- });
980
- this.sub3 = toastPackage.toastRef.countDuplicate().subscribe(function (count) {
981
- _this.duplicatesCount = count;
982
- });
983
- }
984
- Object.defineProperty(ToastNoAnimation.prototype, "displayStyle", {
985
- /** hides component when waiting to be displayed */
986
- get: function () {
987
- if (this.state === 'inactive') {
988
- return 'none';
989
- }
990
- },
991
- enumerable: true,
992
- configurable: true
993
- });
994
- ToastNoAnimation.prototype.ngOnDestroy = function () {
995
- this.sub.unsubscribe();
996
- this.sub1.unsubscribe();
997
- this.sub2.unsubscribe();
998
- this.sub3.unsubscribe();
999
- clearInterval(this.intervalId);
1000
- clearTimeout(this.timeout);
1001
- };
1002
- /**
1003
- * activates toast and sets timeout
1004
- */
1005
- ToastNoAnimation.prototype.activateToast = function () {
1006
- var _this = this;
1007
- this.state = 'active';
1008
- if (!(this.options.disableTimeOut === true || this.options.disableTimeOut === 'timeOut') && this.options.timeOut) {
1009
- this.timeout = setTimeout(function () {
1010
- _this.remove();
1011
- }, this.options.timeOut);
1012
- this.hideTime = new Date().getTime() + this.options.timeOut;
1013
- if (this.options.progressBar) {
1014
- this.intervalId = setInterval(function () { return _this.updateProgress(); }, 10);
1015
- }
1016
- }
1017
- if (this.options.onActivateTick) {
1018
- this.appRef.tick();
1019
- }
1020
- };
1021
- /**
1022
- * updates progress bar width
1023
- */
1024
- ToastNoAnimation.prototype.updateProgress = function () {
1025
- if (this.width === 0 || this.width === 100 || !this.options.timeOut) {
1026
- return;
1027
- }
1028
- var now = new Date().getTime();
1029
- var remaining = this.hideTime - now;
1030
- this.width = (remaining / this.options.timeOut) * 100;
1031
- if (this.options.progressAnimation === 'increasing') {
1032
- this.width = 100 - this.width;
1033
- }
1034
- if (this.width <= 0) {
1035
- this.width = 0;
1036
- }
1037
- if (this.width >= 100) {
1038
- this.width = 100;
1039
- }
1040
- };
1041
- ToastNoAnimation.prototype.resetTimeout = function () {
1042
- var _this = this;
1043
- clearTimeout(this.timeout);
1044
- clearInterval(this.intervalId);
1045
- this.state = 'active';
1046
- this.options.timeOut = this.originalTimeout;
1047
- this.timeout = setTimeout(function () { return _this.remove(); }, this.originalTimeout);
1048
- this.hideTime = new Date().getTime() + (this.originalTimeout || 0);
1049
- this.width = -1;
1050
- if (this.options.progressBar) {
1051
- this.intervalId = setInterval(function () { return _this.updateProgress(); }, 10);
1052
- }
1053
- };
1054
- /**
1055
- * tells toastrService to remove this toast after animation time
1056
- */
1057
- ToastNoAnimation.prototype.remove = function () {
1058
- var _this = this;
1059
- if (this.state === 'removed') {
1060
- return;
1061
- }
1062
- clearTimeout(this.timeout);
1063
- this.state = 'removed';
1064
- this.timeout = setTimeout(function () {
1065
- return _this.toastrService.remove(_this.toastPackage.toastId);
1066
- });
1067
- };
1068
- ToastNoAnimation.prototype.tapToast = function () {
1069
- if (this.state === 'removed') {
1070
- return;
1071
- }
1072
- this.toastPackage.triggerTap();
1073
- if (this.options.tapToDismiss) {
1074
- this.remove();
1075
- }
1076
- };
1077
- ToastNoAnimation.prototype.stickAround = function () {
1078
- if (this.state === 'removed') {
1079
- return;
1080
- }
1081
- clearTimeout(this.timeout);
1082
- this.options.timeOut = 0;
1083
- this.hideTime = 0;
1084
- // disable progressBar
1085
- clearInterval(this.intervalId);
1086
- this.width = 0;
1087
- };
1088
- ToastNoAnimation.prototype.delayedHideToast = function () {
1089
- var _this = this;
1090
- if ((this.options.disableTimeOut === true || this.options.disableTimeOut === 'extendedTimeOut') ||
1091
- this.options.extendedTimeOut === 0 ||
1092
- this.state === 'removed') {
1093
- return;
1094
- }
1095
- this.timeout = setTimeout(function () { return _this.remove(); }, this.options.extendedTimeOut);
1096
- this.options.timeOut = this.options.extendedTimeOut;
1097
- this.hideTime = new Date().getTime() + (this.options.timeOut || 0);
1098
- this.width = -1;
1099
- if (this.options.progressBar) {
1100
- this.intervalId = setInterval(function () { return _this.updateProgress(); }, 10);
1101
- }
1102
- };
1103
- ToastNoAnimation.ctorParameters = function () { return [
1104
- { type: ToastrService },
1105
- { type: ToastPackage },
1106
- { type: ApplicationRef }
1107
- ]; };
1108
- __decorate([
1109
- HostBinding('class')
1110
- ], ToastNoAnimation.prototype, "toastClasses", void 0);
1111
- __decorate([
1112
- HostBinding('style.display')
1113
- ], ToastNoAnimation.prototype, "displayStyle", null);
1114
- __decorate([
1115
- HostListener('click')
1116
- ], ToastNoAnimation.prototype, "tapToast", null);
1117
- __decorate([
1118
- HostListener('mouseenter')
1119
- ], ToastNoAnimation.prototype, "stickAround", null);
1120
- __decorate([
1121
- HostListener('mouseleave')
1122
- ], ToastNoAnimation.prototype, "delayedHideToast", null);
1123
- ToastNoAnimation = __decorate([
1124
- Component({
1125
- selector: '[toast-component]',
1126
- template: "\n <button *ngIf=\"options.closeButton\" (click)=\"remove()\" class=\"toast-close-button\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div *ngIf=\"title\" [class]=\"options.titleClass\" [attr.aria-label]=\"title\">\n {{ title }} <ng-container *ngIf=\"duplicatesCount\">[{{ duplicatesCount + 1 }}]</ng-container>\n </div>\n <div *ngIf=\"message && options.enableHtml\" role=\"alert\" aria-live=\"polite\"\n [class]=\"options.messageClass\" [innerHTML]=\"message\">\n </div>\n <div *ngIf=\"message && !options.enableHtml\" role=\"alert\" aria-live=\"polite\"\n [class]=\"options.messageClass\" [attr.aria-label]=\"message\">\n {{ message }}\n </div>\n <div *ngIf=\"options.progressBar\">\n <div class=\"toast-progress\" [style.width]=\"width + '%'\"></div>\n </div>\n "
1127
- })
1128
- ], ToastNoAnimation);
1129
- return ToastNoAnimation;
1130
- }());
1131
- var DefaultNoAnimationsGlobalConfig = __assign(__assign({}, DefaultNoComponentGlobalConfig), { toastComponent: ToastNoAnimation });
1132
- var ToastNoAnimationModule = /** @class */ (function () {
1133
- function ToastNoAnimationModule() {
1134
- }
1135
- ToastNoAnimationModule_1 = ToastNoAnimationModule;
1136
- ToastNoAnimationModule.forRoot = function (config) {
1137
- if (config === void 0) { config = {}; }
1138
- return {
1139
- ngModule: ToastNoAnimationModule_1,
1140
- providers: [
1141
- {
1142
- provide: TOAST_CONFIG,
1143
- useValue: {
1144
- default: DefaultNoAnimationsGlobalConfig,
1145
- config: config,
1146
- },
1147
- },
1148
- ],
1149
- };
1150
- };
1151
- var ToastNoAnimationModule_1;
1152
- ToastNoAnimationModule = ToastNoAnimationModule_1 = __decorate([
1153
- NgModule({
1154
- imports: [CommonModule],
1155
- declarations: [ToastNoAnimation],
1156
- exports: [ToastNoAnimation],
1157
- entryComponents: [ToastNoAnimation],
1158
- })
1159
- ], ToastNoAnimationModule);
1160
- return ToastNoAnimationModule;
1161
- }());
1162
-
1163
- /**
1164
- * Generated bundle index. Do not edit.
1165
- */
1166
-
1167
- export { BasePortalHost, ComponentPortal, DefaultGlobalConfig, DefaultNoAnimationsGlobalConfig, DefaultNoComponentGlobalConfig, Overlay, OverlayContainer, OverlayRef, TOAST_CONFIG, Toast, ToastContainerDirective, ToastContainerModule, ToastInjector, ToastNoAnimation, ToastNoAnimationModule, ToastPackage, ToastRef, ToastrComponentlessModule, ToastrModule, ToastrService };
1168
- //# sourceMappingURL=ngx-toastr.js.map