@odx/angular 5.7.4 → 6.0.1

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 (658) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/animations/lib/expand.d.ts +44 -0
  3. package/animations/lib/fade.d.ts +70 -0
  4. package/animations/lib/slide.d.ts +21 -0
  5. package/animations/lib/wait-for-child-animations.d.ts +38 -0
  6. package/breakpoints/lib/breakpoints.config.d.ts +38 -0
  7. package/breakpoints/lib/breakpoints.service.d.ts +43 -0
  8. package/breakpoints/lib/directives/match-breakpoints.directive.d.ts +36 -0
  9. package/breakpoints/lib/helpers/configure-breakpoint.d.ts +19 -0
  10. package/cdk/a11y/lib/directives/interactive.directive.d.ts +32 -0
  11. package/cdk/a11y/lib/directives/list-focus-manager-option.directive.d.ts +22 -0
  12. package/cdk/a11y/lib/directives/list-focus-manager.directive.d.ts +17 -0
  13. package/cdk/active-indicator/lib/active-indicator.directive.d.ts +63 -0
  14. package/cdk/autocomplete-control/lib/autocomplete-control.d.ts +53 -0
  15. package/cdk/checkbox-control/lib/checkbox-control.directive.d.ts +3 -0
  16. package/cdk/connected-overlay/lib/connected-overlay.service.d.ts +44 -0
  17. package/cdk/connected-overlay/lib/helpers/compute-overlay-position.d.ts +10 -0
  18. package/cdk/connected-overlay/lib/models/connected-overlay-ref.d.ts +49 -0
  19. package/cdk/custom-form-control/lib/custom-form-control.d.ts +108 -0
  20. package/cdk/custom-form-control/lib/input-control.directive.d.ts +75 -0
  21. package/cdk/dynamic-view/lib/dynamic-view.directive.d.ts +25 -0
  22. package/cdk/dynamic-view/lib/dynamic-view.service.d.ts +30 -0
  23. package/cdk/dynamic-view/lib/helpers/create-projectable-nodes.d.ts +22 -0
  24. package/cdk/dynamic-view/lib/helpers/is-dynamic-text-content.d.ts +22 -0
  25. package/cdk/dynamic-view/lib/helpers/is-dynamic-view.d.ts +22 -0
  26. package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +39 -0
  27. package/cdk/dynamic-view/lib/models/dynamic-template-ref.d.ts +36 -0
  28. package/cdk/event-plugins/lib/event-plugins.config.d.ts +35 -0
  29. package/cdk/event-plugins/lib/models/event-plugin.d.ts +57 -0
  30. package/cdk/event-plugins/lib/plugins/debounce-event-plugin.d.ts +32 -0
  31. package/cdk/event-plugins/lib/plugins/defer-event-plugin.d.ts +24 -0
  32. package/cdk/expandable/lib/directives/expandable-container.directive.d.ts +41 -0
  33. package/cdk/expandable/lib/directives/expandable-item.directive.d.ts +47 -0
  34. package/cdk/option-control/lib/option-control.d.ts +47 -0
  35. package/cdk/radio-group-control/lib/radio-control.directive.d.ts +8 -0
  36. package/cdk/radio-group-control/lib/radio-group-control.directive.d.ts +11 -0
  37. package/components/accordion/lib/accordion.component.d.ts +8 -0
  38. package/components/accordion/lib/components/accordion-item/accordion-item.component.d.ts +37 -1
  39. package/components/accordion/lib/directives/accordion-item-title.d.ts +3 -0
  40. package/components/action-group/action-group.component.d.ts +6 -0
  41. package/components/area-header/area-header.component.d.ts +8 -0
  42. package/components/area-header/directives/area-header-content.directive.d.ts +3 -0
  43. package/components/area-header/directives/area-header-subtitle.directive.d.ts +3 -0
  44. package/components/autocomplete/lib/autocomplete.component.d.ts +17 -0
  45. package/components/avatar/lib/avatar.component.d.ts +8 -0
  46. package/components/badge/lib/badge.component.d.ts +10 -0
  47. package/components/badge/lib/badge.directive.d.ts +15 -0
  48. package/components/bar/lib/bar.component.d.ts +7 -0
  49. package/components/bar/lib/directives/bar-button.directive.d.ts +3 -0
  50. package/components/bar/lib/directives/bar-label.directive.d.ts +3 -0
  51. package/components/breadcrumbs/lib/breadcrumbs.component.d.ts +3 -0
  52. package/components/button/lib/button.component.d.ts +10 -0
  53. package/components/button-group/lib/button-group.component.d.ts +15 -0
  54. package/components/calendar/lib/calendar.component.d.ts +48 -0
  55. package/components/calendar/lib/calendar.config.d.ts +41 -93
  56. package/components/calendar/lib/calendar.service.d.ts +48 -0
  57. package/components/calendar/lib/components/calendar-header/calendar-header.component.d.ts +24 -0
  58. package/components/calendar/lib/components/calendar-month/calendar-month.component.d.ts +6 -0
  59. package/components/calendar/lib/components/calendar-year/calendar-year.component.d.ts +6 -0
  60. package/components/calendar/lib/components/calendar-years/calendar-years.component.d.ts +6 -0
  61. package/components/calendar/lib/daterange.service.d.ts +16 -0
  62. package/components/calendar/lib/directives/calendar-cell.directive.d.ts +37 -9
  63. package/components/calendar/lib/directives/calendar-view.directive.d.ts +41 -9
  64. package/components/calendar/lib/pipes/date-label.pipe.d.ts +12 -21
  65. package/components/calendar/lib/services/calendar-month.service.d.ts +1 -0
  66. package/components/calendar/lib/services/calendar-year.service.d.ts +1 -0
  67. package/components/calendar/lib/services/calendar-years.service.d.ts +1 -0
  68. package/components/calendar/lib/utils/check-cell-in-range.d.ts +1 -0
  69. package/components/calendar/lib/utils/check-identical-date.d.ts +1 -0
  70. package/components/calendar/lib/utils/get-A11y-label.d.ts +2 -2
  71. package/components/calendar/lib/utils/is-date-disabled.d.ts +1 -0
  72. package/components/calendar/lib/utils/parse-date.d.ts +1 -0
  73. package/components/calendar/lib/utils/validate-daterange.d.ts +1 -0
  74. package/components/calendar/lib/utils/validate-max-date.d.ts +1 -0
  75. package/components/calendar/lib/utils/validate-min-date.d.ts +1 -0
  76. package/components/calendar/lib/utils/validate-next-date-set.d.ts +1 -0
  77. package/components/calendar/lib/utils/validate-previous-date-set.d.ts +1 -0
  78. package/components/checkbox/lib/checkbox.component.d.ts +32 -0
  79. package/components/checkbox/lib/checkbox.validator.d.ts +23 -0
  80. package/components/chip/lib/components/chip/chip.component.d.ts +14 -0
  81. package/components/chip/lib/components/chip-list/chip-list.component.d.ts +3 -0
  82. package/components/chip/lib/components/chip-list-row/chip-list-row.component.d.ts +3 -0
  83. package/components/circular-progress/lib/circular-progress.component.d.ts +20 -0
  84. package/components/content-box/lib/content-box.component.d.ts +3 -0
  85. package/components/content-box/lib/directives/content-box-footer.directive.d.ts +3 -0
  86. package/components/content-box/lib/directives/content-box-header.directive.d.ts +3 -0
  87. package/components/datepicker/lib/datepicker.component.d.ts +47 -0
  88. package/components/datepicker/lib/datepicker.config.d.ts +19 -0
  89. package/components/datepicker/lib/directives/datepicker-input-control.directive.d.ts +30 -0
  90. package/components/datepicker/lib/utils/get-datepicker-input-pattern.d.ts +2 -0
  91. package/components/datepicker/lib/utils/get-datepicker-input-value-as-date.d.ts +1 -0
  92. package/components/daterangepicker/lib/daterangepicker.component.d.ts +89 -0
  93. package/components/daterangepicker/lib/daterangepicker.config.d.ts +19 -0
  94. package/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.d.ts +30 -0
  95. package/components/daterangepicker/lib/range.validator.d.ts +15 -0
  96. package/components/daterangepicker/lib/required.validator.d.ts +6 -0
  97. package/components/daterangepicker/lib/utils/get-daterangepicker-input-pattern.d.ts +2 -0
  98. package/components/daterangepicker/lib/utils/get-daterangepicker-input-value-as-date.d.ts +1 -0
  99. package/components/dropdown/lib/dropdown.component.d.ts +16 -0
  100. package/components/dropdown/lib/dropdown.directive.d.ts +67 -0
  101. package/components/dropdown/lib/helpers/close-current-dropdown.d.ts +5 -0
  102. package/components/error-page/lib/error-page.component.d.ts +7 -0
  103. package/components/error-page/lib/error-page.config.d.ts +18 -0
  104. package/components/footer/lib/footer.component.d.ts +9 -6
  105. package/components/footer/lib/footer.config.d.ts +2 -0
  106. package/components/form-field/lib/components/form-field-info/form-field-info.component.d.ts +13 -0
  107. package/components/form-field/lib/components/form-group/form-group.component.d.ts +16 -0
  108. package/components/form-field/lib/directives/form-field-control.directive.d.ts +5 -0
  109. package/components/form-field/lib/directives/form-field-error.directive.d.ts +6 -0
  110. package/components/form-field/lib/directives/form-field-hint.directive.d.ts +3 -0
  111. package/components/form-field/lib/directives/form-field-label.directive.d.ts +3 -0
  112. package/components/form-field/lib/directives/form.directive.d.ts +13 -0
  113. package/components/form-field/lib/form-field.component.d.ts +20 -0
  114. package/components/form-field/lib/form-field.service.d.ts +42 -0
  115. package/components/form-field/lib/services/form-field-error.service.d.ts +24 -0
  116. package/components/header/lib/directives/header-avatar.directive.d.ts +4 -0
  117. package/components/header/lib/directives/header-title.directive.d.ts +3 -0
  118. package/components/header/lib/header.component.d.ts +3 -0
  119. package/components/header-navigation/lib/directives/header-navigation-link.directive.d.ts +3 -0
  120. package/components/header-navigation/lib/header-navigation.component.d.ts +6 -0
  121. package/components/icon/lib/helpers/unpack-icon-identifier.d.ts +14 -0
  122. package/components/icon/lib/icon.component.d.ts +24 -0
  123. package/components/icon/lib/icon.config.d.ts +26 -0
  124. package/components/inline-message/lib/inline-message.component.d.ts +13 -0
  125. package/components/link/link.directive.d.ts +3 -0
  126. package/components/list/lib/components/expandable-list-item/expandable-list-item.component.d.ts +6 -0
  127. package/components/list/lib/components/list-item/list-item.component.d.ts +17 -1
  128. package/components/list/lib/list.component.d.ts +5 -0
  129. package/components/loading-spinner/lib/loading-spinner.component.d.ts +8 -0
  130. package/components/loading-spinner/lib/loading-spinner.directive.d.ts +22 -0
  131. package/components/logo/logo.directive.d.ts +15 -0
  132. package/components/main-menu/lib/directives/main-menu-button.directive.d.ts +5 -1
  133. package/components/main-menu/lib/directives/main-menu-close.directive.d.ts +3 -0
  134. package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +16 -0
  135. package/components/main-menu/lib/helpers/create-main-menu-links.d.ts +1 -0
  136. package/components/main-menu/lib/main-menu.component.d.ts +42 -0
  137. package/components/main-menu/lib/main-menu.config.d.ts +31 -0
  138. package/components/main-menu/lib/main-menu.service.d.ts +28 -0
  139. package/components/mainfilter-group/lib/mainfilter-group.component.d.ts +4 -0
  140. package/components/menu/lib/directives/menu-item.directive.d.ts +6 -0
  141. package/components/menu/lib/menu.component.d.ts +13 -1
  142. package/components/menu/lib/menu.directive.d.ts +31 -0
  143. package/components/modal/lib/components/basic-modal/basic-modal.component.d.ts +14 -0
  144. package/components/modal/lib/components/modal-footer/modal-footer.component.d.ts +3 -0
  145. package/components/modal/lib/components/modal-header/modal-header.component.d.ts +9 -0
  146. package/components/modal/lib/components/modal-hero/modal-hero.component.d.ts +21 -0
  147. package/components/modal/lib/directives/modal-close.directive.d.ts +25 -1
  148. package/components/modal/lib/directives/modal-content.directive.d.ts +3 -0
  149. package/components/modal/lib/directives/modal-dismiss.directive.d.ts +18 -1
  150. package/components/modal/lib/helpers/inject-modal-ref.d.ts +21 -0
  151. package/components/modal/lib/helpers/provide-modal-ref.d.ts +9 -0
  152. package/components/modal/lib/modal.component.d.ts +25 -0
  153. package/components/modal/lib/modal.config.d.ts +33 -0
  154. package/components/modal/lib/modal.directive.d.ts +29 -0
  155. package/components/modal/lib/modal.service.d.ts +54 -0
  156. package/components/modal/lib/models/modal-ref.d.ts +34 -0
  157. package/components/navigation-back/lib/navigation-back.component.d.ts +3 -0
  158. package/components/notification/lib/components/notification-center/notification-center.component.d.ts +0 -2
  159. package/components/notification/lib/directives/notification-center.directive.d.ts +18 -4
  160. package/components/notification/lib/helpers/get-notifications-by-tag.d.ts +1 -0
  161. package/components/notification/lib/helpers/sort-notifications.d.ts +1 -0
  162. package/components/notification/lib/helpers/to-notification-collection.d.ts +1 -0
  163. package/components/notification/lib/models/notification-feature.d.ts +15 -0
  164. package/components/notification/lib/notification.config.d.ts +54 -0
  165. package/components/notification/lib/notification.logger.d.ts +1 -0
  166. package/components/notification/lib/notification.service.d.ts +55 -0
  167. package/components/notification/lib/notification.tokens.d.ts +3 -0
  168. package/components/notification/lib/services/notification-center.service.d.ts +9 -0
  169. package/components/paginator/lib/paginator.component.d.ts +89 -0
  170. package/components/paginator/lib/paginator.config.d.ts +24 -2
  171. package/components/progress/lib/progress.component.d.ts +15 -0
  172. package/components/radio-group/lib/radio-group.component.d.ts +11 -0
  173. package/components/rail-navigation/lib/components/rail-navigation-item/rail-navigation-item.component.d.ts +19 -0
  174. package/components/rail-navigation/lib/rail-navigation.component.d.ts +26 -0
  175. package/components/rich-list/lib/components/rich-list-content/rich-list-content.component.d.ts +4 -0
  176. package/components/rich-list/lib/components/rich-list-header/rich-list-header.component.d.ts +4 -0
  177. package/components/rich-list/lib/components/rich-list-item/rich-list-item.component.d.ts +9 -1
  178. package/components/rich-list/lib/rich-list.component.d.ts +9 -2
  179. package/components/select/lib/components/select-option/select-option.component.d.ts +39 -2
  180. package/components/select/lib/directives/select-input-control.directive.d.ts +11 -0
  181. package/components/select/lib/pipes/select-search-filter.pipe.d.ts +10 -0
  182. package/components/select/lib/select.component.d.ts +59 -0
  183. package/components/slider/lib/slider.directive.d.ts +19 -0
  184. package/components/spinbox/lib/spinbox.component.d.ts +16 -0
  185. package/components/switch/lib/switch.component.d.ts +10 -0
  186. package/components/switch/lib/switch.validator.d.ts +12 -0
  187. package/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.d.ts +28 -0
  188. package/components/tab-bar/lib/tab-bar.component.d.ts +69 -0
  189. package/components/table/lib/components/check-cell/check-cell.component.d.ts +18 -0
  190. package/components/table/lib/components/header-title/header-title.component.d.ts +33 -1
  191. package/components/table/lib/directives/table-cell.directive.d.ts +4 -0
  192. package/components/table/lib/directives/table-row.directive.d.ts +4 -0
  193. package/components/table/lib/table.component.d.ts +36 -0
  194. package/components/timepicker/lib/timepicker.component.d.ts +11 -2
  195. package/components/timepicker/lib/utils/generate-time-stamps.d.ts +2 -1
  196. package/components/timepicker/lib/utils/ngx-mask-helper.d.ts +2 -2
  197. package/components/toast/lib/toast.config.d.ts +26 -0
  198. package/components/toast/lib/toast.service.d.ts +35 -0
  199. package/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.d.ts +11 -0
  200. package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +12 -0
  201. package/components/tooltip/lib/tooltip.component.d.ts +20 -0
  202. package/components/tooltip/lib/tooltip.directive.d.ts +35 -0
  203. package/components/wizard/lib/components/wizard-step/wizard-step.component.d.ts +34 -0
  204. package/components/wizard/lib/wizard.component.d.ts +20 -0
  205. package/esm2022/animations/lib/expand.mjs +45 -1
  206. package/esm2022/animations/lib/fade.mjs +71 -1
  207. package/esm2022/animations/lib/slide.mjs +22 -1
  208. package/esm2022/animations/lib/wait-for-child-animations.mjs +39 -1
  209. package/esm2022/breakpoints/lib/breakpoints.config.mjs +39 -1
  210. package/esm2022/breakpoints/lib/breakpoints.service.mjs +44 -1
  211. package/esm2022/breakpoints/lib/directives/match-breakpoints.directive.mjs +37 -1
  212. package/esm2022/breakpoints/lib/helpers/configure-breakpoint.mjs +20 -1
  213. package/esm2022/cdk/a11y/lib/directives/interactive.directive.mjs +33 -1
  214. package/esm2022/cdk/a11y/lib/directives/list-focus-manager-option.directive.mjs +23 -1
  215. package/esm2022/cdk/a11y/lib/directives/list-focus-manager.directive.mjs +18 -1
  216. package/esm2022/cdk/active-indicator/lib/active-indicator.directive.mjs +64 -1
  217. package/esm2022/cdk/autocomplete-control/lib/autocomplete-control.mjs +39 -1
  218. package/esm2022/cdk/checkbox-control/lib/checkbox-control.directive.mjs +4 -1
  219. package/esm2022/cdk/connected-overlay/lib/connected-overlay.service.mjs +45 -1
  220. package/esm2022/cdk/connected-overlay/lib/helpers/compute-overlay-position.mjs +11 -1
  221. package/esm2022/cdk/connected-overlay/lib/models/connected-overlay-ref.mjs +50 -1
  222. package/esm2022/cdk/custom-form-control/lib/custom-form-control.mjs +109 -3
  223. package/esm2022/cdk/custom-form-control/lib/input-control.directive.mjs +76 -1
  224. package/esm2022/cdk/dynamic-view/lib/dynamic-view.directive.mjs +18 -1
  225. package/esm2022/cdk/dynamic-view/lib/dynamic-view.service.mjs +31 -1
  226. package/esm2022/cdk/dynamic-view/lib/helpers/create-projectable-nodes.mjs +23 -1
  227. package/esm2022/cdk/dynamic-view/lib/helpers/is-dynamic-text-content.mjs +23 -1
  228. package/esm2022/cdk/dynamic-view/lib/helpers/is-dynamic-view.mjs +23 -1
  229. package/esm2022/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +40 -1
  230. package/esm2022/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +37 -1
  231. package/esm2022/cdk/event-plugins/lib/event-plugins.config.mjs +36 -1
  232. package/esm2022/cdk/event-plugins/lib/models/event-plugin.mjs +45 -1
  233. package/esm2022/cdk/event-plugins/lib/plugins/debounce-event-plugin.mjs +33 -1
  234. package/esm2022/cdk/event-plugins/lib/plugins/defer-event-plugin.mjs +25 -1
  235. package/esm2022/cdk/expandable/lib/directives/expandable-container.directive.mjs +42 -1
  236. package/esm2022/cdk/expandable/lib/directives/expandable-item.directive.mjs +48 -1
  237. package/esm2022/cdk/option-control/lib/option-control.mjs +48 -1
  238. package/esm2022/cdk/radio-group-control/lib/radio-control.directive.mjs +9 -1
  239. package/esm2022/cdk/radio-group-control/lib/radio-group-control.directive.mjs +12 -1
  240. package/esm2022/components/accordion/lib/accordion.component.mjs +9 -1
  241. package/esm2022/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +31 -1
  242. package/esm2022/components/accordion/lib/directives/accordion-item-title.mjs +4 -1
  243. package/esm2022/components/action-group/action-group.component.mjs +7 -1
  244. package/esm2022/components/area-header/area-header.component.mjs +9 -1
  245. package/esm2022/components/area-header/directives/area-header-content.directive.mjs +4 -1
  246. package/esm2022/components/area-header/directives/area-header-subtitle.directive.mjs +4 -1
  247. package/esm2022/components/autocomplete/lib/autocomplete.component.mjs +18 -1
  248. package/esm2022/components/avatar/lib/avatar.component.mjs +9 -1
  249. package/esm2022/components/badge/lib/badge.component.mjs +11 -1
  250. package/esm2022/components/badge/lib/badge.directive.mjs +16 -1
  251. package/esm2022/components/bar/lib/bar.component.mjs +8 -1
  252. package/esm2022/components/bar/lib/directives/bar-button.directive.mjs +4 -1
  253. package/esm2022/components/bar/lib/directives/bar-label.directive.mjs +4 -1
  254. package/esm2022/components/breadcrumbs/lib/breadcrumbs.component.mjs +4 -1
  255. package/esm2022/components/button/lib/button.component.mjs +11 -1
  256. package/esm2022/components/button-group/lib/button-group.component.mjs +16 -1
  257. package/esm2022/components/calendar/lib/calendar.component.mjs +35 -1
  258. package/esm2022/components/calendar/lib/calendar.config.mjs +18 -12
  259. package/esm2022/components/calendar/lib/calendar.service.mjs +49 -1
  260. package/esm2022/components/calendar/lib/components/calendar-header/calendar-header.component.mjs +19 -1
  261. package/esm2022/components/calendar/lib/components/calendar-month/calendar-month.component.mjs +9 -3
  262. package/esm2022/components/calendar/lib/components/calendar-year/calendar-year.component.mjs +9 -3
  263. package/esm2022/components/calendar/lib/components/calendar-years/calendar-years.component.mjs +9 -3
  264. package/esm2022/components/calendar/lib/daterange.service.mjs +17 -1
  265. package/esm2022/components/calendar/lib/directives/calendar-cell.directive.mjs +27 -2
  266. package/esm2022/components/calendar/lib/directives/calendar-view.directive.mjs +39 -1
  267. package/esm2022/components/calendar/lib/pipes/date-label.pipe.mjs +27 -9
  268. package/esm2022/components/calendar/lib/services/calendar-month.service.mjs +2 -1
  269. package/esm2022/components/calendar/lib/services/calendar-year.service.mjs +2 -1
  270. package/esm2022/components/calendar/lib/services/calendar-years.service.mjs +2 -1
  271. package/esm2022/components/calendar/lib/utils/check-cell-in-range.mjs +2 -1
  272. package/esm2022/components/calendar/lib/utils/check-identical-date.mjs +2 -1
  273. package/esm2022/components/calendar/lib/utils/get-A11y-label.mjs +11 -8
  274. package/esm2022/components/calendar/lib/utils/is-date-disabled.mjs +2 -1
  275. package/esm2022/components/calendar/lib/utils/parse-date.mjs +2 -1
  276. package/esm2022/components/calendar/lib/utils/validate-daterange.mjs +2 -1
  277. package/esm2022/components/calendar/lib/utils/validate-max-date.mjs +2 -1
  278. package/esm2022/components/calendar/lib/utils/validate-min-date.mjs +2 -1
  279. package/esm2022/components/calendar/lib/utils/validate-next-date-set.mjs +2 -1
  280. package/esm2022/components/calendar/lib/utils/validate-previous-date-set.mjs +2 -1
  281. package/esm2022/components/checkbox/lib/checkbox.component.mjs +33 -1
  282. package/esm2022/components/checkbox/lib/checkbox.validator.mjs +24 -1
  283. package/esm2022/components/chip/lib/components/chip/chip.component.mjs +15 -1
  284. package/esm2022/components/chip/lib/components/chip-list/chip-list.component.mjs +4 -1
  285. package/esm2022/components/chip/lib/components/chip-list-row/chip-list-row.component.mjs +4 -1
  286. package/esm2022/components/circular-progress/lib/circular-progress.component.mjs +21 -1
  287. package/esm2022/components/content-box/lib/content-box.component.mjs +4 -1
  288. package/esm2022/components/content-box/lib/directives/content-box-footer.directive.mjs +4 -1
  289. package/esm2022/components/content-box/lib/directives/content-box-header.directive.mjs +4 -1
  290. package/esm2022/components/datepicker/lib/datepicker.component.mjs +33 -1
  291. package/esm2022/components/datepicker/lib/datepicker.config.mjs +20 -1
  292. package/esm2022/components/datepicker/lib/directives/datepicker-input-control.directive.mjs +31 -1
  293. package/esm2022/components/datepicker/lib/utils/get-datepicker-input-pattern.mjs +3 -1
  294. package/esm2022/components/datepicker/lib/utils/get-datepicker-input-value-as-date.mjs +2 -1
  295. package/esm2022/components/daterangepicker/lib/daterangepicker.component.mjs +65 -1
  296. package/esm2022/components/daterangepicker/lib/daterangepicker.config.mjs +20 -1
  297. package/esm2022/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.mjs +31 -1
  298. package/esm2022/components/daterangepicker/lib/range.validator.mjs +16 -1
  299. package/esm2022/components/daterangepicker/lib/required.validator.mjs +15 -1
  300. package/esm2022/components/daterangepicker/lib/utils/get-daterangepicker-input-pattern.mjs +3 -1
  301. package/esm2022/components/daterangepicker/lib/utils/get-daterangepicker-input-value-as-date.mjs +2 -1
  302. package/esm2022/components/dropdown/lib/dropdown.component.mjs +8 -1
  303. package/esm2022/components/dropdown/lib/dropdown.directive.mjs +55 -1
  304. package/esm2022/components/dropdown/lib/helpers/close-current-dropdown.mjs +6 -1
  305. package/esm2022/components/error-page/lib/error-page.component.mjs +8 -1
  306. package/esm2022/components/error-page/lib/error-page.config.mjs +9 -1
  307. package/esm2022/components/footer/lib/footer.component.mjs +10 -7
  308. package/esm2022/components/footer/lib/footer.config.mjs +3 -1
  309. package/esm2022/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +14 -1
  310. package/esm2022/components/form-field/lib/components/form-group/form-group.component.mjs +13 -1
  311. package/esm2022/components/form-field/lib/directives/form-field-control.directive.mjs +6 -1
  312. package/esm2022/components/form-field/lib/directives/form-field-error.directive.mjs +4 -1
  313. package/esm2022/components/form-field/lib/directives/form-field-hint.directive.mjs +4 -1
  314. package/esm2022/components/form-field/lib/directives/form-field-label.directive.mjs +4 -1
  315. package/esm2022/components/form-field/lib/directives/form.directive.mjs +14 -1
  316. package/esm2022/components/form-field/lib/form-field.component.mjs +14 -1
  317. package/esm2022/components/form-field/lib/form-field.service.mjs +43 -1
  318. package/esm2022/components/form-field/lib/services/form-field-error.service.mjs +25 -1
  319. package/esm2022/components/header/lib/directives/header-avatar.directive.mjs +5 -1
  320. package/esm2022/components/header/lib/directives/header-title.directive.mjs +4 -1
  321. package/esm2022/components/header/lib/header.component.mjs +4 -1
  322. package/esm2022/components/header-navigation/lib/directives/header-navigation-link.directive.mjs +4 -1
  323. package/esm2022/components/header-navigation/lib/header-navigation.component.mjs +4 -1
  324. package/esm2022/components/icon/lib/helpers/unpack-icon-identifier.mjs +15 -1
  325. package/esm2022/components/icon/lib/icon.component.mjs +25 -1
  326. package/esm2022/components/icon/lib/icon.config.mjs +20 -1
  327. package/esm2022/components/inline-message/lib/inline-message.component.mjs +14 -1
  328. package/esm2022/components/link/link.directive.mjs +4 -1
  329. package/esm2022/components/list/lib/components/expandable-list-item/expandable-list-item.component.mjs +7 -1
  330. package/esm2022/components/list/lib/components/list-item/list-item.component.mjs +18 -2
  331. package/esm2022/components/list/lib/list.component.mjs +6 -1
  332. package/esm2022/components/loading-spinner/lib/loading-spinner.component.mjs +10 -2
  333. package/esm2022/components/loading-spinner/lib/loading-spinner.directive.mjs +23 -1
  334. package/esm2022/components/logo/logo.directive.mjs +16 -1
  335. package/esm2022/components/main-menu/lib/directives/main-menu-button.directive.mjs +5 -1
  336. package/esm2022/components/main-menu/lib/directives/main-menu-close.directive.mjs +4 -1
  337. package/esm2022/components/main-menu/lib/directives/main-menu-item.directive.mjs +17 -1
  338. package/esm2022/components/main-menu/lib/helpers/create-main-menu-links.mjs +2 -1
  339. package/esm2022/components/main-menu/lib/main-menu.component.mjs +37 -1
  340. package/esm2022/components/main-menu/lib/main-menu.config.mjs +32 -1
  341. package/esm2022/components/main-menu/lib/main-menu.service.mjs +29 -1
  342. package/esm2022/components/mainfilter-group/lib/mainfilter-group.component.mjs +5 -1
  343. package/esm2022/components/menu/lib/directives/menu-item.directive.mjs +7 -1
  344. package/esm2022/components/menu/lib/menu.component.mjs +13 -1
  345. package/esm2022/components/menu/lib/menu.directive.mjs +19 -1
  346. package/esm2022/components/modal/lib/components/basic-modal/basic-modal.component.mjs +15 -1
  347. package/esm2022/components/modal/lib/components/modal-footer/modal-footer.component.mjs +4 -1
  348. package/esm2022/components/modal/lib/components/modal-header/modal-header.component.mjs +4 -1
  349. package/esm2022/components/modal/lib/components/modal-hero/modal-hero.component.mjs +12 -1
  350. package/esm2022/components/modal/lib/directives/modal-close.directive.mjs +25 -1
  351. package/esm2022/components/modal/lib/directives/modal-content.directive.mjs +4 -1
  352. package/esm2022/components/modal/lib/directives/modal-dismiss.directive.mjs +18 -1
  353. package/esm2022/components/modal/lib/helpers/inject-modal-ref.mjs +22 -1
  354. package/esm2022/components/modal/lib/helpers/provide-modal-ref.mjs +10 -1
  355. package/esm2022/components/modal/lib/modal.component.mjs +21 -2
  356. package/esm2022/components/modal/lib/modal.config.mjs +34 -1
  357. package/esm2022/components/modal/lib/modal.directive.mjs +25 -1
  358. package/esm2022/components/modal/lib/modal.service.mjs +39 -1
  359. package/esm2022/components/modal/lib/models/modal-ref.mjs +34 -1
  360. package/esm2022/components/navigation-back/lib/navigation-back.component.mjs +4 -1
  361. package/esm2022/components/notification/lib/components/notification-center/notification-center.component.mjs +1 -3
  362. package/esm2022/components/notification/lib/directives/notification-center.directive.mjs +19 -5
  363. package/esm2022/components/notification/lib/helpers/get-notifications-by-tag.mjs +2 -1
  364. package/esm2022/components/notification/lib/helpers/sort-notifications.mjs +2 -1
  365. package/esm2022/components/notification/lib/helpers/to-notification-collection.mjs +2 -1
  366. package/esm2022/components/notification/lib/models/notification-feature.mjs +16 -1
  367. package/esm2022/components/notification/lib/notification.config.mjs +45 -1
  368. package/esm2022/components/notification/lib/notification.logger.mjs +2 -1
  369. package/esm2022/components/notification/lib/notification.service.mjs +56 -1
  370. package/esm2022/components/notification/lib/notification.tokens.mjs +4 -1
  371. package/esm2022/components/notification/lib/services/notification-center.service.mjs +10 -1
  372. package/esm2022/components/paginator/lib/paginator.component.mjs +90 -1
  373. package/esm2022/components/paginator/lib/paginator.config.mjs +29 -1
  374. package/esm2022/components/progress/lib/progress.component.mjs +16 -1
  375. package/esm2022/components/radio-group/lib/radio-group.component.mjs +13 -2
  376. package/esm2022/components/rail-navigation/lib/components/rail-navigation-item/rail-navigation-item.component.mjs +17 -1
  377. package/esm2022/components/rail-navigation/lib/rail-navigation.component.mjs +27 -1
  378. package/esm2022/components/rich-list/lib/components/rich-list-content/rich-list-content.component.mjs +5 -1
  379. package/esm2022/components/rich-list/lib/components/rich-list-header/rich-list-header.component.mjs +5 -1
  380. package/esm2022/components/rich-list/lib/components/rich-list-item/rich-list-item.component.mjs +10 -2
  381. package/esm2022/components/rich-list/lib/rich-list.component.mjs +10 -3
  382. package/esm2022/components/select/lib/components/select-option/select-option.component.mjs +47 -6
  383. package/esm2022/components/select/lib/directives/select-input-control.directive.mjs +12 -2
  384. package/esm2022/components/select/lib/pipes/select-search-filter.pipe.mjs +11 -1
  385. package/esm2022/components/select/lib/select.component.mjs +56 -2
  386. package/esm2022/components/slider/lib/slider.directive.mjs +20 -1
  387. package/esm2022/components/spinbox/lib/spinbox.component.mjs +17 -1
  388. package/esm2022/components/switch/lib/switch.component.mjs +11 -1
  389. package/esm2022/components/switch/lib/switch.validator.mjs +13 -1
  390. package/esm2022/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.mjs +29 -1
  391. package/esm2022/components/tab-bar/lib/tab-bar.component.mjs +70 -1
  392. package/esm2022/components/table/lib/components/check-cell/check-cell.component.mjs +19 -1
  393. package/esm2022/components/table/lib/components/header-title/header-title.component.mjs +30 -2
  394. package/esm2022/components/table/lib/directives/table-cell.directive.mjs +5 -1
  395. package/esm2022/components/table/lib/directives/table-row.directive.mjs +5 -1
  396. package/esm2022/components/table/lib/table.component.mjs +30 -1
  397. package/esm2022/components/timepicker/lib/timepicker.component.mjs +15 -6
  398. package/esm2022/components/timepicker/lib/utils/generate-time-stamps.mjs +5 -3
  399. package/esm2022/components/timepicker/lib/utils/ngx-mask-helper.mjs +3 -3
  400. package/esm2022/components/toast/lib/toast.config.mjs +27 -1
  401. package/esm2022/components/toast/lib/toast.service.mjs +36 -1
  402. package/esm2022/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +12 -1
  403. package/esm2022/components/toggle-button-group/lib/toggle-button-group.component.mjs +14 -2
  404. package/esm2022/components/tooltip/lib/tooltip.component.mjs +18 -1
  405. package/esm2022/components/tooltip/lib/tooltip.directive.mjs +36 -1
  406. package/esm2022/components/wizard/lib/components/wizard-step/wizard-step.component.mjs +35 -1
  407. package/esm2022/components/wizard/lib/wizard.component.mjs +21 -1
  408. package/esm2022/internal/lib/helpers/fast-equals.mjs +3 -0
  409. package/esm2022/internal/lib/helpers/index.mjs +2 -1
  410. package/esm2022/internal/translate/lib/translate.config.mjs +32 -1
  411. package/esm2022/internal/translate/lib/translate.service.mjs +30 -1
  412. package/esm2022/lib/controllers/controller.mjs +26 -1
  413. package/esm2022/lib/controllers/disabled.controller.mjs +60 -1
  414. package/esm2022/lib/controllers/readonly.controller.mjs +57 -1
  415. package/esm2022/lib/directives/click-outside.directive.mjs +30 -1
  416. package/esm2022/lib/directives/delegate-focus.directive.mjs +15 -1
  417. package/esm2022/lib/services/window-ref.mjs +67 -1
  418. package/esm2022/lib/tokens/identity-matcher.mjs +25 -1
  419. package/esm2022/lib/tokens/string-search-handler.mjs +25 -1
  420. package/esm2022/lib/tokens/stringify.mjs +26 -1
  421. package/esm2022/localization/lib/features/with-http-language-header.mjs +54 -1
  422. package/esm2022/localization/lib/features/with-http-language-query-param.mjs +52 -1
  423. package/esm2022/localization/lib/loaders/browser-language-loader.mjs +33 -1
  424. package/esm2022/localization/lib/localization.config.mjs +73 -5
  425. package/esm2022/localization/lib/localization.logger.mjs +3 -0
  426. package/esm2022/localization/lib/localization.service.mjs +59 -29
  427. package/esm2022/rxjs/index.mjs +2 -2
  428. package/esm2022/rxjs/lib/delay-until.mjs +23 -1
  429. package/esm2022/rxjs/lib/from-element-mutation.mjs +22 -1
  430. package/esm2022/rxjs/lib/from-element-resize.mjs +25 -1
  431. package/esm2022/rxjs/lib/from-events.mjs +25 -1
  432. package/esm2022/rxjs/lib/from-query-list.mjs +24 -0
  433. package/esm2022/sdk/lib/application-environment.mjs +51 -1
  434. package/esm2022/theming/lib/helpers/prefers-dark-theme.mjs +19 -1
  435. package/esm2022/theming/lib/helpers/resolve-theme.mjs +26 -1
  436. package/esm2022/theming/lib/helpers/theme-storage.mjs +43 -1
  437. package/esm2022/theming/lib/theming.config.mjs +34 -1
  438. package/esm2022/theming/lib/theming.service.mjs +32 -1
  439. package/esm2022/utils/lib/decorators/pure.mjs +52 -1
  440. package/esm2022/utils/lib/helpers/angular.mjs +37 -1
  441. package/esm2022/utils/lib/helpers/array.mjs +5 -1
  442. package/esm2022/utils/lib/helpers/build-url.mjs +21 -1
  443. package/esm2022/utils/lib/helpers/build-website-url.mjs +3 -2
  444. package/esm2022/utils/lib/helpers/cache-storage-client.mjs +52 -1
  445. package/esm2022/utils/lib/helpers/coercion.mjs +18 -1
  446. package/esm2022/utils/lib/helpers/debounce.mjs +28 -1
  447. package/esm2022/utils/lib/helpers/defer-fn.mjs +21 -1
  448. package/esm2022/utils/lib/helpers/dom.mjs +71 -1
  449. package/esm2022/utils/lib/helpers/get-axis.mjs +21 -1
  450. package/esm2022/utils/lib/helpers/get-language-code.mjs +18 -1
  451. package/esm2022/utils/lib/helpers/get-opposite-side.mjs +22 -1
  452. package/esm2022/utils/lib/helpers/get-side.mjs +18 -1
  453. package/esm2022/utils/lib/helpers/get-unique-id.mjs +34 -1
  454. package/esm2022/utils/lib/helpers/match-url.mjs +41 -1
  455. package/esm2022/utils/lib/helpers/ng-changes.mjs +30 -1
  456. package/esm2022/utils/lib/helpers/provide-config.mjs +57 -1
  457. package/esm2022/utils/lib/helpers/queue.mjs +84 -1
  458. package/esm2022/utils/lib/helpers/type-guards.mjs +58 -1
  459. package/esm2022/utils/lib/helpers/until-destroyed.mjs +39 -1
  460. package/fesm2022/odx-angular-animations.mjs +173 -0
  461. package/fesm2022/odx-angular-animations.mjs.map +1 -1
  462. package/fesm2022/odx-angular-breakpoints.mjs +136 -0
  463. package/fesm2022/odx-angular-breakpoints.mjs.map +1 -1
  464. package/fesm2022/odx-angular-cdk-a11y.mjs +71 -0
  465. package/fesm2022/odx-angular-cdk-a11y.mjs.map +1 -1
  466. package/fesm2022/odx-angular-cdk-active-indicator.mjs +63 -0
  467. package/fesm2022/odx-angular-cdk-active-indicator.mjs.map +1 -1
  468. package/fesm2022/odx-angular-cdk-autocomplete-control.mjs +38 -0
  469. package/fesm2022/odx-angular-cdk-autocomplete-control.mjs.map +1 -1
  470. package/fesm2022/odx-angular-cdk-checkbox-control.mjs +3 -0
  471. package/fesm2022/odx-angular-cdk-checkbox-control.mjs.map +1 -1
  472. package/fesm2022/odx-angular-cdk-connected-overlay.mjs +103 -0
  473. package/fesm2022/odx-angular-cdk-connected-overlay.mjs.map +1 -1
  474. package/fesm2022/odx-angular-cdk-custom-form-control.mjs +183 -2
  475. package/fesm2022/odx-angular-cdk-custom-form-control.mjs.map +1 -1
  476. package/fesm2022/odx-angular-cdk-dynamic-view.mjs +188 -0
  477. package/fesm2022/odx-angular-cdk-dynamic-view.mjs.map +1 -1
  478. package/fesm2022/odx-angular-cdk-event-plugins.mjs +135 -0
  479. package/fesm2022/odx-angular-cdk-event-plugins.mjs.map +1 -1
  480. package/fesm2022/odx-angular-cdk-expandable.mjs +88 -0
  481. package/fesm2022/odx-angular-cdk-expandable.mjs.map +1 -1
  482. package/fesm2022/odx-angular-cdk-option-control.mjs +47 -0
  483. package/fesm2022/odx-angular-cdk-option-control.mjs.map +1 -1
  484. package/fesm2022/odx-angular-cdk-radio-group-control.mjs +19 -0
  485. package/fesm2022/odx-angular-cdk-radio-group-control.mjs.map +1 -1
  486. package/fesm2022/odx-angular-components-accordion.mjs +41 -0
  487. package/fesm2022/odx-angular-components-accordion.mjs.map +1 -1
  488. package/fesm2022/odx-angular-components-action-group.mjs +6 -0
  489. package/fesm2022/odx-angular-components-action-group.mjs.map +1 -1
  490. package/fesm2022/odx-angular-components-area-header.mjs +14 -0
  491. package/fesm2022/odx-angular-components-area-header.mjs.map +1 -1
  492. package/fesm2022/odx-angular-components-autocomplete.mjs +17 -0
  493. package/fesm2022/odx-angular-components-autocomplete.mjs.map +1 -1
  494. package/fesm2022/odx-angular-components-avatar.mjs +8 -0
  495. package/fesm2022/odx-angular-components-avatar.mjs.map +1 -1
  496. package/fesm2022/odx-angular-components-badge.mjs +25 -0
  497. package/fesm2022/odx-angular-components-badge.mjs.map +1 -1
  498. package/fesm2022/odx-angular-components-bar.mjs +13 -0
  499. package/fesm2022/odx-angular-components-bar.mjs.map +1 -1
  500. package/fesm2022/odx-angular-components-breadcrumbs.mjs +3 -0
  501. package/fesm2022/odx-angular-components-breadcrumbs.mjs.map +1 -1
  502. package/fesm2022/odx-angular-components-button-group.mjs +15 -0
  503. package/fesm2022/odx-angular-components-button-group.mjs.map +1 -1
  504. package/fesm2022/odx-angular-components-button.mjs +10 -0
  505. package/fesm2022/odx-angular-components-button.mjs.map +1 -1
  506. package/fesm2022/odx-angular-components-calendar.mjs +270 -33
  507. package/fesm2022/odx-angular-components-calendar.mjs.map +1 -1
  508. package/fesm2022/odx-angular-components-checkbox.mjs +55 -0
  509. package/fesm2022/odx-angular-components-checkbox.mjs.map +1 -1
  510. package/fesm2022/odx-angular-components-chip.mjs +20 -0
  511. package/fesm2022/odx-angular-components-chip.mjs.map +1 -1
  512. package/fesm2022/odx-angular-components-circular-progress.mjs +20 -0
  513. package/fesm2022/odx-angular-components-circular-progress.mjs.map +1 -1
  514. package/fesm2022/odx-angular-components-content-box.mjs +9 -0
  515. package/fesm2022/odx-angular-components-content-box.mjs.map +1 -1
  516. package/fesm2022/odx-angular-components-datepicker.mjs +84 -0
  517. package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
  518. package/fesm2022/odx-angular-components-daterangepicker.mjs +145 -0
  519. package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -1
  520. package/fesm2022/odx-angular-components-dropdown.mjs +66 -0
  521. package/fesm2022/odx-angular-components-dropdown.mjs.map +1 -1
  522. package/fesm2022/odx-angular-components-error-page.mjs +15 -0
  523. package/fesm2022/odx-angular-components-error-page.mjs.map +1 -1
  524. package/fesm2022/odx-angular-components-footer.mjs +11 -6
  525. package/fesm2022/odx-angular-components-footer.mjs.map +1 -1
  526. package/fesm2022/odx-angular-components-form-field.mjs +131 -0
  527. package/fesm2022/odx-angular-components-form-field.mjs.map +1 -1
  528. package/fesm2022/odx-angular-components-header-navigation.mjs +6 -0
  529. package/fesm2022/odx-angular-components-header-navigation.mjs.map +1 -1
  530. package/fesm2022/odx-angular-components-header.mjs +10 -0
  531. package/fesm2022/odx-angular-components-header.mjs.map +1 -1
  532. package/fesm2022/odx-angular-components-icon.mjs +57 -0
  533. package/fesm2022/odx-angular-components-icon.mjs.map +1 -1
  534. package/fesm2022/odx-angular-components-inline-message.mjs +13 -0
  535. package/fesm2022/odx-angular-components-inline-message.mjs.map +1 -1
  536. package/fesm2022/odx-angular-components-link.mjs +3 -0
  537. package/fesm2022/odx-angular-components-link.mjs.map +1 -1
  538. package/fesm2022/odx-angular-components-list.mjs +28 -1
  539. package/fesm2022/odx-angular-components-list.mjs.map +1 -1
  540. package/fesm2022/odx-angular-components-loading-spinner.mjs +30 -0
  541. package/fesm2022/odx-angular-components-loading-spinner.mjs.map +1 -1
  542. package/fesm2022/odx-angular-components-logo.mjs +15 -0
  543. package/fesm2022/odx-angular-components-logo.mjs.map +1 -1
  544. package/fesm2022/odx-angular-components-main-menu.mjs +119 -0
  545. package/fesm2022/odx-angular-components-main-menu.mjs.map +1 -1
  546. package/fesm2022/odx-angular-components-mainfilter-group.mjs +4 -0
  547. package/fesm2022/odx-angular-components-mainfilter-group.mjs.map +1 -1
  548. package/fesm2022/odx-angular-components-menu.mjs +36 -0
  549. package/fesm2022/odx-angular-components-menu.mjs.map +1 -1
  550. package/fesm2022/odx-angular-components-modal.mjs +252 -0
  551. package/fesm2022/odx-angular-components-modal.mjs.map +1 -1
  552. package/fesm2022/odx-angular-components-navigation-back.mjs +3 -0
  553. package/fesm2022/odx-angular-components-navigation-back.mjs.map +1 -1
  554. package/fesm2022/odx-angular-components-notification.mjs +148 -6
  555. package/fesm2022/odx-angular-components-notification.mjs.map +1 -1
  556. package/fesm2022/odx-angular-components-paginator.mjs +117 -0
  557. package/fesm2022/odx-angular-components-paginator.mjs.map +1 -1
  558. package/fesm2022/odx-angular-components-progress.mjs +15 -0
  559. package/fesm2022/odx-angular-components-progress.mjs.map +1 -1
  560. package/fesm2022/odx-angular-components-radio-group.mjs +11 -0
  561. package/fesm2022/odx-angular-components-radio-group.mjs.map +1 -1
  562. package/fesm2022/odx-angular-components-rail-navigation.mjs +42 -0
  563. package/fesm2022/odx-angular-components-rail-navigation.mjs.map +1 -1
  564. package/fesm2022/odx-angular-components-rich-list.mjs +26 -3
  565. package/fesm2022/odx-angular-components-rich-list.mjs.map +1 -1
  566. package/fesm2022/odx-angular-components-select.mjs +122 -7
  567. package/fesm2022/odx-angular-components-select.mjs.map +1 -1
  568. package/fesm2022/odx-angular-components-slider.mjs +19 -0
  569. package/fesm2022/odx-angular-components-slider.mjs.map +1 -1
  570. package/fesm2022/odx-angular-components-spinbox.mjs +16 -0
  571. package/fesm2022/odx-angular-components-spinbox.mjs.map +1 -1
  572. package/fesm2022/odx-angular-components-switch.mjs +22 -0
  573. package/fesm2022/odx-angular-components-switch.mjs.map +1 -1
  574. package/fesm2022/odx-angular-components-tab-bar.mjs +97 -0
  575. package/fesm2022/odx-angular-components-tab-bar.mjs.map +1 -1
  576. package/fesm2022/odx-angular-components-table.mjs +84 -1
  577. package/fesm2022/odx-angular-components-table.mjs.map +1 -1
  578. package/fesm2022/odx-angular-components-timepicker.mjs +20 -9
  579. package/fesm2022/odx-angular-components-timepicker.mjs.map +1 -1
  580. package/fesm2022/odx-angular-components-toast.mjs +61 -0
  581. package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
  582. package/fesm2022/odx-angular-components-toggle-button-group.mjs +23 -0
  583. package/fesm2022/odx-angular-components-toggle-button-group.mjs.map +1 -1
  584. package/fesm2022/odx-angular-components-tooltip.mjs +52 -0
  585. package/fesm2022/odx-angular-components-tooltip.mjs.map +1 -1
  586. package/fesm2022/odx-angular-components-wizard.mjs +54 -0
  587. package/fesm2022/odx-angular-components-wizard.mjs.map +1 -1
  588. package/fesm2022/odx-angular-internal-translate.mjs +60 -0
  589. package/fesm2022/odx-angular-internal-translate.mjs.map +1 -1
  590. package/fesm2022/odx-angular-internal.mjs +4 -1
  591. package/fesm2022/odx-angular-internal.mjs.map +1 -1
  592. package/fesm2022/odx-angular-localization.mjs +269 -32
  593. package/fesm2022/odx-angular-localization.mjs.map +1 -1
  594. package/fesm2022/odx-angular-rxjs.mjs +115 -5
  595. package/fesm2022/odx-angular-rxjs.mjs.map +1 -1
  596. package/fesm2022/odx-angular-sdk.mjs +50 -0
  597. package/fesm2022/odx-angular-sdk.mjs.map +1 -1
  598. package/fesm2022/odx-angular-theming.mjs +149 -0
  599. package/fesm2022/odx-angular-theming.mjs.map +1 -1
  600. package/fesm2022/odx-angular-utils.mjs +709 -1
  601. package/fesm2022/odx-angular-utils.mjs.map +1 -1
  602. package/fesm2022/odx-angular.mjs +322 -0
  603. package/fesm2022/odx-angular.mjs.map +1 -1
  604. package/internal/lib/helpers/fast-equals.d.ts +1 -0
  605. package/internal/lib/helpers/index.d.ts +1 -0
  606. package/internal/translate/lib/translate.config.d.ts +31 -0
  607. package/internal/translate/lib/translate.service.d.ts +29 -0
  608. package/lib/controllers/controller.d.ts +25 -0
  609. package/lib/controllers/disabled.controller.d.ts +59 -0
  610. package/lib/controllers/readonly.controller.d.ts +56 -0
  611. package/lib/directives/click-outside.directive.d.ts +29 -0
  612. package/lib/directives/delegate-focus.directive.d.ts +14 -0
  613. package/lib/services/window-ref.d.ts +66 -0
  614. package/lib/tokens/identity-matcher.d.ts +41 -0
  615. package/lib/tokens/string-search-handler.d.ts +39 -0
  616. package/lib/tokens/stringify.d.ts +42 -0
  617. package/localization/lib/features/with-http-language-header.d.ts +63 -0
  618. package/localization/lib/features/with-http-language-query-param.d.ts +61 -0
  619. package/localization/lib/loaders/browser-language-loader.d.ts +32 -0
  620. package/localization/lib/localization.config.d.ts +81 -2
  621. package/localization/lib/localization.logger.d.ts +3 -0
  622. package/localization/lib/localization.service.d.ts +42 -7
  623. package/package.json +8 -7
  624. package/rxjs/index.d.ts +1 -1
  625. package/rxjs/lib/delay-until.d.ts +22 -0
  626. package/rxjs/lib/from-element-mutation.d.ts +21 -0
  627. package/rxjs/lib/from-element-resize.d.ts +24 -0
  628. package/rxjs/lib/from-events.d.ts +24 -0
  629. package/rxjs/lib/from-query-list.d.ts +22 -0
  630. package/sdk/lib/application-environment.d.ts +59 -0
  631. package/theming/lib/helpers/prefers-dark-theme.d.ts +18 -0
  632. package/theming/lib/helpers/resolve-theme.d.ts +25 -0
  633. package/theming/lib/helpers/theme-storage.d.ts +42 -0
  634. package/theming/lib/theming.config.d.ts +46 -0
  635. package/theming/lib/theming.service.d.ts +31 -0
  636. package/utils/lib/decorators/pure.d.ts +51 -0
  637. package/utils/lib/helpers/angular.d.ts +36 -0
  638. package/utils/lib/helpers/array.d.ts +4 -0
  639. package/utils/lib/helpers/build-url.d.ts +20 -0
  640. package/utils/lib/helpers/build-website-url.d.ts +2 -1
  641. package/utils/lib/helpers/cache-storage-client.d.ts +51 -0
  642. package/utils/lib/helpers/coercion.d.ts +17 -0
  643. package/utils/lib/helpers/debounce.d.ts +27 -0
  644. package/utils/lib/helpers/defer-fn.d.ts +20 -0
  645. package/utils/lib/helpers/dom.d.ts +70 -0
  646. package/utils/lib/helpers/get-axis.d.ts +20 -0
  647. package/utils/lib/helpers/get-language-code.d.ts +17 -0
  648. package/utils/lib/helpers/get-opposite-side.d.ts +21 -0
  649. package/utils/lib/helpers/get-side.d.ts +17 -0
  650. package/utils/lib/helpers/get-unique-id.d.ts +33 -0
  651. package/utils/lib/helpers/match-url.d.ts +40 -0
  652. package/utils/lib/helpers/ng-changes.d.ts +52 -0
  653. package/utils/lib/helpers/provide-config.d.ts +56 -0
  654. package/utils/lib/helpers/queue.d.ts +83 -0
  655. package/utils/lib/helpers/type-guards.d.ts +57 -0
  656. package/utils/lib/helpers/until-destroyed.d.ts +38 -0
  657. package/esm2022/rxjs/lib/form-query-list.mjs +0 -5
  658. package/rxjs/lib/form-query-list.d.ts +0 -3
