@tft/crispr-forms 14.0.1 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/esm2022/public-api.mjs +4 -0
  2. package/{esm2020 → esm2022}/src/index.mjs +1 -1
  3. package/esm2022/src/lib/crispr-forms.module.mjs +55 -0
  4. package/esm2022/src/lib/display-field.directive.mjs +52 -0
  5. package/esm2022/src/lib/field-component-map.const.mjs +28 -0
  6. package/esm2022/src/lib/field.directive.mjs +69 -0
  7. package/esm2022/src/lib/form/form.component.mjs +62 -0
  8. package/esm2022/src/lib/form-group-list/form-group-list.component.mjs +97 -0
  9. package/{esm2020 → esm2022}/src/lib/form-group-list/index.mjs +1 -1
  10. package/{esm2020 → esm2022}/src/lib/pipes/crispr-pipes.module.mjs +24 -24
  11. package/esm2022/src/lib/pipes/initial-control-value.pipe.mjs +20 -0
  12. package/{esm2020 → esm2022}/src/lib/public_api.mjs +2 -2
  13. package/{esm2020 → esm2022}/src/lib/sub-group/index.mjs +2 -2
  14. package/esm2022/src/lib/sub-group/sub-group.component.mjs +20 -0
  15. package/esm2022/src/lib/sub-group/sub-group.module.mjs +42 -0
  16. package/esm2022/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +138 -0
  17. package/esm2022/src/lib/ui/autocomplete-chiplist-field/index.mjs +2 -0
  18. package/esm2022/src/lib/ui/autocomplete-chiplist-field/public-api.mjs +2 -0
  19. package/esm2022/src/lib/ui/autocomplete-field/autocomplete-field.component.mjs +95 -0
  20. package/esm2022/src/lib/ui/autocomplete-field/index.mjs +2 -0
  21. package/esm2022/src/lib/ui/autocomplete-field/public-api.mjs +2 -0
  22. package/esm2022/src/lib/ui/button/button.component.mjs +52 -0
  23. package/esm2022/src/lib/ui/button/index.mjs +2 -0
  24. package/esm2022/src/lib/ui/button/public-api.mjs +2 -0
  25. package/esm2022/src/lib/ui/checkbox-field/checkbox-field.component.mjs +42 -0
  26. package/esm2022/src/lib/ui/checkbox-field/index.mjs +2 -0
  27. package/esm2022/src/lib/ui/checkbox-field/public-api.mjs +2 -0
  28. package/esm2022/src/lib/ui/datepicker-field/datepicker-field.component.mjs +66 -0
  29. package/esm2022/src/lib/ui/datepicker-field/index.mjs +2 -0
  30. package/esm2022/src/lib/ui/datepicker-field/public-api.mjs +2 -0
  31. package/esm2022/src/lib/ui/divider/divider.component.mjs +25 -0
  32. package/esm2022/src/lib/ui/divider/index.mjs +2 -0
  33. package/esm2022/src/lib/ui/divider/public-api.mjs +2 -0
  34. package/esm2022/src/lib/ui/field-container/field-container.component.mjs +59 -0
  35. package/esm2022/src/lib/ui/field-container/index.mjs +2 -0
  36. package/esm2022/src/lib/ui/field-container/public-api.mjs +2 -0
  37. package/esm2022/src/lib/ui/file-dropzone/file-dropzone.directive.mjs +40 -0
  38. package/esm2022/src/lib/ui/file-dropzone/index.mjs +2 -0
  39. package/esm2022/src/lib/ui/file-dropzone/public-api.mjs +2 -0
  40. package/esm2022/src/lib/ui/file-upload-field/file-upload-field.component.mjs +107 -0
  41. package/esm2022/src/lib/ui/file-upload-field/index.mjs +2 -0
  42. package/esm2022/src/lib/ui/file-upload-field/public-api.mjs +2 -0
  43. package/esm2022/src/lib/ui/heading/heading.component.mjs +27 -0
  44. package/esm2022/src/lib/ui/heading/index.mjs +2 -0
  45. package/esm2022/src/lib/ui/heading/public-api.mjs +2 -0
  46. package/esm2022/src/lib/ui/image-upload-field/image-upload-field.component.mjs +184 -0
  47. package/esm2022/src/lib/ui/image-upload-field/index.mjs +2 -0
  48. package/esm2022/src/lib/ui/image-upload-field/public-api.mjs +2 -0
  49. package/esm2022/src/lib/ui/index.mjs +2 -0
  50. package/esm2022/src/lib/ui/info/index.mjs +2 -0
  51. package/esm2022/src/lib/ui/info/info.component.mjs +23 -0
  52. package/esm2022/src/lib/ui/info/public-api.mjs +2 -0
  53. package/esm2022/src/lib/ui/input-field/index.mjs +2 -0
  54. package/esm2022/src/lib/ui/input-field/input-field.component.mjs +43 -0
  55. package/esm2022/src/lib/ui/input-field/public-api.mjs +2 -0
  56. package/esm2022/src/lib/ui/option/index.mjs +2 -0
  57. package/esm2022/src/lib/ui/option/option.component.mjs +16 -0
  58. package/esm2022/src/lib/ui/option/public-api.mjs +2 -0
  59. package/esm2022/src/lib/ui/public-api.mjs +7 -0
  60. package/esm2022/src/lib/ui/radio-field/index.mjs +2 -0
  61. package/esm2022/src/lib/ui/radio-field/public-api.mjs +2 -0
  62. package/esm2022/src/lib/ui/radio-field/radio-field.component.mjs +39 -0
  63. package/esm2022/src/lib/ui/select-field/index.mjs +2 -0
  64. package/esm2022/src/lib/ui/select-field/public-api.mjs +2 -0
  65. package/esm2022/src/lib/ui/select-field/select-field.component.mjs +73 -0
  66. package/esm2022/src/lib/ui/selected-file/index.mjs +2 -0
  67. package/esm2022/src/lib/ui/selected-file/public-api.mjs +2 -0
  68. package/esm2022/src/lib/ui/selected-file/selected-file.component.mjs +26 -0
  69. package/esm2022/src/lib/ui/slider-field/index.mjs +2 -0
  70. package/esm2022/src/lib/ui/slider-field/public-api.mjs +2 -0
  71. package/esm2022/src/lib/ui/slider-field/slider-field.component.mjs +46 -0
  72. package/esm2022/src/lib/ui/textarea-field/index.mjs +2 -0
  73. package/esm2022/src/lib/ui/textarea-field/public-api.mjs +2 -0
  74. package/esm2022/src/lib/ui/textarea-field/textarea-field.component.mjs +42 -0
  75. package/esm2022/src/lib/ui/unit-conversion-field/index.mjs +2 -0
  76. package/esm2022/src/lib/ui/unit-conversion-field/public-api.mjs +2 -0
  77. package/esm2022/src/lib/ui/unit-conversion-field/unit-conversion-field.component.mjs +86 -0
  78. package/esm2022/src/lib/utils/abstracts/autocomplete-field.abstract.mjs +30 -0
  79. package/esm2022/src/lib/utils/abstracts/crispr-control.mixin.mjs +27 -0
  80. package/esm2022/src/lib/utils/abstracts/crispr-display-field.abstract.mjs +14 -0
  81. package/esm2022/src/lib/utils/abstracts/crispr-field.abstract.mjs +19 -0
  82. package/esm2022/src/lib/utils/abstracts/index.mjs +5 -0
  83. package/esm2022/src/lib/utils/functions/buildFormGroupFromConfig.mjs +28 -0
  84. package/esm2022/src/lib/utils/functions/callOptionsIfFunction.mjs +4 -0
  85. package/esm2022/src/lib/utils/functions/createControlForType.mjs +19 -0
  86. package/esm2022/src/lib/utils/functions/filterOptionsByLabel.mjs +11 -0
  87. package/esm2022/src/lib/utils/functions/image-compression.helpers.mjs +50 -0
  88. package/esm2022/src/lib/utils/functions/index.mjs +8 -0
  89. package/esm2022/src/lib/utils/functions/isControlConfig.mjs +7 -0
  90. package/esm2022/src/lib/utils/functions/observablifyOptions.mjs +29 -0
  91. package/esm2022/src/lib/utils/index.mjs +2 -0
  92. package/esm2022/src/lib/utils/models/autocomplete-chiplist-field.config.mjs +2 -0
  93. package/esm2022/src/lib/utils/models/autocomplete-field.config.mjs +2 -0
  94. package/esm2022/src/lib/utils/models/button.config.mjs +2 -0
  95. package/esm2022/src/lib/utils/models/checkbox-field.config.mjs +2 -0
  96. package/esm2022/src/lib/utils/models/crispr-field.config.mjs +23 -0
  97. package/esm2022/src/lib/utils/models/datepicker-field.config.mjs +2 -0
  98. package/esm2022/src/lib/utils/models/divider.config.mjs +2 -0
  99. package/esm2022/src/lib/utils/models/file-upload-field.config.mjs +2 -0
  100. package/esm2022/src/lib/utils/models/form-group-list.config.mjs +2 -0
  101. package/esm2022/src/lib/utils/models/heading.config.mjs +3 -0
  102. package/esm2022/src/lib/utils/models/image-upload-field.config.mjs +2 -0
  103. package/esm2022/src/lib/utils/models/index.mjs +18 -0
  104. package/esm2022/src/lib/utils/models/input-field.config.mjs +2 -0
  105. package/esm2022/src/lib/utils/models/radio-field.config.mjs +2 -0
  106. package/esm2022/src/lib/utils/models/select-field.config.mjs +2 -0
  107. package/esm2022/src/lib/utils/models/slider-field.config.mjs +2 -0
  108. package/esm2022/src/lib/utils/models/textarea-field.config.mjs +2 -0
  109. package/esm2022/src/lib/utils/models/unit-conversion-field.config.mjs +2 -0
  110. package/esm2022/src/lib/utils/operators/form.operators.mjs +24 -0
  111. package/esm2022/src/lib/utils/operators/index.mjs +2 -0
  112. package/esm2022/src/lib/utils/public-api.mjs +5 -0
  113. package/esm2022/src/lib/utils/tft-crispr-forms-src-lib-utils.mjs +5 -0
  114. package/{esm2020 → esm2022}/tft-crispr-forms.mjs +4 -4
  115. package/fesm2022/tft-crispr-forms-index-2dAn0905.mjs +19 -0
  116. package/fesm2022/tft-crispr-forms-index-2dAn0905.mjs.map +1 -0
  117. package/fesm2022/tft-crispr-forms-index-76UuF0AI.mjs +36 -0
  118. package/fesm2022/tft-crispr-forms-index-76UuF0AI.mjs.map +1 -0
  119. package/{fesm2020/tft-crispr-forms-ui-image-upload-field.mjs → fesm2022/tft-crispr-forms-index-BXwiulEX.mjs} +169 -169
  120. package/fesm2022/tft-crispr-forms-index-BXwiulEX.mjs.map +1 -0
  121. package/fesm2022/tft-crispr-forms-index-BfR4XbYi.mjs +110 -0
  122. package/fesm2022/tft-crispr-forms-index-BfR4XbYi.mjs.map +1 -0
  123. package/fesm2022/tft-crispr-forms-index-C5X0mk3N.mjs +49 -0
  124. package/fesm2022/tft-crispr-forms-index-C5X0mk3N.mjs.map +1 -0
  125. package/fesm2022/tft-crispr-forms-index-CFUop3Cq.mjs +80 -0
  126. package/fesm2022/tft-crispr-forms-index-CFUop3Cq.mjs.map +1 -0
  127. package/fesm2022/tft-crispr-forms-index-CFdMVgM0.mjs +91 -0
  128. package/fesm2022/tft-crispr-forms-index-CFdMVgM0.mjs.map +1 -0
  129. package/fesm2022/tft-crispr-forms-index-CZdi06Jj.mjs +49 -0
  130. package/fesm2022/tft-crispr-forms-index-CZdi06Jj.mjs.map +1 -0
  131. package/fesm2022/tft-crispr-forms-index-C_I9vjqf.mjs +57 -0
  132. package/fesm2022/tft-crispr-forms-index-C_I9vjqf.mjs.map +1 -0
  133. package/fesm2022/tft-crispr-forms-index-DE8VOdBd.mjs +102 -0
  134. package/fesm2022/tft-crispr-forms-index-DE8VOdBd.mjs.map +1 -0
  135. package/fesm2022/tft-crispr-forms-index-OLo2t0tl.mjs +48 -0
  136. package/fesm2022/tft-crispr-forms-index-OLo2t0tl.mjs.map +1 -0
  137. package/fesm2022/tft-crispr-forms-index-OT7kkOgd.mjs +50 -0
  138. package/fesm2022/tft-crispr-forms-index-OT7kkOgd.mjs.map +1 -0
  139. package/fesm2022/tft-crispr-forms-index-Ukk3WgS2.mjs +54 -0
  140. package/fesm2022/tft-crispr-forms-index-Ukk3WgS2.mjs.map +1 -0
  141. package/fesm2022/tft-crispr-forms-index-rRi6OMY6.mjs +142 -0
  142. package/fesm2022/tft-crispr-forms-index-rRi6OMY6.mjs.map +1 -0
  143. package/fesm2022/tft-crispr-forms-index-xAaInTLg.mjs +73 -0
  144. package/fesm2022/tft-crispr-forms-index-xAaInTLg.mjs.map +1 -0
  145. package/{fesm2020/tft-crispr-forms-utils.mjs → fesm2022/tft-crispr-forms-src-lib-utils.mjs} +244 -235
  146. package/fesm2022/tft-crispr-forms-src-lib-utils.mjs.map +1 -0
  147. package/fesm2022/tft-crispr-forms.mjs +848 -0
  148. package/fesm2022/tft-crispr-forms.mjs.map +1 -0
  149. package/index.d.ts +5 -5
  150. package/package.json +13 -192
  151. package/public-api.d.ts +3 -3
  152. package/src/index.d.ts +1 -1
  153. package/src/lib/crispr-forms.module.d.ts +16 -15
  154. package/src/lib/display-field.directive.d.ts +23 -0
  155. package/src/lib/field-component-map.const.d.ts +42 -42
  156. package/src/lib/field.directive.d.ts +24 -24
  157. package/src/lib/form/form.component.d.ts +19 -19
  158. package/src/lib/form-group-list/form-group-list.component.d.ts +40 -36
  159. package/src/lib/form-group-list/index.d.ts +1 -1
  160. package/src/lib/pipes/crispr-pipes.module.d.ts +8 -8
  161. package/src/lib/pipes/initial-control-value.pipe.d.ts +10 -10
  162. package/src/lib/public_api.d.ts +2 -2
  163. package/src/lib/sub-group/index.d.ts +2 -2
  164. package/src/lib/sub-group/sub-group.component.d.ts +24 -22
  165. package/src/lib/sub-group/sub-group.module.d.ts +12 -12
  166. package/{ui → src/lib/ui}/autocomplete-chiplist-field/autocomplete-chiplist-field.component.d.ts +36 -33
  167. package/src/lib/ui/autocomplete-chiplist-field/index.d.ts +1 -0
  168. package/{ui → src/lib/ui}/autocomplete-chiplist-field/public-api.d.ts +1 -1
  169. package/{ui → src/lib/ui}/autocomplete-field/autocomplete-field.component.d.ts +25 -25
  170. package/src/lib/ui/autocomplete-field/index.d.ts +1 -0
  171. package/{ui → src/lib/ui}/autocomplete-field/public-api.d.ts +1 -1
  172. package/{ui → src/lib/ui}/button/button.component.d.ts +15 -15
  173. package/src/lib/ui/button/index.d.ts +1 -0
  174. package/{ui → src/lib/ui}/button/public-api.d.ts +1 -1
  175. package/src/lib/ui/checkbox-field/checkbox-field.component.d.ts +23 -0
  176. package/src/lib/ui/checkbox-field/index.d.ts +1 -0
  177. package/{ui → src/lib/ui}/checkbox-field/public-api.d.ts +1 -1
  178. package/{ui → src/lib/ui}/datepicker-field/datepicker-field.component.d.ts +32 -30
  179. package/src/lib/ui/datepicker-field/index.d.ts +1 -0
  180. package/{ui → src/lib/ui}/datepicker-field/public-api.d.ts +1 -1
  181. package/{ui → src/lib/ui}/divider/divider.component.d.ts +9 -9
  182. package/src/lib/ui/divider/index.d.ts +1 -0
  183. package/{ui → src/lib/ui}/divider/public-api.d.ts +1 -1
  184. package/{ui → src/lib/ui}/field-container/field-container.component.d.ts +24 -24
  185. package/src/lib/ui/field-container/index.d.ts +1 -0
  186. package/{ui → src/lib/ui}/field-container/public-api.d.ts +1 -1
  187. package/{ui → src/lib/ui}/file-dropzone/file-dropzone.directive.d.ts +10 -10
  188. package/src/lib/ui/file-dropzone/index.d.ts +1 -0
  189. package/{ui → src/lib/ui}/file-dropzone/public-api.d.ts +1 -1
  190. package/{ui → src/lib/ui}/file-upload-field/file-upload-field.component.d.ts +39 -37
  191. package/src/lib/ui/file-upload-field/index.d.ts +1 -0
  192. package/{ui → src/lib/ui}/file-upload-field/public-api.d.ts +1 -1
  193. package/{ui → src/lib/ui}/heading/heading.component.d.ts +8 -8
  194. package/src/lib/ui/heading/index.d.ts +1 -0
  195. package/{ui → src/lib/ui}/heading/public-api.d.ts +1 -1
  196. package/{ui → src/lib/ui}/image-upload-field/image-upload-field.component.d.ts +50 -48
  197. package/src/lib/ui/image-upload-field/index.d.ts +1 -0
  198. package/{ui → src/lib/ui}/image-upload-field/public-api.d.ts +1 -1
  199. package/src/lib/ui/index.d.ts +1 -0
  200. package/src/lib/ui/info/index.d.ts +1 -0
  201. package/{ui → src/lib/ui}/info/info.component.d.ts +7 -7
  202. package/{ui → src/lib/ui}/info/public-api.d.ts +1 -1
  203. package/src/lib/ui/input-field/index.d.ts +1 -0
  204. package/src/lib/ui/input-field/input-field.component.d.ts +24 -0
  205. package/{ui → src/lib/ui}/input-field/public-api.d.ts +1 -1
  206. package/src/lib/ui/option/index.d.ts +1 -0
  207. package/{ui → src/lib/ui}/option/option.component.d.ts +7 -7
  208. package/{ui → src/lib/ui}/option/public-api.d.ts +1 -1
  209. package/src/lib/ui/public-api.d.ts +6 -0
  210. package/src/lib/ui/radio-field/index.d.ts +1 -0
  211. package/{ui → src/lib/ui}/radio-field/public-api.d.ts +1 -1
  212. package/src/lib/ui/radio-field/radio-field.component.d.ts +25 -0
  213. package/src/lib/ui/select-field/index.d.ts +1 -0
  214. package/{ui → src/lib/ui}/select-field/public-api.d.ts +1 -1
  215. package/{ui → src/lib/ui}/select-field/select-field.component.d.ts +34 -32
  216. package/src/lib/ui/selected-file/index.d.ts +1 -0
  217. package/{ui → src/lib/ui}/selected-file/public-api.d.ts +1 -1
  218. package/{ui → src/lib/ui}/selected-file/selected-file.component.d.ts +10 -10
  219. package/src/lib/ui/slider-field/index.d.ts +1 -0
  220. package/{ui → src/lib/ui}/slider-field/public-api.d.ts +1 -1
  221. package/src/lib/ui/slider-field/slider-field.component.d.ts +24 -0
  222. package/src/lib/ui/textarea-field/index.d.ts +1 -0
  223. package/{ui → src/lib/ui}/textarea-field/public-api.d.ts +1 -1
  224. package/src/lib/ui/textarea-field/textarea-field.component.d.ts +23 -0
  225. package/src/lib/ui/unit-conversion-field/index.d.ts +1 -0
  226. package/{ui → src/lib/ui}/unit-conversion-field/public-api.d.ts +1 -1
  227. package/{ui → src/lib/ui}/unit-conversion-field/unit-conversion-field.component.d.ts +38 -36
  228. package/{utils → src/lib/utils}/abstracts/autocomplete-field.abstract.d.ts +28 -28
  229. package/{utils → src/lib/utils}/abstracts/crispr-control.mixin.d.ts +16 -16
  230. package/src/lib/utils/abstracts/crispr-display-field.abstract.d.ts +22 -0
  231. package/{utils → src/lib/utils}/abstracts/crispr-field.abstract.d.ts +11 -11
  232. package/{utils → src/lib/utils}/abstracts/index.d.ts +4 -3
  233. package/{utils → src/lib/utils}/functions/buildFormGroupFromConfig.d.ts +9 -9
  234. package/{utils → src/lib/utils}/functions/callOptionsIfFunction.d.ts +3 -3
  235. package/{utils → src/lib/utils}/functions/createControlForType.d.ts +9 -9
  236. package/{utils → src/lib/utils}/functions/filterOptionsByLabel.d.ts +7 -7
  237. package/{utils → src/lib/utils}/functions/image-compression.helpers.d.ts +5 -5
  238. package/{utils → src/lib/utils}/functions/index.d.ts +7 -7
  239. package/{utils → src/lib/utils}/functions/isControlConfig.d.ts +5 -5
  240. package/{utils → src/lib/utils}/functions/observablifyOptions.d.ts +12 -12
  241. package/{ui → src/lib/utils}/index.d.ts +5 -5
  242. package/{utils → src/lib/utils}/models/autocomplete-chiplist-field.config.d.ts +20 -20
  243. package/{utils → src/lib/utils}/models/autocomplete-field.config.d.ts +14 -14
  244. package/{utils → src/lib/utils}/models/button.config.d.ts +17 -17
  245. package/{utils → src/lib/utils}/models/checkbox-field.config.d.ts +6 -6
  246. package/{utils → src/lib/utils}/models/crispr-field.config.d.ts +97 -94
  247. package/{utils → src/lib/utils}/models/datepicker-field.config.d.ts +20 -20
  248. package/{utils → src/lib/utils}/models/divider.config.d.ts +5 -5
  249. package/{utils → src/lib/utils}/models/file-upload-field.config.d.ts +33 -33
  250. package/{utils → src/lib/utils}/models/form-group-list.config.d.ts +18 -17
  251. package/{utils → src/lib/utils}/models/heading.config.d.ts +6 -6
  252. package/{utils → src/lib/utils}/models/image-upload-field.config.d.ts +54 -54
  253. package/{utils → src/lib/utils}/models/index.d.ts +17 -17
  254. package/{utils → src/lib/utils}/models/input-field.config.d.ts +16 -16
  255. package/{utils → src/lib/utils}/models/radio-field.config.d.ts +6 -6
  256. package/{utils → src/lib/utils}/models/select-field.config.d.ts +21 -21
  257. package/{utils → src/lib/utils}/models/slider-field.config.d.ts +11 -13
  258. package/{utils → src/lib/utils}/models/textarea-field.config.d.ts +5 -5
  259. package/{utils → src/lib/utils}/models/unit-conversion-field.config.d.ts +30 -30
  260. package/{utils → src/lib/utils}/operators/form.operators.d.ts +1 -1
  261. package/{utils → src/lib/utils}/operators/index.d.ts +1 -1
  262. package/{utils → src/lib/utils}/public-api.d.ts +4 -4
  263. package/tft-crispr-forms-15.0.0.tgz +0 -0
  264. package/esm2020/public-api.mjs +0 -5
  265. package/esm2020/src/lib/crispr-forms.module.mjs +0 -57
  266. package/esm2020/src/lib/field-component-map.const.mjs +0 -27
  267. package/esm2020/src/lib/field.directive.mjs +0 -69
  268. package/esm2020/src/lib/form/form.component.mjs +0 -63
  269. package/esm2020/src/lib/form-group-list/form-group-list.component.mjs +0 -93
  270. package/esm2020/src/lib/pipes/initial-control-value.pipe.mjs +0 -21
  271. package/esm2020/src/lib/sub-group/sub-group.component.mjs +0 -21
  272. package/esm2020/src/lib/sub-group/sub-group.module.mjs +0 -42
  273. package/esm2020/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +0 -130
  274. package/esm2020/ui/autocomplete-chiplist-field/public-api.mjs +0 -2
  275. package/esm2020/ui/autocomplete-chiplist-field/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +0 -5
  276. package/esm2020/ui/autocomplete-field/autocomplete-field.component.mjs +0 -93
  277. package/esm2020/ui/autocomplete-field/public-api.mjs +0 -2
  278. package/esm2020/ui/autocomplete-field/tft-crispr-forms-ui-autocomplete-field.mjs +0 -5
  279. package/esm2020/ui/button/button.component.mjs +0 -49
  280. package/esm2020/ui/button/public-api.mjs +0 -2
  281. package/esm2020/ui/button/tft-crispr-forms-ui-button.mjs +0 -5
  282. package/esm2020/ui/checkbox-field/checkbox-field.component.mjs +0 -42
  283. package/esm2020/ui/checkbox-field/public-api.mjs +0 -2
  284. package/esm2020/ui/checkbox-field/tft-crispr-forms-ui-checkbox-field.mjs +0 -5
  285. package/esm2020/ui/datepicker-field/datepicker-field.component.mjs +0 -63
  286. package/esm2020/ui/datepicker-field/public-api.mjs +0 -2
  287. package/esm2020/ui/datepicker-field/tft-crispr-forms-ui-datepicker-field.mjs +0 -5
  288. package/esm2020/ui/divider/divider.component.mjs +0 -28
  289. package/esm2020/ui/divider/public-api.mjs +0 -2
  290. package/esm2020/ui/divider/tft-crispr-forms-ui-divider.mjs +0 -5
  291. package/esm2020/ui/field-container/field-container.component.mjs +0 -58
  292. package/esm2020/ui/field-container/public-api.mjs +0 -2
  293. package/esm2020/ui/field-container/tft-crispr-forms-ui-field-container.mjs +0 -5
  294. package/esm2020/ui/file-dropzone/file-dropzone.directive.mjs +0 -40
  295. package/esm2020/ui/file-dropzone/public-api.mjs +0 -2
  296. package/esm2020/ui/file-dropzone/tft-crispr-forms-ui-file-dropzone.mjs +0 -5
  297. package/esm2020/ui/file-upload-field/file-upload-field.component.mjs +0 -108
  298. package/esm2020/ui/file-upload-field/public-api.mjs +0 -2
  299. package/esm2020/ui/file-upload-field/tft-crispr-forms-ui-file-upload-field.mjs +0 -5
  300. package/esm2020/ui/heading/heading.component.mjs +0 -31
  301. package/esm2020/ui/heading/public-api.mjs +0 -2
  302. package/esm2020/ui/heading/tft-crispr-forms-ui-heading.mjs +0 -5
  303. package/esm2020/ui/image-upload-field/image-upload-field.component.mjs +0 -179
  304. package/esm2020/ui/image-upload-field/public-api.mjs +0 -2
  305. package/esm2020/ui/image-upload-field/tft-crispr-forms-ui-image-upload-field.mjs +0 -5
  306. package/esm2020/ui/info/info.component.mjs +0 -23
  307. package/esm2020/ui/info/public-api.mjs +0 -2
  308. package/esm2020/ui/info/tft-crispr-forms-ui-info.mjs +0 -5
  309. package/esm2020/ui/input-field/input-field.component.mjs +0 -41
  310. package/esm2020/ui/input-field/public-api.mjs +0 -2
  311. package/esm2020/ui/input-field/tft-crispr-forms-ui-input-field.mjs +0 -5
  312. package/esm2020/ui/option/option.component.mjs +0 -19
  313. package/esm2020/ui/option/public-api.mjs +0 -2
  314. package/esm2020/ui/option/tft-crispr-forms-ui-option.mjs +0 -5
  315. package/esm2020/ui/public-api.mjs +0 -7
  316. package/esm2020/ui/radio-field/public-api.mjs +0 -2
  317. package/esm2020/ui/radio-field/radio-field.component.mjs +0 -39
  318. package/esm2020/ui/radio-field/tft-crispr-forms-ui-radio-field.mjs +0 -5
  319. package/esm2020/ui/select-field/public-api.mjs +0 -2
  320. package/esm2020/ui/select-field/select-field.component.mjs +0 -73
  321. package/esm2020/ui/select-field/tft-crispr-forms-ui-select-field.mjs +0 -5
  322. package/esm2020/ui/selected-file/public-api.mjs +0 -2
  323. package/esm2020/ui/selected-file/selected-file.component.mjs +0 -26
  324. package/esm2020/ui/selected-file/tft-crispr-forms-ui-selected-file.mjs +0 -5
  325. package/esm2020/ui/slider-field/public-api.mjs +0 -2
  326. package/esm2020/ui/slider-field/slider-field.component.mjs +0 -44
  327. package/esm2020/ui/slider-field/tft-crispr-forms-ui-slider-field.mjs +0 -5
  328. package/esm2020/ui/textarea-field/public-api.mjs +0 -2
  329. package/esm2020/ui/textarea-field/textarea-field.component.mjs +0 -42
  330. package/esm2020/ui/textarea-field/tft-crispr-forms-ui-textarea-field.mjs +0 -5
  331. package/esm2020/ui/tft-crispr-forms-ui.mjs +0 -5
  332. package/esm2020/ui/unit-conversion-field/public-api.mjs +0 -2
  333. package/esm2020/ui/unit-conversion-field/tft-crispr-forms-ui-unit-conversion-field.mjs +0 -5
  334. package/esm2020/ui/unit-conversion-field/unit-conversion-field.component.mjs +0 -84
  335. package/esm2020/utils/abstracts/autocomplete-field.abstract.mjs +0 -30
  336. package/esm2020/utils/abstracts/crispr-control.mixin.mjs +0 -27
  337. package/esm2020/utils/abstracts/crispr-field.abstract.mjs +0 -20
  338. package/esm2020/utils/abstracts/index.mjs +0 -4
  339. package/esm2020/utils/functions/buildFormGroupFromConfig.mjs +0 -28
  340. package/esm2020/utils/functions/callOptionsIfFunction.mjs +0 -4
  341. package/esm2020/utils/functions/createControlForType.mjs +0 -19
  342. package/esm2020/utils/functions/filterOptionsByLabel.mjs +0 -11
  343. package/esm2020/utils/functions/image-compression.helpers.mjs +0 -50
  344. package/esm2020/utils/functions/index.mjs +0 -8
  345. package/esm2020/utils/functions/isControlConfig.mjs +0 -7
  346. package/esm2020/utils/functions/observablifyOptions.mjs +0 -29
  347. package/esm2020/utils/models/autocomplete-chiplist-field.config.mjs +0 -2
  348. package/esm2020/utils/models/autocomplete-field.config.mjs +0 -2
  349. package/esm2020/utils/models/button.config.mjs +0 -2
  350. package/esm2020/utils/models/checkbox-field.config.mjs +0 -2
  351. package/esm2020/utils/models/crispr-field.config.mjs +0 -23
  352. package/esm2020/utils/models/datepicker-field.config.mjs +0 -2
  353. package/esm2020/utils/models/divider.config.mjs +0 -2
  354. package/esm2020/utils/models/file-upload-field.config.mjs +0 -2
  355. package/esm2020/utils/models/form-group-list.config.mjs +0 -2
  356. package/esm2020/utils/models/heading.config.mjs +0 -3
  357. package/esm2020/utils/models/image-upload-field.config.mjs +0 -2
  358. package/esm2020/utils/models/index.mjs +0 -18
  359. package/esm2020/utils/models/input-field.config.mjs +0 -2
  360. package/esm2020/utils/models/radio-field.config.mjs +0 -2
  361. package/esm2020/utils/models/select-field.config.mjs +0 -2
  362. package/esm2020/utils/models/slider-field.config.mjs +0 -2
  363. package/esm2020/utils/models/textarea-field.config.mjs +0 -2
  364. package/esm2020/utils/models/unit-conversion-field.config.mjs +0 -2
  365. package/esm2020/utils/operators/form.operators.mjs +0 -24
  366. package/esm2020/utils/operators/index.mjs +0 -2
  367. package/esm2020/utils/public-api.mjs +0 -5
  368. package/esm2020/utils/tft-crispr-forms-utils.mjs +0 -5
  369. package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +0 -138
  370. package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +0 -1
  371. package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs +0 -101
  372. package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs.map +0 -1
  373. package/fesm2015/tft-crispr-forms-ui-button.mjs +0 -55
  374. package/fesm2015/tft-crispr-forms-ui-button.mjs.map +0 -1
  375. package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs +0 -49
  376. package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs.map +0 -1
  377. package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs +0 -71
  378. package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs.map +0 -1
  379. package/fesm2015/tft-crispr-forms-ui-divider.mjs +0 -34
  380. package/fesm2015/tft-crispr-forms-ui-divider.mjs.map +0 -1
  381. package/fesm2015/tft-crispr-forms-ui-field-container.mjs +0 -64
  382. package/fesm2015/tft-crispr-forms-ui-field-container.mjs.map +0 -1
  383. package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs +0 -47
  384. package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs.map +0 -1
  385. package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs +0 -117
  386. package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs.map +0 -1
  387. package/fesm2015/tft-crispr-forms-ui-heading.mjs +0 -37
  388. package/fesm2015/tft-crispr-forms-ui-heading.mjs.map +0 -1
  389. package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs +0 -182
  390. package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs.map +0 -1
  391. package/fesm2015/tft-crispr-forms-ui-info.mjs +0 -30
  392. package/fesm2015/tft-crispr-forms-ui-info.mjs.map +0 -1
  393. package/fesm2015/tft-crispr-forms-ui-input-field.mjs +0 -48
  394. package/fesm2015/tft-crispr-forms-ui-input-field.mjs.map +0 -1
  395. package/fesm2015/tft-crispr-forms-ui-option.mjs +0 -26
  396. package/fesm2015/tft-crispr-forms-ui-option.mjs.map +0 -1
  397. package/fesm2015/tft-crispr-forms-ui-radio-field.mjs +0 -46
  398. package/fesm2015/tft-crispr-forms-ui-radio-field.mjs.map +0 -1
  399. package/fesm2015/tft-crispr-forms-ui-select-field.mjs +0 -81
  400. package/fesm2015/tft-crispr-forms-ui-select-field.mjs.map +0 -1
  401. package/fesm2015/tft-crispr-forms-ui-selected-file.mjs +0 -33
  402. package/fesm2015/tft-crispr-forms-ui-selected-file.mjs.map +0 -1
  403. package/fesm2015/tft-crispr-forms-ui-slider-field.mjs +0 -51
  404. package/fesm2015/tft-crispr-forms-ui-slider-field.mjs.map +0 -1
  405. package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs +0 -49
  406. package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs.map +0 -1
  407. package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs +0 -93
  408. package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs.map +0 -1
  409. package/fesm2015/tft-crispr-forms-ui.mjs +0 -12
  410. package/fesm2015/tft-crispr-forms-ui.mjs.map +0 -1
  411. package/fesm2015/tft-crispr-forms-utils.mjs +0 -270
  412. package/fesm2015/tft-crispr-forms-utils.mjs.map +0 -1
  413. package/fesm2015/tft-crispr-forms.mjs +0 -379
  414. package/fesm2015/tft-crispr-forms.mjs.map +0 -1
  415. package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +0 -137
  416. package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +0 -1
  417. package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs +0 -100
  418. package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs.map +0 -1
  419. package/fesm2020/tft-crispr-forms-ui-button.mjs +0 -55
  420. package/fesm2020/tft-crispr-forms-ui-button.mjs.map +0 -1
  421. package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs +0 -49
  422. package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs.map +0 -1
  423. package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs +0 -70
  424. package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs.map +0 -1
  425. package/fesm2020/tft-crispr-forms-ui-divider.mjs +0 -34
  426. package/fesm2020/tft-crispr-forms-ui-divider.mjs.map +0 -1
  427. package/fesm2020/tft-crispr-forms-ui-field-container.mjs +0 -65
  428. package/fesm2020/tft-crispr-forms-ui-field-container.mjs.map +0 -1
  429. package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs +0 -47
  430. package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs.map +0 -1
  431. package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs +0 -115
  432. package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs.map +0 -1
  433. package/fesm2020/tft-crispr-forms-ui-heading.mjs +0 -37
  434. package/fesm2020/tft-crispr-forms-ui-heading.mjs.map +0 -1
  435. package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs.map +0 -1
  436. package/fesm2020/tft-crispr-forms-ui-info.mjs +0 -30
  437. package/fesm2020/tft-crispr-forms-ui-info.mjs.map +0 -1
  438. package/fesm2020/tft-crispr-forms-ui-input-field.mjs +0 -48
  439. package/fesm2020/tft-crispr-forms-ui-input-field.mjs.map +0 -1
  440. package/fesm2020/tft-crispr-forms-ui-option.mjs +0 -26
  441. package/fesm2020/tft-crispr-forms-ui-option.mjs.map +0 -1
  442. package/fesm2020/tft-crispr-forms-ui-radio-field.mjs +0 -46
  443. package/fesm2020/tft-crispr-forms-ui-radio-field.mjs.map +0 -1
  444. package/fesm2020/tft-crispr-forms-ui-select-field.mjs +0 -80
  445. package/fesm2020/tft-crispr-forms-ui-select-field.mjs.map +0 -1
  446. package/fesm2020/tft-crispr-forms-ui-selected-file.mjs +0 -33
  447. package/fesm2020/tft-crispr-forms-ui-selected-file.mjs.map +0 -1
  448. package/fesm2020/tft-crispr-forms-ui-slider-field.mjs +0 -51
  449. package/fesm2020/tft-crispr-forms-ui-slider-field.mjs.map +0 -1
  450. package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs +0 -49
  451. package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs.map +0 -1
  452. package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs +0 -91
  453. package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs.map +0 -1
  454. package/fesm2020/tft-crispr-forms-ui.mjs +0 -12
  455. package/fesm2020/tft-crispr-forms-ui.mjs.map +0 -1
  456. package/fesm2020/tft-crispr-forms-utils.mjs.map +0 -1
  457. package/fesm2020/tft-crispr-forms.mjs +0 -377
  458. package/fesm2020/tft-crispr-forms.mjs.map +0 -1
  459. package/tft-crispr-forms-14.0.1.tgz +0 -0
  460. package/ui/README.md +0 -3
  461. package/ui/autocomplete-chiplist-field/index.d.ts +0 -5
  462. package/ui/autocomplete-field/index.d.ts +0 -5
  463. package/ui/button/index.d.ts +0 -5
  464. package/ui/checkbox-field/checkbox-field.component.d.ts +0 -21
  465. package/ui/checkbox-field/index.d.ts +0 -5
  466. package/ui/datepicker-field/index.d.ts +0 -5
  467. package/ui/divider/index.d.ts +0 -5
  468. package/ui/field-container/index.d.ts +0 -5
  469. package/ui/file-dropzone/index.d.ts +0 -5
  470. package/ui/file-upload-field/index.d.ts +0 -5
  471. package/ui/heading/index.d.ts +0 -5
  472. package/ui/image-upload-field/index.d.ts +0 -5
  473. package/ui/info/index.d.ts +0 -5
  474. package/ui/input-field/index.d.ts +0 -5
  475. package/ui/input-field/input-field.component.d.ts +0 -22
  476. package/ui/option/index.d.ts +0 -5
  477. package/ui/public-api.d.ts +0 -5
  478. package/ui/radio-field/index.d.ts +0 -5
  479. package/ui/radio-field/radio-field.component.d.ts +0 -23
  480. package/ui/select-field/index.d.ts +0 -5
  481. package/ui/selected-file/index.d.ts +0 -5
  482. package/ui/slider-field/index.d.ts +0 -5
  483. package/ui/slider-field/slider-field.component.d.ts +0 -25
  484. package/ui/textarea-field/index.d.ts +0 -5
  485. package/ui/textarea-field/textarea-field.component.d.ts +0 -21
  486. package/ui/unit-conversion-field/index.d.ts +0 -5
  487. package/utils/index.d.ts +0 -5
  488. /package/{utils → src/lib/utils}/README.md +0 -0
