@tft/crispr-forms 14.0.1-rc.1 → 14.0.1-rc.2

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 (291) hide show
  1. package/esm2020/public-api.mjs +5 -0
  2. package/esm2020/src/index.mjs +2 -0
  3. package/esm2020/src/lib/crispr-forms.module.mjs +57 -0
  4. package/esm2020/src/lib/field-component-map.const.mjs +27 -0
  5. package/esm2020/src/lib/field.directive.mjs +69 -0
  6. package/esm2020/{lib → src/lib}/form/form.component.mjs +3 -2
  7. package/esm2020/src/lib/form-group-list/form-group-list.component.mjs +93 -0
  8. package/esm2020/src/lib/form-group-list/index.mjs +2 -0
  9. package/esm2020/{lib → src/lib}/pipes/crispr-pipes.module.mjs +1 -1
  10. package/esm2020/src/lib/pipes/initial-control-value.pipe.mjs +21 -0
  11. package/esm2020/src/lib/public_api.mjs +3 -0
  12. package/esm2020/src/lib/sub-group/index.mjs +3 -0
  13. package/esm2020/src/lib/sub-group/sub-group.component.mjs +21 -0
  14. package/esm2020/src/lib/sub-group/sub-group.module.mjs +42 -0
  15. package/esm2020/tft-crispr-forms.mjs +2 -2
  16. package/esm2020/{lib/material → ui}/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +5 -5
  17. package/esm2020/ui/autocomplete-chiplist-field/index.mjs +2 -0
  18. package/esm2020/{lib/material → ui}/autocomplete-field/autocomplete-field.component.mjs +5 -5
  19. package/esm2020/ui/autocomplete-field/index.mjs +2 -0
  20. package/esm2020/ui/button/button.component.mjs +46 -0
  21. package/esm2020/ui/button/index.mjs +2 -0
  22. package/esm2020/ui/checkbox-field/checkbox-field.component.mjs +42 -0
  23. package/esm2020/ui/checkbox-field/index.mjs +2 -0
  24. package/esm2020/{lib/material → ui}/datepicker-field/datepicker-field.component.mjs +4 -3
  25. package/esm2020/ui/datepicker-field/index.mjs +2 -0
  26. package/esm2020/ui/divider/divider.component.mjs +28 -0
  27. package/esm2020/ui/divider/index.mjs +2 -0
  28. package/esm2020/ui/field-container/field-container.component.mjs +58 -0
  29. package/esm2020/ui/field-container/public-api.mjs +2 -0
  30. package/esm2020/ui/field-container/tft-crispr-forms-ui-field-container.mjs +5 -0
  31. package/esm2020/ui/file-dropzone/file-dropzone.directive.mjs +40 -0
  32. package/esm2020/ui/file-dropzone/public-api.mjs +2 -0
  33. package/esm2020/ui/file-dropzone/tft-crispr-forms-ui-file-dropzone.mjs +5 -0
  34. package/esm2020/{lib/material → ui}/file-upload/file-upload.component.mjs +7 -6
  35. package/esm2020/ui/file-upload/index.mjs +2 -0
  36. package/esm2020/{lib/material → ui}/heading/heading.component.mjs +4 -3
  37. package/esm2020/ui/heading/public-api.mjs +2 -0
  38. package/esm2020/ui/heading/tft-crispr-forms-ui-heading.mjs +5 -0
  39. package/esm2020/{lib/material → ui}/image-upload-field/image-upload-field.component.mjs +7 -53
  40. package/esm2020/ui/image-upload-field/public-api.mjs +2 -0
  41. package/esm2020/ui/image-upload-field/tft-crispr-forms-ui-image-upload-field.mjs +5 -0
  42. package/esm2020/{lib/material → ui}/info/info.component.mjs +1 -1
  43. package/esm2020/ui/info/public-api.mjs +2 -0
  44. package/esm2020/ui/info/tft-crispr-forms-ui-info.mjs +5 -0
  45. package/esm2020/ui/input-field/index.mjs +2 -0
  46. package/esm2020/{lib/material → ui}/input-field/input-field.component.mjs +5 -4
  47. package/esm2020/ui/option/index.mjs +2 -0
  48. package/esm2020/{lib/material → ui}/option/option.component.mjs +2 -2
  49. package/esm2020/ui/public-api.mjs +21 -0
  50. package/esm2020/ui/radio-field/index.mjs +2 -0
  51. package/esm2020/ui/radio-field/radio-field.component.mjs +36 -0
  52. package/esm2020/ui/select-field/index.mjs +2 -0
  53. package/esm2020/{lib/material → ui}/select-field/select-field.component.mjs +10 -8
  54. package/esm2020/ui/selected-file/public-api.mjs +2 -0
  55. package/esm2020/{lib/material → ui}/selected-file/selected-file.component.mjs +1 -1
  56. package/esm2020/ui/selected-file/tft-crispr-forms-ui-selected-file.mjs +5 -0
  57. package/esm2020/ui/slider-field/index.mjs +2 -0
  58. package/esm2020/{lib/material → ui}/slider-field/slider-field.component.mjs +5 -4
  59. package/esm2020/ui/textarea-field/index.mjs +2 -0
  60. package/esm2020/{lib/material → ui}/textarea-field/textarea-field.component.mjs +5 -4
  61. package/esm2020/ui/tft-crispr-forms-ui.mjs +5 -0
  62. package/esm2020/ui/unit-conversion-field/index.mjs +2 -0
  63. package/esm2020/ui/unit-conversion-field/unit-conversion-field.component.mjs +81 -0
  64. package/esm2020/utils/abstracts/autocomplete-field.abstract.mjs +30 -0
  65. package/esm2020/utils/abstracts/crispr-control.mixin.mjs +27 -0
  66. package/esm2020/utils/abstracts/crispr-field.abstract.mjs +20 -0
  67. package/esm2020/utils/abstracts/index.mjs +4 -0
  68. package/esm2020/utils/functions/buildFormGroupFromConfig.mjs +28 -0
  69. package/esm2020/utils/functions/callOptionsIfFunction.mjs +4 -0
  70. package/esm2020/utils/functions/createControlForType.mjs +19 -0
  71. package/esm2020/utils/functions/filterOptionsByLabel.mjs +11 -0
  72. package/esm2020/utils/functions/image-compression.helpers.mjs +50 -0
  73. package/esm2020/utils/functions/index.mjs +8 -0
  74. package/esm2020/utils/functions/isControlConfig.mjs +7 -0
  75. package/esm2020/utils/functions/observablifyOptions.mjs +29 -0
  76. package/esm2020/utils/models/autocomplete-chiplist-field.config.mjs +2 -0
  77. package/esm2020/utils/models/autocomplete-field.config.mjs +2 -0
  78. package/esm2020/utils/models/button.config.mjs +2 -0
  79. package/esm2020/utils/models/checkbox-field.config.mjs +2 -0
  80. package/esm2020/utils/models/crispr-field.config.mjs +23 -0
  81. package/esm2020/utils/models/datepicker-field.config.mjs +2 -0
  82. package/esm2020/utils/models/divider.config.mjs +2 -0
  83. package/esm2020/utils/models/file-upload-field.config.mjs +2 -0
  84. package/esm2020/utils/models/form-group-list.config.mjs +2 -0
  85. package/esm2020/utils/models/heading.config.mjs +3 -0
  86. package/esm2020/utils/models/image-upload-field.config.mjs +2 -0
  87. package/esm2020/utils/models/index.mjs +18 -0
  88. package/esm2020/utils/models/input-field.config.mjs +2 -0
  89. package/esm2020/utils/models/radio-field.config.mjs +2 -0
  90. package/esm2020/utils/models/select-field.config.mjs +2 -0
  91. package/esm2020/utils/models/slider-field.config.mjs +2 -0
  92. package/esm2020/utils/models/textarea-field.config.mjs +2 -0
  93. package/esm2020/utils/models/unit-conversion-field.config.mjs +2 -0
  94. package/esm2020/utils/operators/form.operators.mjs +24 -0
  95. package/esm2020/utils/operators/index.mjs +2 -0
  96. package/esm2020/utils/public-api.mjs +5 -0
  97. package/esm2020/utils/tft-crispr-forms-utils.mjs +5 -0
  98. package/fesm2015/tft-crispr-forms-ui-field-container.mjs +64 -0
  99. package/fesm2015/tft-crispr-forms-ui-field-container.mjs.map +1 -0
  100. package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs +47 -0
  101. package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs.map +1 -0
  102. package/fesm2015/tft-crispr-forms-ui-heading.mjs +37 -0
  103. package/fesm2015/tft-crispr-forms-ui-heading.mjs.map +1 -0
  104. package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs +182 -0
  105. package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs.map +1 -0
  106. package/fesm2015/tft-crispr-forms-ui-info.mjs +30 -0
  107. package/fesm2015/tft-crispr-forms-ui-info.mjs.map +1 -0
  108. package/fesm2015/tft-crispr-forms-ui-selected-file.mjs +33 -0
  109. package/fesm2015/tft-crispr-forms-ui-selected-file.mjs.map +1 -0
  110. package/fesm2015/tft-crispr-forms-ui.mjs +684 -0
  111. package/fesm2015/tft-crispr-forms-ui.mjs.map +1 -0
  112. package/fesm2015/tft-crispr-forms-utils.mjs +270 -0
  113. package/fesm2015/tft-crispr-forms-utils.mjs.map +1 -0
  114. package/fesm2015/tft-crispr-forms.mjs +32 -1355
  115. package/fesm2015/tft-crispr-forms.mjs.map +1 -1
  116. package/fesm2020/tft-crispr-forms-ui-field-container.mjs +65 -0
  117. package/fesm2020/tft-crispr-forms-ui-field-container.mjs.map +1 -0
  118. package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs +47 -0
  119. package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs.map +1 -0
  120. package/fesm2020/tft-crispr-forms-ui-heading.mjs +37 -0
  121. package/fesm2020/tft-crispr-forms-ui-heading.mjs.map +1 -0
  122. package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs +185 -0
  123. package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs.map +1 -0
  124. package/fesm2020/tft-crispr-forms-ui-info.mjs +30 -0
  125. package/fesm2020/tft-crispr-forms-ui-info.mjs.map +1 -0
  126. package/fesm2020/tft-crispr-forms-ui-selected-file.mjs +33 -0
  127. package/fesm2020/tft-crispr-forms-ui-selected-file.mjs.map +1 -0
  128. package/fesm2020/tft-crispr-forms-ui.mjs +676 -0
  129. package/fesm2020/tft-crispr-forms-ui.mjs.map +1 -0
  130. package/fesm2020/tft-crispr-forms-utils.mjs +269 -0
  131. package/fesm2020/tft-crispr-forms-utils.mjs.map +1 -0
  132. package/fesm2020/tft-crispr-forms.mjs +33 -1349
  133. package/fesm2020/tft-crispr-forms.mjs.map +1 -1
  134. package/index.d.ts +5 -1
  135. package/package.json +67 -3
  136. package/public-api.d.ts +3 -0
  137. package/src/index.d.ts +1 -0
  138. package/{lib → src/lib}/crispr-forms.module.d.ts +1 -1
  139. package/{lib → src/lib}/field-component-map.const.d.ts +7 -6
  140. package/{lib → src/lib}/field.directive.d.ts +3 -3
  141. package/{lib → src/lib}/form/form.component.d.ts +1 -1
  142. package/{lib → src/lib}/form-group-list/form-group-list.component.d.ts +11 -13
  143. package/{lib → src/lib}/form-group-list/index.d.ts +0 -0
  144. package/{lib → src/lib}/pipes/crispr-pipes.module.d.ts +0 -0
  145. package/{lib → src/lib}/pipes/initial-control-value.pipe.d.ts +1 -1
  146. package/src/lib/public_api.d.ts +2 -0
  147. package/{lib → src/lib}/sub-group/index.d.ts +0 -0
  148. package/{lib → src/lib}/sub-group/sub-group.component.d.ts +11 -13
  149. package/{lib → src/lib}/sub-group/sub-group.module.d.ts +1 -1
  150. package/tft-crispr-forms-14.0.1-rc.2.tgz +0 -0
  151. package/ui/README.md +3 -0
  152. package/{lib/material → ui}/autocomplete-chiplist-field/autocomplete-chiplist-field.component.d.ts +1 -2
  153. package/ui/autocomplete-chiplist-field/index.d.ts +1 -0
  154. package/{lib/material → ui}/autocomplete-field/autocomplete-field.component.d.ts +1 -2
  155. package/ui/autocomplete-field/index.d.ts +1 -0
  156. package/{lib/material → ui}/button/button.component.d.ts +1 -2
  157. package/ui/button/index.d.ts +1 -0
  158. package/ui/checkbox-field/checkbox-field.component.d.ts +21 -0
  159. package/ui/checkbox-field/index.d.ts +1 -0
  160. package/{lib/material → ui}/datepicker-field/datepicker-field.component.d.ts +11 -13
  161. package/ui/datepicker-field/index.d.ts +1 -0
  162. package/{lib/material → ui}/divider/divider.component.d.ts +1 -2
  163. package/ui/divider/index.d.ts +1 -0
  164. package/{lib → ui}/field-container/field-container.component.d.ts +1 -1
  165. package/ui/field-container/index.d.ts +5 -0
  166. package/{lib/field-container/index.d.ts → ui/field-container/public-api.d.ts} +0 -0
  167. package/{lib/material/file-upload → ui/file-dropzone}/file-dropzone.directive.d.ts +0 -0
  168. package/ui/file-dropzone/index.d.ts +5 -0
  169. package/{lib/material/file-upload/index.d.ts → ui/file-dropzone/public-api.d.ts} +0 -1
  170. package/{lib/material → ui}/file-upload/file-upload.component.d.ts +11 -13
  171. package/ui/file-upload/index.d.ts +1 -0
  172. package/{lib/material → ui}/heading/heading.component.d.ts +1 -2
  173. package/ui/heading/index.d.ts +5 -0
  174. package/ui/heading/public-api.d.ts +1 -0
  175. package/{lib/material → ui}/image-upload-field/image-upload-field.component.d.ts +12 -17
  176. package/ui/image-upload-field/index.d.ts +5 -0
  177. package/{lib/material/image-upload-field/index.d.ts → ui/image-upload-field/public-api.d.ts} +0 -0
  178. package/ui/index.d.ts +5 -0
  179. package/ui/info/index.d.ts +5 -0
  180. package/{lib/material → ui}/info/info.component.d.ts +1 -1
  181. package/ui/info/public-api.d.ts +1 -0
  182. package/ui/input-field/index.d.ts +1 -0
  183. package/ui/input-field/input-field.component.d.ts +22 -0
  184. package/{lib/material → ui}/option/index.d.ts +0 -0
  185. package/{lib/material → ui}/option/option.component.d.ts +1 -1
  186. package/ui/public-api.d.ts +19 -0
  187. package/ui/radio-field/index.d.ts +1 -0
  188. package/ui/radio-field/radio-field.component.d.ts +23 -0
  189. package/ui/select-field/index.d.ts +1 -0
  190. package/{lib/material → ui}/select-field/select-field.component.d.ts +11 -13
  191. package/ui/selected-file/index.d.ts +5 -0
  192. package/ui/selected-file/public-api.d.ts +1 -0
  193. package/{lib/material → ui}/selected-file/selected-file.component.d.ts +0 -0
  194. package/ui/slider-field/index.d.ts +1 -0
  195. package/{lib/material → ui}/slider-field/slider-field.component.d.ts +11 -13
  196. package/ui/textarea-field/index.d.ts +1 -0
  197. package/ui/textarea-field/textarea-field.component.d.ts +21 -0
  198. package/ui/unit-conversion-field/index.d.ts +1 -0
  199. package/{lib/material → ui}/unit-conversion-field/unit-conversion-field.component.d.ts +11 -14
  200. package/utils/README.md +3 -0
  201. package/{lib → utils}/abstracts/autocomplete-field.abstract.d.ts +0 -0
  202. package/{lib → utils}/abstracts/crispr-control.mixin.d.ts +0 -0
  203. package/{lib → utils}/abstracts/crispr-field.abstract.d.ts +0 -0
  204. package/{lib → utils}/abstracts/index.d.ts +0 -0
  205. package/utils/functions/buildFormGroupFromConfig.d.ts +9 -0
  206. package/utils/functions/callOptionsIfFunction.d.ts +3 -0
  207. package/utils/functions/createControlForType.d.ts +9 -0
  208. package/utils/functions/filterOptionsByLabel.d.ts +7 -0
  209. package/utils/functions/image-compression.helpers.d.ts +5 -0
  210. package/utils/functions/index.d.ts +7 -0
  211. package/utils/functions/isControlConfig.d.ts +5 -0
  212. package/utils/functions/observablifyOptions.d.ts +12 -0
  213. package/utils/index.d.ts +5 -0
  214. package/{lib → utils}/models/autocomplete-chiplist-field.config.d.ts +2 -1
  215. package/{lib → utils}/models/autocomplete-field.config.d.ts +1 -2
  216. package/{lib → utils}/models/button.config.d.ts +0 -0
  217. package/{lib → utils}/models/checkbox-field.config.d.ts +1 -2
  218. package/{lib → utils}/models/crispr-field.config.d.ts +1 -10
  219. package/{lib → utils}/models/datepicker-field.config.d.ts +1 -2
  220. package/{lib → utils}/models/divider.config.d.ts +1 -1
  221. package/{lib → utils}/models/file-upload-field.config.d.ts +3 -4
  222. package/{lib → utils}/models/form-group-list.config.d.ts +1 -2
  223. package/{lib → utils}/models/heading.config.d.ts +1 -2
  224. package/{lib → utils}/models/image-upload-field.config.d.ts +2 -1
  225. package/{lib → utils}/models/index.d.ts +0 -0
  226. package/{lib → utils}/models/input-field.config.d.ts +1 -2
  227. package/{lib → utils}/models/radio-field.config.d.ts +0 -0
  228. package/{lib → utils}/models/select-field.config.d.ts +1 -2
  229. package/{lib → utils}/models/slider-field.config.d.ts +1 -2
  230. package/{lib → utils}/models/textarea-field.config.d.ts +1 -2
  231. package/{lib → utils}/models/unit-conversion-field.config.d.ts +1 -2
  232. package/{lib → utils/operators}/form.operators.d.ts +0 -0
  233. package/utils/operators/index.d.ts +1 -0
  234. package/utils/public-api.d.ts +4 -0
  235. package/esm2020/index.mjs +0 -2
  236. package/esm2020/lib/abstracts/autocomplete-field.abstract.mjs +0 -30
  237. package/esm2020/lib/abstracts/crispr-control.mixin.mjs +0 -27
  238. package/esm2020/lib/abstracts/crispr-field.abstract.mjs +0 -20
  239. package/esm2020/lib/abstracts/index.mjs +0 -4
  240. package/esm2020/lib/crispr-forms.module.mjs +0 -57
  241. package/esm2020/lib/field-component-map.const.mjs +0 -28
  242. package/esm2020/lib/field-container/field-container.component.mjs +0 -63
  243. package/esm2020/lib/field-container/index.mjs +0 -2
  244. package/esm2020/lib/field.directive.mjs +0 -69
  245. package/esm2020/lib/form-group-list/form-group-list.component.mjs +0 -92
  246. package/esm2020/lib/form-group-list/index.mjs +0 -2
  247. package/esm2020/lib/form.helpers.mjs +0 -190
  248. package/esm2020/lib/form.operators.mjs +0 -24
  249. package/esm2020/lib/material/button/button.component.mjs +0 -45
  250. package/esm2020/lib/material/checkbox-field/checkbox-field.component.mjs +0 -40
  251. package/esm2020/lib/material/divider/divider.component.mjs +0 -27
  252. package/esm2020/lib/material/file-upload/file-dropzone.directive.mjs +0 -40
  253. package/esm2020/lib/material/file-upload/index.mjs +0 -3
  254. package/esm2020/lib/material/image-upload-field/image-compression.helpers.mjs +0 -4
  255. package/esm2020/lib/material/image-upload-field/index.mjs +0 -2
  256. package/esm2020/lib/material/index.mjs +0 -17
  257. package/esm2020/lib/material/option/index.mjs +0 -2
  258. package/esm2020/lib/material/radio-field/radio-field.component.mjs +0 -36
  259. package/esm2020/lib/material/unit-conversion-field/unit-conversion-field.component.mjs +0 -81
  260. package/esm2020/lib/models/autocomplete-chiplist-field.config.mjs +0 -2
  261. package/esm2020/lib/models/autocomplete-field.config.mjs +0 -2
  262. package/esm2020/lib/models/button.config.mjs +0 -2
  263. package/esm2020/lib/models/checkbox-field.config.mjs +0 -2
  264. package/esm2020/lib/models/crispr-field.config.mjs +0 -23
  265. package/esm2020/lib/models/datepicker-field.config.mjs +0 -2
  266. package/esm2020/lib/models/divider.config.mjs +0 -2
  267. package/esm2020/lib/models/file-upload-field.config.mjs +0 -2
  268. package/esm2020/lib/models/form-group-list.config.mjs +0 -2
  269. package/esm2020/lib/models/heading.config.mjs +0 -3
  270. package/esm2020/lib/models/image-upload-field.config.mjs +0 -2
  271. package/esm2020/lib/models/index.mjs +0 -18
  272. package/esm2020/lib/models/input-field.config.mjs +0 -2
  273. package/esm2020/lib/models/radio-field.config.mjs +0 -2
  274. package/esm2020/lib/models/select-field.config.mjs +0 -2
  275. package/esm2020/lib/models/slider-field.config.mjs +0 -2
  276. package/esm2020/lib/models/textarea-field.config.mjs +0 -2
  277. package/esm2020/lib/models/unit-conversion-field.config.mjs +0 -2
  278. package/esm2020/lib/pipes/initial-control-value.pipe.mjs +0 -20
  279. package/esm2020/lib/public_api.mjs +0 -10
  280. package/esm2020/lib/sub-group/index.mjs +0 -3
  281. package/esm2020/lib/sub-group/sub-group.component.mjs +0 -20
  282. package/esm2020/lib/sub-group/sub-group.module.mjs +0 -42
  283. package/lib/form.helpers.d.ts +0 -88
  284. package/lib/material/checkbox-field/checkbox-field.component.d.ts +0 -23
  285. package/lib/material/image-upload-field/image-compression.helpers.d.ts +0 -1
  286. package/lib/material/index.d.ts +0 -16
  287. package/lib/material/input-field/input-field.component.d.ts +0 -24
  288. package/lib/material/radio-field/radio-field.component.d.ts +0 -26
  289. package/lib/material/textarea-field/textarea-field.component.d.ts +0 -23
  290. package/lib/public_api.d.ts +0 -9
  291. package/tft-crispr-forms-14.0.1-rc.1.tgz +0 -0