@@ -1,16 +1,85 @@
1
1
  import { provideHttpClient, withInterceptors } from '@angular/common/http';
2
2
  import * as i0 from '@angular/core';
3
3
  import { makeEnvironmentProviders, APP_INITIALIZER, inject, Injector, runInInjectionContext, Injectable } from '@angular/core';
4
- import { getLanguageCode, createConfigTokens, matchUrl } from '@odx/angular/utils';
5
- import { BehaviorSubject, filter, distinctUntilChanged, shareReplay, firstValueFrom, isObservable, from, of, take, switchMap } from 'rxjs';
4
+ import { createConfigTokens, matchUrl } from '@odx/angular/utils';
5
+ import { BehaviorSubject, filter, map, distinctUntilChanged, shareReplay, firstValueFrom, isObservable, from, of, take, switchMap } from 'rxjs';
6
+ import { Logger } from '@odx/angular/internal';
6
7
  import { WindowRef } from '@odx/angular';
7
8
 
8
- const DEFAULT_AVAILABLE_LOCALES = ['en-US', 'en-GB', 'de-DE', 'es-ES', 'fr-FR', 'fr-CA'];
9
- const DEFAULT_AVAILABLE_LANGUAGES = Array.from(new Set(DEFAULT_AVAILABLE_LOCALES.map(getLanguageCode)));
9
+ const DEFAULT_AVAILABLE_LANGUAGES = ['en-US', 'en-GB', 'en', 'de-DE', 'de', 'es-ES', 'es', 'fr-FR', 'fr-CA', 'fr'];
10
+ /**
11
+ * Utilizes `createConfigTokens` to generate configuration tokens and related utilities for the
12
+ * localization settings within the application. It defines a structured and type-safe approach
13
+ * for managing localization configurations, such as available languages, and potentially
14
+ * a dynamic loader for the active language. The generated tokens and utilities facilitate accessing
15
+ * and providing these configurations throughout the application.
16
+ *
17
+ * @const {InjectionToken<LocalizationConfig>} LocalizationConfig - An InjectionToken for accessing
18
+ * the localization configuration within Angular's dependency injection framework. Use this token to inject
19
+ * localization configurations into services, components, or other tokens.
20
+ *
21
+ * @const {LocalizationConfig} LocalizationDefaultConfig - The default configuration values for localization,
22
+ * based on the provided settings. Includes the default available languages.
23
+ *
24
+ * @const {Function} injectLocalizationConfig - A utility function that returns the injected value of
25
+ * `LocalizationConfig` token. Use this function to access the current localization configuration in
26
+ * a type-safe manner.
27
+ *
28
+ * @const {Function} provideLocalizationConfig - A utility function to provide the `LocalizationConfig` token
29
+ * with specific values. Use this function to configure and override default localization settings within
30
+ * an Angular module or component.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * // Providing localization settings in an Angular module
35
+ * @NgModule({
36
+ * providers: [
37
+ * provideLocalizationConfig({
38
+ * availableLanguages: ['en', 'es', 'fr'],
39
+ * })
40
+ * ]
41
+ * })
42
+ * export class AppModule { }
43
+ *
44
+ * // Injecting and using the localization configuration in a service
45
+ * @Injectable({ providedIn: 'root' })
46
+ * export class MyLocalizationService {
47
+ * constructor(@Inject(LocalizationConfig) private config: LocalizationConfig) {
48
+ * console.log('Available languages:', config.availableLanguages);
49
+ * }
50
+ * }
51
+ * ```
52
+ */
10
53
  const { LocalizationConfig, LocalizationDefaultConfig, injectLocalizationConfig, provideLocalizationConfig } = createConfigTokens('Localization', '@odx/angular/internal/translate', {
11
54
  availableLanguages: DEFAULT_AVAILABLE_LANGUAGES,
12
- availableLocales: DEFAULT_AVAILABLE_LOCALES,
13
55
  });
