@odx/angular 1.0.0-rc.3 → 1.0.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/animations/index.d.ts +1 -0
  2. package/animations/lib/wait-for-child-animations.d.ts +1 -0
  3. package/cdk/active-indicator/README.md +3 -0
  4. package/cdk/active-indicator/index.d.ts +2 -0
  5. package/cdk/active-indicator/lib/active-indicator.directive.d.ts +24 -0
  6. package/cdk/active-indicator/lib/models/active-indicator-direction.d.ts +5 -0
  7. package/cdk/active-indicator/lib/models/active-indicator-position.d.ts +6 -0
  8. package/cdk/active-indicator/lib/models/index.d.ts +2 -0
  9. package/cdk/checkbox-control/lib/checkbox-control.directive.d.ts +2 -3
  10. package/cdk/custom-form-control/lib/custom-form-control.d.ts +7 -14
  11. package/cdk/dynamic-view/lib/dynamic-view.component.d.ts +3 -3
  12. package/cdk/dynamic-view/lib/dynamic-view.directive.d.ts +3 -1
  13. package/cdk/dynamic-view/lib/dynamic-view.service.d.ts +1 -0
  14. package/cdk/dynamic-view/lib/facade/dynamic-view-ref.d.ts +1 -0
  15. package/cdk/dynamic-view/lib/helpers/create-projectable-nodes.d.ts +2 -0
  16. package/cdk/dynamic-view/lib/helpers/index.d.ts +1 -0
  17. package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +1 -0
  18. package/cdk/dynamic-view/lib/models/dynamic-template-ref.d.ts +1 -0
  19. package/cdk/dynamic-view/lib/models/dynamic-view-options.d.ts +7 -3
  20. package/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.d.ts +3 -0
  21. package/cdk/dynamic-view/lib/tokens/index.d.ts +1 -0
  22. package/components/checkbox/index.d.ts +2 -0
  23. package/components/checkbox/lib/checkbox.module.d.ts +9 -0
  24. package/components/checkbox/lib/checkbox.validator.d.ts +6 -0
  25. package/components/chip/README.md +3 -0
  26. package/components/chip/index.d.ts +2 -0
  27. package/components/chip/lib/chip.component.d.ts +15 -0
  28. package/components/chip/lib/models/chip-size.d.ts +5 -0
  29. package/components/chip/lib/models/chip-variant.d.ts +7 -0
  30. package/components/chip/lib/models/index.d.ts +2 -0
  31. package/components/circular-progress/README.md +3 -0
  32. package/components/circular-progress/index.d.ts +2 -0
  33. package/components/circular-progress/lib/circular-progress.component.d.ts +28 -0
  34. package/components/circular-progress/lib/models/circular-progress-size.d.ts +7 -0
  35. package/components/circular-progress/lib/models/index.d.ts +1 -0
  36. package/components/form-field/lib/components/form-group/form-group.component.d.ts +0 -1
  37. package/components/form-field/lib/directives/form-field-control.directive.d.ts +3 -4
  38. package/components/form-field/lib/form-field.config.d.ts +0 -5
  39. package/components/list/README.md +3 -0
  40. package/components/list/index.d.ts +3 -0
  41. package/components/list/lib/components/index.d.ts +1 -0
  42. package/components/list/lib/components/list-item.component.d.ts +14 -0
  43. package/components/list/lib/list.component.d.ts +5 -0
  44. package/components/list/lib/list.module.d.ts +9 -0
  45. package/components/loading-spinner/README.md +3 -0
  46. package/components/loading-spinner/index.d.ts +3 -0
  47. package/components/loading-spinner/lib/loading-spinner.component.d.ts +15 -0
  48. package/components/loading-spinner/lib/loading-spinner.directive.d.ts +26 -0
  49. package/components/loading-spinner/lib/loading-spinner.module.d.ts +9 -0
  50. package/components/loading-spinner/lib/loading-spinner.service.d.ts +9 -0
  51. package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +6 -1
  52. package/components/main-menu/lib/main-menu.component.d.ts +3 -1
  53. package/components/modal/lib/components/modal-header/modal-header.component.d.ts +1 -0
  54. package/components/modal/lib/modal.component.d.ts +4 -3
  55. package/components/modal/lib/modal.directive.d.ts +8 -4
  56. package/components/modal/lib/modal.service.d.ts +0 -2
  57. package/components/modal/lib/models/index.d.ts +1 -0
  58. package/components/modal/lib/models/modal-options.d.ts +2 -0
  59. package/components/modal/lib/models/modal-ref.d.ts +4 -2
  60. package/components/modal/lib/models/modal-variant.d.ts +5 -0
  61. package/components/progress/README.md +3 -0
  62. package/components/progress/index.d.ts +1 -0
  63. package/components/progress/lib/progress.component.d.ts +14 -0
  64. package/components/rail-navigation/README.md +3 -0
  65. package/components/rail-navigation/index.d.ts +3 -0
  66. package/components/rail-navigation/lib/components/rail-navigation-item.component.d.ts +15 -0
  67. package/components/rail-navigation/lib/rail-navigation.component.d.ts +12 -0
  68. package/components/rail-navigation/lib/rail-navigation.module.d.ts +9 -0
  69. package/components/switch/index.d.ts +2 -0
  70. package/components/switch/lib/switch.module.d.ts +9 -0
  71. package/components/switch/lib/switch.validator.d.ts +6 -0
  72. package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +5 -1
  73. package/esm2020/animations/index.mjs +2 -1
  74. package/esm2020/animations/lib/fade.mjs +2 -5
  75. package/esm2020/animations/lib/wait-for-child-animations.mjs +3 -0
  76. package/esm2020/cdk/active-indicator/index.mjs +3 -0
  77. package/esm2020/cdk/active-indicator/lib/active-indicator.directive.mjs +127 -0
  78. package/esm2020/cdk/active-indicator/lib/models/active-indicator-direction.mjs +5 -0
  79. package/esm2020/cdk/active-indicator/lib/models/active-indicator-position.mjs +6 -0
  80. package/esm2020/cdk/active-indicator/lib/models/index.mjs +3 -0
  81. package/esm2020/cdk/active-indicator/odx-angular-cdk-active-indicator.mjs +5 -0
  82. package/esm2020/cdk/checkbox-control/lib/checkbox-control.directive.mjs +13 -15
  83. package/esm2020/cdk/custom-form-control/lib/control.directive.mjs +4 -4
  84. package/esm2020/cdk/custom-form-control/lib/custom-form-control.mjs +20 -47
  85. package/esm2020/cdk/dynamic-view/lib/dynamic-view.component.mjs +23 -14
  86. package/esm2020/cdk/dynamic-view/lib/dynamic-view.directive.mjs +21 -9
  87. package/esm2020/cdk/dynamic-view/lib/dynamic-view.service.mjs +11 -9
  88. package/esm2020/cdk/dynamic-view/lib/facade/dynamic-view-ref.mjs +1 -1
  89. package/esm2020/cdk/dynamic-view/lib/helpers/create-projectable-nodes.mjs +9 -0
  90. package/esm2020/cdk/dynamic-view/lib/helpers/index.mjs +2 -1
  91. package/esm2020/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +13 -5
  92. package/esm2020/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +9 -5
  93. package/esm2020/cdk/dynamic-view/lib/models/dynamic-view-options.mjs +1 -1
  94. package/esm2020/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.mjs +10 -0
  95. package/esm2020/cdk/dynamic-view/lib/tokens/index.mjs +2 -1
  96. package/esm2020/cdk/expandable/lib/directives/expandable-item.directive.mjs +4 -4
  97. package/esm2020/cdk/expandable/lib/directives/extandable-container.directive.mjs +4 -4
  98. package/esm2020/cdk/expandable/lib/expandable.module.mjs +5 -5
  99. package/esm2020/cdk/radio-group-control/lib/radio-control.directive.mjs +7 -7
  100. package/esm2020/cdk/radio-group-control/lib/radio-group-control.directive.mjs +4 -4
  101. package/esm2020/cdk/radio-group-control/lib/radio-group-control.module.mjs +5 -5
  102. package/esm2020/components/accordion/lib/accordion.component.mjs +4 -4
  103. package/esm2020/components/accordion/lib/accordion.module.mjs +5 -5
  104. package/esm2020/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +4 -4
  105. package/esm2020/components/accordion/lib/directives/accordion-item-title.mjs +4 -4
  106. package/esm2020/components/action-group/action-group.component.mjs +4 -4
  107. package/esm2020/components/area-header/area-header.component.mjs +4 -4
  108. package/esm2020/components/area-header/area-header.module.mjs +5 -5
  109. package/esm2020/components/area-header/directives/area-header-content.directive.mjs +4 -4
  110. package/esm2020/components/area-header/directives/area-header-subtitle.directive.mjs +4 -4
  111. package/esm2020/components/avatar/lib/avatar.component.mjs +4 -4
  112. package/esm2020/components/badge/lib/badge.component.mjs +6 -6
  113. package/esm2020/components/badge/lib/badge.directive.mjs +7 -7
  114. package/esm2020/components/button/lib/button.component.mjs +5 -5
  115. package/esm2020/components/button-group/lib/button-group.component.mjs +4 -4
  116. package/esm2020/components/checkbox/index.mjs +3 -1
  117. package/esm2020/components/checkbox/lib/checkbox.component.mjs +5 -5
  118. package/esm2020/components/checkbox/lib/checkbox.module.mjs +19 -0
  119. package/esm2020/components/checkbox/lib/checkbox.validator.mjs +28 -0
  120. package/esm2020/components/chip/index.mjs +3 -0
  121. package/esm2020/components/chip/lib/chip.component.mjs +54 -0
  122. package/esm2020/components/chip/lib/models/chip-size.mjs +5 -0
  123. package/esm2020/components/chip/lib/models/chip-variant.mjs +7 -0
  124. package/esm2020/components/chip/lib/models/index.mjs +3 -0
  125. package/esm2020/components/chip/odx-angular-components-chip.mjs +5 -0
  126. package/esm2020/components/circular-progress/index.mjs +3 -0
  127. package/esm2020/components/circular-progress/lib/circular-progress.component.mjs +91 -0
  128. package/esm2020/components/circular-progress/lib/models/circular-progress-size.mjs +7 -0
  129. package/esm2020/components/circular-progress/lib/models/index.mjs +2 -0
  130. package/esm2020/components/circular-progress/odx-angular-components-circular-progress.mjs +5 -0
  131. package/esm2020/components/content-box/lib/content-box.component.mjs +4 -4
  132. package/esm2020/components/content-box/lib/content-box.module.mjs +5 -5
  133. package/esm2020/components/content-box/lib/directives/content-box-footer-directive.mjs +4 -4
  134. package/esm2020/components/content-box/lib/directives/content-box-header-directive.mjs +4 -4
  135. package/esm2020/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +4 -4
  136. package/esm2020/components/form-field/lib/components/form-group/form-group.component.mjs +11 -13
  137. package/esm2020/components/form-field/lib/directives/form-field-control.directive.mjs +20 -13
  138. package/esm2020/components/form-field/lib/directives/form-field-error.directive.mjs +4 -4
  139. package/esm2020/components/form-field/lib/directives/form-field-hint.directive.mjs +4 -4
  140. package/esm2020/components/form-field/lib/directives/form-field-label.directive.mjs +4 -4
  141. package/esm2020/components/form-field/lib/directives/form.directive.mjs +4 -4
  142. package/esm2020/components/form-field/lib/form-field.component.mjs +4 -4
  143. package/esm2020/components/form-field/lib/form-field.config.mjs +1 -2
  144. package/esm2020/components/form-field/lib/form-field.module.mjs +5 -5
  145. package/esm2020/components/form-field/lib/form-field.service.mjs +4 -4
  146. package/esm2020/components/form-field/lib/services/form-field-error.service.mjs +4 -4
  147. package/esm2020/components/header/lib/directives/header-avatar.directive.mjs +4 -4
  148. package/esm2020/components/header/lib/directives/header-title.directive.mjs +4 -4
  149. package/esm2020/components/header/lib/header.component.mjs +4 -4
  150. package/esm2020/components/header/lib/header.module.mjs +5 -5
  151. package/esm2020/components/icon/lib/icon.component.mjs +4 -4
  152. package/esm2020/components/link/link.directive.mjs +4 -4
  153. package/esm2020/components/list/index.mjs +4 -0
  154. package/esm2020/components/list/lib/components/index.mjs +2 -0
  155. package/esm2020/components/list/lib/components/list-item.component.mjs +46 -0
  156. package/esm2020/components/list/lib/list.component.mjs +13 -0
  157. package/esm2020/components/list/lib/list.module.mjs +19 -0
  158. package/esm2020/components/list/odx-angular-components-list.mjs +5 -0
  159. package/esm2020/components/loading-spinner/index.mjs +4 -0
  160. package/esm2020/components/loading-spinner/lib/loading-spinner.component.mjs +58 -0
  161. package/esm2020/components/loading-spinner/lib/loading-spinner.directive.mjs +87 -0
  162. package/esm2020/components/loading-spinner/lib/loading-spinner.module.mjs +19 -0
  163. package/esm2020/components/loading-spinner/lib/loading-spinner.service.mjs +17 -0
  164. package/esm2020/components/loading-spinner/odx-angular-components-loading-spinner.mjs +5 -0
  165. package/esm2020/components/logo/logo.directive.mjs +4 -4
  166. package/esm2020/components/main-menu/lib/directives/main-menu-button.directive.mjs +4 -4
  167. package/esm2020/components/main-menu/lib/directives/main-menu-item.directive.mjs +20 -9
  168. package/esm2020/components/main-menu/lib/main-menu.component.mjs +7 -6
  169. package/esm2020/components/main-menu/lib/main-menu.module.mjs +5 -5
  170. package/esm2020/components/main-menu/lib/main-menu.service.mjs +4 -4
  171. package/esm2020/components/modal/lib/components/modal-footer/modal-footer.component.mjs +4 -4
  172. package/esm2020/components/modal/lib/components/modal-header/modal-header.component.mjs +10 -8
  173. package/esm2020/components/modal/lib/directives/modal-close.directive.mjs +4 -4
  174. package/esm2020/components/modal/lib/directives/modal-content.directive.mjs +4 -4
  175. package/esm2020/components/modal/lib/directives/modal-dismiss.directive.mjs +4 -4
  176. package/esm2020/components/modal/lib/modal.component.mjs +29 -16
  177. package/esm2020/components/modal/lib/modal.config.mjs +3 -1
  178. package/esm2020/components/modal/lib/modal.directive.mjs +24 -6
  179. package/esm2020/components/modal/lib/modal.module.mjs +5 -5
  180. package/esm2020/components/modal/lib/modal.service.mjs +8 -21
  181. package/esm2020/components/modal/lib/models/index.mjs +2 -1
  182. package/esm2020/components/modal/lib/models/modal-options.mjs +1 -1
  183. package/esm2020/components/modal/lib/models/modal-ref.mjs +9 -2
  184. package/esm2020/components/modal/lib/models/modal-variant.mjs +5 -0
  185. package/esm2020/components/modal/lib/services/open-modal-manager.service.mjs +4 -4
  186. package/esm2020/components/progress/index.mjs +2 -0
  187. package/esm2020/components/progress/lib/progress.component.mjs +51 -0
  188. package/esm2020/components/progress/odx-angular-components-progress.mjs +5 -0
  189. package/esm2020/components/radio-group/lib/components/radio-button/radio-button.component.mjs +5 -5
  190. package/esm2020/components/radio-group/lib/radio-group.component.mjs +4 -4
  191. package/esm2020/components/radio-group/lib/radio-group.module.mjs +5 -5
  192. package/esm2020/components/rail-navigation/index.mjs +4 -0
  193. package/esm2020/components/rail-navigation/lib/components/rail-navigation-item.component.mjs +43 -0
  194. package/esm2020/components/rail-navigation/lib/rail-navigation.component.mjs +41 -0
  195. package/esm2020/components/rail-navigation/lib/rail-navigation.module.mjs +19 -0
  196. package/esm2020/components/rail-navigation/odx-angular-components-rail-navigation.mjs +5 -0
  197. package/esm2020/components/switch/index.mjs +3 -1
  198. package/esm2020/components/switch/lib/switch.component.mjs +5 -5
  199. package/esm2020/components/switch/lib/switch.module.mjs +19 -0
  200. package/esm2020/components/switch/lib/switch.validator.mjs +28 -0
  201. package/esm2020/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +5 -5
  202. package/esm2020/components/toggle-button-group/lib/toggle-button-group.component.mjs +20 -11
  203. package/esm2020/components/toggle-button-group/lib/toggle-button-group.module.mjs +5 -5
  204. package/esm2020/lib/controllers/controller.mjs +15 -13
  205. package/esm2020/lib/controllers/disabled.controller.mjs +7 -6
  206. package/esm2020/lib/controllers/readonly.controller.mjs +7 -6
  207. package/esm2020/lib/core.module.mjs +5 -5
  208. package/esm2020/lib/directives/click-outside.directive.mjs +4 -4
  209. package/esm2020/lib/services/window-ref.mjs +4 -4
  210. package/esm2020/rxjs/index.mjs +2 -2
  211. package/esm2020/rxjs/lib/from-element-resize.mjs +14 -0
  212. package/esm2020/utils/lib/helpers/angular.mjs +5 -2
  213. package/esm2020/utils/lib/helpers/dom.mjs +24 -1
  214. package/fesm2015/odx-angular-animations.mjs +5 -3
  215. package/fesm2015/odx-angular-animations.mjs.map +1 -1
  216. package/fesm2015/odx-angular-cdk-active-indicator.mjs +142 -0
  217. package/fesm2015/odx-angular-cdk-active-indicator.mjs.map +1 -0
  218. package/fesm2015/odx-angular-cdk-checkbox-control.mjs +12 -14
  219. package/fesm2015/odx-angular-cdk-checkbox-control.mjs.map +1 -1
  220. package/fesm2015/odx-angular-cdk-custom-form-control.mjs +24 -51
  221. package/fesm2015/odx-angular-cdk-custom-form-control.mjs.map +1 -1
  222. package/fesm2015/odx-angular-cdk-dynamic-view.mjs +88 -38
  223. package/fesm2015/odx-angular-cdk-dynamic-view.mjs.map +1 -1
  224. package/fesm2015/odx-angular-cdk-expandable.mjs +10 -10
  225. package/fesm2015/odx-angular-cdk-expandable.mjs.map +1 -1
  226. package/fesm2015/odx-angular-cdk-radio-group-control.mjs +13 -13
  227. package/fesm2015/odx-angular-cdk-radio-group-control.mjs.map +1 -1
  228. package/fesm2015/odx-angular-components-accordion.mjs +13 -13
  229. package/fesm2015/odx-angular-components-accordion.mjs.map +1 -1
  230. package/fesm2015/odx-angular-components-action-group.mjs +3 -3
  231. package/fesm2015/odx-angular-components-action-group.mjs.map +1 -1
  232. package/fesm2015/odx-angular-components-area-header.mjs +13 -13
  233. package/fesm2015/odx-angular-components-area-header.mjs.map +1 -1
  234. package/fesm2015/odx-angular-components-avatar.mjs +3 -3
  235. package/fesm2015/odx-angular-components-avatar.mjs.map +1 -1
  236. package/fesm2015/odx-angular-components-badge.mjs +10 -10
  237. package/fesm2015/odx-angular-components-badge.mjs.map +1 -1
  238. package/fesm2015/odx-angular-components-button-group.mjs +3 -3
  239. package/fesm2015/odx-angular-components-button-group.mjs.map +1 -1
  240. package/fesm2015/odx-angular-components-button.mjs +4 -5
  241. package/fesm2015/odx-angular-components-button.mjs.map +1 -1
  242. package/fesm2015/odx-angular-components-checkbox.mjs +47 -7
  243. package/fesm2015/odx-angular-components-checkbox.mjs.map +1 -1
  244. package/fesm2015/odx-angular-components-chip.mjs +71 -0
  245. package/fesm2015/odx-angular-components-chip.mjs.map +1 -0
  246. package/fesm2015/odx-angular-components-circular-progress.mjs +103 -0
  247. package/fesm2015/odx-angular-components-circular-progress.mjs.map +1 -0
  248. package/fesm2015/odx-angular-components-content-box.mjs +13 -13
  249. package/fesm2015/odx-angular-components-content-box.mjs.map +1 -1
  250. package/fesm2015/odx-angular-components-form-field.mjs +52 -51
  251. package/fesm2015/odx-angular-components-form-field.mjs.map +1 -1
  252. package/fesm2015/odx-angular-components-header.mjs +13 -13
  253. package/fesm2015/odx-angular-components-header.mjs.map +1 -1
  254. package/fesm2015/odx-angular-components-icon.mjs +3 -3
  255. package/fesm2015/odx-angular-components-icon.mjs.map +1 -1
  256. package/fesm2015/odx-angular-components-link.mjs +3 -3
  257. package/fesm2015/odx-angular-components-link.mjs.map +1 -1
  258. package/fesm2015/odx-angular-components-list.mjs +79 -0
  259. package/fesm2015/odx-angular-components-list.mjs.map +1 -0
  260. package/fesm2015/odx-angular-components-loading-spinner.mjs +173 -0
  261. package/fesm2015/odx-angular-components-loading-spinner.mjs.map +1 -0
  262. package/fesm2015/odx-angular-components-logo.mjs +3 -3
  263. package/fesm2015/odx-angular-components-logo.mjs.map +1 -1
  264. package/fesm2015/odx-angular-components-main-menu.mjs +34 -23
  265. package/fesm2015/odx-angular-components-main-menu.mjs.map +1 -1
  266. package/fesm2015/odx-angular-components-modal.mjs +97 -66
  267. package/fesm2015/odx-angular-components-modal.mjs.map +1 -1
  268. package/fesm2015/odx-angular-components-progress.mjs +57 -0
  269. package/fesm2015/odx-angular-components-progress.mjs.map +1 -0
  270. package/fesm2015/odx-angular-components-radio-group.mjs +11 -11
  271. package/fesm2015/odx-angular-components-radio-group.mjs.map +1 -1
  272. package/fesm2015/odx-angular-components-rail-navigation.mjs +97 -0
  273. package/fesm2015/odx-angular-components-rail-navigation.mjs.map +1 -0
  274. package/fesm2015/odx-angular-components-switch.mjs +47 -7
  275. package/fesm2015/odx-angular-components-switch.mjs.map +1 -1
  276. package/fesm2015/odx-angular-components-toggle-button-group.mjs +26 -18
  277. package/fesm2015/odx-angular-components-toggle-button-group.mjs.map +1 -1
  278. package/fesm2015/odx-angular-rxjs.mjs +15 -6
  279. package/fesm2015/odx-angular-rxjs.mjs.map +1 -1
  280. package/fesm2015/odx-angular-utils.mjs +28 -2
  281. package/fesm2015/odx-angular-utils.mjs.map +1 -1
  282. package/fesm2015/odx-angular.mjs +38 -33
  283. package/fesm2015/odx-angular.mjs.map +1 -1
  284. package/fesm2020/odx-angular-animations.mjs +5 -6
  285. package/fesm2020/odx-angular-animations.mjs.map +1 -1
  286. package/fesm2020/odx-angular-cdk-active-indicator.mjs +142 -0
  287. package/fesm2020/odx-angular-cdk-active-indicator.mjs.map +1 -0
  288. package/fesm2020/odx-angular-cdk-checkbox-control.mjs +12 -14
  289. package/fesm2020/odx-angular-cdk-checkbox-control.mjs.map +1 -1
  290. package/fesm2020/odx-angular-cdk-custom-form-control.mjs +22 -49
  291. package/fesm2020/odx-angular-cdk-custom-form-control.mjs.map +1 -1
  292. package/fesm2020/odx-angular-cdk-dynamic-view.mjs +82 -33
  293. package/fesm2020/odx-angular-cdk-dynamic-view.mjs.map +1 -1
  294. package/fesm2020/odx-angular-cdk-expandable.mjs +10 -10
  295. package/fesm2020/odx-angular-cdk-expandable.mjs.map +1 -1
  296. package/fesm2020/odx-angular-cdk-radio-group-control.mjs +13 -13
  297. package/fesm2020/odx-angular-cdk-radio-group-control.mjs.map +1 -1
  298. package/fesm2020/odx-angular-components-accordion.mjs +13 -13
  299. package/fesm2020/odx-angular-components-accordion.mjs.map +1 -1
  300. package/fesm2020/odx-angular-components-action-group.mjs +3 -3
  301. package/fesm2020/odx-angular-components-action-group.mjs.map +1 -1
  302. package/fesm2020/odx-angular-components-area-header.mjs +13 -13
  303. package/fesm2020/odx-angular-components-area-header.mjs.map +1 -1
  304. package/fesm2020/odx-angular-components-avatar.mjs +3 -3
  305. package/fesm2020/odx-angular-components-avatar.mjs.map +1 -1
  306. package/fesm2020/odx-angular-components-badge.mjs +10 -10
  307. package/fesm2020/odx-angular-components-badge.mjs.map +1 -1
  308. package/fesm2020/odx-angular-components-button-group.mjs +3 -3
  309. package/fesm2020/odx-angular-components-button-group.mjs.map +1 -1
  310. package/fesm2020/odx-angular-components-button.mjs +4 -4
  311. package/fesm2020/odx-angular-components-button.mjs.map +1 -1
  312. package/fesm2020/odx-angular-components-checkbox.mjs +47 -7
  313. package/fesm2020/odx-angular-components-checkbox.mjs.map +1 -1
  314. package/fesm2020/odx-angular-components-chip.mjs +71 -0
  315. package/fesm2020/odx-angular-components-chip.mjs.map +1 -0
  316. package/fesm2020/odx-angular-components-circular-progress.mjs +103 -0
  317. package/fesm2020/odx-angular-components-circular-progress.mjs.map +1 -0
  318. package/fesm2020/odx-angular-components-content-box.mjs +13 -13
  319. package/fesm2020/odx-angular-components-content-box.mjs.map +1 -1
  320. package/fesm2020/odx-angular-components-form-field.mjs +52 -51
  321. package/fesm2020/odx-angular-components-form-field.mjs.map +1 -1
  322. package/fesm2020/odx-angular-components-header.mjs +13 -13
  323. package/fesm2020/odx-angular-components-header.mjs.map +1 -1
  324. package/fesm2020/odx-angular-components-icon.mjs +3 -3
  325. package/fesm2020/odx-angular-components-icon.mjs.map +1 -1
  326. package/fesm2020/odx-angular-components-link.mjs +3 -3
  327. package/fesm2020/odx-angular-components-link.mjs.map +1 -1
  328. package/fesm2020/odx-angular-components-list.mjs +78 -0
  329. package/fesm2020/odx-angular-components-list.mjs.map +1 -0
  330. package/fesm2020/odx-angular-components-loading-spinner.mjs +172 -0
  331. package/fesm2020/odx-angular-components-loading-spinner.mjs.map +1 -0
  332. package/fesm2020/odx-angular-components-logo.mjs +3 -3
  333. package/fesm2020/odx-angular-components-logo.mjs.map +1 -1
  334. package/fesm2020/odx-angular-components-main-menu.mjs +34 -23
  335. package/fesm2020/odx-angular-components-main-menu.mjs.map +1 -1
  336. package/fesm2020/odx-angular-components-modal.mjs +96 -65
  337. package/fesm2020/odx-angular-components-modal.mjs.map +1 -1
  338. package/fesm2020/odx-angular-components-progress.mjs +57 -0
  339. package/fesm2020/odx-angular-components-progress.mjs.map +1 -0
  340. package/fesm2020/odx-angular-components-radio-group.mjs +11 -11
  341. package/fesm2020/odx-angular-components-radio-group.mjs.map +1 -1
  342. package/fesm2020/odx-angular-components-rail-navigation.mjs +96 -0
  343. package/fesm2020/odx-angular-components-rail-navigation.mjs.map +1 -0
  344. package/fesm2020/odx-angular-components-switch.mjs +47 -7
  345. package/fesm2020/odx-angular-components-switch.mjs.map +1 -1
  346. package/fesm2020/odx-angular-components-toggle-button-group.mjs +26 -18
  347. package/fesm2020/odx-angular-components-toggle-button-group.mjs.map +1 -1
  348. package/fesm2020/odx-angular-rxjs.mjs +15 -6
  349. package/fesm2020/odx-angular-rxjs.mjs.map +1 -1
  350. package/fesm2020/odx-angular-utils.mjs +28 -2
  351. package/fesm2020/odx-angular-utils.mjs.map +1 -1
  352. package/fesm2020/odx-angular.mjs +38 -33
  353. package/fesm2020/odx-angular.mjs.map +1 -1
  354. package/lib/controllers/controller.d.ts +1 -2
  355. package/package.json +59 -2
  356. package/rxjs/index.d.ts +1 -1
  357. package/rxjs/lib/from-element-resize.d.ts +2 -0
  358. package/utils/lib/helpers/angular.d.ts +2 -1
  359. package/utils/lib/helpers/dom.d.ts +5 -1
  360. package/esm2020/rxjs/lib/mark-for-check.mjs +0 -5
  361. package/rxjs/lib/mark-for-check.d.ts +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odx-angular-cdk-active-indicator.mjs","sources":["../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-direction.ts","../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-position.ts","../../../../libs/angular/cdk/active-indicator/src/lib/active-indicator.directive.ts","../../../../libs/angular/cdk/active-indicator/src/odx-angular-cdk-active-indicator.ts"],"sourcesContent":["export type ActiveIndicatorDirection = typeof ActiveIndicatorDirection[keyof typeof ActiveIndicatorDirection];\n\nexport const ActiveIndicatorDirection = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical',\n} as const;\n","export type ActiveIndicatorPosition = typeof ActiveIndicatorPosition[keyof typeof ActiveIndicatorPosition];\n\nexport const ActiveIndicatorPosition = {\n START: 'start',\n CENTER: 'center',\n END: 'end',\n} as const;\n","import { AfterViewInit, Directive, Input, OnChanges } from '@angular/core';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { fromElementResize$ } from '@odx/angular/rxjs';\nimport { applyStyles, disableCSSTransitions, hasChanged, injectElement, NgChanges, px, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, distinctUntilChanged, EMPTY, switchMap } from 'rxjs';\nimport { ActiveIndicatorPosition } from './models';\nimport { ActiveIndicatorDirection } from './models/active-indicator-direction';\n\n@CSSComponent('cdk-active-indicator')\n@Directive({\n standalone: true,\n selector: '[odxActiveIndicator]',\n})\nexport class ActiveIndicatorDirective implements OnChanges, AfterViewInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly parentElement$$ = new BehaviorSubject<HTMLElement | null>(null);\n private readonly onResize$ = this.parentElement$$.pipe(\n distinctUntilChanged(),\n switchMap((parentElement) => {\n return parentElement ? fromElementResize$(parentElement) : EMPTY;\n })\n );\n public readonly element = injectElement();\n\n @CSSModifier()\n protected isActive = false;\n\n @Input('odxActiveIndicator')\n public activeElement?: HTMLElement | null = null;\n\n @Input('odxActiveIndicatorParent')\n public set parent(value: HTMLElement | null) {\n this.parentElement$$.next(value);\n }\n\n @CSSModifier()\n @Input('odxActiveIndicatorDirection')\n public direction: ActiveIndicatorDirection = ActiveIndicatorDirection.HORIZONTAL;\n\n @Input('odxActiveIndicatorPosition')\n public position: ActiveIndicatorPosition = ActiveIndicatorPosition.CENTER;\n\n public ngAfterViewInit(): void {\n this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles(true));\n if (!this.parentElement$$.getValue()) {\n this.parentElement$$.next(this.element.nativeElement.parentElement);\n }\n }\n\n public ngOnChanges(changes: NgChanges<ActiveIndicatorDirective>): void {\n if (hasChanged(changes, 'activeElement', false)) {\n this.isActive = !!this.activeElement;\n }\n if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {\n this.updateStyles();\n }\n }\n\n private updateStyles(disableTransition = false): void {\n if (!this.activeElement) return;\n const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;\n const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;\n const relativeOffset = this.getIndicatorRelativeOffset();\n\n let transform = null;\n if (isHorizontal) {\n const positionX = this.getIndicatorPositionX(this.activeElement);\n transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;\n }\n if (isVertical) {\n const positionY = this.getIndicatorPositionY(this.activeElement);\n transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;\n }\n\n disableTransition && disableCSSTransitions(this.element.nativeElement, true);\n applyStyles(this.element.nativeElement, {\n transform,\n width: isHorizontal ? px(this.activeElement.offsetWidth) : null,\n height: isVertical ? px(this.activeElement.offsetHeight) : null,\n });\n disableTransition && disableCSSTransitions(this.element.nativeElement, false);\n }\n\n private getIndicatorPositionX(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetLeft;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetLeft + activeElement.offsetWidth / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetLeft + activeElement.offsetWidth;\n }\n }\n\n private getIndicatorPositionY(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetTop;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetTop + activeElement.offsetHeight / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetTop + activeElement.offsetHeight;\n }\n }\n\n private getIndicatorRelativeOffset(): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return 0;\n case ActiveIndicatorPosition.CENTER:\n return -50;\n case ActiveIndicatorPosition.END:\n return -100;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEa,MAAA,wBAAwB,GAAG;AACtC,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,QAAQ,EAAE,UAAU;;;ACFT,MAAA,uBAAuB,GAAG;AACrC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,GAAG,EAAE,KAAK;;;ACQC,IAAA,wBAAwB,GAA9B,MAAM,wBAAwB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACY,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,eAAe,CAAqB,IAAI,CAAC,CAAC;AAChE,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CACpD,oBAAoB,EAAE,EACtB,SAAS,CAAC,CAAC,aAAa,KAAI;AAC1B,YAAA,OAAO,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;SAClE,CAAC,CACH,CAAC;QACc,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QAGhC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAGpB,IAAa,CA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;AAAC,IAAA,WAAW,EAAE;;AACa,CAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAU3B,UAAA,CAAA;AAAC,IAAA,WAAW,EAAE;;AAEmE,CAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAxBtE,wBAAwB,GAAA,UAAA,CAAA;IALpC,YAAY,CAAC,sBAAsB,CAAC;AAKxB,CAAA,EAAA,wBAAwB,CAsGpC,CAAA;4FAtGY,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;AAaW,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,QAAQ,MAGX,aAAa,EAAA,CAAA;sBADnB,KAAK;uBAAC,oBAAoB,CAAA;gBAIhB,MAAM,EAAA,CAAA;sBADhB,KAAK;uBAAC,0BAA0B,CAAA;gBAO1B,SAAS,EAAA,CAAA;sBADf,KAAK;uBAAC,6BAA6B,CAAA;gBAI7B,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,4BAA4B,CAAA;;;ACvCrC;;AAEG;;;;"}