@@ -1,487 +1,40 @@
1
- import { of, combineLatest, from, isObservable, BehaviorSubject, Subject } from 'rxjs';
2
- import * as i2 from '@angular/forms';
3
- import { FormGroup, FormArray, FormControl, ReactiveFormsModule } from '@angular/forms';
4
- import { map, startWith, debounceTime, distinctUntilChanged, switchMap, shareReplay, tap } from 'rxjs/operators';
5
1
  import * as i0 from '@angular/core';
6
- import { Directive, Component, ChangeDetectionStrategy, Input, ViewChild, EventEmitter, Output, HostListener, Optional, Self, Pipe, NgModule } from '@angular/core';
7
- import * as i4 from '@angular/material/input';
8
- import { MatInputModule } from '@angular/material/input';
2
+ import { Directive, Input, Pipe, NgModule, EventEmitter, Component, Output, ViewChild, ChangeDetectionStrategy } from '@angular/core';
9
3
  import * as i1 from '@angular/common';
10
4
  import { CommonModule } from '@angular/common';
11
- import * as i3$2 from '@angular/material/form-field';
12
- import { MatFormFieldModule } from '@angular/material/form-field';
13
- import * as i3 from '@angular/material/icon';
14
- import { MatIconModule } from '@angular/material/icon';
15
- import * as i3$1 from '@angular/material/tooltip';
16
- import { MatTooltipModule } from '@angular/material/tooltip';
17
- import * as i4$1 from '@angular/material/select';
18
- import { MatSelectModule } from '@angular/material/select';
19
- import * as i2$1 from '@angular/material/checkbox';
20
- import { MatCheckboxModule } from '@angular/material/checkbox';
5
+ import * as i2 from '@angular/forms';
6
+ import { FormGroup, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i3$1 from '@tft/form-validation-handler';
8
+ import { FormValidationHandlerModule } from '@tft/form-validation-handler';
21
9
  import { __awaiter } from 'tslib';
22
- import * as i4$2 from '@angular/material/core';
23
- import { MatOptionModule } from '@angular/material/core';
24
- import * as i3$3 from '@angular/material/autocomplete';
25
- import { MatAutocompleteTrigger, MatAutocompleteModule } from '@angular/material/autocomplete';
26
- import { ENTER } from '@angular/cdk/keycodes';
27
- import * as i7 from '@angular/material/chips';
28
- import { MatChipsModule } from '@angular/material/chips';
29
- import * as i3$4 from '@angular/material/slider';
30
- import { MatSliderModule } from '@angular/material/slider';
31
- import * as i2$2 from '@angular/material/button';
10
+ import { isControlConfig, ControlType, buildFormGroupFromConfig, crisprControlMixin, CrisprFieldComponent, createControlForType } from '@tft/crispr-forms/utils';
11
+ export * from '@tft/crispr-forms/utils';
12
+ import * as i2$1 from '@angular/material/button';
32
13
  import { MatButtonModule } from '@angular/material/button';
33
- import * as i2$3 from '@angular/material/datepicker';
34
- import { MatDatepickerModule } from '@angular/material/datepicker';
35
- import { MatDateFnsModule } from '@angular/material-date-fns-adapter';
36
- import * as i6 from '@angular/cdk/portal';
37
- import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
38
- import * as i2$4 from '@angular/material/divider';
39
- import { MatDividerModule } from '@angular/material/divider';
40
- import * as i3$5 from '@angular/material/radio';
41
- import { MatRadioModule } from '@angular/material/radio';
42
- import imageCompression from 'browser-image-compression';
43
- import * as i7$1 from '@tft/form-validation-handler';
44
- import { FormValidationHandlerModule } from '@tft/form-validation-handler';
45
- import * as i2$5 from '@angular/material/progress-bar';
46
- import { MatProgressBarModule } from '@angular/material/progress-bar';
47
- import * as i2$6 from '@angular/platform-browser';
48
-
49
- const DEFAULT_EMPTY_OPTIONS_MESSAGE = 'No Items';
50
-
51
- // export type ControlType = keyof typeof FIELD_COMPONENTS;
52
- var ControlType;
53
- (function (ControlType) {
54
- ControlType["AUTOCOMPLETE"] = "autocomplete";
55
- ControlType["AUTOCOMPLETE_CHIPLIST"] = "autocompleteChiplist";
56
- ControlType["BUTTON"] = "button";
57
- ControlType["CHECKBOX"] = "checkbox";
58
- ControlType["CUSTOM"] = "custom";
59
- ControlType["DATEPICKER"] = "datepicker";
60
- ControlType["DIVIDER"] = "divider";
61
- ControlType["FILE_UPLOAD"] = "fileUpload";
62
- ControlType["HEADING"] = "heading";
63
- ControlType["INPUT"] = "input";
64
- ControlType["IMAGE_UPLOAD"] = "imageUpload";
65
- ControlType["GROUP_LIST"] = "groupList";
66
- ControlType["RADIO"] = "radio";
67
- ControlType["SELECT"] = "select";
68
- ControlType["SLIDER"] = "slider";
69
- ControlType["SUB_GROUP"] = "subGroup";
70
- ControlType["TEXTAREA"] = "textarea";
71
- ControlType["UNIT_CONVERSION"] = "unitConversion";
72
- })(ControlType || (ControlType = {}));
73
-
74
- ;
75
-
76
- function valueIn(values) {
77
- return map((value) => {
78
- if (value) {
79
- return values.some(v => {
80
- if (isRegex(v)) {
81
- const trimmedStringForRegex = v.substr(1, v.length - 2);
82
- const regex = new RegExp(trimmedStringForRegex);
83
- return regex.test(value);
84
- }
85
- else {
86
- return v === value;
87
- }
88
- });
89
- }
90
- else {
91
- return false;
92
- }
93
- });
94
- }
95
- function isRegex(string) {
96
- return string.startsWith('/') && string.endsWith('/');
97
- }
98
-
99
- /**
100
- * Watches a single control for a list of values, returns true when field value matches any value in list
101
- * unless an evaluate method is found on config, in which case that method is run on the returned boolean value
102
- * @param group the direct parent of the field we want to watch
103
- * @param config
104
- */
105
- function checkControlForValues(group, config) {
106
- // check that all the pieces we need are available
107
- if (config && config.controlName && Array.isArray(config.values)) {
108
- return getValueChanges(group, config.controlName).pipe(
109
- // return a boolean, true if value is in the values being watch for, otherwise false
110
- valueIn(config.values), map((isValueInValues) => {
111
- // since we can only check if the value is in the list of watched values, the evaluate function gives us
112
- // a chance to make other decisions based on if the boolean returned, e.g. return true if value not in watched values
113
- if (config.evaluate && config.evaluate instanceof Function) {
114
- return config.evaluate(isValueInValues);
115
- }
116
- else {
117
- return isValueInValues;
118
- }
119
- }));
120
- }
121
- else {
122
- //
123
- return of(true);
124
- }
125
- }
126
- /**
127
- * Watches a list of fields for individual lists of values returning true when any field contains one
128
- * of the values being watched for, or optionally running a function on the array of resolved booleans
129
- * from the listed fields and returning a boolean
130
- * @param group the form group that has the fields to watch as direct descendants
131
- * @param config the configuration to use when calling the function
132
- */
133
- function checkControlsForValues(group, config) {
134
- // if no config is passed we just want to show the field, so we return an observable of true
135
- if (!config || !config.watchConfigs) {
136
- return of(true);
137
- }
138
- // we run checkControlForValues on every control in the list of WatchConfigs creating
139
- // an array of Observable watching fields for values
140
- const fieldTriggers = config.watchConfigs.map(watchConfig => {
141
- // resolves a boolean, true when field value matches a watched value, otherwise false
142
- return checkControlForValues(group, watchConfig);
143
- });
144
- return combineLatest(fieldTriggers).pipe(startWith([true]), map((booleans) => {
145
- // if the user passed an evaluate function use it
146
- if (config.evaluate && config.evaluate instanceof Function) {
147
- return config.evaluate(booleans);
148
- }
149
- else { // otherwise we return true if any of the watched fields resolve to true
150
- return booleans.some(bool => bool);
151
- }
152
- }));
153
- }
154
- /**
155
- * Watches values on an array of fields, computing their values as they change
156
- * @param group the group to get the fields from, for now it can only be the parent of the computed field
157
- * @param computeFieldsConfig the configuration that drives the computation, holds the names to watch and the
158
- * computation function that get called against the array of values
159
- */
160
- function computeValueFromFields(group, computeFieldsConfig) {
161
- // TODO: better checking
162
- const { controlNamesToWatch } = computeFieldsConfig;
163
- //creates an observable listener for each control in the controlNamesToWatch array
164
- return combineLatest(controlNamesToWatch.map(controlNameToWatch => getValueChanges(group, controlNameToWatch))).pipe(
165
- // each time a watched field values changes a new array of the latest field values is pipe through to the
166
- // compute callback. Which runs the users logic on the values to compute this fields value
167
- map(valuesArray => computeFieldsConfig.computeCallback(valuesArray)));
168
- }
169
- /**
170
- * A simple wrapper for doing error checking around getting the valueChanges observable from a control on a form group
171
- * @param group the form group we want to pull the observable from
172
- * @param controlName the name of the control who's value we want to subscribe to
173
- */
174
- function getValueChanges(group, controlName) {
175
- const control = group.get(controlName);
176
- if (!control) {
177
- throw new Error(`No control with controlName ${controlName}`);
178
- }
179
- return control.valueChanges;
180
- }
181
- /**
182
- * TODO: move to utils library after library is built
183
- * Allows developer to pass an array of operators into the pipe of an Observable.
184
- * Useful for creating function with a variable amount of operators to be run
185
- * @param observable the observable to pass the operators to
186
- * @param operators array of operators to pipe
187
- */
188
- function pipeOperatorsIntoObservable(observable, operators) {
189
- try {
190
- return operators.reduce((obs, op) => {
191
- return obs.pipe(op);
192
- }, observable);
193
- }
194
- catch (_a) {
195
- console.error('Unable to pipe operators into observable');
196
- return of(null);
197
- }
198
- }
199
- function callOptionsIfFunction(options, parentGroup, searchString) {
200
- return options instanceof Function ? options(parentGroup, searchString) : options;
201
- }
202
- /**
203
- * The user can give us select options as an array, a function that resolves to a promise,
204
- * or an observable. This functions consumes any of those and returns an observable that
205
- * resolves an array of options
206
- *
207
- * @param options the options passed in from the config
208
- * @param emptyMessageOption the message to display when the array is empty
209
- */
210
- function observablifyOptions(options, parentGroup, searchString) {
211
- const calledOptions = callOptionsIfFunction(options, parentGroup, searchString);
212
- // if options are a promise
213
- const observableOptions = calledOptions instanceof Promise
214
- // convert to observable
215
- ? from(calledOptions)
216
- // if array that isn't empty
217
- : Array.isArray(calledOptions) && calledOptions.length
218
- // convert to observable
219
- ? of(calledOptions)
220
- // if observable
221
- : isObservable(calledOptions)
222
- // return it
223
- ? calledOptions
224
- // else an empty array
225
- : of([]);
226
- return observableOptions;
227
- }
228
- /**
229
- * Determines if the field config is for a form control (not a divider, heading or other non-control field)
230
- * */
231
- function isControlConfig(fieldConfig) {
232
- return 'controlName' in fieldConfig;
233
- }
234
- /**
235
- * builds out form group based on config
236
- * @param config a configuration for a form group
237
- * @param value an object of initial values to pass in
238
- * @param group the form group to modify and build out
239
- */
240
- function buildFormGroupFromConfig(config, value = null, group = new FormGroup({})) {
241
- config.fields.forEach((controlConfig) => {
242
- var _a;
243
- if (isControlConfig(controlConfig)) {
244
- // then add a control to the group using the controlName from configuration
245
- const { controlName } = controlConfig;
246
- if (group.get(controlName)) {
247
- group.removeControl(controlName);
248
- }
249
- // if there's a value object and it has a non-null/undefined value for this field use it.
250
- // Otherwise, default to null
251
- const controlValue = (_a = (value && value[controlName])) !== null && _a !== void 0 ? _a : null;
252
- const control = createControlForType(controlConfig, controlValue);
253
- group.addControl(controlName, control);
254
- }
255
- });
256
- group.setValidators(config.validators);
257
- return group;
258
- }
259
- /**
260
- * Analyze the config and build a form control to spec. Notice we don't use FormBuilder here
261
- * as we want to keep this function pure.
262
- * @param controlConfig the configuration object for the control to build
263
- * @param value an initial value to use if passed in
264
- */
265
- function createControlForType(controlConfig, value = null) {
266
- // build form control out based on the control type
267
- const control = controlConfig.controlType === ControlType.SUB_GROUP
268
- ? buildFormGroupFromConfig(controlConfig, value)
269
- : controlConfig.controlType === ControlType.GROUP_LIST
270
- ? new FormArray([], controlConfig.validators)
271
- : new FormControl(value || null, controlConfig.validators);
272
- return control;
273
- }
274
- /**
275
- * A basic filter function that filters the search string against the label of the options object
276
- * @param options the array of options to filter
277
- * @param searchString the string from the input
278
- */
279
- function filterOptionsByLabel(options, searchString) {
280
- return options.filter(option => {
281
- return option.label && option.label.toLowerCase().includes(searchString.toLowerCase());
282
- });
283
- }
284
-
285
- function crisprControlMixin(BaseClass) {
286
- return class extends BaseClass {
287
- set value(value) {
288
- this.setControlValue(value);
289
- this._value = value;
290
- }
291
- get value() {
292
- return this._value;
293
- }
294
- ngOnInit() {
295
- super.ngOnInit();
296
- this.control = this.group.get(this.config.controlName);
297
- this.setControlValue(this.value);
298
- // setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values
299
- setTimeout(() => {
300
- this.control.updateValueAndValidity();
301
- });
302
- }
303
- setControlValue(value) {
304
- if (value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {
305
- this.control.setValue(value);
306
- }
307
- }
308
- };
309
- }
310
-
311
- // eslint-disable-next-line @angular-eslint/directive-class-suffix
312
- class CrisprFieldComponent {
313
- ngOnInit() {
314
- this.applyDefaultConfig();
315
- }
316
- applyDefaultConfig() {
317
- this.config = this.defaultConfig ? Object.assign(Object.assign({}, this.defaultConfig), this.config) : this.config;
318
- }
319
- }
320
- CrisprFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CrisprFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
321
- CrisprFieldComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CrisprFieldComponent, isStandalone: true, ngImport: i0 });
322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CrisprFieldComponent, decorators: [{
323
- type: Directive,
324
- args: [{
325
- standalone: true
326
- }]
327
- }] });
328
-
329
- const AbstractAutocompleteFieldMixin = crisprControlMixin(CrisprFieldComponent);
330
- // eslint-disable-next-line @angular-eslint/directive-class-suffix
331
- class AbstractAutocompleteComponent extends AbstractAutocompleteFieldMixin {
332
- constructor() {
333
- super(...arguments);
334
- // we need a separate control for the UI because of the way the material autocomplete chiplist works
335
- this.autocompleteInputControl = new FormControl('');
336
- }
337
- ngOnInit() {
338
- super.ngOnInit();
339
- this.group.addControl(this.config.controlName, new FormControl());
340
- // filter options by the search string using either the default filter function or one passed in through config
341
- this.options$ = this.autocompleteInputControl.valueChanges.pipe(
342
- // this is needed to have the options panel to open on focus
343
- startWith(''), debounceTime(this.config.typeDebounceTime), map((searchText) => typeof searchText === 'string' ? searchText === null || searchText === void 0 ? void 0 : searchText.trim() : ''), distinctUntilChanged(), switchMap((searchText) => observablifyOptions(this.config.options, this.group, searchText)), shareReplay(1));
344
- }
345
- }
346
- AbstractAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AbstractAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
347
- AbstractAutocompleteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: AbstractAutocompleteComponent, usesInheritance: true, ngImport: i0 });
348
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AbstractAutocompleteComponent, decorators: [{
349
- type: Directive
350
- }] });
351
-
352
- class InfoComponent {
353
- }
354
- InfoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
355
- InfoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: InfoComponent, isStandalone: true, selector: "crispr-info", inputs: { info: "info" }, ngImport: i0, template: "<mat-icon\n *ngIf=\"info\"\n [matTooltip]=\"info.content\"\n [matTooltipPosition]=\"info.tooltipPosition || 'below'\"\n matSuffix>\n {{info.iconName || 'info'}}\n</mat-icon>\n", styles: [":host mat-icon{font-size:1.2em;width:1em;height:1em;opacity:.8;margin-right:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InfoComponent, decorators: [{
357
- type: Component,
358
- args: [{ selector: 'crispr-info', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
359
- CommonModule,
360
- MatIconModule,
361
- MatTooltipModule
362
- ], template: "<mat-icon\n *ngIf=\"info\"\n [matTooltip]=\"info.content\"\n [matTooltipPosition]=\"info.tooltipPosition || 'below'\"\n matSuffix>\n {{info.iconName || 'info'}}\n</mat-icon>\n", styles: [":host mat-icon{font-size:1.2em;width:1em;height:1em;opacity:.8;margin-right:0}\n"] }]
363
- }], propDecorators: { info: [{
364
- type: Input
365
- }] } });
366
-
367
- const defaultConfig$8 = {
368
- typographyClass: 'mat-h3'
369
- };
370
- class HeadingComponent extends CrisprFieldComponent {
371
- constructor() {
372
- super(...arguments);
373
- this.defaultConfig = defaultConfig$8;
374
- }
375
- }
376
- HeadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: HeadingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
377
- HeadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: HeadingComponent, isStandalone: true, selector: "crispr-heading", inputs: { config: "config" }, usesInheritance: true, ngImport: i0, template: " <label\n *ngIf=\"!!config?.label\"\n [ngClass]=\"config.typographyClass\">\n {{ config.label }}\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n </label>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: HeadingComponent, decorators: [{
379
- type: Component,
380
- args: [{ selector: 'crispr-heading', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
381
- CommonModule,
382
- MatFormFieldModule,
383
- InfoComponent
384
- ], template: " <label\n *ngIf=\"!!config?.label\"\n [ngClass]=\"config.typographyClass\">\n {{ config.label }}\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n </label>\n", styles: [":host{display:block}\n"] }]
385
- }], propDecorators: { config: [{
386
- type: Input
387
- }] } });
388
-
389
- class FieldContainerComponent {
390
- constructor() {
391
- // boolean whether field-container is inline
392
- this.inlineField = false;
393
- this.subs = [];
394
- }
395
- ngOnInit() {
396
- this.disabled$ = this.connectDisabledCallback(this.group, this.config);
397
- // we tried moving this into afterViewChecked and afterContentChecked lifecycle hooks without any luck
398
- if (this.config.computeValue) {
399
- this.subs.push(this.config.computeValue(this.group).pipe(distinctUntilChanged(), tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))).subscribe());
400
- }
401
- else if (this.config.computeFieldConfig) {
402
- console.warn(`computeFieldConfig property is deprecated, please use computeValue. Example here: https://stackblitz.com/github/nayfin/tft-documentation?file=src%2Fapp%2Fcrispr-forms-demo%2Ffeatures%2Fcomputed-field%2Fcomputed-field.component.ts`);
403
- this.subs.push(computeValueFromFields(this.group, this.config.computeFieldConfig).pipe(distinctUntilChanged(), tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))).subscribe());
404
- }
405
- }
406
- ngOnDestroy() {
407
- this.subs.forEach(sub => sub.unsubscribe);
408
- }
409
- /**
410
- * Connects user defined disabledCallback function to the the view, so that the control is enabled/disabled
411
- * appropriately. It also will hide disabled fields in the UI unless `hideDisabled` is set to
412
- * false in the controls config
413
- * @param group used to get valueChanges from control
414
- * @param config configuration object used to
415
- */
416
- connectDisabledCallback(group, config = null) {
417
- const control = group.get(config.controlName);
418
- // If the disabled$ function exists on the field config then call it with the disabledCallbackConfig
419
- // as a parameter otherwise return an observable of true.
420
- return (config === null || config === void 0 ? void 0 : config.disabledCallback) && config.disabledCallback instanceof Function
421
- ? config.disabledCallback(group, config.disabledCallbackConfig || null).pipe(
422
- // This enables/disables when callback conditions are met
423
- tap((shouldDisable) => shouldDisable ? control.disable() : control.enable()))
424
- : of(false);
425
- }
426
- }
427
- FieldContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FieldContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
428
- FieldContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: FieldContainerComponent, isStandalone: true, selector: "crispr-field-container", inputs: { config: "config", group: "group", inlineField: "inlineField" }, ngImport: i0, template: "<div\n *ngIf=\"(disabled$ | async) ? !config.hideDisabled : true\"\n [ngClass]=\"config.classes\"\n [class.inline-field]=\"inlineField\"\n class=\"field-container\">\n\n <crispr-heading\n *ngIf=\"config.heading\"\n [config]=\"config.heading\">\n </crispr-heading>\n\n <ng-content>\n </ng-content>\n\n</div>\n", styles: ["::ng-deep mat-form-field.mat-form-field{display:block;padding:.25em 0}.inline-field{display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: HeadingComponent, selector: "crispr-heading", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FieldContainerComponent, decorators: [{
430
- type: Component,
431
- args: [{ selector: 'crispr-field-container', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
432
- CommonModule,
433
- HeadingComponent,
434
- ], template: "<div\n *ngIf=\"(disabled$ | async) ? !config.hideDisabled : true\"\n [ngClass]=\"config.classes\"\n [class.inline-field]=\"inlineField\"\n class=\"field-container\">\n\n <crispr-heading\n *ngIf=\"config.heading\"\n [config]=\"config.heading\">\n </crispr-heading>\n\n <ng-content>\n </ng-content>\n\n</div>\n", styles: ["::ng-deep mat-form-field.mat-form-field{display:block;padding:.25em 0}.inline-field{display:inline-block}\n"] }]
435
- }], propDecorators: { config: [{
436
- type: Input
437
- }], group: [{
438
- type: Input
439
- }], inlineField: [{
440
- type: Input
441
- }] } });
442
-
443
- const InputFieldMixin = crisprControlMixin(CrisprFieldComponent);
444
- class InputFieldComponent extends InputFieldMixin {
445
- constructor() {
446
- super();
447
- this.defaultConfig = { inputType: 'text' };
448
- }
449
- ngOnInit() {
450
- super.ngOnInit();
451
- }
452
- }
453
- InputFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
454
- InputFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: InputFieldComponent, isStandalone: true, selector: "crispr-input-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>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
455
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InputFieldComponent, decorators: [{
456
- type: Component,
457
- args: [{ selector: 'crispr-input-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
458
- CommonModule,
459
- InfoComponent,
460
- ReactiveFormsModule,
461
- FieldContainerComponent,
462
- MatFormFieldModule,
463
- MatInputModule,
464
- ], 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>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n" }]
465
- }], ctorParameters: function () { return []; } });
14
+ import * as i3$2 from '@angular/material/icon';
15
+ import { MatIconModule } from '@angular/material/icon';
16
+ import * as i3 from '@tft/crispr-forms/ui';
17
+ import { FieldContainerComponent } from '@tft/crispr-forms/ui';
18
+ export * from '@tft/crispr-forms/ui';
466
19
 