56
+ /**
57
+ * Sets up the localization configuration for the application and initializes the localization
58
+ * system with the provided configuration and features. This function is typically called
59
+ * within the main module or a core module of the application to ensure localization settings
60
+ * are available and active as early as possible.
61
+ *
62
+ * @param {Partial<LocalizationConfig>} config The localization configuration settings, including
63
+ * available languages and optionally, a custom loader for the active language.
64
+ * @param {...LocalizationFeature[]} features Additional localization features or configurations
65
+ * to be registered as part of the application's environment providers.
66
+ * @returns {EnvironmentProviders} A collection of providers for setting up the application's
67
+ * localization environment, to be used with Angular's environment-specific injector configuration.
68
+ * @example
69
+ * ```ts
70
+ * // Example of providing localization settings in an Angular module
71
+ * @NgModule({
72
+ * imports: [...],
73
+ * providers: [
74
+ * provideLocalization({
75
+ * availableLanguages: ['en', 'es', 'fr'],
76
+ * activeLanguageLoader: () => fetch('/api/user/language').then(res => res.text()),
77
+ * }),
78
+ * ],
79
+ * })
80
+ * export class AppModule {}
81
+ * ```
82
+ */
14
83
  function provideLocalization(config, ...features) {
15
84
  return makeEnvironmentProviders([
16
85
  provideLocalizationConfig(config),
@@ -24,49 +93,81 @@ function provideLocalization(config, ...features) {
24
93
  ]);
25
94
  }
26
95
 
96
+ var logger = new Logger('@odx/angular/localization');
97
+
27
98
  class LocalizationService {
28
99
  constructor() {
29
- this.injector = inject(Injector);
30
100
  this.localizationConfig = injectLocalizationConfig();
31
- this.activeLanguage$$ = new BehaviorSubject(undefined);
32
- this.activeLocale$$ = new BehaviorSubject(undefined);
33
- this.activeLanguage$ = this.activeLanguage$$.pipe(filter(Boolean), distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));
101
+ this.injector = inject(Injector);
102
+ this.localeState$ = new BehaviorSubject(new Intl.Locale(this.localizationConfig.availableLanguages[0]));
103
+ /**
104
+ * Represents an observable stream of the active language in the localization service.
105
+ * The active language is determined by the locale state.
106
+ *
107
+ * @emits {string} The active language.
108
+ */
109
+ this.activeLanguage$ = this.localeState$.pipe(filter(Boolean), map((x) => x.baseName), distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));
110
+ /**
111
+ * Gets the list of available languages for localization.
112
+ *
113
+ * @type {string[]} The list of available languages.
114
+ */
34
115
  this.availableLanguages = this.localizationConfig.availableLanguages;
116
+ /** Default language derived from the first entry in the available languages list.
117
+ *
118
+ * @type {string}
119
+ */
35
120
  this.defaultLanguage = this.availableLanguages[0];
36
- this.availableLocales = this.localizationConfig.availableLocales;
37
- this.defaultLocale = this.availableLocales[0];
38
121
  }
