@odx/angular 1.0.0-rc.4 → 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 (315) 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.service.d.ts +1 -0
  12. package/cdk/dynamic-view/lib/facade/dynamic-view-ref.d.ts +1 -0
  13. package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +1 -0
  14. package/cdk/dynamic-view/lib/models/dynamic-template-ref.d.ts +1 -0
  15. package/cdk/dynamic-view/lib/models/dynamic-view-options.d.ts +6 -3
  16. package/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.d.ts +3 -0
  17. package/cdk/dynamic-view/lib/tokens/index.d.ts +1 -0
  18. package/components/checkbox/index.d.ts +2 -0
  19. package/components/checkbox/lib/checkbox.module.d.ts +9 -0
  20. package/components/checkbox/lib/checkbox.validator.d.ts +6 -0
  21. package/components/form-field/lib/components/form-group/form-group.component.d.ts +0 -1
  22. package/components/form-field/lib/directives/form-field-control.directive.d.ts +3 -4
  23. package/components/form-field/lib/form-field.config.d.ts +0 -5
  24. package/components/list/README.md +3 -0
  25. package/components/list/index.d.ts +3 -0
  26. package/components/list/lib/components/index.d.ts +1 -0
  27. package/components/list/lib/components/list-item.component.d.ts +14 -0
  28. package/components/list/lib/list.component.d.ts +5 -0
  29. package/components/list/lib/list.module.d.ts +9 -0
  30. package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +1 -1
  31. package/components/modal/lib/modal.component.d.ts +2 -2
  32. package/components/modal/lib/modal.service.d.ts +0 -2
  33. package/components/modal/lib/models/index.d.ts +1 -0
  34. package/components/modal/lib/models/modal-options.d.ts +2 -0
  35. package/components/modal/lib/models/modal-variant.d.ts +5 -0
  36. package/components/rail-navigation/README.md +3 -0
  37. package/components/rail-navigation/index.d.ts +3 -0
  38. package/components/rail-navigation/lib/components/rail-navigation-item.component.d.ts +15 -0
  39. package/components/rail-navigation/lib/rail-navigation.component.d.ts +12 -0
  40. package/components/rail-navigation/lib/rail-navigation.module.d.ts +9 -0
  41. package/components/switch/index.d.ts +2 -0
  42. package/components/switch/lib/switch.module.d.ts +9 -0
  43. package/components/switch/lib/switch.validator.d.ts +6 -0
  44. package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +5 -1
  45. package/esm2020/animations/index.mjs +2 -1
  46. package/esm2020/animations/lib/wait-for-child-animations.mjs +3 -0
  47. package/esm2020/cdk/active-indicator/index.mjs +3 -0
  48. package/esm2020/cdk/active-indicator/lib/active-indicator.directive.mjs +127 -0
  49. package/esm2020/cdk/active-indicator/lib/models/active-indicator-direction.mjs +5 -0
  50. package/esm2020/cdk/active-indicator/lib/models/active-indicator-position.mjs +6 -0
  51. package/esm2020/cdk/active-indicator/lib/models/index.mjs +3 -0
  52. package/esm2020/cdk/active-indicator/odx-angular-cdk-active-indicator.mjs +5 -0
  53. package/esm2020/cdk/checkbox-control/lib/checkbox-control.directive.mjs +11 -13
  54. package/esm2020/cdk/custom-form-control/lib/control.directive.mjs +4 -4
  55. package/esm2020/cdk/custom-form-control/lib/custom-form-control.mjs +20 -47
  56. package/esm2020/cdk/dynamic-view/lib/dynamic-view.component.mjs +4 -4
  57. package/esm2020/cdk/dynamic-view/lib/dynamic-view.directive.mjs +5 -5
  58. package/esm2020/cdk/dynamic-view/lib/dynamic-view.service.mjs +11 -9
  59. package/esm2020/cdk/dynamic-view/lib/facade/dynamic-view-ref.mjs +1 -1
  60. package/esm2020/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +12 -5
  61. package/esm2020/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +9 -5
  62. package/esm2020/cdk/dynamic-view/lib/models/dynamic-view-options.mjs +1 -1
  63. package/esm2020/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.mjs +10 -0
  64. package/esm2020/cdk/dynamic-view/lib/tokens/index.mjs +2 -1
  65. package/esm2020/cdk/expandable/lib/directives/expandable-item.directive.mjs +4 -4
  66. package/esm2020/cdk/expandable/lib/directives/extandable-container.directive.mjs +4 -4
  67. package/esm2020/cdk/expandable/lib/expandable.module.mjs +5 -5
  68. package/esm2020/cdk/radio-group-control/lib/radio-control.directive.mjs +5 -5
  69. package/esm2020/cdk/radio-group-control/lib/radio-group-control.directive.mjs +4 -4
  70. package/esm2020/cdk/radio-group-control/lib/radio-group-control.module.mjs +5 -5
  71. package/esm2020/components/accordion/lib/accordion.component.mjs +4 -4
  72. package/esm2020/components/accordion/lib/accordion.module.mjs +5 -5
  73. package/esm2020/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +4 -4
  74. package/esm2020/components/accordion/lib/directives/accordion-item-title.mjs +4 -4
  75. package/esm2020/components/action-group/action-group.component.mjs +4 -4
  76. package/esm2020/components/area-header/area-header.component.mjs +4 -4
  77. package/esm2020/components/area-header/area-header.module.mjs +5 -5
  78. package/esm2020/components/area-header/directives/area-header-content.directive.mjs +4 -4
  79. package/esm2020/components/area-header/directives/area-header-subtitle.directive.mjs +4 -4
  80. package/esm2020/components/avatar/lib/avatar.component.mjs +4 -4
  81. package/esm2020/components/badge/lib/badge.component.mjs +6 -6
  82. package/esm2020/components/badge/lib/badge.directive.mjs +7 -7
  83. package/esm2020/components/button/lib/button.component.mjs +5 -5
  84. package/esm2020/components/button-group/lib/button-group.component.mjs +4 -4
  85. package/esm2020/components/checkbox/index.mjs +3 -1
  86. package/esm2020/components/checkbox/lib/checkbox.component.mjs +5 -5
  87. package/esm2020/components/checkbox/lib/checkbox.module.mjs +19 -0
  88. package/esm2020/components/checkbox/lib/checkbox.validator.mjs +28 -0
  89. package/esm2020/components/chip/lib/chip.component.mjs +4 -4
  90. package/esm2020/components/circular-progress/lib/circular-progress.component.mjs +4 -4
  91. package/esm2020/components/content-box/lib/content-box.component.mjs +4 -4
  92. package/esm2020/components/content-box/lib/content-box.module.mjs +5 -5
  93. package/esm2020/components/content-box/lib/directives/content-box-footer-directive.mjs +4 -4
  94. package/esm2020/components/content-box/lib/directives/content-box-header-directive.mjs +4 -4
  95. package/esm2020/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +4 -4
  96. package/esm2020/components/form-field/lib/components/form-group/form-group.component.mjs +11 -13
  97. package/esm2020/components/form-field/lib/directives/form-field-control.directive.mjs +20 -13
  98. package/esm2020/components/form-field/lib/directives/form-field-error.directive.mjs +4 -4
  99. package/esm2020/components/form-field/lib/directives/form-field-hint.directive.mjs +4 -4
  100. package/esm2020/components/form-field/lib/directives/form-field-label.directive.mjs +4 -4
  101. package/esm2020/components/form-field/lib/directives/form.directive.mjs +4 -4
  102. package/esm2020/components/form-field/lib/form-field.component.mjs +4 -4
  103. package/esm2020/components/form-field/lib/form-field.config.mjs +1 -2
  104. package/esm2020/components/form-field/lib/form-field.module.mjs +5 -5
  105. package/esm2020/components/form-field/lib/form-field.service.mjs +4 -4
  106. package/esm2020/components/form-field/lib/services/form-field-error.service.mjs +4 -4
  107. package/esm2020/components/header/lib/directives/header-avatar.directive.mjs +4 -4
  108. package/esm2020/components/header/lib/directives/header-title.directive.mjs +4 -4
  109. package/esm2020/components/header/lib/header.component.mjs +4 -4
  110. package/esm2020/components/header/lib/header.module.mjs +5 -5
  111. package/esm2020/components/icon/lib/icon.component.mjs +4 -4
  112. package/esm2020/components/link/link.directive.mjs +4 -4
  113. package/esm2020/components/list/index.mjs +4 -0
  114. package/esm2020/components/list/lib/components/index.mjs +2 -0
  115. package/esm2020/components/list/lib/components/list-item.component.mjs +46 -0
  116. package/esm2020/components/list/lib/list.component.mjs +13 -0
  117. package/esm2020/components/list/lib/list.module.mjs +19 -0
  118. package/esm2020/components/list/odx-angular-components-list.mjs +5 -0
  119. package/esm2020/components/loading-spinner/lib/loading-spinner.component.mjs +4 -4
  120. package/esm2020/components/loading-spinner/lib/loading-spinner.directive.mjs +7 -7
  121. package/esm2020/components/loading-spinner/lib/loading-spinner.module.mjs +5 -5
  122. package/esm2020/components/loading-spinner/lib/loading-spinner.service.mjs +4 -4
  123. package/esm2020/components/logo/logo.directive.mjs +4 -4
  124. package/esm2020/components/main-menu/lib/directives/main-menu-button.directive.mjs +4 -4
  125. package/esm2020/components/main-menu/lib/directives/main-menu-item.directive.mjs +4 -4
  126. package/esm2020/components/main-menu/lib/main-menu.component.mjs +4 -4
  127. package/esm2020/components/main-menu/lib/main-menu.module.mjs +5 -5
  128. package/esm2020/components/main-menu/lib/main-menu.service.mjs +4 -4
  129. package/esm2020/components/modal/lib/components/modal-footer/modal-footer.component.mjs +4 -4
  130. package/esm2020/components/modal/lib/components/modal-header/modal-header.component.mjs +4 -4
  131. package/esm2020/components/modal/lib/directives/modal-close.directive.mjs +4 -4
  132. package/esm2020/components/modal/lib/directives/modal-content.directive.mjs +4 -4
  133. package/esm2020/components/modal/lib/directives/modal-dismiss.directive.mjs +4 -4
  134. package/esm2020/components/modal/lib/modal.component.mjs +23 -14
  135. package/esm2020/components/modal/lib/modal.config.mjs +3 -1
  136. package/esm2020/components/modal/lib/modal.directive.mjs +4 -4
  137. package/esm2020/components/modal/lib/modal.module.mjs +5 -5
  138. package/esm2020/components/modal/lib/modal.service.mjs +8 -21
  139. package/esm2020/components/modal/lib/models/index.mjs +2 -1
  140. package/esm2020/components/modal/lib/models/modal-options.mjs +1 -1
  141. package/esm2020/components/modal/lib/models/modal-variant.mjs +5 -0
  142. package/esm2020/components/modal/lib/services/open-modal-manager.service.mjs +4 -4
  143. package/esm2020/components/progress/lib/progress.component.mjs +4 -4
  144. package/esm2020/components/radio-group/lib/components/radio-button/radio-button.component.mjs +5 -5
  145. package/esm2020/components/radio-group/lib/radio-group.component.mjs +4 -4
  146. package/esm2020/components/radio-group/lib/radio-group.module.mjs +5 -5
  147. package/esm2020/components/rail-navigation/index.mjs +4 -0
  148. package/esm2020/components/rail-navigation/lib/components/rail-navigation-item.component.mjs +43 -0
  149. package/esm2020/components/rail-navigation/lib/rail-navigation.component.mjs +41 -0
  150. package/esm2020/components/rail-navigation/lib/rail-navigation.module.mjs +19 -0
  151. package/esm2020/components/rail-navigation/odx-angular-components-rail-navigation.mjs +5 -0
  152. package/esm2020/components/switch/index.mjs +3 -1
  153. package/esm2020/components/switch/lib/switch.component.mjs +5 -5
  154. package/esm2020/components/switch/lib/switch.module.mjs +19 -0
  155. package/esm2020/components/switch/lib/switch.validator.mjs +28 -0
  156. package/esm2020/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +5 -5
  157. package/esm2020/components/toggle-button-group/lib/toggle-button-group.component.mjs +20 -11
  158. package/esm2020/components/toggle-button-group/lib/toggle-button-group.module.mjs +5 -5
  159. package/esm2020/lib/controllers/controller.mjs +10 -9
  160. package/esm2020/lib/controllers/disabled.controller.mjs +7 -6
  161. package/esm2020/lib/controllers/readonly.controller.mjs +7 -6
  162. package/esm2020/lib/core.module.mjs +5 -5
  163. package/esm2020/lib/directives/click-outside.directive.mjs +4 -4
  164. package/esm2020/lib/services/window-ref.mjs +4 -4
  165. package/esm2020/rxjs/index.mjs +2 -2
  166. package/esm2020/rxjs/lib/from-element-resize.mjs +14 -0
  167. package/esm2020/utils/lib/helpers/angular.mjs +5 -2
  168. package/esm2020/utils/lib/helpers/dom.mjs +24 -1
  169. package/fesm2015/odx-angular-animations.mjs +4 -2
  170. package/fesm2015/odx-angular-animations.mjs.map +1 -1
  171. package/fesm2015/odx-angular-cdk-active-indicator.mjs +142 -0
  172. package/fesm2015/odx-angular-cdk-active-indicator.mjs.map +1 -0
  173. package/fesm2015/odx-angular-cdk-checkbox-control.mjs +10 -12
  174. package/fesm2015/odx-angular-cdk-checkbox-control.mjs.map +1 -1
  175. package/fesm2015/odx-angular-cdk-custom-form-control.mjs +24 -51
  176. package/fesm2015/odx-angular-cdk-custom-form-control.mjs.map +1 -1
  177. package/fesm2015/odx-angular-cdk-dynamic-view.mjs +46 -25
  178. package/fesm2015/odx-angular-cdk-dynamic-view.mjs.map +1 -1
  179. package/fesm2015/odx-angular-cdk-expandable.mjs +10 -10
  180. package/fesm2015/odx-angular-cdk-expandable.mjs.map +1 -1
  181. package/fesm2015/odx-angular-cdk-radio-group-control.mjs +11 -11
  182. package/fesm2015/odx-angular-cdk-radio-group-control.mjs.map +1 -1
  183. package/fesm2015/odx-angular-components-accordion.mjs +13 -13
  184. package/fesm2015/odx-angular-components-accordion.mjs.map +1 -1
  185. package/fesm2015/odx-angular-components-action-group.mjs +3 -3
  186. package/fesm2015/odx-angular-components-action-group.mjs.map +1 -1
  187. package/fesm2015/odx-angular-components-area-header.mjs +13 -13
  188. package/fesm2015/odx-angular-components-area-header.mjs.map +1 -1
  189. package/fesm2015/odx-angular-components-avatar.mjs +3 -3
  190. package/fesm2015/odx-angular-components-avatar.mjs.map +1 -1
  191. package/fesm2015/odx-angular-components-badge.mjs +10 -10
  192. package/fesm2015/odx-angular-components-badge.mjs.map +1 -1
  193. package/fesm2015/odx-angular-components-button-group.mjs +3 -3
  194. package/fesm2015/odx-angular-components-button-group.mjs.map +1 -1
  195. package/fesm2015/odx-angular-components-button.mjs +4 -5
  196. package/fesm2015/odx-angular-components-button.mjs.map +1 -1
  197. package/fesm2015/odx-angular-components-checkbox.mjs +47 -7
  198. package/fesm2015/odx-angular-components-checkbox.mjs.map +1 -1
  199. package/fesm2015/odx-angular-components-chip.mjs +3 -3
  200. package/fesm2015/odx-angular-components-chip.mjs.map +1 -1
  201. package/fesm2015/odx-angular-components-circular-progress.mjs +3 -3
  202. package/fesm2015/odx-angular-components-circular-progress.mjs.map +1 -1
  203. package/fesm2015/odx-angular-components-content-box.mjs +13 -13
  204. package/fesm2015/odx-angular-components-content-box.mjs.map +1 -1
  205. package/fesm2015/odx-angular-components-form-field.mjs +52 -51
  206. package/fesm2015/odx-angular-components-form-field.mjs.map +1 -1
  207. package/fesm2015/odx-angular-components-header.mjs +13 -13
  208. package/fesm2015/odx-angular-components-header.mjs.map +1 -1
  209. package/fesm2015/odx-angular-components-icon.mjs +3 -3
  210. package/fesm2015/odx-angular-components-icon.mjs.map +1 -1
  211. package/fesm2015/odx-angular-components-link.mjs +3 -3
  212. package/fesm2015/odx-angular-components-link.mjs.map +1 -1
  213. package/fesm2015/odx-angular-components-list.mjs +79 -0
  214. package/fesm2015/odx-angular-components-list.mjs.map +1 -0
  215. package/fesm2015/odx-angular-components-loading-spinner.mjs +16 -16
  216. package/fesm2015/odx-angular-components-loading-spinner.mjs.map +1 -1
  217. package/fesm2015/odx-angular-components-logo.mjs +3 -3
  218. package/fesm2015/odx-angular-components-logo.mjs.map +1 -1
  219. package/fesm2015/odx-angular-components-main-menu.mjs +16 -16
  220. package/fesm2015/odx-angular-components-main-menu.mjs.map +1 -1
  221. package/fesm2015/odx-angular-components-modal.mjs +61 -58
  222. package/fesm2015/odx-angular-components-modal.mjs.map +1 -1
  223. package/fesm2015/odx-angular-components-progress.mjs +3 -3
  224. package/fesm2015/odx-angular-components-progress.mjs.map +1 -1
  225. package/fesm2015/odx-angular-components-radio-group.mjs +11 -11
  226. package/fesm2015/odx-angular-components-radio-group.mjs.map +1 -1
  227. package/fesm2015/odx-angular-components-rail-navigation.mjs +97 -0
  228. package/fesm2015/odx-angular-components-rail-navigation.mjs.map +1 -0
  229. package/fesm2015/odx-angular-components-switch.mjs +47 -7
  230. package/fesm2015/odx-angular-components-switch.mjs.map +1 -1
  231. package/fesm2015/odx-angular-components-toggle-button-group.mjs +26 -18
  232. package/fesm2015/odx-angular-components-toggle-button-group.mjs.map +1 -1
  233. package/fesm2015/odx-angular-rxjs.mjs +15 -6
  234. package/fesm2015/odx-angular-rxjs.mjs.map +1 -1
  235. package/fesm2015/odx-angular-utils.mjs +28 -2
  236. package/fesm2015/odx-angular-utils.mjs.map +1 -1
  237. package/fesm2015/odx-angular.mjs +32 -28
  238. package/fesm2015/odx-angular.mjs.map +1 -1
  239. package/fesm2020/odx-angular-animations.mjs +4 -2
  240. package/fesm2020/odx-angular-animations.mjs.map +1 -1
  241. package/fesm2020/odx-angular-cdk-active-indicator.mjs +142 -0
  242. package/fesm2020/odx-angular-cdk-active-indicator.mjs.map +1 -0
  243. package/fesm2020/odx-angular-cdk-checkbox-control.mjs +10 -12
  244. package/fesm2020/odx-angular-cdk-checkbox-control.mjs.map +1 -1
  245. package/fesm2020/odx-angular-cdk-custom-form-control.mjs +22 -49
  246. package/fesm2020/odx-angular-cdk-custom-form-control.mjs.map +1 -1
  247. package/fesm2020/odx-angular-cdk-dynamic-view.mjs +42 -22
  248. package/fesm2020/odx-angular-cdk-dynamic-view.mjs.map +1 -1
  249. package/fesm2020/odx-angular-cdk-expandable.mjs +10 -10
  250. package/fesm2020/odx-angular-cdk-expandable.mjs.map +1 -1
  251. package/fesm2020/odx-angular-cdk-radio-group-control.mjs +11 -11
  252. package/fesm2020/odx-angular-cdk-radio-group-control.mjs.map +1 -1
  253. package/fesm2020/odx-angular-components-accordion.mjs +13 -13
  254. package/fesm2020/odx-angular-components-accordion.mjs.map +1 -1
  255. package/fesm2020/odx-angular-components-action-group.mjs +3 -3
  256. package/fesm2020/odx-angular-components-action-group.mjs.map +1 -1
  257. package/fesm2020/odx-angular-components-area-header.mjs +13 -13
  258. package/fesm2020/odx-angular-components-area-header.mjs.map +1 -1
  259. package/fesm2020/odx-angular-components-avatar.mjs +3 -3
  260. package/fesm2020/odx-angular-components-avatar.mjs.map +1 -1
  261. package/fesm2020/odx-angular-components-badge.mjs +10 -10
  262. package/fesm2020/odx-angular-components-badge.mjs.map +1 -1
  263. package/fesm2020/odx-angular-components-button-group.mjs +3 -3
  264. package/fesm2020/odx-angular-components-button-group.mjs.map +1 -1
  265. package/fesm2020/odx-angular-components-button.mjs +4 -4
  266. package/fesm2020/odx-angular-components-button.mjs.map +1 -1
  267. package/fesm2020/odx-angular-components-checkbox.mjs +47 -7
  268. package/fesm2020/odx-angular-components-checkbox.mjs.map +1 -1
  269. package/fesm2020/odx-angular-components-chip.mjs +3 -3
  270. package/fesm2020/odx-angular-components-chip.mjs.map +1 -1
  271. package/fesm2020/odx-angular-components-circular-progress.mjs +3 -3
  272. package/fesm2020/odx-angular-components-circular-progress.mjs.map +1 -1
  273. package/fesm2020/odx-angular-components-content-box.mjs +13 -13
  274. package/fesm2020/odx-angular-components-content-box.mjs.map +1 -1
  275. package/fesm2020/odx-angular-components-form-field.mjs +52 -51
  276. package/fesm2020/odx-angular-components-form-field.mjs.map +1 -1
  277. package/fesm2020/odx-angular-components-header.mjs +13 -13
  278. package/fesm2020/odx-angular-components-header.mjs.map +1 -1
  279. package/fesm2020/odx-angular-components-icon.mjs +3 -3
  280. package/fesm2020/odx-angular-components-icon.mjs.map +1 -1
  281. package/fesm2020/odx-angular-components-link.mjs +3 -3
  282. package/fesm2020/odx-angular-components-link.mjs.map +1 -1
  283. package/fesm2020/odx-angular-components-list.mjs +78 -0
  284. package/fesm2020/odx-angular-components-list.mjs.map +1 -0
  285. package/fesm2020/odx-angular-components-loading-spinner.mjs +16 -16
  286. package/fesm2020/odx-angular-components-loading-spinner.mjs.map +1 -1
  287. package/fesm2020/odx-angular-components-logo.mjs +3 -3
  288. package/fesm2020/odx-angular-components-logo.mjs.map +1 -1
  289. package/fesm2020/odx-angular-components-main-menu.mjs +16 -16
  290. package/fesm2020/odx-angular-components-main-menu.mjs.map +1 -1
  291. package/fesm2020/odx-angular-components-modal.mjs +61 -58
  292. package/fesm2020/odx-angular-components-modal.mjs.map +1 -1
  293. package/fesm2020/odx-angular-components-progress.mjs +3 -3
  294. package/fesm2020/odx-angular-components-progress.mjs.map +1 -1
  295. package/fesm2020/odx-angular-components-radio-group.mjs +11 -11
  296. package/fesm2020/odx-angular-components-radio-group.mjs.map +1 -1
  297. package/fesm2020/odx-angular-components-rail-navigation.mjs +96 -0
  298. package/fesm2020/odx-angular-components-rail-navigation.mjs.map +1 -0
  299. package/fesm2020/odx-angular-components-switch.mjs +47 -7
  300. package/fesm2020/odx-angular-components-switch.mjs.map +1 -1
  301. package/fesm2020/odx-angular-components-toggle-button-group.mjs +26 -18
  302. package/fesm2020/odx-angular-components-toggle-button-group.mjs.map +1 -1
  303. package/fesm2020/odx-angular-rxjs.mjs +15 -6
  304. package/fesm2020/odx-angular-rxjs.mjs.map +1 -1
  305. package/fesm2020/odx-angular-utils.mjs +28 -2
  306. package/fesm2020/odx-angular-utils.mjs.map +1 -1
  307. package/fesm2020/odx-angular.mjs +32 -28
  308. package/fesm2020/odx-angular.mjs.map +1 -1
  309. package/package.json +26 -2
  310. package/rxjs/index.d.ts +1 -1
  311. package/rxjs/lib/from-element-resize.d.ts +2 -0
  312. package/utils/lib/helpers/angular.d.ts +2 -1
  313. package/utils/lib/helpers/dom.d.ts +5 -1
  314. package/esm2020/rxjs/lib/mark-for-check.mjs +0 -5
  315. package/rxjs/lib/mark-for-check.d.ts +0 -3
