UNPKG

@serene-dev/toast-notifications

Version:

This is an Angular Toast Notification library.

1 lines 26.4 kB
{"version":3,"file":"serene-dev-toast-notifications.mjs","sources":["../../../../projects/toast-notifications/src/lib/toast-notifications.model.ts","../../../../projects/toast-notifications/src/lib/toast-notifications.internal.service.ts","../../../../projects/toast-notifications/src/lib/toast-notifications.service.ts","../../../../projects/toast-notifications/src/lib/toast-notifications.pipe.ts","../../../../projects/toast-notifications/src/lib/toast-notifications.component.ts","../../../../projects/toast-notifications/src/lib/toast-notifications.component.html","../../../../projects/toast-notifications/src/public-api.ts","../../../../projects/toast-notifications/src/serene-dev-toast-notifications.ts"],"sourcesContent":["import { Subject } from 'rxjs';\n\n/**\n * An interface to guide the creation of a notification.\n */\nexport interface IAddToastNotification {\n /**Text to display in the header of the notification */\n header: string;\n /**Message to display in the body of the notification */\n body?: string;\n /**Time to display the notification in milliseconds */\n duration?: number;\n /**Indicates if the notification stays up until the consumer triggers a close action */\n manuallyDismiss?: boolean;\n /**Indicates if the notification is in a loading state */\n loading?: boolean;\n /**Class name to wrap around the notification */\n toastClass?: string;\n /**Class icon name to use for the icon. Overrides the default icon set. */\n iconClass?: string;\n /**Preferred colour tag*/\n tag?: EToastTag | 0 | 1 | 2 | 3;\n /**Callback function to handle the expansion button click */\n expansionHandler?: (item: IToastNotification) => any;\n}\n\n/**\n * Interface for toast notification configuration\n * @remarks\n * This interface defines the structure for configuring toast notifications,\n * including their appearance, behavior, and actions.\n */\nexport interface IToastNotification extends IAddToastNotification {\n /**An RXJS observable the tells the subscriber when the notification is closed */\n closed: Subject<{\n /**Indicates if the closure was manually triggered or not */ manuallyClosed: boolean;\n }>;\n /**The id generated for the notification */\n id: string;\n /**Icon class */\n _iconClass?: string;\n /**Generated tag */\n _tag?: EToastTag;\n /**Date time when the notification was created */\n datetime: number;\n /**If the notification is expanded currently */\n expanded?: boolean;\n /**If the notification is expandable */\n expandable: boolean;\n} \n\n/**\n * Enum for the different notification tags\n */\nexport enum EToastTag {\n /** Danger */\n danger = 'DANGER',\n /** Success */\n success = 'SUCCESS',\n /** Info */\n info = 'INFO',\n /** Warning */\n warning = 'WARNING',\n}\n/**Maps tag enum values to tag numerical values */\nexport const ToastTagMap: { [e in EToastTag]: 0 | 1 | 2 | 3 } = {\n [EToastTag.danger]: 0,\n [EToastTag.success]: 1,\n [EToastTag.info]: 2,\n [EToastTag.warning]: 3,\n};\n/**Maps the numerical tags to the enums */\nexport const ToastTagReverseMap: { [e in 0 | 1 | 2 | 3]: EToastTag } = {\n 0: EToastTag.danger,\n 1: EToastTag.success,\n 2: EToastTag.info,\n 3: EToastTag.warning,\n};\n\n/**\n * General configuration for all instances of the toast notification\n */\nexport interface IToastComponentConfig {\n /**In milliseconds */\n defaultDuration: number;\n /**Show the expansion button */\n showExpansionButton?: boolean;\n /**Horizontal position of the notification panel */\n xPosition?: 'left' | 'right' | 'center';\n /**Function to handle the expansion button */\n expandHandler?: (item: IToastNotification) => any;\n}\n","import { Injectable, computed, inject, signal } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport {\n IToastNotification,\n IAddToastNotification,\n ToastTagReverseMap,\n EToastTag,\n IToastComponentConfig,\n} from './toast-notifications.model';\n\n/**Service to manage all instances of the notification component internally. */\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastNotificationsInternalService {\n protected readonly _toastNotifications = signal<{ [id: string]: IToastNotification }>({});\n\n readonly toastNotifications = computed(\n () => Object.values(this._toastNotifications())?.reverse() || ([] as IToastNotification[]),\n );\n\n protected readonly _config = signal<IToastComponentConfig>({\n showExpansionButton: true,\n xPosition: 'left',\n defaultDuration: 5000,\n });\n readonly config = computed(() => this._config());\n\n updateConfig(val: Partial<IToastComponentConfig>) {\n this._config.update((config) => ({ ...config, ...val }));\n }\n\n generateUUID = () => {\n let d = new Date().getTime();\n let d2 =\n (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0; //Time in microseconds since page-load or 0 if unsupported\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n let r = Math.random() * 16; //random number between 0 and 16\n if (d > 0) {\n //Use timestamp until depleted\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n //Use microseconds since page-load if supported\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n };\n\n /**\n * Adds a new notification item\n * @param item\n * @returns\n */\n addToastNotification = (item: IAddToastNotification) => {\n const id = this.generateUUID();\n\n const { defaultDuration } = this._config(),\n duration = item.manuallyDismiss ? null : item.duration || defaultDuration,\n closed: IToastNotification['closed'] = new Subject(),\n formattedItem = this.formatToast({\n ...item,\n duration,\n datetime: Date.now(),\n id,\n closed,\n expandable: false,\n });\n this._toastNotifications.update((map) => ({\n ...map,\n [id]: formattedItem,\n }));\n this.handleDuration(formattedItem);\n return {\n id,\n update: (update: Partial<IAddToastNotification>) => this.updateToastNotification(id, update),\n close: () => this.closeToastNotification(id, false),\n loader: {\n play: () => this.updateToastNotification(id, { loading: true }),\n stop: () => this.updateToastNotification(id, { loading: false }),\n },\n closed: closed,\n };\n };\n\n formatToast = (item: IToastNotification): IToastNotification => {\n item._tag =\n typeof item.tag == 'string' ? item.tag : ToastTagReverseMap[item.tag] || EToastTag.info;\n item._iconClass =\n item.iconClass ||\n `fa fa-${\n item._tag == EToastTag.success\n ? 'check-circle'\n : item._tag == EToastTag.info\n ? 'info-circle'\n : 'warning'\n }`;\n\n item.expandable = !!item.body;\n return item;\n };\n\n handleDuration = (item: Partial<IToastNotification>) => {\n if (item?.duration != null)\n setTimeout(() => this.closeToastNotification(item.id, false), item.duration || 0);\n };\n\n /**Update the details of a notification */\n updateToastNotification = (id: string, item: Partial<IAddToastNotification>) => {\n this._toastNotifications.update((map) => {\n if (!map[id]) return map;\n const f = this.formatToast({ ...map[id], ...item });\n this.handleDuration({ id, duration: f.duration });\n return { ...map, [id]: f };\n });\n };\n\n /**Toggle the expansion state of a notification */\n toggleToastNotification = (id: string, expand?: boolean) =>\n this._toastNotifications.update((map) => {\n if (!map[id]) return map;\n return {\n ...map,\n [id]: { ...map[id], expanded: expand == null ? !map[id].expanded : expand },\n };\n });\n\n /**Close a notification */\n closeToastNotification = (id: string, manualDismissal: boolean) => {\n return this._toastNotifications.update((map) => {\n if (map[id]) {\n map[id].closed.next({ manuallyClosed: manualDismissal });\n map[id].closed.complete();\n delete map[id];\n }\n return { ...map };\n });\n };\n}\n","import { Injectable, computed, inject } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport {\n IToastComponentConfig\n} from './toast-notifications.model';\nimport { ToastNotificationsInternalService } from './toast-notifications.internal.service';\n\n/**Service to manage all instances of the notification component. */\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastNotificationsService {\n /**Set this to configure a custom label formatter. */\n labelPipe: (value: string) => Observable<string>;\n\n protected internalService = inject(ToastNotificationsInternalService);\n\n /**Global configuration */\n readonly config = computed(() => this.internalService.config());\n\n /**\n * Update the global configuration.\n * @param val\n */\n updateConfig(val: Partial<IToastComponentConfig>) {\n this.internalService.updateConfig(val);\n }\n\n /**Shortcut functions for managing the notifications */\n toastShortcut = () => ({\n add: this.internalService.addToastNotification,\n close: this.internalService.closeToastNotification,\n // toggle: this.internalService.toggleToastNotification,\n update: this.internalService.updateToastNotification,\n });\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { ToastNotificationsService } from './toast-notifications.service';\nimport { Observable, of } from 'rxjs';\n\n/**\n * Value formatter pipe.\n */\n@Pipe({\n name: 'tnLabelPipe',\n standalone: true,\n})\nexport class ToastNotificationsLabelPipe implements PipeTransform {\n /**\n * Transforms the string texts passed into it using the preferred formatter function. The formatter function can be set in the Toast Notification Service\n * @param value\n * @returns\n */\n transform(value: string): Observable<string> {\n return this.service.labelPipe ? this.service.labelPipe(value) : of(value);\n }\n\n constructor(protected service: ToastNotificationsService) {}\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n effect,\n inject,\n input,\n output,\n} from '@angular/core';\nimport {\n IAddToastNotification,\n IToastComponentConfig,\n IToastNotification,\n} from './toast-notifications.model';\nimport { ToastNotificationsInternalService } from './toast-notifications.internal.service';\nimport { ToastNotificationsLabelPipe } from './toast-notifications.pipe';\n\n/**Toast notification component.\n *\n * Reference this in your app.html file to display the notifications in the root of your UI */\n@Component({\n selector: 'toast-notifications',\n templateUrl: './toast-notifications.component.html',\n styleUrl: './toast-notifications.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, ToastNotificationsLabelPipe],\n})\nexport class ToastNotificationsComponent {\n protected readonly service = inject(ToastNotificationsInternalService);\n protected readonly cdr = inject(ChangeDetectorRef);\n\n /**Specify if to show the expansion button for all notifications. It overrides the global settings. */\n readonly _showExpansionButton = input<IToastComponentConfig['showExpansionButton']>(undefined, {\n alias: 'showExpansionButton',\n });\n /**Horizontal position of the notification panel. It overrides the global settings. */\n readonly _xPosition = input<IToastComponentConfig['xPosition']>(undefined, {\n alias: 'xPosition',\n });\n /**Expansion handler in the event that the expand button is clicked. */\n readonly _expandHandler = input<IToastComponentConfig['expandHandler']>(undefined, {\n alias: 'expandHandler',\n });\n\n /**Output emitter to notify if the expansion button is clicked. */\n readonly expanded = output<IToastNotification>();\n\n protected readonly showExpansionButton = computed(() => {\n const genConfig = this.service.config();\n return this._showExpansionButton() != null\n ? this._showExpansionButton()\n : genConfig?.showExpansionButton;\n });\n\n protected readonly xPosition = computed(() => {\n const genConfig = this.service.config();\n return this._xPosition() != null ? this._xPosition() : genConfig?.xPosition;\n });\n\n protected readonly expandHandler = computed(() => {\n const genConfig = this.service.config();\n return this._expandHandler() != null ? this._expandHandler() : genConfig?.expandHandler;\n });\n\n protected readonly style = computed<{ [x: string]: any }>(() => {\n const xPosition = this.xPosition();\n if (xPosition == 'right') return { right: 0 };\n else if (xPosition == 'left') return { left: 0 };\n else if (xPosition == 'center')\n return { left: '50%', right: '50%', transform: 'translate(-50%, 0%)' };\n return {};\n });\n protected readonly notifications = computed(() => this.service.toastNotifications());\n\n protected readonly notificationsEffect = effect(() => {\n this.notifications();\n this.cdr.markForCheck();\n setTimeout(() => this.cdr.markForCheck(), 500);\n setTimeout(() => this.cdr.markForCheck(), 1000);\n });\n\n protected expand(item: IToastNotification) {\n (item.expansionHandler ?? this.expandHandler())?.(item);\n this.expanded.emit(item);\n }\n\n /**\n * Adds a new notification item\n * @param item\n * @returns\n */\n add(item: IAddToastNotification) {\n return this.service.addToastNotification(item);\n }\n /**\n * Close a notification item\n * @param id ID of the notification\n * @param manualDismissal Indicate if it is a manual dismissal\n * @returns\n */\n close(id: string, manualDismissal: boolean) {\n return this.service.closeToastNotification(id, manualDismissal);\n }\n /**\n * Update the details of a notification item\n * @param id ID of the notification\n * @param item Notification item\n * @returns\n */\n update(id: string, item: Partial<IAddToastNotification>) {\n return this.service.updateToastNotification(id, item);\n }\n}\n","<div class=\"toast-list\" [style]=\"style()\">\n @for (item of notifications(); track item.id) {\n <div class=\"toast-item toast-tag-{{ item._tag | lowercase }} {{ item.toastClass }} \">\n <div class=\"toast-item-content\" [style.width]=\"'calc(100% - ' + side.offsetWidth + 'px )'\">\n <div\n class=\"toast-item-header\"\n [ngClass]=\"{ compact: !item.expanded }\"\n (click)=\"service.toggleToastNotification(item.id)\"\n >\n <i class=\"toast-icon {{ item._iconClass }}\"></i>\n <span [innerHTML]=\"item.header | tnLabelPipe | async\"></span>\n </div>\n <!-- <hr [hidden]=\"!item.expanded\" class=\"toast-item-divider\" /> -->\n <div\n [hidden]=\"!item.expanded || !item.expandable\"\n class=\"toast-item-body\"\n [innerHTML]=\"item.body | tnLabelPipe | async\"\n ></div>\n </div>\n <div class=\"d-flex align-items-center\" #side>\n @if (item.loading) {\n <div class=\"toast-item-loader\">\n <i class=\"fa fa-spinner fa-spin\"></i>\n </div>\n }\n <div class=\"toast-item-action\">\n @if ((showExpansionButton() && item.expandable) || item.expansionHandler) {\n <button class=\"cbtn\" (click)=\"expand(item)\">\n <i class=\"fa fa-expand\"></i>\n </button>\n }\n <button class=\"cbtn\" (click)=\"service.closeToastNotification(item.id, true)\">\n <i class=\"fa fa-close\"></i>\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n","/*\n * Public API Surface of toast-notifications\n */\n\nexport * from './lib/toast-notifications.service';\nexport * from './lib/toast-notifications.component';\nexport * from './lib/toast-notifications.pipe';\nexport * from './lib/toast-notifications.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ToastNotificationsService"],"mappings":";;;;;;AAmDA;;AAEG;IACS;AAAZ,CAAA,UAAY,SAAS,EAAA;;AAEnB,IAAA,SAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EATW,SAAS,KAAT,SAAS,GASpB,EAAA,CAAA,CAAA;AACD;AACa,MAAA,WAAW,GAAwC;AAC9D,IAAA,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;AACrB,IAAA,CAAC,SAAS,CAAC,OAAO,GAAG,CAAC;AACtB,IAAA,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC;AACnB,IAAA,CAAC,SAAS,CAAC,OAAO,GAAG,CAAC;;AAExB;AACa,MAAA,kBAAkB,GAAwC;IACrE,CAAC,EAAE,SAAS,CAAC,MAAM;IACnB,CAAC,EAAE,SAAS,CAAC,OAAO;IACpB,CAAC,EAAE,SAAS,CAAC,IAAI;IACjB,CAAC,EAAE,SAAS,CAAC,OAAO;;;AClEtB;MAIa,iCAAiC,CAAA;AAH9C,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAuC,EAAE,CAAC;QAEhF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