122
+ /**
123
+ * Retrieves the currently active language. Falls back to the default language if
124
+ * no active language is set.
125
+ *
126
+ * @returns {string} Full locale name e.g. 'en-US' or just 'en' if no region info is attached.
127
+ */
39
128
  getActiveLanguage() {
40
- return this.activeLanguage$$.getValue() ?? this.defaultLanguage;
129
+ return this.localeState$.getValue()?.baseName ?? new Intl.Locale(this.defaultLanguage).baseName;
130
+ }
131
+ /**
132
+ * Retrieves the active language subtag.
133
+ *
134
+ * @returns {string} The two-digit language subtag, e.g. 'en', 'fr'.
135
+ */
136
+ getActiveLanguageSubtag() {
137
+ return this.localeState$.getValue()?.language ?? new Intl.Locale(this.defaultLanguage).language;
41
138
  }
139
+ /**
140
+ * Sets the active language based on the provided language code. If the language is not
141
+ * recognized, it logs an error and does not change the active language.
142
+ *
143
+ * @param {string} language The language code to set as the active language.
144
+ */
42
145
  setActiveLanguage(language) {
43
- if (this.availableLanguages.includes(language)) {
44
- this.activeLanguage$$.next(language);
45
- return;
46
- }
47
- const languageCode = getLanguageCode(language);
48
- if (this.availableLanguages.includes(languageCode)) {
49
- this.activeLanguage$$.next(languageCode);
50
- return;
146
+ try {
147
+ const locale = new Intl.Locale(language);
148
+ if (this.availableLanguages.includes(locale.baseName) || this.availableLanguages.includes(locale.language)) {
149
+ this.localeState$.next(locale);
150
+ }
151
+ else {
152
+ throw new Error(`Unrecognizable language '${language}'. Make sure it's a part of availableLanguages inside LocalizationService config.`);
153
+ }
51
154
  }
52
- this.activeLanguage$$.next(this.defaultLanguage);
53
- }
54
- getActiveLocale() {
55
- return this.activeLocale$$.getValue() ?? this.defaultLocale;
56
- }
57
- setActiveLocale(locale) {
58
- if (this.availableLocales.includes(locale)) {
59
- this.activeLocale$$.next(locale);
60
- return;
155
+ catch (error) {
156
+ logger.error(error);
61
157
  }
62
- this.activeLocale$$.next(this.defaultLocale);
63
158
  }
159
+ /**
160
+ * Loads the active language for the localization service.
161
+ * This method runs in an injection context and sets the active language based on the result of the active language loader.
162
+ * If the active language loader fails, the default language is set as the active language.
163
+ *
164
+ * @returns {Promise<void>} A promise that resolves when the active language is loaded and set.
165
+ */
64
166
  async loadActiveLanguage() {
65
167
  return runInInjectionContext(this.injector, async () => {
66
168
  const activeLanguageLoader$ = this.createActiveLanguageLoader$();
67
169
  const activeLanguage = await firstValueFrom(activeLanguageLoader$).catch(() => null);
68
170
  this.setActiveLanguage(activeLanguage ?? this.defaultLanguage);
69
- this.setActiveLocale(activeLanguage ?? this.defaultLocale);
70
171
  });
71
172
  }
72
173
  createActiveLanguageLoader$() {
@@ -92,6 +193,33 @@ function makeLocalizationFeature(provider) {
92
193
  }
93
194
 
94
195
  const HTTP_LANGUAGE_HEADER = 'Accept-Language';
196
+ /**
197
+ * Creates an HTTP interceptor function that adds a language header to outgoing HTTP requests,
198
+ * but only for URLs matching the provided criteria. This allows the server to respond with
199
+ * resources localized in the user's current language.
200
+ *
201
+ * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the interceptor,
202
+ * including the list of allowed URLs and optionally a custom header name.
203
+ * @returns {HttpInterceptorFn} An Angular HTTP interceptor function that conditionally adds
204
+ * the current language as an HTTP header based on the request URL.
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * // Use in HTTP client module setup
209
+ * import { HttpClientModule } from '@angular/common/http';
210
+ * import { httpLanguageHeaderInterceptor, HTTP_LANGUAGE_HEADER } from '@odx/angular/localization';
211
+ *
212
+ * @NgModule({
213
+ * imports: [HttpClientModule],
214
+ * providers: [
215
+ * provideHttpClient(withInterceptors([
216
+ * httpLanguageHeaderInterceptor({ allowedUrls: ['/api'], headerName: HTTP_LANGUAGE_HEADER })
217
+ * ]))
218
+ * ]
219
+ * })
220
+ * export class AppModule {}
221
+ * ```
222
+ */
95
223
  function httpLanguageHeaderInterceptor({ allowedUrls, headerName }) {
96
224
  return (req, next) => {
97
225
  const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));
@@ -103,12 +231,64 @@ function httpLanguageHeaderInterceptor({ allowedUrls, headerName }) {
103
231
  return next(req);
104
232
  };
105
233
  }
234
+ /**
235
+ * Provides a localization feature that automatically adds a language header to HTTP requests
236
+ * for specified URLs, using the current active language. This function simplifies setting up
237
+ * the HTTP language header interceptor by wrapping it into a LocalizationFeature, making it easy
238
+ * to integrate with the application's localization infrastructure.
239
+ *
240
+ * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the language header
241
+ * interceptor, specifying which URLs should include the language header and optionally defining a
242
+ * custom header name.
243
+ * @returns {LocalizationFeature} A localization feature object that can be used to configure
244
+ * the application's localization settings to include automatic language header addition for HTTP requests.
245
+ *
246
+ * @example
247
+ * ```ts
248
+ * // Example usage with the localization provider
249
+ * import { provideLocalization, LocalizationModule, withHttpLanguageHeader } from '@odx/angular/localization';
250
+ *
251
+ * @NgModule({
252
+ * imports: [LocalizationModule],
253
+ * providers: [
254
+ * provideLocalization({}, withHttpLanguageHeader({ allowedUrls: ['/api'] }))
255
+ * ]
256
+ * })
257
+ * export class AppModule {}
258
+ * ```
259
+ */
106
260
  function withHttpLanguageHeader(config) {
107
261
  const providers = provideHttpClient(withInterceptors([httpLanguageHeaderInterceptor(config)]));
108
262
  return makeLocalizationFeature(providers);
109
263
  }
110
264
 
111
265
  const HTTP_LANGUAGE_QUERY = 'language';
266
+ /**
267
+ * Creates an HTTP interceptor function that appends the current language as a query parameter
268
+ * to outgoing HTTP requests that match specified URLs. This interceptor enables dynamic content
269
+ * localization by informing the backend of the user's preferred language.
270
+ *
271
+ * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for the interceptor,
272
+ * including allowed URLs and an optional custom name for the query parameter.
273
+ * @returns {HttpInterceptorFn} The interceptor function ready to be applied to the HTTP client.
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * // Applying the interceptor in an Angular module
278
+ * import { HttpClientModule } from '@angular/common/http';
279
+ * import { withHttpLanguageQueryParam } from '@odx/angular/localization';
280
+ *
281
+ * @NgModule({
282
+ * imports: [HttpClientModule],
283
+ * providers: [
284
+ * provideHttpClient(withInterceptors([
285
+ * withHttpLanguageQueryParam({ allowedUrls: ['/api/resources'] })
286
+ * ]))
287
+ * ]
288
+ * })
289
+ * export class ApiModule {}
290
+ * ```
291
+ */
112
292
  function withHttpLanguageQueryParamInterceptor({ allowedUrls, queryParamName }) {
113
293
  return (req, next) => {
114
294
  const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));
@@ -120,11 +300,68 @@ function withHttpLanguageQueryParamInterceptor({ allowedUrls, queryParamName })
120
300
  return next(req);
121
301
  };
122
302
  }
