@odx/angular 8.1.0 → 9.1.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 (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/animations/index.d.ts +1 -0
  3. package/cdk/connected-overlay/lib/connected-overlay.component.d.ts +4 -7
  4. package/cdk/connected-overlay/lib/models/connected-overlay-options.d.ts +1 -0
  5. package/cdk/connected-overlay/lib/models/connected-overlay-ref.d.ts +1 -0
  6. package/components/modal/lib/modal.component.d.ts +2 -8
  7. package/components/toast/lib/components/toast-container/toast-container.component.d.ts +2 -0
  8. package/components/tooltip/lib/tooltip.directive.d.ts +1 -0
  9. package/esm2022/animations/index.mjs +2 -1
  10. package/esm2022/cdk/connected-overlay/lib/connected-overlay.component.mjs +18 -56
  11. package/esm2022/cdk/connected-overlay/lib/helpers/compute-overlay-position.mjs +9 -14
  12. package/esm2022/cdk/connected-overlay/lib/models/connected-overlay-options.mjs +1 -1
  13. package/esm2022/cdk/connected-overlay/lib/models/connected-overlay-ref.mjs +2 -1
  14. package/esm2022/components/badge/lib/badge.directive.mjs +6 -2
  15. package/esm2022/components/dropdown/lib/dropdown.directive.mjs +2 -2
  16. package/esm2022/components/modal/lib/modal.component.mjs +17 -42
  17. package/esm2022/components/modal/lib/modal.service.mjs +5 -4
  18. package/esm2022/components/toast/lib/components/toast-container/toast-container.component.mjs +13 -3
  19. package/esm2022/components/tooltip/lib/tooltip.directive.mjs +6 -2
  20. package/esm2022/internal/lib/helpers/deepmerge.mjs +1 -1
  21. package/esm2022/sdk/lib/application-environment.mjs +4 -4
  22. package/esm2022/utils/lib/helpers/queue.mjs +2 -2
  23. package/fesm2022/odx-angular-animations.mjs +1 -1
  24. package/fesm2022/odx-angular-animations.mjs.map +1 -1
  25. package/fesm2022/odx-angular-cdk-connected-overlay.mjs +25 -67
  26. package/fesm2022/odx-angular-cdk-connected-overlay.mjs.map +1 -1
  27. package/fesm2022/odx-angular-components-badge.mjs +5 -1
  28. package/fesm2022/odx-angular-components-badge.mjs.map +1 -1
  29. package/fesm2022/odx-angular-components-dropdown.mjs +1 -1
  30. package/fesm2022/odx-angular-components-dropdown.mjs.map +1 -1
  31. package/fesm2022/odx-angular-components-modal.mjs +20 -44
  32. package/fesm2022/odx-angular-components-modal.mjs.map +1 -1
  33. package/fesm2022/odx-angular-components-toast.mjs +12 -2
  34. package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
  35. package/fesm2022/odx-angular-components-tooltip.mjs +4 -0
  36. package/fesm2022/odx-angular-components-tooltip.mjs.map +1 -1
  37. package/fesm2022/odx-angular-internal.mjs.map +1 -1
  38. package/fesm2022/odx-angular-sdk.mjs +3 -3
  39. package/fesm2022/odx-angular-sdk.mjs.map +1 -1
  40. package/fesm2022/odx-angular-utils.mjs +1 -1
  41. package/fesm2022/odx-angular-utils.mjs.map +1 -1
  42. package/internal/lib/helpers/deepmerge.d.ts +2 -1
  43. package/package.json +6 -6
  44. package/sdk/lib/application-environment.d.ts +1 -2
@@ -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\n/**\n * Utility functions generated by `createConfigTokens` to handle injection and provision of `ToastConfig`.\n * These include tokens and functions to access and provide the default configuration for toasts.\n *\n * `ToastDefaultConfig` provides the default settings for toasts.\n * `ToastConfig` is a token that can be used to inject toast configuration settings.\n * `injectToastConfig` is a function that retrieves the current toast configuration.\n * `provideToastConfig` is a function used to specify a custom configuration for toasts.\n *\n * @example\n * ```ts\n * // In module providers:\n * providers: [\n * provideToastConfig({ // ... global module configuration }),\n * ]\n *\n * // In a component or service:\n * constructor(@Inject(ToastConfig) private readonly config: ToastConfig) {}\n *\n * // Or using the `injectToastConfig` function:\n * @Component({ ... })\n * export class MyComponent {\n * private readonly config = injectToastConfig();\n * }\n * ```\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/**\n * ToastService provides a centralized management system for toasts within an application.\n * It handles the creation, updates, and dismissal of toasts based on a FIFO (first-in, first-out) queue.\n * This service integrates custom toast options with default configurations and supports reactive updates through observables.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n private readonly queue = new Queue<ToastRef>();\n private readonly defaultOptions = injectToastConfig();\n\n /**\n * Observable stream of active toasts.\n *\n * @emits {ToastRef[]} The current list of active toasts.\n */\n public readonly toasts$ = this.queue.value$;\n\n /**\n * Observable that emits when any update occurs in the toast queue.\n *\n * @emits {ToastRef[]} The updated list of active toasts.\n */\n public readonly onUpdate$ = this.queue.onUpdate$;\n\n /**\n * Observable that emits when a toast is added.\n *\n * @emits {ToastRef} The newly added toast.\n */\n public readonly onToastAdd$ = this.queue.onAdd$;\n\n /**\n * Observable that emits when a toast is updated.\n *\n * @emits {ToastRef} The updated toast.\n */\n public readonly onToastUpdate$ = this.queue.onUpdate$;\n\n /**\n * Observable that emits when a toast is removed.\n *\n * @emits {ToastRef} The removed toast.\n */\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 /**\n * Creates and queues a new toast based on the provided item and options.\n * Merges given options with default configurations.\n *\n * @param {Toast} item The toast item to create.\n * @param {Partial<ToastOptions>} options Optional additional options for the toast.\n * @returns {ToastRef} The reference to the newly created toast.\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 /**\n * Dismisses a specific toast identified by a reference or ID.\n *\n * @param {ToastRef | ToastRef['id']} refOrId The reference or ID of the toast to dismiss.\n * @returns {ToastRef | null} The reference to the dismissed toast, or null if not found.\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 /**\n * Dismisses all toasts currently being displayed.\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, Type, ViewEncapsulation } from '@angular/core';\nimport { DynamicContent, DynamicTextContent, DynamicViewDirective, GetDynamicViewContext } 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/**\n * A component that represents a single toast notification. This component is responsible for displaying\n * message content, handling toast actions, and managing the automatic dismissal of the toast based on a duration.\n * It supports dynamic content for descriptions and can show an optional set of actions.\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 /**\n * Determines the icon to display based on the toast's variant.\n * Returns a string representing the icon class.\n *\n * @returns {string} - The icon class name.\n * @default 'info'\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 /**\n * Unique identifier for the toast item, typically provided for accessibility purposes.\n *\n * @required\n * @type {string}\n */\n @Input()\n public id!: string;\n\n /**\n * The main title of the toast, displayed prominently.\n *\n * @required\n * @type {DynamicTextContent}\n */\n @Input()\n public title!: DynamicTextContent;\n\n /**\n * Optional detailed description for the toast. This can be plain text or a dynamic template.\n *\n * @type {DynamicContent | null}\n */\n @Input()\n public description?: DynamicContent | null;\n\n /**\n * Context for rendering the dynamic component of the description.\n *\n * @type {GetDynamicViewContext<Type<unknown>> | undefined}\n */\n @Input()\n public descriptionContext?: GetDynamicViewContext<Type<unknown>>;\n\n /**\n * The variant of the toast which influences the icon and styling.\n *\n * @type {ToastVariant | null}\n * @default ToastVariant.DEFAULT\n */\n @CSSModifier()\n @Input()\n public variant?: ToastVariant | null = ToastVariant.DEFAULT;\n\n /**\n * Optional actions related to the toast, such as 'retry' or 'dismiss'.\n *\n * @type {ToastAction[] | undefined}\n */\n @Input()\n public actions?: ToastAction[];\n\n /**\n * Configuration options for the toast, including its duration and dismissal behavior.\n *\n * @required\n * @type {ToastOptions}\n */\n @Input()\n public options!: ToastOptions;\n\n /**\n * Emits an event when the toast is dismissed, either through action or automatically.\n *\n * @emits {void}\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 protected 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\" [odxDynamicViewContext]=\"descriptionContext\"> </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\n/**\n * Represents a container component for displaying toast notifications. This component manages and arranges toast messages,\n * handling animations for entering and leaving toasts. It ensures that only a limited number of toasts are shown at the same time,\n * based on the `maxItems` input. The container listens for toast events from the `ToastService` to update its list of toasts dynamically.\n *\n * The component uses a group of animations to slide toasts in and out smoothly and also provides an output for when a toast is dismissed.\n * It's designed to integrate with a single instance per application, ensuring no more than one toast container is initialized.\n */\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 /**\n * Maximum number of toasts that can be displayed at once.\n *\n * @type {number}\n * @default 3\n */\n @Input({ transform: numberAttribute })\n public maxItems = 3;\n\n /**\n * Emits an event when a toast is dismissed.\n *\n * @emits {ToastRef} - The toast reference that was dismissed.\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 [descriptionContext]=\"toastRef.item.descriptionContext\"\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;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACU,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;;AC5BhB;;;;AAIG;MAIU,YAAY,CAAA;AAHzB,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,KAAK,EAAY,CAAC;QAC9B,IAAc,CAAA,cAAA,GAAG,iBAAiB,EAAE,CAAC;AAEtD;;;;AAIG;AACa,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AAE5C;;;;AAIG;AACa,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;AAEjD;;;;AAIG;AACa,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AAEhD;;;;AAIG;AACa,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;AAEtD;;;;AAIG;AACa,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;AAEtD;;AAEG;AACa,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;AACtC;;AAEG;AACa,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;AAC1C;;AAEG;AACa,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC;AAuDjD,KAAA;AArDC;;AAEG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HAAX,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;;;;"}
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\n/**\n * Utility functions generated by `createConfigTokens` to handle injection and provision of `ToastConfig`.\n * These include tokens and functions to access and provide the default configuration for toasts.\n *\n * `ToastDefaultConfig` provides the default settings for toasts.\n * `ToastConfig` is a token that can be used to inject toast configuration settings.\n * `injectToastConfig` is a function that retrieves the current toast configuration.\n * `provideToastConfig` is a function used to specify a custom configuration for toasts.\n *\n * @example\n * ```ts\n * // In module providers:\n * providers: [\n * provideToastConfig({ // ... global module configuration }),\n * ]\n *\n * // In a component or service:\n * constructor(@Inject(ToastConfig) private readonly config: ToastConfig) {}\n *\n * // Or using the `injectToastConfig` function:\n * @Component({ ... })\n * export class MyComponent {\n * private readonly config = injectToastConfig();\n * }\n * ```\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/**\n * ToastService provides a centralized management system for toasts within an application.\n * It handles the creation, updates, and dismissal of toasts based on a FIFO (first-in, first-out) queue.\n * This service integrates custom toast options with default configurations and supports reactive updates through observables.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n private readonly queue = new Queue<ToastRef>();\n private readonly defaultOptions = injectToastConfig();\n\n /**\n * Observable stream of active toasts.\n *\n * @emits {ToastRef[]} The current list of active toasts.\n */\n public readonly toasts$ = this.queue.value$;\n\n /**\n * Observable that emits when any update occurs in the toast queue.\n *\n * @emits {ToastRef[]} The updated list of active toasts.\n */\n public readonly onUpdate$ = this.queue.onUpdate$;\n\n /**\n * Observable that emits when a toast is added.\n *\n * @emits {ToastRef} The newly added toast.\n */\n public readonly onToastAdd$ = this.queue.onAdd$;\n\n /**\n * Observable that emits when a toast is updated.\n *\n * @emits {ToastRef} The updated toast.\n */\n public readonly onToastUpdate$ = this.queue.onUpdate$;\n\n /**\n * Observable that emits when a toast is removed.\n *\n * @emits {ToastRef} The removed toast.\n */\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 /**\n * Creates and queues a new toast based on the provided item and options.\n * Merges given options with default configurations.\n *\n * @param {Toast} item The toast item to create.\n * @param {Partial<ToastOptions>} options Optional additional options for the toast.\n * @returns {ToastRef} The reference to the newly created toast.\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 /**\n * Dismisses a specific toast identified by a reference or ID.\n *\n * @param {ToastRef | ToastRef['id']} refOrId The reference or ID of the toast to dismiss.\n * @returns {ToastRef | null} The reference to the dismissed toast, or null if not found.\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 /**\n * Dismisses all toasts currently being displayed.\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, Type, ViewEncapsulation } from '@angular/core';\nimport { DynamicContent, DynamicTextContent, DynamicViewDirective, GetDynamicViewContext } 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/**\n * A component that represents a single toast notification. This component is responsible for displaying\n * message content, handling toast actions, and managing the automatic dismissal of the toast based on a duration.\n * It supports dynamic content for descriptions and can show an optional set of actions.\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 /**\n * Determines the icon to display based on the toast's variant.\n * Returns a string representing the icon class.\n *\n * @returns {string} - The icon class name.\n * @default 'info'\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 /**\n * Unique identifier for the toast item, typically provided for accessibility purposes.\n *\n * @required\n * @type {string}\n */\n @Input()\n public id!: string;\n\n /**\n * The main title of the toast, displayed prominently.\n *\n * @required\n * @type {DynamicTextContent}\n */\n @Input()\n public title!: DynamicTextContent;\n\n /**\n * Optional detailed description for the toast. This can be plain text or a dynamic template.\n *\n * @type {DynamicContent | null}\n */\n @Input()\n public description?: DynamicContent | null;\n\n /**\n * Context for rendering the dynamic component of the description.\n *\n * @type {GetDynamicViewContext<Type<unknown>> | undefined}\n */\n @Input()\n public descriptionContext?: GetDynamicViewContext<Type<unknown>>;\n\n /**\n * The variant of the toast which influences the icon and styling.\n *\n * @type {ToastVariant | null}\n * @default ToastVariant.DEFAULT\n */\n @CSSModifier()\n @Input()\n public variant?: ToastVariant | null = ToastVariant.DEFAULT;\n\n /**\n * Optional actions related to the toast, such as 'retry' or 'dismiss'.\n *\n * @type {ToastAction[] | undefined}\n */\n @Input()\n public actions?: ToastAction[];\n\n /**\n * Configuration options for the toast, including its duration and dismissal behavior.\n *\n * @required\n * @type {ToastOptions}\n */\n @Input()\n public options!: ToastOptions;\n\n /**\n * Emits an event when the toast is dismissed, either through action or automatically.\n *\n * @emits {void}\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 protected 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\" [odxDynamicViewContext]=\"descriptionContext\"> </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 DestroyRef,\n Input,\n OnDestroy,\n Output,\n Renderer2,\n ViewEncapsulation,\n inject,\n numberAttribute,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\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 { deferFn, injectElement, px, setAttribute, 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\n/**\n * Represents a container component for displaying toast notifications. This component manages and arranges toast messages,\n * handling animations for entering and leaving toasts. It ensures that only a limited number of toasts are shown at the same time,\n * based on the `maxItems` input. The container listens for toast events from the `ToastService` to update its list of toasts dynamically.\n *\n * The component uses a group of animations to slide toasts in and out smoothly and also provides an output for when a toast is dismissed.\n * It's designed to integrate with a single instance per application, ensuring no more than one toast container is initialized.\n */\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 destroyRef = inject(DestroyRef);\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 /**\n * Maximum number of toasts that can be displayed at once.\n *\n * @type {number}\n * @default 3\n */\n @Input({ transform: numberAttribute })\n public maxItems = 3;\n\n /**\n * Emits an event when a toast is dismissed.\n *\n * @emits {ToastRef} - The toast reference that was dismissed.\n */\n @Output()\n public readonly dismiss = this.toastService.onToastRemove$;\n\n public ngAfterViewInit(): void {\n setAttribute(this.element.nativeElement, 'popover', 'manual');\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 this.items$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.updatePopverPosition());\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 private updatePopverPosition(): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element.nativeElement as any)?.hidePopover?.();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n deferFn(() => (this.element.nativeElement as any)?.showPopover?.());\n }\n}\n","<odx-toast\n @slide\n [id]=\"toastRef.id\"\n [title]=\"toastRef.item.title\"\n [description]=\"toastRef.item.description\"\n [descriptionContext]=\"toastRef.item.descriptionContext\"\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;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACU,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;;AC5BhB;;;;AAIG;MAIU,YAAY,CAAA;AAHzB,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,KAAK,EAAY,CAAC;QAC9B,IAAc,CAAA,cAAA,GAAG,iBAAiB,EAAE,CAAC;AAEtD;;;;AAIG;AACa,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AAE5C;;;;AAIG;AACa,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;AAEjD;;;;AAIG;AACa,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AAEhD;;;;AAIG;AACa,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;AAEtD;;;;AAIG;AACa,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;AAEtD;;AAEG;AACa,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;AACtC;;AAEG;AACa,QAAA,IAAA,CAAA,MAAM,GAAG,IAA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ACpE,gCAAA,YAAY,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAAE,CAAC;AACzE,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,6iBAAA,EAAA,CAAA;8BAuBM,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;gBASrB,OAAO,EAAA,CAAA;sBADtB,MAAM;;;AEnFT,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;;;;"}
@@ -122,6 +122,7 @@ let TooltipDirective = class TooltipDirective {
122
122
  this.hideTrigger$$ = new Subject();
123
123
  this.connectedOverlayRef = null;
124
124
  this.tooltipOptions = DefaultTooltipOptions;
125
+ this.injector = inject(Injector);
125
126
  this.tooltipId = null;
126
127
  this.element = injectElement();
127
128
  /**
@@ -194,6 +195,9 @@ let TooltipDirective = class TooltipDirective {
194
195
  context: { content: this.content, size: this.size, id: this.tooltipId },
195
196
  showArrow: true,
196
197
  enableFallback: true,
198
+ }, {
199
+ host: this.element.nativeElement.parentElement,
200
+ injector: this.injector,
197
201
  });
198
202
  }
199
203
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-components-tooltip.mjs","sources":["../../../../libs/angular/components/tooltip/src/lib/helpers/resolve-tooltip-trigger-events.ts","../../../../libs/angular/components/tooltip/src/lib/models/tooltip-size.ts","../../../../libs/angular/components/tooltip/src/lib/models/tooltip-options.ts","../../../../libs/angular/components/tooltip/src/lib/tooltip.component.ts","../../../../libs/angular/components/tooltip/src/lib/tooltip.component.html","../../../../libs/angular/components/tooltip/src/lib/tooltip.directive.ts","../../../../libs/angular/components/tooltip/src/odx-angular-components-tooltip.ts"],"sourcesContent":["import { TooltipTrigger } from '../models';\n\n/**\n * @internal\n * Resolves the appropriate event names for the provided tooltip trigger.\n *\n * @param {TooltipTrigger} trigger - The trigger to resolve.\n * @returns {[string, string | null]} - The event names for the trigger.\n */\nexport function resolveTooltipTriggerEvents(trigger: TooltipTrigger): [string, string | null] {\n if (trigger === 'click') {\n return ['click', null];\n } else {\n return ['mouseenter', 'mouseleave'];\n }\n}\n","export type TooltipSize = typeof TooltipSize[keyof typeof TooltipSize];\n\nexport const TooltipSize = {\n AUTO: 'auto',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n} as const;\n","import { ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay';\nimport { TooltipSize } from './tooltip-size';\nimport { TooltipTrigger } from './tooltip-trigger';\n\nexport interface TooltipOptions extends Pick<ConnectedOverlayOptions, 'position' | 'matchReferenceWidth'> {\n trigger: TooltipTrigger;\n delayIn: number;\n delayOut: number;\n size: TooltipSize;\n}\n\nexport const DefaultTooltipOptions: TooltipOptions = {\n matchReferenceWidth: false,\n size: TooltipSize.AUTO,\n trigger: 'hover',\n position: 'top',\n delayIn: 0,\n delayOut: 0,\n};\n","import { ChangeDetectionStrategy, Component, inject, Injector, Input, Type, ViewEncapsulation } from '@angular/core';\nimport { DynamicContent, DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\nimport { TooltipSize } from './models';\n\n/**\n /**\n * TooltipComponent displays contextual information related to an element when the user hovers over\n * or focuses on the element. It supports dynamic content and can be styled with different sizes.\n *\n * The component uses dynamic content rendering to provide flexible display options including text,\n * templates, or even other Angular components, making it highly customizable.\n */\n@CSSComponent('tooltip')\n@Component({\n standalone: true,\n selector: 'odx-tooltip',\n imports: [DynamicViewDirective],\n templateUrl: './tooltip.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.id]': 'id',\n role: 'tooltip',\n },\n})\nexport class TooltipComponent {\n protected readonly injector = inject(Injector);\n public readonly element = injectElement();\n\n /**\n * The ID attribute of the tooltip, used for accessibility purposes to link the tooltip with its owner element.\n *\n * @type {string | null}\n * @default null\n */\n @Input()\n public id: string | null = null;\n\n /**\n * The content to be displayed within the tooltip. This can be text, a template reference, or a dynamic component.\n *\n * @type {DynamicContent | null}\n */\n @Input()\n public content?: Exclude<DynamicContent, Type<unknown>> | null;\n\n /**\n * Determines the size of the tooltip. It can adjust based on the content size or be set to specific dimensions.\n * The size influences the CSS class applied to the tooltip, allowing for custom styles.\n *\n * @type {TooltipSize}\n * @default TooltipSize.AUTO\n */\n @CSSModifier()\n @Input()\n public size: TooltipSize = TooltipSize.AUTO;\n}\n","<ng-template [odxDynamicView]=\"content\" [odxDynamicViewInjector]=\"injector\"></ng-template>\n","import { booleanAttribute, Directive, inject, Input, OnChanges, OnInit, Type } from '@angular/core';\nimport { ConnectedOverlayRef, ConnectedOverlayService } from '@odx/angular/cdk/connected-overlay';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent, deepmerge } from '@odx/angular/internal';\nimport { delayUntil } from '@odx/angular/rxjs';\nimport { EventManager, getUniqueId, hasChanged, injectElement, NgChanges, untilDestroyed } from '@odx/angular/utils';\nimport { filter, merge, Subject, tap } from 'rxjs';\nimport { resolveTooltipTriggerEvents } from './helpers';\nimport { DefaultTooltipOptions, TooltipOptions, TooltipSize } from './models';\nimport { TooltipComponent } from './tooltip.component';\n\n/**\n * TooltipDirective manages tooltips for host elements by creating overlay components dynamically.\n * It provides configuration options such as content, delay timings, visibility, and tooltip sizing.\n * This directive uses Angular's connected overlay system to position and manage tooltip visibility.\n */\n@CSSComponent('tooltip-host')\n@Directive({\n standalone: true,\n selector: '[odxTooltip]',\n exportAs: 'odxTooltip',\n providers: [EventManager],\n host: {\n '[attr.aria-describedby]': 'tooltipId',\n },\n})\nexport class TooltipDirective implements OnInit, OnChanges {\n private readonly eventManager = inject(EventManager);\n private readonly connectedOverlayService = inject(ConnectedOverlayService);\n private readonly showTrigger$$ = new Subject<void>();\n private readonly hideTrigger$$ = new Subject<void>();\n private connectedOverlayRef: ConnectedOverlayRef | null = null;\n private tooltipOptions = DefaultTooltipOptions;\n\n protected tooltipId: string | null = null;\n public readonly element = injectElement();\n\n /**\n * Input for dynamic content to display in the tooltip.\n * This content is reactive and can change dynamically.\n *\n * @type {DynamicContent | null}\n * @default null\n */\n @Input('odxTooltip')\n public content?: Exclude<DynamicContent, Type<unknown>> | null = null;\n\n /**\n * Controls whether the tooltip is disabled. A disabled tooltip will not be displayed.\n *\n * @type {boolean}\n * @default false\n */\n @Input({ alias: 'odxTooltipDisabled', transform: booleanAttribute })\n public disabled = false;\n\n /**\n * Configuration options for the tooltip.\n * It allows setting various behaviors like delay and positioning.\n *\n * @param {Partial<TooltipOptions> | null | undefined}\n */\n @Input('odxTooltipOptions')\n public set options(value: Partial<TooltipOptions> | null | undefined) {\n this.tooltipOptions = deepmerge(DefaultTooltipOptions, value) as TooltipOptions;\n }\n\n /**\n * Sets the size of the tooltip.\n *\n * @type {TooltipSize}\n * @default null\n */\n @Input('odxTooltipSize')\n public size?: TooltipSize | null = null;\n\n /**\n * Controls the visibility of the tooltip.\n * Useful for programmatically toggling the tooltip display.\n *\n * @type {boolean}\n * @default false\n */\n @Input({ alias: 'odxTooltipVisible', transform: booleanAttribute })\n public visible = false;\n\n /**\n * Indicates whether the tooltip is currently open.\n *\n * @returns {boolean}\n */\n public get isOpen(): boolean {\n return this.connectedOverlayRef !== null;\n }\n\n constructor() {\n const takeUntilDestroyed = untilDestroyed();\n const show$ = this.showTrigger$$.pipe(\n filter(() => !this.isOpen),\n delayUntil(() => this.tooltipOptions.delayIn, this.hideTrigger$$),\n tap(() => this.show()),\n );\n const hide$ = this.hideTrigger$$.pipe(\n filter(() => this.isOpen),\n delayUntil(() => this.tooltipOptions.delayOut, this.showTrigger$$),\n tap(() => this.hide()),\n );\n merge(show$, hide$).pipe(takeUntilDestroyed()).subscribe();\n }\n\n public ngOnInit(): void {\n this.registerEvents();\n }\n\n public ngOnChanges(changes: NgChanges<TooltipDirective>): void {\n if (hasChanged(changes, 'disabled') && this.disabled) {\n this.hide();\n }\n if (hasChanged(changes, ['content', 'size'])) {\n this.connectedOverlayRef?.update({ context: { content: this.content, size: this.size } });\n }\n if (hasChanged(changes, 'options')) {\n this.connectedOverlayRef?.update(this.tooltipOptions);\n this.registerEvents();\n }\n if (this.visible && !this.disabled) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Shows the tooltip, creating and attaching the overlay to the host element.\n */\n public show(): void {\n if (this.isOpen || this.disabled) return;\n this.tooltipId = getUniqueId('odx-tooltip');\n this.connectedOverlayRef = this.connectedOverlayService.createOverlay(this.element.nativeElement, {\n ...this.tooltipOptions,\n containerClass: 'odx-tooltip-overlay',\n content: TooltipComponent,\n context: { content: this.content, size: this.size, id: this.tooltipId },\n showArrow: true,\n enableFallback: true,\n });\n }\n\n /**\n * Hides the tooltip, detaching the overlay from the host element.\n */\n public hide(): void {\n if (!this.isOpen || (this.visible && !this.disabled)) return;\n this.connectedOverlayRef?.close();\n this.connectedOverlayRef = null;\n this.tooltipId = null;\n }\n\n private registerEvents(): void {\n const [openEvent, closeEvent] = resolveTooltipTriggerEvents(this.tooltipOptions.trigger);\n this.eventManager.destroyListeners();\n this.eventManager.register([openEvent, 'focusin'], () => this.showTrigger$$.next());\n this.eventManager.register([closeEvent, 'focusout'], () => this.hideTrigger$$.next());\n this.eventManager.register(['keyup.esc'], () => this.hideTrigger$$.next(), 'document');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEA;;;;;;AAMG;AACG,SAAU,2BAA2B,CAAC,OAAuB,EAAA;IACjE,IAAI,OAAO,KAAK,OAAO,EAAE;AACvB,QAAA,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACxB,KAAA;AAAM,SAAA;AACL,QAAA,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AACrC,KAAA;AACH;;ACba,MAAA,WAAW,GAAG;AACzB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,OAAO;;;ACKH,MAAA,qBAAqB,GAAmB;AACnD,IAAA,mBAAmB,EAAE,KAAK;IAC1B,IAAI,EAAE,WAAW,CAAC,IAAI;AACtB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,QAAQ,EAAE,CAAC;;;ACXb;;;;;;;AAOG;AAcU,IAAA,gBAAgB,GAAtB,MAAM,gBAAgB,CAAA;AAAtB,IAAA,WAAA,GAAA;AACc,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/B,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAE1C;;;;;AAKG;QAE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AAA,EAAA,EAAA,SAAA,EAAA,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;AAKd,gBAAgB,GAAA,UAAA,CAAA;IAV5B,YAAY,CAAC,cAAc,CAAC;;AAUhB,CAAA,EAAA,gBAAgB,CA2I5B,CAAA;4FA3IY,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAT5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,SAAS,EAAE,CAAC,YAAY,CAAC;AACzB,oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,WAAW;AACvC,qBAAA;AACF,iBAAA,CAAA;0EAoBQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,YAAY,CAAA;gBAUZ,QAAQ,EAAA,CAAA;sBADd,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAUxD,OAAO,EAAA,CAAA;sBADjB,KAAK;uBAAC,mBAAmB,CAAA;gBAYnB,IAAI,EAAA,CAAA;sBADV,KAAK;uBAAC,gBAAgB,CAAA;gBAWhB,OAAO,EAAA,CAAA;sBADb,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;;;ACnFpE;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-components-tooltip.mjs","sources":["../../../../libs/angular/components/tooltip/src/lib/helpers/resolve-tooltip-trigger-events.ts","../../../../libs/angular/components/tooltip/src/lib/models/tooltip-size.ts","../../../../libs/angular/components/tooltip/src/lib/models/tooltip-options.ts","../../../../libs/angular/components/tooltip/src/lib/tooltip.component.ts","../../../../libs/angular/components/tooltip/src/lib/tooltip.component.html","../../../../libs/angular/components/tooltip/src/lib/tooltip.directive.ts","../../../../libs/angular/components/tooltip/src/odx-angular-components-tooltip.ts"],"sourcesContent":["import { TooltipTrigger } from '../models';\n\n/**\n * @internal\n * Resolves the appropriate event names for the provided tooltip trigger.\n *\n * @param {TooltipTrigger} trigger - The trigger to resolve.\n * @returns {[string, string | null]} - The event names for the trigger.\n */\nexport function resolveTooltipTriggerEvents(trigger: TooltipTrigger): [string, string | null] {\n if (trigger === 'click') {\n return ['click', null];\n } else {\n return ['mouseenter', 'mouseleave'];\n }\n}\n","export type TooltipSize = typeof TooltipSize[keyof typeof TooltipSize];\n\nexport const TooltipSize = {\n AUTO: 'auto',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n} as const;\n","import { ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay';\nimport { TooltipSize } from './tooltip-size';\nimport { TooltipTrigger } from './tooltip-trigger';\n\nexport interface TooltipOptions extends Pick<ConnectedOverlayOptions, 'position' | 'matchReferenceWidth'> {\n trigger: TooltipTrigger;\n delayIn: number;\n delayOut: number;\n size: TooltipSize;\n}\n\nexport const DefaultTooltipOptions: TooltipOptions = {\n matchReferenceWidth: false,\n size: TooltipSize.AUTO,\n trigger: 'hover',\n position: 'top',\n delayIn: 0,\n delayOut: 0,\n};\n","import { ChangeDetectionStrategy, Component, inject, Injector, Input, Type, ViewEncapsulation } from '@angular/core';\nimport { DynamicContent, DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\nimport { TooltipSize } from './models';\n\n/**\n /**\n * TooltipComponent displays contextual information related to an element when the user hovers over\n * or focuses on the element. It supports dynamic content and can be styled with different sizes.\n *\n * The component uses dynamic content rendering to provide flexible display options including text,\n * templates, or even other Angular components, making it highly customizable.\n */\n@CSSComponent('tooltip')\n@Component({\n standalone: true,\n selector: 'odx-tooltip',\n imports: [DynamicViewDirective],\n templateUrl: './tooltip.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.id]': 'id',\n role: 'tooltip',\n },\n})\nexport class TooltipComponent {\n protected readonly injector = inject(Injector);\n public readonly element = injectElement();\n\n /**\n * The ID attribute of the tooltip, used for accessibility purposes to link the tooltip with its owner element.\n *\n * @type {string | null}\n * @default null\n */\n @Input()\n public id: string | null = null;\n\n /**\n * The content to be displayed within the tooltip. This can be text, a template reference, or a dynamic component.\n *\n * @type {DynamicContent | null}\n */\n @Input()\n public content?: Exclude<DynamicContent, Type<unknown>> | null;\n\n /**\n * Determines the size of the tooltip. It can adjust based on the content size or be set to specific dimensions.\n * The size influences the CSS class applied to the tooltip, allowing for custom styles.\n *\n * @type {TooltipSize}\n * @default TooltipSize.AUTO\n */\n @CSSModifier()\n @Input()\n public size: TooltipSize = TooltipSize.AUTO;\n}\n","<ng-template [odxDynamicView]=\"content\" [odxDynamicViewInjector]=\"injector\"></ng-template>\n","import { booleanAttribute, Directive, inject, Injector, Input, OnChanges, OnInit, Type } from '@angular/core';\nimport { ConnectedOverlayRef, ConnectedOverlayService } from '@odx/angular/cdk/connected-overlay';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent, deepmerge } from '@odx/angular/internal';\nimport { delayUntil } from '@odx/angular/rxjs';\nimport { EventManager, getUniqueId, hasChanged, injectElement, NgChanges, untilDestroyed } from '@odx/angular/utils';\nimport { filter, merge, Subject, tap } from 'rxjs';\nimport { resolveTooltipTriggerEvents } from './helpers';\nimport { DefaultTooltipOptions, TooltipOptions, TooltipSize } from './models';\nimport { TooltipComponent } from './tooltip.component';\n\n/**\n * TooltipDirective manages tooltips for host elements by creating overlay components dynamically.\n * It provides configuration options such as content, delay timings, visibility, and tooltip sizing.\n * This directive uses Angular's connected overlay system to position and manage tooltip visibility.\n */\n@CSSComponent('tooltip-host')\n@Directive({\n standalone: true,\n selector: '[odxTooltip]',\n exportAs: 'odxTooltip',\n providers: [EventManager],\n host: {\n '[attr.aria-describedby]': 'tooltipId',\n },\n})\nexport class TooltipDirective implements OnInit, OnChanges {\n private readonly eventManager = inject(EventManager);\n private readonly connectedOverlayService = inject(ConnectedOverlayService);\n private readonly showTrigger$$ = new Subject<void>();\n private readonly hideTrigger$$ = new Subject<void>();\n private connectedOverlayRef: ConnectedOverlayRef | null = null;\n private tooltipOptions = DefaultTooltipOptions;\n private readonly injector = inject(Injector);\n\n protected tooltipId: string | null = null;\n public readonly element = injectElement();\n\n /**\n * Input for dynamic content to display in the tooltip.\n * This content is reactive and can change dynamically.\n *\n * @type {DynamicContent | null}\n * @default null\n */\n @Input('odxTooltip')\n public content?: Exclude<DynamicContent, Type<unknown>> | null = null;\n\n /**\n * Controls whether the tooltip is disabled. A disabled tooltip will not be displayed.\n *\n * @type {boolean}\n * @default false\n */\n @Input({ alias: 'odxTooltipDisabled', transform: booleanAttribute })\n public disabled = false;\n\n /**\n * Configuration options for the tooltip.\n * It allows setting various behaviors like delay and positioning.\n *\n * @param {Partial<TooltipOptions> | null | undefined}\n */\n @Input('odxTooltipOptions')\n public set options(value: Partial<TooltipOptions> | null | undefined) {\n this.tooltipOptions = deepmerge(DefaultTooltipOptions, value) as TooltipOptions;\n }\n\n /**\n * Sets the size of the tooltip.\n *\n * @type {TooltipSize}\n * @default null\n */\n @Input('odxTooltipSize')\n public size?: TooltipSize | null = null;\n\n /**\n * Controls the visibility of the tooltip.\n * Useful for programmatically toggling the tooltip display.\n *\n * @type {boolean}\n * @default false\n */\n @Input({ alias: 'odxTooltipVisible', transform: booleanAttribute })\n public visible = false;\n\n /**\n * Indicates whether the tooltip is currently open.\n *\n * @returns {boolean}\n */\n public get isOpen(): boolean {\n return this.connectedOverlayRef !== null;\n }\n\n constructor() {\n const takeUntilDestroyed = untilDestroyed();\n const show$ = this.showTrigger$$.pipe(\n filter(() => !this.isOpen),\n delayUntil(() => this.tooltipOptions.delayIn, this.hideTrigger$$),\n tap(() => this.show()),\n );\n const hide$ = this.hideTrigger$$.pipe(\n filter(() => this.isOpen),\n delayUntil(() => this.tooltipOptions.delayOut, this.showTrigger$$),\n tap(() => this.hide()),\n );\n merge(show$, hide$).pipe(takeUntilDestroyed()).subscribe();\n }\n\n public ngOnInit(): void {\n this.registerEvents();\n }\n\n public ngOnChanges(changes: NgChanges<TooltipDirective>): void {\n if (hasChanged(changes, 'disabled') && this.disabled) {\n this.hide();\n }\n if (hasChanged(changes, ['content', 'size'])) {\n this.connectedOverlayRef?.update({ context: { content: this.content, size: this.size } });\n }\n if (hasChanged(changes, 'options')) {\n this.connectedOverlayRef?.update(this.tooltipOptions);\n this.registerEvents();\n }\n if (this.visible && !this.disabled) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Shows the tooltip, creating and attaching the overlay to the host element.\n */\n public show(): void {\n if (this.isOpen || this.disabled) return;\n this.tooltipId = getUniqueId('odx-tooltip');\n this.connectedOverlayRef = this.connectedOverlayService.createOverlay(\n this.element.nativeElement,\n {\n ...this.tooltipOptions,\n containerClass: 'odx-tooltip-overlay',\n content: TooltipComponent,\n context: { content: this.content, size: this.size, id: this.tooltipId },\n showArrow: true,\n enableFallback: true,\n },\n {\n host: this.element.nativeElement.parentElement,\n injector: this.injector,\n },\n );\n }\n\n /**\n * Hides the tooltip, detaching the overlay from the host element.\n */\n public hide(): void {\n if (!this.isOpen || (this.visible && !this.disabled)) return;\n this.connectedOverlayRef?.close();\n this.connectedOverlayRef = null;\n this.tooltipId = null;\n }\n\n private registerEvents(): void {\n const [openEvent, closeEvent] = resolveTooltipTriggerEvents(this.tooltipOptions.trigger);\n this.eventManager.destroyListeners();\n this.eventManager.register([openEvent, 'focusin'], () => this.showTrigger$$.next());\n this.eventManager.register([closeEvent, 'focusout'], () => this.hideTrigger$$.next());\n this.eventManager.register(['keyup.esc'], () => this.hideTrigger$$.next(), 'document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A,EAAA,CAAA,CAAA,EAAA;;AAKd,gBAAgB,GAAA,UAAA,CAAA;IAV5B,YAAY,CAAC,cAAc,CAAC;;AAUhB,CAAA,EAAA,gBAAgB,CAmJ5B,CAAA;4FAnJY,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAT5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,SAAS,EAAE,CAAC,YAAY,CAAC;AACzB,oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,WAAW;AACvC,qBAAA;AACF,iBAAA,CAAA;0EAqBQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,YAAY,CAAA;gBAUZ,QAAQ,EAAA,CAAA;sBADd,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAUxD,OAAO,EAAA,CAAA;sBADjB,KAAK;uBAAC,mBAAmB,CAAA;gBAYnB,IAAI,EAAA,CAAA;sBADV,KAAK;uBAAC,gBAAgB,CAAA;gBAWhB,OAAO,EAAA,CAAA;sBADb,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;;;ACpFpE;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-internal.mjs","sources":["../../../../libs/angular/internal/src/lib/helpers/camel-to-kebab-case.ts","../../../../libs/angular/internal/src/lib/helpers/decorator-property-name.ts","../../../../libs/angular/internal/src/lib/helpers/deepmerge.ts","../../../../libs/angular/internal/src/lib/helpers/fast-equals.ts","../../../../libs/angular/internal/src/lib/helpers/get-css-variables.ts","../../../../libs/angular/internal/src/lib/helpers/get-enum-values.ts","../../../../libs/angular/internal/src/lib/decorators/css-component.ts","../../../../libs/angular/internal/src/lib/decorators/css-modifier.ts","../../../../libs/angular/internal/src/lib/logger.ts","../../../../libs/angular/internal/src/odx-angular-internal.ts"],"sourcesContent":["/** @internal */\n/* istanbul ignore next */\nexport function camelToKebabCase(value: string): string {\n if (value !== value.toLowerCase()) {\n return value.replace(/[A-Z]/g, (match, index) => {\n const char = match.toLowerCase();\n\n return index === 0 ? char : `-${char}`;\n });\n }\n return value;\n}\n","/**\n * @internal\n * Generates a unique property name for a decorator.\n *\n * @param {string} decoratorName - The name of the decorator.\n * @param {string} propertyName - The name of the property.\n * @returns {string} - The unique property name.\n */\nexport function decoratorPropertyName<D extends string, T extends string>(decoratorName: D, propertyName: T): `__ODX_${D}_${T}__` {\n return `__ODX_${decoratorName}_${propertyName}__`;\n}\n","import { deepmergeCustom, DeepMergeLeafURI } from 'deepmerge-ts';\n\nexport const deepmerge = deepmergeCustom<{ DeepMergeArraysURI: DeepMergeLeafURI }>({\n mergeArrays: false,\n mergeSets: false,\n});\n","import { deepEqual } from 'fast-equals';\n\nexport const fastDeepEqual = (obj1: unknown, obj2: unknown) => deepEqual(obj1, obj2);\n","interface CSSVariableDefinition {\n name: string;\n value: string;\n}\n\n/* istanbul ignore next */\nfunction isSameDomain({ href }: StyleSheet): boolean {\n return !href || href.startsWith(window.location.origin);\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function getCSSVariables(filter: RegExp, selector = ':root'): CSSVariableDefinition[] {\n const stylesheets = Array.from(document.styleSheets).filter(isSameDomain);\n\n return stylesheets.reduce<CSSVariableDefinition[]>((variables, { cssRules }) => {\n const rules = Array.from(cssRules).filter(({ type }) => type === CSSRule.STYLE_RULE) as CSSStyleRule[];\n for (const { style, selectorText } of rules) {\n for (const propName of Array.from(style)) {\n const name = propName.trim();\n if (!name.startsWith('--') || !filter.test(name) || (selector && selectorText !== selector)) continue;\n variables.push({ name, value: style.getPropertyValue(propName).trim() });\n }\n }\n return variables;\n }, []);\n}\n","/** @internal */\nexport function getEnumValues<TEnum, TKeys extends string>(e: { [key in TKeys]: TEnum }): TEnum[] {\n const keys = Object.keys(e) as TKeys[];\n return keys.filter((key) => e[key] !== undefined).map((key) => e[key]);\n}\n","import { ElementRef, Type } from '@angular/core';\nimport { decoratorPropertyName } from '../helpers';\n\nexport const CSS_COMPONENT_NAME = decoratorPropertyName('CSSComponent', 'name');\n\n/** @internal */\nexport interface CSSComponent {\n readonly element: ElementRef<HTMLElement>;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSComponent(name: string, prefix = 'odx') {\n return (target: Type<CSSComponent>) => {\n const cssClass = `${prefix}-${name}`;\n Object.defineProperty(target.prototype, CSS_COMPONENT_NAME, {\n value: cssClass,\n });\n\n (function (this: unknown, ngOnInit?: () => void) {\n target.prototype.ngOnInit = function (this: CSSComponent) {\n this.element.nativeElement.classList.add(cssClass);\n ngOnInit?.call(this);\n };\n })(target.prototype.ngOnInit);\n };\n}\n","import { camelToKebabCase, decoratorPropertyName } from '../helpers';\nimport { CSSComponent, CSS_COMPONENT_NAME } from './css-component';\n\n/** @internal */\ninterface CSSModifierOptions {\n withComponentPrefix?: boolean;\n withPrefix?: boolean;\n}\n\ntype CSSComponentInstance = CSSComponent & Record<string, unknown>;\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSModifier(options?: CSSModifierOptions) {\n return (target: CSSComponent, propertyKey: PropertyKey) => {\n const propertyKeyName = propertyKey.toString();\n const propertyKeyKebabCase = camelToKebabCase(propertyKeyName);\n const propertySymbol = decoratorPropertyName('CSSModifier', propertyKeyName);\n const propertyDefaultValue = decoratorPropertyName('CSSModifier', `${propertyKeyName}_default`);\n\n function createModifierClass(this: CSSComponentInstance, value: unknown) {\n if (typeof value === 'boolean' || (typeof value === 'string' && value.length > 0)) {\n let modifier = typeof value === 'boolean' ? propertyKeyKebabCase : value;\n if (options?.withPrefix) {\n modifier = `${propertyKeyName}-${modifier}`;\n }\n if (options?.withComponentPrefix ?? true) {\n return `${this[CSS_COMPONENT_NAME]}--${modifier}`;\n }\n return modifier;\n }\n return null;\n }\n\n function getter(this: CSSComponentInstance) {\n return this[propertySymbol];\n }\n\n function setter(this: CSSComponentInstance, value: unknown) {\n this[propertyDefaultValue] ??= value;\n const currentValue = this[propertySymbol] ?? null;\n const nextValue = value ?? this[propertyDefaultValue] ?? null;\n\n if (nextValue !== currentValue) {\n const currentModifierClass = createModifierClass.call(this, currentValue);\n if (currentModifierClass !== null) {\n this.element.nativeElement.classList.remove(currentModifierClass);\n }\n const newModifierClass = createModifierClass.call(this, nextValue);\n if (newModifierClass !== null && (typeof nextValue === 'boolean' ? nextValue : true)) {\n this.element.nativeElement.classList.add(newModifierClass);\n }\n }\n this[propertySymbol] = nextValue;\n }\n Object.defineProperty(target, propertyKey, {\n get: getter,\n set: setter,\n });\n };\n}\n","import { isDevMode } from '@angular/core';\n\nexport class Logger {\n private isEnabled: boolean;\n private readonly name: string;\n private readonly prefix: string;\n\n constructor(name: string) {\n this.name = name;\n this.prefix = `[${this.name}]`;\n this.isEnabled = isDevMode();\n }\n\n public log(...data: unknown[]): void {\n this.handle('log', data);\n }\n\n public info(...data: unknown[]): void {\n this.handle('info', data);\n }\n\n public warn(...data: unknown[]): void {\n this.handle('warn', data);\n }\n\n public error(...data: unknown[]): void {\n this.handle('error', data);\n }\n\n public debug(...data: unknown[]): void {\n this.handle('debug', data);\n }\n\n public group(name: string, groupHandler: (this: Logger, log: (...data: unknown[]) => void) => void, collapsed = true): void {\n if (!this.isEnabled) return;\n console[collapsed ? 'groupCollapsed' : 'group'](this.prefix, name);\n groupHandler.apply(this, [console.info]);\n console.groupEnd();\n }\n\n public enable(): void {\n this.isEnabled = true;\n }\n\n public disable(): void {\n this.isEnabled = false;\n }\n\n protected handle(method: 'debug' | 'log' | 'info' | 'warn' | 'error', data: unknown[]): void {\n if (!this.isEnabled) return;\n console[method](this.prefix, ...data);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings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AAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,QAAQ,EAAE,CAAC;KACpB;IAEM,MAAM,GAAA;AACX,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACvB;IAEM,OAAO,GAAA;AACZ,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KACxB;IAES,MAAM,CAAC,MAAmD,EAAE,IAAe,EAAA;QACnF,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO;QAC5B,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;KACvC;AACF;;ACpDD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-internal.mjs","sources":["../../../../libs/angular/internal/src/lib/helpers/camel-to-kebab-case.ts","../../../../libs/angular/internal/src/lib/helpers/decorator-property-name.ts","../../../../libs/angular/internal/src/lib/helpers/deepmerge.ts","../../../../libs/angular/internal/src/lib/helpers/fast-equals.ts","../../../../libs/angular/internal/src/lib/helpers/get-css-variables.ts","../../../../libs/angular/internal/src/lib/helpers/get-enum-values.ts","../../../../libs/angular/internal/src/lib/decorators/css-component.ts","../../../../libs/angular/internal/src/lib/decorators/css-modifier.ts","../../../../libs/angular/internal/src/lib/logger.ts","../../../../libs/angular/internal/src/odx-angular-internal.ts"],"sourcesContent":["/** @internal */\n/* istanbul ignore next */\nexport function camelToKebabCase(value: string): string {\n if (value !== value.toLowerCase()) {\n return value.replace(/[A-Z]/g, (match, index) => {\n const char = match.toLowerCase();\n\n return index === 0 ? char : `-${char}`;\n });\n }\n return value;\n}\n","/**\n * @internal\n * Generates a unique property name for a decorator.\n *\n * @param {string} decoratorName - The name of the decorator.\n * @param {string} propertyName - The name of the property.\n * @returns {string} - The unique property name.\n */\nexport function decoratorPropertyName<D extends string, T extends string>(decoratorName: D, propertyName: T): `__ODX_${D}_${T}__` {\n return `__ODX_${decoratorName}_${propertyName}__`;\n}\n","import { deepmergeCustom } from 'deepmerge-ts';\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n mergeSets: false,\n});\n","import { deepEqual } from 'fast-equals';\n\nexport const fastDeepEqual = (obj1: unknown, obj2: unknown) => deepEqual(obj1, obj2);\n","interface CSSVariableDefinition {\n name: string;\n value: string;\n}\n\n/* istanbul ignore next */\nfunction isSameDomain({ href }: StyleSheet): boolean {\n return !href || href.startsWith(window.location.origin);\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function getCSSVariables(filter: RegExp, selector = ':root'): CSSVariableDefinition[] {\n const stylesheets = Array.from(document.styleSheets).filter(isSameDomain);\n\n return stylesheets.reduce<CSSVariableDefinition[]>((variables, { cssRules }) => {\n const rules = Array.from(cssRules).filter(({ type }) => type === CSSRule.STYLE_RULE) as CSSStyleRule[];\n for (const { style, selectorText } of rules) {\n for (const propName of Array.from(style)) {\n const name = propName.trim();\n if (!name.startsWith('--') || !filter.test(name) || (selector && selectorText !== selector)) continue;\n variables.push({ name, value: style.getPropertyValue(propName).trim() });\n }\n }\n return variables;\n }, []);\n}\n","/** @internal */\nexport function getEnumValues<TEnum, TKeys extends string>(e: { [key in TKeys]: TEnum }): TEnum[] {\n const keys = Object.keys(e) as TKeys[];\n return keys.filter((key) => e[key] !== undefined).map((key) => e[key]);\n}\n","import { ElementRef, Type } from '@angular/core';\nimport { decoratorPropertyName } from '../helpers';\n\nexport const CSS_COMPONENT_NAME = decoratorPropertyName('CSSComponent', 'name');\n\n/** @internal */\nexport interface CSSComponent {\n readonly element: ElementRef<HTMLElement>;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSComponent(name: string, prefix = 'odx') {\n return (target: Type<CSSComponent>) => {\n const cssClass = `${prefix}-${name}`;\n Object.defineProperty(target.prototype, CSS_COMPONENT_NAME, {\n value: cssClass,\n });\n\n (function (this: unknown, ngOnInit?: () => void) {\n target.prototype.ngOnInit = function (this: CSSComponent) {\n this.element.nativeElement.classList.add(cssClass);\n ngOnInit?.call(this);\n };\n })(target.prototype.ngOnInit);\n };\n}\n","import { camelToKebabCase, decoratorPropertyName } from '../helpers';\nimport { CSSComponent, CSS_COMPONENT_NAME } from './css-component';\n\n/** @internal */\ninterface CSSModifierOptions {\n withComponentPrefix?: boolean;\n withPrefix?: boolean;\n}\n\ntype CSSComponentInstance = CSSComponent & Record<string, unknown>;\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSModifier(options?: CSSModifierOptions) {\n return (target: CSSComponent, propertyKey: PropertyKey) => {\n const propertyKeyName = propertyKey.toString();\n const propertyKeyKebabCase = camelToKebabCase(propertyKeyName);\n const propertySymbol = decoratorPropertyName('CSSModifier', propertyKeyName);\n const propertyDefaultValue = decoratorPropertyName('CSSModifier', `${propertyKeyName}_default`);\n\n function createModifierClass(this: CSSComponentInstance, value: unknown) {\n if (typeof value === 'boolean' || (typeof value === 'string' && value.length > 0)) {\n let modifier = typeof value === 'boolean' ? propertyKeyKebabCase : value;\n if (options?.withPrefix) {\n modifier = `${propertyKeyName}-${modifier}`;\n }\n if (options?.withComponentPrefix ?? true) {\n return `${this[CSS_COMPONENT_NAME]}--${modifier}`;\n }\n return modifier;\n }\n return null;\n }\n\n function getter(this: CSSComponentInstance) {\n return this[propertySymbol];\n }\n\n function setter(this: CSSComponentInstance, value: unknown) {\n this[propertyDefaultValue] ??= value;\n const currentValue = this[propertySymbol] ?? null;\n const nextValue = value ?? this[propertyDefaultValue] ?? null;\n\n if (nextValue !== currentValue) {\n const currentModifierClass = createModifierClass.call(this, currentValue);\n if (currentModifierClass !== null) {\n this.element.nativeElement.classList.remove(currentModifierClass);\n }\n const newModifierClass = createModifierClass.call(this, nextValue);\n if (newModifierClass !== null && (typeof nextValue === 'boolean' ? nextValue : true)) {\n this.element.nativeElement.classList.add(newModifierClass);\n }\n }\n this[propertySymbol] = nextValue;\n }\n Object.defineProperty(target, propertyKey, {\n get: getter,\n set: setter,\n });\n };\n}\n","import { isDevMode } from '@angular/core';\n\nexport class Logger {\n private isEnabled: boolean;\n private readonly name: string;\n private readonly prefix: string;\n\n constructor(name: string) {\n this.name = name;\n this.prefix = `[${this.name}]`;\n this.isEnabled = isDevMode();\n }\n\n public log(...data: unknown[]): void {\n this.handle('log', data);\n }\n\n public info(...data: unknown[]): void {\n this.handle('info', data);\n }\n\n public warn(...data: unknown[]): void {\n this.handle('warn', data);\n }\n\n public error(...data: unknown[]): void {\n this.handle('error', data);\n }\n\n public debug(...data: unknown[]): void {\n this.handle('debug', data);\n }\n\n public group(name: string, groupHandler: (this: Logger, log: (...data: unknown[]) => void) => void, collapsed = true): void {\n if (!this.isEnabled) return;\n console[collapsed ? 'groupCollapsed' : 'group'](this.prefix, name);\n groupHandler.apply(this, [console.info]);\n console.groupEnd();\n }\n\n public enable(): void {\n this.isEnabled = true;\n }\n\n public disable(): void {\n this.isEnabled = false;\n }\n\n protected handle(method: 'debug' | 'log' | 'info' | 'warn' | 'error', data: unknown[]): void {\n if (!this.isEnabled) return;\n console[method](this.prefix, ...data);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;AACM,SAAU,gBAAgB,CAAC,KAAa,EAAA;AAC5C,IAAA,IAAI,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,EAAE;QACjC,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAI;AAC9C,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;AAEjC,YAAA,OAAO,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,CAAI,CAAA,EAAA,IAAI,EAAE,CAAC;AACzC,SAAC,CAAC,CAAC;AACJ,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACf;;ACXA;;;;;;;AAOG;AACa,SAAA,qBAAqB,CAAqC,aAAgB,EAAE,YAAe,EAAA;AACzG,IAAA,OAAO,CAAS,MAAA,EAAA,aAAa,CAAI,C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ageClient } from '@odx/angular/utils';
4
3
 
5
4
  /**
6
5
  * Creates a loader function for fetching application environment data over HTTP and caching it.
@@ -15,8 +14,9 @@ import { CacheStorageClient } from '@odx/angular/utils';
15
14
  * });
16
15
  */
17
16
  function createHttpApplicationEnvironmentLoader(handler) {
18
- const cache = new CacheStorageClient('@odx/angular/sdk::ApplicationEnvironment');
19
- return (...args) => cache.request(...args).then((dto) => handler(dto));
17
+ return (...args) => fetch(...args)
18
+ .then((res) => res.json())
19
+ .then((dto) => handler(dto));
20
20
  }
21
21
  /**
22
22
  * The application environment module can be used to load environment data before application startup,
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-sdk.mjs","sources":["../../../../libs/angular/sdk/src/lib/application-environment.ts","../../../../libs/angular/sdk/src/odx-angular-sdk.ts"],"sourcesContent":["import { ApplicationRef, inject, InjectionToken } from '@angular/core';\nimport { bootstrapApplication } from '@angular/platform-browser';\nimport { CacheStorageClient } from '@odx/angular/utils';\n\n/**\n * A function type definition for loading environment data for an application.\n * It's a generic loader function that accepts parameters and returns a Promise of environment data.\n *\n * @template EnvironmentData The type of the environment data to be loaded.\n * @template Params The types of the parameters accepted by the loader function.\n * @param {...Params} args - Parameters passed to the loader function.\n * @returns {Promise<EnvironmentData>} A promise resolving to the loaded environment data.\n */\nexport type ApplicationEnvironmentLoader<EnvironmentData, Params extends unknown[]> = (...args: Params) => Promise<EnvironmentData>;\n\n/**\n * Creates a loader function for fetching application environment data over HTTP and caching it.\n * Utilizes `CacheStorageClient` for caching the fetched data to optimize performance and reduce network load.\n *\n * @template Data The type of the data expected from the HTTP request.\n * @param {Function} handler - A function that processes the fetched data and returns a promise resolving to the desired environment data format.\n * @returns {ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>>} A loader function that fetches, caches, and processes environment data.\n * @example\n * const environmentLoader = createHttpApplicationEnvironmentLoader(async (dto) => {\n * return { apiEndpoint: dto.apiEndpoint, featureFlags: dto.featureFlags };\n * });\n */\nexport function createHttpApplicationEnvironmentLoader<Data>(\n handler: (dto: unknown) => Promise<Data>,\n): ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>> {\n const cache = new CacheStorageClient('@odx/angular/sdk::ApplicationEnvironment');\n\n return (...args: Parameters<CacheStorageClient['request']>) => cache.request<unknown>(...args).then((dto) => handler(dto));\n}\n\n/**\n * The application environment module can be used to load environment data before application startup,\n * that can be used to load environment variables from an external URL.\n *\n * @template Data The type of the environment data.\n * @template Params The types of the parameters accepted by the loader function.\n * @param {ApplicationEnvironmentLoader<Data, Params>} loader - A loader function that asynchronously loads the environment data.\n * @returns An object containing utilities for working with the application environment, including the InjectionToken\n * and functions for loading and bootstrapping the application with the environment.\n * @example\n * To add an application environment to your Angular application, follow the following steps:\n * 1. Create the application environment with your loader:\n * ```ts\n * import { createApplicationEnvironment, createHttpApplicationEnvironmentLoader } from '@odx/angular/sdk';\n * import { z } from 'zod';\n *\n * export const ApplicationConfigSchema = z.object({\n * environment: z.enum(['dev', 'stage', 'prod']),\n * appName: z.string().default('App'),\n * });\n *\n * const httpEnvironmentLoader = createHttpApplicationEnvironmentLoader((res) => res.json().then(ApplicationConfigSchema.parse));\n * export const { injectApplicationEnvironment, bootstrapApplicationWithEnvironment } = createApplicationEnvironment(httpEnvironmentLoader);\n * ```\n * This example creates an HTTP environment loader which parses the response as JSON and validate it against a schema\n *\n * 2. Provide the application environment:\n * ```ts\n * bootstrapApplicationWithEnvironment(['assets/config.json'], AppComponent, { providers: [] });\n * ```\n *\n * 3. Use the application environment via DI\n * ```ts\n * class MyService {\n * private readonly environment = injectApplicationEnvironment();\n * }\n * ```\n */\nexport function createApplicationEnvironment<Data, Params extends unknown[]>(loader: ApplicationEnvironmentLoader<Data, Params>) {\n let environment: Data;\n const APPLICATION_ENVIRONMENT = new InjectionToken<Data>('@odx/angular/sdk::ApplicationEnvironment', {\n providedIn: 'root',\n factory: () => environment as Data,\n });\n\n function injectApplicationEnvironment(): Data {\n return inject(APPLICATION_ENVIRONMENT);\n }\n\n async function loadApplicationEnvironment(...args: Parameters<typeof loader>): Promise<Data> {\n environment = await loader(...args);\n if (!environment) {\n throw new Error('[@odx/angular/sdk] Failed load application environment');\n }\n return environment;\n }\n\n async function bootstrapApplicationWithEnvironment(\n params: Parameters<typeof loader>,\n ...args: Parameters<typeof bootstrapApplication>\n ): Promise<ApplicationRef> {\n await loadApplicationEnvironment(...params);\n\n return bootstrapApplication(...args);\n }\n\n return {\n APPLICATION_ENVIRONMENT,\n injectApplicationEnvironment,\n bootstrapApplicationWithEnvironment,\n loadApplicationEnvironment,\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAeA;;;;;;;;;;;AAWG;AACG,SAAU,sCAAsC,CACpD,OAAwC,EAAA;AAExC,IAAA,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,0CAA0C,CAAC,CAAC;IAEjF,OAAO,CAAC,GAAG,IAA+C,KAAK,KAAK,CAAC,OAAO,CAAU,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7H,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACG,SAAU,4BAA4B,CAAiC,MAAkD,EAAA;AAC7H,IAAA,IAAI,WAAiB,CAAC;AACtB,IAAA,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAO,0CAA0C,EAAE;AACnG,QAAA,UAAU,EAAE,MAAM;AAClB,QAAA,OAAO,EAAE,MAAM,WAAmB;AACnC,KAAA,CAAC,CAAC;AAEH,IAAA,SAAS,4BAA4B,GAAA;AACnC,QAAA,OAAO,MAAM,CAAC,uBAAuB,CAAC,CAAC;KACxC;AAED,IAAA,eAAe,0BAA0B,CAAC,GAAG,IAA+B,EAAA;AAC1E,QAAA,WAAW,GAAG,MAAM,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC3E,SAAA;AACD,QAAA,OAAO,WAAW,CAAC;KACpB;AAED,IAAA,eAAe,mCAAmC,CAChD,MAAiC,EACjC,GAAG,IAA6C,EAAA;AAEhD,QAAA,MAAM,0BAA0B,CAAC,GAAG,MAAM,CAAC,CAAC;AAE5C,QAAA,OAAO,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAAC;KACtC;IAED,OAAO;QACL,uBAAuB;QACvB,4BAA4B;QAC5B,mCAAmC;QACnC,0BAA0B;KAC3B,CAAC;AACJ;;AC3GA;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-sdk.mjs","sources":["../../../../libs/angular/sdk/src/lib/application-environment.ts","../../../../libs/angular/sdk/src/odx-angular-sdk.ts"],"sourcesContent":["import { ApplicationRef, inject, InjectionToken } from '@angular/core';\nimport { bootstrapApplication } from '@angular/platform-browser';\n\n/**\n * A function type definition for loading environment data for an application.\n * It's a generic loader function that accepts parameters and returns a Promise of environment data.\n *\n * @template EnvironmentData The type of the environment data to be loaded.\n * @template Params The types of the parameters accepted by the loader function.\n * @param {...Params} args - Parameters passed to the loader function.\n * @returns {Promise<EnvironmentData>} A promise resolving to the loaded environment data.\n */\nexport type ApplicationEnvironmentLoader<EnvironmentData, Params extends unknown[]> = (...args: Params) => Promise<EnvironmentData>;\n\n/**\n * Creates a loader function for fetching application environment data over HTTP and caching it.\n * Utilizes `CacheStorageClient` for caching the fetched data to optimize performance and reduce network load.\n *\n * @template Data The type of the data expected from the HTTP request.\n * @param {Function} handler - A function that processes the fetched data and returns a promise resolving to the desired environment data format.\n * @returns {ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>>} A loader function that fetches, caches, and processes environment data.\n * @example\n * const environmentLoader = createHttpApplicationEnvironmentLoader(async (dto) => {\n * return { apiEndpoint: dto.apiEndpoint, featureFlags: dto.featureFlags };\n * });\n */\nexport function createHttpApplicationEnvironmentLoader<Data>(\n handler: (dto: unknown) => Promise<Data>,\n): ApplicationEnvironmentLoader<Data, Parameters<typeof fetch>> {\n return (...args: Parameters<typeof fetch>) =>\n fetch(...args)\n .then((res) => res.json())\n .then((dto) => handler(dto));\n}\n\n/**\n * The application environment module can be used to load environment data before application startup,\n * that can be used to load environment variables from an external URL.\n *\n * @template Data The type of the environment data.\n * @template Params The types of the parameters accepted by the loader function.\n * @param {ApplicationEnvironmentLoader<Data, Params>} loader - A loader function that asynchronously loads the environment data.\n * @returns An object containing utilities for working with the application environment, including the InjectionToken\n * and functions for loading and bootstrapping the application with the environment.\n * @example\n * To add an application environment to your Angular application, follow the following steps:\n * 1. Create the application environment with your loader:\n * ```ts\n * import { createApplicationEnvironment, createHttpApplicationEnvironmentLoader } from '@odx/angular/sdk';\n * import { z } from 'zod';\n *\n * export const ApplicationConfigSchema = z.object({\n * environment: z.enum(['dev', 'stage', 'prod']),\n * appName: z.string().default('App'),\n * });\n *\n * const httpEnvironmentLoader = createHttpApplicationEnvironmentLoader((res) => res.json().then(ApplicationConfigSchema.parse));\n * export const { injectApplicationEnvironment, bootstrapApplicationWithEnvironment } = createApplicationEnvironment(httpEnvironmentLoader);\n * ```\n * This example creates an HTTP environment loader which parses the response as JSON and validate it against a schema\n *\n * 2. Provide the application environment:\n * ```ts\n * bootstrapApplicationWithEnvironment(['assets/config.json'], AppComponent, { providers: [] });\n * ```\n *\n * 3. Use the application environment via DI\n * ```ts\n * class MyService {\n * private readonly environment = injectApplicationEnvironment();\n * }\n * ```\n */\nexport function createApplicationEnvironment<Data, Params extends unknown[]>(loader: ApplicationEnvironmentLoader<Data, Params>) {\n let environment: Data;\n const APPLICATION_ENVIRONMENT = new InjectionToken<Data>('@odx/angular/sdk::ApplicationEnvironment', {\n providedIn: 'root',\n factory: () => environment as Data,\n });\n\n function injectApplicationEnvironment(): Data {\n return inject(APPLICATION_ENVIRONMENT);\n }\n\n async function loadApplicationEnvironment(...args: Parameters<typeof loader>): Promise<Data> {\n environment = await loader(...args);\n if (!environment) {\n throw new Error('[@odx/angular/sdk] Failed load application environment');\n }\n return environment;\n }\n\n async function bootstrapApplicationWithEnvironment(\n params: Parameters<typeof loader>,\n ...args: Parameters<typeof bootstrapApplication>\n ): Promise<ApplicationRef> {\n await loadApplicationEnvironment(...params);\n\n return bootstrapApplication(...args);\n }\n\n return {\n APPLICATION_ENVIRONMENT,\n injectApplicationEnvironment,\n bootstrapApplicationWithEnvironment,\n loadApplicationEnvironment,\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAcA;;;;;;;;;;;AAWG;AACG,SAAU,sCAAsC,CACpD,OAAwC,EAAA;IAExC,OAAO,CAAC,GAAG,IAA8B,KACvC,KAAK,CAAC,GAAG,IAAI,CAAC;SACX,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;SACzB,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACG,SAAU,4BAA4B,CAAiC,MAAkD,EAAA;AAC7H,IAAA,IAAI,WAAiB,CAAC;AACtB,IAAA,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAO,0CAA0C,EAAE;AACnG,QAAA,UAAU,EAAE,MAAM;AAClB,QAAA,OAAO,EAAE,MAAM,WAAmB;AACnC,KAAA,CAAC,CAAC;AAEH,IAAA,SAAS,4BAA4B,GAAA;AACnC,QAAA,OAAO,MAAM,CAAC,uBAAuB,CAAC,CAAC;KACxC;AAED,IAAA,eAAe,0BAA0B,CAAC,GAAG,IAA+B,EAAA;AAC1E,QAAA,WAAW,GAAG,MAAM,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC3E,SAAA;AACD,QAAA,OAAO,WAAW,CAAC;KACpB;AAED,IAAA,eAAe,mCAAmC,CAChD,MAAiC,EACjC,GAAG,IAA6C,EAAA;AAEhD,QAAA,MAAM,0BAA0B,CAAC,GAAG,MAAM,CAAC,CAAC;AAE5C,QAAA,OAAO,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAAC;KACtC;IAED,OAAO;QACL,uBAAuB;QACvB,4BAA4B;QAC5B,mCAAmC;QACnC,0BAA0B;KAC3B,CAAC;AACJ;;AC3GA;;AAEG;;;;"}
@@ -1233,7 +1233,7 @@ class Queue {
1233
1233
  const addedItems = [];
1234
1234
  const updatedItems = [];
1235
1235
  for (const item of items) {
1236
- if (this.get(item)) {
1236
+ if (!this.get(item)) {
1237
1237
  addedItems.push(item);
1238
1238
  }
1239
1239
  else {