@odx/angular 12.21.4 → 12.21.5

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 (146) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/fesm2022/odx-angular-animations.mjs.map +1 -1
  3. package/fesm2022/odx-angular-breakpoints.mjs +1 -1
  4. package/fesm2022/odx-angular-breakpoints.mjs.map +1 -1
  5. package/fesm2022/odx-angular-cdk-a11y.mjs +1 -1
  6. package/fesm2022/odx-angular-cdk-a11y.mjs.map +1 -1
  7. package/fesm2022/odx-angular-cdk-active-indicator.mjs +1 -1
  8. package/fesm2022/odx-angular-cdk-active-indicator.mjs.map +1 -1
  9. package/fesm2022/odx-angular-cdk-autocomplete-control.mjs +1 -1
  10. package/fesm2022/odx-angular-cdk-autocomplete-control.mjs.map +1 -1
  11. package/fesm2022/odx-angular-cdk-checkbox-control.mjs +1 -1
  12. package/fesm2022/odx-angular-cdk-checkbox-control.mjs.map +1 -1
  13. package/fesm2022/odx-angular-cdk-connected-overlay.mjs +1 -1
  14. package/fesm2022/odx-angular-cdk-connected-overlay.mjs.map +1 -1
  15. package/fesm2022/odx-angular-cdk-custom-form-control.mjs +1 -1
  16. package/fesm2022/odx-angular-cdk-custom-form-control.mjs.map +1 -1
  17. package/fesm2022/odx-angular-cdk-date-input.mjs.map +1 -1
  18. package/fesm2022/odx-angular-cdk-dynamic-view.mjs +1 -1
  19. package/fesm2022/odx-angular-cdk-dynamic-view.mjs.map +1 -1
  20. package/fesm2022/odx-angular-cdk-event-plugins.mjs.map +1 -1
  21. package/fesm2022/odx-angular-cdk-expandable.mjs +1 -1
  22. package/fesm2022/odx-angular-cdk-expandable.mjs.map +1 -1
  23. package/fesm2022/odx-angular-cdk-option-control.mjs +1 -1
  24. package/fesm2022/odx-angular-cdk-option-control.mjs.map +1 -1
  25. package/fesm2022/odx-angular-cdk-radio-group-control.mjs +1 -1
  26. package/fesm2022/odx-angular-cdk-radio-group-control.mjs.map +1 -1
  27. package/fesm2022/odx-angular-cdk-scrollable.mjs.map +1 -1
  28. package/fesm2022/odx-angular-components-accordion.mjs +1 -1
  29. package/fesm2022/odx-angular-components-accordion.mjs.map +1 -1
  30. package/fesm2022/odx-angular-components-action-group.mjs +1 -1
  31. package/fesm2022/odx-angular-components-action-group.mjs.map +1 -1
  32. package/fesm2022/odx-angular-components-anchor-navigation.mjs +1 -1
  33. package/fesm2022/odx-angular-components-anchor-navigation.mjs.map +1 -1
  34. package/fesm2022/odx-angular-components-area-header.mjs +1 -1
  35. package/fesm2022/odx-angular-components-area-header.mjs.map +1 -1
  36. package/fesm2022/odx-angular-components-autocomplete.mjs +1 -1
  37. package/fesm2022/odx-angular-components-autocomplete.mjs.map +1 -1
  38. package/fesm2022/odx-angular-components-avatar.mjs +1 -1
  39. package/fesm2022/odx-angular-components-avatar.mjs.map +1 -1
  40. package/fesm2022/odx-angular-components-badge.mjs +1 -1
  41. package/fesm2022/odx-angular-components-badge.mjs.map +1 -1
  42. package/fesm2022/odx-angular-components-bar.mjs +1 -1
  43. package/fesm2022/odx-angular-components-bar.mjs.map +1 -1
  44. package/fesm2022/odx-angular-components-breadcrumbs.mjs +1 -1
  45. package/fesm2022/odx-angular-components-breadcrumbs.mjs.map +1 -1
  46. package/fesm2022/odx-angular-components-button-group.mjs +1 -1
  47. package/fesm2022/odx-angular-components-button-group.mjs.map +1 -1
  48. package/fesm2022/odx-angular-components-button.mjs +1 -1
  49. package/fesm2022/odx-angular-components-button.mjs.map +1 -1
  50. package/fesm2022/odx-angular-components-calendar.mjs +2 -2
  51. package/fesm2022/odx-angular-components-calendar.mjs.map +1 -1
  52. package/fesm2022/odx-angular-components-card.mjs +2 -2
  53. package/fesm2022/odx-angular-components-card.mjs.map +1 -1
  54. package/fesm2022/odx-angular-components-checkbox.mjs +1 -1
  55. package/fesm2022/odx-angular-components-checkbox.mjs.map +1 -1
  56. package/fesm2022/odx-angular-components-chip.mjs +1 -1
  57. package/fesm2022/odx-angular-components-chip.mjs.map +1 -1
  58. package/fesm2022/odx-angular-components-circular-progress.mjs +1 -1
  59. package/fesm2022/odx-angular-components-circular-progress.mjs.map +1 -1
  60. package/fesm2022/odx-angular-components-content-box.mjs +1 -1
  61. package/fesm2022/odx-angular-components-content-box.mjs.map +1 -1
  62. package/fesm2022/odx-angular-components-data-table.mjs +1 -1
  63. package/fesm2022/odx-angular-components-data-table.mjs.map +1 -1
  64. package/fesm2022/odx-angular-components-datepicker.mjs +2 -2
  65. package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
  66. package/fesm2022/odx-angular-components-daterangepicker.mjs +3 -3
  67. package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -1
  68. package/fesm2022/odx-angular-components-dropdown.mjs +1 -1
  69. package/fesm2022/odx-angular-components-dropdown.mjs.map +1 -1
  70. package/fesm2022/odx-angular-components-error-page.mjs +1 -1
  71. package/fesm2022/odx-angular-components-error-page.mjs.map +1 -1
  72. package/fesm2022/odx-angular-components-footer.mjs +2 -2
  73. package/fesm2022/odx-angular-components-footer.mjs.map +1 -1
  74. package/fesm2022/odx-angular-components-form-field.mjs +1 -1
  75. package/fesm2022/odx-angular-components-form-field.mjs.map +1 -1
  76. package/fesm2022/odx-angular-components-header-navigation.mjs +1 -1
  77. package/fesm2022/odx-angular-components-header-navigation.mjs.map +1 -1
  78. package/fesm2022/odx-angular-components-header.mjs +1 -1
  79. package/fesm2022/odx-angular-components-header.mjs.map +1 -1
  80. package/fesm2022/odx-angular-components-icon.mjs +1 -1
  81. package/fesm2022/odx-angular-components-icon.mjs.map +1 -1
  82. package/fesm2022/odx-angular-components-inline-message.mjs +1 -1
  83. package/fesm2022/odx-angular-components-inline-message.mjs.map +1 -1
  84. package/fesm2022/odx-angular-components-link.mjs.map +1 -1
  85. package/fesm2022/odx-angular-components-list.mjs +2 -2
  86. package/fesm2022/odx-angular-components-list.mjs.map +1 -1
  87. package/fesm2022/odx-angular-components-loading-spinner.mjs +1 -1
  88. package/fesm2022/odx-angular-components-loading-spinner.mjs.map +1 -1
  89. package/fesm2022/odx-angular-components-logo.mjs +1 -1
  90. package/fesm2022/odx-angular-components-logo.mjs.map +1 -1
  91. package/fesm2022/odx-angular-components-main-menu.mjs +2 -2
  92. package/fesm2022/odx-angular-components-main-menu.mjs.map +1 -1
  93. package/fesm2022/odx-angular-components-mainfilter-group.mjs +1 -1
  94. package/fesm2022/odx-angular-components-mainfilter-group.mjs.map +1 -1
  95. package/fesm2022/odx-angular-components-menu.mjs +1 -1
  96. package/fesm2022/odx-angular-components-menu.mjs.map +1 -1
  97. package/fesm2022/odx-angular-components-modal.mjs +1 -1
  98. package/fesm2022/odx-angular-components-modal.mjs.map +1 -1
  99. package/fesm2022/odx-angular-components-navigation-back.mjs +1 -1
  100. package/fesm2022/odx-angular-components-navigation-back.mjs.map +1 -1
  101. package/fesm2022/odx-angular-components-notification-testing.mjs.map +1 -1
  102. package/fesm2022/odx-angular-components-notification.mjs +3 -3
  103. package/fesm2022/odx-angular-components-notification.mjs.map +1 -1
  104. package/fesm2022/odx-angular-components-paginator.mjs +1 -1
  105. package/fesm2022/odx-angular-components-paginator.mjs.map +1 -1
  106. package/fesm2022/odx-angular-components-progress.mjs +1 -1
  107. package/fesm2022/odx-angular-components-progress.mjs.map +1 -1
  108. package/fesm2022/odx-angular-components-radio-group.mjs +1 -1
  109. package/fesm2022/odx-angular-components-radio-group.mjs.map +1 -1
  110. package/fesm2022/odx-angular-components-rail-navigation.mjs +1 -1
  111. package/fesm2022/odx-angular-components-rail-navigation.mjs.map +1 -1
  112. package/fesm2022/odx-angular-components-rich-list.mjs +1 -1
  113. package/fesm2022/odx-angular-components-rich-list.mjs.map +1 -1
  114. package/fesm2022/odx-angular-components-search-bar.mjs.map +1 -1
  115. package/fesm2022/odx-angular-components-select.mjs +1 -1
  116. package/fesm2022/odx-angular-components-select.mjs.map +1 -1
  117. package/fesm2022/odx-angular-components-slider.mjs +1 -1
  118. package/fesm2022/odx-angular-components-slider.mjs.map +1 -1
  119. package/fesm2022/odx-angular-components-spinbox.mjs +1 -1
  120. package/fesm2022/odx-angular-components-spinbox.mjs.map +1 -1
  121. package/fesm2022/odx-angular-components-switch.mjs +1 -1
  122. package/fesm2022/odx-angular-components-switch.mjs.map +1 -1
  123. package/fesm2022/odx-angular-components-tab-bar.mjs +1 -1
  124. package/fesm2022/odx-angular-components-tab-bar.mjs.map +1 -1
  125. package/fesm2022/odx-angular-components-table.mjs +1 -1
  126. package/fesm2022/odx-angular-components-table.mjs.map +1 -1
  127. package/fesm2022/odx-angular-components-timepicker.mjs +2 -2
  128. package/fesm2022/odx-angular-components-timepicker.mjs.map +1 -1
  129. package/fesm2022/odx-angular-components-toast.mjs +1 -1
  130. package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
  131. package/fesm2022/odx-angular-components-toggle-button-group.mjs +1 -1
  132. package/fesm2022/odx-angular-components-toggle-button-group.mjs.map +1 -1
  133. package/fesm2022/odx-angular-components-tooltip.mjs +1 -1
  134. package/fesm2022/odx-angular-components-tooltip.mjs.map +1 -1
  135. package/fesm2022/odx-angular-components-wizard.mjs +1 -1
  136. package/fesm2022/odx-angular-components-wizard.mjs.map +1 -1
  137. package/fesm2022/odx-angular-internal-translate.mjs.map +1 -1
  138. package/fesm2022/odx-angular-internal.mjs.map +1 -1
  139. package/fesm2022/odx-angular-localization.mjs.map +1 -1
  140. package/fesm2022/odx-angular-rxjs.mjs.map +1 -1
  141. package/fesm2022/odx-angular-sdk.mjs.map +1 -1
  142. package/fesm2022/odx-angular-theming.mjs.map +1 -1
  143. package/fesm2022/odx-angular-utils.mjs.map +1 -1
  144. package/fesm2022/odx-angular.mjs +2 -2
  145. package/fesm2022/odx-angular.mjs.map +1 -1
  146. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @odx/angular
2
2
 