@@ -0,0 +1,73 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy } from '@angular/core';
3
+ import * as i2 from '@angular/material/datepicker';
4
+ import { MatDatepickerModule } from '@angular/material/datepicker';
5
+ import { MatDateFnsModule } from '@angular/material-date-fns-adapter';
6
+ import { of } from 'rxjs';
7
+ import * as i6 from '@angular/cdk/portal';
8
+ import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
9
+ import * as i3 from '@angular/material/form-field';
10
+ import { MatFormFieldModule } from '@angular/material/form-field';
11
+ import * as i1 from '@angular/common';
12
+ import { CommonModule } from '@angular/common';
13
+ import * as i2$1 from '@angular/forms';
14
+ import { ReactiveFormsModule } from '@angular/forms';
15
+ import * as i5 from '@angular/material/input';
16
+ import { MatInputModule } from '@angular/material/input';
17
+ import * as i7 from '@tft/form-validation-handler';
18
+ import { FormValidationHandlerModule } from '@tft/form-validation-handler';
19
+ import { crisprControlMixin, CrisprFieldComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
20
+ import 'rxjs/operators';
21
+ import '@angular/material/button';
22
+ import '@angular/material/icon';
23
+ import '@angular/material/progress-bar';
24
+ import '@angular/material/tooltip';
25
+
26
+ /* eslint-disable @nx/enforce-module-boundaries */
27
+ const defaultConfig = {
28
+ startView: 'month',
29
+ };
30
+ const DatepickerFieldMixin = crisprControlMixin(CrisprFieldComponent);
31
+ class DatepickerFieldComponent extends DatepickerFieldMixin {
32
+ constructor() {
33
+ super(...arguments);
34
+ this.defaultConfig = defaultConfig;
35
+ }
36
+ ngOnInit() {
37
+ super.ngOnInit();
38
+ this.startAt$ =
39
+ this.config.startAt instanceof Date
40
+ ? of(this.config.startAt)
41
+ : this.config.startAt instanceof Function
42
+ ? this.config.startAt(this.group)
43
+ : of(null);
44
+ this.dateClass = this.config?.cellClassFunction || null;
45
+ this.dateClass$ = this.config.dateClass
46
+ ? this.config?.dateClass(this.group)
47
+ : of(() => '');
48
+ }
49
+ ngAfterContentInit() {
50
+ if (this.config.datepickerActions) {
51
+ this.calendarFooterPortal = new ComponentPortal(this.config.datepickerActions);
52
+ }
53
+ }
54
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: DatepickerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
55
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.9", type: DatepickerFieldComponent, isStandalone: true, selector: "crispr-datepicker-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n matInput\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config.datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config.touchUi\"\n [startView]=\"config.startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n <mat-datepicker-actions *ngIf=\"calendarFooterPortal\">\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n</crispr-field-container>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDateFnsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
56
+ }
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
58
+ type: Component,
59
+ args: [{ selector: 'crispr-datepicker-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
60
+ CommonModule,
61
+ FieldContainerComponent,
62
+ MatDatepickerModule,
63
+ MatFormFieldModule,
64
+ ReactiveFormsModule,
65
+ MatInputModule,
66
+ MatDateFnsModule,
67
+ PortalModule,
68
+ FormValidationHandlerModule,
69
+ ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n matInput\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config.datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config.touchUi\"\n [startView]=\"config.startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n <mat-datepicker-actions *ngIf=\"calendarFooterPortal\">\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n</crispr-field-container>\n\n" }]
70
+ }] });
71
+
72
+ export { DatepickerFieldComponent };
73
+ //# sourceMappingURL=tft-crispr-forms-index-xAaInTLg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tft-crispr-forms-index-xAaInTLg.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n AfterContentInit,\n} from '@angular/core';\nimport {\n MatCalendarCellClassFunction,\n MatDatepickerModule,\n} from '@angular/material/datepicker';\nimport { MatDateFnsModule } from '@angular/material-date-fns-adapter';\nimport { Observable, of } from 'rxjs';\nimport { ComponentPortal, Portal, PortalModule } from '@angular/cdk/portal';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n crisprControlMixin,\n CrisprFieldComponent,\n DatepickerFieldConfig,\n} from '../../utils';\n\nconst defaultConfig: Partial<DatepickerFieldConfig> = {\n startView: 'month',\n};\nconst DatepickerFieldMixin =\n crisprControlMixin<DatepickerFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-datepicker-field',\n templateUrl: './datepicker-field.component.html',\n styleUrls: ['./datepicker-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n FieldContainerComponent,\n MatDatepickerModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDateFnsModule,\n PortalModule,\n FormValidationHandlerModule,\n ],\n})\nexport class DatepickerFieldComponent\n extends DatepickerFieldMixin\n implements OnInit, AfterContentInit\n{\n defaultConfig = defaultConfig;\n\n dateClass: MatCalendarCellClassFunction<Date>;\n dateClass$: Observable<MatCalendarCellClassFunction<Date>>;\n startAt$: Observable<Date>;\n\n /** A portal containing the footer component type for this calendar. */\n calendarFooterPortal: Portal<any>;\n\n ngOnInit() {\n super.ngOnInit();\n this.startAt$ =\n this.config.startAt instanceof Date\n ? of(this.config.startAt)\n : this.config.startAt instanceof Function\n ? this.config.startAt(this.group)\n : of(null);\n this.dateClass = this.config?.cellClassFunction || null;\n this.dateClass$ = this.config.dateClass\n ? this.config?.dateClass(this.group)\n : of(() => '');\n }\n\n ngAfterContentInit() {\n if (this.config.datepickerActions) {\n this.calendarFooterPortal = new ComponentPortal(\n this.config.datepickerActions\n );\n }\n }\n\n // handleSelectedChange(event, picker: MatDatepicker<unknown>) {\n // console.log({event, picker})\n // if(this.config.selectedChange) {\n // this.config.selectedChange(event, picker);\n // }\n // }\n}\n","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n matInput\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config.datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config.touchUi\"\n [startView]=\"config.startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n <mat-datepicker-actions *ngIf=\"calendarFooterPortal\">\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n</crispr-field-container>\n\n"],"names":[],"mappings":"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"}
@@ -1,269 +1,278 @@
1
1
  import { map, startWith, debounceTime, distinctUntilChanged, switchMap, shareReplay } from 'rxjs/operators';
