@odx/angular 5.3.4 → 5.5.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 (140) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/components/footer/README.md +3 -0
  3. package/components/footer/index.d.ts +3 -0
  4. package/components/footer/lib/footer.component.d.ts +23 -0
  5. package/components/footer/lib/footer.config.d.ts +30 -0
  6. package/components/footer/lib/footer.i18n.d.ts +3 -0
  7. package/components/footer/lib/helpers/create-footer-links.d.ts +12 -0
  8. package/components/footer/lib/helpers/index.d.ts +1 -0
  9. package/components/footer/lib/models/footer-link.d.ts +4 -0
  10. package/components/footer/lib/models/footer-variant.d.ts +5 -0
  11. package/components/footer/lib/models/index.d.ts +2 -0
  12. package/components/header/lib/header.component.d.ts +1 -1
  13. package/components/header-navigation/README.md +3 -0
  14. package/components/header-navigation/index.d.ts +3 -0
  15. package/components/header-navigation/lib/directives/header-navigation-link.directive.d.ts +11 -0
  16. package/components/header-navigation/lib/directives/index.d.ts +1 -0
  17. package/components/header-navigation/lib/header-navigation.component.d.ts +8 -0
  18. package/components/header-navigation/lib/header-navigation.module.d.ts +9 -0
  19. package/components/main-menu/lib/helpers/create-main-menu-links.d.ts +2 -1
  20. package/components/main-menu/lib/main-menu.component.d.ts +5 -5
  21. package/components/main-menu/lib/main-menu.config.d.ts +1 -0
  22. package/components/notification/README.md +3 -0
  23. package/components/notification/index.d.ts +7 -0
  24. package/components/notification/lib/components/index.d.ts +2 -0
  25. package/components/notification/lib/components/notification-center/notification-center.component.d.ts +19 -0
  26. package/components/notification/lib/components/notification-item/notification-item.component.d.ts +37 -0
  27. package/components/notification/lib/directives/index.d.ts +1 -0
  28. package/components/notification/lib/directives/notification-center.directive.d.ts +69 -0
  29. package/components/notification/lib/features/index.d.ts +5 -0
  30. package/components/notification/lib/features/with-browser-notifications.d.ts +17 -0
  31. package/components/notification/lib/features/with-load-notifications.d.ts +18 -0
  32. package/components/notification/lib/features/with-notification-transformer.d.ts +26 -0
  33. package/components/notification/lib/features/with-peristent-notifications.d.ts +63 -0
  34. package/components/notification/lib/features/with-save-notifications.d.ts +11 -0
  35. package/components/notification/lib/helpers/get-notifications-by-tag.d.ts +2 -0
  36. package/components/notification/lib/helpers/index.d.ts +3 -0
  37. package/components/notification/lib/helpers/sort-notifications.d.ts +3 -0
  38. package/components/notification/lib/helpers/to-notification-collection.d.ts +3 -0
  39. package/components/notification/lib/models/index.d.ts +8 -0
  40. package/components/notification/lib/models/notification-action.d.ts +2 -0
  41. package/components/notification/lib/models/notification-collection.d.ts +6 -0
  42. package/components/notification/lib/models/notification-feature.d.ts +5 -0
  43. package/components/notification/lib/models/notification-options.d.ts +7 -0
  44. package/components/notification/lib/models/notification-query.d.ts +2 -0
  45. package/components/notification/lib/models/notification-sort-fn.d.ts +2 -0
  46. package/components/notification/lib/models/notification.d.ts +6 -0
  47. package/components/notification/lib/models/notification.ref.d.ts +9 -0
  48. package/components/notification/lib/notification.config.d.ts +11 -0
  49. package/components/notification/lib/notification.i18n.d.ts +3 -0
  50. package/components/notification/lib/notification.logger.d.ts +3 -0
  51. package/components/notification/lib/notification.service.d.ts +110 -0
  52. package/components/notification/lib/notification.tokens.d.ts +4 -0
  53. package/components/notification/lib/services/index.d.ts +1 -0
  54. package/components/notification/lib/services/notification-center.service.d.ts +69 -0
  55. package/components/notification/testing/README.md +3 -0
  56. package/components/notification/testing/index.d.ts +1 -0
  57. package/components/notification/testing/lib/test-helpers.d.ts +5 -0
  58. package/components/toast/lib/toast.service.d.ts +30 -2
  59. package/esm2022/breakpoints/lib/directives/match-breakpoints.directive.mjs +3 -2
  60. package/esm2022/components/footer/index.mjs +4 -0
  61. package/esm2022/components/footer/lib/footer.component.mjs +51 -0
  62. package/esm2022/components/footer/lib/footer.config.mjs +29 -0
  63. package/esm2022/components/footer/lib/footer.i18n.mjs +19 -0
  64. package/esm2022/components/footer/lib/helpers/create-footer-links.mjs +25 -0
  65. package/esm2022/components/footer/lib/helpers/index.mjs +2 -0
  66. package/esm2022/components/footer/lib/models/footer-link.mjs +2 -0
  67. package/esm2022/components/footer/lib/models/footer-variant.mjs +5 -0
  68. package/esm2022/components/footer/lib/models/index.mjs +3 -0
  69. package/esm2022/components/footer/odx-angular-components-footer.mjs +5 -0
  70. package/esm2022/components/header/lib/header.component.mjs +3 -3
  71. package/esm2022/components/header-navigation/index.mjs +4 -0
  72. package/esm2022/components/header-navigation/lib/directives/header-navigation-link.directive.mjs +37 -0
  73. package/esm2022/components/header-navigation/lib/directives/index.mjs +2 -0
  74. package/esm2022/components/header-navigation/lib/header-navigation.component.mjs +28 -0
  75. package/esm2022/components/header-navigation/lib/header-navigation.module.mjs +19 -0
  76. package/esm2022/components/header-navigation/odx-angular-components-header-navigation.mjs +5 -0
  77. package/esm2022/components/main-menu/lib/helpers/create-main-menu-links.mjs +7 -4
  78. package/esm2022/components/main-menu/lib/main-menu.component.mjs +9 -11
  79. package/esm2022/components/main-menu/lib/main-menu.config.mjs +1 -1
  80. package/esm2022/components/notification/index.mjs +8 -0
  81. package/esm2022/components/notification/lib/components/index.mjs +3 -0
  82. package/esm2022/components/notification/lib/components/notification-center/notification-center.component.mjs +65 -0
  83. package/esm2022/components/notification/lib/components/notification-item/notification-item.component.mjs +65 -0
  84. package/esm2022/components/notification/lib/directives/index.mjs +2 -0
  85. package/esm2022/components/notification/lib/directives/notification-center.directive.mjs +142 -0
  86. package/esm2022/components/notification/lib/features/index.mjs +6 -0
  87. package/esm2022/components/notification/lib/features/with-browser-notifications.mjs +75 -0
  88. package/esm2022/components/notification/lib/features/with-load-notifications.mjs +45 -0
  89. package/esm2022/components/notification/lib/features/with-notification-transformer.mjs +34 -0
  90. package/esm2022/components/notification/lib/features/with-peristent-notifications.mjs +94 -0
  91. package/esm2022/components/notification/lib/features/with-save-notifications.mjs +45 -0
  92. package/esm2022/components/notification/lib/helpers/get-notifications-by-tag.mjs +7 -0
  93. package/esm2022/components/notification/lib/helpers/index.mjs +4 -0
  94. package/esm2022/components/notification/lib/helpers/sort-notifications.mjs +10 -0
  95. package/esm2022/components/notification/lib/helpers/to-notification-collection.mjs +9 -0
  96. package/esm2022/components/notification/lib/models/index.mjs +9 -0
  97. package/esm2022/components/notification/lib/models/notification-action.mjs +2 -0
  98. package/esm2022/components/notification/lib/models/notification-collection.mjs +2 -0
  99. package/esm2022/components/notification/lib/models/notification-feature.mjs +4 -0
  100. package/esm2022/components/notification/lib/models/notification-options.mjs +2 -0
  101. package/esm2022/components/notification/lib/models/notification-query.mjs +2 -0
  102. package/esm2022/components/notification/lib/models/notification-sort-fn.mjs +2 -0
  103. package/esm2022/components/notification/lib/models/notification.mjs +2 -0
  104. package/esm2022/components/notification/lib/models/notification.ref.mjs +2 -0
  105. package/esm2022/components/notification/lib/notification.config.mjs +11 -0
  106. package/esm2022/components/notification/lib/notification.i18n.mjs +11 -0
  107. package/esm2022/components/notification/lib/notification.logger.mjs +3 -0
  108. package/esm2022/components/notification/lib/notification.service.mjs +168 -0
  109. package/esm2022/components/notification/lib/notification.tokens.mjs +7 -0
  110. package/esm2022/components/notification/lib/services/index.mjs +2 -0
  111. package/esm2022/components/notification/lib/services/notification-center.service.mjs +96 -0
  112. package/esm2022/components/notification/odx-angular-components-notification.mjs +5 -0
  113. package/esm2022/components/notification/testing/index.mjs +2 -0
  114. package/esm2022/components/notification/testing/lib/test-helpers.mjs +33 -0
  115. package/esm2022/components/notification/testing/odx-angular-components-notification-testing.mjs +5 -0
  116. package/esm2022/components/toast/lib/components/toast-container/toast-container.component.mjs +6 -6
  117. package/esm2022/components/toast/lib/toast.service.mjs +38 -8
  118. package/esm2022/utils/lib/helpers/array.mjs +24 -1
  119. package/esm2022/utils/lib/helpers/build-website-url.mjs +24 -1
  120. package/fesm2022/odx-angular-breakpoints.mjs +2 -1
  121. package/fesm2022/odx-angular-breakpoints.mjs.map +1 -1
  122. package/fesm2022/odx-angular-components-footer.mjs +131 -0
  123. package/fesm2022/odx-angular-components-footer.mjs.map +1 -0
  124. package/fesm2022/odx-angular-components-header-navigation.mjs +84 -0
  125. package/fesm2022/odx-angular-components-header-navigation.mjs.map +1 -0
  126. package/fesm2022/odx-angular-components-header.mjs +2 -2
  127. package/fesm2022/odx-angular-components-header.mjs.map +1 -1
  128. package/fesm2022/odx-angular-components-main-menu.mjs +11 -9
  129. package/fesm2022/odx-angular-components-main-menu.mjs.map +1 -1
  130. package/fesm2022/odx-angular-components-notification-testing.mjs +39 -0
  131. package/fesm2022/odx-angular-components-notification-testing.mjs.map +1 -0
  132. package/fesm2022/odx-angular-components-notification.mjs +832 -0
  133. package/fesm2022/odx-angular-components-notification.mjs.map +1 -0
  134. package/fesm2022/odx-angular-components-toast.mjs +42 -11
  135. package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
  136. package/fesm2022/odx-angular-utils.mjs +46 -0
  137. package/fesm2022/odx-angular-utils.mjs.map +1 -1
  138. package/package.json +25 -1
  139. package/utils/lib/helpers/array.d.ts +23 -0
  140. package/utils/lib/helpers/build-website-url.d.ts +23 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odx-angular-components-notification.mjs","sources":["../../../../libs/angular/components/notification/src/lib/notification.i18n.ts","../../../../libs/angular/components/notification/src/lib/helpers/get-notifications-by-tag.ts","../../../../libs/angular/components/notification/src/lib/helpers/sort-notifications.ts","../../../../libs/angular/components/notification/src/lib/helpers/to-notification-collection.ts","../../../../libs/angular/components/notification/src/lib/notification.config.ts","../../../../libs/angular/components/notification/src/lib/notification.logger.ts","../../../../libs/angular/components/notification/src/lib/notification.tokens.ts","../../../../libs/angular/components/notification/src/lib/notification.service.ts","../../../../libs/angular/components/notification/src/lib/services/notification-center.service.ts","../../../../libs/angular/components/notification/src/lib/models/notification-feature.ts","../../../../libs/angular/components/notification/src/lib/features/with-load-notifications.ts","../../../../libs/angular/components/notification/src/lib/features/with-save-notifications.ts","../../../../libs/angular/components/notification/src/lib/features/with-peristent-notifications.ts","../../../../libs/angular/components/notification/src/lib/features/with-browser-notifications.ts","../../../../libs/angular/components/notification/src/lib/features/with-notification-transformer.ts","../../../../libs/angular/components/notification/src/lib/components/notification-item/notification-item.component.ts","../../../../libs/angular/components/notification/src/lib/components/notification-item/notification-item.component.html","../../../../libs/angular/components/notification/src/lib/components/notification-center/notification-center.component.ts","../../../../libs/angular/components/notification/src/lib/components/notification-center/notification-center.component.html","../../../../libs/angular/components/notification/src/lib/directives/notification-center.directive.ts","../../../../libs/angular/components/notification/src/odx-angular-components-notification.ts"],"sourcesContent":["import { TranslationObject } from '@odx/angular/internal/translate';\n\nexport default {\n en: {\n title: 'Notifications',\n dismissAll: 'Dismiss all',\n },\n de: {\n title: 'Benachrichtigungen',\n dismissAll: 'Alle entfernen',\n },\n} as TranslationObject;\n","import { NotificationQuery } from '../models';\n\nexport function getNotificationsByTags(...tags: Array<string | null | undefined>): NotificationQuery {\n const cachedTags = new Set(tags.filter(Boolean));\n\n return ({ options }) => {\n return cachedTags.size < 1 || options.tags.every((tag) => cachedTags.has(tag));\n };\n}\n","import { isFunction } from '@odx/angular/utils';\nimport { MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { NotificationRef, NotificationSortFn } from '../models';\n\nexport function sortNotifications(sortFn?: NotificationSortFn): MonoTypeOperatorFunction<NotificationRef[]> {\n return (source$) =>\n source$.pipe(\n tap((values) => {\n if (!isFunction(sortFn)) return;\n values.sort(sortFn);\n }),\n );\n}\n","import { OperatorFunction, map } from 'rxjs';\nimport { NotificationCollection, NotificationRef } from '../models';\n\nexport function toNotificationCollection(): OperatorFunction<NotificationRef[], NotificationCollection> {\n return (source$) =>\n source$.pipe(\n map((notificationRefs) => ({\n values: notificationRefs,\n count: notificationRefs.length,\n isEmpty: notificationRefs.length === 0,\n })),\n );\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { createConfigTokens, orderBy } from '@odx/angular/utils';\nimport { NotificationAction, NotificationFeature, NotificationOptions, NotificationRef, NotificationSortFn } from './models';\n\nexport interface NotificationConfig {\n defaultIdPrefix: string;\n options: NotificationOptions;\n sortFn: NotificationSortFn;\n tagToIconMap?: Record<string, string>;\n actionMap?: Record<string, NotificationAction>;\n}\n\nexport const { NotificationConfig, NotificationDefaultConfig, injectNotificationConfig, provideNotificationConfig } = createConfigTokens(\n 'Notification',\n '@odx/angular/components/notification',\n {\n options: { icon: 'core::globe', tags: [], dismissable: true },\n sortFn: orderBy<NotificationRef>('createdAt', 'DESC'),\n defaultIdPrefix: 'odx-notifications',\n } as NotificationConfig,\n);\n\nexport function provideNotifications(config?: Partial<NotificationConfig>, ...features: NotificationFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([provideNotificationConfig(config ?? {}), features]);\n}\n","import { Logger } from '@odx/angular/internal';\n\nexport default new Logger('@odx/angular/components/notification');\n","import { InjectionToken } from '@angular/core';\nimport { Queue } from '@odx/angular/utils';\nimport { NotificationRef } from './models';\n\nexport const ODX_NOTIFICATION_QUEUE = new InjectionToken<Queue<NotificationRef>>('@odx/angular/component/notifications::Queue', {\n providedIn: 'root',\n factory: () => new Queue(),\n});\n","import { Injectable, Injector, inject, runInInjectionContext } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { LocalizationService } from '@odx/angular/localization';\nimport { getUniqueId, isFunction } from '@odx/angular/utils';\nimport { Observable, filter, map, shareReplay } from 'rxjs';\nimport { sortNotifications, toNotificationCollection } from './helpers';\nimport { Notification, NotificationCollection, NotificationOptions, NotificationQuery, NotificationRef, NotificationSortFn } from './models';\nimport { injectNotificationConfig } from './notification.config';\nimport logger from './notification.logger';\nimport { ODX_NOTIFICATION_QUEUE } from './notification.tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class NotificationService {\n private readonly config = injectNotificationConfig();\n private readonly localizationService = inject(LocalizationService);\n private readonly queue = inject(ODX_NOTIFICATION_QUEUE);\n private readonly injector = inject(Injector);\n\n public readonly notifications$ = this.queue.value$.pipe(\n sortNotifications(this.config.sortFn),\n toNotificationCollection(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n public readonly unseenNotifications$ = this.notifications$.pipe(\n map((collection) => collection.values.filter(({ hasBeenSeen }) => !hasBeenSeen)),\n toNotificationCollection(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n public readonly onNotificationAdd$ = this.queue.onAdd$;\n public readonly onNotificationRemove$ = this.queue.onRemove$;\n public readonly onNotificationUpdate$ = this.queue.onUpdate$;\n public readonly onNotificationSeen$ = this.queue.onUpdate$.pipe(filter(({ hasBeenSeen }) => hasBeenSeen));\n\n /**\n * Fetches notifications filtered by a specified query and optionally sorted by a custom sort function.\n *\n * @param {NotificationQuery} query - A function or object to filter notifications.\n * @param {NotificationSortFn} [sortFn] - An optional sorting function to order the filtered notifications.\n * @returns {Observable<NotificationCollection>} An observable stream of the filtered (and optionally sorted) notification collection.\n * @example\n * // Fetch notifications with a specific tag, sorted by creation date\n * const sortedNotifications$ = notificationService.getNotificationsBy$(\n * notification => notification.tags.includes('important'),\n * (a, b) => b.createdAt - a.createdAt\n * );\n */\n public getNotificationsBy$(query: NotificationQuery, sortFn?: NotificationSortFn): Observable<NotificationCollection> {\n return this.queue.value$.pipe(\n map((notifications) => notifications.filter(query)),\n sortNotifications(sortFn),\n toNotificationCollection(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n\n /**\n * Loads a list of notifications into the service.\n *\n * @param {NotificationRef[]} refs - An array of notification references to be loaded.\n * @example\n * // Load multiple notifications at once\n * notificationService.load([\n * { id: '1', item: { title: 'Notification 1' }, options: {dismissable: true, icon: 'plus', tags: ['important']}, hasBeenSeen: false, createdAt: Date.now() },\n * { id: '2', item: { title: 'Notification 2' }, options: {dismissable: true, icon: 'plus', tags: ['important']}, hasBeenSeen: false, createdAt: Date.now() }\n * ]);\n */\n public load(refs: NotificationRef[]): void {\n this.queue.addMany(refs);\n }\n\n /**\n * Creates a new notification and adds it to the notification queue.\n *\n * @param {Notification} item - The notification to create.\n * @param {Partial<NotificationOptions>} [options] - Optional settings for the notification.\n * @example\n * // Create a new notification with custom options\n * notificationService.create(\n * { title: 'New Notification' },\n * { dismissable: true, icon: 'plus', tags: ['important'] }\n * );\n */\n public create(item: Notification, options?: Partial<NotificationOptions>): void {\n this.queue.add({\n id: item.id ?? getUniqueId(this.config.defaultIdPrefix),\n createdAt: Date.now(),\n item,\n options: this.resolveOptions(options),\n hasBeenSeen: false,\n });\n }\n\n /**\n * Marks a specific notification as seen.\n *\n * @param {NotificationRef} notificationRef - The reference to the notification to mark as seen.\n * @example\n * // Mark a notification as seen by its reference\n * notificationService.markAsSeen(notificationRef);\n */\n public markAsSeen(notificationRef: NotificationRef): void {\n if (notificationRef.hasBeenSeen) return;\n this.queue.add({ ...notificationRef, hasBeenSeen: true });\n }\n\n /**\n * Marks all notifications that match a specific query as seen.\n *\n * @param {NotificationQuery} query - The query to match notifications to mark as seen.\n * @example\n * // Mark all notifications with a specific tag as seen\n * notificationService.markAsSeenBy(notification => notification.tags.includes('important'));\n */\n public markAsSeenBy(query: NotificationQuery): void {\n for (const notificationRef of this.queue.toArray().filter(query)) {\n this.markAsSeen(notificationRef);\n }\n }\n\n /**\n * Dismisses a specific notification.\n *\n * @param {NotificationRef} notificationRef - The reference to the notification to dismiss.\n * @example\n * // Dismiss a notification by its reference\n * notificationService.dismiss(notificationRef);\n */\n public dismiss(notificationRef: NotificationRef): void {\n if (!notificationRef.options.dismissable) return;\n this.queue.remove(notificationRef);\n }\n\n /**\n * Dismisses all notifications that match a specific query.\n *\n * @param {NotificationQuery} query - The query to match notifications to dismiss.\n * @example\n * // Dismiss all notifications with a specific tag\n * notificationService.dismissBy(notification => notification.tags.includes('expired'));\n */\n public dismissBy(query: NotificationQuery): void {\n for (const item of this.queue.toArray().filter(query)) {\n this.dismiss(item);\n }\n }\n\n /**\n * Dismisses all notifications.\n *\n * @example\n * // Dismiss all notifications\n * notificationService.dismissAll();\n */\n public dismissAll(): void {\n this.queue.clear();\n }\n\n /**\n * Executes the action associated with a specific notification.\n *\n * @param {NotificationRef} notificationRef - The reference to the notification whose action to execute.\n * @example\n * // Execute action for a notification\n * notificationService.executeAction(notificationRef);\n */\n public executeAction(notificationRef: NotificationRef): void {\n if (!notificationRef.options.action) return;\n const actionFn = this.config.actionMap?.[notificationRef.options.action];\n if (!isFunction(actionFn)) {\n logger.warn(`Cannot find action ${notificationRef.options.action} for notification reference: ${notificationRef}`);\n return;\n }\n runInInjectionContext(this.injector, () => actionFn(notificationRef));\n }\n\n private resolveOptions(options?: Partial<NotificationOptions>): NotificationOptions {\n return deepmerge(this.config.options, options ?? {}, {\n icon: options?.icon ?? this.config.tagToIconMap?.[options?.tags?.[0] ?? ''] ?? this.config.options.icon,\n language: options?.language ?? this.localizationService.getActiveLanguage(),\n }) as NotificationOptions;\n }\n}\n","import { Injectable, computed, inject, signal } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { DynamicTextContent } from '@odx/angular/cdk/dynamic-view';\nimport { Observable, combineLatest, filter, isObservable, map, of, shareReplay, switchMap } from 'rxjs';\nimport { getNotificationsByTags, toNotificationCollection } from '../helpers';\nimport { NotificationRef, NotificationSortFn } from '../models';\nimport { NotificationService } from '../notification.service';\n\n/**\n * A service for managing the notification center. This service provides functionalities\n * to filter, sort, and manage actions on notifications.\n */\n@Injectable()\nexport class NotificationCenterService {\n private readonly currentTag = signal<string | null>(null);\n private readonly currentSortFn = signal<NotificationSortFn>(undefined);\n private readonly notificationService = inject(NotificationService);\n private readonly notificationQuery = computed(() => getNotificationsByTags(this.currentTag()));\n private readonly title = signal<DynamicTextContent | null>(null);\n\n public readonly title$ = toObservable(this.title).pipe(\n switchMap((title) => (isObservable(title) ? title : of(title))),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n public readonly notifications$ = combineLatest([toObservable(this.notificationQuery), toObservable(this.currentSortFn)]).pipe(\n switchMap(([query, sortFn]) => this.notificationService.getNotificationsBy$(query, sortFn)),\n );\n public readonly unseenNotifications$ = this.notifications$.pipe(\n map((collection) => collection.values.filter(({ hasBeenSeen }) => !hasBeenSeen)),\n toNotificationCollection(),\n );\n public onNotificationAdd$ = this.queryEvent(this.notificationService.onNotificationAdd$);\n public onNotificationUpdate$ = this.queryEvent(this.notificationService.onNotificationUpdate$);\n public onNotificationRemove$ = this.queryEvent(this.notificationService.onNotificationRemove$);\n public onNotificationSeen$ = this.queryEvent(this.notificationService.onNotificationSeen$);\n\n /**\n * Sets the title for the notification center. The title can be static text or an observable for dynamic content.\n *\n * @param {DynamicTextContent | null} [value] - The title content for the notification center.\n */\n public setTitle(value?: DynamicTextContent | null): void {\n this.title.set(value ?? null);\n }\n\n /**\n * Sets the current tag to filter notifications. Only notifications with this tag will be included.\n *\n * @param {string | null} [value] - The tag to filter notifications by.\n */\n public setTag(value?: string | null): void {\n this.currentTag.set(value ?? null);\n }\n\n /**\n * Sets the sort function used to order the notifications.\n *\n * @param {NotificationSortFn} [value] - The sort function to apply to the notifications.\n */\n public setSortFn(value?: NotificationSortFn): void {\n this.currentSortFn.set(value);\n }\n\n /**\n * Marks a given notification as seen. This does not remove the notification but updates its seen status.\n *\n * @param {NotificationRef} notificationRef - The reference to the notification to be marked as seen.\n */\n public markAsSeen(notificationRef: NotificationRef): void {\n this.notificationService.markAsSeen(notificationRef);\n }\n\n /**\n * Marks all current filtered notifications as seen.\n */\n public markAllAsSeen(): void {\n this.notificationService.markAsSeenBy(this.notificationQuery());\n }\n\n /**\n * Dismisses a specific notification.\n *\n * @param {NotificationRef} notificationRef - The reference to the notification to dismiss.\n */\n public dismiss(notificationRef: NotificationRef): void {\n this.notificationService.dismiss(notificationRef);\n }\n\n /**\n * Dismisses all notifications that match the current filter criteria.\n */\n public dismissAll(): void {\n this.notificationService.dismissBy(this.notificationQuery());\n }\n\n /**\n * Executes the action associated with a specific notification and marks it as seen.\n *\n * @param {NotificationRef} notificationRef - The reference to the notification whose action to execute.\n */\n public executeAction(notificationRef: NotificationRef): void {\n this.markAsSeen(notificationRef);\n this.notificationService.executeAction(notificationRef);\n }\n\n private queryEvent(source$: Observable<NotificationRef>): Observable<NotificationRef> {\n return combineLatest([source$, toObservable(this.notificationQuery)]).pipe(\n filter(([notificationRef, query]) => query(notificationRef)),\n map(([notificationRef]) => notificationRef),\n );\n }\n}\n","import { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type NotificationFeature = EnvironmentProviders & { ɵodxBrand: '@odx/angular/components/notification::NotificationFeature' };\n\nexport function makeNotificationFeature(provider: (Provider | NotificationFeature)[] | EnvironmentProviders): NotificationFeature {\n return provider as never as NotificationFeature;\n}\n","import { ENVIRONMENT_INITIALIZER, inject } from '@angular/core';\nimport { Observable, from, isObservable, of } from 'rxjs';\nimport { NotificationFeature, NotificationRef, makeNotificationFeature } from '../models';\nimport { NotificationService } from '../notification.service';\n\n/**\n * Type definition for a function that loads notifications.\n * Can return notifications directly as an array, as a Promise, or as an Observable.\n * @typedef {Function} LoadNotificationsFn\n * @returns {Observable<NotificationRef[]> | Promise<NotificationRef[]> | NotificationRef[]} The loaded notifications.\n */\nexport type LoadNotificationsFn = () => Observable<NotificationRef[]> | Promise<NotificationRef[]> | NotificationRef[];\n\n/**\n * Loads notifications using the provided `loadFn`. This function abstracts over the differences\n * between synchronous notifications, promises, and observables, providing a uniform Observable output.\n * @function loadNotifications\n * @param {LoadNotificationsFn} [loadFn] - An optional function to load notifications.\n * @returns {Observable<NotificationRef[]>} An Observable stream of notification references.\n */\nfunction loadNotifications(loadFn?: LoadNotificationsFn): Observable<NotificationRef[]> {\n const notifications = loadFn?.();\n if (isObservable(notifications)) {\n return notifications;\n }\n if (notifications instanceof Promise) {\n return from(notifications);\n }\n return of(notifications ?? []);\n}\n\n/**\n * Integrates notification loading into the application environment. This function uses the Angular\n * `ENVIRONMENT_INITIALIZER` to ensure that notifications are loaded as part of the application's\n * initialization process.\n * @function withLoadNotifications\n * @param {LoadNotificationsFn} loadFn - The function to load notifications.\n * @returns {NotificationFeature} A notification feature configured to load notifications at startup.\n */\nexport function withLoadNotifications(loadFn: LoadNotificationsFn): NotificationFeature {\n return makeNotificationFeature([\n {\n provide: ENVIRONMENT_INITIALIZER,\n useFactory: () => {\n const notificationService = inject(NotificationService);\n const notifications$ = loadNotifications(loadFn);\n\n return () => {\n notifications$.subscribe((notificationRefs) => notificationService.load(notificationRefs));\n };\n },\n multi: true,\n },\n ]);\n}\n","import { ENVIRONMENT_INITIALIZER, Injector, inject, runInInjectionContext } from '@angular/core';\nimport { Observable, firstValueFrom, isObservable } from 'rxjs';\nimport { NotificationFeature, NotificationRef, makeNotificationFeature } from '../models';\nimport { NotificationService } from '../notification.service';\n\nexport type SaveNotificationsFn = (notificationRefs: NotificationRef[]) => Observable<void> | Promise<void> | void;\n\n/**\n * Asynchronously saves notifications using the provided save function. It handles Observable and Promise results seamlessly.\n * @async\n * @function saveNotifications\n * @param {NotificationRef[]} notifications - The notifications to be saved.\n * @param {SaveNotificationsFn} [saveFn] - Optional custom save function.\n * @returns {Promise<void>} A promise that resolves when the save operation is complete.\n */\nasync function saveNotifications(notifications: NotificationRef[], saveFn?: SaveNotificationsFn): Promise<void> {\n const save = saveFn?.(notifications);\n if (isObservable(save)) {\n await firstValueFrom(save);\n } else if (save instanceof Promise) {\n await save;\n }\n}\n\n/**\n * Configures the application to automatically save notifications using a specified save function.\n * This setup integrates with Angular's environment initialization process to ensure notifications are saved as needed.\n * @function withSaveNotifications\n * @param {SaveNotificationsFn} saveFn - The function to save notifications.\n * @returns {NotificationFeature} A notification feature configured to automatically save notifications.\n */\nexport function withSaveNotifications(saveFn: SaveNotificationsFn): NotificationFeature {\n return makeNotificationFeature([\n {\n provide: ENVIRONMENT_INITIALIZER,\n useFactory: () => {\n const injector = Injector.create({ parent: inject(Injector), providers: [] });\n const notificationService = inject(NotificationService);\n const saveFnWithContext: SaveNotificationsFn = (notifications) => runInInjectionContext(injector, () => saveFn(notifications));\n\n return () => {\n notificationService.notifications$.subscribe(({ values }) => saveNotifications(values, saveFnWithContext));\n };\n },\n multi: true,\n },\n ]);\n}\n","import { DynamicTextContent } from '@odx/angular/cdk/dynamic-view';\nimport { deepmerge } from '@odx/angular/internal';\nimport { isFunction, isString } from '@odx/angular/utils';\nimport { firstValueFrom } from 'rxjs';\nimport { NotificationFeature, NotificationRef, makeNotificationFeature } from '../models';\nimport { LoadNotificationsFn, withLoadNotifications } from './with-load-notifications';\nimport { SaveNotificationsFn, withSaveNotifications } from './with-save-notifications';\n\nexport interface NotificationSerializer {\n serialize(value: NotificationRef[]): Promise<string>;\n deserialize(value: string): Promise<NotificationRef[]>;\n}\n\n/**\n * Implementation of NotificationSerializer for persistent storage.\n * @class PersistentNotificationSerializer\n * @implements {NotificationSerializer}\n */\nexport class PersistentNotificationSerializer implements NotificationSerializer {\n /**\n * Serializes an array of NotificationRef objects into a string.\n * @function serialize\n * @memberof NotificationSerializer\n * @param {NotificationRef[]} value - The notification references to serialize.\n * @returns {Promise<string>} A promise that resolves to the serialized string representation of notification references.\n */\n public async serialize(value: NotificationRef[]): Promise<string> {\n const serializedNotifications = await Promise.all(\n value.map(async (ref) =>\n deepmerge(ref, {\n item: {\n title: await this.serializeDynamicTextContent(ref.item.title),\n description: await this.serializeDynamicTextContent(ref.item.description),\n },\n }),\n ),\n );\n\n return JSON.stringify(serializedNotifications);\n }\n\n /**\n * Deserializes a string into an array of NotificationRef objects.\n * @function deserialize\n * @memberof NotificationSerializer\n * @param {string} value - The string representation of notification references to deserialize.\n * @returns {Promise<NotificationRef[]>} A promise that resolves to the deserialized notification references.\n */\n public async deserialize(value: string): Promise<NotificationRef[]> {\n return JSON.parse(value);\n }\n\n private async serializeDynamicTextContent(content?: DynamicTextContent): Promise<string> {\n if (!content) return '';\n if (isString(content)) return content;\n\n return firstValueFrom(content).catch(() => '');\n }\n}\n\nexport interface WithPersistentNotificationsStorageOptions {\n storageKey: string;\n storage: Storage;\n serializer: NotificationSerializer;\n idTransformer?: (notificationRef: NotificationRef) => string;\n}\n\nexport interface WithPersistentNotificationsOptions {\n initFn: LoadNotificationsFn;\n saveFn: SaveNotificationsFn;\n storageOptions: WithPersistentNotificationsStorageOptions;\n}\n\n/**\n * Initializes and returns a function for loading persistent notifications.\n * @function initPersistentNotifications\n * @param {WithPersistentNotificationsStorageOptions} options - The storage options including serializer and storage key.\n * @returns {LoadNotificationsFn} A function to load notifications from storage.\n */\nexport function initPersistentNotifications({\n storage,\n storageKey,\n serializer,\n idTransformer,\n}: WithPersistentNotificationsStorageOptions): LoadNotificationsFn {\n return async () => {\n const storedValue = storage.getItem(storageKey);\n if (!storedValue) return [];\n const notificationRefs = await serializer.deserialize(storedValue);\n\n if (isFunction(idTransformer)) {\n for (const notificationRef of notificationRefs) {\n notificationRef.item.id = notificationRef.id = idTransformer(notificationRef);\n }\n }\n\n return notificationRefs;\n };\n}\n\n/**\n * Returns a function for persisting notifications.\n * @function persistNotifications\n * @param {WithPersistentNotificationsStorageOptions} options - The storage options including serializer and storage key.\n * @returns {SaveNotificationsFn} A function to save notifications to storage.\n */\nexport function persistNotifications({ storage, storageKey, serializer }: WithPersistentNotificationsStorageOptions): SaveNotificationsFn {\n return async (notificationRefs: NotificationRef[]) => {\n storage.setItem(storageKey, await serializer.serialize(notificationRefs));\n };\n}\n\n/**\n * Configures the application to use persistent notifications, automatically loading from and saving to the configured storage.\n * @function withPersistentNotifications\n * @param {Partial<WithPersistentNotificationsOptions>} [options] - Optional configuration for persistent notifications.\n * @returns {NotificationFeature} A notification feature configured for persistence.\n */\nexport function withPersistentNotifications(options?: Partial<WithPersistentNotificationsOptions>): NotificationFeature {\n const storageOptions: WithPersistentNotificationsStorageOptions = {\n storageKey: options?.storageOptions?.storageKey ?? '@odx/angular/components/notification::Storage',\n storage: options?.storageOptions?.storage ?? localStorage,\n serializer: options?.storageOptions?.serializer ?? new PersistentNotificationSerializer(),\n };\n const initFn = options?.initFn ?? initPersistentNotifications(storageOptions);\n const saveFn = options?.saveFn ?? persistNotifications(storageOptions);\n\n return makeNotificationFeature([withLoadNotifications(initFn), withSaveNotifications(saveFn)]);\n}\n","import { ENVIRONMENT_INITIALIZER, inject } from '@angular/core';\nimport { NotificationFeature, NotificationRef, makeNotificationFeature } from '../models';\nimport { NotificationService } from '../notification.service';\nimport { NotificationSerializer, PersistentNotificationSerializer } from './with-peristent-notifications';\n\nexport type BrowserNotificationExtras = Omit<NotificationOptions, 'body' | 'timestamp'>;\nexport type BrowserNotification = Notification;\nexport type BrowserNotificationFactory = (notificationRef: NotificationRef) => BrowserNotification;\nexport type SendBrowserNotificationFn = (notificationRef: NotificationRef) => unknown;\n\nexport interface WithBrowserNotificationsOptions {\n sendFn?: SendBrowserNotificationFn;\n extras?: BrowserNotificationExtras;\n isEnabled?: boolean;\n}\n\n/**\n * Requests permission to display browser notifications and returns a boolean indicating whether permission was granted.\n * @async\n * @function requestBrowserNotificationPermissions\n * @returns {Promise<boolean>} A promise that resolves to `true` if permission is granted, otherwise `false`.\n */\nasync function requestBrowserNotificationPermissions(): Promise<boolean> {\n if (!('Notification' in window)) return false;\n if (Notification.permission === 'granted') return true;\n if (Notification.permission === 'denied') return false;\n const permission = await Notification.requestPermission();\n\n return permission === 'granted';\n}\n\n/**\n * Creates a function responsible for sending out browser notifications with the given options.\n * @function sendBrowserNotification\n * @param {NotificationSerializer} serializer - The serializer to use for notification data.\n * @param {BrowserNotificationExtras} [options] - Additional options for the browser notification.\n * @returns {SendBrowserNotificationFn} A function to send browser notifications.\n */\nfunction sendBrowserNotification(serializer: NotificationSerializer, options?: BrowserNotificationExtras): SendBrowserNotificationFn {\n return async (notificationRef) => {\n if (!('Notification' in window)) return;\n const [notificationObj] = await serializer.deserialize(await serializer.serialize([notificationRef]));\n if (!notificationObj || notificationObj.hasBeenSeen) return;\n const { createdAt, item } = notificationObj;\n new Notification(item.title as string, {\n tag: notificationRef.options.tags?.[0],\n lang: notificationRef.options.language,\n ...options,\n body: item.description as string,\n timestamp: createdAt,\n });\n };\n}\n\n/**\n * Configures the application to send browser notifications, using Angular's `ENVIRONMENT_INITIALIZER` for setup.\n * @function withBrowserNotifications\n * @param {WithBrowserNotificationsOptions} [options] - Optional configuration for browser notifications.\n * @returns {NotificationFeature} A notification feature for integration into the application environment.\n */\nexport function withBrowserNotifications(options?: WithBrowserNotificationsOptions): NotificationFeature {\n return makeNotificationFeature([\n {\n provide: ENVIRONMENT_INITIALIZER,\n useFactory: () => {\n const isEnabled = options?.isEnabled ?? true;\n if (!isEnabled) return () => void 0;\n const notificationService = inject(NotificationService);\n const serializer = new PersistentNotificationSerializer();\n const sendBrowserNotificationFn = options?.sendFn ?? sendBrowserNotification(serializer, options?.extras);\n\n return async () => {\n if (!isEnabled) return;\n const permissionsGranted = await requestBrowserNotificationPermissions();\n if (!permissionsGranted) return;\n notificationService.onNotificationAdd$.subscribe(sendBrowserNotificationFn);\n };\n },\n multi: true,\n },\n ]);\n}\n","import { InjectionToken, inject } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { NotificationFeature, NotificationRef, makeNotificationFeature } from '../models';\n\nexport type NotificationTransformFn = (ref: NotificationRef) => Observable<NotificationRef>;\n\n/**\n * An InjectionToken for the NotificationTransformFn. This token can be used to inject\n * a custom notification transformation function into the Angular DI system.\n * @type {InjectionToken<NotificationTransformFn>}\n */\nexport const ODX_NOTIFICATION_TRANSFORMER = new InjectionToken<NotificationTransformFn>('@odx/angular/components/notification::NotificationTransformer');\n\n/**\n * Attempts to inject a NotificationTransformFn from the Angular DI system.\n * If no provider is found, it returns null.\n * @function injectNotificationTransform\n * @returns {NotificationTransformFn | null} The injected NotificationTransformFn, or null if not provided.\n */\nexport function injectNotificationTransform(): NotificationTransformFn | null {\n return inject(ODX_NOTIFICATION_TRANSFORMER, { optional: true });\n}\n\n/**\n * Configures a notification transformation function to be used within the application.\n * This function provides a mechanism to globally apply transformations to notifications\n * before they are processed or displayed.\n * @function withNotificationTransform\n * @param {NotificationTransformFn} transformFn - The function to transform notifications.\n * @returns {NotificationFeature} A NotificationFeature configured with the provided transformation function.\n */\nexport function withNotificationTransform(transformFn: NotificationTransformFn): NotificationFeature {\n return makeNotificationFeature([\n {\n provide: ODX_NOTIFICATION_TRANSFORMER,\n useValue: transformFn,\n },\n ]);\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { AvatarComponent } from '@odx/angular/components/avatar';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\nimport { Observable, of } from 'rxjs';\nimport { injectNotificationTransform } from '../../features';\nimport { NotificationRef } from '../../models';\n\n/**\n * A component for displaying notifications.\n * Supports customization through dynamic transformation of notification data.\n * Utilizes the OnPush change detection strategy for better performance in large applications.\n *\n * @component\n */\n@CSSComponent('notification-item')\n@Component({\n selector: 'odx-notification-item',\n standalone: true,\n imports: [AvatarComponent, ActionGroupComponent, ButtonComponent, CommonModule, DynamicViewDirective, IconComponent],\n templateUrl: './notification-item.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NotificationItemComponent {\n private readonly transformNotification = injectNotificationTransform();\n private _notificationRef!: NotificationRef;\n\n protected transformedNotification!: Observable<NotificationRef>;\n\n public readonly element = injectElement();\n\n /**\n * Input property to set the notification. On setting, it transforms the notification for display.\n * This transformation can be a custom logic provided through dependency injection.\n *\n * @param value NotificationRef - The notification object to be displayed.\n */\n @Input({ required: true })\n public set notification(value: NotificationRef) {\n this._notificationRef = value;\n this.transformedNotification = this.transformNotification?.(value) ?? of(value);\n }\n\n /**\n * Getter for the notification property.\n *\n * @returns NotificationRef - The current notification reference stored in the component.\n */\n public get notification() {\n return this._notificationRef;\n }\n\n /**\n * An event emitter for dismissing the notification.\n * It emits the notification reference that was dismissed.\n */\n @Output()\n public dismiss = new EventEmitter<NotificationRef>();\n}\n","<ng-template [ngIf]=\"transformedNotification | async\" let-ref>\n <odx-avatar class=\"odx-notification-item__avatar odx-no-margin\">\n <odx-icon [identifier]=\"ref.options.icon\" />\n </odx-avatar>\n <div class=\"odx-notification-item__title\">\n <ng-template [odxDynamicView]=\"ref.item.title\" />\n </div>\n <div class=\"odx-notification-item__description\" *ngIf=\"ref.item.description as description\">\n <ng-template [odxDynamicView]=\"ref.item.description\" />\n </div>\n</ng-template>\n<odx-action-group class=\"odx-notification-item__actions odx-no-margin\">\n <button odxButton class=\"odx-no-margin\" (click)=\"dismiss.next(notification)\" *ngIf=\"notification.options.dismissable\">\n <odx-icon name=\"close\" iconSet=\"core\"></odx-icon>\n </button>\n</odx-action-group>\n","import { transition, trigger, useAnimation } from '@angular/animations';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, OnDestroy, ViewEncapsulation, inject } from '@angular/core';\nimport { LetDirective } from '@ngrx/component';\nimport { collapse } from '@odx/angular/animations';\nimport { InteractiveDirective } from '@odx/angular/cdk/a11y';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { BadgeDirective } from '@odx/angular/components/badge';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { DropdownModule } from '@odx/angular/components/dropdown';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { ListModule } from '@odx/angular/components/list';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { TranslatePipe, provideTranslations } from '@odx/angular/internal/translate';\nimport { injectElement, trackById } from '@odx/angular/utils';\nimport { NotificationRef } from '../../models';\nimport notificationI18n from '../../notification.i18n';\nimport { NotificationCenterService } from '../../services';\nimport { NotificationItemComponent } from '../notification-item/notification-item.component';\n\n/**\n * A component for displaying and managing a list of notifications. It integrates various sub-components and directives to provide a rich user interface for notification interaction. Supports animations for notification transitions and leverages Angular's change detection strategies for performance.\n *\n * @CSSComponent 'notification-center' - Specifies the CSS class for styling the notification center component.\n */\n@CSSComponent('notification-center')\n@Component({\n selector: 'odx-notification-center',\n standalone: true,\n imports: [\n CommonModule,\n LetDirective,\n ActionGroupComponent,\n BadgeDirective,\n ButtonComponent,\n DynamicViewDirective,\n IconComponent,\n DropdownModule,\n TranslatePipe,\n NotificationItemComponent,\n InteractiveDirective,\n ListModule,\n ],\n templateUrl: './notification-center.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [provideTranslations(notificationI18n)],\n animations: [trigger('notificationAnimation', [transition(':leave', useAnimation(collapse, { delay: 150 }))])],\n})\nexport class NotificationCenterComponent implements OnDestroy {\n protected readonly notificationCenterService = inject(NotificationCenterService);\n protected readonly trackById = trackById;\n\n public readonly element = injectElement();\n\n public ngOnDestroy(): void {\n this.notificationCenterService.markAllAsSeen();\n }\n\n protected isMuted({ options, hasBeenSeen }: NotificationRef): boolean {\n return hasBeenSeen && !options.action;\n }\n}\n","<ng-template [ngIf]=\"notificationCenterService.notifications$ | async\" let-notifications>\n <h3 class=\"odx-notification-center__header\" *ngrxLet=\"notificationCenterService.title$ | async as title\">\n <ng-template [odxDynamicView]=\"title ?? ('title' | odxTranslate | async)\"></ng-template>\n </h3>\n <odx-list class=\"odx-notification-center__content\">\n <odx-list-item\n @notificationAnimation\n [muted]=\"isMuted(notification)\"\n [selected]=\"!notification.hasBeenSeen\"\n (click)=\"notificationCenterService.executeAction(notification)\"\n *ngFor=\"let notification of notifications.values; trackBy: trackById\"\n >\n <odx-notification-item [notification]=\"notification\" (dismiss)=\"notificationCenterService.dismiss(notification)\" />\n </odx-list-item>\n </odx-list>\n <div class=\"odx-notification-center__footer\">\n <button odxButton [disabled]=\"false\" (click)=\"notificationCenterService.dismissAll()\">\n {{ 'dismissAll' | odxTranslate | async }}\n </button>\n </div>\n</ng-template>\n","import { AfterViewInit, DestroyRef, Directive, Input, OnInit, Output, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DisabledController } from '@odx/angular';\nimport { DynamicTextContent } from '@odx/angular/cdk/dynamic-view';\nimport { BadgeDirective } from '@odx/angular/components/badge';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { Position } from '@odx/angular/utils';\nimport { Observable, map, merge, startWith, switchMap, tap } from 'rxjs';\nimport { NotificationCenterComponent } from '../components';\nimport { NotificationSortFn } from '../models';\nimport { NotificationCenterService } from '../services';\n\n/**\n * A directive that provides an interface for managing notifications.\n * It allows configuring a notification center with dynamic content, sorting, and badge display functionalities.\n */\n@Directive({\n standalone: true,\n selector: '[odxNotificationCenter]',\n hostDirectives: [{ directive: BadgeDirective, inputs: ['odxBadgeVariant:odxNotificationCenterBadgeVariant'] }, DropdownDirective],\n providers: [NotificationCenterService],\n})\nexport class NotificationCenterDirective implements OnInit, AfterViewInit {\n private readonly badgeDirective = inject(BadgeDirective, { self: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly disabledController = DisabledController.inject();\n private readonly dropdownDirective = inject(DropdownDirective, { self: true });\n private readonly notificationCenterService = inject(NotificationCenterService, { self: true });\n private readonly dropdownStateChange$ = merge(this.dropdownDirective.beforeOpen, this.dropdownDirective.beforeClose).pipe(startWith(void 0));\n private readonly badgeValue$ = this.notificationCenterService.unseenNotifications$.pipe(\n switchMap(({ count }) => this.dropdownStateChange$.pipe(map(() => this.formatBadgeValue(count)))),\n );\n\n /**\n * Sets the tag for filtering notifications. Only notifications with this tag will be shown in the notification center.\n * @param value The tag value to filter notifications. If null, all notifications are shown.\n */\n @Input('odxNotificationCenter')\n public set tag(value: string | null) {\n this.notificationCenterService.setTag(value);\n }\n\n /**\n * Sets the title of the notification center. The title can be dynamic and change based on the application state.\n * @param value The title content, which can be a string or an Observable returning a string. Allows for dynamic titles.\n */\n @Input('odxNotificationCenterTitle')\n public set title(value: DynamicTextContent | null) {\n this.notificationCenterService.setTitle(value);\n }\n\n /**\n * Sets the sorting function used to order notifications within the notification center.\n * @param value A function that compares two notifications and returns the sort order.\n *\n * @example\n * sortFfn = (a: NotificationRef, b: NotificationRef) => {\n if (a.createdAt < b.createdAt) return -1;\n if (a.createdAt > b.createdAt) return 1;\n return 0;\n };\n */\n @Input('odxNotificationCenterSortFn')\n public set sortFn(value: NotificationSortFn) {\n this.notificationCenterService.setSortFn(value);\n }\n\n /**\n * An event that is emitted when a new notification is added.\n * Listeners can use this event to react to new notifications being added to the notification center.\n */\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxNotificationCenterAdd')\n public notificationAdd = this.notificationCenterService.onNotificationAdd$;\n\n /**\n * An event that is emitted when a notification is updated.\n * This can be used to react to changes in notifications, such as their read status or content updates.\n */\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxNotificationCenterUpdate')\n public notificationUpdate = this.notificationCenterService.onNotificationUpdate$;\n\n /**\n * An event that is emitted when a notification is removed from the notification center.\n * Use this event to handle the removal of notifications, such as cleaning up resources or updating UI elements.\n */\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxNotificationCenterRemove')\n public notificationRemove = this.notificationCenterService.onNotificationRemove$;\n\n /**\n * An event that is emitted when a notification is marked as seen.\n * This event can be used to perform actions when the user acknowledges a notification.\n */\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxNotificationCenterSeen')\n public notificationSeen = this.notificationCenterService.onNotificationSeen$;\n\n public ngOnInit() {\n this.badgeDirective.position = Position.BOTTOM;\n this.badgeDirective.offset = 6;\n\n this.dropdownDirective.content = NotificationCenterComponent;\n this.dropdownDirective.options = {\n containerClass: 'odx-notification-center-overlay',\n position: Position.BOTTOM_END,\n enableFallback: false,\n };\n }\n\n public ngAfterViewInit() {\n merge(this.handleBadgeUpdates(), this.handleDropdownUpdates()).pipe(takeUntilDestroyed(this.destroyRef)).subscribe();\n }\n\n private formatBadgeValue(value: number): string | null {\n return this.dropdownDirective.isOpen || value === 0 ? null : value.toFixed(0);\n }\n\n private handleBadgeUpdates(): Observable<unknown> {\n return this.badgeValue$.pipe(\n tap((value: DynamicTextContent | null) => {\n this.badgeDirective.value = value as DynamicTextContent;\n this.badgeDirective.ngOnChanges();\n }),\n );\n }\n\n private handleDropdownUpdates(): Observable<unknown> {\n return this.notificationCenterService.notifications$.pipe(\n tap(({ isEmpty }) => {\n this.disabledController?.setDisabledState(isEmpty);\n if (!isEmpty) return;\n this.dropdownDirective.close();\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uBAAe;AACb,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,UAAU,EAAE,aAAa;AAC1B,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,oBAAoB;AAC3B,QAAA,UAAU,EAAE,gBAAgB;AAC7B,KAAA;CACmB;;ACTN,SAAA,sBAAsB,CAAC,GAAG,IAAsC,EAAA;AAC9E,IAAA,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAEjD,IAAA,OAAO,CAAC,EAAE,OAAO,EAAE,KAAI;QACrB,OAAO,UAAU,CAAC,IAAI,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACjF,KAAC,CAAC;AACJ;;ACJM,SAAU,iBAAiB,CAAC,MAA2B,EAAA;AAC3D,IAAA,OAAO,CAAC,OAAO,KACb,OAAO,CAAC,IAAI,CACV,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,QAAA,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO;AAChC,QAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACrB,CAAC,CACH,CAAC;AACN;;SCTgB,wBAAwB,GAA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EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,cAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,EAAA,mCAAA,CAAA,EAAA,EAAA,EAAA,SAAA,EAAAC,IAAA,CAAA,iBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAE3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBANvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,mDAAmD,CAAC,EAAE,EAAE,iBAAiB,CAAC;oBACjI,SAAS,EAAE,CAAC,yBAAyB,CAAC;AACvC,iBAAA,CAAA;8BAiBY,GAAG,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB,CAAA;gBAUnB,KAAK,EAAA,CAAA;sBADf,KAAK;uBAAC,4BAA4B,CAAA;gBAiBxB,MAAM,EAAA,CAAA;sBADhB,KAAK;uBAAC,6BAA6B,CAAA;gBAW7B,eAAe,EAAA,CAAA;sBADrB,MAAM;uBAAC,0BAA0B,CAAA;gBAS3B,kBAAkB,EAAA,CAAA;sBADxB,MAAM;uBAAC,6BAA6B,CAAA;gBAS9B,kBAAkB,EAAA,CAAA;sBADxB,MAAM;uBAAC,6BAA6B,CAAA;gBAS9B,gBAAgB,EAAA,CAAA;sBADtB,MAAM;uBAAC,2BAA2B,CAAA;;;AChGrC;;AAEG;;;;"}
@@ -10,7 +10,7 @@ import { ChipComponent } from '@odx/angular/components/chip';
10
10
  import { HeaderComponent } from '@odx/angular/components/header';
11
11
  import { deepmerge, CSSModifier, CSSComponent } from '@odx/angular/internal';
12
12
  import { createConfigTokens, Queue, getUniqueId, untilDestroyed, injectElement, trackById, px } from '@odx/angular/utils';
13
- import { Subject, share, timer, tap, map } from 'rxjs';
13
+ import { timer, tap, map } from 'rxjs';
14
14
  import { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';
15
15
  import { ActionGroupComponent } from '@odx/angular/components/action-group';
16
16
  import { ButtonComponent } from '@odx/angular/components/button';
@@ -24,23 +24,54 @@ const { ToastDefaultConfig, ToastConfig, injectToastConfig, provideToastConfig }
24
24
  class ToastService {
25
25
  constructor() {
26
26
  this.queue = new Queue();
27
- this.onRemove$$ = new Subject();
28
27
  this.defaultOptions = injectToastConfig();
29
- this.queue$ = this.queue.value$;
30
- this.onRemove$ = this.onRemove$$.pipe(share());
28
+ this.toasts$ = this.queue.value$;
29
+ this.onUpdate$ = this.queue.onUpdate$;
30
+ this.onToastAdd$ = this.queue.onAdd$;
31
+ this.onToastUpdate$ = this.queue.onUpdate$;
32
+ this.onToastRemove$ = this.queue.onRemove$;
33
+ /**
34
+ * @deprecated Use `toasts$` instead
35
+ */
36
+ this.queue$ = this.toasts$;
37
+ /**
38
+ * @deprecated Use `onToastAdd$` instead
39
+ */
40
+ this.onAdd$ = this.onToastAdd$;
41
+ /**
42
+ * @deprecated Use `onToastRemove$` instead
43
+ */
44
+ this.onRemove$ = this.onToastRemove$;
31
45
  }
46
+ /**
47
+ * @deprecated Use `create` instead
48
+ */
32
49
  add(item, options = {}) {
50
+ return this.create(item, options);
51
+ }
52
+ create(item, options = {}) {
33
53
  return this.queue.add({
34
54
  id: item.id ?? getUniqueId('odx-toast'),
35
55
  item,
36
56
  options: deepmerge(this.defaultOptions, options),
37
57
  });
38
58
  }
39
- remove(itemRef) {
40
- this.queue.remove(itemRef);
41
- this.onRemove$$.next(itemRef);
59
+ /**
60
+ * @deprecated Use `dismiss` instead
61
+ */
62
+ remove(refOrId) {
63
+ return this.dismiss(refOrId);
64
+ }
65
+ dismiss(refOrId) {
66
+ return this.queue.remove(refOrId);
42
67
  }
68
+ /**
69
+ * @deprecated Use `dismissAll` instead
70
+ */
43
71
  clear() {
72
+ return this.dismissAll();
73
+ }
74
+ dismissAll() {
44
75
  this.queue.clear();
45
76
  }
46
77
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -130,10 +161,10 @@ let ToastContainerComponent = class ToastContainerComponent {
130
161
  this.toastService = inject(ToastService);
131
162
  this.trackById = trackById;
132
163
  this.element = injectElement();
133
- this.items$ = this.toastService.queue$.pipe(map((refs) => refs.slice(0, this.maxItems)));
134
- this.hiddenToasts$ = this.toastService.queue$.pipe(map((refs) => Math.max(0, refs.length - this.maxItems)));
164
+ this.items$ = this.toastService.toasts$.pipe(map((refs) => refs.slice(0, this.maxItems)));
165
+ this.hiddenToasts$ = this.toastService.toasts$.pipe(map((refs) => Math.max(0, refs.length - this.maxItems)));
135
166
  this.maxItems = 3;
136
- this.dismiss = this.toastService.onRemove$;
167
+ this.dismiss = this.toastService.onToastRemove$;
137
168
  }
138
169
  static { ToastContainerComponent_1 = this; }
139
170
  static { this.INITIALIZED = false; }
@@ -151,7 +182,7 @@ let ToastContainerComponent = class ToastContainerComponent {
151
182
  ToastContainerComponent_1.INITIALIZED = false;
152
183
  }
153
184
  onDismiss(itemRef) {
154
- this.toastService.remove(itemRef);
185
+ this.toastService.dismiss(itemRef);
155
186
  }
156
187
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
157
188
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "16.2.12", type: ToastContainerComponent, isStandalone: true, selector: "odx-toast-container", inputs: { maxItems: ["maxItems", "maxItems", numberAttribute] }, outputs: { dismiss: "dismiss" }, ngImport: i0, template: "<odx-toast\n @slide\n [id]=\"toastRef.id\"\n [title]=\"toastRef.item.title\"\n [description]=\"toastRef.item.description\"\n [actions]=\"toastRef.item.actions ?? []\"\n [variant]=\"toastRef.item.variant\"\n [options]=\"toastRef.options\"\n (dismiss)=\"onDismiss(toastRef)\"\n *ngFor=\"let toastRef of items$ | async; trackBy: trackById\"\n></odx-toast>\n<odx-chip class=\"odx-toast-container__counter\" *ngIf=\"hiddenToasts$ | async as more\">{{ more }} more Notifications</odx-chip>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: ChipComponent, selector: "odx-chip", inputs: ["removable", "size", "variant"], outputs: ["remove"] }, { kind: "component", type: ToastItemComponent, selector: "odx-toast", inputs: ["id", "title", "description", "variant", "actions", "options"], outputs: ["dismiss"] }], animations: [
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-components-toast.mjs","sources":["../../../../libs/angular/components/toast/src/lib/toast.config.ts","../../../../libs/angular/components/toast/src/lib/toast.service.ts","../../../../libs/angular/components/toast/src/lib/models/toast-variant.ts","../../../../libs/angular/components/toast/src/lib/components/toast-item/toast-item.component.ts","../../../../libs/angular/components/toast/src/lib/components/toast-item/toast-item.component.html","../../../../libs/angular/components/toast/src/lib/components/toast-container/toast-container.component.ts","../../../../libs/angular/components/toast/src/lib/components/toast-container/toast-container.component.html","../../../../libs/angular/components/toast/src/lib/toast.module.ts","../../../../libs/angular/components/toast/src/odx-angular-components-toast.ts"],"sourcesContent":["import { createConfigTokens } from '@odx/angular/utils';\nimport { ToastOptions } from './models/toast.options';\n\nexport type ToastConfig = ToastOptions;\n\nexport const { ToastDefaultConfig, ToastConfig, injectToastConfig, provideToastConfig } = createConfigTokens('Toast', '@odx/angular/components/toast', {\n dismissable: true,\n duration: 0,\n} as ToastConfig);\n","import { Injectable } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { getUniqueId, Queue } from '@odx/angular/utils';\nimport { share, Subject } from 'rxjs';\nimport { Toast, ToastOptions, ToastRef } from './models';\nimport { injectToastConfig } from './toast.config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n private readonly queue = new Queue<ToastRef>();\n private readonly onRemove$$ = new Subject<ToastRef>();\n private readonly defaultOptions = injectToastConfig();\n\n public readonly queue$ = this.queue.value$;\n public readonly onRemove$ = this.onRemove$$.pipe(share());\n\n public add(item: Toast, options: Partial<ToastOptions> = {}): ToastRef {\n return this.queue.add({\n id: item.id ?? getUniqueId('odx-toast'),\n item,\n options: deepmerge(this.defaultOptions, options) as ToastOptions,\n });\n }\n\n public remove(itemRef: ToastRef): void {\n this.queue.remove(itemRef);\n this.onRemove$$.next(itemRef);\n }\n\n public clear(): void {\n this.queue.clear();\n }\n}\n","export type ToastVariant = (typeof ToastVariant)[keyof typeof ToastVariant];\n\nexport const ToastVariant = {\n DEFAULT: 'default',\n WARNING: 'warning',\n DANGER: 'danger',\n SUCCESS: 'success',\n} as const;\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';\nimport { DynamicTextContent, DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { injectElement, untilDestroyed } from '@odx/angular/utils';\nimport { tap, timer } from 'rxjs';\nimport { ToastAction, ToastOptions, ToastVariant } from '../../models';\n\n@CSSComponent('toast-item')\n@Component({\n selector: 'odx-toast',\n templateUrl: './toast-item.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CommonModule, IconComponent, ButtonComponent, DynamicViewDirective, ActionGroupComponent],\n host: {\n '[attr.id]': 'id',\n },\n})\nexport class ToastItemComponent implements OnInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n\n public readonly element = injectElement();\n\n public get icon(): string {\n switch (this.variant) {\n case ToastVariant.WARNING:\n return 'warning';\n case ToastVariant.DANGER:\n return 'error';\n case ToastVariant.SUCCESS:\n return 'check';\n default:\n return 'info';\n }\n }\n\n @Input()\n public id!: string;\n\n @Input()\n public title!: DynamicTextContent;\n\n @Input()\n public description?: DynamicTextContent | null;\n\n @CSSModifier()\n @Input()\n public variant?: ToastVariant | null = ToastVariant.DEFAULT;\n\n @Input()\n public actions?: ToastAction[];\n\n @Input()\n public options!: ToastOptions;\n\n @Output()\n public readonly dismiss = new EventEmitter<void>();\n\n public ngOnInit(): void {\n const { duration } = this.options;\n if (duration > 0) {\n timer(duration)\n .pipe(\n this.takeUntilDestroyed(),\n tap(() => this.onDismiss()),\n )\n .subscribe();\n }\n }\n\n public onDismiss(): void {\n this.dismiss.next();\n }\n}\n","<div class=\"odx-toast-item__content\">\n <odx-icon [name]=\"icon\" iconSet=\"core\"></odx-icon>\n <div class=\"odx-toast-item__text-content\">\n <p class=\"odx-toast-item__title\">\n <ng-template [odxDynamicView]=\"title\"> </ng-template>\n </p>\n <p class=\"odx-toast-item__description\" *ngIf=\"description\">\n <ng-template [odxDynamicView]=\"description\"> </ng-template>\n </p>\n </div>\n <button odxButton class=\"odx-toast-item__close\" (click)=\"onDismiss()\" *ngIf=\"options?.dismissable\">\n <odx-icon name=\"close\" iconSet=\"core\"></odx-icon>\n </button>\n</div>\n<odx-action-group class=\"odx-toast-item__buttons\" *ngIf=\"!!actions?.length\">\n <button odxButton (click)=\"action.action()\" *ngFor=\"let action of actions\">\n <odx-icon [name]=\"action.leftIcon\" iconSet=\"core\" alignLeft *ngIf=\"action.leftIcon\"></odx-icon>\n <ng-template [odxDynamicView]=\"action.label\"> </ng-template>\n <odx-icon [name]=\"action.rightIcon\" iconSet=\"core\" alignRight *ngIf=\"action.rightIcon\"></odx-icon>\n </button>\n</odx-action-group>\n","import { group, transition, trigger, useAnimation } from '@angular/animations';\nimport { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\n numberAttribute,\n OnDestroy,\n Output,\n Renderer2,\n ViewEncapsulation,\n} from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { collapse, expand, fadeIn, slideInRight } from '@odx/angular/animations';\nimport { ChipComponent } from '@odx/angular/components/chip';\nimport { HeaderComponent } from '@odx/angular/components/header';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement, px, trackById } from '@odx/angular/utils';\nimport { map, Observable } from 'rxjs';\nimport { ToastRef } from '../../models';\nimport { ToastService } from '../../toast.service';\nimport { ToastItemComponent } from '../toast-item/toast-item.component';\n\nconst TOAST_ANIMATION_DELAY = '125ms';\n@CSSComponent('toast-container')\n@Component({\n selector: 'odx-toast-container',\n templateUrl: './toast-container.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CommonModule, ChipComponent, ToastItemComponent],\n animations: [\n trigger('slide', [\n transition(\n ':enter',\n group([\n useAnimation(expand),\n useAnimation(fadeIn(), { params: { delay: TOAST_ANIMATION_DELAY } }),\n useAnimation(slideInRight, { params: { delay: TOAST_ANIMATION_DELAY } }),\n ]),\n ),\n transition(':leave', group([useAnimation(collapse)])),\n ]),\n ],\n})\nexport class ToastContainerComponent implements AfterViewInit, OnDestroy {\n private static INITIALIZED = false;\n\n private readonly windowRef = inject(WindowRef);\n private readonly renderer = inject(Renderer2);\n private readonly toastService = inject(ToastService);\n\n protected readonly trackById = trackById;\n\n public readonly element = injectElement();\n public readonly items$: Observable<ToastRef[]> = this.toastService.queue$.pipe(map((refs) => refs.slice(0, this.maxItems)));\n public readonly hiddenToasts$: Observable<number> = this.toastService.queue$.pipe(map((refs) => Math.max(0, refs.length - this.maxItems)));\n\n @Input({ transform: numberAttribute })\n public maxItems = 3;\n\n @Output()\n public readonly dismiss = this.toastService.onRemove$;\n\n public ngAfterViewInit(): void {\n if (ToastContainerComponent.INITIALIZED) {\n throw new Error('Only one toast container per application allowed');\n }\n ToastContainerComponent.INITIALIZED = true;\n const headerElement = this.windowRef.queryByComponent(HeaderComponent);\n if (headerElement) {\n this.renderer.setStyle(this.element.nativeElement, 'top', px(headerElement.offsetHeight));\n }\n }\n\n public ngOnDestroy(): void {\n ToastContainerComponent.INITIALIZED = false;\n }\n\n protected onDismiss(itemRef: ToastRef): void {\n this.toastService.remove(itemRef);\n }\n}\n","<odx-toast\n @slide\n [id]=\"toastRef.id\"\n [title]=\"toastRef.item.title\"\n [description]=\"toastRef.item.description\"\n [actions]=\"toastRef.item.actions ?? []\"\n [variant]=\"toastRef.item.variant\"\n [options]=\"toastRef.options\"\n (dismiss)=\"onDismiss(toastRef)\"\n *ngFor=\"let toastRef of items$ | async; trackBy: trackById\"\n></odx-toast>\n<odx-chip class=\"odx-toast-container__counter\" *ngIf=\"hiddenToasts$ | async as more\">{{ more }} more Notifications</odx-chip>\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { ToastContainerComponent, ToastItemComponent } from './components';\n\nconst modules = [ToastContainerComponent, ToastItemComponent];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class ToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAKa,MAAA,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,OAAO,EAAE,+BAA+B,EAAE;AACrJ,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,CAAC;AACG,CAAA;;MCEH,YAAY,CAAA;AAHzB,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,KAAK,EAAY,CAAC;AA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ET,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-components-toast.mjs","sources":["../../../../libs/angular/components/toast/src/lib/toast.config.ts","../../../../libs/angular/components/toast/src/lib/toast.service.ts","../../../../libs/angular/components/toast/src/lib/models/toast-variant.ts","../../../../libs/angular/components/toast/src/lib/components/toast-item/toast-item.component.ts","../../../../libs/angular/components/toast/src/lib/components/toast-item/toast-item.component.html","../../../../libs/angular/components/toast/src/lib/components/toast-container/toast-container.component.ts","../../../../libs/angular/components/toast/src/lib/components/toast-container/toast-container.component.html","../../../../libs/angular/components/toast/src/lib/toast.module.ts","../../../../libs/angular/components/toast/src/odx-angular-components-toast.ts"],"sourcesContent":["import { createConfigTokens } from '@odx/angular/utils';\nimport { ToastOptions } from './models/toast.options';\n\nexport type ToastConfig = ToastOptions;\n\nexport const { ToastDefaultConfig, ToastConfig, injectToastConfig, provideToastConfig } = createConfigTokens('Toast', '@odx/angular/components/toast', {\n dismissable: true,\n duration: 0,\n} as ToastConfig);\n","import { Injectable } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { getUniqueId, Queue } from '@odx/angular/utils';\nimport { Toast, ToastOptions, ToastRef } from './models';\nimport { injectToastConfig } from './toast.config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n private readonly queue = new Queue<ToastRef>();\n private readonly defaultOptions = injectToastConfig();\n\n public readonly toasts$ = this.queue.value$;\n public readonly onUpdate$ = this.queue.onUpdate$;\n\n public readonly onToastAdd$ = this.queue.onAdd$;\n public readonly onToastUpdate$ = this.queue.onUpdate$;\n public readonly onToastRemove$ = this.queue.onRemove$;\n\n /**\n * @deprecated Use `toasts$` instead\n */\n public readonly queue$ = this.toasts$;\n /**\n * @deprecated Use `onToastAdd$` instead\n */\n public readonly onAdd$ = this.onToastAdd$;\n /**\n * @deprecated Use `onToastRemove$` instead\n */\n public readonly onRemove$ = this.onToastRemove$;\n\n /**\n * @deprecated Use `create` instead\n */\n public add(item: Toast, options: Partial<ToastOptions> = {}): ToastRef {\n return this.create(item, options);\n }\n\n public create(item: Toast, options: Partial<ToastOptions> = {}): ToastRef {\n return this.queue.add({\n id: item.id ?? getUniqueId('odx-toast'),\n item,\n options: deepmerge(this.defaultOptions, options) as ToastOptions,\n });\n }\n\n /**\n * @deprecated Use `dismiss` instead\n */\n public remove(refOrId: ToastRef | ToastRef['id']): ToastRef | null {\n return this.dismiss(refOrId);\n }\n\n public dismiss(refOrId: ToastRef | ToastRef['id']): ToastRef | null {\n return this.queue.remove(refOrId);\n }\n\n /**\n * @deprecated Use `dismissAll` instead\n */\n public clear(): void {\n return this.dismissAll();\n }\n\n public dismissAll(): void {\n this.queue.clear();\n }\n}\n","export type ToastVariant = (typeof ToastVariant)[keyof typeof ToastVariant];\n\nexport const ToastVariant = {\n DEFAULT: 'default',\n WARNING: 'warning',\n DANGER: 'danger',\n SUCCESS: 'success',\n} as const;\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';\nimport { DynamicTextContent, DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { injectElement, untilDestroyed } from '@odx/angular/utils';\nimport { tap, timer } from 'rxjs';\nimport { ToastAction, ToastOptions, ToastVariant } from '../../models';\n\n@CSSComponent('toast-item')\n@Component({\n selector: 'odx-toast',\n templateUrl: './toast-item.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CommonModule, IconComponent, ButtonComponent, DynamicViewDirective, ActionGroupComponent],\n host: {\n '[attr.id]': 'id',\n },\n})\nexport class ToastItemComponent implements OnInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n\n public readonly element = injectElement();\n\n public get icon(): string {\n switch (this.variant) {\n case ToastVariant.WARNING:\n return 'warning';\n case ToastVariant.DANGER:\n return 'error';\n case ToastVariant.SUCCESS:\n return 'check';\n default:\n return 'info';\n }\n }\n\n @Input()\n public id!: string;\n\n @Input()\n public title!: DynamicTextContent;\n\n @Input()\n public description?: DynamicTextContent | null;\n\n @CSSModifier()\n @Input()\n public variant?: ToastVariant | null = ToastVariant.DEFAULT;\n\n @Input()\n public actions?: ToastAction[];\n\n @Input()\n public options!: ToastOptions;\n\n @Output()\n public readonly dismiss = new EventEmitter<void>();\n\n public ngOnInit(): void {\n const { duration } = this.options;\n if (duration > 0) {\n timer(duration)\n .pipe(\n this.takeUntilDestroyed(),\n tap(() => this.onDismiss()),\n )\n .subscribe();\n }\n }\n\n public onDismiss(): void {\n this.dismiss.next();\n }\n}\n","<div class=\"odx-toast-item__content\">\n <odx-icon [name]=\"icon\" iconSet=\"core\"></odx-icon>\n <div class=\"odx-toast-item__text-content\">\n <p class=\"odx-toast-item__title\">\n <ng-template [odxDynamicView]=\"title\"> </ng-template>\n </p>\n <p class=\"odx-toast-item__description\" *ngIf=\"description\">\n <ng-template [odxDynamicView]=\"description\"> </ng-template>\n </p>\n </div>\n <button odxButton class=\"odx-toast-item__close\" (click)=\"onDismiss()\" *ngIf=\"options?.dismissable\">\n <odx-icon name=\"close\" iconSet=\"core\"></odx-icon>\n </button>\n</div>\n<odx-action-group class=\"odx-toast-item__buttons\" *ngIf=\"!!actions?.length\">\n <button odxButton (click)=\"action.action()\" *ngFor=\"let action of actions\">\n <odx-icon [name]=\"action.leftIcon\" iconSet=\"core\" alignLeft *ngIf=\"action.leftIcon\"></odx-icon>\n <ng-template [odxDynamicView]=\"action.label\"> </ng-template>\n <odx-icon [name]=\"action.rightIcon\" iconSet=\"core\" alignRight *ngIf=\"action.rightIcon\"></odx-icon>\n </button>\n</odx-action-group>\n","import { group, transition, trigger, useAnimation } from '@angular/animations';\nimport { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n Output,\n Renderer2,\n ViewEncapsulation,\n inject,\n numberAttribute,\n} from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { collapse, expand, fadeIn, slideInRight } from '@odx/angular/animations';\nimport { ChipComponent } from '@odx/angular/components/chip';\nimport { HeaderComponent } from '@odx/angular/components/header';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement, px, trackById } from '@odx/angular/utils';\nimport { Observable, map } from 'rxjs';\nimport { ToastRef } from '../../models';\nimport { ToastService } from '../../toast.service';\nimport { ToastItemComponent } from '../toast-item/toast-item.component';\n\nconst TOAST_ANIMATION_DELAY = '125ms';\n@CSSComponent('toast-container')\n@Component({\n selector: 'odx-toast-container',\n templateUrl: './toast-container.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CommonModule, ChipComponent, ToastItemComponent],\n animations: [\n trigger('slide', [\n transition(\n ':enter',\n group([\n useAnimation(expand),\n useAnimation(fadeIn(), { params: { delay: TOAST_ANIMATION_DELAY } }),\n useAnimation(slideInRight, { params: { delay: TOAST_ANIMATION_DELAY } }),\n ]),\n ),\n transition(':leave', group([useAnimation(collapse)])),\n ]),\n ],\n})\nexport class ToastContainerComponent implements AfterViewInit, OnDestroy {\n private static INITIALIZED = false;\n\n private readonly windowRef = inject(WindowRef);\n private readonly renderer = inject(Renderer2);\n private readonly toastService = inject(ToastService);\n\n protected readonly trackById = trackById;\n\n public readonly element = injectElement();\n public readonly items$: Observable<ToastRef[]> = this.toastService.toasts$.pipe(map((refs) => refs.slice(0, this.maxItems)));\n public readonly hiddenToasts$: Observable<number> = this.toastService.toasts$.pipe(map((refs) => Math.max(0, refs.length - this.maxItems)));\n\n @Input({ transform: numberAttribute })\n public maxItems = 3;\n\n @Output()\n public readonly dismiss = this.toastService.onToastRemove$;\n\n public ngAfterViewInit(): void {\n if (ToastContainerComponent.INITIALIZED) {\n throw new Error('Only one toast container per application allowed');\n }\n ToastContainerComponent.INITIALIZED = true;\n const headerElement = this.windowRef.queryByComponent(HeaderComponent);\n if (headerElement) {\n this.renderer.setStyle(this.element.nativeElement, 'top', px(headerElement.offsetHeight));\n }\n }\n\n public ngOnDestroy(): void {\n ToastContainerComponent.INITIALIZED = false;\n }\n\n protected onDismiss(itemRef: ToastRef): void {\n this.toastService.dismiss(itemRef);\n }\n}\n","<odx-toast\n @slide\n [id]=\"toastRef.id\"\n [title]=\"toastRef.item.title\"\n [description]=\"toastRef.item.description\"\n [actions]=\"toastRef.item.actions ?? []\"\n [variant]=\"toastRef.item.variant\"\n [options]=\"toastRef.options\"\n (dismiss)=\"onDismiss(toastRef)\"\n *ngFor=\"let toastRef of items$ | async; trackBy: trackById\"\n></odx-toast>\n<odx-chip class=\"odx-toast-container__counter\" *ngIf=\"hiddenToasts$ | async as more\">{{ more }} more Notifications</odx-chip>\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { ToastContainerComponent, ToastItemComponent } from './components';\n\nconst modules = [ToastContainerComponent, ToastItemComponent];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class ToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAKa,MAAA,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,OAAO,EAAE,+BAA+B,EAAE;AACrJ,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,CAAC;AACG,CAAA;;MCCH,YAAY,CAAA;A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6BAAA,CAAC,CACH;AACD,4BAAA,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;yBACtD,CAAC;AACH,qBAAA,EAAA,QAAA,EAAA,gfAAA,EAAA,CAAA;8BAgBM,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;gBAIrB,OAAO,EAAA,CAAA;sBADtB,MAAM;;;AE5DT,MAAM,OAAO,GAAG,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;MAMjD,WAAW,CAAA;+GAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;gHAAX,WAAW,EAAA,OAAA,EAAA,CANP,uBAAuB,EAAE,kBAAkB,aAIhD,UAAU,EAJL,uBAAuB,EAAE,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;gHAM/C,WAAW,EAAA,OAAA,EAAA,CAHb,OAAO,EACN,UAAU,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
@@ -172,9 +172,32 @@ function trackById(_, { id }) {
172
172
  return id;
173
173
  }
174
174
 
175
+ /**
176
+ * Extracts the values of a specified key from each object in an array.
177
+ *
178
+ * @template T - The type of the objects in the array.
179
+ * @template K - The type of the keys of `T`.
180
+ * @param {T[]} arr - The array of objects to pluck values from.
181
+ * @param {K} key - The key whose values are to be plucked from each object in the array.
182
+ * @returns {Array<T[K]>} An array of values corresponding to the specified key from each object.
183
+ * @example
184
+ * const users = [{ name: 'Alice' }, { name: 'Bob' }];
185
+ * const names = pluckFromArray(users, 'name'); // ['Alice', 'Bob']
186
+ */
175
187
  function pluckFromArray(arr, key) {
176
188
  return arr.map((value) => value[key]);
177
189
  }
190
+ /**
191
+ * Creates a compare function for sorting an array of objects based on a specified key and direction.
192
+ *
193
+ * @template T - The type of the objects in the array.
194
+ * @param {keyof T} key - The key to sort by.
195
+ * @param {OrderByDirection} [direction='ASC'] - The direction to sort ('ASC' for ascending, 'DESC' for descending).
196
+ * @returns {(a: T, b: T) => number} A compare function that can be used in the array sort method.
197
+ * @example
198
+ * const items = [{ value: 10 }, { value: 5 }, { value: 7 }];
199
+ * const sortedItems = items.sort(orderBy('value', 'ASC')); // Sorted by value in ascending order
200
+ */
178
201
  function orderBy(key, direction = 'ASC') {
179
202
  return (a, b) => {
180
203
  const leftValue = direction === 'ASC' ? a[key] : b[key];
@@ -199,7 +222,30 @@ function buildUrl(...args) {
199
222
  return args.join('/').replace(/(^.*)(https?:\/\/)|(\/)+/g, '$2$3');
200
223
  }
201
224
 
225
+ /**
226
+ * A constant representing the base URL for the Draeger website.
227
+ * @constant
228
+ * @type {string}
229
+ * @default 'https://www.draeger.com'
230
+ */
202
231
  const DRAEGER_WEBSITE_URL = 'https://www.draeger.com';
232
+ /**
233
+ * Constructs a full URL for the Draeger website by appending the provided path segments to the base URL.
234
+ * This function is a utility for creating fully qualified URLs to various resources or pages within the Draeger website.
235
+ *
236
+ * @function buildWebsiteUrl
237
+ * @param {...(string | number | symbol | null | undefined)} segments - The path segments to append to the base URL.
238
+ * These can include strings, numbers, symbols, or null/undefined values (the latter two are ignored).
239
+ * @returns {string} The fully constructed URL, including the base URL and all provided path segments.
240
+ *
241
+ * @example
242
+ * // Returns 'https://www.draeger.com/about-us'
243
+ * const url = buildWebsiteUrl('about-us');
244
+ *
245
+ * @example
246
+ * // Can also handle multiple segments, returning 'https://www.draeger.com/products/search/123'
247
+ * const productUrl = buildWebsiteUrl('products', 'search', 123);
248
+ */
203
249
  function buildWebsiteUrl(...segments) {
204
250
  return buildUrl(DRAEGER_WEBSITE_URL, ...segments);
205
251
  }