@@ -1,6 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Directive, Input } from '@angular/core';
3
- import { Validators } from '@angular/forms';
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;
11
+ // eslint-disable-next-line @angular-eslint/no-input-rename
12
+ this.controlValue = null;
13
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.9", ngImport: i0, type: CheckBoxControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
33
- CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: CheckBoxControl, selector: "[odxCheckBoxControl]", inputs: { checked: "checked", value: "value" }, usesInheritance: true, ngImport: i0 });
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", 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 { Directive, 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(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;AAQjC,QAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;KAC3C;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.9", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
15
- ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ControlDirective, isStandalone: true, selector: "[odxControl]", exportAs: ["odxControl"], ngImport: i0 });
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", 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.9", 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.9", ngImport: i0, type: CustomFormControl, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
117
- CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", 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.9", 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.9", 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,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACvB,iBAAA,CAAA;;;ACQK,MAAgB,iBAAqB,SAAQ,UAAU,CAAA;AAmD3D,IAAA,WAAA,CAAY,YAAe,EAAA;AAC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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,GAAG,aAAa,EAAE,CAAC;AAC3C,KAAA;;8GAFY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA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B,CAAA;;;ACtD7B;;AAEG;;;;"}
@@ -1,7 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, reflectComponentType, ApplicationRef, createComponent, EnvironmentInjector, InjectionToken, inject, Injector, Injectable, ViewContainerRef, TemplateRef, Directive } from '@angular/core';
3
- import { injectElement, isString, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
3
+ import { injectElement, isString, isViewContainer, getInjector, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
4
4
  import { isObservable, distinctUntilChanged } from 'rxjs';
5
+ import { DOCUMENT } from '@angular/common';
5
6
 
6
7
  class DynamicViewComponent {
7
8
  constructor() {
@@ -27,9 +28,9 @@ class DynamicViewComponent {
27
28
  this.element.nativeElement.innerHTML = value;
28
29
  }
29
30
  }
30
- DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
- DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.9", type: DynamicViewComponent, isStandalone: true, selector: "odx-dynamic-view", inputs: { content: "content" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", 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: [{
33
34
  type: Component,
34
35
  args: [{
35
36
  selector: 'odx-dynamic-view',
@@ -59,17 +60,20 @@ class DynamicComponentRef {
59
60
  this.options = options;
60
61
  this.application = this.options.injector.get(ApplicationRef);
61
62
  this.componentRef = null;
62
- const { component, context, injector, projectableNodes, vcr } = options;
63
+ const { component, context, injector, projectableNodes, host } = options;
63
64
  this.componentRef = createComponent(component, {
64
65
  environmentInjector: injector.get(EnvironmentInjector),
65
66
  elementInjector: injector,
66
67
  projectableNodes,
67
68
  });
68
- if (vcr) {
69
- vcr.insert(this.componentRef.hostView);
69
+ if (isViewContainer(host)) {
70
+ host.insert(this.componentRef.hostView);
70
71
  }
71
72
  else {
72
73
  this.application.attachView(this.componentRef.hostView);
74
+ if (host) {
75
+ host.appendChild(this.getElement());
76
+ }
73
77
  }
74
78
  if (context) {
75
79
  this.update(context);
@@ -83,7 +87,7 @@ class DynamicComponentRef {
83
87
  this.componentRef = null;
84
88
  return;
85
89
  }
86
- if (this.componentRef && !this.options.vcr) {
90
+ if (this.componentRef && !isViewContainer(this.options.host)) {
87
91
  this.application.detachView(this.componentRef.hostView);
88
92
  }
89
93
  this.componentRef?.destroy();
@@ -97,6 +101,9 @@ class DynamicComponentRef {
97
101
  this.componentRef?.setInput(key, context[key]);
98
102
  }
99
103
  }
104
+ getContext() {
105
+ return this.options.context ?? {};
106
+ }
100
107
  getView() {
101
108
  return this.componentRef?.hostView ?? null;
102
109
  }
@@ -117,7 +124,7 @@ class DynamicTemplateRef {
117
124
  this.embeddedViewRef = null;
118
125
  return;
119
126
  }
120
- if (!this.options.vcr && this.embeddedViewRef) {
127
+ if (!isViewContainer(this.options.host) && this.embeddedViewRef) {
121
128
  this.application.detachView(this.embeddedViewRef);
122
129
  }
123
130
  this.embeddedViewRef?.destroy();
@@ -132,12 +139,15 @@ class DynamicTemplateRef {
132
139
  this.detectChanges();
133
140
  }
134
141
  }
142
+ getContext() {
143
+ return this.options.context ?? {};
144
+ }
135
145
  getView() {
136
146
  return this.embeddedViewRef;
137
147
  }
138
- create({ context, template, vcr }) {
139
- if (vcr) {
140
- 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 });
141
151
  }
142
152
  else {
143
153
  this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);
@@ -152,15 +162,25 @@ function isDynamicView(value) {
152
162
 
153
163
  const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');
154
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
+
155
173
  class DynamicViewService {
156
174
  constructor() {
157
- this.injector = inject(Injector);
175
+ this.injector = getInjector();
176
+ this.defaultHost = getDynamicViewDefaultHost();
158
177
  }
159
178
  createView(content, options = {}) {
160
179
  const viewOptions = {
161
180
  ...options,
181
+ host: options.host ?? this.defaultHost,
162
182
  injector: Injector.create({
163
- providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],
183
+ providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, options.providers ?? []],
164
184
  parent: options.injector ?? this.injector,
165
185
  }),
166
186
  };
@@ -180,9 +200,9 @@ class DynamicViewService {
180
200
  throw new Error('Content type is not supported');
181
201
  }
182
202
  }
183
- DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
184
- DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DynamicViewService, providedIn: 'root' });
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", 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: [{
186
206
  type: Injectable,
187
207
  args: [{ providedIn: 'root' }]
188
208
  }] });
@@ -244,7 +264,7 @@ class DynamicViewDirective {
244
264
  context: this.context ?? undefined,
245
265
  injector: this.injector ?? this.viewContainer.injector,
246
266
  projectableNodes,
247
- vcr: this.viewContainer,
267
+ host: this.viewContainer,
248
268
  });
249
269
  }
250
270
  }