2
2
  import * as i0 from '@angular/core';
3
3
  import { Directive } from '@angular/core';
4
- import { FormControl, FormArray, FormGroup } from '@angular/forms';
4
+ import { FormArray, FormControl, FormGroup } from '@angular/forms';
5
5
  import { from, of, isObservable } from 'rxjs';
6
6
 
7
- function valueIn(values) {
8
- return map((value) => {
9
- if (value) {
10
- return values.some(v => {
11
- if (isRegex(v)) {
12
- const trimmedStringForRegex = v.substr(1, v.length - 2);
13
- const regex = new RegExp(trimmedStringForRegex);
14
- return regex.test(value);
15
- }
16
- else {
17
- return v === value;
18
- }
19
- });
20
- }
21
- else {
22
- return false;
23
- }
24
- });
25
- }
26
- function isRegex(string) {
27
- return string.startsWith('/') && string.endsWith('/');
7
+ function valueIn(values) {
8
+ return map((value) => {
9
+ if (value) {
10
+ return values.some(v => {
11
+ if (isRegex(v)) {
12
+ const trimmedStringForRegex = v.substr(1, v.length - 2);
13
+ const regex = new RegExp(trimmedStringForRegex);
14
+ return regex.test(value);
15
+ }
16
+ else {
17
+ return v === value;
18
+ }
19
+ });
20
+ }
21
+ else {
22
+ return false;
23
+ }
24
+ });
25
+ }
26
+ function isRegex(string) {
27
+ return string.startsWith('/') && string.endsWith('/');
28
28
  }
29
29
 
30
30
  const DEFAULT_EMPTY_OPTIONS_MESSAGE = 'No Items';
31
31
 
32
- // export type ControlType = keyof typeof FIELD_COMPONENTS;
33
- var ControlType;
34
- (function (ControlType) {
35
- ControlType["AUTOCOMPLETE"] = "autocomplete";
36
- ControlType["AUTOCOMPLETE_CHIPLIST"] = "autocompleteChiplist";
37
- ControlType["BUTTON"] = "button";
38
- ControlType["CHECKBOX"] = "checkbox";
39
- ControlType["CUSTOM"] = "custom";
40
- ControlType["DATEPICKER"] = "datepicker";
41
- ControlType["DIVIDER"] = "divider";
42
- ControlType["FILE_UPLOAD"] = "fileUpload";
43
- ControlType["HEADING"] = "heading";
44
- ControlType["INPUT"] = "input";
45
- ControlType["IMAGE_UPLOAD"] = "imageUpload";
46
- ControlType["GROUP_LIST"] = "groupList";
47
- ControlType["RADIO"] = "radio";
48
- ControlType["SELECT"] = "select";
49
- ControlType["SLIDER"] = "slider";
50
- ControlType["SUB_GROUP"] = "subGroup";
51
- ControlType["TEXTAREA"] = "textarea";
52
- ControlType["UNIT_CONVERSION"] = "unitConversion";
32
+ // export type ControlType = keyof typeof FIELD_COMPONENTS;
33
+ var ControlType;
34
+ (function (ControlType) {
35
+ ControlType["AUTOCOMPLETE"] = "autocomplete";
36
+ ControlType["AUTOCOMPLETE_CHIPLIST"] = "autocompleteChiplist";
37
+ ControlType["BUTTON"] = "button";
38
+ ControlType["CHECKBOX"] = "checkbox";
39
+ ControlType["CUSTOM"] = "custom";
40
+ ControlType["DATEPICKER"] = "datepicker";
41
+ ControlType["DIVIDER"] = "divider";
42
+ ControlType["FILE_UPLOAD"] = "fileUpload";
43
+ ControlType["HEADING"] = "heading";
44
+ ControlType["INPUT"] = "input";
45
+ ControlType["IMAGE_UPLOAD"] = "imageUpload";
46
+ ControlType["GROUP_LIST"] = "groupList";
47
+ ControlType["RADIO"] = "radio";
48
+ ControlType["SELECT"] = "select";
49
+ ControlType["SLIDER"] = "slider";
50
+ ControlType["SUB_GROUP"] = "subGroup";
51
+ ControlType["TEXTAREA"] = "textarea";
52
+ ControlType["UNIT_CONVERSION"] = "unitConversion";
53
53
  })(ControlType || (ControlType = {}));
54
54
 
55
55
  ;
56
56
 
57
- function crisprControlMixin(BaseClass) {
58
- return class extends BaseClass {
59
- set value(value) {
60
- this.setControlValue(value);
61
- this._value = value;
62
- }
63
- get value() {
64
- return this._value;
65
- }
66
- ngOnInit() {
67
- super.ngOnInit();
68
- this.control = this.group.get(this.config.controlName);
69
- this.setControlValue(this.value);
70
- // setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values
71
- setTimeout(() => {
72
- this.control.updateValueAndValidity();
73
- });
74
- }
75
- setControlValue(value) {
76
- if (value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {
77
- this.control.setValue(value);
78
- }
79
- }
80
- };
57
+ function crisprControlMixin(BaseClass) {
58
+ return class extends BaseClass {
59
+ set value(value) {
60
+ this.setControlValue(value);
61
+ this._value = value;
62
+ }
63
+ get value() {
64
+ return this._value;
65
+ }
66
+ ngOnInit() {
67
+ super.ngOnInit();
68
+ this.control = this.group.get(this.config.controlName);
69
+ this.setControlValue(this.value);
70
+ // setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values
71
+ setTimeout(() => {
72
+ this.control.updateValueAndValidity();
73
+ });
74
+ }
75
+ setControlValue(value) {
76
+ if (value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {
77
+ this.control.setValue(value);
78
+ }
79
+ }
80
+ };
81
81
  }
82
82
 
83
- // eslint-disable-next-line @angular-eslint/directive-class-suffix
84
- class CrisprFieldComponent {
85
- ngOnInit() {
86
- this.applyDefaultConfig();
87
- }
88
- applyDefaultConfig() {
89
- this.config = this.defaultConfig ? { ...this.defaultConfig, ...this.config } : this.config;
90
- }
91
- }
92
- CrisprFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CrisprFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
- CrisprFieldComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CrisprFieldComponent, isStandalone: true, ngImport: i0 });
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CrisprFieldComponent, decorators: [{
95
- type: Directive,
96
- args: [{
97
- standalone: true
98
- }]
83
+ class CrisprFieldComponent {
84
+ ngOnInit() {
85
+ this.applyDefaultConfig();
86
+ }
87
+ applyDefaultConfig() {
88
+ this.config = this.defaultConfig ? { ...this.defaultConfig, ...this.config } : this.config;
89
+ }
90
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
91
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: CrisprFieldComponent, isStandalone: true, ngImport: i0 }); }
92
+ }
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprFieldComponent, decorators: [{
94
+ type: Directive,
95
+ args: [{
96
+ standalone: true
97
+ }]
99
98
  }] });
100
99
 
101
- function callOptionsIfFunction(options, parentGroup, searchString) {
102
- return options instanceof Function ? options(parentGroup, searchString) : options;
100
+ /**
101
+ * Analyze the config and build a form control to spec. Notice we don't use FormBuilder here
102
+ * as we want to keep this function pure.
103
+ * @param controlConfig the configuration object for the control to build
104
+ * @param value an initial value to use if passed in
105
+ */
106
+ function createControlForType(controlConfig, value = null) {
107
+ // build form control out based on the control type
108
+ const control = controlConfig.controlType === ControlType.SUB_GROUP
109
+ ? buildFormGroupFromConfig(controlConfig, value)
110
+ : controlConfig.controlType === ControlType.GROUP_LIST
111
+ ? new FormArray([], controlConfig.validators)
112
+ : new FormControl(value || null, controlConfig.validators);
113
+ return control;
114
+ }
115
+
116
+ /**
117
+ * Determines if the field config is for a form control (not a divider, heading or other non-control field)
118
+ */
119
+ function isControlConfig(fieldConfig) {
120
+ return 'controlName' in fieldConfig;
103
121
  }
104
122
 
105
- /**
106
- * The user can give us select options as an array, a function that resolves to a promise,
107
- * or an observable. This functions consumes any of those and returns an observable that
108
- * resolves an array of options
109
- *
110
- * @param options the options passed in from the config
111
- * @param emptyMessageOption the message to display when the array is empty
112
- */
113
- function observablifyOptions(options, parentGroup, searchString) {
114
- const calledOptions = callOptionsIfFunction(options, parentGroup, searchString);
115
- // if options are a promise
116
- const observableOptions = calledOptions instanceof Promise
117
- // convert to observable
118
- ? from(calledOptions)
119
- // if array that isn't empty
120
- : Array.isArray(calledOptions) && calledOptions.length
121
- // convert to observable
122
- ? of(calledOptions)
123
- // if observable
124
- : isObservable(calledOptions)
125
- // return it
126
- ? calledOptions
127
- // else an empty array
128
- : of([]);
129
- return observableOptions;
123
+ /**
124
+ * builds out form group based on config
125
+ * @param config a configuration for a form group
126
+ * @param value an object of initial values to pass in
127
+ * @param group the form group to modify and build out
128
+ */
129
+ function buildFormGroupFromConfig(config, value = null, group = new FormGroup({})) {
130
+ config.fields.forEach((controlConfig) => {
131
+ if (isControlConfig(controlConfig)) {
132
+ // then add a control to the group using the controlName from configuration
133
+ const { controlName } = controlConfig;
134
+ if (group.get(controlName)) {
135
+ group.removeControl(controlName);
136
+ }
137
+ // if there's a value object and it has a non-null/undefined value for this field use it.
138
+ // Otherwise, default to null
139
+ const controlValue = (value && value[controlName]) ?? null;
140
+ const control = createControlForType(controlConfig, controlValue);
141
+ group.addControl(controlName, control);
142
+ }
143
+ });
144
+ group.setValidators(config.validators);
145
+ return group;
130
146
  }
131
147
 
132
- const AbstractAutocompleteFieldMixin = crisprControlMixin(CrisprFieldComponent);
133
- // eslint-disable-next-line @angular-eslint/directive-class-suffix
134
- class AbstractAutocompleteComponent extends AbstractAutocompleteFieldMixin {
135
- constructor() {
136
- super(...arguments);
137
- // we need a separate control for the UI because of the way the material autocomplete chiplist works
138
- this.autocompleteInputControl = new FormControl('');
139
- }
140
- ngOnInit() {
141
- super.ngOnInit();
142
- this.group.addControl(this.config.controlName, new FormControl());
143
- // filter options by the search string using either the default filter function or one passed in through config
144
- this.options$ = this.autocompleteInputControl.valueChanges.pipe(
145
- // this is needed to have the options panel to open on focus
146
- startWith(''), debounceTime(this.config.typeDebounceTime), map((searchText) => typeof searchText === 'string' ? searchText?.trim() : ''), distinctUntilChanged(), switchMap((searchText) => observablifyOptions(this.config.options, this.group, searchText)), shareReplay(1));
147
- }
148
- }
149
- AbstractAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AbstractAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
150
- AbstractAutocompleteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: AbstractAutocompleteComponent, usesInheritance: true, ngImport: i0 });
151
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AbstractAutocompleteComponent, decorators: [{
152
- type: Directive
153
- }] });
148
+ function callOptionsIfFunction(options, parentGroup, searchString) {
149
+ return options instanceof Function ? options(parentGroup, searchString) : options;
150
+ }
154
151
 