@@ -1,6 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, Directive, Input } from '@angular/core';
3
- import { Validators } from '@angular/forms';
2
+ import { Directive, Input } from '@angular/core';
4
3
  import { detectControllerChanges } from '@odx/angular';
5
4
  import { CustomFormControl } from '@odx/angular/cdk/custom-form-control';
6
5
  import { injectElement, booleanToAttributeString } from '@odx/angular/utils';
@@ -9,14 +8,15 @@ class CheckBoxControl extends CustomFormControl {
9
8
  constructor() {
10
9
  super(false);
11
10
  this.element = injectElement();
12
- this.value = null;
13
- detectControllerChanges(inject(ChangeDetectorRef), this).subscribe();
11
+ // eslint-disable-next-line @angular-eslint/no-input-rename
12
+ this.controlValue = null;
13
+ detectControllerChanges(this).subscribe();
14
14
  }
15
15
  set checked(value) {
16
- this.controlValue = value;
16
+ this.value = value;
17
17
  }
18
18
  get checked() {
19
- return this.controlValue;
19
+ return this.value;
20
20
  }
21
21
  get ariaChecked() {
22
22
  return booleanToAttributeString(this.checked);
@@ -25,21 +25,19 @@ class CheckBoxControl extends CustomFormControl {
25
25
  event.stopPropagation();
26
26
  super.updateValue(event.target.checked);
27
27
  }
28
- updateRequiredValidator() {
29
- this.toggleValidator(Validators.requiredTrue, this.required);
30
- }
31
28
  }
32
- CheckBoxControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CheckBoxControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
33
- CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: CheckBoxControl, selector: "[odxCheckBoxControl]", inputs: { checked: "checked", value: "value" }, usesInheritance: true, ngImport: i0 });
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CheckBoxControl, decorators: [{
29
+ CheckBoxControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: CheckBoxControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
30
+ CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: CheckBoxControl, selector: "[odxCheckBoxControl]", inputs: { checked: "checked", controlValue: ["value", "controlValue"] }, usesInheritance: true, ngImport: i0 });
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: CheckBoxControl, decorators: [{
35
32
  type: Directive,
36
33
  args: [{
37
34
  selector: '[odxCheckBoxControl]',
38
35
  }]
39
36
  }], ctorParameters: function () { return []; }, propDecorators: { checked: [{
40
37
  type: Input
41
- }], value: [{
42
- type: Input
38
+ }], controlValue: [{
39
+ type: Input,
40
+ args: ['value']
43
41
  }] } });