303
+ /**
304
+ * Registers the HTTP interceptor that appends the current language as a query parameter to
305
+ * outgoing requests for configured URLs as a localization feature. This utility function
306
+ * simplifies the setup by bundling the interceptor into a feature that can be easily integrated
307
+ * with localization configurations.
308
+ *
309
+ * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for appending the
310
+ * language query parameter, including allowed URLs and an optional parameter name.
311
+ * @returns {LocalizationFeature} A localization feature encapsulating the interceptor, ready
312
+ * for integration with the application's localization setup.
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * // Integrating the localization feature in an Angular module
317
+ * import { provideLocalization } from '@angular/core';
318
+ * import { withHttpLanguageQueryParam } from '@odx/angular/localization';
319
+ *
320
+ * @NgModule({
321
+ * providers: [
322
+ * provideLocalization({}, withHttpLanguageQueryParam({ allowedUrls: ['/api'] }))
323
+ * ]
324
+ * })
325
+ * export class AppModule {}
326
+ * ```
327
+ */
123
328
  function withHttpLanguageQueryParam(config) {
124
329
  const providers = provideHttpClient(withInterceptors([withHttpLanguageQueryParamInterceptor(config)]));
125
330
  return makeLocalizationFeature(providers);
126
331
  }
127
332
 