155
- /**
156
- * Analyze the config and build a form control to spec. Notice we don't use FormBuilder here
157
- * as we want to keep this function pure.
158
- * @param controlConfig the configuration object for the control to build
159
- * @param value an initial value to use if passed in
160
- */
161
- function createControlForType(controlConfig, value = null) {
162
- // build form control out based on the control type
163
- const control = controlConfig.controlType === ControlType.SUB_GROUP
164
- ? buildFormGroupFromConfig(controlConfig, value)
165
- : controlConfig.controlType === ControlType.GROUP_LIST
166
- ? new FormArray([], controlConfig.validators)
167
- : new FormControl(value || null, controlConfig.validators);
168
- return control;
152
+ /**
153
+ * A basic filter function that filters the search string against the label of the options object
154
+ * @param options the array of options to filter
155
+ * @param searchString the string from the input
156
+ */
157
+ function filterOptionsByLabel(options, searchString) {
158
+ return options.filter(option => {
159
+ return option.label && option.label.toLowerCase().includes(searchString.toLowerCase());
160
+ });
169
161
  }
170
162
 
171
- /**
172
- * Determines if the field config is for a form control (not a divider, heading or other non-control field)
173
- * */
174
- function isControlConfig(fieldConfig) {
175
- return 'controlName' in fieldConfig;
163
+ /**
164
+ * The user can give us select options as an array, a function that resolves to a promise,
165
+ * or an observable. This functions consumes any of those and returns an observable that
166
+ * resolves an array of options
167
+ *
168
+ * @param options the options passed in from the config
169
+ * @param emptyMessageOption the message to display when the array is empty
170
+ */
171
+ function observablifyOptions(options, parentGroup, searchString) {
172
+ const calledOptions = callOptionsIfFunction(options, parentGroup, searchString);
173
+ // if options are a promise
174
+ const observableOptions = calledOptions instanceof Promise
175
+ // convert to observable
176
+ ? from(calledOptions)
177
+ // if array that isn't empty
178
+ : Array.isArray(calledOptions) && calledOptions.length
179
+ // convert to observable
180
+ ? of(calledOptions)
181
+ // if observable
182
+ : isObservable(calledOptions)
183
+ // return it
184
+ ? calledOptions
185
+ // else an empty array
186
+ : of([]);
187
+ return observableOptions;
176
188
  }
177
189
 
178
- /**
179
- * builds out form group based on config
180
- * @param config a configuration for a form group
181
- * @param value an object of initial values to pass in
182
- * @param group the form group to modify and build out
183
- */
184
- function buildFormGroupFromConfig(config, value = null, group = new FormGroup({})) {
185
- config.fields.forEach((controlConfig) => {
186
- if (isControlConfig(controlConfig)) {
187
- // then add a control to the group using the controlName from configuration
188
- const { controlName } = controlConfig;
189
- if (group.get(controlName)) {
190
- group.removeControl(controlName);
191
- }
192
- // if there's a value object and it has a non-null/undefined value for this field use it.
193
- // Otherwise, default to null
194
- const controlValue = (value && value[controlName]) ?? null;
195
- const control = createControlForType(controlConfig, controlValue);
196
- group.addControl(controlName, control);
197
- }
198
- });
199
- group.setValidators(config.validators);
200
- return group;
190
+ function convertBytesToMb(bytes) {
191
+ return bytes / 1048576;
192
+ }
193
+ function maxFileSizeValidator(maxFileSize) {
194
+ return (control) => {
195
+ const controlValue = control.value;
196
+ if (!(controlValue instanceof File)) {
197
+ return null;
198
+ }
199
+ const actualFileSize = +convertBytesToMb(controlValue.size).toPrecision(3);
200
+ if (maxFileSize > actualFileSize)
201
+ return null;
202
+ return { maxFileSize: { maxFileSize, actualFileSize } };
203
+ };
204
+ }
205
+ function allowedFileExtValidator(allowedFileExtensions, onlyAllowFiles = true) {
206
+ return (control) => {
207
+ const controlValue = control.value;
208
+ const isFile = controlValue instanceof File;
209
+ if (!onlyAllowFiles && !isFile)
210
+ return null;
211
+ const actualExtension = isFile ? controlValue.name.split('.').pop().toLocaleLowerCase() : 'Not a file';
212
+ const isAllowedExtension = allowedFileExtensions.includes(actualExtension);
213
+ if (isAllowedExtension) {
214
+ return null;
215
+ }
216
+ return { allowedExtension: { allowedFileExtensions, actualExtension } };
217
+ };
218
+ }
219
+ function allowedFileType(matchExp) {
220
+ return (formControl) => {
221
+ const value = formControl.value;
222
+ if (!(value instanceof File))
223
+ return null;
224
+ const type = value.type;
225
+ const matches = type.match(matchExp);
226
+ if (!type || !matches?.length) {
227
+ return {
228
+ allowedFileType: {
229
+ actualType: type,
230
+ allowedTypeExp: matchExp
231
+ }
232
+ };
233
+ }
234
+ else {
235
+ return null;
236
+ }
237
+ };
201
238
  }
202
239
 
203
- /**
204
- * A basic filter function that filters the search string against the label of the options object
205
- * @param options the array of options to filter
206
- * @param searchString the string from the input
207
- */
208
- function filterOptionsByLabel(options, searchString) {
209
- return options.filter(option => {
210
- return option.label && option.label.toLowerCase().includes(searchString.toLowerCase());
211
- });
240
+ const AbstractAutocompleteFieldMixin = crisprControlMixin(CrisprFieldComponent);
241
+ // eslint-disable-next-line @angular-eslint/directive-class-suffix
242
+ class AbstractAutocompleteComponent extends AbstractAutocompleteFieldMixin {
243
+ constructor() {
244
+ super(...arguments);
245
+ // we need a separate control for the UI because of the way the material autocomplete chiplist works
246
+ this.autocompleteInputControl = new FormControl('');
247
+ }
248
+ ngOnInit() {
249
+ super.ngOnInit();
250
+ this.group.addControl(this.config.controlName, new FormControl());
251
+ // filter options by the search string using either the default filter function or one passed in through config
252
+ this.options$ = this.autocompleteInputControl.valueChanges.pipe(
253
+ // this is needed to have the options panel to open on focus
254
+ startWith(''), debounceTime(this.config.typeDebounceTime), map((searchText) => typeof searchText === 'string' ? searchText?.trim() : ''), distinctUntilChanged(), switchMap((searchText) => observablifyOptions(this.config.options, this.group, searchText)), shareReplay(1));
255
+ }
256
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AbstractAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
257
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: AbstractAutocompleteComponent, usesInheritance: true, ngImport: i0 }); }
212
258
  }
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AbstractAutocompleteComponent, decorators: [{
260
+ type: Directive
261
+ }] });
213
262
 