44
42
 
45
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-checkbox-control.mjs","sources":["../../../../libs/angular/cdk/checkbox-control/src/lib/checkbox-control.directive.ts","../../../../libs/angular/cdk/checkbox-control/src/odx-angular-cdk-checkbox-control.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, inject, Input } from '@angular/core';\nimport { Validators } from '@angular/forms';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { booleanToAttributeString, injectElement } from '@odx/angular/utils';\n\n@Directive({\n selector: '[odxCheckBoxControl]',\n})\nexport class CheckBoxControl extends CustomFormControl<boolean> {\n public static ngAcceptInputType_checked: BooleanInput;\n\n public readonly element = injectElement();\n\n @Input()\n public set checked(value: boolean) {\n this.controlValue = value;\n }\n public get checked(): boolean {\n return this.controlValue;\n }\n\n @Input()\n public value: string | null = null;\n\n public get ariaChecked(): string {\n return booleanToAttributeString(this.checked);\n }\n\n constructor() {\n super(false);\n detectControllerChanges(inject(ChangeDetectorRef), this).subscribe();\n }\n\n public onChanged(event: Event): void {\n event.stopPropagation();\n super.updateValue((event.target as HTMLInputElement).checked);\n }\n\n protected override updateRequiredValidator(): void {\n this.toggleValidator(Validators.requiredTrue, this.required);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUM,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;AAoB7D,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,KAAK,CAAC,CAAC;QAlBC,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QAWnC,IAAK,CAAA,KAAA,GAAkB,IAAI,CAAC;QAQjC,uBAAuB,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;KACtE;IAlBD,IACW,OAAO,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;KAC3B;AACD,IAAA,IAAW,OAAO,GAAA;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC;KAC1B;AAKD,IAAA,IAAW,WAAW,GAAA;AACpB,QAAA,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC/C;AAOM,IAAA,SAAS,CAAC,KAAY,EAAA;QAC3B,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,WAAW,CAAE,KAAK,CAAC,MAA2B,CAAC,OAAO,CAAC,CAAC;KAC/D;IAEkB,uBAAuB,GAAA;QACxC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC9D;;4GAhCU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;gGAAf,eAAe,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;0EAOY,OAAO,EAAA,CAAA;sBADjB,KAAK;gBASC,KAAK,EAAA,CAAA;sBADX,KAAK;;;ACvBR;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-checkbox-control.mjs","sources":["../../../../libs/angular/cdk/checkbox-control/src/lib/checkbox-control.directive.ts","../../../../libs/angular/cdk/checkbox-control/src/odx-angular-cdk-checkbox-control.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, Input } from '@angular/core';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { booleanToAttributeString, injectElement } from '@odx/angular/utils';\n\n@Directive({\n selector: '[odxCheckBoxControl]',\n})\nexport class CheckBoxControl extends CustomFormControl<boolean> {\n public static ngAcceptInputType_checked: BooleanInput;\n\n public readonly element = injectElement();\n\n @Input()\n public set checked(value: boolean) {\n this.value = value;\n }\n public get checked(): boolean {\n return this.value;\n }\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value')\n public controlValue: string | null = null;\n\n public get ariaChecked(): string {\n return booleanToAttributeString(this.checked);\n }\n\n constructor() {\n super(false);\n detectControllerChanges(this).subscribe();\n }\n\n public onChanged(event: Event): void {\n event.stopPropagation();\n super.updateValue((event.target as HTMLInputElement).checked);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASM,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;AAqB7D,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,KAAK,CAAC,CAAC;QAnBC,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;;QAYnC,IAAY,CAAA,YAAA,GAAkB,IAAI,CAAC;AAQxC,QAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;KAC3C;IAnBD,IACW,OAAO,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACpB;AACD,IAAA,IAAW,OAAO,GAAA;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC;KACnB;AAMD,IAAA,IAAW,WAAW,GAAA;AACpB,QAAA,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC/C;AAOM,IAAA,SAAS,CAAC,KAAY,EAAA;QAC3B,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,WAAW,CAAE,KAAK,CAAC,MAA2B,CAAC,OAAO,CAAC,CAAC;KAC/D;;6GA7BU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;iGAAf,eAAe,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,OAAA,EAAA,cAAA,CAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;0EAOY,OAAO,EAAA,CAAA;sBADjB,KAAK;gBAUC,YAAY,EAAA,CAAA;sBADlB,KAAK;uBAAC,OAAO,CAAA;;;ACvBhB;;AAEG;;;;"}
@@ -1,19 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Directive, inject, Input, ViewChild } from '@angular/core';
3
3
  import { injectElement } from '@odx/angular/utils';
4
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
5
- import { NgControl, Validators } from '@angular/forms';
4
+ import { RequiredValidator, NgControl, Validators } from '@angular/forms';
6
5
  import { Controller, DisabledController, ReadonlyController } from '@odx/angular';
7
- import { filter, EMPTY } from 'rxjs';
8
6
 
9
7
  class ControlDirective {
10
8
  constructor() {
11
9
  this.element = injectElement();
12
10
  }
13
11
  }
14
- ControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
15
- ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ControlDirective, isStandalone: true, selector: "[odxControl]", exportAs: ["odxControl"], ngImport: i0 });
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ControlDirective, decorators: [{
12
+ ControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
13
+ ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: ControlDirective, isStandalone: true, selector: "[odxControl]", exportAs: ["odxControl"], ngImport: i0 });
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ControlDirective, decorators: [{
17
15
  type: Directive,
18
16
  args: [{
19
17
  standalone: true,
@@ -25,10 +23,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
25
23
  class CustomFormControl extends Controller {
26
24
  constructor(initialValue) {
27
25
  super();
28
- this.isRequired = false;
26
+ this.requiredValidator = inject(RequiredValidator, { optional: true, self: true });
29
27
  this.disabledController = DisabledController.inject();
30
28
  this.readonlyController = ReadonlyController.inject();
31
- this.enabled$ = this.disabledController?.change$.pipe(filter(() => !this.isDisabled)) ?? EMPTY;
32
29
  this.ngControl = inject(NgControl, { self: true, optional: true });
33
30
  this.id = null;
34
31
  this.name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;
@@ -37,22 +34,14 @@ class CustomFormControl extends Controller {
37
34
  if (this.ngControl) {
38
35
  this.ngControl.valueAccessor = this;
39
36
  }
40
- this.enabled$.subscribe(() => this.updateRequiredValidator());
41
37
  }
42
- set required(value) {
43
- this.isRequired = coerceBooleanProperty(value);
44
- this.updateRequiredValidator();
45
- }
46
- get required() {
47
- return this.isRequired;
48
- }
49
- set controlValue(value) {
38
+ set value(value) {
50
39
  if (this.internalValue !== value) {
51
40
  this.internalValue = value;
52
41
  this.triggerControllerChange();
53
42
  }
54
43
  }
55
- get controlValue() {
44
+ get value() {
56
45
  return this.internalValue;
57
46
  }
58
47
  get hasError() {
@@ -64,14 +53,14 @@ class CustomFormControl extends Controller {
64
53
  get isReadonly() {
65
54
  return !!this.readonlyController?.readonly;
66
55
  }
67
- ngAfterContentInit() {
68
- this.updateRequiredValidator();
56
+ get isRequired() {
57
+ return !!this.requiredValidator?.required || this.hasValidator(Validators.required) || this.hasValidator(Validators.requiredTrue);
69
58
  }
70
59
  onTouched() {
71
- // empty;
60
+ // implemented by control value accessor
72
61
  }
73
62
  onChange(_value) {
74
- // empty
63
+ // implemented by control value accessor
75
64
  }
76
65
  registerOnChange(fn) {
77
66
  this.onChange = fn;
@@ -83,39 +72,25 @@ class CustomFormControl extends Controller {
83
72
  this.disabledController?.setDisabledState(isDisabled);
84
73
  }
85
74
  writeValue(value) {
86
- this.controlValue = value;
75
+ if (this.isDisabled)
76
+ return;
77
+ this.value = value;
78
+ this.onChange(value);
87
79
  }
88
80
  updateValue(value) {
81
+ if (this.isDisabled)
82
+ return;
89
83
  this.writeValue(value);
90
- this.onChange(value);
91
84
  this.onTouched();
92
85
  }
93
- toggleValidator(validator, state) {
94
- const control = this.ngControl?.control;
95
- if (!control)
96
- return;
97
- const hasValidator = control.hasValidator(validator);
98
- if (state && hasValidator)
99
- return;
100
- if (!state && !hasValidator)
101
- return;
102
- if (state) {
103
- control.addValidators(validator);
104
- }
105
- else {
106
- control.removeValidators(validator);
107
- }
108
- control.updateValueAndValidity();
109
- control.markAsUntouched();
110
- }
111
- updateRequiredValidator() {
112
- this.toggleValidator(Validators.required, this.isRequired);
86
+ hasValidator(validator) {
87
+ return !!this.ngControl?.control?.hasValidator(validator);
113
88
  }
114
89
  }
115
90
  CustomFormControl.CURRENT_INDEX = 0;
116
- CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CustomFormControl, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
117
- CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: CustomFormControl, inputs: { id: "id", name: "name", required: "required" }, host: { properties: { "class.has-error": "hasError", "class.is-disabled": "isDisabled", "class.is-readonly": "isReadonly", "class.is-required": "required" } }, viewQueries: [{ propertyName: "control", first: true, predicate: ControlDirective, descendants: true }], usesInheritance: true, ngImport: i0 });
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CustomFormControl, decorators: [{
91
+ CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: CustomFormControl, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
92
+ CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: CustomFormControl, inputs: { id: "id", name: "name" }, host: { properties: { "class.has-error": "hasError", "class.is-disabled": "isDisabled", "class.is-readonly": "isReadonly", "class.is-required": "required" } }, viewQueries: [{ propertyName: "control", first: true, predicate: ControlDirective, descendants: true }], usesInheritance: true, ngImport: i0 });
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: CustomFormControl, decorators: [{
119
94
  type: Directive,
120
95
  args: [{
121
96
  host: {
@@ -129,8 +104,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
129
104
  type: Input
130
105
  }], name: [{
131
106
  type: Input
132
- }], required: [{
133
- type: Input
134
107
  }], control: [{
135
108
  type: ViewChild,
136
109
  args: [ControlDirective]
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-custom-form-control.mjs","sources":["../../../../libs/angular/cdk/custom-form-control/src/lib/control.directive.ts","../../../../libs/angular/cdk/custom-form-control/src/lib/custom-form-control.ts","../../../../libs/angular/cdk/custom-form-control/src/odx-angular-cdk-custom-form-control.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\n\n@Directive({\n standalone: true,\n selector: '[odxControl]',\n exportAs: 'odxControl',\n})\nexport class ControlDirective {\n public readonly element = injectElement();\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { AfterContentInit, Directive, inject, Input, ViewChild } from '@angular/core';\nimport { ControlValueAccessor, NgControl, ValidatorFn, Validators } from '@angular/forms';\nimport { Controller, DisabledController, ReadonlyController } from '@odx/angular';\nimport { EMPTY, filter } from 'rxjs';\nimport { ControlDirective } from './control.directive';\n\n@Directive({\n host: {\n '[class.has-error]': 'hasError',\n '[class.is-disabled]': 'isDisabled',\n '[class.is-readonly]': 'isReadonly',\n '[class.is-required]': 'required',\n },\n})\nexport abstract class CustomFormControl<T> extends Controller implements ControlValueAccessor, AfterContentInit {\n private static CURRENT_INDEX = 0;\n public static ngAcceptInputType_required: BooleanInput;\n\n private internalValue: T;\n private isRequired = false;\n protected readonly disabledController = DisabledController.inject();\n protected readonly readonlyController = ReadonlyController.inject();\n protected readonly enabled$ = this.disabledController?.change$.pipe(filter(() => !this.isDisabled)) ?? EMPTY;\n protected readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n @Input()\n public id: string | null = null;\n\n @Input()\n public name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;\n\n @Input()\n public set required(value: unknown) {\n this.isRequired = coerceBooleanProperty(value);\n this.updateRequiredValidator();\n }\n public get required(): boolean {\n return this.isRequired;\n }\n\n public set controlValue(value: T) {\n if (this.internalValue !== value) {\n this.internalValue = value;\n this.triggerControllerChange();\n }\n }\n public get controlValue(): T {\n return this.internalValue;\n }\n\n public get hasError(): boolean {\n return !!this.ngControl?.touched && !!this.ngControl?.invalid;\n }\n\n public get isDisabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n public get isReadonly(): boolean {\n return !!this.readonlyController?.readonly;\n }\n\n @ViewChild(ControlDirective)\n public readonly control: ControlDirective | null = null;\n\n constructor(initialValue: T) {\n super();\n this.internalValue = initialValue;\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n this.enabled$.subscribe(() => this.updateRequiredValidator());\n }\n\n public ngAfterContentInit(): void {\n this.updateRequiredValidator();\n }\n\n public onTouched() {\n // empty;\n }\n\n public onChange(_value: T) {\n // empty\n }\n\n public registerOnChange(fn: (value: T) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.disabledController?.setDisabledState(isDisabled);\n }\n\n public writeValue(value: T): void {\n this.controlValue = value;\n }\n\n public updateValue(value: T): void {\n this.writeValue(value);\n this.onChange(value);\n this.onTouched();\n }\n\n protected toggleValidator(validator: ValidatorFn, state: boolean): void {\n const control = this.ngControl?.control;\n if (!control) return;\n const hasValidator = control.hasValidator(validator);\n if (state && hasValidator) return;\n if (!state && !hasValidator) return;\n if (state) {\n control.addValidators(validator);\n } else {\n control.removeValidators(validator);\n }\n control.updateValueAndValidity();\n control.markAsUntouched();\n }\n\n protected updateRequiredValidator(): void {\n this.toggleValidator(Validators.required, this.isRequired);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAQa,gBAAgB,CAAA;AAL7B,IAAA,WAAA,GAAA;QAMkB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAC3C,KAAA;;6GAFY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;iGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAA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AA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAhDP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBARtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,IAAI,EAAE;AACJ,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,qBAAqB,EAAE,UAAU;AAClC,qBAAA;AACF,iBAAA,CAAA;6FAaQ,EAAE,EAAA,CAAA;sBADR,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIK,QAAQ,EAAA,CAAA;sBADlB,KAAK;gBAgCU,OAAO,EAAA,CAAA;sBADtB,SAAS;uBAAC,gBAAgB,CAAA;;;AC/D7B;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-custom-form-control.mjs","sources":["../../../../libs/angular/cdk/custom-form-control/src/lib/control.directive.ts","../../../../libs/angular/cdk/custom-form-control/src/lib/custom-form-control.ts","../../../../libs/angular/cdk/custom-form-control/src/odx-angular-cdk-custom-form-control.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\n\n@Directive({\n standalone: true,\n selector: '[odxControl]',\n exportAs: 'odxControl',\n})\nexport class ControlDirective {\n public readonly element = injectElement();\n}\n","import { Directive, inject, Input, ViewChild } from '@angular/core';\nimport { ControlValueAccessor, NgControl, RequiredValidator, ValidatorFn, Validators } from '@angular/forms';\nimport { Controller, DisabledController, ReadonlyController } from '@odx/angular';\nimport { ControlDirective } from './control.directive';\n\n@Directive({\n host: {\n '[class.has-error]': 'hasError',\n '[class.is-disabled]': 'isDisabled',\n '[class.is-readonly]': 'isReadonly',\n '[class.is-required]': 'required',\n },\n})\nexport abstract class CustomFormControl<T> extends Controller implements ControlValueAccessor {\n private static CURRENT_INDEX = 0;\n\n private readonly requiredValidator = inject(RequiredValidator, { optional: true, self: true });\n private internalValue: T;\n protected readonly disabledController = DisabledController.inject();\n protected readonly readonlyController = ReadonlyController.inject();\n protected readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n @Input()\n public id: string | null = null;\n\n @Input()\n public name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;\n\n public set value(value: T) {\n if (this.internalValue !== value) {\n this.internalValue = value;\n this.triggerControllerChange();\n }\n }\n public get value(): T {\n return this.internalValue;\n }\n\n public get hasError(): boolean {\n return !!this.ngControl?.touched && !!this.ngControl?.invalid;\n }\n\n public get isDisabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n public get isReadonly(): boolean {\n return !!this.readonlyController?.readonly;\n }\n\n public get isRequired(): boolean {\n return !!this.requiredValidator?.required || this.hasValidator(Validators.required) || this.hasValidator(Validators.requiredTrue);\n }\n\n @ViewChild(ControlDirective)\n public readonly control: ControlDirective | null = null;\n\n constructor(initialValue: T) {\n super();\n this.internalValue = initialValue;\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public onTouched() {\n // implemented by control value accessor\n }\n\n public onChange(_value: T) {\n // implemented by control value accessor\n }\n\n public registerOnChange(fn: (value: T) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.disabledController?.setDisabledState(isDisabled);\n }\n\n public writeValue(value: T): void {\n if (this.isDisabled) return;\n this.value = value;\n this.onChange(value);\n }\n\n public updateValue(value: T): void {\n if (this.isDisabled) return;\n this.writeValue(value);\n this.onTouched();\n }\n\n protected hasValidator(validator: ValidatorFn): boolean {\n return !!this.ngControl?.control?.hasValidator(validator);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAQa,gBAAgB,CAAA;AAL7B,IAAA,WAAA,GAAA;QAMkB,IAAO,CAAA,OAAA,G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A,qBAAqB,EAAE,UAAU;AAClC,qBAAA;AACF,iBAAA,CAAA;6FAWQ,EAAE,EAAA,CAAA;sBADR,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBA8BU,OAAO,EAAA,CAAA;sBADtB,SAAS;uBAAC,gBAAgB,CAAA;;;ACtD7B;;AAEG;;;;"}
@@ -1,24 +1,36 @@
1
- import { AsyncPipe } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, ChangeDetectorRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ApplicationRef, createComponent, EnvironmentInjector, InjectionToken, Injector, Injectable, ViewContainerRef, Directive } from '@angular/core';
4
- import { isObservable } from 'rxjs';
5
- import { isString, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
2
+ import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, reflectComponentType, ApplicationRef, createComponent, EnvironmentInjector, InjectionToken, inject, Injector, Injectable, ViewContainerRef, TemplateRef, Directive } from '@angular/core';
3
+ import { injectElement, isString, isViewContainer, getInjector, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
4
+ import { isObservable, distinctUntilChanged } from 'rxjs';
5
+ import { DOCUMENT } from '@angular/common';
6
6
 
7
7
  class DynamicViewComponent {
8
8
  constructor() {
9
- this.asyncPipe = new AsyncPipe(inject(ChangeDetectorRef));
10
- this.resolveContent = () => null;
9
+ this.element = injectElement();
10
+ this.currentSubscription = null;
11
11
  }
12
12
  set content(value) {
13
- this.resolveContent = isObservable(value) ? () => this.asyncPipe.transform(value) : () => value;
13
+ if (isObservable(value)) {
14
+ this.ngOnDestroy();
15
+ this.currentSubscription = value.pipe(distinctUntilChanged()).subscribe((innerValue) => {
16
+ this.setContent(innerValue);
17
+ });
18
+ }
19
+ else {
20
+ this.setContent(value);
21
+ }
14
22
  }
15
23
  ngOnDestroy() {
16
- this.asyncPipe?.ngOnDestroy();
24
+ this.currentSubscription?.unsubscribe();
25
+ this.currentSubscription = null;
26
+ }
27
+ setContent(value) {
28
+ this.element.nativeElement.innerHTML = value;
17
29
  }
18
30
  }
19
- DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
20
- DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: DynamicViewComponent, isStandalone: true, selector: "odx-dynamic-view", inputs: { content: "content" }, host: { properties: { "innerHTML": "resolveContent()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewComponent, decorators: [{
31
+ DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
32
+ DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.10", type: DynamicViewComponent, isStandalone: true, selector: "odx-dynamic-view", inputs: { content: "content" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewComponent, decorators: [{
22
34
  type: Component,
23
35
  args: [{
24
36
  selector: 'odx-dynamic-view',
@@ -26,14 +38,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
26
38
  changeDetection: ChangeDetectionStrategy.OnPush,
27
39
  encapsulation: ViewEncapsulation.None,
28
40
  standalone: true,
29
- host: {
30
- '[innerHTML]': 'resolveContent()',
31
- },
32
41
  }]
33
42
  }], propDecorators: { content: [{
34
43
  type: Input
35
44
  }] } });
36
45
 
46
+ function createProjectableNodes(component, nodes) {
47
+ const componentType = reflectComponentType(component);
48
+ if (componentType && componentType.ngContentSelectors.length > 0) {
49
+ return componentType.ngContentSelectors.map((selector) => (selector === '*' ? nodes : []));
50
+ }
51
+ return [];
52
+ }
53
+
37
54
  function isDynamicTextContent(value) {
38
55
  return isString(value) || isObservable(value);
39
56
  }
@@ -43,16 +60,20 @@ class DynamicComponentRef {
43
60
  this.options = options;
44
61
  this.application = this.options.injector.get(ApplicationRef);
45
62
  this.componentRef = null;
46
- const { component, context, injector, vcr } = options;
63
+ const { component, context, injector, projectableNodes, host } = options;
47
64
  this.componentRef = createComponent(component, {
48
65
  environmentInjector: injector.get(EnvironmentInjector),
49
66
  elementInjector: injector,
67
+ projectableNodes,
50
68
  });
51
- if (vcr) {
52
- vcr.insert(this.componentRef.hostView);
69
+ if (isViewContainer(host)) {
70
+ host.insert(this.componentRef.hostView);
53
71
  }
54
72
  else {
55
73
  this.application.attachView(this.componentRef.hostView);
74
+ if (host) {
75
+ host.appendChild(this.getElement());
76
+ }
56
77
  }
57
78
  if (context) {
58
79
  this.update(context);
@@ -66,7 +87,7 @@ class DynamicComponentRef {
66
87
  this.componentRef = null;
67
88
  return;
68
89
  }
69
- if (this.componentRef && !this.options.vcr) {
90
+ if (this.componentRef && !isViewContainer(this.options.host)) {
70
91
  this.application.detachView(this.componentRef.hostView);
71
92
  }
72
93
  this.componentRef?.destroy();
@@ -80,6 +101,9 @@ class DynamicComponentRef {
80
101
  this.componentRef?.setInput(key, context[key]);
81
102
  }
82
103
  }
104
+ getContext() {
105
+ return this.options.context ?? {};
106
+ }
83
107
  getView() {
84
108
  return this.componentRef?.hostView ?? null;
85
109
  }
@@ -100,7 +124,7 @@ class DynamicTemplateRef {
100
124
  this.embeddedViewRef = null;
101
125
  return;
102
126
  }
103
- if (!this.options.vcr && this.embeddedViewRef) {
127
+ if (!isViewContainer(this.options.host) && this.embeddedViewRef) {
104
128
  this.application.detachView(this.embeddedViewRef);
105
129
  }
106
130
  this.embeddedViewRef?.destroy();
@@ -115,12 +139,15 @@ class DynamicTemplateRef {
115
139
  this.detectChanges();
116
140
  }
117
141
  }
142
+ getContext() {
143
+ return this.options.context ?? {};
144
+ }
118
145
  getView() {
119
146
  return this.embeddedViewRef;
120
147
  }
121
- create({ context, template, vcr }) {
122
- if (vcr) {
123
- this.embeddedViewRef = vcr.createEmbeddedView(template, context, { injector: this.options.injector });
148
+ create({ context, template, host }) {
149
+ if (isViewContainer(host)) {
150
+ this.embeddedViewRef = host.createEmbeddedView(template, context, { injector: this.options.injector });
124
151
  }
125
152
  else {
126
153
  this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);
@@ -135,15 +162,25 @@ function isDynamicView(value) {
135
162
 
136
163
  const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');
137
164
 
165
+ const ODX_DYNAMIC_VIEW_DEFAULT_HOST = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewDefaultHost', {
166
+ providedIn: 'root',
167
+ factory: () => inject(DOCUMENT).body,
168
+ });
169
+ function getDynamicViewDefaultHost() {
170
+ return inject(ODX_DYNAMIC_VIEW_DEFAULT_HOST);
171
+ }
172
+
138
173
  class DynamicViewService {
139
174
  constructor() {
140
- this.injector = inject(Injector);
175
+ this.injector = getInjector();
176
+ this.defaultHost = getDynamicViewDefaultHost();
141
177
  }
142
178
  createView(content, options = {}) {
143
179
  const viewOptions = {
144
180
  ...options,
181
+ host: options.host ?? this.defaultHost,
145
182
  injector: Injector.create({
146
- providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],
183
+ providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, options.providers ?? []],
147
184
  parent: options.injector ?? this.injector,
148
185
  }),
149
186
  };
@@ -163,9 +200,9 @@ class DynamicViewService {
163
200
  throw new Error('Content type is not supported');
164
201
  }
165
202
  }
166
- DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
167
- DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewService, providedIn: 'root' });
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewService, decorators: [{
203
+ DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
204
+ DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewService, providedIn: 'root' });
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewService, decorators: [{
169
206
  type: Injectable,
170
207
  args: [{ providedIn: 'root' }]
171
208
  }] });
@@ -174,7 +211,10 @@ class DynamicViewDirective {
174
211
  constructor() {
175
212
  this.dynamicViewService = inject(DynamicViewService);
176
213
  this.viewContainer = inject(ViewContainerRef);
214
+ this.template = inject(TemplateRef);
177
215
  this.viewRef = null;
216
+ this.contentViewRef = null;
217
+ // eslint-disable-next-line @angular-eslint/no-input-rename
178
218
  this.content = null;
179
219
  }
180
220
  ngOnInit() {
@@ -214,24 +254,33 @@ class DynamicViewDirective {
214
254
  }
215
255
  }
216
256
  else {
257
+ let projectableNodes = [];
258
+ if (isComponent(this.content)) {
259
+ this.contentViewRef = this.dynamicViewService.createView(this.template, { injector: this.injector });
260
+ const rootNodes = this.contentViewRef.getView().rootNodes;
261
+ projectableNodes = createProjectableNodes(this.content, rootNodes);
262
+ }
217
263
  this.viewRef = this.dynamicViewService.createView(this.content, {
218
264
  context: this.context ?? undefined,
219
265
  injector: this.injector ?? this.viewContainer.injector,
220
- vcr: this.viewContainer,
266
+ projectableNodes,
267
+ host: this.viewContainer,
221
268
  });
222
269
  }
223
270
  }
224
271
  destroy() {
272
+ this.contentViewRef?.destroy();
225
273
  this.viewRef?.destroy();
274
+ this.contentViewRef = null;
226
275
  this.viewRef = null;
227
276
  }
228
277
  }
229
- DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
230
- DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: DynamicViewDirective, isStandalone: true, selector: "[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 });
231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicViewDirective, decorators: [{
278
+ DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
279
+ DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: DynamicViewDirective, isStandalone: true, selector: "ng-template[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 });
280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewDirective, decorators: [{
232
281
  type: Directive,
233
282
  args: [{
234
- selector: '[odxDynamicView]',
283
+ selector: 'ng-template[odxDynamicView]',
235
284
  standalone: true,
236
285
  }]
237
286
  }], propDecorators: { content: [{
@@ -249,5 +298,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
249
298
  * Generated bundle index. Do not edit.
250
299
  */
251
300
 
252
- export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, isDynamicTextContent, isDynamicView };
301
+ export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, ODX_DYNAMIC_VIEW_DEFAULT_HOST, createProjectableNodes, getDynamicViewDefaultHost, isDynamicTextContent, isDynamicView };
253
302
  //# sourceMappingURL=odx-angular-cdk-dynamic-view.mjs.map