@@ -255,9 +275,9 @@ class DynamicViewDirective {
255
275
  this.viewRef = null;
256
276
  }
257
277
  }
258
- DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
259
- DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: DynamicViewDirective, isStandalone: true, selector: "ng-template[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 });
260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", 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: [{
261
281
  type: Directive,
262
282
  args: [{
263
283
  selector: 'ng-template[odxDynamicView]',
@@ -278,5 +298,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
278
298
  * Generated bundle index. Do not edit.
279
299
  */
280
300
 
281
- export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, createProjectableNodes, isDynamicTextContent, isDynamicView };
301
+ export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, ODX_DYNAMIC_VIEW_DEFAULT_HOST, createProjectableNodes, getDynamicViewDefaultHost, isDynamicTextContent, isDynamicView };
282
302
  //# sourceMappingURL=odx-angular-cdk-dynamic-view.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-dynamic-view.mjs","sources":["../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/create-projectable-nodes.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-text-content.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-component-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-template-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-view.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-context.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.service.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.directive.ts","../../../../libs/angular/cdk/dynamic-view/src/odx-angular-cdk-dynamic-view.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\nimport { distinctUntilChanged, isObservable, Subscription } from 'rxjs';\nimport { DynamicTextContent } from './facade';\n\n@Component({\n selector: 'odx-dynamic-view',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n})\nexport class DynamicViewComponent implements OnDestroy {\n private readonly element = injectElement();\n private currentSubscription: Subscription | null = null;\n\n @Input()\n public set content(value: DynamicTextContent) {\n if (isObservable(value)) {\n this.ngOnDestroy();\n this.currentSubscription = value.pipe(distinctUntilChanged()).subscribe((innerValue) => {\n this.setContent(innerValue);\n });\n } else {\n this.setContent(value);\n }\n }\n\n public ngOnDestroy(): void {\n this.currentSubscription?.unsubscribe();\n this.currentSubscription = null;\n }\n\n private setContent(value: string): void {\n this.element.nativeElement.innerHTML = value;\n }\n}\n","import { reflectComponentType, Type } from '@angular/core';\n\nexport function createProjectableNodes(component: Type<unknown>, nodes: Node[]): Node[][] {\n const componentType = reflectComponentType(component);\n if (componentType && componentType.ngContentSelectors.length > 0) {\n return componentType.ngContentSelectors.map((selector) => (selector === '*' ? nodes : []));\n }\n return [];\n}\n","import { isString } from '@odx/angular/utils';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from '../facade';\n\nexport function isDynamicTextContent(value: unknown): value is DynamicTextContent {\n return isString(value) || isObservable(value);\n}\n","import { ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, Type, ViewRef } from '@angular/core';\nimport { GetDynamicViewContext } from '../facade';\nimport { DynamicViewRef } from '../facade/dynamic-view-ref';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicComponentOptions<T extends Type<unknown>> extends DynamicViewOptions<T> {\n component: T;\n}\n\nexport class DynamicComponentRef<T extends Type<unknown>, C extends GetDynamicViewContext<T>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private componentRef: ComponentRef<T> | null = null;\n\n constructor(private readonly options: DynamicComponentOptions<T>) {\n const { component, context, injector, projectableNodes, vcr } = options;\n\n this.componentRef = createComponent(component as Type<T>, {\n environmentInjector: injector.get(EnvironmentInjector),\n elementInjector: injector,\n projectableNodes,\n });\n\n if (vcr) {\n vcr.insert(this.componentRef.hostView);\n } else {\n this.application.attachView(this.componentRef.hostView);\n }\n if (context) {\n this.update(context as C);\n }\n }\n\n public detectChanges(): void {\n this.componentRef?.changeDetectorRef.detectChanges();\n }\n\n public destroy(): void {\n if (this.componentRef?.hostView.destroyed) {\n this.componentRef = null;\n return;\n }\n if (this.componentRef && !this.options.vcr) {\n this.application.detachView(this.componentRef.hostView);\n }\n this.componentRef?.destroy();\n this.componentRef = null;\n }\n\n public getElement(): Element {\n return this.componentRef?.location.nativeElement ?? null;\n }\n\n public update(context: C): void {\n for (const key in context) {\n this.componentRef?.setInput(key, context[key]);\n }\n }\n\n public getView(): ViewRef | null {\n return this.componentRef?.hostView ?? null;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, TemplateRef as NgTemplateRef, ViewRef } from '@angular/core';\nimport { DynamicViewRef, GetDynamicViewContext } from '../facade';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicTemplateOptions<T extends NgTemplateRef<unknown>> extends DynamicViewOptions<T> {\n template: T;\n}\n\nexport class DynamicTemplateRef<T extends NgTemplateRef<unknown> = NgTemplateRef<unknown>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private embeddedViewRef: EmbeddedViewRef<unknown> | null = null;\n\n constructor(private readonly options: DynamicTemplateOptions<T>) {\n this.create(options);\n }\n\n public detectChanges(): void {\n this.embeddedViewRef?.detectChanges();\n }\n\n public destroy(): void {\n if (this.embeddedViewRef?.destroyed) {\n this.embeddedViewRef = null;\n return;\n }\n if (!this.options.vcr && this.embeddedViewRef) {\n this.application.detachView(this.embeddedViewRef);\n }\n this.embeddedViewRef?.destroy();\n this.embeddedViewRef = null;\n }\n\n public getElement(): Element {\n return this.embeddedViewRef?.rootNodes?.[0] ?? null;\n }\n\n public update(context: GetDynamicViewContext<T>): void {\n if (this.embeddedViewRef) {\n this.embeddedViewRef.context = context;\n this.detectChanges();\n }\n }\n\n public getView(): ViewRef | null {\n return this.embeddedViewRef;\n }\n\n private create({ context, template, vcr }: DynamicTemplateOptions<T>) {\n if (vcr) {\n this.embeddedViewRef = vcr.createEmbeddedView(template, context, { injector: this.options.injector });\n } else {\n this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);\n this.application.attachView(this.embeddedViewRef);\n }\n }\n}\n","import { DynamicContent, DynamicViewRef } from '../facade';\nimport { DynamicComponentRef, DynamicTemplateRef } from '../models';\n\nexport function isDynamicView(value: unknown): value is DynamicViewRef<DynamicContent> {\n return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;\n}\n","import { InjectionToken, TemplateRef } from '@angular/core';\n\nexport interface DynamicViewContextWithImplicitTemplate<T = unknown> {\n $implicit: TemplateRef<T>;\n}\n\nexport const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { isComponent, isTemplateRef } from '@odx/angular/utils';\nimport { DynamicViewComponent } from './dynamic-view.component';\nimport { DynamicContent, DynamicViewRef } from './facade';\nimport { isDynamicTextContent } from './helpers';\nimport { DynamicComponentRef, DynamicViewOptions } from './models';\nimport { DynamicTemplateRef } from './models/dynamic-template-ref';\nimport { DYNAMIC_VIEW_CONTEXT } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class DynamicViewService {\n private readonly injector = inject(Injector);\n\n public createView<T extends DynamicContent>(content: T, options: Partial<DynamicViewOptions<T>> = {}): DynamicViewRef<T> {\n const viewOptions = {\n ...options,\n injector: Injector.create({\n providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],\n parent: options.injector ?? this.injector,\n }),\n };\n if (isTemplateRef(content)) {\n return new DynamicTemplateRef({ ...viewOptions, template: content });\n }\n if (isComponent(content)) {\n return new DynamicComponentRef({ ...viewOptions, context: options.context, component: content });\n }\n if (isDynamicTextContent(content)) {\n return new DynamicComponentRef({\n ...viewOptions,\n component: DynamicViewComponent,\n context: { content },\n });\n }\n throw new Error('Content type is not supported');\n }\n}\n","import { Directive, EmbeddedViewRef, inject, Injector, Input, OnChanges, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { hasChanged, isComponent, NgChanges } from '@odx/angular/utils';\nimport { DynamicViewService } from './dynamic-view.service';\nimport { DynamicContent, DynamicViewRef, GetDynamicViewContext } from './facade';\nimport { createProjectableNodes, isDynamicTextContent, isDynamicView } from './helpers';\n\n@Directive({\n selector: 'ng-template[odxDynamicView]',\n standalone: true,\n})\nexport class DynamicViewDirective<T extends DynamicContent<unknown> = DynamicContent<unknown>> implements OnDestroy, OnInit, OnChanges {\n private readonly dynamicViewService = inject(DynamicViewService);\n private readonly viewContainer = inject(ViewContainerRef);\n private readonly template = inject(TemplateRef);\n private viewRef: DynamicViewRef<T> | null = null;\n private contentViewRef: DynamicViewRef<TemplateRef<unknown>> | null = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicView')\n public content?: T | DynamicViewRef<T> | null = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewInjector')\n public injector?: Injector;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewContext')\n public context?: GetDynamicViewContext<T>;\n\n public ngOnInit(): void {\n this.render();\n }\n\n public ngOnChanges(changes: NgChanges<DynamicViewDirective<DynamicContent>>): void {\n if (hasChanged(changes, 'injector')) {\n this.render();\n }\n if (hasChanged(changes, 'content')) {\n const hasChangedTextContent = isDynamicTextContent(changes.content?.previousValue) && isDynamicTextContent(changes.content?.currentValue);\n this.render(!hasChangedTextContent);\n }\n if (hasChanged(changes, 'context')) {\n this.viewRef?.update(changes.context?.currentValue ?? {});\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n public getView(): DynamicViewRef<T> | null {\n return this.viewRef;\n }\n\n private render(reRender = true) {\n if (!this.content) return;\n if (!reRender && this.viewRef) {\n this.viewRef?.update({ content: this.content } as object);\n return;\n }\n this.viewRef?.destroy();\n if (isDynamicView(this.content)) {\n this.viewRef = this.content;\n const hostView = this.viewRef.getView();\n if (hostView) {\n this.viewContainer.insert(hostView);\n }\n } else {\n let projectableNodes: Node[][] = [];\n if (isComponent(this.content)) {\n this.contentViewRef = this.dynamicViewService.createView(this.template, { injector: this.injector });\n const rootNodes = (this.contentViewRef.getView() as EmbeddedViewRef<unknown>).rootNodes;\n projectableNodes = createProjectableNodes(this.content, rootNodes);\n }\n this.viewRef = this.dynamicViewService.createView(this.content, {\n context: this.context ?? undefined,\n injector: this.injector ?? this.viewContainer.injector,\n projectableNodes,\n vcr: this.viewContainer,\n });\n }\n }\n\n private destroy() {\n this.contentViewRef?.destroy();\n this.viewRef?.destroy();\n this.contentViewRef = null;\n this.viewRef = null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAYa,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;QAQmB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QACnC,IAAmB,CAAA,mBAAA,GAAwB,IAAI,CAAC;AA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,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,wBAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,EAAA,SAAA,CAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;8BAUQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,gBAAgB,CAAA;gBAKhB,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,wBAAwB,CAAA;gBAKxB,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB,CAAA;;;AC1BhC;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-dynamic-view.mjs","sources":["../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/create-projectable-nodes.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-text-content.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-component-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-template-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-view.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-context.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-default-host.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.service.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.directive.ts","../../../../libs/angular/cdk/dynamic-view/src/odx-angular-cdk-dynamic-view.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\nimport { distinctUntilChanged, isObservable, Subscription } from 'rxjs';\nimport { DynamicTextContent } from './facade';\n\n@Component({\n selector: 'odx-dynamic-view',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n})\nexport class DynamicViewComponent implements OnDestroy {\n private readonly element = injectElement();\n private currentSubscription: Subscription | null = null;\n\n @Input()\n public set content(value: DynamicTextContent) {\n if (isObservable(value)) {\n this.ngOnDestroy();\n this.currentSubscription = value.pipe(distinctUntilChanged()).subscribe((innerValue) => {\n this.setContent(innerValue);\n });\n } else {\n this.setContent(value);\n }\n }\n\n public ngOnDestroy(): void {\n this.currentSubscription?.unsubscribe();\n this.currentSubscription = null;\n }\n\n private setContent(value: string): void {\n this.element.nativeElement.innerHTML = value;\n }\n}\n","import { reflectComponentType, Type } from '@angular/core';\n\nexport function createProjectableNodes(component: Type<unknown>, nodes: Node[]): Node[][] {\n const componentType = reflectComponentType(component);\n if (componentType && componentType.ngContentSelectors.length > 0) {\n return componentType.ngContentSelectors.map((selector) => (selector === '*' ? nodes : []));\n }\n return [];\n}\n","import { isString } from '@odx/angular/utils';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from '../facade';\n\nexport function isDynamicTextContent(value: unknown): value is DynamicTextContent {\n return isString(value) || isObservable(value);\n}\n","import { ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, Type, ViewRef } from '@angular/core';\nimport { isViewContainer } from '@odx/angular/utils';\nimport { GetDynamicViewContext } from '../facade';\nimport { DynamicViewRef } from '../facade/dynamic-view-ref';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicComponentOptions<T extends Type<unknown>> extends DynamicViewOptions<T> {\n component: T;\n}\n\nexport class DynamicComponentRef<T extends Type<unknown>, C extends GetDynamicViewContext<T>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private componentRef: ComponentRef<T> | null = null;\n\n constructor(private readonly options: DynamicComponentOptions<T>) {\n const { component, context, injector, projectableNodes, host } = options;\n\n this.componentRef = createComponent(component as Type<T>, {\n environmentInjector: injector.get(EnvironmentInjector),\n elementInjector: injector,\n projectableNodes,\n });\n\n if (isViewContainer(host)) {\n host.insert(this.componentRef.hostView);\n } else {\n this.application.attachView(this.componentRef.hostView);\n if (host) {\n host.appendChild(this.getElement());\n }\n }\n if (context) {\n this.update(context as C);\n }\n }\n\n public detectChanges(): void {\n this.componentRef?.changeDetectorRef.detectChanges();\n }\n\n public destroy(): void {\n if (this.componentRef?.hostView.destroyed) {\n this.componentRef = null;\n return;\n }\n if (this.componentRef && !isViewContainer(this.options.host)) {\n this.application.detachView(this.componentRef.hostView);\n }\n this.componentRef?.destroy();\n this.componentRef = null;\n }\n\n public getElement(): Element {\n return this.componentRef?.location.nativeElement ?? null;\n }\n\n public update(context: C): void {\n for (const key in context) {\n this.componentRef?.setInput(key, context[key]);\n }\n }\n\n public getContext(): GetDynamicViewContext<T> {\n return this.options.context ?? {};\n }\n\n public getView(): ViewRef | null {\n return this.componentRef?.hostView ?? null;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, TemplateRef as NgTemplateRef, ViewRef } from '@angular/core';\nimport { isViewContainer } from '@odx/angular/utils';\nimport { DynamicViewRef, GetDynamicViewContext } from '../facade';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicTemplateOptions<T extends NgTemplateRef<unknown>> extends DynamicViewOptions<T> {\n template: T;\n}\n\nexport class DynamicTemplateRef<T extends NgTemplateRef<unknown> = NgTemplateRef<unknown>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private embeddedViewRef: EmbeddedViewRef<unknown> | null = null;\n\n constructor(private readonly options: DynamicTemplateOptions<T>) {\n this.create(options);\n }\n\n public detectChanges(): void {\n this.embeddedViewRef?.detectChanges();\n }\n\n public destroy(): void {\n if (this.embeddedViewRef?.destroyed) {\n this.embeddedViewRef = null;\n return;\n }\n if (!isViewContainer(this.options.host) && this.embeddedViewRef) {\n this.application.detachView(this.embeddedViewRef);\n }\n this.embeddedViewRef?.destroy();\n this.embeddedViewRef = null;\n }\n\n public getElement(): Element {\n return this.embeddedViewRef?.rootNodes?.[0] ?? null;\n }\n\n public update(context: GetDynamicViewContext<T>): void {\n if (this.embeddedViewRef) {\n this.embeddedViewRef.context = context;\n this.detectChanges();\n }\n }\n\n public getContext(): GetDynamicViewContext<T> {\n return this.options.context ?? {};\n }\n\n public getView(): ViewRef | null {\n return this.embeddedViewRef;\n }\n\n private create({ context, template, host }: DynamicTemplateOptions<T>) {\n if (isViewContainer(host)) {\n this.embeddedViewRef = host.createEmbeddedView(template, context, { injector: this.options.injector });\n } else {\n this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);\n this.application.attachView(this.embeddedViewRef);\n }\n }\n}\n","import { DynamicContent, DynamicViewRef } from '../facade';\nimport { DynamicComponentRef, DynamicTemplateRef } from '../models';\n\nexport function isDynamicView(value: unknown): value is DynamicViewRef<DynamicContent> {\n return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;\n}\n","import { InjectionToken, TemplateRef } from '@angular/core';\n\nexport interface DynamicViewContextWithImplicitTemplate<T = unknown> {\n $implicit: TemplateRef<T>;\n}\n\nexport const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');\n","import { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken } from '@angular/core';\n\nexport const ODX_DYNAMIC_VIEW_DEFAULT_HOST = new InjectionToken<Element>('@odx/angular/cdk/dynamic-view::DynamicViewDefaultHost', {\n providedIn: 'root',\n factory: () => inject(DOCUMENT).body,\n});\n\nexport function getDynamicViewDefaultHost(): Element {\n return inject(ODX_DYNAMIC_VIEW_DEFAULT_HOST);\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { getInjector, isComponent, isTemplateRef } from '@odx/angular/utils';\nimport { DynamicViewComponent } from './dynamic-view.component';\nimport { DynamicContent, DynamicViewRef } from './facade';\nimport { isDynamicTextContent } from './helpers';\nimport { DynamicComponentRef, DynamicViewOptions } from './models';\nimport { DynamicTemplateRef } from './models/dynamic-template-ref';\nimport { DYNAMIC_VIEW_CONTEXT, getDynamicViewDefaultHost } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class DynamicViewService {\n private readonly injector = getInjector();\n private readonly defaultHost = getDynamicViewDefaultHost();\n\n public createView<T extends DynamicContent>(content: T, options: Partial<DynamicViewOptions<T>> = {}): DynamicViewRef<T> {\n const viewOptions: DynamicViewOptions<T> = {\n ...options,\n host: options.host ?? this.defaultHost,\n injector: Injector.create({\n providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, options.providers ?? []],\n parent: options.injector ?? this.injector,\n }),\n };\n if (isTemplateRef(content)) {\n return new DynamicTemplateRef({ ...viewOptions, template: content });\n }\n if (isComponent(content)) {\n return new DynamicComponentRef({ ...viewOptions, context: options.context, component: content });\n }\n if (isDynamicTextContent(content)) {\n return new DynamicComponentRef({\n ...viewOptions,\n component: DynamicViewComponent,\n context: { content },\n }) as never;\n }\n throw new Error('Content type is not supported');\n }\n}\n","import { Directive, EmbeddedViewRef, inject, Injector, Input, OnChanges, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { hasChanged, isComponent, NgChanges } from '@odx/angular/utils';\nimport { DynamicViewService } from './dynamic-view.service';\nimport { DynamicContent, DynamicViewRef, GetDynamicViewContext } from './facade';\nimport { createProjectableNodes, isDynamicTextContent, isDynamicView } from './helpers';\n\n@Directive({\n selector: 'ng-template[odxDynamicView]',\n standalone: true,\n})\nexport class DynamicViewDirective<T extends DynamicContent<unknown> = DynamicContent<unknown>> implements OnDestroy, OnInit, OnChanges {\n private readonly dynamicViewService = inject(DynamicViewService);\n private readonly viewContainer = inject(ViewContainerRef);\n private readonly template = inject(TemplateRef);\n private viewRef: DynamicViewRef<T> | null = null;\n private contentViewRef: DynamicViewRef<TemplateRef<unknown>> | null = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicView')\n public content?: T | DynamicViewRef<T> | null = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewInjector')\n public injector?: Injector;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewContext')\n public context?: GetDynamicViewContext<T>;\n\n public ngOnInit(): void {\n this.render();\n }\n\n public ngOnChanges(changes: NgChanges<DynamicViewDirective<DynamicContent>>): void {\n if (hasChanged(changes, 'injector')) {\n this.render();\n }\n if (hasChanged(changes, 'content')) {\n const hasChangedTextContent = isDynamicTextContent(changes.content?.previousValue) && isDynamicTextContent(changes.content?.currentValue);\n this.render(!hasChangedTextContent);\n }\n if (hasChanged(changes, 'context')) {\n this.viewRef?.update(changes.context?.currentValue ?? {});\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n public getView(): DynamicViewRef<T> | null {\n return this.viewRef;\n }\n\n private render(reRender = true) {\n if (!this.content) return;\n if (!reRender && this.viewRef) {\n this.viewRef?.update({ content: this.content } as object);\n return;\n }\n this.viewRef?.destroy();\n if (isDynamicView(this.content)) {\n this.viewRef = this.content;\n const hostView = this.viewRef.getView();\n if (hostView) {\n this.viewContainer.insert(hostView);\n }\n } else {\n let projectableNodes: Node[][] = [];\n if (isComponent(this.content)) {\n this.contentViewRef = this.dynamicViewService.createView(this.template, { injector: this.injector });\n const rootNodes = (this.contentViewRef.getView() as EmbeddedViewRef<unknown>).rootNodes;\n projectableNodes = createProjectableNodes(this.content, rootNodes);\n }\n this.viewRef = this.dynamicViewService.createView(this.content, {\n context: this.context ?? undefined,\n injector: this.injector ?? this.viewContainer.injector,\n projectableNodes,\n host: this.viewContainer,\n });\n }\n }\n\n private destroy() {\n this.contentViewRef?.destroy();\n this.viewRef?.destroy();\n this.contentViewRef = null;\n this.viewRef = null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAYa,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;QAQmB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QACnC,IAAmB,CAAA,mBAAA,GAAwB,IAAI,CAAC;AAsBzD,KAAA;IApBC,IACW,OAAO,CAAC,KAAyB,EAAA;AAC1C,QAAA,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB,IAAI,CAAC,WAAW,EAAE,CAAC;AACnB,YAAA,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,KAAI;AACrF,gBAAA,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC9B,aAAC,CAAC,CAAC;AACJ,SAAA;AAAM,aAAA;AACL,YAAA,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AACxB,SAAA;KACF;IAEM,WAAW,GAAA;AAChB,QAAA,IAAI,CAAC,mBAAmB,EAAE,WAAW,EAAE,CAAC;AACxC,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;KACjC;AAEO,IAAA,UAAU,CAAC,KAAa,EAAA;QAC9B,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,GAAG,KAAK,CAAC;KAC9C;;kHAvBU,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QA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,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,wBAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,EAAA,SAAA,CAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;8BAUQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,gBAAgB,CAAA;gBAKhB,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,wBAAwB,CAAA;gBAKxB,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB,CAAA;;;AC1BhC;;AAEG;;;;"}