214
- function convertBytesToMb(bytes) {
215
- return bytes / 1048576;
216
- }
217
- function maxFileSizeValidator(maxFileSize) {
218
- return (control) => {
219
- const controlValue = control.value;
220
- if (!(controlValue instanceof File)) {
221
- return null;
222
- }
223
- const actualFileSize = +convertBytesToMb(controlValue.size).toPrecision(3);
224
- if (maxFileSize > actualFileSize)
225
- return null;
226
- return { maxFileSize: { maxFileSize, actualFileSize } };
227
- };
228
- }
229
- function allowedFileExtValidator(allowedFileExtensions, onlyAllowFiles = true) {
230
- return (control) => {
231
- const controlValue = control.value;
232
- const isFile = controlValue instanceof File;
233
- if (!onlyAllowFiles && !isFile)
234
- return null;
235
- const actualExtension = isFile ? controlValue.name.split('.').pop().toLocaleLowerCase() : 'Not a file';
236
- const isAllowedExtension = allowedFileExtensions.includes(actualExtension);
237
- if (isAllowedExtension) {
238
- return null;
239
- }
240
- return { allowedExtension: { allowedFileExtensions, actualExtension } };
241
- };
242
- }
243
- function allowedFileType(matchExp) {
244
- return (formControl) => {
245
- const value = formControl.value;
246
- if (!(value instanceof File))
247
- return null;
248
- const type = value.type;
249
- const matches = type.match(matchExp);
250
- if (!type || !matches?.length) {
251
- return {
252
- allowedFileType: {
253
- actualType: type,
254
- allowedTypeExp: matchExp
255
- }
256
- };
257
- }
258
- else {
259
- return null;
260
- }
261
- };
263
+ const CrisprDisplayFieldMixin = crisprControlMixin(CrisprFieldComponent);
264
+ // eslint-disable-next-line @angular-eslint/directive-class-suffix
265
+ class CrisprDisplayFieldComponent extends CrisprDisplayFieldMixin {
266
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprDisplayFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
267
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: CrisprDisplayFieldComponent, usesInheritance: true, ngImport: i0 }); }
262
268
  }
