ngx-toastr.js 46 KB

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