@@ -42,9 +42,9 @@ class ExpandableItemDirective extends ExpandableItem {
42
42
  }
43
43
  }
44
44
  ExpandableItemDirective.ID = 0;
45
- ExpandableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableItemDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
46
- ExpandableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ExpandableItemDirective, isStandalone: true, selector: "[odxExpandableItem]", inputs: { expanded: "expanded" }, usesInheritance: true, ngImport: i0 });
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableItemDirective, decorators: [{
45
+ ExpandableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableItemDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
46
+ ExpandableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: ExpandableItemDirective, isStandalone: true, selector: "[odxExpandableItem]", inputs: { expanded: "expanded" }, usesInheritance: true, ngImport: i0 });
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableItemDirective, decorators: [{
48
48
  type: Directive,
49
49
  args: [{
50
50
  standalone: true,
@@ -75,13 +75,13 @@ class ExpandableContainerDirective extends ExpandableContainer {
75
75
  this.openItems[item.id] = item;
76
76
  }
77
77
  }
78
- ExpandableContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableContainerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
79
- ExpandableContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ExpandableContainerDirective, isStandalone: true, selector: "[odxExpandableContainer]", inputs: { multiple: "multiple" }, usesInheritance: true, ngImport: i0 });
78
+ ExpandableContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableContainerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
79
+ ExpandableContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: ExpandableContainerDirective, isStandalone: true, selector: "[odxExpandableContainer]", inputs: { multiple: "multiple" }, usesInheritance: true, ngImport: i0 });
80
80
  __decorate([
81
81
  Transform(coerceBooleanProperty),
82
82
  __metadata("design:type", Object)
83
83
  ], ExpandableContainerDirective.prototype, "multiple", void 0);
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableContainerDirective, decorators: [{
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableContainerDirective, decorators: [{
85
85
  type: Directive,
86
86
  args: [{
87
87
  standalone: true,
@@ -94,10 +94,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
94
94
  const modules = [ExpandableContainerDirective, ExpandableItemDirective];
95
95
  class ExpandableModule {
96
96
  }
97
- ExpandableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
98
- ExpandableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.9", ngImport: i0, type: ExpandableModule, imports: [ExpandableContainerDirective, ExpandableItemDirective], exports: [ExpandableContainerDirective, ExpandableItemDirective] });
99
- ExpandableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableModule });
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ExpandableModule, decorators: [{
97
+ ExpandableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
98
+ ExpandableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.10", ngImport: i0, type: ExpandableModule, imports: [ExpandableContainerDirective, ExpandableItemDirective], exports: [ExpandableContainerDirective, ExpandableItemDirective] });
99
+ ExpandableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableModule });
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ExpandableModule, decorators: [{
101
101
  type: NgModule,
102
102
  args: [{
103
103
  imports: modules,
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-expandable.mjs","sources":["../../../../libs/angular/cdk/expandable/src/lib/facade/expandable-container.ts","../../../../libs/angular/cdk/expandable/src/lib/facade/expandable-item.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/expandable-item.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/extandable-container.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/expandable.module.ts","../../../../libs/angular/cdk/expandable/src/odx-angular-cdk-expandable.ts"],"sourcesContent":["import { ExpandableItem } from './expandable-item';\n\nexport abstract class ExpandableContainer {\n public abstract close(item: ExpandableItem): void;\n public abstract closeAll(): void;\n public abstract open(item: ExpandableItem): void;\n}\n","export abstract class ExpandableItem {\n public abstract readonly id: string;\n public abstract expanded: boolean;\n\n public abstract close(): void;\n public abstract open(): void;\n public abstract toggle(): void;\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, inject, Input } from '@angular/core';\nimport { ExpandableContainer, ExpandableItem } from '../facade';\n\n@Directive({\n standalone: true,\n selector: '[odxExpandableItem]',\n})\nexport class ExpandableItemDirective extends ExpandableItem {\n public static ID = 0;\n public static ngAcceptInputType_expanded: BooleanInput;\n\n private readonly container = inject(ExpandableContainer, { optional: true, skipSelf: true });\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private _expanded = false;\n\n public readonly id = `odx-expandable-item-${ExpandableItemDirective.ID++}`;\n\n @Input()\n public set expanded(value: boolean) {\n this._expanded = coerceBooleanProperty(value);\n if (this._expanded) {\n this.container?.open(this);\n } else {\n this.container?.close(this);\n }\n this.changeDetectorRef.markForCheck();\n }\n public get expanded(): boolean {\n return this._expanded;\n }\n\n public toggle(): void {\n this.expanded = !this.expanded;\n }\n\n public open(): void {\n this.expanded = true;\n }\n\n public close(): void {\n this.expanded = false;\n }\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, Input } from '@angular/core';\nimport { Transform } from '@odx/angular/utils';\nimport { ExpandableContainer, ExpandableItem } from '../facade';\n\n@Directive({\n standalone: true,\n selector: '[odxExpandableContainer]',\n})\nexport class ExpandableContainerDirective extends ExpandableContainer {\n public static ngAcceptInputType_multiple: BooleanInput;\n\n private openItems: Record<string, ExpandableItem> = {};\n\n @Transform(coerceBooleanProperty)\n @Input()\n public multiple = false;\n\n public close(item: ExpandableItem): void {\n delete this.openItems[item.id];\n }\n\n public closeAll(): void {\n for (const item of Object.values(this.openItems)) {\n item.close();\n }\n }\n\n public open(item: ExpandableItem): void {\n if (!this.multiple) {\n this.closeAll();\n }\n this.openItems[item.id] = item;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ExpandableContainerDirective, ExpandableItemDirective } from './directives';\n\nconst modules = [ExpandableContainerDirective, ExpandableItemDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class ExpandableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAEsB,mBAAmB,CAAA;AAIxC;;MCNqB,cAAc,CAAA;AAOnC;;ACCK,MAAO,uBAAwB,SAAQ,cAAc,CAAA;AAJ3D,IAAA,WAAA,GAAA;;AAQmB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5E,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACvD,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAEV,QAAA,IAAA,CAAA,EAAE,GAAG,CAAuB,oBAAA,EAAA,uBAAuB,CAAC,EAAE,EAAE,EAAE,CAAC;AA2B5E,KAAA;IAzBC,IACW,QAAQ,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,IAAI,CAAC,SAAS,EAAE;AAClB,YAAA,I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AA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YANZ,4BAA4B,EAAE,uBAAuB,CAArD,EAAA,OAAA,EAAA,CAAA,4BAA4B,EAAE,uBAAuB,CAAA,EAAA,CAAA,CAAA;8GAMzD,gBAAgB,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-expandable.mjs","sources":["../../../../libs/angular/cdk/expandable/src/lib/facade/expandable-container.ts","../../../../libs/angular/cdk/expandable/src/lib/facade/expandable-item.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/expandable-item.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/extandable-container.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/expandable.module.ts","../../../../libs/angular/cdk/expandable/src/odx-angular-cdk-expandable.ts"],"sourcesContent":["import { ExpandableItem } from './expandable-item';\n\nexport abstract class ExpandableContainer {\n public abstract close(item: ExpandableItem): void;\n public abstract closeAll(): void;\n public abstract open(item: ExpandableItem): void;\n}\n","export abstract class ExpandableItem {\n public abstract readonly id: string;\n public abstract expanded: boolean;\n\n public abstract close(): void;\n public abstract open(): void;\n public abstract toggle(): void;\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, inject, Input } from '@angular/core';\nimport { ExpandableContainer, ExpandableItem } from '../facade';\n\n@Directive({\n standalone: true,\n selector: '[odxExpandableItem]',\n})\nexport class ExpandableItemDirective extends ExpandableItem {\n public static ID = 0;\n public static ngAcceptInputType_expanded: BooleanInput;\n\n private readonly container = inject(ExpandableContainer, { optional: true, skipSelf: true });\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private _expanded = false;\n\n public readonly id = `odx-expandable-item-${ExpandableItemDirective.ID++}`;\n\n @Input()\n public set expanded(value: boolean) {\n this._expanded = coerceBooleanProperty(value);\n if (this._expanded) {\n this.container?.open(this);\n } else {\n this.container?.close(this);\n }\n this.changeDetectorRef.markForCheck();\n }\n public get expanded(): boolean {\n return this._expanded;\n }\n\n public toggle(): void {\n this.expanded = !this.expanded;\n }\n\n public open(): void {\n this.expanded = true;\n }\n\n public close(): void {\n this.expanded = false;\n }\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, Input } from '@angular/core';\nimport { Transform } from '@odx/angular/utils';\nimport { ExpandableContainer, ExpandableItem } from '../facade';\n\n@Directive({\n standalone: true,\n selector: '[odxExpandableContainer]',\n})\nexport class ExpandableContainerDirective extends ExpandableContainer {\n public static ngAcceptInputType_multiple: BooleanInput;\n\n private openItems: Record<string, ExpandableItem> = {};\n\n @Transform(coerceBooleanProperty)\n @Input()\n public multiple = false;\n\n public close(item: ExpandableItem): void {\n delete this.openItems[item.id];\n }\n\n public closeAll(): void {\n for (const item of Object.values(this.openItems)) {\n item.close();\n }\n }\n\n public open(item: ExpandableItem): void {\n if (!this.multiple) {\n this.closeAll();\n }\n this.openItems[item.id] = item;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ExpandableContainerDirective, ExpandableItemDirective } from './directives';\n\nconst modules = [ExpandableContainerDirective, ExpandableItemDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class ExpandableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAEsB,mBAAmB,CAAA;AAIxC;;MCNqB,c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