269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprDisplayFieldComponent, decorators: [{
270
+ type: Directive
271
+ }] });
263
272
 
264
- /**
265
- * Generated bundle index. Do not edit.
273
+ /**
274
+ * Generated bundle index. Do not edit.
266
275
  */
267
276
 
268
- export { AbstractAutocompleteComponent, ControlType, CrisprFieldComponent, DEFAULT_EMPTY_OPTIONS_MESSAGE, allowedFileExtValidator, allowedFileType, buildFormGroupFromConfig, callOptionsIfFunction, convertBytesToMb, createControlForType, crisprControlMixin, filterOptionsByLabel, isControlConfig, maxFileSizeValidator, observablifyOptions, valueIn };
269
- //# sourceMappingURL=tft-crispr-forms-utils.mjs.map
277
+ export { AbstractAutocompleteComponent, ControlType, CrisprDisplayFieldComponent, CrisprFieldComponent, DEFAULT_EMPTY_OPTIONS_MESSAGE, allowedFileExtValidator, allowedFileType, buildFormGroupFromConfig, callOptionsIfFunction, convertBytesToMb, createControlForType, crisprControlMixin, filterOptionsByLabel, isControlConfig, maxFileSizeValidator, observablifyOptions, valueIn };
278
+ //# sourceMappingURL=tft-crispr-forms-src-lib-utils.mjs.map