3
+ ## 12.21.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 53b5444: Fix: toast container tagname in docs
8
+
3
9
  ## 12.21.4
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-animations.mjs","sources":["../../../../libs/angular/animations/src/lib/config.ts","../../../../libs/angular/animations/src/lib/expand.ts","../../../../libs/angular/animations/src/lib/fade.ts","../../../../libs/angular/animations/src/lib/slide.ts","../../../../libs/angular/animations/src/lib/wait-for-child-animations.ts","../../../../libs/angular/animations/src/odx-angular-animations.ts"],"sourcesContent":["export const DEFAULT_ANIMATION_TIMING_FN = 'ease';\nexport const DEFAULT_ANIMATION_DURATION = '250ms';\nexport const DEFAULT_ANIMATION_PARAMS = {\n timingFn: DEFAULT_ANIMATION_TIMING_FN,\n duration: DEFAULT_ANIMATION_DURATION,\n delay: '0ms',\n};\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\n/**\n * Animation for smoothly expanding an element from height 0 to its natural height.\n * It transitions the element's height, padding, margin, and opacity from a collapsed state to an expanded state,\n * making the element smoothly grow into view.\n *\n * The `expand` animation uses `DEFAULT_ANIMATION_PARAMS` for its default parameters, which can be overridden\n * when using the animation.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component\n * import { expand, collapse } from '@odx/angular/animations';\n *\n * @Component({\n * selector: 'my-expandable-component',\n * templateUrl: './expandable-component.html',\n * animations: [\n * trigger('expandCollapse', [\n * transition('collapsed => expanded', useAnimation(expand)),\n * transition('expanded => collapsed', useAnimation(collapse)),\n * ])\n * ]\n * })\n * export class ExpandableComponent {\n * state = 'collapsed';\n *\n * toggle(): void {\n * this.state = this.state === 'collapsed' ? 'expanded' : 'collapsed';\n * }\n * }\n * ```\n *\n * The animation smoothly transitions various properties (height, padding, margin, and opacity) and is controlled\n * through parameters defined in `DEFAULT_ANIMATION_PARAMS` or those provided during usage.\n */\nexport const expand = animation(\n [\n style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, marginTop: 0, marginBottom: 0, overflow: 'hidden' }),\n animate(\n '{{duration}} {{ delay }} {{ timingFn }}',\n style({ height: '*', paddingTop: '*', paddingBottom: '*', opacity: 1, marginTop: '*', marginBottom: '*' }),\n ),\n ],\n {\n params: DEFAULT_ANIMATION_PARAMS,\n },\n);\n\n/**\n * Animation for smoothly collapsing an element from its natural height to height 0.\n * It transitions the element's height, padding, margin, and opacity from an expanded state to a collapsed state,\n * making the element smoothly shrink out of view.\n *\n * The `collapse` animation also uses `DEFAULT_ANIMATION_PARAMS` for its default parameters, which can be overridden\n * when using the animation. It's designed to be used in conjunction with the `expand` animation for creating\n * expandable/collapsible elements.\n */\nexport const collapse = animation(\n [\n animate(\n '{{duration}} {{ delay }} {{ timingFn }}',\n style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, marginTop: 0, marginBottom: 0, overflow: 'hidden' }),\n ),\n ],\n {\n params: DEFAULT_ANIMATION_PARAMS,\n },\n);\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\n/**\n * Generates a fadeIn animation with customizable opacity target.\n * This animation gradually changes the element's opacity from 0 to a specified value, creating a \"fade in\" visual effect.\n *\n * @param {number} to - The final opacity value of the element at the end of the animation. Defaults to 1 (fully opaque).\n * @returns {AnimationReferenceMetadata} An Angular animation object that can be used with Angular's animation system.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component with a fadeIn animation\n * import { fadeIn } from '@odx/angular/animations';\n * import { trigger, transition, useAnimation } from '@angular/animations';\n *\n * @Component({\n * selector: 'app-fade-in-example',\n * template: `\n * @if(isVisible) {\n * <div @fadeInAnimation>Fade In Content</div>\n * }\n * <button (click)=\"showContent()\">Show Content</button>`,\n * animations: [\n * trigger('fadeInAnimation', [\n * transition(':enter', useAnimation(fadeIn(), { params: { duration: '500ms' } }))\n * ])\n * ]\n * })\n * export class FadeInExampleComponent {\n * isVisible = false;\n *\n * showContent(): void {\n * this.isVisible = true;\n * }\n * }\n * ```\n *\n * This example demonstrates how to apply the fadeIn animation to an element, making it smoothly appear on the screen.\n */\nexport const fadeIn = (to = 1) =>\n animation([style({ opacity: 0 }), animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n });\n\n/**\n * Generates a fadeOut animation with customizable opacity target.\n * This animation gradually changes the element's opacity from its current value to a specified value, creating a \"fade out\" visual effect.\n *\n * @param {number} to - The target opacity value of the element at the end of the animation. Defaults to 0 (fully transparent).\n * @returns {AnimationReferenceMetadata} An Angular animation object that can be used with Angular's animation system.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component with a fadeOut animation\n * import { fadeOut } from '@odx/angular/animations';\n * import { trigger, transition, useAnimation } from '@angular/animations';\n *\n * @Component({\n * selector: 'app-fade-out-example',\n * template: `\n * @if(isVisible) {\n * <div @fadeOutAnimation>Fade Out Content</div>\n * }\n * <button (click)=\"hideContent()\">Hide Content</button>`,\n * animations: [\n * trigger('fadeOutAnimation', [\n * transition(':leave', useAnimation(fadeOut(), { params: { duration: '500ms' } }))\n * ])\n * ]\n * })\n * export class FadeOutExampleComponent {\n * isVisible = true;\n *\n * hideContent(): void {\n * this.isVisible = false;\n * }\n * }\n * ```\n *\n * This example demonstrates how to apply the fadeOut animation to an element, making it smoothly disappear from the screen.\n */\nexport const fadeOut = (to = 0) =>\n animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n });\n","import { animate, animation, AnimationReferenceMetadata, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nfunction createSlideInAnimation(from: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation(\n [\n style({ transform: `translate${direction}({{ from }})` }),\n animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}(0)` })),\n ],\n {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n from,\n },\n },\n );\n}\n\nfunction createSlideOutAnimation(to: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}({{ to }})` }))], {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n to,\n },\n });\n}\n\n/**\n * Utility functions for creating slide-in and slide-out animations in specific directions.\n * These include slideInX, slideInY, slideInDown, slideInUp, slideInLeft, slideInRight,\n * slideOutX, slideOutY, slideOutDown, slideOutUp, slideOutLeft, and slideOutRight.\n * Each function is configured for a specific slide direction and distance, making it easy to apply\n * consistent slide animations across your application.\n *\n * @example\n * ```ts\n * // Using slideInLeft and slideOutRight in a component\n * animations: [\n * trigger('slideInOut', [\n * transition(':enter', [useAnimation(slideInLeft)]),\n * transition(':leave', [useAnimation(slideOutRight)])\n * ])\n * ]\n * ```\n *\n * Note: The 'from' and 'to' parameters for slideIn and slideOut functions respectively\n * can be customized for different slide distances.\n */\nexport const slideInX = (from: string) => createSlideInAnimation(from, 'X');\nexport const slideInY = (from: string) => createSlideInAnimation(from, 'Y');\nexport const slideInDown = slideInY('-100%');\nexport const slideInUp = slideInY('100%');\nexport const slideInLeft = slideInX('-100%');\nexport const slideInRight = slideInX('100%');\n\nexport const slideOutX = (to: string) => createSlideOutAnimation(to, 'X');\nexport const slideOutY = (to: string) => createSlideOutAnimation(to, 'Y');\nexport const slideOutDown = slideOutY('100%');\nexport const slideOutUp = slideOutY('-100%');\nexport const slideOutLeft = slideOutX('-100%');\nexport const slideOutRight = slideOutX('100%');\n","import { animateChild, query, transition } from '@angular/animations';\n\n/**\n * Utility animation that waits for animations on child components to complete.\n * This animation should be used within parent components that have child components with their\n * own animations. It ensures that the parent's enter and leave animations are only triggered\n * after all child animations have completed, creating a seamless animation sequence.\n *\n * This utility uses Angular's animation functions `query` and `animateChild` to find and animate\n * child elements marked with Angular's animation triggers. The `{ optional: true }` parameter\n * ensures that the animation gracefully handles cases where no child animations are defined.\n *\n * @example\n * ```ts\n * // Using waitForChildAnimations in a parent component with children that have animations\n * import { trigger, transition, style, animate, query, animateChild } from '@angular/animations';\n * import { waitForChildAnimations } from '@odx/angular/animations';\n *\n * @Component({\n * selector: 'app-parent',\n * templateUrl: './parent.component.html',\n * animations: [\n * trigger('parentAnimation', [\n * // Define parent animations here\n * transition(':enter', [style({ opacity: 0 }), animate('0.5s ease-in', style({ opacity: 1 }))]),\n * transition(':leave', [animate('0.5s ease-out', style({ opacity: 0 }))]),\n * // Use waitForChildAnimations for coordinating with child animations\n * waitForChildAnimations\n * ])\n * ]\n * })\n * export class ParentComponent {\n * // Component logic here\n * }\n * ```\n *\n * Note: The `waitForChildAnimations` utility is added to the parent component's animation triggers,\n * ensuring that any child component animations are completed before continuing with the parent's\n * own animations.\n */\nexport const waitForChildAnimations = transition(':enter, :leave', [query('@*', animateChild(), { optional: true })]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAO,MAAM,2BAA2B,GAAG,OAAO;AAC3C,MAAM,0BAA0B,GAAG,QAAQ;AACrC,MAAA,wBAAwB,GAAG;AACtC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,KAAK,EAAE,KAAK;;;ACFd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACI,MAAM,MAAM,GAAG,SAAS,CAC7B;AACE,IAAA,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAClI,IAAA,OAAO,CACL,yCAAyC,EACzC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,E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AS,CAAC,MAAM;;AC1D7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACU,MAAA,sBAAsB,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;;ACxCpH;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-animations.mjs","sources":["../../../../libs/angular/animations/src/lib/config.ts","../../../../libs/angular/animations/src/lib/expand.ts","../../../../libs/angular/animations/src/lib/fade.ts","../../../../libs/angular/animations/src/lib/slide.ts","../../../../libs/angular/animations/src/lib/wait-for-child-animations.ts","../../../../libs/angular/animations/src/odx-angular-animations.ts"],"sourcesContent":["export const DEFAULT_ANIMATION_TIMING_FN = 'ease';\nexport const DEFAULT_ANIMATION_DURATION = '250ms';\nexport const DEFAULT_ANIMATION_PARAMS = {\n timingFn: DEFAULT_ANIMATION_TIMING_FN,\n duration: DEFAULT_ANIMATION_DURATION,\n delay: '0ms',\n};\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\n/**\n * Animation for smoothly expanding an element from height 0 to its natural height.\n * It transitions the element's height, padding, margin, and opacity from a collapsed state to an expanded state,\n * making the element smoothly grow into view.\n *\n * The `expand` animation uses `DEFAULT_ANIMATION_PARAMS` for its default parameters, which can be overridden\n * when using the animation.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component\n * import { expand, collapse } from '@odx/angular/animations';\n *\n * @Component({\n * selector: 'my-expandable-component',\n * templateUrl: './expandable-component.html',\n * animations: [\n * trigger('expandCollapse', [\n * transition('collapsed => expanded', useAnimation(expand)),\n * transition('expanded => collapsed', useAnimation(collapse)),\n * ])\n * ]\n * })\n * export class ExpandableComponent {\n * state = 'collapsed';\n *\n * toggle(): void {\n * this.state = this.state === 'collapsed' ? 'expanded' : 'collapsed';\n * }\n * }\n * ```\n *\n * The animation smoothly transitions various properties (height, padding, margin, and opacity) and is controlled\n * through parameters defined in `DEFAULT_ANIMATION_PARAMS` or those provided during usage.\n */\nexport const expand = animation(\n [\n style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, marginTop: 0, marginBottom: 0, overflow: 'hidden' }),\n animate(\n '{{duration}} {{ delay }} {{ timingFn }}',\n style({ height: '*', paddingTop: '*', paddingBottom: '*', opacity: 1, marginTop: '*', marginBottom: '*' }),\n ),\n ],\n {\n params: DEFAULT_ANIMATION_PARAMS,\n },\n);\n\n/**\n * Animation for smoothly collapsing an element from its natural height to height 0.\n * It transitions the element's height, padding, margin, and opacity from an expanded state to a collapsed state,\n * making the element smoothly shrink out of view.\n *\n * The `collapse` animation also uses `DEFAULT_ANIMATION_PARAMS` for its default parameters, which can be overridden\n * when using the animation. It's designed to be used in conjunction with the `expand` animation for creating\n * expandable/collapsible elements.\n */\nexport const collapse = animation(\n [\n animate(\n '{{duration}} {{ delay }} {{ timingFn }}',\n style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, marginTop: 0, marginBottom: 0, overflow: 'hidden' }),\n ),\n ],\n {\n params: DEFAULT_ANIMATION_PARAMS,\n },\n);\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\n/**\n * Generates a fadeIn animation with customizable opacity target.\n * This animation gradually changes the element's opacity from 0 to a specified value, creating a \"fade in\" visual effect.\n *\n * @param {number} to - The final opacity value of the element at the end of the animation. Defaults to 1 (fully opaque).\n * @returns {AnimationReferenceMetadata} An Angular animation object that can be used with Angular's animation system.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component with a fadeIn animation\n * import { fadeIn } from '@odx/angular/animations';\n * import { trigger, transition, useAnimation } from '@angular/animations';\n *\n * @Component({\n * selector: 'app-fade-in-example',\n * template: `\n * @if(isVisible) {\n * <div @fadeInAnimation>Fade In Content</div>\n * }\n * <button (click)=\"showContent()\">Show Content</button>`,\n * animations: [\n * trigger('fadeInAnimation', [\n * transition(':enter', useAnimation(fadeIn(), { params: { duration: '500ms' } }))\n * ])\n * ]\n * })\n * export class FadeInExampleComponent {\n * isVisible = false;\n *\n * showContent(): void {\n * this.isVisible = true;\n * }\n * }\n * ```\n *\n * This example demonstrates how to apply the fadeIn animation to an element, making it smoothly appear on the screen.\n */\nexport const fadeIn = (to = 1) =>\n animation([style({ opacity: 0 }), animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n });\n\n/**\n * Generates a fadeOut animation with customizable opacity target.\n * This animation gradually changes the element's opacity from its current value to a specified value, creating a \"fade out\" visual effect.\n *\n * @param {number} to - The target opacity value of the element at the end of the animation. Defaults to 0 (fully transparent).\n * @returns {AnimationReferenceMetadata} An Angular animation object that can be used with Angular's animation system.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component with a fadeOut animation\n * import { fadeOut } from '@odx/angular/animations';\n * import { trigger, transition, useAnimation } from '@angular/animations';\n *\n * @Component({\n * selector: 'app-fade-out-example',\n * template: `\n * @if(isVisible) {\n * <div @fadeOutAnimation>Fade Out Content</div>\n * }\n * <button (click)=\"hideContent()\">Hide Content</button>`,\n * animations: [\n * trigger('fadeOutAnimation', [\n * transition(':leave', useAnimation(fadeOut(), { params: { duration: '500ms' } }))\n * ])\n * ]\n * })\n * export class FadeOutExampleComponent {\n * isVisible = true;\n *\n * hideContent(): void {\n * this.isVisible = false;\n * }\n * }\n * ```\n *\n * This example demonstrates how to apply the fadeOut animation to an element, making it smoothly disappear from the screen.\n */\nexport const fadeOut = (to = 0) =>\n animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n });\n","import { animate, animation, AnimationReferenceMetadata, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nfunction createSlideInAnimation(from: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation(\n [\n style({ transform: `translate${direction}({{ from }})` }),\n animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}(0)` })),\n ],\n {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n from,\n },\n },\n );\n}\n\nfunction createSlideOutAnimation(to: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}({{ to }})` }))], {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n to,\n },\n });\n}\n\n/**\n * Utility functions for creating slide-in and slide-out animations in specific directions.\n * These include slideInX, slideInY, slideInDown, slideInUp, slideInLeft, slideInRight,\n * slideOutX, slideOutY, slideOutDown, slideOutUp, slideOutLeft, and slideOutRight.\n * Each function is configured for a specific slide direction and distance, making it easy to apply\n * consistent slide animations across your application.\n *\n * @example\n * ```ts\n * // Using slideInLeft and slideOutRight in a component\n * animations: [\n * trigger('slideInOut', [\n * transition(':enter', [useAnimation(slideInLeft)]),\n * transition(':leave', [useAnimation(slideOutRight)])\n * ])\n * ]\n * ```\n *\n * Note: The 'from' and 'to' parameters for slideIn and slideOut functions respectively\n * can be customized for different slide distances.\n */\nexport const slideInX = (from: string) => createSlideInAnimation(from, 'X');\nexport const slideInY = (from: string) => createSlideInAnimation(from, 'Y');\nexport const slideInDown = slideInY('-100%');\nexport const slideInUp = slideInY('100%');\nexport const slideInLeft = slideInX('-100%');\nexport const slideInRight = slideInX('100%');\n\nexport const slideOutX = (to: string) => createSlideOutAnimation(to, 'X');\nexport const slideOutY = (to: string) => createSlideOutAnimation(to, 'Y');\nexport const slideOutDown = slideOutY('100%');\nexport const slideOutUp = slideOutY('-100%');\nexport const slideOutLeft = slideOutX('-100%');\nexport const slideOutRight = slideOutX('100%');\n","import { animateChild, query, transition } from '@angular/animations';\n\n/**\n * Utility animation that waits for animations on child components to complete.\n * This animation should be used within parent components that have child components with their\n * own animations. It ensures that the parent's enter and leave animations are only triggered\n * after all child animations have completed, creating a seamless animation sequence.\n *\n * This utility uses Angular's animation functions `query` and `animateChild` to find and animate\n * child elements marked with Angular's animation triggers. The `{ optional: true }` parameter\n * ensures that the animation gracefully handles cases where no child animations are defined.\n *\n * @example\n * ```ts\n * // Using waitForChildAnimations in a parent component with children that have animations\n * import { trigger, transition, style, animate, query, animateChild } from '@angular/animations';\n * import { waitForChildAnimations } from '@odx/angular/animations';\n *\n * @Component({\n * selector: 'app-parent',\n * templateUrl: './parent.component.html',\n * animations: [\n * trigger('parentAnimation', [\n * // Define parent animations here\n * transition(':enter', [style({ opacity: 0 }), animate('0.5s ease-in', style({ opacity: 1 }))]),\n * transition(':leave', [animate('0.5s ease-out', style({ opacity: 0 }))]),\n * // Use waitForChildAnimations for coordinating with child animations\n * waitForChildAnimations\n * ])\n * ]\n * })\n * export class ParentComponent {\n * // Component logic here\n * }\n * ```\n *\n * Note: The `waitForChildAnimations` utility is added to the parent component's animation triggers,\n * ensuring that any child component animations are completed before continuing with the parent's\n * own animations.\n */\nexport const waitForChildAnimations = transition(':enter, :leave', [query('@*', animateChild(), { optional: true })]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAO,MAAM,2BAA2B,GAAG;AACpC,MAAM,0BAA0B,GAAG;AACnC,MAAM,wBAAwB,GAAG;AACtC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,KAAK,EAAE,KAAK;;;ACFd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACI,MAAM,MAAM,GAAG,SAAS,CAC7B;AACE,IAAA,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,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,GAAG,SAAS,CAAC,OAAO;MAC9B,YAAY,GAAG,SAAS,CAAC,OAAO;MAChC,aAAa,GAAG,SAAS,CAAC,MAAM;;AC1D7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACI,MAAM,sBAAsB,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;;ACxCpH;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { createConfigTokens, untilDestroyed, coerceArray } from '@odx/angular/utils';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, Injectable, TemplateRef, ViewContainerRef, Directive, Input, NgModule } from '@angular/core';
3
+ import { inject, Injectable, TemplateRef, ViewContainerRef, Input, Directive, NgModule } from '@angular/core';
4
4
  import { of, map, distinctUntilChanged, shareReplay, BehaviorSubject, switchMap, tap } from 'rxjs';