467
20
  const FIELD_COMPONENTS = {
468
21
  groupList: Promise.resolve().then(function () { return index$1; }).then(({ FormGroupListComponent }) => FormGroupListComponent),
469
22
  subGroup: Promise.resolve().then(function () { return index; }).then(({ SubGroupComponent }) => SubGroupComponent),
470
- button: Promise.resolve().then(function () { return index$2; }).then(({ ButtonComponent }) => ButtonComponent),
471
- input: Promise.resolve().then(function () { return index$2; }).then(({ InputFieldComponent }) => InputFieldComponent),
472
- select: Promise.resolve().then(function () { return index$2; }).then(({ SelectFieldComponent }) => SelectFieldComponent),
473
- radio: Promise.resolve().then(function () { return index$2; }).then(({ RadioFieldComponent }) => RadioFieldComponent),
474
- autocomplete: Promise.resolve().then(function () { return index$2; }).then(({ AutocompleteFieldComponent }) => AutocompleteFieldComponent),
475
- autocompleteChiplist: Promise.resolve().then(function () { return index$2; }).then(({ AutocompleteChiplistFieldComponent }) => AutocompleteChiplistFieldComponent),
476
- textarea: Promise.resolve().then(function () { return index$2; }).then(({ TextareaFieldComponent }) => TextareaFieldComponent),
477
- checkbox: Promise.resolve().then(function () { return index$2; }).then(({ CheckboxFieldComponent }) => CheckboxFieldComponent),
478
- slider: Promise.resolve().then(function () { return index$2; }).then(({ SliderFieldComponent }) => SliderFieldComponent),
479
- datepicker: Promise.resolve().then(function () { return index$2; }).then(({ DatepickerFieldComponent }) => DatepickerFieldComponent),
480
- fileUpload: Promise.resolve().then(function () { return index$2; }).then(({ FileUploadFieldComponent }) => FileUploadFieldComponent),
481
- imageUpload: Promise.resolve().then(function () { return index$2; }).then(({ ImageUploadFieldComponent }) => ImageUploadFieldComponent),
482
- heading: Promise.resolve().then(function () { return index$2; }).then(({ HeadingComponent }) => HeadingComponent),
483
- divider: Promise.resolve().then(function () { return index$2; }).then(({ DividerComponent }) => DividerComponent),
484
- unitConversion: Promise.resolve().then(function () { return index$2; }).then(({ UnitConversionFieldComponent }) => UnitConversionFieldComponent)
23
+ button: import('@tft/crispr-forms/ui').then(({ ButtonComponent }) => ButtonComponent),
24
+ input: import('@tft/crispr-forms/ui').then(({ InputFieldComponent }) => InputFieldComponent),
25
+ select: import('@tft/crispr-forms/ui').then(({ SelectFieldComponent }) => SelectFieldComponent),
26
+ radio: import('@tft/crispr-forms/ui').then(({ RadioFieldComponent }) => RadioFieldComponent),
27
+ autocomplete: import('@tft/crispr-forms/ui').then(({ AutocompleteFieldComponent }) => AutocompleteFieldComponent),
28
+ autocompleteChiplist: import('@tft/crispr-forms/ui').then(({ AutocompleteChiplistFieldComponent }) => AutocompleteChiplistFieldComponent),
29
+ textarea: import('@tft/crispr-forms/ui').then(({ TextareaFieldComponent }) => TextareaFieldComponent),
30
+ checkbox: import('@tft/crispr-forms/ui').then(({ CheckboxFieldComponent }) => CheckboxFieldComponent),
31
+ slider: import('@tft/crispr-forms/ui').then(({ SliderFieldComponent }) => SliderFieldComponent),
32
+ datepicker: import('@tft/crispr-forms/ui').then(({ DatepickerFieldComponent }) => DatepickerFieldComponent),
33
+ fileUpload: import('@tft/crispr-forms/ui').then(({ FileUploadFieldComponent }) => FileUploadFieldComponent),
34
+ imageUpload: import('@tft/crispr-forms/ui/image-upload-field').then(({ ImageUploadFieldComponent }) => ImageUploadFieldComponent),
35
+ heading: import('@tft/crispr-forms/ui').then(({ HeadingComponent }) => HeadingComponent),
36
+ divider: import('@tft/crispr-forms/ui').then(({ DividerComponent }) => DividerComponent),
37
+ unitConversion: import('@tft/crispr-forms/ui').then(({ UnitConversionFieldComponent }) => UnitConversionFieldComponent)
485
38
  };
