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