5
5
  import { BreakpointObserver } from '@angular/cdk/layout';
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-breakpoints.mjs","sources":["../../../../libs/angular/breakpoints/src/lib/helpers/configure-breakpoint.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.config.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.service.ts","../../../../libs/angular/breakpoints/src/lib/directives/match-breakpoints.directive.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.module.ts","../../../../libs/angular/breakpoints/src/odx-angular-breakpoints.ts"],"sourcesContent":["type BreakpointOperators = '<' | '=' | '>';\ntype BreakpointConfig<T extends string> = Record<`${BreakpointOperators}${T}`, string>;\n\n/**\n * Generates a configuration object containing CSS media query strings for a named breakpoint.\n * The function creates media queries for three scenarios: below (`<`), exactly (`=`), and above (`>`) the specified breakpoint.\n *\n * @template T - The string literal type representing the name of the breakpoint.\n * @param {T} name - The name of the breakpoint (e.g., 'md' for medium).\n * @param {number} min - The minimum width (inclusive) where the breakpoint starts.\n * @param {number} max - The maximum width (exclusive) where the breakpoint ends.\n * @returns {BreakpointConfig<T>} An object containing media query strings for targeting screen sizes relative to the breakpoint.\n *\n * @example\n * ```ts\n * // Define a medium (md) breakpoint\n * const mdBreakpoint = configureBreakpoint('md', 768, 1024);\n * console.log(mdBreakpoint['<md']); // Outputs: \"(max-width: 767px)\"\n * console.log(mdBreakpoint['=md']); // Outputs: \"(min-width: 768px) and (max-width: 1023px)\"\n * console.log(mdBreakpoint['>md']); // Outputs: \"(min-width: 768px)\"\n * ```\n */\nexport function configureBreakpoint<T extends string>(name: T, min: number, max: number): BreakpointConfig<T> {\n return {\n [`<${name}` as const]: `(max-width: ${min - 1}px)`,\n [`=${name}` as const]: `(min-width: ${min}px) and (max-width: ${max - 1}px)`,\n [`>${name}` as const]: `(min-width: ${min}px)`,\n } as BreakpointConfig<T>;\n}\n","import { createConfigTokens } from '@odx/angular/utils';\nimport { configureBreakpoint } from './helpers/configure-breakpoint';\n\n/**\n * Defines default responsive breakpoints for the application. These breakpoints are used to\n * apply responsive styles and behaviors across various device sizes. Each breakpoint is\n * configured with a name, a minimum width, and a maximum width, defining the range of device\n * sizes it targets.\n *\n * @constant\n * @type {Record<string, string>}\n *\n * @example\n * ```ts\n * // Accessing a breakpoint value\n * console.log(DEFAULT_BREAKPOINTS['=phone']); // Outputs: \"(min-width: 480px) and (max-width: 767px)\"\n * ```\n */\nexport const DEFAULT_BREAKPOINTS = {\n ...configureBreakpoint('phone-s', 360, 480),\n ...configureBreakpoint('phone', 480, 768),\n ...configureBreakpoint('tablet', 768, 960),\n ...configureBreakpoint('desktop-s', 960, 1200),\n ...configureBreakpoint('desktop', 1200, 9999),\n} as const;\n\nexport interface BreakpointsConfig {\n breakpoints: Partial<OdxAngular.Breakpoints>;\n}\n\n/**\n * Provides Angular dependency injection tokens for accessing and configuring breakpoints\n * within the application. This enables a type-safe and modular way to manage responsive\n * design breakpoints across the app.\n *\n * @example\n * ```ts\n * // Providing custom breakpoints in an Angular module\n * import { NgModule } from '@angular/core';\n * import { provideBreakpointsConfig } from '@odx/angular/breakpoints';\n *\n * @NgModule({\n * providers: [\n * provideBreakpointsConfig({\n * breakpoints: {\n * ...configureBreakpoint('custom-tablet', 640, 1024),\n * },\n * }),\n * ],\n * })\n * export class CustomModule {}\n * ```\n */\nexport const { BreakpointsConfig, BreakpointsDefaultConfig, injectBreakpointsConfig, provideBreakpointsConfig } = createConfigTokens(\n 'Breakpoints',\n '@odx/angular/breakpoints',\n {\n breakpoints: DEFAULT_BREAKPOINTS,\n } as BreakpointsConfig,\n);\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport { inject, Injectable } from '@angular/core';\nimport { distinctUntilChanged, map, Observable, of, shareReplay } from 'rxjs';\nimport { injectBreakpointsConfig } from './breakpoints.config';\nimport { BreakpointName } from './models';\n\n/**\n * Service to observe and react to changes in viewport size based on predefined breakpoints.\n * Utilizes Angular CDK's BreakpointObserver for listening to media query changes and integrates\n * it with the application's custom breakpoints configuration.\n *\n * @Injectable({ providedIn: 'root' })\n */\n@Injectable({ providedIn: 'root' })\nexport class BreakpointsService {\n private readonly breakpointObserver = inject(BreakpointObserver);\n private readonly config = injectBreakpointsConfig();\n\n /**\n * Observes the specified breakpoints and returns an Observable that emits true if any\n * of the specified breakpoints match the current viewport size, and false otherwise.\n *\n * @param {BreakpointName[]} breakpoints - An array of breakpoints to observe.\n * @returns {Observable<boolean>} - An Observable that emits true if the viewport matches the specified breakpoints.\n *\n * @example\n * ```ts\n * // Component that uses BreakpointsService to apply dynamic styles based on breakpoints\n * @Component({\n * selector: 'app-responsive-component',\n * templateUrl: './responsive-component.component.html',\n * })\n * export class ResponsiveComponent {\n * isMobile$: Observable<boolean>;\n *\n * constructor(private breakpointsService: BreakpointsService) {\n * this.isMobile$ = this.breakpointsService.observe(['phone', 'tablet']);\n * }\n * }\n * ```\n */\n public observe(breakpoints: BreakpointName[]): Observable<boolean> {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.createBreakpointObserver(mediaQueries);\n }\n\n /**\n * Checks if any of the specified breakpoints match the current viewport size.\n *\n * @param {BreakpointName[]} breakpoints - An array of breakpoints to check.\n * @returns {boolean} - Returns true if the viewport matches the specified breakpoints, false otherwise.\n *\n * @example\n * ```ts\n * // Checking if the current viewport matches the 'desktop' breakpoint\n * const isDesktop = this.breakpointsService.matches(['desktop']);\n * console.log(`Is desktop view? ${isDesktop}`);\n * ```\n */\n public matches(breakpoints: BreakpointName[]): boolean {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.breakpointObserver.isMatched(mediaQueries);\n }\n\n private getMediaQueries(breakpointNames: BreakpointName[]): string[] {\n return breakpointNames.map((name) => this.config.breakpoints[name] as string).filter(Boolean);\n }\n\n private createBreakpointObserver(mediaQueries: string[]): Observable<boolean> {\n if (mediaQueries.length < 1) return of(false);\n\n return this.breakpointObserver.observe(mediaQueries).pipe(\n map(({ matches }) => matches),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n}\n","import { Directive, inject, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { coerceArray, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, switchMap, tap } from 'rxjs';\nimport { BreakpointsService } from '../breakpoints.service';\nimport { BreakpointName } from '../models';\n\n/**\n * A structural directive that conditionally includes an Angular template based on whether the viewport matches\n * specified breakpoints. It leverages the BreakpointsService to observe changes in viewport size and apply\n * the appropriate template.\n *\n * @Directive\n * @param {BreakpointsService} breakpointsService - Injects BreakpointsService to observe breakpoint changes.\n * @param {TemplateRef} template - Injects the Angular template to render when breakpoints match.\n * @param {ViewContainerRef} viewContainer - Injects the container where the template will be rendered.\n *\n * @example\n * ```html\n * // Usage in a component template to conditionally display content based on breakpoints\n * // Assume 'mobile' and 'tablet' are defined breakpoints\n * <ng-template [odxMatchBreakpoints]=\"['mobile', 'tablet']\">\n * Content to display on mobile and tablet sizes.\n * </ng-template>\n * <ng-template [odxMatchBreakpoints]=\"['desktop']\" [odxMatchBreakpointsElse]=\"elseTemplate\">\n * Content to display on desktop size.\n * </ng-template>\n * <ng-template #elseTemplate>\n * Content to display when not on desktop size.\n * </ng-template>\n * ```\n */\n@Directive({\n standalone: true,\n selector: 'ng-template[odxMatchBreakpoints]',\n})\nexport class MatchBreakpointsDirective implements OnInit {\n private readonly breakpoints$$ = new BehaviorSubject<BreakpointName[]>([]);\n private readonly breakpointsService = inject(BreakpointsService);\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly template = inject(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n /**\n * Sets the breakpoints to observe. The directive's content is displayed if the current viewport matches\n * any of the specified breakpoints.\n *\n * @param {BreakpointName | BreakpointName[]} value - The breakpoint(s) to match against the current viewport size.\n */\n @Input('odxMatchBreakpoints')\n public set breakpoints(value: BreakpointName | BreakpointName[] | null | undefined) {\n this.breakpoints$$.next(coerceArray(value ?? []));\n }\n\n /**\n * Optionally specifies a template to render when the viewport does not match the specified breakpoints.\n *\n * @param {TemplateRef<unknown>} elseTemplate - The template to render when the viewport does not match the breakpoints.\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxMatchBreakpointsElse')\n public elseTemplate?: TemplateRef<unknown> | null = null;\n\n public ngOnInit(): void {\n this.breakpoints$$\n .pipe(\n switchMap((breakpoints) => this.breakpointsService.observe(breakpoints)),\n tap((matchesBreakpoints) => this.render(matchesBreakpoints)),\n this.takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private render(matchesBreakpoints: boolean): void {\n this.viewContainer.clear();\n const template = matchesBreakpoints ? this.template : this.elseTemplate;\n if (template) {\n const viewRef = this.viewContainer.createEmbeddedView(template);\n viewRef.markForCheck();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { MatchBreakpointsDirective } from './directives';\n\nconst modules = [MatchBreakpointsDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class BreakpointsModule {}\n","/**\n * Generated bund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BAAyB,CAAA,EAAA,OAAA,EAAA,CAAzB,yBAAyB,CAAA,EAAA,CAAA,CAAA,EAAA;gHAM7B,iBAAiB,EAAA,CAAA,CAAA,EAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-breakpoints.mjs","sources":["../../../../libs/angular/breakpoints/src/lib/helpers/configure-breakpoint.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.config.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.service.ts","../../../../libs/angular/breakpoints/src/lib/directives/match-breakpoints.directive.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.module.ts","../../../../libs/angular/breakpoints/src/odx-angular-breakpoints.ts"],"sourcesContent":["type BreakpointOperators = '<' | '=' | '>';\ntype BreakpointConfig<T extends string> = Record<`${BreakpointOperators}${T}`, string>;\n\n/**\n * Generates a configuration object containing CSS media query strings for a named breakpoint.\n * The function creates media queries for three scenarios: below (`<`), exactly (`=`), and above (`>`) the specified breakpoint.\n *\n * @template T - The string literal type representing the name of the breakpoint.\n * @param {T} name - The name of the breakpoint (e.g., 'md' for medium).\n * @param {number} min - The minimum width (inclusive) where the breakpoint starts.\n * @param {number} max - The maximum width (exclusive) where the breakpoint ends.\n * @returns {BreakpointConfig<T>} An object containing media query strings for targeting screen sizes relative to the breakpoint.\n *\n * @example\n * ```ts\n * // Define a medium (md) breakpoint\n * const mdBreakpoint = configureBreakpoint('md', 768, 1024);\n * console.log(mdBreakpoint['<md']); // Outputs: \"(max-width: 767px)\"\n * console.log(mdBreakpoint['=md']); // Outputs: \"(min-width: 768px) and (max-width: 1023px)\"\n * console.log(mdBreakpoint['>md']); // Outputs: \"(min-width: 768px)\"\n * ```\n */\nexport function configureBreakpoint<T extends string>(name: T, min: number, max: number): BreakpointConfig<T> {\n return {\n [`<${name}` as const]: `(max-width: ${min - 1}px)`,\n [`=${name}` as const]: `(min-width: ${min}px) and (max-width: ${max - 1}px)`,\n [`>${name}` as const]: `(min-width: ${min}px)`,\n } as BreakpointConfig<T>;\n}\n","import { createConfigTokens } from '@odx/angular/utils';\nimport { configureBreakpoint } from './helpers/configure-breakpoint';\n\n/**\n * Defines default responsive breakpoints for the application. These breakpoints are used to\n * apply responsive styles and behaviors across various device sizes. Each breakpoint is\n * configured with a name, a minimum width, and a maximum width, defining the range of device\n * sizes it targets.\n *\n * @constant\n * @type {Record<string, string>}\n *\n * @example\n * ```ts\n * // Accessing a breakpoint value\n * console.log(DEFAULT_BREAKPOINTS['=phone']); // Outputs: \"(min-width: 480px) and (max-width: 767px)\"\n * ```\n */\nexport const DEFAULT_BREAKPOINTS = {\n ...configureBreakpoint('phone-s', 360, 480),\n ...configureBreakpoint('phone', 480, 768),\n ...configureBreakpoint('tablet', 768, 960),\n ...configureBreakpoint('desktop-s', 960, 1200),\n ...configureBreakpoint('desktop', 1200, 9999),\n} as const;\n\nexport interface BreakpointsConfig {\n breakpoints: Partial<OdxAngular.Breakpoints>;\n}\n\n/**\n * Provides Angular dependency injection tokens for accessing and configuring breakpoints\n * within the application. This enables a type-safe and modular way to manage responsive\n * design breakpoints across the app.\n *\n * @example\n * ```ts\n * // Providing custom breakpoints in an Angular module\n * import { NgModule } from '@angular/core';\n * import { provideBreakpointsConfig } from '@odx/angular/breakpoints';\n *\n * @NgModule({\n * providers: [\n * provideBreakpointsConfig({\n * breakpoints: {\n * ...configureBreakpoint('custom-tablet', 640, 1024),\n * },\n * }),\n * ],\n * })\n * export class CustomModule {}\n * ```\n */\nexport const { BreakpointsConfig, BreakpointsDefaultConfig, injectBreakpointsConfig, provideBreakpointsConfig } = createConfigTokens(\n 'Breakpoints',\n '@odx/angular/breakpoints',\n {\n breakpoints: DEFAULT_BREAKPOINTS,\n } as BreakpointsConfig,\n);\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport { inject, Injectable } from '@angular/core';\nimport { distinctUntilChanged, map, Observable, of, shareReplay } from 'rxjs';\nimport { injectBreakpointsConfig } from './breakpoints.config';\nimport { BreakpointName } from './models';\n\n/**\n * Service to observe and react to changes in viewport size based on predefined breakpoints.\n * Utilizes Angular CDK's BreakpointObserver for listening to media query changes and integrates\n * it with the application's custom breakpoints configuration.\n *\n * @Injectable({ providedIn: 'root' })\n */\n@Injectable({ providedIn: 'root' })\nexport class BreakpointsService {\n private readonly breakpointObserver = inject(BreakpointObserver);\n private readonly config = injectBreakpointsConfig();\n\n /**\n * Observes the specified breakpoints and returns an Observable that emits true if any\n * of the specified breakpoints match the current viewport size, and false otherwise.\n *\n * @param {BreakpointName[]} breakpoints - An array of breakpoints to observe.\n * @returns {Observable<boolean>} - An Observable that emits true if the viewport matches the specified breakpoints.\n *\n * @example\n * ```ts\n * // Component that uses BreakpointsService to apply dynamic styles based on breakpoints\n * @Component({\n * selector: 'app-responsive-component',\n * templateUrl: './responsive-component.component.html',\n * })\n * export class ResponsiveComponent {\n * isMobile$: Observable<boolean>;\n *\n * constructor(private breakpointsService: BreakpointsService) {\n * this.isMobile$ = this.breakpointsService.observe(['phone', 'tablet']);\n * }\n * }\n * ```\n */\n public observe(breakpoints: BreakpointName[]): Observable<boolean> {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.createBreakpointObserver(mediaQueries);\n }\n\n /**\n * Checks if any of the specified breakpoints match the current viewport size.\n *\n * @param {BreakpointName[]} breakpoints - An array of breakpoints to check.\n * @returns {boolean} - Returns true if the viewport matches the specified breakpoints, false otherwise.\n *\n * @example\n * ```ts\n * // Checking if the current viewport matches the 'desktop' breakpoint\n * const isDesktop = this.breakpointsService.matches(['desktop']);\n * console.log(`Is desktop view? ${isDesktop}`);\n * ```\n */\n public matches(breakpoints: BreakpointName[]): boolean {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.breakpointObserver.isMatched(mediaQueries);\n }\n\n private getMediaQueries(breakpointNames: BreakpointName[]): string[] {\n return breakpointNames.map((name) => this.config.breakpoints[name] as string).filter(Boolean);\n }\n\n private createBreakpointObserver(mediaQueries: string[]): Observable<boolean> {\n if (mediaQueries.length < 1) return of(false);\n\n return this.breakpointObserver.observe(mediaQueries).pipe(\n map(({ matches }) => matches),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n}\n","import { Directive, inject, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { coerceArray, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, switchMap, tap } from 'rxjs';\nimport { BreakpointsService } from '../breakpoints.service';\nimport { BreakpointName } from '../models';\n\n/**\n * A structural directive that conditionally includes an Angular template based on whether the viewport matches\n * specified breakpoints. It leverages the BreakpointsService to observe changes in viewport size and apply\n * the appropriate template.\n *\n * @Directive\n * @param {BreakpointsService} breakpointsService - Injects BreakpointsService to observe breakpoint changes.\n * @param {TemplateRef} template - Injects the Angular template to render when breakpoints match.\n * @param {ViewContainerRef} viewContainer - Injects the container where the template will be rendered.\n *\n * @example\n * ```html\n * // Usage in a component template to conditionally display content based on breakpoints\n * // Assume 'mobile' and 'tablet' are defined breakpoints\n * <ng-template [odxMatchBreakpoints]=\"['mobile', 'tablet']\">\n * Content to display on mobile and tablet sizes.\n * </ng-template>\n * <ng-template [odxMatchBreakpoints]=\"['desktop']\" [odxMatchBreakpointsElse]=\"elseTemplate\">\n * Content to display on desktop size.\n * </ng-template>\n * <ng-template #elseTemplate>\n * Content to display when not on desktop size.\n * </ng-template>\n * ```\n */\n@Directive({\n standalone: true,\n selector: 'ng-template[odxMatchBreakpoints]',\n})\nexport class MatchBreakpointsDirective implements OnInit {\n private readonly breakpoints$$ = new BehaviorSubject<BreakpointName[]>([]);\n private readonly breakpointsService = inject(BreakpointsService);\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly template = inject(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n /**\n * Sets the breakpoints to observe. The directive's content is displayed if the current viewport matches\n * any of the specified breakpoints.\n *\n * @param {BreakpointName | BreakpointName[]} value - The breakpoint(s) to match against the current viewport size.\n */\n @Input('odxMatchBreakpoints')\n public set breakpoints(value: BreakpointName | BreakpointName[] | null | undefined) {\n this.breakpoints$$.next(coerceArray(value ?? []));\n }\n\n /**\n * Optionally specifies a template to render when the viewport does not match the specified breakpoints.\n *\n * @param {TemplateRef<unknown>} elseTemplate - The template to render when the viewport does not match the breakpoints.\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxMatchBreakpointsElse')\n public elseTemplate?: TemplateRef<unknown> | null = null;\n\n public ngOnInit(): void {\n this.breakpoints$$\n .pipe(\n switchMap((breakpoints) => this.breakpointsService.observe(breakpoints)),\n tap((matchesBreakpoints) => this.render(matchesBreakpoints)),\n this.takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private render(matchesBreakpoints: boolean): void {\n this.viewContainer.clear();\n const template = matchesBreakpoints ? this.template : this.elseTemplate;\n if (template) {\n const viewRef = this.viewContainer.createEmbeddedView(template);\n viewRef.markForCheck();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { MatchBreakpointsDirective } from './directives';\n\nconst modules = [MatchBreakpointsDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class BreakpointsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGA;;;;;;;;;;;;;;;;;;AAkBG;SACa,mBAAmB,CAAmB,IAAO,EAAE,GAAW,EAAE,GAAW,EAAA;IACrF,OAAO;QACL,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAW,GAAG,CAAA,YAAA,EAAe,GAAG,GAAG,CAAC,CAAA,GAAA,CAAK;QAClD,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAW,GAAG,CAAA,YAAA,EAAe,GAAG,CAAA,oBAAA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,QAAA,EAAA,kCAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,CAAA,qBAAA,EAAA,aAAA,CAAA,EAAA,YAAA,EAAA,CAAA,yBAAA,EAAA,cAAA,CAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,kCAAkC;AAC7C,iBAAA;8BAeY,WAAW,EAAA,CAAA;sBADrB,KAAK;uBAAC,qBAAqB;gBAYrB,YAAY,EAAA,CAAA;sBADlB,KAAK;uBAAC,yBAAyB;;;ACxDlC,MAAM,OAAO,GAAG,CAAC,yBAAyB,CAAC;MAM9B,iBAAiB,CAAA;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAjB,iBAAiB,EAAA,OAAA,EAAA,CANb,yBAAyB,CAAA,EAAA,OAAA,EAAA,CAAzB,yBAAyB,CAAA,EAAA,CAAA,CAAA;gHAM7B,iBAAiB,EAAA,CAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { FocusKeyManager, A11yModule as A11yModule$1 } from '@angular/cdk/a11y';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Directive, Output, HostListener, ContentChildren, NgModule } from '@angular/core';
3
+ import { EventEmitter, HostListener, Output, Directive, ContentChildren, NgModule } from '@angular/core';
4
4
  import * as i1 from '@odx/angular';
5
5
  import { DisabledController, WithDisabledState, WithTabIndex, CoreModule } from '@odx/angular';
6
6
  import { __decorate } from 'tslib';
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-a11y.mjs","sources":["../../../../libs/angular/cdk/a11y/src/lib/directives/interactive.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager-option.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/a11y.module.ts","../../../../libs/angular/cdk/a11y/src/odx-angular-cdk-a11y.ts"],"sourcesContent":["import { Directive, EventEmitter, HostListener, Output } from '@angular/core';\nimport { DisabledController, WithDisabledState, WithTabIndex } from '@odx/angular';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * Directive that makes an element interactive, responding to click, Enter key, and Space key events.\n * It automatically handles the disabled state through `DisabledController`, inhibiting interactions when disabled.\n * This directive can be useful for creating custom buttons or interactive elements that are not natively interactive,\n * such as divs or custom components.\n *\n * @Directive\n * @CSSComponent cdk-interactive - A CSS Component class that can be targeted for styling interactive elements.\n * @selector '[odxCdkInteractive]' - Applies this directive to any element with the 'odxCdkInteractive' attribute.\n * @hostDirectives {WithDisabledState, WithTabIndex} - Applies disabled state and tab index handling.\n * @host role='button' - Assigns a role of 'button' to the host element for accessibility.\n *\n * @example\n * Applying the directive to a div element to make it interactive:\n * ```html\n * <div odxCdkInteractive (odxCdkInteractive)=\"onInteract($event)\">\n * Click or press Enter/Space to interact\n * </div>\n * ```\n *\n * @example\n * Using the directive on a custom Angular component\n * ```html\n * <app-custom-button odxCdkInteractive (odxCdkInteractive)=\"onCustomButtonInteract($event)\">\n * </app-custom-button>\n * ```\n */\n@CSSComponent('cdk-interactive')\n@Directive({\n selector: '[odxCdkInteractive]',\n standalone: true,\n hostDirectives: [WithDisabledState, WithTabIndex],\n host: {\n role: 'button',\n },\n})\nexport class InteractiveDirective {\n private readonly disabledController = DisabledController.inject();\n\n public readonly element = injectElement();\n\n /**\n * Emits an event when the element is interacted with via click, Enter key, or Space key.\n *\n * @emits {MouseEvent | KeyboardEvent} - The event that triggered the interaction.\n */\n @Output('odxCdkInteractive')\n public interact = new EventEmitter<MouseEvent | KeyboardEvent>();\n\n @HostListener('click', ['$event'])\n @HostListener('keyup.enter', ['$event'])\n @HostListener('keyup.space', ['$event'])\n protected handleEvents(event: MouseEvent | KeyboardEvent) {\n if (this.disabledController?.disabled) return;\n this.interact.next(event);\n }\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { Directive } from '@angular/core';\nimport { DisabledController } from '@odx/angular';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * Directive to make an element focusable as part of a list, integrating with Angular CDK's FocusKeyManager.\n * It listens to the disabled state controlled by `DisabledController` to manage focus correctly based on\n * the enabled state of the element.\n *\n * @example\n * In a component template, apply this directive to list items that should be focusable and managed by a FocusKeyManager:\n * ```html\n * @for(item of items; track item) {\n * <li odxListFocusManagerOption>\n * {{ item }}\n * </li>\n * }\n * ```\n */\n@Directive({\n selector: '[odxListFocusManagerOption]',\n standalone: true,\n})\nexport class ListFocusManagerOptionDirective implements FocusableOption {\n private readonly disabledController = DisabledController.inject();\n private readonly element = injectElement();\n\n /**\n * Reflects the disabled state of the element, managed by `DisabledController`.\n * If disabled, the element is not focusable.\n *\n * @returns {boolean} True if the directive's host element is disabled.\n */\n public get disabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n /**\n * Focuses the host element. If the element is disabled, it will not be focused.\n */\n public focus(): void {\n this.element.nativeElement.focus();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { AfterContentInit, ContentChildren, Directive, HostListener, OnDestroy, QueryList } from '@angular/core';\nimport { deferFn } from '@odx/angular/utils';\nimport { ListFocusManagerOptionDirective } from './list-focus-manager-option.directive';\n\n/**\n * Directive that sets up keyboard navigation for a list or a group of focusable elements.\n * Utilizes `FocusKeyManager` from Angular CDK to manage focus among items.\n * It automatically skips disabled items and wraps around when navigating past the first or last item.\n * Handles keydown events to navigate through the focusable options.\n *\n * @example\n * In a component template, use this directive on a container element and `odxListFocusManagerOption`\n * on each focusable list item:\n * ```html\n * <ul odxListFocusManager>\n * @for(item of items; track item) {\n * <li odxListFocusManagerOption>\n * {{ item }}\n * </li>\n * }\n * </ul>\n * ```\n */\n@Directive({\n selector: '[odxListFocusManager]',\n standalone: true,\n})\nexport class ListFocusManagerDirective implements AfterContentInit, OnDestroy {\n private keyManager: FocusKeyManager<ListFocusManagerOptionDirective> | null = null;\n\n @ContentChildren(ListFocusManagerOptionDirective)\n protected options!: QueryList<ListFocusManagerOptionDirective>;\n\n public ngAfterContentInit(): void {\n this.keyManager = new FocusKeyManager(this.options)\n .withHomeAndEnd()\n .withWrap()\n .skipPredicate((item) => item.disabled);\n deferFn(() => this.keyManager?.setFirstItemActive());\n }\n\n public ngOnDestroy(): void {\n this.keyManager?.destroy();\n this.keyManager = null;\n }\n\n @HostListener('keydown', ['$event'])\n protected onKeyDown(event: KeyboardEvent): void {\n this.keyManager?.onKeydown(event);\n }\n}\n","import { A11yModule as NgCdkA11yModule } from '@angular/cdk/a11y';\nimport { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { InteractiveDirective, ListFocusManagerDirective, ListFocusManagerOptionDirective } from './directives';\n\nconst modules = [ListFocusManagerDirective, ListFocusManagerOptionDirective, InteractiveDirective];\n\n@NgModule({\n imports: [NgCdkA11yModule, ...modules],\n exports: [CoreModule, NgCdkA11yModule, ...modules],\n})\nexport class A11yModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NgCdkA11yModule"],"mappings":";;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AAUU,IAAA,oBAAoB,GAA1B,MAAM,oBAAoB,CAAA;AAA1B,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAElD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C,CAAA;;;AC1CrC,MAAM,OAAO,GAAG,CAAC,yBAAyB,EAAE,+BAA+B,EAAE,oBAAoB,CAAC,CAAC;MAMtF,UAAU,CAAA;+GAAV,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,YAHXA,YAAe,EAHV,yBAAyB,EAAE,+BAA+B,EAAE,oBAAoB,CAIrF,EAAA,OAAA,EAAA,CAAA,UAAU,EAAEA,YAAe,EAJtB,yBAAyB,EAAE,+BAA+B,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA,EAAA;AAMpF,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,EAHX,OAAA,EAAA,CAAAA,YAAe,EACf,UAAU,EAAEA,YAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAE1B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAACA,YAAe,EAAE,GAAG,OAAO,CAAC;oBACtC,OAAO,EAAE,CAAC,UAAU,EAAEA,YAAe,EAAE,GAAG,OAAO,CAAC;AACnD,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-a11y.mjs","sources":["../../../../libs/angular/cdk/a11y/src/lib/directives/interactive.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager-option.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/a11y.module.ts","../../../../libs/angular/cdk/a11y/src/odx-angular-cdk-a11y.ts"],"sourcesContent":["import { Directive, EventEmitter, HostListener, Output } from '@angular/core';\nimport { DisabledController, WithDisabledState, WithTabIndex } from '@odx/angular';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * Directive that makes an element interactive, responding to click, Enter key, and Space key events.\n * It automatically handles the disabled state through `DisabledController`, inhibiting interactions when disabled.\n * This directive can be useful for creating custom buttons or interactive elements that are not natively interactive,\n * such as divs or custom components.\n *\n * @Directive\n * @CSSComponent cdk-interactive - A CSS Component class that can be targeted for styling interactive elements.\n * @selector '[odxCdkInteractive]' - Applies this directive to any element with the 'odxCdkInteractive' attribute.\n * @hostDirectives {WithDisabledState, WithTabIndex} - Applies disabled state and tab index handling.\n * @host role='button' - Assigns a role of 'button' to the host element for accessibility.\n *\n * @example\n * Applying the directive to a div element to make it interactive:\n * ```html\n * <div odxCdkInteractive (odxCdkInteractive)=\"onInteract($event)\">\n * Click or press Enter/Space to interact\n * </div>\n * ```\n *\n * @example\n * Using the directive on a custom Angular component\n * ```html\n * <app-custom-button odxCdkInteractive (odxCdkInteractive)=\"onCustomButtonInteract($event)\">\n * </app-custom-button>\n * ```\n */\n@CSSComponent('cdk-interactive')\n@Directive({\n selector: '[odxCdkInteractive]',\n standalone: true,\n hostDirectives: [WithDisabledState, WithTabIndex],\n host: {\n role: 'button',\n },\n})\nexport class InteractiveDirective {\n private readonly disabledController = DisabledController.inject();\n\n public readonly element = injectElement();\n\n /**\n * Emits an event when the element is interacted with via click, Enter key, or Space key.\n *\n * @emits {MouseEvent | KeyboardEvent} - The event that triggered the interaction.\n */\n @Output('odxCdkInteractive')\n public interact = new EventEmitter<MouseEvent | KeyboardEvent>();\n\n @HostListener('click', ['$event'])\n @HostListener('keyup.enter', ['$event'])\n @HostListener('keyup.space', ['$event'])\n protected handleEvents(event: MouseEvent | KeyboardEvent) {\n if (this.disabledController?.disabled) return;\n this.interact.next(event);\n }\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { Directive } from '@angular/core';\nimport { DisabledController } from '@odx/angular';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * Directive to make an element focusable as part of a list, integrating with Angular CDK's FocusKeyManager.\n * It listens to the disabled state controlled by `DisabledController` to manage focus correctly based on\n * the enabled state of the element.\n *\n * @example\n * In a component template, apply this directive to list items that should be focusable and managed by a FocusKeyManager:\n * ```html\n * @for(item of items; track item) {\n * <li odxListFocusManagerOption>\n * {{ item }}\n * </li>\n * }\n * ```\n */\n@Directive({\n selector: '[odxListFocusManagerOption]',\n standalone: true,\n})\nexport class ListFocusManagerOptionDirective implements FocusableOption {\n private readonly disabledController = DisabledController.inject();\n private readonly element = injectElement();\n\n /**\n * Reflects the disabled state of the element, managed by `DisabledController`.\n * If disabled, the element is not focusable.\n *\n * @returns {boolean} True if the directive's host element is disabled.\n */\n public get disabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n /**\n * Focuses the host element. If the element is disabled, it will not be focused.\n */\n public focus(): void {\n this.element.nativeElement.focus();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { AfterContentInit, ContentChildren, Directive, HostListener, OnDestroy, QueryList } from '@angular/core';\nimport { deferFn } from '@odx/angular/utils';\nimport { ListFocusManagerOptionDirective } from './list-focus-manager-option.directive';\n\n/**\n * Directive that sets up keyboard navigation for a list or a group of focusable elements.\n * Utilizes `FocusKeyManager` from Angular CDK to manage focus among items.\n * It automatically skips disabled items and wraps around when navigating past the first or last item.\n * Handles keydown events to navigate through the focusable options.\n *\n * @example\n * In a component template, use this directive on a container element and `odxListFocusManagerOption`\n * on each focusable list item:\n * ```html\n * <ul odxListFocusManager>\n * @for(item of items; track item) {\n * <li odxListFocusManagerOption>\n * {{ item }}\n * </li>\n * }\n * </ul>\n * ```\n */\n@Directive({\n selector: '[odxListFocusManager]',\n standalone: true,\n})\nexport class ListFocusManagerDirective implements AfterContentInit, OnDestroy {\n private keyManager: FocusKeyManager<ListFocusManagerOptionDirective> | null = null;\n\n @ContentChildren(ListFocusManagerOptionDirective)\n protected options!: QueryList<ListFocusManagerOptionDirective>;\n\n public ngAfterContentInit(): void {\n this.keyManager = new FocusKeyManager(this.options)\n .withHomeAndEnd()\n .withWrap()\n .skipPredicate((item) => item.disabled);\n deferFn(() => this.keyManager?.setFirstItemActive());\n }\n\n public ngOnDestroy(): void {\n this.keyManager?.destroy();\n this.keyManager = null;\n }\n\n @HostListener('keydown', ['$event'])\n protected onKeyDown(event: KeyboardEvent): void {\n this.keyManager?.onKeydown(event);\n }\n}\n","import { A11yModule as NgCdkA11yModule } from '@angular/cdk/a11y';\nimport { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { InteractiveDirective, ListFocusManagerDirective, ListFocusManagerOptionDirective } from './directives';\n\nconst modules = [ListFocusManagerDirective, ListFocusManagerOptionDirective, InteractiveDirective];\n\n@NgModule({\n imports: [NgCdkA11yModule, ...modules],\n exports: [CoreModule, NgCdkA11yModule, ...modules],\n})\nexport class A11yModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NgCdkA11yModule"],"mappings":";;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AAUI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB,CAAA;AAA1B,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE;QAEjD,IAAA,CAAA,OAAO,GAAG,aAAa,EAAE;AAEzC;;;;AAIG;AAEI,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAA8B;AASjE,IAAA;AAJW,IAAA,YAAY,CAAC,KAAiC,EAAA;AACtD,QAAA,IAAI,IAAI,CAAC,kBAAkB,EAAE,QAAQ;YAAE;AACvC,QAAA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,EAAA,OAAA,EAAA,CAIrF,UAAU,EAAEA,YAAe,EAJtB,yBAAyB,EAAE,+BAA+B,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAMpF,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,EAAA,OAAA,EAAA,CAHXA,YAAe,EACf,UAAU,EAAEA,YAAe,CAAA,EAAA,CAAA,CAAA;;4FAE1B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAACA,YAAe,EAAE,GAAG,OAAO,CAAC;oBACtC,OAAO,EAAE,CAAC,UAAU,EAAEA,YAAe,EAAE,GAAG,OAAO,CAAC;AACnD,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, Input } from '@angular/core';
3
+ import { Input, Directive } from '@angular/core';
4
4
  import { CSSModifier, CSSComponent } from '@odx/angular/internal';
5
5
  import { fromElementResize$ } from '@odx/angular/rxjs';
6
6
  import { untilDestroyed, injectElement, hasChanged, isPresent, px, disableCSSTransitions, applyStyles } from '@odx/angular/utils';
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-active-indicator.mjs","sources":["../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-direction.ts","../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-position.ts","../../../../libs/angular/cdk/active-indicator/src/lib/active-indicator.directive.ts","../../../../libs/angular/cdk/active-indicator/src/odx-angular-cdk-active-indicator.ts"],"sourcesContent":["export type ActiveIndicatorDirection = typeof ActiveIndicatorDirection[keyof typeof ActiveIndicatorDirection];\n\nexport const ActiveIndicatorDirection = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical',\n} as const;\n","export type ActiveIndicatorPosition = typeof ActiveIndicatorPosition[keyof typeof ActiveIndicatorPosition];\n\nexport const ActiveIndicatorPosition = {\n START: 'start',\n CENTER: 'center',\n END: 'end',\n} as const;\n","import { AfterViewInit, Directive, Input, OnChanges } from '@angular/core';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { fromElementResize$ } from '@odx/angular/rxjs';\nimport { NgChanges, applyStyles, disableCSSTransitions, hasChanged, injectElement, isPresent, px, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, EMPTY, distinctUntilChanged, switchMap } from 'rxjs';\nimport { ActiveIndicatorPosition } from './models';\nimport { ActiveIndicatorDirection } from './models/active-indicator-direction';\n\n/**\n * `ActiveIndicatorDirective` is designed to adjust an indicator's position and size dynamically to highlight\n * the active element within a container. It's useful for tabs, menus, or any list where an active state is visually represented.\n * The directive can be customized to align the indicator based on the active element's position and supports\n * both horizontal and vertical orientations.\n *\n * To use this directive, apply it to the element you want to use as an active indicator.\n * Then, bind the active element using the `odxActiveIndicator` input. Optionally, specify\n * the container element with `odxActiveIndicatorParent` if the container is not the immediate parent of the indicator.\n *\n * @example\n * ```html\n * <div class=\"tabs-container\" #tabsContainer>\n * @for(tab of tabs; track tab.id) {\n * <div class=\"tab\" [class.active]=\"tab.isActive\" #tabElement>{{ tab.label }}</div>\n * }\n * <div class=\"indicator\" [odxActiveIndicator]=\"activeTabElement\" [odxActiveIndicatorParent]=\"tabsContainer\"></div>\n * </div>\n * ```\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs',\n * templateUrl: './tabs.component.html',\n * imports: [ActiveIndicatorDirective, NgForOf],\n * })\n * export class TabsComponent {\n * tabs = [{ label: 'Tab 1', isActive: true }, { label: 'Tab 2', isActive: false }];\n * @ViewChildren('tabElement') tabElements?: QueryList<ElementRef>;\n * @ViewChild('tabsContainer') tabsContainer!: ElementRef;\n *\n * get activeTabElement(): HTMLElement {\n * const activeTab = this.tabElements?.find((tab) => tab.nativeElement.classList.contains('active'));\n * return activeTab ? activeTab.nativeElement : null;\n * }\n * }\n * ```\n */\n@CSSComponent('cdk-active-indicator')\n@Directive({\n standalone: true,\n selector: '[odxActiveIndicator]',\n})\nexport class ActiveIndicatorDirective implements OnChanges, AfterViewInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly parentElement$$ = new BehaviorSubject<HTMLElement | null>(null);\n private readonly onResize$ = this.parentElement$$.pipe(\n distinctUntilChanged(),\n switchMap((parentElement) => {\n return parentElement ? fromElementResize$(parentElement) : EMPTY;\n }),\n );\n\n public readonly element = injectElement();\n\n /**\n * Indicates whether the element is active or not.\n *\n * @type {boolean}\n */\n @CSSModifier()\n public isActive = false;\n\n /**\n * The currently active element to which the indicator should align.\n * It dynamically updates the indicator's position and size based on this element.\n *\n * @type {HTMLElement | null}\n */\n @Input('odxActiveIndicator')\n public activeElement?: HTMLElement | null = null;\n\n /**\n * The parent container element of the active elements.\n * If not set, the indicator's immediate parent element is used.\n *\n * @type {HTMLElement | null}\n */\n @Input('odxActiveIndicatorParent')\n public set parent(value: HTMLElement | null) {\n this.parentElement$$.next(value);\n }\n public get parent(): HTMLElement | null {\n return this.parentElement$$.getValue();\n }\n\n /**\n * The direction in which the indicator should move.\n *\n * @type {ActiveIndicatorDirection}\n */\n @CSSModifier()\n @Input('odxActiveIndicatorDirection')\n public direction: ActiveIndicatorDirection = ActiveIndicatorDirection.HORIZONTAL;\n\n /**\n * The position of the indicator relative to the active element.\n *\n * @type {ActiveIndicatorPosition}\n */\n @Input('odxActiveIndicatorPosition')\n public position: ActiveIndicatorPosition = ActiveIndicatorPosition.CENTER;\n\n public ngAfterViewInit(): void {\n this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles());\n this.parent ??= this.element.nativeElement.parentElement;\n }\n\n public ngOnChanges(changes: NgChanges<ActiveIndicatorDirective>): void {\n if (hasChanged(changes, 'activeElement', false)) {\n this.isActive = !!this.activeElement;\n }\n if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {\n this.updateStyles(!isPresent(changes.activeElement?.previousValue));\n }\n }\n\n private updateStyles(disableTransition = false): void {\n if (!this.activeElement) return;\n const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;\n const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;\n const relativeOffset = this.getIndicatorRelativeOffset();\n\n let transform = null;\n if (isHorizontal) {\n const positionX = this.getIndicatorPositionX(this.activeElement);\n transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;\n }\n if (isVertical) {\n const positionY = this.getIndicatorPositionY(this.activeElement);\n transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;\n }\n\n disableTransition && disableCSSTransitions(this.element.nativeElement, true);\n applyStyles(this.element.nativeElement, {\n transform,\n width: isHorizontal ? px(this.activeElement.offsetWidth) : null,\n height: isVertical ? px(this.activeElement.offsetHeight) : null,\n });\n disableTransition && disableCSSTransitions(this.element.nativeElement, false);\n }\n\n private getIndicatorPositionX(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetLeft;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetLeft + activeElement.offsetWidth / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetLeft + activeElement.offsetWidth;\n }\n }\n\n private getIndicatorPositionY(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetTop;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetTop + activeElement.offsetHeight / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetTop + activeElement.offsetHeight;\n }\n }\n\n private getIndicatorRelativeOffset(): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return 0;\n case ActiveIndicatorPosition.CENTER:\n return -50;\n case ActiveIndicatorPosition.END:\n return -100;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport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AAKxB,CAAA,EAAA,wBAAwB,CAmIpC,CAAA;4FAnIY,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;AAmBQ,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,QAAQ,MASR,aAAa,EAAA,CAAA;sBADnB,KAAK;uBAAC,oBAAoB,CAAA;gBAUhB,MAAM,EAAA,CAAA;sBADhB,KAAK;uBAAC,0BAA0B,CAAA;gBAe1B,SAAS,EAAA,CAAA;sBADf,KAAK;uBAAC,6BAA6B,CAAA;gBAS7B,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,4BAA4B,CAAA;;;AC5GrC;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-active-indicator.mjs","sources":["../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-direction.ts","../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-position.ts","../../../../libs/angular/cdk/active-indicator/src/lib/active-indicator.directive.ts","../../../../libs/angular/cdk/active-indicator/src/odx-angular-cdk-active-indicator.ts"],"sourcesContent":["export type ActiveIndicatorDirection = typeof ActiveIndicatorDirection[keyof typeof ActiveIndicatorDirection];\n\nexport const ActiveIndicatorDirection = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical',\n} as const;\n","export type ActiveIndicatorPosition = typeof ActiveIndicatorPosition[keyof typeof ActiveIndicatorPosition];\n\nexport const ActiveIndicatorPosition = {\n START: 'start',\n CENTER: 'center',\n END: 'end',\n} as const;\n","import { AfterViewInit, Directive, Input, OnChanges } from '@angular/core';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { fromElementResize$ } from '@odx/angular/rxjs';\nimport { NgChanges, applyStyles, disableCSSTransitions, hasChanged, injectElement, isPresent, px, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, EMPTY, distinctUntilChanged, switchMap } from 'rxjs';\nimport { ActiveIndicatorPosition } from './models';\nimport { ActiveIndicatorDirection } from './models/active-indicator-direction';\n\n/**\n * `ActiveIndicatorDirective` is designed to adjust an indicator's position and size dynamically to highlight\n * the active element within a container. It's useful for tabs, menus, or any list where an active state is visually represented.\n * The directive can be customized to align the indicator based on the active element's position and supports\n * both horizontal and vertical orientations.\n *\n * To use this directive, apply it to the element you want to use as an active indicator.\n * Then, bind the active element using the `odxActiveIndicator` input. Optionally, specify\n * the container element with `odxActiveIndicatorParent` if the container is not the immediate parent of the indicator.\n *\n * @example\n * ```html\n * <div class=\"tabs-container\" #tabsContainer>\n * @for(tab of tabs; track tab.id) {\n * <div class=\"tab\" [class.active]=\"tab.isActive\" #tabElement>{{ tab.label }}</div>\n * }\n * <div class=\"indicator\" [odxActiveIndicator]=\"activeTabElement\" [odxActiveIndicatorParent]=\"tabsContainer\"></div>\n * </div>\n * ```\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs',\n * templateUrl: './tabs.component.html',\n * imports: [ActiveIndicatorDirective, NgForOf],\n * })\n * export class TabsComponent {\n * tabs = [{ label: 'Tab 1', isActive: true }, { label: 'Tab 2', isActive: false }];\n * @ViewChildren('tabElement') tabElements?: QueryList<ElementRef>;\n * @ViewChild('tabsContainer') tabsContainer!: ElementRef;\n *\n * get activeTabElement(): HTMLElement {\n * const activeTab = this.tabElements?.find((tab) => tab.nativeElement.classList.contains('active'));\n * return activeTab ? activeTab.nativeElement : null;\n * }\n * }\n * ```\n */\n@CSSComponent('cdk-active-indicator')\n@Directive({\n standalone: true,\n selector: '[odxActiveIndicator]',\n})\nexport class ActiveIndicatorDirective implements OnChanges, AfterViewInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly parentElement$$ = new BehaviorSubject<HTMLElement | null>(null);\n private readonly onResize$ = this.parentElement$$.pipe(\n distinctUntilChanged(),\n switchMap((parentElement) => {\n return parentElement ? fromElementResize$(parentElement) : EMPTY;\n }),\n );\n\n public readonly element = injectElement();\n\n /**\n * Indicates whether the element is active or not.\n *\n * @type {boolean}\n */\n @CSSModifier()\n public isActive = false;\n\n /**\n * The currently active element to which the indicator should align.\n * It dynamically updates the indicator's position and size based on this element.\n *\n * @type {HTMLElement | null}\n */\n @Input('odxActiveIndicator')\n public activeElement?: HTMLElement | null = null;\n\n /**\n * The parent container element of the active elements.\n * If not set, the indicator's immediate parent element is used.\n *\n * @type {HTMLElement | null}\n */\n @Input('odxActiveIndicatorParent')\n public set parent(value: HTMLElement | null) {\n this.parentElement$$.next(value);\n }\n public get parent(): HTMLElement | null {\n return this.parentElement$$.getValue();\n }\n\n /**\n * The direction in which the indicator should move.\n *\n * @type {ActiveIndicatorDirection}\n */\n @CSSModifier()\n @Input('odxActiveIndicatorDirection')\n public direction: ActiveIndicatorDirection = ActiveIndicatorDirection.HORIZONTAL;\n\n /**\n * The position of the indicator relative to the active element.\n *\n * @type {ActiveIndicatorPosition}\n */\n @Input('odxActiveIndicatorPosition')\n public position: ActiveIndicatorPosition = ActiveIndicatorPosition.CENTER;\n\n public ngAfterViewInit(): void {\n this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles());\n this.parent ??= this.element.nativeElement.parentElement;\n }\n\n public ngOnChanges(changes: NgChanges<ActiveIndicatorDirective>): void {\n if (hasChanged(changes, 'activeElement', false)) {\n this.isActive = !!this.activeElement;\n }\n if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {\n this.updateStyles(!isPresent(changes.activeElement?.previousValue));\n }\n }\n\n private updateStyles(disableTransition = false): void {\n if (!this.activeElement) return;\n const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;\n const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;\n const relativeOffset = this.getIndicatorRelativeOffset();\n\n let transform = null;\n if (isHorizontal) {\n const positionX = this.getIndicatorPositionX(this.activeElement);\n transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;\n }\n if (isVertical) {\n const positionY = this.getIndicatorPositionY(this.activeElement);\n transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;\n }\n\n disableTransition && disableCSSTransitions(this.element.nativeElement, true);\n applyStyles(this.element.nativeElement, {\n transform,\n width: isHorizontal ? px(this.activeElement.offsetWidth) : null,\n height: isVertical ? px(this.activeElement.offsetHeight) : null,\n });\n disableTransition && disableCSSTransitions(this.element.nativeElement, false);\n }\n\n private getIndicatorPositionX(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetLeft;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetLeft + activeElement.offsetWidth / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetLeft + activeElement.offsetWidth;\n }\n }\n\n private getIndicatorPositionY(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetTop;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetTop + activeElement.offsetHeight / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetTop + activeElement.offsetHeight;\n }\n }\n\n private getIndicatorRelativeOffset(): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return 0;\n case ActiveIndicatorPosition.CENTER:\n return -50;\n case ActiveIndicatorPosition.END:\n return -100;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEO,MAAM,wBAAwB,GAAG;AACtC,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,QAAQ,EAAE,UAAU;;;ACFf,MAAM,uBAAuB,GAAG;AACrC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,GAAG,EAAE,KAAK;;;ACGZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AAMI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB,CAAA;AAA9B,IAAA,WAAA,GAA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booleanAttribute, Directive, ViewChild, Input, Output, HostListener, computed, SecurityContext, input, InjectionToken } from '@angular/core';
3
+ import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, HostListener, Output, Input, ViewChild, Directive, computed, SecurityContext, input, InjectionToken } from '@angular/core';
4
4
  import { detectControllerChanges, ODX_STRING_SEARCH_HANDLER, ODX_STRINGIFY } from '@odx/angular';
5
5
  import { CustomFormControl } from '@odx/angular/cdk/custom-form-control';
6
6
  import { DropdownDirective } from '@odx/angular/components/dropdown';
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-autocomplete-control.mjs","sources":["../../../../libs/angular/cdk/autocomplete-control/src/lib/autocomplete-control.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/directives/highlight-search-result.directive.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/pipes/base-search-filter-pipe.ts","../../../../libs/angular/cdk/autocomplete-control/src/odx-angular-cdk-autocomplete-control.ts"],"sourcesContent":["import { ActiveDescendantKeyManager, Highlightable } from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n Directive,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output,\n QueryList,\n ViewChild,\n} from '@angular/core';\nimport { detectControllerChanges, StringifyFn } from '@odx/angular';\nimport { CustomFormControl, InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { FormFieldComponent } from '@odx/angular/components/form-field';\nimport { injectElement, isFunction, untilDestroyed } from '@odx/angular/utils';\n\n/**\n * `AutocompleteControl` is a base directive to enhance an input field with autocomplete functionality,\n * providing keyboard navigation and selection for options displayed in a dropdown. It's designed to be extended\n * for specific implementations.\n * Extends `CustomFormControl` to provide form control behavior and state management.\n *\n * @see {CustomFormControl}\n *\n * This directive manages the open/close state of the dropdown, the loading state indication, and the interaction between\n * the autocomplete input and the dropdown options. It utilizes `ActiveDescendantKeyManager` for keyboard navigation among options.\n *\n * Extend this directive to create a fully functional autocomplete control tailored to your data type and UI requirements.\n *\n * @template T - The type of the items displayed in the autocomplete dropdown.\n */\n@Directive({\n standalone: true,\n host: {\n '[class.is-open]': 'isOpen',\n '[attr.aria-disabled]': 'isDisabled || null',\n },\n})\nexport abstract class AutocompleteControl<T> extends CustomFormControl<T | null> implements AfterViewInit {\n protected abstract readonly options?: QueryList<OptionControl<T>>;\n\n protected readonly changeDetector = inject(ChangeDetectorRef);\n protected readonly formField = inject(FormFieldComponent, { optional: true });\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected keyManager?: ActiveDescendantKeyManager<Highlightable>;\n protected smoothScrollEnabled = false;\n\n @ViewChild(DropdownDirective)\n protected readonly dropdown?: DropdownDirective;\n\n public abstract searchField?: InputControlDirective;\n\n public readonly element = injectElement();\n\n public get dropdownReferenceElement(): HTMLElement {\n return this.formField?.controlElement?.nativeElement ?? this.element?.nativeElement;\n }\n\n public get hasOptions(): boolean {\n return !!this.options?.length;\n }\n\n public get isOpen(): boolean {\n return !!this.dropdown?.isOpen;\n }\n\n @Input({ transform: booleanAttribute })\n public isLoading = false;\n\n /**\n * A function that converts an item of type T to a string representation.\n * Used by the AutocompleteControl component to display the selected item.\n *\n * @type {StringifyFn<T>}\n *\n * @example\n * ```ts\n * // Define a stringify function for a custom type Person\n * const stringifyPerson: StringifyFn<Person> = (person) => `${person.firstName} ${person.lastName}`;\n *\n * // Assign the stringify function to the AutocompleteControl\n * autocompleteControl.stringify = stringifyPerson;\n * ```\n */\n @Input()\n public stringify?: StringifyFn<T>;\n\n /**\n * Emits the selected option when an option is selected from the dropdown.\n *\n * @emits {T} - The selected option.\n *\n * @example\n * ```ts\n * autocompleteControl.optionSelected.subscribe((selectedOption) => {\n * console.log('Selected option:', selectedOption);\n * });\n * ```\n */\n @Output()\n public optionSelected = new EventEmitter<T>();\n\n /**\n * Event emitted before the dropdown opens.\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownOpen)=\"onBeforeDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown opened.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownOpen)=\"onAfterDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted before the dropdown closes.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownClose)=\"onBeforeDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownClose = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown closed.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownClose)=\"onAfterDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownClose = new EventEmitter<void>();\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n if (!this.options) return;\n\n this.initKeyManager(this.options.toArray());\n this.handleQueryListOption(this.options);\n this.handleSearchFieldChanges();\n }\n\n /**\n * Scrolls the specified option element into view.\n * @param {OptionControl<T>} option - The option control containing the element to scroll into view.\n * @returns {void}\n *\n * @example\n * ```ts\n * const optionControl: OptionControl<string> = { element: myOptionElement };\n * scrollOptionIntoView(optionControl);\n * ```\n */\n public scrollOptionIntoView({ element }: OptionControl<T>): void {\n const behavior = this.smoothScrollEnabled ? 'smooth' : undefined;\n if (isFunction(element.nativeElement.scrollIntoView)) {\n element.nativeElement.scrollIntoView({ block: 'center', behavior });\n }\n }\n\n protected abstract handleQueryListOption(options: QueryList<OptionControl<T>>): void;\n\n protected abstract handleSearchFieldChanges(): void;\n\n protected abstract activateSelectedOption(): void;\n\n protected initKeyManager(options: Highlightable[]): void {\n this.keyManager = new ActiveDescendantKeyManager<Highlightable>(options).withHomeAndEnd();\n }\n\n protected disableSmoothScroll(): void {\n this.smoothScrollEnabled = false;\n }\n\n protected enableSmoothScroll(): void {\n this.smoothScrollEnabled = true;\n }\n\n protected openDropdown(): void {\n this.dropdown?.open();\n }\n\n protected closeDropdown(): void {\n this.dropdown?.close();\n }\n\n protected onDropdownOpen(): void {\n this.beforeDropdownOpen.emit();\n this.activateSelectedOption();\n }\n\n protected onDropdownOpened(): void {\n this.afterDropdownOpen.emit();\n this.enableSmoothScroll();\n }\n\n protected onDropdownClose(): void {\n this.beforeDropdownClose.emit();\n this.disableSmoothScroll();\n }\n\n protected onDropdownClosed(): void {\n this.afterDropdownClose.emit();\n }\n\n @HostListener('focusout', ['$event'])\n protected handleFocusOut(event: FocusEvent): void {\n if (this.isOpen) {\n event.stopImmediatePropagation();\n }\n this.onTouched();\n }\n}\n","import { computed, Directive, inject, input, SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n@Directive({\n selector: 'odx-highlight',\n standalone: true,\n host: {\n '[innerHTML]': 'highlightedText()',\n },\n})\nexport class HighlightSearchDirective {\n private readonly sanitizer = inject(DomSanitizer);\n\n protected highlightedText = computed(() => {\n const search = this.odxHighlightSearch().trim();\n const text = this.sanitizer.sanitize(SecurityContext.HTML, this.text()) ?? '';\n\n if (!search) {\n return text;\n }\n\n const regex = new RegExp(search.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'gi');\n const highlightedText = text.replace(regex, '<mark>$&</mark>');\n\n return this.sanitizer.bypassSecurityTrustHtml(highlightedText);\n });\n\n /**\n * Search string\n * @required\n * @type string\n */\n public odxHighlightSearch = input.required<string>();\n\n /**\n * Text to highlight\n * @required\n * @type string\n */\n public text = input.required<string>();\n}\n","import { inject, InjectionToken, PipeTransform } from '@angular/core';\nimport { ODX_STRINGIFY, ODX_STRING_SEARCH_HANDLER, StringifyFn, StringSearchHandler } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { isFunction, Pure } from '@odx/angular/utils';\n\ninterface HostController {\n searchField?: InputControlDirective;\n stringify?: StringifyFn<unknown>;\n}\n\ninterface SearchFilterPipeOptions<T> {\n searchHandler?: StringSearchHandler;\n stringify?: StringifyFn<T>;\n}\n\nexport const ODX_SEARCH_FILTER_HOST = new InjectionToken<HostController>('@odx/angular/cdk/autocomplete-control::SearchFilterHost');\n\nexport abstract class BaseSearchFilterPipe implements PipeTransform {\n private readonly stringSearchHandler = inject(ODX_STRING_SEARCH_HANDLER);\n private readonly defaultStringify = inject(ODX_STRINGIFY);\n protected readonly hostController = inject(ODX_SEARCH_FILTER_HOST, { optional: true });\n\n protected get searchField(): InputControlDirective | undefined {\n return this.hostController?.searchField;\n }\n\n protected get stringify(): StringifyFn<unknown> {\n return this.hostController?.stringify ?? this.defaultStringify;\n }\n\n public transform<T>(items: T[] | null, optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): T[] | null {\n const searchHandler = this.isStringSearchHandler(optionsOrHandler) ? optionsOrHandler : optionsOrHandler?.searchHandler;\n const stringify = this.isStringSearchHandler(optionsOrHandler) ? null : optionsOrHandler?.stringify;\n if (this.searchField) {\n return this.filter(items, this.searchField.nativeElementValue, stringify ?? (this.stringify as never), searchHandler ?? this.stringSearchHandler);\n }\n return items;\n }\n\n protected queryHandler(query: string): string {\n return query?.trim() || '';\n }\n\n @Pure\n private filter<T>(items: T[] | null, query: string, stringify: StringifyFn<T>, searchHandler: StringSearchHandler): T[] | null {\n if (!items) return null;\n\n query = this.queryHandler(query);\n\n if (query === '') return items;\n\n return items.filter((item) => searchHandler(stringify(item), query));\n }\n\n private isStringSearchHandler<T>(optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): optionsOrHandler is StringSearchHandler {\n return isFunction(optionsOrHandler);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;;;;;;;;;;;;;;AAcG;AAQG,MAAgB,mBAAuB,SAAQ,iBAA2B,CAAA;AA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,IAAA,MAAM,CAAI,KAAiB,EAAE,KAAa,EAAE,SAAyB,EAAE,aAAkC,EAAA;AAC/G,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,IAAI,CAAC;AAExB,QAAA,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,KAAK,KAAK,EAAE;AAAE,YAAA,OAAO,KAAK,CAAC;AAE/B,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;KACtE;AAEO,IAAA,qBAAqB,CAAI,gBAAmE,EAAA;AAClG,QAAA,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;KACrC;AACF,CAAA;AAbS,UAAA,CAAA;IADP,IAAI;;;;AASJ,CAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;ACpDH;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-autocomplete-control.mjs","sources":["../../../../libs/angular/cdk/autocomplete-control/src/lib/autocomplete-control.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/directives/highlight-search-result.directive.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/pipes/base-search-filter-pipe.ts","../../../../libs/angular/cdk/autocomplete-control/src/odx-angular-cdk-autocomplete-control.ts"],"sourcesContent":["import { ActiveDescendantKeyManager, Highlightable } from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n Directive,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output,\n QueryList,\n ViewChild,\n} from '@angular/core';\nimport { detectControllerChanges, StringifyFn } from '@odx/angular';\nimport { CustomFormControl, InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { FormFieldComponent } from '@odx/angular/components/form-field';\nimport { injectElement, isFunction, untilDestroyed } from '@odx/angular/utils';\n\n/**\n * `AutocompleteControl` is a base directive to enhance an input field with autocomplete functionality,\n * providing keyboard navigation and selection for options displayed in a dropdown. It's designed to be extended\n * for specific implementations.\n * Extends `CustomFormControl` to provide form control behavior and state management.\n *\n * @see {CustomFormControl}\n *\n * This directive manages the open/close state of the dropdown, the loading state indication, and the interaction between\n * the autocomplete input and the dropdown options. It utilizes `ActiveDescendantKeyManager` for keyboard navigation among options.\n *\n * Extend this directive to create a fully functional autocomplete control tailored to your data type and UI requirements.\n *\n * @template T - The type of the items displayed in the autocomplete dropdown.\n */\n@Directive({\n standalone: true,\n host: {\n '[class.is-open]': 'isOpen',\n '[attr.aria-disabled]': 'isDisabled || null',\n },\n})\nexport abstract class AutocompleteControl<T> extends CustomFormControl<T | null> implements AfterViewInit {\n protected abstract readonly options?: QueryList<OptionControl<T>>;\n\n protected readonly changeDetector = inject(ChangeDetectorRef);\n protected readonly formField = inject(FormFieldComponent, { optional: true });\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected keyManager?: ActiveDescendantKeyManager<Highlightable>;\n protected smoothScrollEnabled = false;\n\n @ViewChild(DropdownDirective)\n protected readonly dropdown?: DropdownDirective;\n\n public abstract searchField?: InputControlDirective;\n\n public readonly element = injectElement();\n\n public get dropdownReferenceElement(): HTMLElement {\n return this.formField?.controlElement?.nativeElement ?? this.element?.nativeElement;\n }\n\n public get hasOptions(): boolean {\n return !!this.options?.length;\n }\n\n public get isOpen(): boolean {\n return !!this.dropdown?.isOpen;\n }\n\n @Input({ transform: booleanAttribute })\n public isLoading = false;\n\n /**\n * A function that converts an item of type T to a string representation.\n * Used by the AutocompleteControl component to display the selected item.\n *\n * @type {StringifyFn<T>}\n *\n * @example\n * ```ts\n * // Define a stringify function for a custom type Person\n * const stringifyPerson: StringifyFn<Person> = (person) => `${person.firstName} ${person.lastName}`;\n *\n * // Assign the stringify function to the AutocompleteControl\n * autocompleteControl.stringify = stringifyPerson;\n * ```\n */\n @Input()\n public stringify?: StringifyFn<T>;\n\n /**\n * Emits the selected option when an option is selected from the dropdown.\n *\n * @emits {T} - The selected option.\n *\n * @example\n * ```ts\n * autocompleteControl.optionSelected.subscribe((selectedOption) => {\n * console.log('Selected option:', selectedOption);\n * });\n * ```\n */\n @Output()\n public optionSelected = new EventEmitter<T>();\n\n /**\n * Event emitted before the dropdown opens.\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownOpen)=\"onBeforeDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown opened.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownOpen)=\"onAfterDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted before the dropdown closes.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownClose)=\"onBeforeDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownClose = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown closed.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownClose)=\"onAfterDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownClose = new EventEmitter<void>();\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n if (!this.options) return;\n\n this.initKeyManager(this.options.toArray());\n this.handleQueryListOption(this.options);\n this.handleSearchFieldChanges();\n }\n\n /**\n * Scrolls the specified option element into view.\n * @param {OptionControl<T>} option - The option control containing the element to scroll into view.\n * @returns {void}\n *\n * @example\n * ```ts\n * const optionControl: OptionControl<string> = { element: myOptionElement };\n * scrollOptionIntoView(optionControl);\n * ```\n */\n public scrollOptionIntoView({ element }: OptionControl<T>): void {\n const behavior = this.smoothScrollEnabled ? 'smooth' : undefined;\n if (isFunction(element.nativeElement.scrollIntoView)) {\n element.nativeElement.scrollIntoView({ block: 'center', behavior });\n }\n }\n\n protected abstract handleQueryListOption(options: QueryList<OptionControl<T>>): void;\n\n protected abstract handleSearchFieldChanges(): void;\n\n protected abstract activateSelectedOption(): void;\n\n protected initKeyManager(options: Highlightable[]): void {\n this.keyManager = new ActiveDescendantKeyManager<Highlightable>(options).withHomeAndEnd();\n }\n\n protected disableSmoothScroll(): void {\n this.smoothScrollEnabled = false;\n }\n\n protected enableSmoothScroll(): void {\n this.smoothScrollEnabled = true;\n }\n\n protected openDropdown(): void {\n this.dropdown?.open();\n }\n\n protected closeDropdown(): void {\n this.dropdown?.close();\n }\n\n protected onDropdownOpen(): void {\n this.beforeDropdownOpen.emit();\n this.activateSelectedOption();\n }\n\n protected onDropdownOpened(): void {\n this.afterDropdownOpen.emit();\n this.enableSmoothScroll();\n }\n\n protected onDropdownClose(): void {\n this.beforeDropdownClose.emit();\n this.disableSmoothScroll();\n }\n\n protected onDropdownClosed(): void {\n this.afterDropdownClose.emit();\n }\n\n @HostListener('focusout', ['$event'])\n protected handleFocusOut(event: FocusEvent): void {\n if (this.isOpen) {\n event.stopImmediatePropagation();\n }\n this.onTouched();\n }\n}\n","import { computed, Directive, inject, input, SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n@Directive({\n selector: 'odx-highlight',\n standalone: true,\n host: {\n '[innerHTML]': 'highlightedText()',\n },\n})\nexport class HighlightSearchDirective {\n private readonly sanitizer = inject(DomSanitizer);\n\n protected highlightedText = computed(() => {\n const search = this.odxHighlightSearch().trim();\n const text = this.sanitizer.sanitize(SecurityContext.HTML, this.text()) ?? '';\n\n if (!search) {\n return text;\n }\n\n const regex = new RegExp(search.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'gi');\n const highlightedText = text.replace(regex, '<mark>$&</mark>');\n\n return this.sanitizer.bypassSecurityTrustHtml(highlightedText);\n });\n\n /**\n * Search string\n * @required\n * @type string\n */\n public odxHighlightSearch = input.required<string>();\n\n /**\n * Text to highlight\n * @required\n * @type string\n */\n public text = input.required<string>();\n}\n","import { inject, InjectionToken, PipeTransform } from '@angular/core';\nimport { ODX_STRINGIFY, ODX_STRING_SEARCH_HANDLER, StringifyFn, StringSearchHandler } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { isFunction, Pure } from '@odx/angular/utils';\n\ninterface HostController {\n searchField?: InputControlDirective;\n stringify?: StringifyFn<unknown>;\n}\n\ninterface SearchFilterPipeOptions<T> {\n searchHandler?: StringSearchHandler;\n stringify?: StringifyFn<T>;\n}\n\nexport const ODX_SEARCH_FILTER_HOST = new InjectionToken<HostController>('@odx/angular/cdk/autocomplete-control::SearchFilterHost');\n\nexport abstract class BaseSearchFilterPipe implements PipeTransform {\n private readonly stringSearchHandler = inject(ODX_STRING_SEARCH_HANDLER);\n private readonly defaultStringify = inject(ODX_STRINGIFY);\n protected readonly hostController = inject(ODX_SEARCH_FILTER_HOST, { optional: true });\n\n protected get searchField(): InputControlDirective | undefined {\n return this.hostController?.searchField;\n }\n\n protected get stringify(): StringifyFn<unknown> {\n return this.hostController?.stringify ?? this.defaultStringify;\n }\n\n public transform<T>(items: T[] | null, optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): T[] | null {\n const searchHandler = this.isStringSearchHandler(optionsOrHandler) ? optionsOrHandler : optionsOrHandler?.searchHandler;\n const stringify = this.isStringSearchHandler(optionsOrHandler) ? null : optionsOrHandler?.stringify;\n if (this.searchField) {\n return this.filter(items, this.searchField.nativeElementValue, stringify ?? (this.stringify as never), searchHandler ?? this.stringSearchHandler);\n }\n return items;\n }\n\n protected queryHandler(query: string): string {\n return query?.trim() || '';\n }\n\n @Pure\n private filter<T>(items: T[] | null, query: string, stringify: StringifyFn<T>, searchHandler: StringSearchHandler): T[] | null {\n if (!items) return null;\n\n query = this.queryHandler(query);\n\n if (query === '') return items;\n\n return items.filter((item) => searchHandler(stringify(item), query));\n }\n\n private isStringSearchHandler<T>(optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): optionsOrHandler is StringSearchHandler {\n return isFunction(optionsOrHandler);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;;;;;;;;;;;;;;AAcG;AAQG,MAAgB,mBAAuB,SAAQ,iBAA2B,CAAA;AAiB9E,IAAA,IAAW,wBAAwB,GAAA;AACjC,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,CAAC,OAAO,EAAE,aAAa;IACrF;AAEA,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM;IAC/B;AAEA,IAAA,IAAW,MAAM,GAAA;AACf,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM;IAChC;AA6FA,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,IAAI,CAAC;AAtHM,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAC1C,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC1D,IAAA,CAAA,kBAAkB,GAAG,cAAc,EAAE;QAG9C,IAAA,CAAA,mBAAmB,GAAG,KAAK;QAOrB,IAAA,CAAA,OAAO,GAAG,aAAa,EAAE;QAelC,IAAA,CAAA,SAAS,GAAG,KAAK;AAoBxB;;;;;;;;;;;AAWG;AAEI,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAK;AAE7C;;;;;;;;;AASG;AAEI,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,YAAY,EAAQ;AAEpD;;;;;;;;;;AAUG;AAEI,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,E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,OAAO,IAAI;AAEvB,QAAA,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QAEhC,IAAI,KAAK,KAAK,EAAE;AAAE,YAAA,OAAO,KAAK;AAE9B,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACtE;AAEQ,IAAA,qBAAqB,CAAI,gBAAmE,EAAA;AAClG,QAAA,OAAO,UAAU,CAAC,gBAAgB,CAAC;IACrC;AACD;AAbS,UAAA,CAAA;IADP,IAAI;;;;AASJ,CAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;ACpDH;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, booleanAttribute, Directive, Input, Output } from '@angular/core';
2
+ import { EventEmitter, booleanAttribute, Output, Input, Directive } from '@angular/core';
3
3
  import { detectControllerChanges } from '@odx/angular';
4
4
  import { CustomFormControl } from '@odx/angular/cdk/custom-form-control';
5
5
  import { booleanToAttributeString, injectElement } from '@odx/angular/utils';
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-checkbox-control.mjs","sources":["../../../../libs/angular/cdk/checkbox-control/src/lib/checkbox-control.directive.ts","../../../../libs/angular/cdk/checkbox-control/src/odx-angular-cdk-checkbox-control.ts"],"sourcesContent":["import { booleanAttribute, Directive, EventEmitter, Input, Output } from '@angular/core';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { booleanToAttributeString, injectElement } from '@odx/angular/utils';\n\n/**\n * `CheckBoxControl` is a directive that extends `CustomFormControl` to create a custom checkbox control.\n * It integrates seamlessly with Angular forms and provides additional events and bindings for enhanced\n * functionality.\n */\n@Directive({\n selector: '[odxCheckBoxControl]',\n})\nexport class CheckBoxControl extends CustomFormControl<boolean> {\n public readonly element = injectElement();\n\n @Input({ transform: booleanAttribute })\n public set checked(value: boolean) {\n this.value = value;\n }\n public get checked(): boolean {\n return this.value;\n }\n\n /**\n * The value of the checkbox control.\n *\n * @type {string | null}\n * @default null\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value')\n public controlValue: string | null = null;\n\n /**\n * A boolean value when the checked state of the checkbox changes.\n *\n * @emits {boolean} - The new checked state of the checkbox.\n */\n @Output()\n public checkedChange = new EventEmitter<boolean>();\n\n /**\n * Aria attribute that represents the checked state of the checkbox.\n *\n * @type {string}\n */\n public get ariaChecked(): string {\n return booleanToAttributeString(this.checked);\n }\n\n constructor() {\n super(false);\n detectControllerChanges(this).subscribe();\n }\n\n public onChanged(event: Event): void {\n event.stopPropagation();\n super.updateValue((event.target as HTMLInputElement).checked);\n this.checkedChange.next(this.checked);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAKA;;;;AAIG;AAIG,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;IAG7D,IACW,OAAO,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACpB;AACD,IAAA,IAAW,OAAO,GAAA;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC;KACnB;AAoBD;;;;AAIG;AACH,IAAA,IAAW,WAAW,GAAA;AACpB,QAAA,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC/C;AAED,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,KAAK,CAAC,CAAC;QAtCC,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAU1C;;;;;AAKG;;QAGI,IAAY,CAAA,YAAA,GAAkB,IAAI,CAAC;AAE1C;;;;AAIG;AAEI,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAW,CAAC;AAajD,QAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;KAC3C;AAEM,IAAA,SAAS,CAAC,KAAY,EAAA;QAC3B,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,WAAW,CAAE,KAAK,CAAC,MAA2B,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACvC;+GA/CU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,eAAe,8EAGN,gBAAgB,CAAA,EAAA,YAAA,EAAA,CAAA,OAAA,EAAA,cAAA,CAAA,EAAA,EAAA,OAAA,EAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAHzB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;wDAKY,OAAO,EAAA,CAAA;sBADjB,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAgB/B,YAAY,EAAA,CAAA;sBADlB,KAAK;uBAAC,OAAO,CAAA;gBASP,aAAa,EAAA,CAAA;sBADnB,MAAM;;;ACvCT;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-checkbox-control.mjs","sources":["../../../../libs/angular/cdk/checkbox-control/src/lib/checkbox-control.directive.ts","../../../../libs/angular/cdk/checkbox-control/src/odx-angular-cdk-checkbox-control.ts"],"sourcesContent":["import { booleanAttribute, Directive, EventEmitter, Input, Output } from '@angular/core';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { booleanToAttributeString, injectElement } from '@odx/angular/utils';\n\n/**\n * `CheckBoxControl` is a directive that extends `CustomFormControl` to create a custom checkbox control.\n * It integrates seamlessly with Angular forms and provides additional events and bindings for enhanced\n * functionality.\n */\n@Directive({\n selector: '[odxCheckBoxControl]',\n})\nexport class CheckBoxControl extends CustomFormControl<boolean> {\n public readonly element = injectElement();\n\n @Input({ transform: booleanAttribute })\n public set checked(value: boolean) {\n this.value = value;\n }\n public get checked(): boolean {\n return this.value;\n }\n\n /**\n * The value of the checkbox control.\n *\n * @type {string | null}\n * @default null\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value')\n public controlValue: string | null = null;\n\n /**\n * A boolean value when the checked state of the checkbox changes.\n *\n * @emits {boolean} - The new checked state of the checkbox.\n */\n @Output()\n public checkedChange = new EventEmitter<boolean>();\n\n /**\n * Aria attribute that represents the checked state of the checkbox.\n *\n * @type {string}\n */\n public get ariaChecked(): string {\n return booleanToAttributeString(this.checked);\n }\n\n constructor() {\n super(false);\n detectControllerChanges(this).subscribe();\n }\n\n public onChanged(event: Event): void {\n event.stopPropagation();\n super.updateValue((event.target as HTMLInputElement).checked);\n this.checkedChange.next(this.checked);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAKA;;;;AAIG;AAIG,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;IAG7D,IACW,OAAO,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;IACpB;AACA,IAAA,IAAW,OAAO,GAAA;QAChB,OAAO,IAAI,CAAC,KAAK;IACnB;AAoBA;;;;AAIG;AACH,IAAA,IAAW,WAAW,GAAA;AACpB,QAAA,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/C;AAEA,IAAA,WAAA,GAAA;QACE,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,6 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, NgZone, Injector, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, Input, Output, Injectable } from '@angular/core';
3
+ import { inject, NgZone, Injector, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
4
4
  import { arrow, flip, computePosition, offset, shift, size, hide, autoUpdate } from '@floating-ui/dom';
5
5
  import { CoreModule } from '@odx/angular';
6
6
  import { DynamicViewDirective, DynamicViewService } from '@odx/angular/cdk/dynamic-view';
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-connected-overlay.mjs","sources":["../../../../libs/angular/cdk/connected-overlay/src/lib/helpers/compute-overlay-position.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-options.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-ref.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.html","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.service.ts","../../../../libs/angular/cdk/connected-overlay/src/odx-angular-cdk-connected-overlay.ts"],"sourcesContent":["import { ComputePositionReturn, VirtualElement, arrow, computePosition, flip, hide, shift, size, offset as withOffset } from '@floating-ui/dom';\nimport { applyStyles, getOppositeSide, getSide, px } from '@odx/angular/utils';\nimport { ConnectedOverlayOptions } from '../models';\n\n/**\n * Computes the position of an overlay element relative to a reference element.\n *\n * @param referenceElement - The reference element to position the overlay relative to.\n * @param overlayElement - The overlay element to be positioned.\n * @param contentElement - The content element within the overlay.\n * @param arrowElement - The arrow element within the overlay.\n * @param options - The options for positioning the overlay.\n * @returns A promise that resolves to the computed position of the overlay.\n */\nexport async function computeOverlayPosition(\n referenceElement: VirtualElement,\n overlayElement: HTMLElement,\n contentElement: HTMLElement,\n arrowElement: HTMLElement,\n options: ConnectedOverlayOptions,\n): Promise<ComputePositionReturn> {\n const variablePrefix = '--odx-cdk-connected-overlay';\n const { position, offset, outerPadding, matchReferenceWidth, enableFallback, fallbackAxisSideDirection, strategy, minHeight } = options;\n const arrowSize = options.showArrow ? arrowElement.offsetWidth : 0;\n const arrowMiddleware = options.showArrow ? [arrow({ element: arrowElement, padding: 8 })] : [];\n const flipMiddleWare = enableFallback ? [flip({ fallbackAxisSideDirection })] : [];\n return computePosition(referenceElement, overlayElement, {\n strategy,\n placement: position,\n middleware: [\n withOffset(Math.max(offset, arrowSize + offset)),\n shift({ padding: outerPadding }),\n ...flipMiddleWare,\n size({\n padding: outerPadding,\n apply: ({ availableHeight, rects }) => {\n contentElement.style.setProperty?.(`${variablePrefix}-min-height`, minHeight ? px(Math.min(availableHeight, minHeight)) : null);\n contentElement.style.setProperty?.(`${variablePrefix}-min-width`, matchReferenceWidth ? px(rects.reference.width) : null);\n },\n }),\n ...arrowMiddleware,\n hide({ rootBoundary: 'viewport' }),\n ],\n }).then((result) => {\n overlayElement.style.setProperty?.(`${variablePrefix}-position-x`, px(result.x));\n overlayElement.style.setProperty?.(`${variablePrefix}-position-y`, px(result.y));\n if (options.hiddenClass) {\n overlayElement.classList.toggle(options.hiddenClass, !!result.middlewareData.hide?.referenceHidden);\n }\n if (options.showArrow) {\n const overlaySide = getSide(result.placement);\n const arrowSide = getOppositeSide(result.placement);\n applyStyles(arrowElement, {\n display: null,\n top: px(result.middlewareData.arrow?.y),\n left: px(result.middlewareData.arrow?.x),\n [arrowSide]: px(-arrowSize / 2),\n [overlaySide]: null,\n });\n } else {\n applyStyles(arrowElement, { display: 'none' });\n }\n\n return result;\n });\n}\n","import { Strategy } from '@floating-ui/dom';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { Position } from '@odx/angular/utils';\n\nexport interface ConnectedOverlayOptions {\n content?: DynamicContent | null;\n context?: Record<string, unknown>;\n containerClass?: string | null;\n hiddenClass: string | null;\n enableFallback: boolean;\n fallbackAxisSideDirection: 'start' | 'end';\n matchReferenceWidth: boolean;\n minHeight?: number | null;\n offset: number;\n outerPadding: number;\n position: Position;\n strategy: Strategy;\n showArrow?: boolean;\n updateOnAnimationFrame?: boolean;\n nonInteractive?: boolean;\n hooks?: {\n beforeOpen?: () => void;\n afterOpen?: () => void;\n beforeClose?: () => void;\n afterClose?: () => void;\n };\n}\n\nexport const DefaultConnectedOverlayOptions: ConnectedOverlayOptions = {\n hiddenClass: 'is-hidden',\n enableFallback: false,\n fallbackAxisSideDirection: 'start',\n matchReferenceWidth: false,\n offset: 8,\n outerPadding: 12,\n position: Position.BOTTOM,\n strategy: 'fixed',\n};\n","import { DynamicViewRef } from '@odx/angular/cdk/dynamic-view';\nimport { waitForAnimations } from '@odx/angular/utils';\nimport { EMPTY, Observable } from 'rxjs';\nimport { ConnectedOverlayComponent } from '../connected-overlay.component';\nimport { ConnectedOverlayOptions } from './connected-overlay-options';\n\n/**\n * A reference to a connected overlay created by the `ConnectedOverlayService`. This class provides methods to interact\n * with the overlay, such as updating its options or closing it. It encapsulates the `DynamicViewRef` for the overlay's instance,\n * allowing for direct manipulation of the overlay's state and behavior.\n *\n * This example demonstrates how to use a `ConnectedOverlayRef` to update and close a connected overlay in response\n * to user interactions.\n *\n * @example\n * ```ts\n * class MyComponent {\n * private overlayRef?: ConnectedOverlayRef;\n *\n * constructor(private overlayService: ConnectedOverlayService) {}\n *\n * openOverlay() {\n * this.overlayRef = this.overlayService.createOverlay(this.someElementRef.nativeElement, { position: 'bottom' });\n * }\n *\n * updateOverlayPosition() {\n * if (this.overlayRef) {\n * this.overlayRef.update({ position: 'top' });\n * }\n * }\n *\n * closeOverlay() {\n * this.overlayRef?.close();\n * }\n * }\n * ```\n *\n * In this example, `MyComponent` uses the `ConnectedOverlayService` to create an overlay. It stores a reference to\n * the created overlay in `overlayRef`, allowing it to update the overlay's position or close it when necessary.\n */\nexport class ConnectedOverlayRef {\n public readonly element = this.dynamicViewRef.getElement();\n\n /**\n * An Observable that emits when the overlay is closed.\n *\n * @emits {void} - Emits when the overlay is closed.\n *\n */\n public readonly onClose$: Observable<void> = this.dynamicViewRef.getContext().closed ?? EMPTY;\n\n constructor(private readonly dynamicViewRef: DynamicViewRef<typeof ConnectedOverlayComponent>) {}\n\n /**\n * Updates the connected overlay with new options.\n *\n * @param options {Partial<ConnectedOverlayOptions>} - The new options to be applied to the connected overlay.\n */\n public update(options: Partial<ConnectedOverlayOptions>): void {\n this.dynamicViewRef.update({ options: options as ConnectedOverlayOptions });\n }\n\n /**\n * Closes the connected overlay.\n *\n * @returns {void}\n */\n public async close(force = false) {\n const hiddenClass = force ? 'force-hidden' : this.dynamicViewRef.getContext().options?.hiddenClass || 'is-hidden';\n this.element?.classList.add(hiddenClass);\n await waitForAnimations(this.element);\n this.dynamicViewRef.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Injector,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { VirtualElement, autoUpdate } from '@floating-ui/dom';\nimport { CoreModule } from '@odx/angular';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { NgChanges, Side, deferFn, getSide, hasChanged, injectElement, isPresent } from '@odx/angular/utils';\nimport { Subject } from 'rxjs';\nimport { computeOverlayPosition } from './helpers';\nimport { ConnectedOverlayOptions, DefaultConnectedOverlayOptions } from './models';\n\n@CSSComponent('cdk-connected-overlay')\n@Component({\n standalone: true,\n selector: 'odx-connected-overlay[popover=\"manual\"]',\n imports: [CoreModule, DynamicViewDirective],\n templateUrl: 'connected-overlay.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConnectedOverlayComponent implements OnInit, OnChanges, OnDestroy {\n private readonly zone = inject(NgZone);\n private positionUpdater: (() => void) | null = null;\n\n protected readonly injector = inject(Injector);\n protected overlaySide?: Side;\n\n @ViewChild('content', { static: true })\n protected contentElement!: ElementRef<HTMLElement>;\n\n @ViewChild('arrow', { static: true })\n protected arrowElement!: ElementRef<HTMLElement>;\n\n public readonly element = injectElement();\n\n @Input()\n public referenceElement!: VirtualElement;\n\n @Input()\n public options: ConnectedOverlayOptions = DefaultConnectedOverlayOptions;\n\n @Output()\n public closed = new Subject<void>();\n\n public ngOnInit(): void {\n this.options.hooks?.beforeOpen?.();\n deferFn(() => {\n this.element.nativeElement?.isConnected && this.element.nativeElement?.showPopover?.();\n this.options.hooks?.afterOpen?.();\n });\n }\n\n public ngOnChanges(changes: NgChanges<ConnectedOverlayComponent>): void {\n if (hasChanged(changes, ['options'], false)) {\n this.overlaySide = getSide(this.options.position);\n this.element.nativeElement.classList.toggle('odx-cdk-connected-overlay--non-interactive', this.options.nonInteractive ?? false);\n }\n if (hasChanged(changes, ['referenceElement', 'options'], false)) {\n this.stopPositionUpdater();\n this.startPositionUpdater();\n }\n }\n\n public ngOnDestroy(): void {\n this.options.hooks?.beforeClose?.();\n this.stopPositionUpdater();\n this.element.nativeElement?.hidePopover?.();\n this.closed.next();\n this.options.hooks?.afterClose?.();\n }\n\n private startPositionUpdater(): void {\n this.positionUpdater = this.zone.runOutsideAngular(() =>\n autoUpdate(this.referenceElement, this.element.nativeElement, () => this.updatePosition(), {\n elementResize: isPresent(window.ResizeObserver),\n animationFrame: this.options.updateOnAnimationFrame,\n }),\n );\n }\n\n private stopPositionUpdater(): void {\n this.positionUpdater?.();\n this.positionUpdater = null;\n }\n\n private async updatePosition(): Promise<void> {\n return computeOverlayPosition(\n this.referenceElement,\n this.element.nativeElement,\n this.contentElement.nativeElement,\n this.arrowElement.nativeElement,\n this.options,\n ).then(({ placement }) => {\n this.overlaySide = getSide(placement);\n });\n }\n}\n","<div class=\"odx-cdk-connected-overlay__content {{ options.containerClass }}\" #content>\n <ng-template [odxDynamicView]=\"options.content\" [odxDynamicViewContext]=\"options.context\" [odxDynamicViewInjector]=\"injector\" />\n <div class=\"odx-cdk-connected-overlay-arrow\" #arrow></div>\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { VirtualElement } from '@floating-ui/dom';\nimport { DynamicViewRenderingOptions, DynamicViewService } from '@odx/angular/cdk/dynamic-view';\nimport { deepmerge } from '@odx/angular/internal';\nimport { ConnectedOverlayComponent } from './connected-overlay.component';\nimport { ConnectedOverlayOptions, ConnectedOverlayRef, DefaultConnectedOverlayOptions } from './models';\n\n/**\n * Service for creating and managing connected overlays. These overlays are UI elements such as popovers, tooltips,\n * or dropdown menus that are positioned relative to a reference element in the DOM. This service leverages the `DynamicViewService`\n * for dynamic component rendering and provides a streamlined API for creating overlays with custom positioning and options.\n *\n * Use the `ConnectedOverlayService` to dynamically create an overlay next to a specific element in your Angular application.\n * This example demonstrates creating a connected overlay next to a button element when the button is clicked.\n *\n * @example\n * ```ts\n * import { Component, ElementRef, ViewChild } from '@angular/core';\n * import { ConnectedOverlayService, ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay';\n *\n * @Component({\n * selector: 'app-example',\n * template: `<button #triggerElement>Click me</button>`,\n * })\n * class AppComponent {\n * @ViewChild('triggerElement') triggerElementRef!: ElementRef;\n *\n * constructor(private connectedOverlayService: ConnectedOverlayService) {}\n *\n * showOverlay(): void {\n * const options: Partial<ConnectedOverlayOptions> = {\n * position: 'bottom-start',\n * showArrow: true,\n * content: 'Hello, world!',\n * };\n *\n * this.connectedOverlayService.createOverlay(this.triggerElementRef.nativeElement, options);\n * }\n * }\n * ```\n *\n * This service simplifies the process of creating dynamic, positionally aware overlays that enhance the interactivity\n * and visual appeal of Angular applications.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectedOverlayService {\n private readonly dynamicViewService = inject(DynamicViewService);\n\n /**\n * Creates a connected overlay.\n * @param referenceElement - The reference element to which the overlay will be connected.\n * @param options - Optional configuration for the connected overlay.\n * @param renderingOptions - Optional rendering options for the connected overlay.\n * @returns {ConnectedOverlayRef} The created Connected Overlay reference instance.\n */\n public createOverlay(\n referenceElement: VirtualElement,\n options?: Partial<ConnectedOverlayOptions>,\n renderingOptions?: Partial<DynamicViewRenderingOptions>,\n ): ConnectedOverlayRef {\n const dynamicViewRef = this.dynamicViewService.createView(ConnectedOverlayComponent, {\n ...renderingOptions,\n context: { options: deepmerge(DefaultConnectedOverlayOptions, options) as ConnectedOverlayOptions, referenceElement },\n });\n\n return new ConnectedOverlayRef(dynamicViewRef);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["offset","withOffset"],"mappings":";;;;;;;;;;AAIA;;;;;;;;;AASG;AACI,eAAe,sBAAsB,CAC1C,gBAAgC,EAChC,cAA2B,EAC3B,cAA2B,EAC3B,YAAyB,EACzB,OAAgC,EAAA;IAEhC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,IAAA,MAAM,EAAE,QAAQ,UAAEA,QAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;AACxI,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,WAAW,GAAG,CAAC,CAAC;IACnE,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AAChG,IAAA,MAAM,cAAc,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC,EAAE,yBAAyB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AACnF,IAAA,OAAO,eAAe,CAAC,gBAAgB,EAAE,cAAc,EAAE;QACvD,QAAQ;AACR,QAAA,SAAS,EAAE,QAAQ;AACnB,QAAA,UAAU,EAAE;YACVC,MAAU,CAAC,IAAI,CAAC,GAAG,CAACD,QAAM,EAAE,SAAS,GAAGA,QAAM,CAAC,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;AAoCG;MAEU,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAqBlE,KAAA;AAnBC;;;;;;AAMG;AACI,IAAA,aAAa,CAClB,gBAAgC,EAChC,OAA0C,EAC1C,gBAAuD,EAAA;QAEvD,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,yBAAyB,EAAE;AACnF,YAAA,GAAG,gBAAgB;AACnB,YAAA,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,8BAA8B,EAAE,OAAO,CAA4B,EAAE,gBAAgB,EAAE;AACtH,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,mBAAmB,CAAC,cAAc,CAAC,CAAC;KAChD;+GArBU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA,EAAA;;4FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;AC5ClC;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-connected-overlay.mjs","sources":["../../../../libs/angular/cdk/connected-overlay/src/lib/helpers/compute-overlay-position.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-options.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-ref.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.html","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.service.ts","../../../../libs/angular/cdk/connected-overlay/src/odx-angular-cdk-connected-overlay.ts"],"sourcesContent":["import { ComputePositionReturn, VirtualElement, arrow, computePosition, flip, hide, shift, size, offset as withOffset } from '@floating-ui/dom';\nimport { applyStyles, getOppositeSide, getSide, px } from '@odx/angular/utils';\nimport { ConnectedOverlayOptions } from '../models';\n\n/**\n * Computes the position of an overlay element relative to a reference element.\n *\n * @param referenceElement - The reference element to position the overlay relative to.\n * @param overlayElement - The overlay element to be positioned.\n * @param contentElement - The content element within the overlay.\n * @param arrowElement - The arrow element within the overlay.\n * @param options - The options for positioning the overlay.\n * @returns A promise that resolves to the computed position of the overlay.\n */\nexport async function computeOverlayPosition(\n referenceElement: VirtualElement,\n overlayElement: HTMLElement,\n contentElement: HTMLElement,\n arrowElement: HTMLElement,\n options: ConnectedOverlayOptions,\n): Promise<ComputePositionReturn> {\n const variablePrefix = '--odx-cdk-connected-overlay';\n const { position, offset, outerPadding, matchReferenceWidth, enableFallback, fallbackAxisSideDirection, strategy, minHeight } = options;\n const arrowSize = options.showArrow ? arrowElement.offsetWidth : 0;\n const arrowMiddleware = options.showArrow ? [arrow({ element: arrowElement, padding: 8 })] : [];\n const flipMiddleWare = enableFallback ? [flip({ fallbackAxisSideDirection })] : [];\n return computePosition(referenceElement, overlayElement, {\n strategy,\n placement: position,\n middleware: [\n withOffset(Math.max(offset, arrowSize + offset)),\n shift({ padding: outerPadding }),\n ...flipMiddleWare,\n size({\n padding: outerPadding,\n apply: ({ availableHeight, rects }) => {\n contentElement.style.setProperty?.(`${variablePrefix}-min-height`, minHeight ? px(Math.min(availableHeight, minHeight)) : null);\n contentElement.style.setProperty?.(`${variablePrefix}-min-width`, matchReferenceWidth ? px(rects.reference.width) : null);\n },\n }),\n ...arrowMiddleware,\n hide({ rootBoundary: 'viewport' }),\n ],\n }).then((result) => {\n overlayElement.style.setProperty?.(`${variablePrefix}-position-x`, px(result.x));\n overlayElement.style.setProperty?.(`${variablePrefix}-position-y`, px(result.y));\n if (options.hiddenClass) {\n overlayElement.classList.toggle(options.hiddenClass, !!result.middlewareData.hide?.referenceHidden);\n }\n if (options.showArrow) {\n const overlaySide = getSide(result.placement);\n const arrowSide = getOppositeSide(result.placement);\n applyStyles(arrowElement, {\n display: null,\n top: px(result.middlewareData.arrow?.y),\n left: px(result.middlewareData.arrow?.x),\n [arrowSide]: px(-arrowSize / 2),\n [overlaySide]: null,\n });\n } else {\n applyStyles(arrowElement, { display: 'none' });\n }\n\n return result;\n });\n}\n","import { Strategy } from '@floating-ui/dom';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { Position } from '@odx/angular/utils';\n\nexport interface ConnectedOverlayOptions {\n content?: DynamicContent | null;\n context?: Record<string, unknown>;\n containerClass?: string | null;\n hiddenClass: string | null;\n enableFallback: boolean;\n fallbackAxisSideDirection: 'start' | 'end';\n matchReferenceWidth: boolean;\n minHeight?: number | null;\n offset: number;\n outerPadding: number;\n position: Position;\n strategy: Strategy;\n showArrow?: boolean;\n updateOnAnimationFrame?: boolean;\n nonInteractive?: boolean;\n hooks?: {\n beforeOpen?: () => void;\n afterOpen?: () => void;\n beforeClose?: () => void;\n afterClose?: () => void;\n };\n}\n\nexport const DefaultConnectedOverlayOptions: ConnectedOverlayOptions = {\n hiddenClass: 'is-hidden',\n enableFallback: false,\n fallbackAxisSideDirection: 'start',\n matchReferenceWidth: false,\n offset: 8,\n outerPadding: 12,\n position: Position.BOTTOM,\n strategy: 'fixed',\n};\n","import { DynamicViewRef } from '@odx/angular/cdk/dynamic-view';\nimport { waitForAnimations } from '@odx/angular/utils';\nimport { EMPTY, Observable } from 'rxjs';\nimport { ConnectedOverlayComponent } from '../connected-overlay.component';\nimport { ConnectedOverlayOptions } from './connected-overlay-options';\n\n/**\n * A reference to a connected overlay created by the `ConnectedOverlayService`. This class provides methods to interact\n * with the overlay, such as updating its options or closing it. It encapsulates the `DynamicViewRef` for the overlay's instance,\n * allowing for direct manipulation of the overlay's state and behavior.\n *\n * This example demonstrates how to use a `ConnectedOverlayRef` to update and close a connected overlay in response\n * to user interactions.\n *\n * @example\n * ```ts\n * class MyComponent {\n * private overlayRef?: ConnectedOverlayRef;\n *\n * constructor(private overlayService: ConnectedOverlayService) {}\n *\n * openOverlay() {\n * this.overlayRef = this.overlayService.createOverlay(this.someElementRef.nativeElement, { position: 'bottom' });\n * }\n *\n * updateOverlayPosition() {\n * if (this.overlayRef) {\n * this.overlayRef.update({ position: 'top' });\n * }\n * }\n *\n * closeOverlay() {\n * this.overlayRef?.close();\n * }\n * }\n * ```\n *\n * In this example, `MyComponent` uses the `ConnectedOverlayService` to create an overlay. It stores a reference to\n * the created overlay in `overlayRef`, allowing it to update the overlay's position or close it when necessary.\n */\nexport class ConnectedOverlayRef {\n public readonly element = this.dynamicViewRef.getElement();\n\n /**\n * An Observable that emits when the overlay is closed.\n *\n * @emits {void} - Emits when the overlay is closed.\n *\n */\n public readonly onClose$: Observable<void> = this.dynamicViewRef.getContext().closed ?? EMPTY;\n\n constructor(private readonly dynamicViewRef: DynamicViewRef<typeof ConnectedOverlayComponent>) {}\n\n /**\n * Updates the connected overlay with new options.\n *\n * @param options {Partial<ConnectedOverlayOptions>} - The new options to be applied to the connected overlay.\n */\n public update(options: Partial<ConnectedOverlayOptions>): void {\n this.dynamicViewRef.update({ options: options as ConnectedOverlayOptions });\n }\n\n /**\n * Closes the connected overlay.\n *\n * @returns {void}\n */\n public async close(force = false) {\n const hiddenClass = force ? 'force-hidden' : this.dynamicViewRef.getContext().options?.hiddenClass || 'is-hidden';\n this.element?.classList.add(hiddenClass);\n await waitForAnimations(this.element);\n this.dynamicViewRef.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Injector,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { VirtualElement, autoUpdate } from '@floating-ui/dom';\nimport { CoreModule } from '@odx/angular';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { NgChanges, Side, deferFn, getSide, hasChanged, injectElement, isPresent } from '@odx/angular/utils';\nimport { Subject } from 'rxjs';\nimport { computeOverlayPosition } from './helpers';\nimport { ConnectedOverlayOptions, DefaultConnectedOverlayOptions } from './models';\n\n@CSSComponent('cdk-connected-overlay')\n@Component({\n standalone: true,\n selector: 'odx-connected-overlay[popover=\"manual\"]',\n imports: [CoreModule, DynamicViewDirective],\n templateUrl: 'connected-overlay.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConnectedOverlayComponent implements OnInit, OnChanges, OnDestroy {\n private readonly zone = inject(NgZone);\n private positionUpdater: (() => void) | null = null;\n\n protected readonly injector = inject(Injector);\n protected overlaySide?: Side;\n\n @ViewChild('content', { static: true })\n protected contentElement!: ElementRef<HTMLElement>;\n\n @ViewChild('arrow', { static: true })\n protected arrowElement!: ElementRef<HTMLElement>;\n\n public readonly element = injectElement();\n\n @Input()\n public referenceElement!: VirtualElement;\n\n @Input()\n public options: ConnectedOverlayOptions = DefaultConnectedOverlayOptions;\n\n @Output()\n public closed = new Subject<void>();\n\n public ngOnInit(): void {\n this.options.hooks?.beforeOpen?.();\n deferFn(() => {\n this.element.nativeElement?.isConnected && this.element.nativeElement?.showPopover?.();\n this.options.hooks?.afterOpen?.();\n });\n }\n\n public ngOnChanges(changes: NgChanges<ConnectedOverlayComponent>): void {\n if (hasChanged(changes, ['options'], false)) {\n this.overlaySide = getSide(this.options.position);\n this.element.nativeElement.classList.toggle('odx-cdk-connected-overlay--non-interactive', this.options.nonInteractive ?? false);\n }\n if (hasChanged(changes, ['referenceElement', 'options'], false)) {\n this.stopPositionUpdater();\n this.startPositionUpdater();\n }\n }\n\n public ngOnDestroy(): void {\n this.options.hooks?.beforeClose?.();\n this.stopPositionUpdater();\n this.element.nativeElement?.hidePopover?.();\n this.closed.next();\n this.options.hooks?.afterClose?.();\n }\n\n private startPositionUpdater(): void {\n this.positionUpdater = this.zone.runOutsideAngular(() =>\n autoUpdate(this.referenceElement, this.element.nativeElement, () => this.updatePosition(), {\n elementResize: isPresent(window.ResizeObserver),\n animationFrame: this.options.updateOnAnimationFrame,\n }),\n );\n }\n\n private stopPositionUpdater(): void {\n this.positionUpdater?.();\n this.positionUpdater = null;\n }\n\n private async updatePosition(): Promise<void> {\n return computeOverlayPosition(\n this.referenceElement,\n this.element.nativeElement,\n this.contentElement.nativeElement,\n this.arrowElement.nativeElement,\n this.options,\n ).then(({ placement }) => {\n this.overlaySide = getSide(placement);\n });\n }\n}\n","<div class=\"odx-cdk-connected-overlay__content {{ options.containerClass }}\" #content>\n <ng-template [odxDynamicView]=\"options.content\" [odxDynamicViewContext]=\"options.context\" [odxDynamicViewInjector]=\"injector\" />\n <div class=\"odx-cdk-connected-overlay-arrow\" #arrow></div>\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { VirtualElement } from '@floating-ui/dom';\nimport { DynamicViewRenderingOptions, DynamicViewService } from '@odx/angular/cdk/dynamic-view';\nimport { deepmerge } from '@odx/angular/internal';\nimport { ConnectedOverlayComponent } from './connected-overlay.component';\nimport { ConnectedOverlayOptions, ConnectedOverlayRef, DefaultConnectedOverlayOptions } from './models';\n\n/**\n * Service for creating and managing connected overlays. These overlays are UI elements such as popovers, tooltips,\n * or dropdown menus that are positioned relative to a reference element in the DOM. This service leverages the `DynamicViewService`\n * for dynamic component rendering and provides a streamlined API for creating overlays with custom positioning and options.\n *\n * Use the `ConnectedOverlayService` to dynamically create an overlay next to a specific element in your Angular application.\n * This example demonstrates creating a connected overlay next to a button element when the button is clicked.\n *\n * @example\n * ```ts\n * import { Component, ElementRef, ViewChild } from '@angular/core';\n * import { ConnectedOverlayService, ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay';\n *\n * @Component({\n * selector: 'app-example',\n * template: `<button #triggerElement>Click me</button>`,\n * })\n * class AppComponent {\n * @ViewChild('triggerElement') triggerElementRef!: ElementRef;\n *\n * constructor(private connectedOverlayService: ConnectedOverlayService) {}\n *\n * showOverlay(): void {\n * const options: Partial<ConnectedOverlayOptions> = {\n * position: 'bottom-start',\n * showArrow: true,\n * content: 'Hello, world!',\n * };\n *\n * this.connectedOverlayService.createOverlay(this.triggerElementRef.nativeElement, options);\n * }\n * }\n * ```\n *\n * This service simplifies the process of creating dynamic, positionally aware overlays that enhance the interactivity\n * and visual appeal of Angular applications.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectedOverlayService {\n private readonly dynamicViewService = inject(DynamicViewService);\n\n /**\n * Creates a connected overlay.\n * @param referenceElement - The reference element to which the overlay will be connected.\n * @param options - Optional configuration for the connected overlay.\n * @param renderingOptions - Optional rendering options for the connected overlay.\n * @returns {ConnectedOverlayRef} The created Connected Overlay reference instance.\n */\n public createOverlay(\n referenceElement: VirtualElement,\n options?: Partial<ConnectedOverlayOptions>,\n renderingOptions?: Partial<DynamicViewRenderingOptions>,\n ): ConnectedOverlayRef {\n const dynamicViewRef = this.dynamicViewService.createView(ConnectedOverlayComponent, {\n ...renderingOptions,\n context: { options: deepmerge(DefaultConnectedOverlayOptions, options) as ConnectedOverlayOptions, referenceElement },\n });\n\n return new ConnectedOverlayRef(dynamicViewRef);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["offset","withOffset"],"mappings":";;;;;;;;;;AAIA;;;;;;;;;AASG;AACI,eAAe,sBAAsB,CAC1C,gBAAgC,EAChC,cAA2B,EAC3B,cAA2B,EAC3B,YAAyB,EACzB,OAAgC,EAAA;IAEhC,MAAM,cAAc,GAAG,6BAA6B;AACpD,IAAA,MAAM,EAAE,QAAQ,UAAEA,QAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,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@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, inject, booleanAttribute, Input, ViewChild } from '@angular/core';
2
+ import { Directive, inject, booleanAttribute, ViewChild, Input } from '@angular/core';
3
3
  import { injectElement, arrayAttribute, Pure, untilDestroyed } from '@odx/angular/utils';
4
4
  import { __decorate, __metadata } from 'tslib';
5
5
  import { Validators, RequiredValidator, NgControl } from '@angular/forms';