333
+ /**
334
+ * Asynchronously loads the browser's current language setting by utilizing the `WindowRef` service.
335
+ * This function is intended to be used as a dynamic language loader within a localization configuration,
336
+ * allowing applications to automatically adapt to the user's preferred language as specified in their
337
+ * browser settings.
338
+ *
339
+ * The `WindowRef` service abstracts window-related operations, making it easier to interact with global
340
+ * browser properties and methods in a testable and platform-agnostic way. This function makes use of
341
+ * `WindowRef` to access the navigator's language setting in a safe and Angular-friendly manner.
342
+ *
343
+ * @returns {Promise<string>} A promise that resolves to the language code (e.g., 'en', 'fr') of the
344
+ * browser's currently configured language. This can then be used to set the active language in a
345
+ * localization configuration.
346
+ *
347
+ * @example
348
+ * ```ts
349
+ * // Example usage in a localization configuration
350
+ * import { provideLocalization } from '@odx/angular/utils';
351
+ * import { browserLanguageLoader } from '@odx/angular/localization';
352
+ *
353
+ * @NgModule({
354
+ * providers: [
355
+ * provideLocalization({
356
+ * activeLanguageLoader: browserLanguageLoader,
357
+ * availableLanguages: ['en', 'es', 'fr'],
358
+ * availableLocales: ['en-US', 'es-ES', 'fr-FR']
359
+ * })
360
+ * ]
361
+ * })
362
+ * export class AppModule { }
363
+ * ```
364
+ */
128
365
  const browserLanguageLoader = async () => {
129
366
  return inject(WindowRef).getLanguage();
130
367
  };