486
39
  function isControlComponent(component) {
487
40
  return component && isControlConfig(component.config) && 'value' in component; // || component.config.controlType === ControlType.BUTTON;
@@ -557,882 +110,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImpor
557
110
  type: Input
558
111
  }] } });
559
112
 
560
- class OptionComponent {
561
- }
562
- OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
563
- OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: OptionComponent, isStandalone: true, selector: "crispr-option", inputs: { option: "option" }, ngImport: i0, template: "<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
564
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: OptionComponent, decorators: [{
565
- type: Component,
566
- args: [{ selector: 'crispr-option', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
567
- CommonModule,
568
- InfoComponent,
569
- ], template: "<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"] }]
570
- }], propDecorators: { option: [{
571
- type: Input
572
- }] } });
573
-
574
- const SelectFieldMixin = crisprControlMixin(CrisprFieldComponent);
575
- class SelectFieldComponent extends SelectFieldMixin {
576
- constructor() {
577
- super(...arguments);
578
- this.defaultConfig = {
579
- enableToggleAll: false,
580
- color: 'primary'
581
- };
582
- this.allSelected = false;
583
- }
584
- ngOnInit() {
585
- super.ngOnInit();
586
- // options$ can be passed as an array, promise that resolves array, or observable that resolves array
587
- // this functions accounts for all possibilities and converts to observable that resolves array
588
- this.options$ = observablifyOptions(this.config.options, this.group);
589
- }
590
- ngAfterViewInit() {
591
- var _a, _b;
592
- if (this.config.multiple
593
- && this.config.enableToggleAll
594
- && ((_a = this.selectField.options) === null || _a === void 0 ? void 0 : _a.length) === ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length)) {
595
- this.allSelected = true;
596
- }
597
- }
598
- toggleAll(isSelected) {
599
- if (isSelected) {
600
- this.selectField.options.forEach(option => option.deselect());
601
- }
602
- else {
603
- this.selectField.options.forEach(option => option.select());
604
- }
605
- this.allSelected = !this.allSelected;
606
- }
607
- }
608
- SelectFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
609
- SelectFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SelectFieldComponent, isStandalone: true, selector: "crispr-select-field", viewQueries: [{ propertyName: "selectField", first: true, predicate: ["selectField"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\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 <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
610
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectFieldComponent, decorators: [{
611
- type: Component,
612
- args: [{ selector: 'crispr-select-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
613
- CommonModule,
614
- InfoComponent,
615
- OptionComponent,
616
- MatCheckboxModule,
617
- MatSelectModule,
618
- ReactiveFormsModule,
619
- CrisprFieldDirective,
620
- FieldContainerComponent,
621
- MatFormFieldModule,
622
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\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 <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"] }]
623
- }], propDecorators: { selectField: [{
624
- type: ViewChild,
625
- args: ['selectField']
626
- }] } });
627
-
628
- const defaultConfig$7 = {
629
- autoActiveFirstOption: true,
630
- typeDebounceTime: 500,
631
- emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE
632
- };
633
- class AutocompleteFieldComponent extends AbstractAutocompleteComponent {
634
- constructor() {
635
- super(...arguments);
636
- this.defaultConfig = defaultConfig$7;
637
- }
638
- ngOnInit() {
639
- super.ngOnInit();
640
- this.clearFieldSubscription = this.autocompleteInputControl.valueChanges.subscribe((text) => {
641
- if (typeof text === 'string' && (text === null || text === void 0 ? void 0 : text.trim()) === '') {
642
- this.control.setValue(null);
643
- }
644
- });
645
- }
646
- ngOnDestroy() {
647
- this.clearFieldSubscription.unsubscribe();
648
- }
649
- setControlValue(value) {
650
- if (this.control && value) {
651
- // sets the initial value on the control if one is passed
652
- this.control.setValue(value.value || '');
653
- this.autocompleteInputControl.setValue(value.label || '');
654
- }
655
- }
656
- /**
657
- * The material autocomplete defaults to displaying the options value instead of its label.
658
- * We only have the value from the selected option to work with, so we have to pass the options
659
- * through a function called in the template and return the function that the material displayWith
660
- * input is expecting.
661
- * @param options the array of options to search for option with corresponding value
662
- */
663
- displayLabel(options) {
664
- if (this.config.displayWith) {
665
- return this.config.displayWith(options);
666
- }
667
- return (value) => {
668
- var _a;
669
- const label = !!options && Array.isArray(options)
670
- ? (_a = options.find((option) => JSON.stringify(option.value) === JSON.stringify(value))) === null || _a === void 0 ? void 0 : _a.label : value;
671
- return label;
672
- };
673
- }
674
- handleSelect(event) {
675
- this.control.setValue(event.option.value);
676
- this.autoInputRef.nativeElement.blur();
677
- }
678
- }
679
- AutocompleteFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
680
- AutocompleteFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: AutocompleteFieldComponent, isStandalone: true, selector: "crispr-autocomplete-field", viewQueries: [{ propertyName: "autoInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "autoInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\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\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n <ng-container *ngIf=\"options$ | async as options; else emptyOption\">\n <ng-container *ngIf=\"options.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of options\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n\n </mat-autocomplete>\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", styles: [".hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3$3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i3$3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.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: MatOptionModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
681
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteFieldComponent, decorators: [{
682
- type: Component,
683
- args: [{ selector: 'crispr-autocomplete-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
684
- CommonModule,
685
- InfoComponent,
686
- OptionComponent,
687
- ReactiveFormsModule,
688
- FieldContainerComponent,
689
- MatAutocompleteModule,
690
- MatInputModule,
691
- MatOptionModule,
692
- ], template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\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\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n <ng-container *ngIf=\"options$ | async as options; else emptyOption\">\n <ng-container *ngIf=\"options.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of options\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n\n </mat-autocomplete>\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", styles: [".hidden-error-directive-anchor{display:none}\n"] }]
693
- }], propDecorators: { autoInput: [{
694
- type: ViewChild,
695
- args: ['autoInput', { read: MatAutocompleteTrigger }]
696
- }], autoInputRef: [{
697
- type: ViewChild,
698
- args: ['autoInput']
699
- }] } });
700
-
701
- const defaultConfig$6 = {
702
- chipsSelectable: true,
703
- areChipsRemovable: true,
704
- tabToSelect: true,
705
- autoActiveFirstOption: true,
706
- imageUrlParam: 'image',
707
- typeDebounceTime: 500,
708
- allowDuplicates: false,
709
- duplicateCompareFunction: (chip, option) => chip.value === option.value,
710
- separatorKeyCodes: [ENTER],
711
- emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,
712
- };
713
- class AutocompleteChiplistFieldComponent extends AbstractAutocompleteComponent {
714
- constructor() {
715
- super(...arguments);
716
- this.defaultConfig = defaultConfig$6;
717
- this.chips$ = new BehaviorSubject([]);
718
- this.controlValue$ = this.chips$.pipe(tap(chips => {
719
- this.control.setValue(chips.map(chip => chip.value));
720
- }));
721
- }
722
- ngOnInit() {
723
- super.ngOnInit();
724
- this.remainingOptions$ = combineLatest([
725
- this.chips$,
726
- this.options$
727
- ]).pipe(map(([chips, options]) => {
728
- return this.config.allowDuplicates
729
- ? options
730
- : options === null || options === void 0 ? void 0 : options.filter(option => {
731
- return !chips.some(chip => this.config.duplicateCompareFunction(chip, option));
732
- });
733
- }));
734
- }
735
- setControlValue(value) {
736
- if (value) {
737
- this.chips$.next(value);
738
- }
739
- }
740
- // handles mat selecting
741
- handleSelect(event) {
742
- const selectedOption = event.option.value;
743
- this.chips$.next([...this.chips$.value, selectedOption]);
744
- this.chipInputRef.nativeElement.value = '';
745
- this.autocompleteInputControl.setValue('');
746
- // setTimeout needed because the panel thinks it's still open at this point
747
- setTimeout(() => this.chipInput.openPanel());
748
- }
749
- /**
750
- * To follow ARIA standards we want to select the active option on blur.
751
- * matChipInputAddOnBlur should do this but it causes buggy behaviour
752
- * @param event blur event that triggers the handle blur
753
- */
754
- handleTab(_event) {
755
- if (this.chipInput.activeOption && (this.config.tabToSelect || this.config.addChipOnBlur)) {
756
- const chip = this.chipInput.activeOption.value;
757
- this.chips$.next([...this.chips$.value, chip]);
758
- }
759
- }
760
- /**
761
- * Handles selection via key tokens passed through separatorKeyCodes propert
762
- * NOTE: If TAB is used focus does not move on to next component
763
- * @param event
764
- */
765
- handleTokenEnd(event) {
766
- var _a;
767
- if (this.chipInput.activeOption) {
768
- this.chipInput.activeOption.select();
769
- }
770
- (_a = event.chipInput) === null || _a === void 0 ? void 0 : _a.clear();
771
- }
772
- mapToLabel(option) {
773
- return option ? option.label : '';
774
- }
775
- removeChip(removedChip) {
776
- const remainingChips = this.chips$.value.filter(chip => chip !== removedChip);
777
- this.chips$.next(remainingChips);
778
- }
779
- }
780
- AutocompleteChiplistFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteChiplistFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
781
- AutocompleteChiplistFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: AutocompleteChiplistFieldComponent, isStandalone: true, selector: "crispr-autocomplete-chiplist-field", viewQueries: [{ propertyName: "chipInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "chipInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\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\n <mat-chip-list\n #chipList>\n <mat-chip\n class=\"refinement-chip\"\n *ngFor=\"let chip of controlValue$ | async\"\n [selectable]=\"config.chipsSelectable\"\n [removable]=\"config.areChipsRemovable\"\n (removed)=\"removeChip(chip)\">\n <span *ngIf=\"chip.imageUrl as imageUrl\" class=\"image-container\">\n <img [src]=\"imageUrl\" alt=\"image of {{chip.label}}\">\n </span>\n {{chip.label}}\n <mat-icon\n matChipRemove\n *ngIf=\"config.areChipsRemovable\">\n cancel\n </mat-icon>\n </mat-chip>\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"auto\"\n (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config.separatorKeyCodes\"\n (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\"\n type=\"text\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput/>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n </mat-chip-list>\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"this.config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"mapToLabel\">\n <ng-container *ngIf=\"remainingOptions$ | async as remainingOptions; else emptyOption\">\n <ng-container *ngIf=\"remainingOptions.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of remainingOptions$ | async\"\n [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n </mat-autocomplete>\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", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3$3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i3$3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.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: MatOptionModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i7.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
782
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteChiplistFieldComponent, decorators: [{
783
- type: Component,
784
- args: [{ selector: 'crispr-autocomplete-chiplist-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
785
- CommonModule,
786
- InfoComponent,
787
- OptionComponent,
788
- ReactiveFormsModule,
789
- FieldContainerComponent,
790
- MatAutocompleteModule,
791
- MatInputModule,
792
- MatOptionModule,
793
- MatChipsModule,
794
- MatIconModule
795
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\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\n <mat-chip-list\n #chipList>\n <mat-chip\n class=\"refinement-chip\"\n *ngFor=\"let chip of controlValue$ | async\"\n [selectable]=\"config.chipsSelectable\"\n [removable]=\"config.areChipsRemovable\"\n (removed)=\"removeChip(chip)\">\n <span *ngIf=\"chip.imageUrl as imageUrl\" class=\"image-container\">\n <img [src]=\"imageUrl\" alt=\"image of {{chip.label}}\">\n </span>\n {{chip.label}}\n <mat-icon\n matChipRemove\n *ngIf=\"config.areChipsRemovable\">\n cancel\n </mat-icon>\n </mat-chip>\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"auto\"\n (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config.separatorKeyCodes\"\n (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\"\n type=\"text\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput/>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n </mat-chip-list>\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"this.config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"mapToLabel\">\n <ng-container *ngIf=\"remainingOptions$ | async as remainingOptions; else emptyOption\">\n <ng-container *ngIf=\"remainingOptions.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of remainingOptions$ | async\"\n [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n </mat-autocomplete>\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", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"] }]
796
- }], propDecorators: { chipInput: [{
797
- type: ViewChild,
798
- args: ['autoInput', { read: MatAutocompleteTrigger }]
799
- }], chipInputRef: [{
800
- type: ViewChild,
801
- args: ['autoInput']
802
- }] } });
803
-
804
- const defaultConfig$5 = {
805
- labelPosition: 'after',
806
- inline: false
807
- };
808
- const CheckboxFieldMixin = crisprControlMixin(CrisprFieldComponent);
809
- class CheckboxFieldComponent extends CheckboxFieldMixin {
810
- constructor() {
811
- super(...arguments);
812
- this.defaultConfig = defaultConfig$5;
813
- }
814
- ngOnInit() {
815
- super.ngOnInit();
816
- }
817
- }
818
- CheckboxFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CheckboxFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
819
- CheckboxFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: CheckboxFieldComponent, isStandalone: true, selector: "crispr-checkbox-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [inlineField]=\"config.inline\">\n <div\n [formGroup]=\"group\">\n <mat-checkbox\n [color]=\"config.color\"\n [labelPosition]=\"config.labelPosition\"\n [formControlName]=\"config.controlName\">\n {{config.label}}\n <crispr-info\n matSuffix *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
820
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CheckboxFieldComponent, decorators: [{
821
- type: Component,
822
- args: [{ selector: 'crispr-checkbox-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
823
- CommonModule,
824
- InfoComponent,
825
- MatCheckboxModule,
826
- ReactiveFormsModule,
827
- CrisprFieldDirective,
828
- FieldContainerComponent
829
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [inlineField]=\"config.inline\">\n <div\n [formGroup]=\"group\">\n <mat-checkbox\n [color]=\"config.color\"\n [labelPosition]=\"config.labelPosition\"\n [formControlName]=\"config.controlName\">\n {{config.label}}\n <crispr-info\n matSuffix *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"] }]
830
- }] });
831
-
832
- const defaultConfig$4 = { rows: 5 };
833
- const TextareaFieldMixin = crisprControlMixin(CrisprFieldComponent);
834
- class TextareaFieldComponent extends TextareaFieldMixin {
835
- constructor() {
836
- super(...arguments);
837
- this.defaultConfig = defaultConfig$4;
838
- }
839
- ngOnInit() {
840
- super.ngOnInit();
841
- }
842
- }
843
- TextareaFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: TextareaFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
844
- TextareaFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: TextareaFieldComponent, isStandalone: true, selector: "crispr-textarea-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 <textarea\n [rows]=\"config.rows\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\">\n </textarea>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && control.valid\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
845
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: TextareaFieldComponent, decorators: [{
846
- type: Component,
847
- args: [{ selector: 'crispr-textarea-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
848
- CommonModule,
849
- InfoComponent,
850
- ReactiveFormsModule,
851
- FieldContainerComponent,
852
- MatFormFieldModule,
853
- MatInputModule,
854
- ], 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 <textarea\n [rows]=\"config.rows\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\">\n </textarea>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && control.valid\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n" }]
855
- }] });
856
-
857
- const defaultConfig$3 = { displayLimits: true };
858
- const SliderFieldMixin = crisprControlMixin(CrisprFieldComponent);
859
- class SliderFieldComponent extends SliderFieldMixin {
860
- constructor() {
861
- super();
862
- this.defaultConfig = defaultConfig$3;
863
- }
864
- get flexDirection() {
865
- return this.config.vertical ? 'column' : 'row';
866
- }
867
- ngOnInit() {
868
- super.ngOnInit();
869
- }
870
- }
871
- SliderFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SliderFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
872
- SliderFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SliderFieldComponent, isStandalone: true, selector: "crispr-slider-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n", styles: [".slider-container{display:flex;align-items:center}.slider-container .mat-slider-horizontal{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i3$4.MatSlider, selector: "mat-slider", inputs: ["disabled", "color", "tabIndex", "invert", "max", "min", "step", "thumbLabel", "tickInterval", "value", "displayWith", "valueText", "vertical"], outputs: ["change", "input", "valueChange"], exportAs: ["matSlider"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
873
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SliderFieldComponent, decorators: [{
874
- type: Component,
875
- args: [{ selector: 'crispr-slider-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
876
- CommonModule,
877
- InfoComponent,
878
- OptionComponent,
879
- FieldContainerComponent,
880
- ReactiveFormsModule,
881
- MatSliderModule
882
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n", styles: [".slider-container{display:flex;align-items:center}.slider-container .mat-slider-horizontal{width:100%}\n"] }]
883
- }], ctorParameters: function () { return []; } });
884
-
885
- class ButtonComponent extends CrisprFieldComponent {
886
- constructor() {
887
- super(...arguments);
888
- this.defaultConfig = { buttonType: 'raised', type: 'submit' };
889
- }
890
- get matButtonClass() {
891
- return this.config.buttonType ? `mat-${this.config.buttonType}-button` : '';
892
- }
893
- ngOnInit() {
894
- super.ngOnInit();
895
- this.formValid$ = this.group.statusChanges.pipe(map(status => status === 'VALID'), startWith(this.group.valid));
896
- }
897
- handleClick(group, event) {
898
- if (this.config.callback) {
899
- this.config.callback(group, event);
900
- }
901
- }
902
- }
903
- ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
904
- ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: ButtonComponent, isStandalone: true, selector: "crispr-button", usesInheritance: true, ngImport: i0, template: "<button\n [formGroup]=\"group\"\n mat-button\n [ngClass]=\"matButtonClass\"\n [color]=\"config.color\"\n [disabled]=\"config.disabledOnInvalidForm && !(formValid$ | async)\"\n [type]=\"config.type\"\n (click)=\"handleClick(group, $event)\"\n [matTooltip]=\"config.info?.content\"\n [matTooltipPosition]=\"config.info?.tooltipPosition || 'below'\">\n {{ config.label }}\n <mat-icon *ngIf=\"config.icon\">\n {{ config.icon}}\n </mat-icon>\n</button>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
905
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ButtonComponent, decorators: [{
906
- type: Component,
907
- args: [{ selector: 'crispr-button', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
908
- CommonModule,
909
- MatButtonModule,
910
- MatIconModule,
911
- MatTooltipModule,
912
- ReactiveFormsModule,
913
- ], template: "<button\n [formGroup]=\"group\"\n mat-button\n [ngClass]=\"matButtonClass\"\n [color]=\"config.color\"\n [disabled]=\"config.disabledOnInvalidForm && !(formValid$ | async)\"\n [type]=\"config.type\"\n (click)=\"handleClick(group, $event)\"\n [matTooltip]=\"config.info?.content\"\n [matTooltipPosition]=\"config.info?.tooltipPosition || 'below'\">\n {{ config.label }}\n <mat-icon *ngIf=\"config.icon\">\n {{ config.icon}}\n </mat-icon>\n</button>\n\n" }]
914
- }] });
915
-
916
- const defaultConfig$2 = {
917
- startView: 'month',
918
- };
919
- const DatepickerFieldMixin = crisprControlMixin(CrisprFieldComponent);
920
- class DatepickerFieldComponent extends DatepickerFieldMixin {
921
- constructor() {
922
- super(...arguments);
923
- this.defaultConfig = defaultConfig$2;
924
- }
925
- ngOnInit() {
926
- var _a, _b;
927
- super.ngOnInit();
928
- this.startAt$ = this.config.startAt instanceof Date
929
- ? of(this.config.startAt)
930
- : this.config.startAt instanceof Function
931
- ? this.config.startAt(this.group)
932
- : of(null);
933
- this.dateClass = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.cellClassFunction) || null;
934
- this.dateClass$ = this.config.dateClass ? (_b = this.config) === null || _b === void 0 ? void 0 : _b.dateClass(this.group) : of(() => '');
935
- }
936
- ngAfterContentInit() {
937
- if (this.config.datepickerActions) {
938
- this.calendarFooterPortal = new ComponentPortal(this.config.datepickerActions);
939
- }
940
- }
941
- }
942
- DatepickerFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DatepickerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
943
- DatepickerFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", 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$3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$3.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
944
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
945
- type: Component,
946
- args: [{ selector: 'crispr-datepicker-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
947
- CommonModule,
948
- FieldContainerComponent,
949
- MatDatepickerModule,
950
- MatFormFieldModule,
951
- ReactiveFormsModule,
952
- MatInputModule,
953
- MatDateFnsModule,
954
- PortalModule
955
- ], 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" }]
956
- }] });
957
-
958
- class DividerComponent extends CrisprFieldComponent {
959
- constructor() {
960
- super(...arguments);
961
- // TODO: pull in type after configs are better organized
962
- this.defaultConfig = {};
963
- }
964
- ngOnInit() {
965
- super.ngOnInit();
966
- }
967
- }
968
- DividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
969
- DividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: DividerComponent, isStandalone: true, selector: "crispr-divider", usesInheritance: true, ngImport: i0, template: "<mat-divider [ngClass]=\"config.classes\"></mat-divider>", styles: [":host{display:block;padding:1em 0}::ng-deep .mat-divider.mat-divider-horizontal{position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], preserveWhitespaces: true });
970
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, decorators: [{
971
- type: Component,
972
- args: [{ selector: 'crispr-divider', standalone: true, imports: [
973
- CommonModule,
974
- MatDividerModule
975
- ], template: "<mat-divider [ngClass]=\"config.classes\"></mat-divider>", styles: [":host{display:block;padding:1em 0}::ng-deep .mat-divider.mat-divider-horizontal{position:relative}\n"] }]
976
- }] });
977
-
978
- const RadioFieldMixin = crisprControlMixin(CrisprFieldComponent);
979
- class RadioFieldComponent extends RadioFieldMixin {
980
- constructor() {
981
- super(...arguments);
982
- this.defaultConfig = {};
983
- }
984
- ngOnInit() {
985
- super.ngOnInit();
986
- // options$ can be passed as an array, promise that resolves array, or observable that resolves array
987
- // this functions accounts for all possibilities and converts to observable that resolves array
988
- this.options$ = observablifyOptions(this.config.options, this.group);
989
- }
990
- }
991
- RadioFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: RadioFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
992
- RadioFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: RadioFieldComponent, isStandalone: true, selector: "crispr-radio-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i3$5.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i3$5.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
993
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: RadioFieldComponent, decorators: [{
994
- type: Component,
995
- args: [{ selector: 'crispr-radio-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
996
- CommonModule,
997
- ReactiveFormsModule,
998
- FieldContainerComponent,
999
- MatRadioModule,
1000
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"] }]
1001
- }] });
1002
-
1003
- const defaultConfig$1 = {};
1004
- const UnitConversionFieldMixin = crisprControlMixin(CrisprFieldComponent);
1005
- class UnitConversionFieldComponent extends UnitConversionFieldMixin {
1006
- constructor() {
1007
- super(...arguments);
1008
- this.defaultConfig = defaultConfig$1;
1009
- this.displayValueControl = new FormControl();
1010
- this.unitSelectControl = new FormControl();
1011
- }
1012
- ngOnInit() {
1013
- var _a, _b;
1014
- super.ngOnInit();
1015
- // TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value
1016
- // this.displayValueControl.setValidators(this.config.validators);
1017
- const controlValuePipeline = [
1018
- this.displayValueControl.valueChanges.pipe(startWith(this.displayValueControl.value))
1019
- ];
1020
- // setup all required pieces when showing a field for selecting units
1021
- if (this.config.showUnitSelect) {
1022
- this.unitOptions$ = observablifyOptions(this.config.selectableUnits, this.group);
1023
- controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(((_a = this.config) === null || _a === void 0 ? void 0 : _a.initialDisplayUnit) || null)));
1024
- this.unitSelectControl.setValue(((_b = this.config) === null || _b === void 0 ? void 0 : _b.initialDisplayUnit) || null);
1025
- }
1026
- this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue]) => {
1027
- const computedValue = this.config.storedValueConversion(displayValue, unitValue);
1028
- this.control.setValue(computedValue);
1029
- });
1030
- }
1031
- ngOnDestroy() {
1032
- this.transformationSubscription.unsubscribe();
1033
- }
1034
- setInitialDisplayValue(storedValue, unit) {
1035
- const initialDisplayValue = this.config.initialDisplayValueConversion(storedValue || null, unit);
1036
- this.displayValueControl.setValue(initialDisplayValue);
1037
- }
1038
- /**
1039
- * We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,
1040
- * This function gets called onInit because were object oriented. it's so great, so great that I'm
1041
- * typing a paragraph to explain what the hell is going on...
1042
- * @param value the initial value for the control passed down from the form components input
1043
- */
1044
- setControlValue(value) {
1045
- var _a;
1046
- const initialUnitValue = this.config.showUnitSelect ? (_a = this.config) === null || _a === void 0 ? void 0 : _a.initialDisplayUnit : null;
1047
- this.setInitialDisplayValue(value, initialUnitValue);
1048
- }
1049
- }
1050
- UnitConversionFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: UnitConversionFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1051
- UnitConversionFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: UnitConversionFieldComponent, isStandalone: true, selector: "crispr-unit-conversion-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.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: MatSelectModule }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
1052
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: UnitConversionFieldComponent, decorators: [{
1053
- type: Component,
1054
- args: [{ selector: 'crispr-unit-conversion-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1055
- CommonModule,
1056
- InfoComponent,
1057
- OptionComponent,
1058
- ReactiveFormsModule,
1059
- FieldContainerComponent,
1060
- MatInputModule,
1061
- MatSelectModule,
1062
- MatOptionModule,
1063
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"] }]
1064
- }] });
1065
-
1066
- class FileDropzoneDirective {
1067
- constructor() {
1068
- this.fileDrop = new EventEmitter();
1069
- this.crisprFileDropzone = true;
1070
- }
1071
- onDrop($event) {
1072
- if (this.crisprFileDropzone) {
1073
- $event.preventDefault();
1074
- this.fileDrop.emit($event.dataTransfer.files);
1075
- }
1076
- }
1077
- // Prevents DOM from trying to open file in browser
1078
- onDragOver($event) {
1079
- if (this.crisprFileDropzone) {
1080
- $event.preventDefault();
1081
- }
1082
- }
1083
- }
1084
- FileDropzoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileDropzoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1085
- FileDropzoneDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: FileDropzoneDirective, isStandalone: true, selector: "[crisprFileDropzone]", inputs: { crisprFileDropzone: "crisprFileDropzone" }, outputs: { fileDrop: "fileDrop" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDragOver($event)" } }, ngImport: i0 });
1086
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileDropzoneDirective, decorators: [{
1087
- type: Directive,
1088
- args: [{
1089
- selector: '[crisprFileDropzone]',
1090
- standalone: true,
1091
- }]
1092
- }], propDecorators: { fileDrop: [{
1093
- type: Output
1094
- }], crisprFileDropzone: [{
1095
- type: Input
1096
- }], onDrop: [{
1097
- type: HostListener,
1098
- args: ['drop', ['$event']]
1099
- }], onDragOver: [{
1100
- type: HostListener,
1101
- args: ['dragover', ['$event']]
1102
- }] } });
1103
-
1104
- class SelectedFileComponent {
1105
- }
1106
- SelectedFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectedFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1107
- SelectedFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SelectedFileComponent, isStandalone: true, selector: "crispr-selected-file", inputs: { fileName: "fileName", progress: "progress", showProgress: "showProgress", color: "color" }, ngImport: i0, template: "<h3 class=\"mat-h3\">{{ fileName }}</h3>\n<mat-progress-bar\n *ngIf=\"showProgress\"\n mode=\"determinate\"\n [color]=\"color\"\n [value]=\"progress\">\n</mat-progress-bar>\n", styles: ["mat-progress-bar{margin-bottom:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2$5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], preserveWhitespaces: true });
1108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectedFileComponent, decorators: [{
1109
- type: Component,
1110
- args: [{ selector: 'crispr-selected-file', standalone: true, imports: [
1111
- CommonModule,
1112
- MatProgressBarModule
1113
- ], template: "<h3 class=\"mat-h3\">{{ fileName }}</h3>\n<mat-progress-bar\n *ngIf=\"showProgress\"\n mode=\"determinate\"\n [color]=\"color\"\n [value]=\"progress\">\n</mat-progress-bar>\n", styles: ["mat-progress-bar{margin-bottom:8px}\n"] }]
1114
- }], propDecorators: { fileName: [{
1115
- type: Input
1116
- }], progress: [{
1117
- type: Input
1118
- }], showProgress: [{
1119
- type: Input
1120
- }], color: [{
1121
- type: Input
1122
- }] } });
1123
-
1124
- const FileUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
1125
- class FileUploadFieldComponent extends FileUploadFieldMixin {
1126
- // ngControl: NgControl = null;
1127
- constructor(ngControl) {
1128
- super();
1129
- this.ngControl = ngControl;
1130
- this.defaultConfig = {
1131
- allowMultipleFiles: false,
1132
- acceptedTypes: '*.*',
1133
- dropZoneText: 'DROP FILE HERE',
1134
- selectFilesButtonType: 'button',
1135
- selectButtonText: 'SELECT',
1136
- showClearFilesButton: true,
1137
- clearFilesButtonText: 'CLEAR',
1138
- uploadButtonText: 'UPLOAD',
1139
- uploadButtonType: 'button',
1140
- showUploadProgress: false,
1141
- disableOnUpload: true
1142
- };
1143
- this.isUploaded = false;
1144
- this.fileProgress = [];
1145
- if (this.ngControl != null) {
1146
- // Setting the value accessor directly (instead of using
1147
- // the providers) to avoid running into a circular import.
1148
- ngControl.valueAccessor = this;
1149
- }
1150
- }
1151
- ngOnInit() {
1152
- super.ngOnInit();
1153
- this.disabled$ = this.config.disabledCallback
1154
- ? this.config.disabledCallback(this.group, this.config)
1155
- : of(false);
1156
- }
1157
- filesChanged(files) {
1158
- if (files && files.length > 0) {
1159
- this.selectedFiles = files;
1160
- this.control.patchValue(files);
1161
- }
1162
- }
1163
- uploadFiles() {
1164
- if (this.selectedFiles && this.config.uploadFiles) {
1165
- this.isUploaded = true;
1166
- this.config.uploadFiles(this.group, this.selectedFiles, this);
1167
- }
1168
- }
1169
- resetFileInput() {
1170
- this.fileInputRef.nativeElement.value = '';
1171
- this.control.patchValue(null);
1172
- this.isUploaded = false;
1173
- }
1174
- writeValue(value) {
1175
- // clear file input
1176
- // this.host.nativeElement.value = '';
1177
- // this.file = null;
1178
- }
1179
- registerOnChange(fn) {
1180
- this.onChange = fn;
1181
- }
1182
- registerOnTouched(fn) {
1183
- }
1184
- }
1185
- FileUploadFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, deps: [{ token: i2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
1186
- FileUploadFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: FileUploadFieldComponent, isStandalone: true, selector: "crispr-file-upload-field", viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0;display:flex;justify-content:center}:host .drop-info{display:flex;flex-direction:column;align-items:center}:host .drop-info .drop-icon{font-size:36px}:host .drop-info .mat-h2{margin:0}:host .button-container{display:flex;justify-content:flex-end;margin-top:-16px}:host .button-container button{margin-left:8px}:host .selected-files-container{width:100%}:host [matInput]{position:absolute;max-height:0;visibility:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.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: "component", type: SelectedFileComponent, selector: "crispr-selected-file", inputs: ["fileName", "progress", "showProgress", "color"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7$1.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
1187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, decorators: [{
1188
- type: Component,
1189
- args: [{ selector: 'crispr-file-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1190
- CommonModule,
1191
- FieldContainerComponent,
1192
- ReactiveFormsModule,
1193
- MatIconModule,
1194
- MatButtonModule,
1195
- MatFormFieldModule,
1196
- MatInputModule,
1197
- SelectedFileComponent,
1198
- FormValidationHandlerModule,
1199
- FileDropzoneDirective
1200
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0;display:flex;justify-content:center}:host .drop-info{display:flex;flex-direction:column;align-items:center}:host .drop-info .drop-icon{font-size:36px}:host .drop-info .mat-h2{margin:0}:host .button-container{display:flex;justify-content:flex-end;margin-top:-16px}:host .button-container button{margin-left:8px}:host .selected-files-container{width:100%}:host [matInput]{position:absolute;max-height:0;visibility:hidden}\n"] }]
1201
- }], ctorParameters: function () {
1202
- return [{ type: i2.NgControl, decorators: [{
1203
- type: Optional
1204
- }, {
1205
- type: Self
1206
- }] }];
1207
- }, propDecorators: { fileInputRef: [{
1208
- type: ViewChild,
1209
- args: ['fileInput']
1210
- }] } });
1211
-
1212
- function convertBytesToMb(bytes) {
1213
- return bytes / 1048576;
1214
- }
1215
-
1216
- const ImageUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
1217
- class ImageUploadFieldComponent extends ImageUploadFieldMixin {
1218
- constructor(ngControl, domSanitizer, cdr) {
1219
- super();
1220
- this.ngControl = ngControl;
1221
- this.domSanitizer = domSanitizer;
1222
- this.cdr = cdr;
1223
- this.defaultConfig = {
1224
- // allowMultipleFiles: false,
1225
- acceptedTypes: 'image/*',
1226
- dropZoneText: 'DROP FILE HERE',
1227
- selectFilesButtonType: 'button',
1228
- selectButtonText: 'SELECT',
1229
- showClearFilesButton: true,
1230
- clearFilesButtonText: 'CLEAR',
1231
- resetFilesButtonText: 'RESET',
1232
- imagePreviewHeight: '250px',
1233
- compressImage: false,
1234
- targetCompressedImageFileSizeMb: .4,
1235
- minCompressionThresholdMb: .6,
1236
- useWebWorker: true,
1237
- };
1238
- this.inputImageFileSubject = new Subject();
1239
- this.inputImageFile$ = this.inputImageFileSubject.asObservable().pipe(shareReplay(1));
1240
- this.compressedFile$ = this.inputImageFile$.pipe(switchMap((file) => __awaiter(this, void 0, void 0, function* () {
1241
- if (!file || !(file instanceof File))
1242
- return null;
1243
- const { compressImage, targetCompressedImageFileSizeMb, minCompressionThresholdMb, maxWidthOrHeight, useWebWorker } = this.config;
1244
- const fileSizeMb = convertBytesToMb(file.size);
1245
- const shouldCompress = compressImage
1246
- && targetCompressedImageFileSizeMb < fileSizeMb
1247
- && minCompressionThresholdMb < fileSizeMb;
1248
- if (shouldCompress) {
1249
- const options = Object.assign(Object.assign({}, (maxWidthOrHeight ? { maxWidthOrHeight } : { maxSizeMB: targetCompressedImageFileSizeMb })), { useWebWorker, maxIterations: 30, onProgress: (progress) => {
1250
- this.progress = progress;
1251
- this.cdr.detectChanges();
1252
- } });
1253
- return yield imageCompression(file, options);
1254
- }
1255
- else
1256
- return file;
1257
- })), map((compressedFile) => {
1258
- if (!compressedFile)
1259
- return compressedFile;
1260
- const { type, name, lastModified } = compressedFile;
1261
- return new File([compressedFile], this.config.fileName || name, {
1262
- type,
1263
- lastModified
1264
- });
1265
- }), tap(file => {
1266
- // only set the value if there is a file because resetToInitialValue sets the control value
1267
- // to initial value and clears the compressed image, so setting it to null here would undo that
1268
- if (file) {
1269
- this.control.setValue(file);
1270
- }
1271
- if (file || this.value) {
1272
- this.control.markAsTouched();
1273
- setTimeout(() => {
1274
- this.cdr.detectChanges();
1275
- }, 100);
1276
- }
1277
- }), shareReplay(1));
1278
- this.compressedImageUrlString$ = this.compressedFile$.pipe(switchMap((file) => __awaiter(this, void 0, void 0, function* () {
1279
- if (!file)
1280
- return null;
1281
- const compressedStringImage = yield imageCompression.getDataUrlFromFile(file);
1282
- return this.domSanitizer.bypassSecurityTrustResourceUrl(compressedStringImage);
1283
- })), shareReplay(1));
1284
- this.isUploaded = false;
1285
- if (this.ngControl != null) {
1286
- // Setting the value accessor directly (instead of using
1287
- // the providers) to avoid running into a circular import.
1288
- ngControl.valueAccessor = this;
1289
- }
1290
- }
1291
- ngOnInit() {
1292
- super.ngOnInit();
1293
- this.imageSrcUrl$ = combineLatest([
1294
- this.compressedImageUrlString$.pipe(startWith(null)),
1295
- this.control.valueChanges.pipe(startWith(this.value), map((controlValue) => {
1296
- var _a, _b;
1297
- if (!controlValue)
1298
- return null;
1299
- if (controlValue instanceof File)
1300
- return null;
1301
- return ((_b = (_a = this.config).mapInputValueToUrl) === null || _b === void 0 ? void 0 : _b.call(_a, controlValue)) || controlValue;
1302
- }))
1303
- ]).pipe(map(([compressedImageUrlString, controlUrl]) => {
1304
- return compressedImageUrlString || controlUrl || null;
1305
- }));
1306
- this.disabled$ = this.config.disabledCallback
1307
- ? this.config.disabledCallback(this.group, this.config)
1308
- : of(false);
1309
- }
1310
- filesChanged(files) {
1311
- if (files && files.length > 0) {
1312
- const imageFile = files[0];
1313
- // We clear the control here so that it is invalid while compressing
1314
- // the input pipeline will take care of resetting it
1315
- this.control.patchValue(null);
1316
- // this.control.setErrors({compressing: {loadingMessage: 'Please wait while file compresses'}});
1317
- this.control.markAsTouched();
1318
- this.inputImageFileSubject.next(imageFile);
1319
- }
1320
- }
1321
- clearFileInput() {
1322
- this.inputImageFileSubject.next(null);
1323
- this.fileInputRef.nativeElement.value = '';
1324
- this.control.patchValue(null);
1325
- this.control.markAsTouched();
1326
- this.isUploaded = false;
1327
- }
1328
- resetToInitialValue(initialValue) {
1329
- this.inputImageFileSubject.next(null);
1330
- this.control.patchValue(initialValue);
1331
- this.isUploaded = false;
1332
- }
1333
- writeValue(value) { }
1334
- registerOnChange(fn) {
1335
- this.onChange = fn;
1336
- }
1337
- registerOnTouched(fn) { }
1338
- }
1339
- ImageUploadFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ImageUploadFieldComponent, deps: [{ token: i2.NgControl, optional: true, self: true }, { token: i2$6.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1340
- ImageUploadFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: ImageUploadFieldComponent, isStandalone: true, selector: "crispr-image-upload-field", viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>{{config.label}}</mat-label>\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n [accept]=\"config.acceptedTypes\"\n (change)=\"filesChanged($event.target.files)\"/>\n <div class=\"ui-container\">\n\n <div class=\"image-preview\" [style.height]=\"config.imagePreviewHeight\">\n <crispr-selected-file\n *ngIf=\"(progress < 100) && inputImageFile$ | async as file; else dropzoneOrPreview\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n\n <ng-template #dropzoneOrPreview>\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n <img *ngIf=\"imageSrcUrl$ | async as srcUrl; else noImage\" [src]=\"srcUrl\" alt=\"\">\n <ng-template #noImage>\n <div class=\"drop-container\"\n [crisprFileDropzone]=\"!(disabled$ | async)\"\n (fileDrop)=\"filesChanged($event)\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n </div>\n </ng-template>\n\n </ng-template>\n </div>\n\n\n\n <!-- </ng-template> -->\n <div class=\"button-container\" *ngIf=\"true\">\n\n <button\n mat-button\n (click)=\"clearFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>delete</mat-icon>\n {{config.clearFilesButtonText}}\n </button>\n\n <button\n *ngIf=\"value\"\n mat-button\n (click)=\"resetToInitialValue(value)\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>replay</mat-icon>\n {{config.resetFilesButtonText}}\n </button>\n\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async)\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n <mat-icon>\n camera\n </mat-icon>\n SELECT\n </button>\n </div>\n </div>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0}:host ::ng-deep .mat-form-field .mat-button-wrapper{display:flex;flex-direction:column;align-items:center;padding-top:8px}:host .ui-container{display:flex;flex-direction:column}:host .ui-container .image-preview{display:flex;flex-direction:column;align-content:space-between;justify-content:center;align-items:center;margin:8px 0;flex-grow:1}:host .ui-container .image-preview crispr-selected-file{width:100%}:host .ui-container .image-preview .drop-container{display:flex;box-sizing:border-box;flex-direction:column;align-items:center;border:3px dashed gray;height:100%;width:100%;align-content:center;justify-content:center;border-radius:8px}:host .ui-container .image-preview .drop-container .drop-icon{height:32px;width:32px;font-size:36px}:host .ui-container .image-preview .drop-container .mat-h2{margin:0}:host .ui-container .image-preview img{height:inherit;max-width:100%}:host .ui-container .button-container{display:flex;flex-direction:var(--image-upload-button-container-direction);justify-content:flex-end}:host .ui-container .button-container button{margin-left:8px}:host input{position:absolute;max-height:0;visibility:hidden}\n"], 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: ReactiveFormsModule }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.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: "component", type: SelectedFileComponent, selector: "crispr-selected-file", inputs: ["fileName", "progress", "showProgress", "color"] }, { kind: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7$1.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
1341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ImageUploadFieldComponent, decorators: [{
1342
- type: Component,
1343
- args: [{ selector: 'crispr-image-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1344
- CommonModule,
1345
- FieldContainerComponent,
1346
- ReactiveFormsModule,
1347
- MatIconModule,
1348
- MatButtonModule,
1349
- MatFormFieldModule,
1350
- MatInputModule,
1351
- SelectedFileComponent,
1352
- FileDropzoneDirective,
1353
- FormValidationHandlerModule
1354
- ], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>{{config.label}}</mat-label>\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n [accept]=\"config.acceptedTypes\"\n (change)=\"filesChanged($event.target.files)\"/>\n <div class=\"ui-container\">\n\n <div class=\"image-preview\" [style.height]=\"config.imagePreviewHeight\">\n <crispr-selected-file\n *ngIf=\"(progress < 100) && inputImageFile$ | async as file; else dropzoneOrPreview\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n\n <ng-template #dropzoneOrPreview>\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n <img *ngIf=\"imageSrcUrl$ | async as srcUrl; else noImage\" [src]=\"srcUrl\" alt=\"\">\n <ng-template #noImage>\n <div class=\"drop-container\"\n [crisprFileDropzone]=\"!(disabled$ | async)\"\n (fileDrop)=\"filesChanged($event)\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n </div>\n </ng-template>\n\n </ng-template>\n </div>\n\n\n\n <!-- </ng-template> -->\n <div class=\"button-container\" *ngIf=\"true\">\n\n <button\n mat-button\n (click)=\"clearFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>delete</mat-icon>\n {{config.clearFilesButtonText}}\n </button>\n\n <button\n *ngIf=\"value\"\n mat-button\n (click)=\"resetToInitialValue(value)\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>replay</mat-icon>\n {{config.resetFilesButtonText}}\n </button>\n\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async)\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n <mat-icon>\n camera\n </mat-icon>\n SELECT\n </button>\n </div>\n </div>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0}:host ::ng-deep .mat-form-field .mat-button-wrapper{display:flex;flex-direction:column;align-items:center;padding-top:8px}:host .ui-container{display:flex;flex-direction:column}:host .ui-container .image-preview{display:flex;flex-direction:column;align-content:space-between;justify-content:center;align-items:center;margin:8px 0;flex-grow:1}:host .ui-container .image-preview crispr-selected-file{width:100%}:host .ui-container .image-preview .drop-container{display:flex;box-sizing:border-box;flex-direction:column;align-items:center;border:3px dashed gray;height:100%;width:100%;align-content:center;justify-content:center;border-radius:8px}:host .ui-container .image-preview .drop-container .drop-icon{height:32px;width:32px;font-size:36px}:host .ui-container .image-preview .drop-container .mat-h2{margin:0}:host .ui-container .image-preview img{height:inherit;max-width:100%}:host .ui-container .button-container{display:flex;flex-direction:var(--image-upload-button-container-direction);justify-content:flex-end}:host .ui-container .button-container button{margin-left:8px}:host input{position:absolute;max-height:0;visibility:hidden}\n"] }]
1355
- }], ctorParameters: function () {
1356
- return [{ type: i2.NgControl, decorators: [{
1357
- type: Optional
1358
- }, {
1359
- type: Self
1360
- }] }, { type: i2$6.DomSanitizer }, { type: i0.ChangeDetectorRef }];
1361
- }, propDecorators: { fileInputRef: [{
1362
- type: ViewChild,
1363
- args: ['fileInput']
1364
- }] } });
1365
- function maxFileSizeValidator(maxFileSize) {
1366
- return (control) => {
1367
- const controlValue = control.value;
1368
- if (!(controlValue instanceof File)) {
1369
- return null;
1370
- }
1371
- const actualFileSize = +convertBytesToMb(controlValue.size).toPrecision(3);
1372
- if (maxFileSize > actualFileSize)
1373
- return null;
1374
- return { maxFileSize: { maxFileSize, actualFileSize } };
1375
- };
1376
- }
1377
- function allowedFileExtValidator(allowedFileExtensions, onlyAllowFiles = true) {
1378
- return (control) => {
1379
- const controlValue = control.value;
1380
- const isFile = controlValue instanceof File;
1381
- if (!onlyAllowFiles && !isFile)
1382
- return null;
1383
- const actualExtension = isFile ? controlValue.name.split('.').pop().toLocaleLowerCase() : 'Not a file';
1384
- const isAllowedExtension = allowedFileExtensions.includes(actualExtension);
1385
- if (isAllowedExtension) {
1386
- return null;
1387
- }
1388
- return { allowedExtension: { allowedFileExtensions, actualExtension } };
1389
- };
1390
- }
1391
- function allowedFileType(matchExp) {
1392
- return (formControl) => {
1393
- const value = formControl.value;
1394
- if (!(value instanceof File))
1395
- return null;
1396
- const type = value.type;
1397
- const matches = type.match(matchExp);
1398
- if (!type || !(matches === null || matches === void 0 ? void 0 : matches.length)) {
1399
- return {
1400
- allowedFileType: {
1401
- actualType: type,
1402
- allowedTypeExp: matchExp
1403
- }
1404
- };
1405
- }
1406
- else {
1407
- return null;
1408
- }
1409
- };
1410
- }
1411
-
1412
- var index$2 = /*#__PURE__*/Object.freeze({
1413
- __proto__: null,
1414
- InputFieldComponent: InputFieldComponent,
1415
- SelectFieldComponent: SelectFieldComponent,
1416
- AutocompleteFieldComponent: AutocompleteFieldComponent,
1417
- AutocompleteChiplistFieldComponent: AutocompleteChiplistFieldComponent,
1418
- CheckboxFieldComponent: CheckboxFieldComponent,
1419
- TextareaFieldComponent: TextareaFieldComponent,
1420
- SliderFieldComponent: SliderFieldComponent,
1421
- ButtonComponent: ButtonComponent,
1422
- DatepickerFieldComponent: DatepickerFieldComponent,
1423
- HeadingComponent: HeadingComponent,
1424
- DividerComponent: DividerComponent,
1425
- RadioFieldComponent: RadioFieldComponent,
1426
- UnitConversionFieldComponent: UnitConversionFieldComponent,
1427
- ImageUploadFieldComponent: ImageUploadFieldComponent,
1428
- maxFileSizeValidator: maxFileSizeValidator,
1429
- allowedFileExtValidator: allowedFileExtValidator,
1430
- allowedFileType: allowedFileType,
1431
- FileDropzoneDirective: FileDropzoneDirective,
1432
- FileUploadFieldComponent: FileUploadFieldComponent,
1433
- OptionComponent: OptionComponent
1434
- });
1435
-
1436
113
  class InitialControlValuePipe {
1437
114
  // TODO: does changing any to unknown break anything?
1438
115
  transform(initialFormValue, fieldConfig) {
@@ -1492,7 +169,7 @@ class CrisprFormComponent {
1492
169
  }
1493
170
  }
1494
171
  CrisprFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CrisprFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1495
- CrisprFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: CrisprFormComponent, isStandalone: true, selector: "crispr-form", inputs: { config: "config", form: "form", value: "value" }, outputs: { submitted: "submitted", valueChanges: "valueChanges", statusChanges: "statusChanges" }, viewQueries: [{ propertyName: "submitTrigger", first: true, predicate: ["submitTrigger"], descendants: true }], ngImport: i0, template: "<form\n class=\"crispr-form\"\n [ngClass]=\"config.classes\"\n [formGroup]=\"form\"\n (ngSubmit)=\"handleSubmit()\"\n [autocomplete]=\"config.autocomplete || 'off'\"\n [errorDictionary]=\"config.errorDictionary\"\n #ngFormElement=\"ngForm\">\n\n <ng-container\n *ngFor=\"let field of config.fields;\"\n crisprField\n [value]=\"value | initialControlValue : field\"\n [config]=\"field\"\n [group]=\"form\">\n </ng-container>\n <!-- Hidden button, programmatically clicked when crispr form triggerSubmit function called.\n Uses a hidden button with type=\"submit\" because it will trigger both native form submit event\n (which the error handler has to listen for) and ngSubmit event -->\n <button #submitTrigger class=\"submit-trigger\" type=\"submit\">\n </button>\n</form>\n", styles: [".submit-trigger{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "value"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7$1.ControlErrorsFormDirective, selector: "form", inputs: ["errorDictionary"] }, { kind: "directive", type: i7$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "ngmodule", type: CrisprPipesModule }, { kind: "pipe", type: InitialControlValuePipe, name: "initialControlValue" }], preserveWhitespaces: true });
172
+ CrisprFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: CrisprFormComponent, isStandalone: true, selector: "crispr-form", inputs: { config: "config", form: "form", value: "value" }, outputs: { submitted: "submitted", valueChanges: "valueChanges", statusChanges: "statusChanges" }, viewQueries: [{ propertyName: "submitTrigger", first: true, predicate: ["submitTrigger"], descendants: true }], ngImport: i0, template: "<form\n class=\"crispr-form\"\n [ngClass]=\"config.classes\"\n [formGroup]=\"form\"\n (ngSubmit)=\"handleSubmit()\"\n [autocomplete]=\"config.autocomplete || 'off'\"\n [errorDictionary]=\"config.errorDictionary\"\n #ngFormElement=\"ngForm\">\n\n <ng-container\n *ngFor=\"let field of config.fields;\"\n crisprField\n [value]=\"value | initialControlValue : field\"\n [config]=\"field\"\n [group]=\"form\">\n </ng-container>\n <!-- Hidden button, programmatically clicked when crispr form triggerSubmit function called.\n Uses a hidden button with type=\"submit\" because it will trigger both native form submit event\n (which the error handler has to listen for) and ngSubmit event -->\n <button #submitTrigger class=\"submit-trigger\" type=\"submit\">\n </button>\n</form>\n", styles: [".submit-trigger{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "value"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i3$1.ControlErrorsFormDirective, selector: "form", inputs: ["errorDictionary"] }, { kind: "directive", type: i3$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "ngmodule", type: CrisprPipesModule }, { kind: "pipe", type: InitialControlValuePipe, name: "initialControlValue" }], preserveWhitespaces: true });
1496
173
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CrisprFormComponent, decorators: [{
1497
174
  type: Component,
1498
175
  args: [{ selector: 'crispr-form', standalone: true, imports: [
@@ -1578,7 +255,7 @@ class FormGroupListComponent extends FormGroupListMixin {
1578
255
  }
1579
256
  }
1580
257
  FormGroupListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FormGroupListComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1581
- FormGroupListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: FormGroupListComponent, isStandalone: true, selector: "crispr-form-group-list", usesInheritance: true, ngImport: i0, template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [formGroup]=\"group\">\n\n <div [formArrayName]=\"config.controlName\">\n <!-- Don't add trackBy function, it confuses the state of the array -->\n <div *ngFor=\"let con of control?.controls; let i = index;\">\n <!-- TODO: use content projection to allow custom item label component -->\n <div class=\"item-header\">\n <span class=\"mat-h2\"> {{ config.itemLabelBuilder ? config.itemLabelBuilder(i) : 'Item ' + (i + 1) }} </span>\n <button\n mat-icon-button\n type=\"button\"\n *ngIf=\"i + 1 > config.minListLength\">\n <mat-icon (click)=\"clickDelete(i)\">delete</mat-icon>\n </button>\n </div>\n <div\n [formGroup]=\"con\">\n <!-- TODO: if chiplists didn't need to have labels mixed in with their values we could use [value]=\"control.value\" below -->\n <ng-container\n *ngFor=\"let field of config.itemConfig.fields;\"\n crisprField\n [value]=\"blockValue ? null : value && value[i] | initialControlValue : field\"\n [config]=\"field\"\n [group]=\"con\">\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"group-footer\">\n <button\n type=\"button\"\n class=\"add\"\n mat-raised-button\n [color]=\"config.addButtonColor\"\n (click)=\"clickAdd()\">\n {{config.addItemLabel || config.addButtonLabel}}\n </button>\n </div>\n\n</crispr-field-container>\n", styles: [".item-header{display:flex;justify-content:space-between}.group-footer{display:flex;justify-content:flex-end}.group-footer button.add{margin-bottom:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "value"] }, { kind: "ngmodule", type: CrisprPipesModule }, { kind: "pipe", type: InitialControlValuePipe, name: "initialControlValue" }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
258
+ FormGroupListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: FormGroupListComponent, isStandalone: true, selector: "crispr-form-group-list", usesInheritance: true, ngImport: i0, template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [formGroup]=\"group\">\n\n <div [formArrayName]=\"config.controlName\">\n <!-- Don't add trackBy function, it confuses the state of the array -->\n <div *ngFor=\"let con of control?.controls; let i = index;\">\n <!-- TODO: use content projection to allow custom item label component -->\n <div class=\"item-header\">\n <span class=\"mat-h2\"> {{ config.itemLabelBuilder ? config.itemLabelBuilder(i) : 'Item ' + (i + 1) }} </span>\n <button\n mat-icon-button\n type=\"button\"\n *ngIf=\"i + 1 > config.minListLength\">\n <mat-icon (click)=\"clickDelete(i)\">delete</mat-icon>\n </button>\n </div>\n <div\n [formGroup]=\"con\">\n <!-- TODO: if chiplists didn't need to have labels mixed in with their values we could use [value]=\"control.value\" below -->\n <ng-container\n *ngFor=\"let field of config.itemConfig.fields;\"\n crisprField\n [value]=\"blockValue ? null : value && value[i] | initialControlValue : field\"\n [config]=\"field\"\n [group]=\"con\">\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"group-footer\">\n <button\n type=\"button\"\n class=\"add\"\n mat-raised-button\n [color]=\"config.addButtonColor\"\n (click)=\"clickAdd()\">\n {{config.addItemLabel || config.addButtonLabel}}\n </button>\n </div>\n\n</crispr-field-container>\n", styles: [".item-header{display:flex;justify-content:space-between}.group-footer{display:flex;justify-content:flex-end}.group-footer button.add{margin-bottom:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "value"] }, { kind: "ngmodule", type: CrisprPipesModule }, { kind: "pipe", type: InitialControlValuePipe, name: "initialControlValue" }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i3$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
1582
259
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FormGroupListComponent, decorators: [{
1583
260
  type: Component,
1584
261
  args: [{ selector: 'crispr-form-group-list', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
@@ -1605,7 +282,7 @@ class SubGroupComponent extends FormGroupMixin {
1605
282
  }
1606
283
  }
1607
284
  SubGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SubGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1608
- SubGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SubGroupComponent, selector: "crispr-sub-group", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <ng-container\n *ngFor=\"let fieldConfig of config.fields;\"\n crisprField\n [value]=\"value | initialControlValue : fieldConfig\"\n [config]=\"fieldConfig\"\n [group]=\"control\">\n </ng-container>\n</crispr-field-container>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "value"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "pipe", type: InitialControlValuePipe, name: "initialControlValue" }], preserveWhitespaces: true });
285
+ SubGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SubGroupComponent, selector: "crispr-sub-group", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <ng-container\n *ngFor=\"let fieldConfig of config.fields;\"\n crisprField\n [value]=\"value | initialControlValue : fieldConfig\"\n [config]=\"fieldConfig\"\n [group]=\"control\">\n </ng-container>\n</crispr-field-container>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "value"] }, { kind: "component", type: i3.FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "pipe", type: InitialControlValuePipe, name: "initialControlValue" }], preserveWhitespaces: true });
1609
286
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SubGroupComponent, decorators: [{
1610
287
  type: Component,
1611
288
  args: [{ selector: 'crispr-sub-group', template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <ng-container\n *ngFor=\"let fieldConfig of config.fields;\"\n crisprField\n [value]=\"value | initialControlValue : fieldConfig\"\n [config]=\"fieldConfig\"\n [group]=\"control\">\n </ng-container>\n</crispr-field-container>\n\n" }]
@@ -1698,5 +375,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImpor
1698
375
  * Generated bundle index. Do not edit.
1699
376
  */
1700
377
 
1701
- export { AbstractAutocompleteComponent, AutocompleteChiplistFieldComponent, AutocompleteFieldComponent, ButtonComponent, CheckboxFieldComponent, ControlType, CrisprFieldComponent, CrisprFormComponent, CrisprFormsModule, DEFAULT_EMPTY_OPTIONS_MESSAGE, DatepickerFieldComponent, DividerComponent, FieldContainerComponent, FileDropzoneDirective, FileUploadFieldComponent, HeadingComponent, ImageUploadFieldComponent, InputFieldComponent, OptionComponent, RadioFieldComponent, SelectFieldComponent, SliderFieldComponent, TextareaFieldComponent, UnitConversionFieldComponent, allowedFileExtValidator, allowedFileType, buildFormGroupFromConfig, callOptionsIfFunction, checkControlForValues, checkControlsForValues, computeValueFromFields, createControlForType, crisprControlMixin, filterOptionsByLabel, isControlConfig, maxFileSizeValidator, observablifyOptions };
378
+ export { CrisprFormComponent, CrisprFormsModule };
1702
379
  //# sourceMappingURL=tft-crispr-forms.mjs.map