@@ -133,5 +370,5 @@ const browserLanguageLoader = async () => {
133
370
  * Generated bundle index. Do not edit.
134
371
  */
135
372
 
136
- export { DEFAULT_AVAILABLE_LANGUAGES, DEFAULT_AVAILABLE_LOCALES, HTTP_LANGUAGE_HEADER, HTTP_LANGUAGE_QUERY, LocalizationConfig, LocalizationDefaultConfig, LocalizationService, browserLanguageLoader, httpLanguageHeaderInterceptor, injectLocalizationConfig, makeLocalizationFeature, provideLocalization, provideLocalizationConfig, withHttpLanguageHeader, withHttpLanguageQueryParam, withHttpLanguageQueryParamInterceptor };
373
+ export { DEFAULT_AVAILABLE_LANGUAGES, HTTP_LANGUAGE_HEADER, HTTP_LANGUAGE_QUERY, LocalizationConfig, LocalizationDefaultConfig, LocalizationService, browserLanguageLoader, httpLanguageHeaderInterceptor, injectLocalizationConfig, makeLocalizationFeature, provideLocalization, provideLocalizationConfig, withHttpLanguageHeader, withHttpLanguageQueryParam, withHttpLanguageQueryParamInterceptor };
137
374
  //# sourceMappingURL=odx-angular-localization.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-localization.mjs","sources":["../../../../libs/angular/localization/src/lib/localization.config.ts","../../../../libs/angular/localization/src/lib/localization.service.ts","../../../../libs/angular/localization/src/lib/models/localization-feature.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-header.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-query-param.ts","../../../../libs/angular/localization/src/lib/loaders/browser-language-loader.ts","../../../../libs/angular/localization/src/odx-angular-localization.ts"],"sourcesContent":["import { APP_INITIALIZER, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { createConfigTokens, getLanguageCode } from '@odx/angular/utils';\nimport { LocalizationService } from './localization.service';\nimport { LanguageLoaderFn, LocalizationFeature } from './models';\n\nexport const DEFAULT_AVAILABLE_LOCALES = ['en-US', 'en-GB', 'de-DE', 'es-ES', 'fr-FR', 'fr-CA'];\nexport const DEFAULT_AVAILABLE_LANGUAGES = Array.from(new Set(DEFAULT_AVAILABLE_LOCALES.map(getLanguageCode)));\n\nexport interface LocalizationConfig {\n activeLanguageLoader?: LanguageLoaderFn;\n availableLanguages: string[];\n availableLocales: string[];\n}\n\nexport const { LocalizationConfig, LocalizationDefaultConfig, injectLocalizationConfig, provideLocalizationConfig } = createConfigTokens(\n 'Localization',\n '@odx/angular/internal/translate',\n {\n availableLanguages: DEFAULT_AVAILABLE_LANGUAGES,\n availableLocales: DEFAULT_AVAILABLE_LOCALES,\n } as LocalizationConfig,\n);\n\nexport function provideLocalization(config: Partial<LocalizationConfig>, ...features: LocalizationFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideLocalizationConfig(config),\n {\n provide: APP_INITIALIZER,\n useFactory: (localizationService: LocalizationService) => () => localizationService.loadActiveLanguage(),\n deps: [LocalizationService],\n multi: true,\n },\n features,\n ]);\n}\n","import { Injectable, Injector, inject, runInInjectionContext } from '@angular/core';\nimport { getLanguageCode } from '@odx/angular/utils';\nimport { BehaviorSubject, Observable, distinctUntilChanged, filter, firstValueFrom, from, isObservable, of, shareReplay } from 'rxjs';\nimport { injectLocalizationConfig } from './localization.config';\n\n@Injectable({ providedIn: 'root' })\nexport class LocalizationService {\n private readonly injector = inject(Injector);\n private readonly localizationConfig = injectLocalizationConfig();\n private readonly activeLanguage$$ = new BehaviorSubject<string | undefined>(undefined);\n private readonly activeLocale$$ = new BehaviorSubject<string | undefined>(undefined);\n\n public readonly activeLanguage$ = this.activeLanguage$$.pipe(filter(Boolean), distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));\n public readonly availableLanguages = this.localizationConfig.availableLanguages;\n public readonly defaultLanguage = this.availableLanguages[0];\n public readonly availableLocales = this.localizationConfig.availableLocales;\n public readonly defaultLocale = this.availableLocales[0];\n\n public getActiveLanguage(): string {\n return this.activeLanguage$$.getValue() ?? this.defaultLanguage;\n }\n\n public setActiveLanguage(language: string): void {\n if (this.availableLanguages.includes(language)) {\n this.activeLanguage$$.next(language);\n return;\n }\n const languageCode = getLanguageCode(language);\n if (this.availableLanguages.includes(languageCode)) {\n this.activeLanguage$$.next(languageCode);\n return;\n }\n this.activeLanguage$$.next(this.defaultLanguage);\n }\n\n public getActiveLocale(): string {\n return this.activeLocale$$.getValue() ?? this.defaultLocale;\n }\n\n public setActiveLocale(locale: string): void {\n if (this.availableLocales.includes(locale)) {\n this.activeLocale$$.next(locale);\n return;\n }\n this.activeLocale$$.next(this.defaultLocale);\n }\n\n public async loadActiveLanguage(): Promise<void> {\n return runInInjectionContext(this.injector, async () => {\n const activeLanguageLoader$ = this.createActiveLanguageLoader$();\n const activeLanguage = await firstValueFrom(activeLanguageLoader$).catch(() => null);\n this.setActiveLanguage(activeLanguage ?? this.defaultLanguage);\n this.setActiveLocale(activeLanguage ?? this.defaultLocale);\n });\n }\n\n private createActiveLanguageLoader$(): Observable<string | undefined> {\n const language = this.localizationConfig.activeLanguageLoader?.();\n if (isObservable(language)) {\n return language;\n }\n if (language instanceof Promise) {\n return from(language);\n }\n return of(language);\n }\n}\n","import { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type LocalizationFeature = EnvironmentProviders & { ɵodxBrand: '@odx/angular/localization::LocalizationFeature' };\n\nexport function makeLocalizationFeature(provider: Provider[] | EnvironmentProviders): LocalizationFeature {\n return provider as never as LocalizationFeature;\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_HEADER = 'Accept-Language';\n\nexport interface HttpLanguageHeaderInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n headerName?: string;\n}\n\nexport function httpLanguageHeaderInterceptor({ allowedUrls, headerName }: HttpLanguageHeaderInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setHeaders: { [headerName ?? HTTP_LANGUAGE_HEADER]: language } }))));\n }\n return next(req);\n };\n}\n\nexport function withHttpLanguageHeader(config: HttpLanguageHeaderInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([httpLanguageHeaderInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_QUERY = 'language';\n\nexport interface HttpLanguageQueryParamInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n queryParamName?: string;\n}\n\nexport function withHttpLanguageQueryParamInterceptor({ allowedUrls, queryParamName }: HttpLanguageQueryParamInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setParams: { [queryParamName ?? HTTP_LANGUAGE_QUERY]: language } }))));\n }\n return next(req);\n };\n}\n\nexport function withHttpLanguageQueryParam(config: HttpLanguageQueryParamInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([withHttpLanguageQueryParamInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { inject } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { LanguageLoaderFn } from '../models';\n\nexport const browserLanguageLoader: LanguageLoaderFn = async () => {\n return inject(WindowRef).getLanguage();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAKa,MAAA,yBAAyB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;AACnF,MAAA,2BAA2B,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,yBAAyB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,EAAE;AAQlG,MAAA,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,GAAG,kBAAk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SAAS;AAC7C,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,cAAc,IAAI,mBAAmB,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACvI,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,KAAC,CAAC;AACJ,CAAC;AAEK,SAAU,0BAA0B,CAAC,MAA+C,EAAA;AACxF,IAAA,MAAM,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvG,IAAA,OAAO,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C;;ACzBa,MAAA,qBAAqB,GAAqB,YAAW;AAChE,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC;;ACNA;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-localization.mjs","sources":["../../../../libs/angular/localization/src/lib/localization.config.ts","../../../../libs/angular/localization/src/lib/localization.logger.ts","../../../../libs/angular/localization/src/lib/localization.service.ts","../../../../libs/angular/localization/src/lib/models/localization-feature.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-header.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-query-param.ts","../../../../libs/angular/localization/src/lib/loaders/browser-language-loader.ts","../../../../libs/angular/localization/src/odx-angular-localization.ts"],"sourcesContent":["import { APP_INITIALIZER, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { createConfigTokens } from '@odx/angular/utils';\nimport { LocalizationService } from './localization.service';\nimport { LanguageLoaderFn, LocalizationFeature } from './models';\n\nexport const DEFAULT_AVAILABLE_LANGUAGES = ['en-US', 'en-GB', 'en', 'de-DE', 'de', 'es-ES', 'es', 'fr-FR', 'fr-CA', 'fr'];\n\n/**\n * Defines the structure for the localization configuration used throughout the application.\n * It allows specifying available languages, and includes an optional loader\n * function for dynamically determining the active language.\n *\n * @property {LanguageLoaderFn} [activeLanguageLoader] Optional function for loading the\n * active language dynamically, useful for scenarios where the application's language\n * needs to be determined based on user settings, browser settings, or external data.\n * @property {string[]} availableLanguages An array of language codes representing the\n * languages available in the application.\n */\nexport interface LocalizationConfig {\n activeLanguageLoader?: LanguageLoaderFn;\n availableLanguages: string[];\n}\n\n/**\n * Utilizes `createConfigTokens` to generate configuration tokens and related utilities for the\n * localization settings within the application. It defines a structured and type-safe approach\n * for managing localization configurations, such as available languages, and potentially\n * a dynamic loader for the active language. The generated tokens and utilities facilitate accessing\n * and providing these configurations throughout the application.\n *\n * @const {InjectionToken<LocalizationConfig>} LocalizationConfig - An InjectionToken for accessing\n * the localization configuration within Angular's dependency injection framework. Use this token to inject\n * localization configurations into services, components, or other tokens.\n *\n * @const {LocalizationConfig} LocalizationDefaultConfig - The default configuration values for localization,\n * based on the provided settings. Includes the default available languages.\n *\n * @const {Function} injectLocalizationConfig - A utility function that returns the injected value of\n * `LocalizationConfig` token. Use this function to access the current localization configuration in\n * a type-safe manner.\n *\n * @const {Function} provideLocalizationConfig - A utility function to provide the `LocalizationConfig` token\n * with specific values. Use this function to configure and override default localization settings within\n * an Angular module or component.\n *\n * @example\n * ```ts\n * // Providing localization settings in an Angular module\n * @NgModule({\n * providers: [\n * provideLocalizationConfig({\n * availableLanguages: ['en', 'es', 'fr'],\n * })\n * ]\n * })\n * export class AppModule { }\n *\n * // Injecting and using the localization configuration in a service\n * @Injectable({ providedIn: 'root' })\n * export class MyLocalizationService {\n * constructor(@Inject(LocalizationConfig) private config: LocalizationConfig) {\n * console.log('Available languages:', config.availableLanguages);\n * }\n * }\n * ```\n */\nexport const { LocalizationConfig, LocalizationDefaultConfig, injectLocalizationConfig, provideLocalizationConfig } = createConfigTokens(\n 'Localization',\n '@odx/angular/internal/translate',\n {\n availableLanguages: DEFAULT_AVAILABLE_LANGUAGES,\n } as LocalizationConfig,\n);\n\n/**\n * Sets up the localization configuration for the application and initializes the localization\n * system with the provided configuration and features. This function is typically called\n * within the main module or a core module of the application to ensure localization settings\n * are available and active as early as possible.\n *\n * @param {Partial<LocalizationConfig>} config The localization configuration settings, including\n * available languages and optionally, a custom loader for the active language.\n * @param {...LocalizationFeature[]} features Additional localization features or configurations\n * to be registered as part of the application's environment providers.\n * @returns {EnvironmentProviders} A collection of providers for setting up the application's\n * localization environment, to be used with Angular's environment-specific injector configuration.\n * @example\n * ```ts\n * // Example of providing localization settings in an Angular module\n * @NgModule({\n * imports: [...],\n * providers: [\n * provideLocalization({\n * availableLanguages: ['en', 'es', 'fr'],\n * activeLanguageLoader: () => fetch('/api/user/language').then(res => res.text()),\n * }),\n * ],\n * })\n * export class AppModule {}\n * ```\n */\nexport function provideLocalization(config: Partial<LocalizationConfig>, ...features: LocalizationFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideLocalizationConfig(config),\n {\n provide: APP_INITIALIZER,\n useFactory: (localizationService: LocalizationService) => () => localizationService.loadActiveLanguage(),\n deps: [LocalizationService],\n multi: true,\n },\n features,\n ]);\n}\n","import { Logger } from '@odx/angular/internal';\n\nexport default new Logger('@odx/angular/localization');\n","import { Injectable, Injector, inject, runInInjectionContext } from '@angular/core';\nimport { BehaviorSubject, Observable, distinctUntilChanged, filter, firstValueFrom, from, isObservable, map, of, shareReplay } from 'rxjs';\nimport { injectLocalizationConfig } from './localization.config';\nimport logger from './localization.logger';\n\n@Injectable({ providedIn: 'root' })\nexport class LocalizationService {\n private readonly localizationConfig = injectLocalizationConfig();\n private readonly injector = inject(Injector);\n private readonly localeState$ = new BehaviorSubject<Intl.Locale | undefined>(new Intl.Locale(this.localizationConfig.availableLanguages[0]));\n\n /**\n * Represents an observable stream of the active language in the localization service.\n * The active language is determined by the locale state.\n *\n * @emits {string} The active language.\n */\n public readonly activeLanguage$ = this.localeState$.pipe(\n filter(Boolean),\n map((x) => x.baseName),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n /**\n * Gets the list of available languages for localization.\n *\n * @type {string[]} The list of available languages.\n */\n public readonly availableLanguages = this.localizationConfig.availableLanguages;\n\n /** Default language derived from the first entry in the available languages list.\n *\n * @type {string}\n */\n public readonly defaultLanguage = this.availableLanguages[0];\n\n /**\n * Retrieves the currently active language. Falls back to the default language if\n * no active language is set.\n *\n * @returns {string} Full locale name e.g. 'en-US' or just 'en' if no region info is attached.\n */\n public getActiveLanguage(): string {\n return this.localeState$.getValue()?.baseName ?? new Intl.Locale(this.defaultLanguage).baseName;\n }\n\n /**\n * Retrieves the active language subtag.\n *\n * @returns {string} The two-digit language subtag, e.g. 'en', 'fr'.\n */\n public getActiveLanguageSubtag(): string {\n return this.localeState$.getValue()?.language ?? new Intl.Locale(this.defaultLanguage).language;\n }\n\n /**\n * Sets the active language based on the provided language code. If the language is not\n * recognized, it logs an error and does not change the active language.\n *\n * @param {string} language The language code to set as the active language.\n */\n public setActiveLanguage(language: string): void {\n try {\n const locale = new Intl.Locale(language);\n if (this.availableLanguages.includes(locale.baseName) || this.availableLanguages.includes(locale.language)) {\n this.localeState$.next(locale);\n } else {\n throw new Error(`Unrecognizable language '${language}'. Make sure it's a part of availableLanguages inside LocalizationService config.`);\n }\n } catch (error) {\n logger.error(error);\n }\n }\n\n /**\n * Loads the active language for the localization service.\n * This method runs in an injection context and sets the active language based on the result of the active language loader.\n * If the active language loader fails, the default language is set as the active language.\n *\n * @returns {Promise<void>} A promise that resolves when the active language is loaded and set.\n */\n public async loadActiveLanguage(): Promise<void> {\n return runInInjectionContext(this.injector, async () => {\n const activeLanguageLoader$ = this.createActiveLanguageLoader$();\n const activeLanguage = await firstValueFrom(activeLanguageLoader$).catch(() => null);\n this.setActiveLanguage(activeLanguage ?? this.defaultLanguage);\n });\n }\n\n private createActiveLanguageLoader$(): Observable<string | undefined> {\n const language = this.localizationConfig.activeLanguageLoader?.();\n if (isObservable(language)) {\n return language;\n }\n if (language instanceof Promise) {\n return from(language);\n }\n return of(language);\n }\n}\n","import { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type LocalizationFeature = EnvironmentProviders & { ɵodxBrand: '@odx/angular/localization::LocalizationFeature' };\n\nexport function makeLocalizationFeature(provider: Provider[] | EnvironmentProviders): LocalizationFeature {\n return provider as never as LocalizationFeature;\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_HEADER = 'Accept-Language';\n\n/**\n * Configuration object for the HTTP language header interceptor. It specifies which URLs\n * the interceptor should apply to and allows customizing the name of the header used to transmit\n * the current language setting.\n *\n * @property {Array<string | RegExp>} allowedUrls - An array of strings or RegExp patterns\n * indicating the URLs to which the language header should be added.\n * @property {string} [headerName=HTTP_LANGUAGE_HEADER] - Optional. The name of the HTTP header\n * through which the current language setting will be transmitted. Defaults to 'Accept-Language'.\n */\nexport interface HttpLanguageHeaderInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n headerName?: string;\n}\n\n/**\n * Creates an HTTP interceptor function that adds a language header to outgoing HTTP requests,\n * but only for URLs matching the provided criteria. This allows the server to respond with\n * resources localized in the user's current language.\n *\n * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the interceptor,\n * including the list of allowed URLs and optionally a custom header name.\n * @returns {HttpInterceptorFn} An Angular HTTP interceptor function that conditionally adds\n * the current language as an HTTP header based on the request URL.\n *\n * @example\n * ```ts\n * // Use in HTTP client module setup\n * import { HttpClientModule } from '@angular/common/http';\n * import { httpLanguageHeaderInterceptor, HTTP_LANGUAGE_HEADER } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [HttpClientModule],\n * providers: [\n * provideHttpClient(withInterceptors([\n * httpLanguageHeaderInterceptor({ allowedUrls: ['/api'], headerName: HTTP_LANGUAGE_HEADER })\n * ]))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function httpLanguageHeaderInterceptor({ allowedUrls, headerName }: HttpLanguageHeaderInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setHeaders: { [headerName ?? HTTP_LANGUAGE_HEADER]: language } }))));\n }\n return next(req);\n };\n}\n\n/**\n * Provides a localization feature that automatically adds a language header to HTTP requests\n * for specified URLs, using the current active language. This function simplifies setting up\n * the HTTP language header interceptor by wrapping it into a LocalizationFeature, making it easy\n * to integrate with the application's localization infrastructure.\n *\n * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the language header\n * interceptor, specifying which URLs should include the language header and optionally defining a\n * custom header name.\n * @returns {LocalizationFeature} A localization feature object that can be used to configure\n * the application's localization settings to include automatic language header addition for HTTP requests.\n *\n * @example\n * ```ts\n * // Example usage with the localization provider\n * import { provideLocalization, LocalizationModule, withHttpLanguageHeader } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [LocalizationModule],\n * providers: [\n * provideLocalization({}, withHttpLanguageHeader({ allowedUrls: ['/api'] }))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function withHttpLanguageHeader(config: HttpLanguageHeaderInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([httpLanguageHeaderInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_QUERY = 'language';\n\n/**\n * Defines the configuration options for the HTTP interceptor that appends the current\n * language setting as a query parameter to outgoing requests. This configuration specifies\n * which requests should have the language parameter appended based on their URLs.\n *\n * @property {Array<string | RegExp>} allowedUrls - URLs (or patterns matching URLs) to which\n * the language query parameter should be appended.\n * @property {string} [queryParamName=HTTP_LANGUAGE_QUERY] - The name of the query parameter\n * used to transmit the current language. Defaults to 'language'.\n */\nexport interface HttpLanguageQueryParamInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n queryParamName?: string;\n}\n\n/**\n * Creates an HTTP interceptor function that appends the current language as a query parameter\n * to outgoing HTTP requests that match specified URLs. This interceptor enables dynamic content\n * localization by informing the backend of the user's preferred language.\n *\n * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for the interceptor,\n * including allowed URLs and an optional custom name for the query parameter.\n * @returns {HttpInterceptorFn} The interceptor function ready to be applied to the HTTP client.\n *\n * @example\n * ```ts\n * // Applying the interceptor in an Angular module\n * import { HttpClientModule } from '@angular/common/http';\n * import { withHttpLanguageQueryParam } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [HttpClientModule],\n * providers: [\n * provideHttpClient(withInterceptors([\n * withHttpLanguageQueryParam({ allowedUrls: ['/api/resources'] })\n * ]))\n * ]\n * })\n * export class ApiModule {}\n * ```\n */\nexport function withHttpLanguageQueryParamInterceptor({ allowedUrls, queryParamName }: HttpLanguageQueryParamInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setParams: { [queryParamName ?? HTTP_LANGUAGE_QUERY]: language } }))));\n }\n return next(req);\n };\n}\n\n/**\n * Registers the HTTP interceptor that appends the current language as a query parameter to\n * outgoing requests for configured URLs as a localization feature. This utility function\n * simplifies the setup by bundling the interceptor into a feature that can be easily integrated\n * with localization configurations.\n *\n * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for appending the\n * language query parameter, including allowed URLs and an optional parameter name.\n * @returns {LocalizationFeature} A localization feature encapsulating the interceptor, ready\n * for integration with the application's localization setup.\n *\n * @example\n * ```ts\n * // Integrating the localization feature in an Angular module\n * import { provideLocalization } from '@angular/core';\n * import { withHttpLanguageQueryParam } from '@odx/angular/localization';\n *\n * @NgModule({\n * providers: [\n * provideLocalization({}, withHttpLanguageQueryParam({ allowedUrls: ['/api'] }))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function withHttpLanguageQueryParam(config: HttpLanguageQueryParamInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([withHttpLanguageQueryParamInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { inject } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { LanguageLoaderFn } from '../models';\n\n/**\n * Asynchronously loads the browser's current language setting by utilizing the `WindowRef` service.\n * This function is intended to be used as a dynamic language loader within a localization configuration,\n * allowing applications to automatically adapt to the user's preferred language as specified in their\n * browser settings.\n *\n * The `WindowRef` service abstracts window-related operations, making it easier to interact with global\n * browser properties and methods in a testable and platform-agnostic way. This function makes use of\n * `WindowRef` to access the navigator's language setting in a safe and Angular-friendly manner.\n *\n * @returns {Promise<string>} A promise that resolves to the language code (e.g., 'en', 'fr') of the\n * browser's currently configured language. This can then be used to set the active language in a\n * localization configuration.\n *\n * @example\n * ```ts\n * // Example usage in a localization configuration\n * import { provideLocalization } from '@odx/angular/utils';\n * import { browserLanguageLoader } from '@odx/angular/localization';\n *\n * @NgModule({\n * providers: [\n * provideLocalization({\n * activeLanguageLoader: browserLanguageLoader,\n * availableLanguages: ['en', 'es', 'fr'],\n * availableLocales: ['en-US', 'es-ES', 'fr-FR']\n * })\n * ]\n * })\n * export class AppModule { }\n * ```\n */\nexport const browserLanguageLoader: LanguageLoaderFn = async () => {\n return inject(WindowRef).getLanguage();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport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;;;;;;;;;;AAyBG;SACa,qCAAqC,CAAC,EAAE,WAAW,EAAE,cAAc,EAA2C,EAAA;AAC5H,IAAA,OAAO,CAAC,GAAG,EAAE,IAAI,KAAI;AACnB,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,QAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC;gBAAE,SAAS;AAC7C,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,cAAc,IAAI,mBAAmB,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACvI,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,KAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,0BAA0B,CAAC,MAA+C,EAAA;AACxF,IAAA,MAAM,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvG,IAAA,OAAO,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C;;ACtFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACU,MAAA,qBAAqB,GAAqB,YAAW;AAChE,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC;;ACtCA;;AAEG;;;;"}
@@ -1,14 +1,53 @@
1
- import { switchMap, timer, map, takeUntil, startWith, Observable, debounceTime, merge, fromEvent } from 'rxjs';
1
+ import { switchMap, timer, map, takeUntil, Observable, debounceTime, merge, fromEvent, startWith } from 'rxjs';
2
2
  import { createMutationObserver, createResizeObserver } from '@odx/angular/utils';
3
3
 
4
+ /**
5
+ * Delays the emission of each value from the source Observable by a time span determined by the `delay` function.
6
+ * If the `notifier` Observable emits before the delay expires, the delayed emission is cancelled.
7
+ *
8
+ * This operator is useful for postponing the observable emissions until certain conditions are met,
9
+ * represented by the passage of time defined by `delay`. It also allows for a way to preemptively
10
+ * cancel the delay in response to another observable's emission.
11
+ *
12
+ * @template T The type of items emitted by the source Observable.
13
+ * @param {() => number} delay A function that returns the delay (in milliseconds) before the source Observable's values are emitted.
14
+ * @param {Observable<unknown>} notifier An Observable that cancels the delay when it emits.
15
+ * @returns {MonoTypeOperatorFunction<T>} An Observable that emits the source Observable's items with a delay if not cancelled.
16
+ * @example
17
+ * ```ts
18
+ * // Delay each number emission by 1 second, unless the 'cancel' button is clicked.
19
+ * const delayedNumbers$ = of(1, 2, 3).pipe(
20
+ * delayUntil(() => 1000, fromEvent(cancelButton, 'click'))
21
+ * );
22
+ *
23
+ * delayedNumbers$.subscribe(console.log);
24
+ * ```
25
+ */
4
26
  function delayUntil(delay, notifier) {
5
27
  return (source$) => source$.pipe(switchMap((value) => timer(delay()).pipe(map(() => value), takeUntil(notifier))));
6
28
  }
7
29
 
8
- function fromQueryList(queryList) {
9
- return queryList.changes.pipe(startWith(queryList));
10
- }
11
-
30
+ /**
31
+ * Creates an RxJS Observable that emits mutation records for changes in a DOM element's attributes,
32
+ * child list, and subtree. It uses the `MutationObserver` Web API to observe mutations on the specified
33
+ * element according to the options provided.
34
+ *
35
+ * @param {Element} element The DOM element to observe for mutations.
36
+ * @param {MutationObserverInit} options An object that specifies which DOM mutations should be reported.
37
+ * Options include attributes, childList, subtree, attributeOldValue, characterData, characterDataOldValue,
38
+ * and attributeFilter.
39
+ * @returns {Observable<MutationRecord>} An Observable that emits a `MutationRecord` each time a mutation
40
+ * matching the specified options occurs in the observed element.
41
+ * @example
42
+ * ```ts
43
+ * // Observing changes to the child list of an element
44
+ * const element = document.getElementById('my-element');
45
+ * const mutationOptions = { childList: true };
46
+ *
47
+ * fromElementMutation$(element, mutationOptions).subscribe((mutation) => console.log('Mutation detected:', mutation));
48
+ * ```
49
+ * Note: Always remember to unsubscribe from the observable to prevent memory leaks.
50
+ */
12
51
  function fromElementMutation$(element, options) {
13
52
  return new Observable((observer) => {
14
53
  const mutationObserver = createMutationObserver(observer, (events) => events.length > 0);
@@ -17,6 +56,30 @@ function fromElementMutation$(element, options) {
17
56
  });
18
57
  }
19
58
 
59
+ /**
60
+ * Creates an RxJS Observable that emits an array of `ResizeObserverEntry` objects whenever
61
+ * the target element's size changes. This function provides a reactive way to observe
62
+ * and respond to changes in an element's dimensions, using the `ResizeObserver` Web API.
63
+ *
64
+ * The observable debounces the emitted values to improve performance and reduce the frequency
65
+ * of change detection runs in Angular applications. The debounce time can be adjusted via
66
+ * the `debounceDuration` parameter.
67
+ *
68
+ * @param {Element} element The DOM element to observe for size changes.
69
+ * @param {number} [debounceDuration=50] The time, in milliseconds, to debounce the emitted
70
+ * values. Defaults to 50ms.
71
+ * @returns {Observable<ResizeObserverEntry[]>} An Observable that emits the resize events
72
+ * for the observed element. Each emission is an array of `ResizeObserverEntry` objects, one
73
+ * for each observed element that experienced a resize.
74
+ * @example
75
+ * ```ts
76
+ * // Observing resize events of an element with a 100ms debounce duration
77
+ * const element = document.getElementById('resizable-element');
78
+ * fromElementResize$(element, 100).subscribe((entries) => console.log('Element resized:', entries));
79
+ * ```
80
+ *
81
+ * Always unsubscribe from the observable to clean up resources and prevent memory leaks.
82
+ */
20
83
  function fromElementResize$(element, debounceDuration = 50) {
21
84
  return new Observable((observer) => {
22
85
  const resizeObserver = createResizeObserver((events) => {
@@ -29,10 +92,57 @@ function fromElementResize$(element, debounceDuration = 50) {
29
92
  }).pipe(debounceTime(debounceDuration));
30
93
  }
31
94
 
95
+ /**
96
+ * Creates an Observable that emits events of a specific type from one or multiple event targets.
97
+ * It listens to multiple event types on the given target(s) and emits the events through a single
98
+ * Observable stream, simplifying the handling of related event types.
99
+ *
100
+ * @template T The event object type that the Observable will emit.
101
+ * @param {HasEventTargetAddRemove<T> | HasEventTargetAddRemove<T>[]} target The DOM element(s) or event target(s) to listen on.
102
+ * @param {...string[]} events The names of the events to listen for on the target(s).
103
+ * @returns {Observable<T>} An Observable that emits an event each time one of the specified events occurs on the given target(s).
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * // Listen to both 'click' and 'keyup' events on document
108
+ * fromEvents(document, 'click', 'keyup').subscribe(event => {
109
+ * console.log('Event occurred:', event);
110
+ * });
111
+ *
112
+ * // Listen to 'mousemove' event on multiple elements
113
+ * const elements = [document.getElementById('first'), document.getElementById('second')];
114
+ * fromEvents(elements, 'mousemove').subscribe(event => {
115
+ * console.log('Mouse moved over:', event.target);
116
+ * });
117
+ * ```
118
+ */
32
119
  function fromEvents(target, ...events) {
33
120
  return merge(...events.map((event) => fromEvent(target, event)));
34
121
  }
35
122
 
123
+ /**
124
+ * Creates an Observable from an Angular QueryList. The Observable emits the initial state
125
+ * of the QueryList and continues to emit updates every time the QueryList changes.
126
+ * This utility function is useful for integrating Angular's QueryList changes into
127
+ * the RxJS reactive data flow, allowing developers to apply RxJS operators and
128
+ * subscriptions to respond to QueryList updates.
129
+ *
130
+ * @template T The type of elements contained within the QueryList.
131
+ * @param {QueryList<T>} queryList The QueryList instance to observe.
132
+ * @returns {Observable<QueryList<T>>} An Observable that emits the current state of the QueryList
133
+ * and updates whenever the QueryList changes.
134
+ * @example
135
+ * ```ts
136
+ * // Assuming 'items' is a QueryList of component instances or DOM elements
137
+ * fromQueryList(items).subscribe(queryList => {
138
+ * console.log('QueryList changed:', queryList);
139
+ * });
140
+ * ```
141
+ */
142
+ function fromQueryList(queryList) {
143
+ return queryList.changes.pipe(startWith(queryList));
144
+ }
145
+
36
146
  /**
37
147
  * Generated bundle index. Do not edit.
38
148
  */