@tft/crispr-forms 13.0.23 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/README.md +77 -76
  2. package/esm2020/public-api.mjs +5 -0
  3. package/esm2020/src/index.mjs +2 -0
  4. package/esm2020/src/lib/crispr-forms.module.mjs +57 -0
  5. package/esm2020/src/lib/field-component-map.const.mjs +27 -0
  6. package/esm2020/src/lib/field.directive.mjs +69 -0
  7. package/esm2020/src/lib/form/form.component.mjs +63 -0
  8. package/esm2020/src/lib/form-group-list/form-group-list.component.mjs +93 -0
  9. package/esm2020/src/lib/form-group-list/index.mjs +2 -0
  10. package/esm2020/src/lib/pipes/crispr-pipes.module.mjs +24 -0
  11. package/esm2020/src/lib/pipes/initial-control-value.pipe.mjs +21 -0
  12. package/esm2020/src/lib/public_api.mjs +3 -0
  13. package/esm2020/src/lib/sub-group/index.mjs +3 -0
  14. package/esm2020/src/lib/sub-group/sub-group.component.mjs +21 -0
  15. package/esm2020/src/lib/sub-group/sub-group.module.mjs +42 -0
  16. package/esm2020/tft-crispr-forms.mjs +2 -2
  17. package/esm2020/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +130 -0
  18. package/esm2020/ui/autocomplete-chiplist-field/public-api.mjs +2 -0
  19. package/esm2020/ui/autocomplete-chiplist-field/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +5 -0
  20. package/esm2020/ui/autocomplete-field/autocomplete-field.component.mjs +93 -0
  21. package/esm2020/ui/autocomplete-field/public-api.mjs +2 -0
  22. package/esm2020/ui/autocomplete-field/tft-crispr-forms-ui-autocomplete-field.mjs +5 -0
  23. package/esm2020/ui/button/button.component.mjs +49 -0
  24. package/esm2020/ui/button/public-api.mjs +2 -0
  25. package/esm2020/ui/button/tft-crispr-forms-ui-button.mjs +5 -0
  26. package/esm2020/ui/checkbox-field/checkbox-field.component.mjs +42 -0
  27. package/esm2020/ui/checkbox-field/public-api.mjs +2 -0
  28. package/esm2020/ui/checkbox-field/tft-crispr-forms-ui-checkbox-field.mjs +5 -0
  29. package/esm2020/ui/datepicker-field/datepicker-field.component.mjs +63 -0
  30. package/esm2020/ui/datepicker-field/public-api.mjs +2 -0
  31. package/esm2020/ui/datepicker-field/tft-crispr-forms-ui-datepicker-field.mjs +5 -0
  32. package/esm2020/ui/divider/divider.component.mjs +28 -0
  33. package/esm2020/ui/divider/public-api.mjs +2 -0
  34. package/esm2020/ui/divider/tft-crispr-forms-ui-divider.mjs +5 -0
  35. package/esm2020/ui/field-container/field-container.component.mjs +58 -0
  36. package/esm2020/ui/field-container/public-api.mjs +2 -0
  37. package/esm2020/ui/field-container/tft-crispr-forms-ui-field-container.mjs +5 -0
  38. package/esm2020/ui/file-dropzone/file-dropzone.directive.mjs +40 -0
  39. package/esm2020/ui/file-dropzone/public-api.mjs +2 -0
  40. package/esm2020/ui/file-dropzone/tft-crispr-forms-ui-file-dropzone.mjs +5 -0
  41. package/esm2020/ui/file-upload-field/file-upload-field.component.mjs +108 -0
  42. package/esm2020/ui/file-upload-field/public-api.mjs +2 -0
  43. package/esm2020/ui/file-upload-field/tft-crispr-forms-ui-file-upload-field.mjs +5 -0
  44. package/esm2020/ui/heading/heading.component.mjs +31 -0
  45. package/esm2020/ui/heading/public-api.mjs +2 -0
  46. package/esm2020/ui/heading/tft-crispr-forms-ui-heading.mjs +5 -0
  47. package/esm2020/ui/image-upload-field/image-upload-field.component.mjs +179 -0
  48. package/esm2020/ui/image-upload-field/public-api.mjs +2 -0
  49. package/esm2020/ui/image-upload-field/tft-crispr-forms-ui-image-upload-field.mjs +5 -0
  50. package/esm2020/ui/info/info.component.mjs +23 -0
  51. package/esm2020/ui/info/public-api.mjs +2 -0
  52. package/esm2020/ui/info/tft-crispr-forms-ui-info.mjs +5 -0
  53. package/esm2020/ui/input-field/input-field.component.mjs +41 -0
  54. package/esm2020/ui/input-field/public-api.mjs +2 -0
  55. package/esm2020/ui/input-field/tft-crispr-forms-ui-input-field.mjs +5 -0
  56. package/esm2020/ui/option/option.component.mjs +19 -0
  57. package/esm2020/ui/option/public-api.mjs +2 -0
  58. package/esm2020/ui/option/tft-crispr-forms-ui-option.mjs +5 -0
  59. package/esm2020/ui/public-api.mjs +7 -0
  60. package/esm2020/ui/radio-field/public-api.mjs +2 -0
  61. package/esm2020/ui/radio-field/radio-field.component.mjs +39 -0
  62. package/esm2020/ui/radio-field/tft-crispr-forms-ui-radio-field.mjs +5 -0
  63. package/esm2020/ui/select-field/public-api.mjs +2 -0
  64. package/esm2020/ui/select-field/select-field.component.mjs +73 -0
  65. package/esm2020/ui/select-field/tft-crispr-forms-ui-select-field.mjs +5 -0
  66. package/esm2020/ui/selected-file/public-api.mjs +2 -0
  67. package/esm2020/ui/selected-file/selected-file.component.mjs +26 -0
  68. package/esm2020/ui/selected-file/tft-crispr-forms-ui-selected-file.mjs +5 -0
  69. package/esm2020/ui/slider-field/public-api.mjs +2 -0
  70. package/esm2020/ui/slider-field/slider-field.component.mjs +44 -0
  71. package/esm2020/ui/slider-field/tft-crispr-forms-ui-slider-field.mjs +5 -0
  72. package/esm2020/ui/textarea-field/public-api.mjs +2 -0
  73. package/esm2020/ui/textarea-field/textarea-field.component.mjs +42 -0
  74. package/esm2020/ui/textarea-field/tft-crispr-forms-ui-textarea-field.mjs +5 -0
  75. package/esm2020/ui/tft-crispr-forms-ui.mjs +5 -0
  76. package/esm2020/ui/unit-conversion-field/public-api.mjs +2 -0
  77. package/esm2020/ui/unit-conversion-field/tft-crispr-forms-ui-unit-conversion-field.mjs +5 -0
  78. package/esm2020/ui/unit-conversion-field/unit-conversion-field.component.mjs +84 -0
  79. package/esm2020/utils/abstracts/autocomplete-field.abstract.mjs +30 -0
  80. package/esm2020/utils/abstracts/crispr-control.mixin.mjs +27 -0
  81. package/esm2020/utils/abstracts/crispr-field.abstract.mjs +20 -0
  82. package/esm2020/utils/abstracts/index.mjs +4 -0
  83. package/esm2020/utils/functions/buildFormGroupFromConfig.mjs +28 -0
  84. package/esm2020/utils/functions/callOptionsIfFunction.mjs +4 -0
  85. package/esm2020/utils/functions/createControlForType.mjs +19 -0
  86. package/esm2020/utils/functions/filterOptionsByLabel.mjs +11 -0
  87. package/esm2020/utils/functions/image-compression.helpers.mjs +50 -0
  88. package/esm2020/utils/functions/index.mjs +8 -0
  89. package/esm2020/utils/functions/isControlConfig.mjs +7 -0
  90. package/esm2020/utils/functions/observablifyOptions.mjs +29 -0
  91. package/esm2020/utils/models/autocomplete-chiplist-field.config.mjs +2 -0
  92. package/esm2020/utils/models/autocomplete-field.config.mjs +2 -0
  93. package/esm2020/utils/models/button.config.mjs +2 -0
  94. package/esm2020/utils/models/checkbox-field.config.mjs +2 -0
  95. package/esm2020/utils/models/crispr-field.config.mjs +23 -0
  96. package/esm2020/utils/models/datepicker-field.config.mjs +2 -0
  97. package/esm2020/utils/models/divider.config.mjs +2 -0
  98. package/esm2020/utils/models/file-upload-field.config.mjs +2 -0
  99. package/esm2020/utils/models/form-group-list.config.mjs +2 -0
  100. package/esm2020/utils/models/heading.config.mjs +3 -0
  101. package/esm2020/utils/models/image-upload-field.config.mjs +2 -0
  102. package/esm2020/utils/models/index.mjs +18 -0
  103. package/esm2020/utils/models/input-field.config.mjs +2 -0
  104. package/esm2020/utils/models/radio-field.config.mjs +2 -0
  105. package/esm2020/utils/models/select-field.config.mjs +2 -0
  106. package/esm2020/utils/models/slider-field.config.mjs +2 -0
  107. package/esm2020/utils/models/textarea-field.config.mjs +2 -0
  108. package/esm2020/utils/models/unit-conversion-field.config.mjs +2 -0
  109. package/esm2020/utils/operators/form.operators.mjs +24 -0
  110. package/esm2020/utils/operators/index.mjs +2 -0
  111. package/esm2020/utils/public-api.mjs +5 -0
  112. package/esm2020/utils/tft-crispr-forms-utils.mjs +5 -0
  113. package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +138 -0
  114. package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +1 -0
  115. package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs +101 -0
  116. package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs.map +1 -0
  117. package/fesm2015/tft-crispr-forms-ui-button.mjs +55 -0
  118. package/fesm2015/tft-crispr-forms-ui-button.mjs.map +1 -0
  119. package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs +49 -0
  120. package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs.map +1 -0
  121. package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs +71 -0
  122. package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs.map +1 -0
  123. package/fesm2015/tft-crispr-forms-ui-divider.mjs +34 -0
  124. package/fesm2015/tft-crispr-forms-ui-divider.mjs.map +1 -0
  125. package/fesm2015/tft-crispr-forms-ui-field-container.mjs +64 -0
  126. package/fesm2015/tft-crispr-forms-ui-field-container.mjs.map +1 -0
  127. package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs +47 -0
  128. package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs.map +1 -0
  129. package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs +117 -0
  130. package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs.map +1 -0
  131. package/fesm2015/tft-crispr-forms-ui-heading.mjs +37 -0
  132. package/fesm2015/tft-crispr-forms-ui-heading.mjs.map +1 -0
  133. package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs +182 -0
  134. package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs.map +1 -0
  135. package/fesm2015/tft-crispr-forms-ui-info.mjs +30 -0
  136. package/fesm2015/tft-crispr-forms-ui-info.mjs.map +1 -0
  137. package/fesm2015/tft-crispr-forms-ui-input-field.mjs +48 -0
  138. package/fesm2015/tft-crispr-forms-ui-input-field.mjs.map +1 -0
  139. package/fesm2015/tft-crispr-forms-ui-option.mjs +26 -0
  140. package/fesm2015/tft-crispr-forms-ui-option.mjs.map +1 -0
  141. package/fesm2015/tft-crispr-forms-ui-radio-field.mjs +46 -0
  142. package/fesm2015/tft-crispr-forms-ui-radio-field.mjs.map +1 -0
  143. package/fesm2015/tft-crispr-forms-ui-select-field.mjs +81 -0
  144. package/fesm2015/tft-crispr-forms-ui-select-field.mjs.map +1 -0
  145. package/fesm2015/tft-crispr-forms-ui-selected-file.mjs +33 -0
  146. package/fesm2015/tft-crispr-forms-ui-selected-file.mjs.map +1 -0
  147. package/fesm2015/tft-crispr-forms-ui-slider-field.mjs +51 -0
  148. package/fesm2015/tft-crispr-forms-ui-slider-field.mjs.map +1 -0
  149. package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs +49 -0
  150. package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs.map +1 -0
  151. package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs +93 -0
  152. package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs.map +1 -0
  153. package/fesm2015/tft-crispr-forms-ui.mjs +12 -0
  154. package/fesm2015/tft-crispr-forms-ui.mjs.map +1 -0
  155. package/fesm2015/tft-crispr-forms-utils.mjs +270 -0
  156. package/fesm2015/tft-crispr-forms-utils.mjs.map +1 -0
  157. package/fesm2015/tft-crispr-forms.mjs +117 -1730
  158. package/fesm2015/tft-crispr-forms.mjs.map +1 -1
  159. package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +137 -0
  160. package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +1 -0
  161. package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs +100 -0
  162. package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs.map +1 -0
  163. package/fesm2020/tft-crispr-forms-ui-button.mjs +55 -0
  164. package/fesm2020/tft-crispr-forms-ui-button.mjs.map +1 -0
  165. package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs +49 -0
  166. package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs.map +1 -0
  167. package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs +70 -0
  168. package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs.map +1 -0
  169. package/fesm2020/tft-crispr-forms-ui-divider.mjs +34 -0
  170. package/fesm2020/tft-crispr-forms-ui-divider.mjs.map +1 -0
  171. package/fesm2020/tft-crispr-forms-ui-field-container.mjs +65 -0
  172. package/fesm2020/tft-crispr-forms-ui-field-container.mjs.map +1 -0
  173. package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs +47 -0
  174. package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs.map +1 -0
  175. package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs +115 -0
  176. package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs.map +1 -0
  177. package/fesm2020/tft-crispr-forms-ui-heading.mjs +37 -0
  178. package/fesm2020/tft-crispr-forms-ui-heading.mjs.map +1 -0
  179. package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs +185 -0
  180. package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs.map +1 -0
  181. package/fesm2020/tft-crispr-forms-ui-info.mjs +30 -0
  182. package/fesm2020/tft-crispr-forms-ui-info.mjs.map +1 -0
  183. package/fesm2020/tft-crispr-forms-ui-input-field.mjs +48 -0
  184. package/fesm2020/tft-crispr-forms-ui-input-field.mjs.map +1 -0
  185. package/fesm2020/tft-crispr-forms-ui-option.mjs +26 -0
  186. package/fesm2020/tft-crispr-forms-ui-option.mjs.map +1 -0
  187. package/fesm2020/tft-crispr-forms-ui-radio-field.mjs +46 -0
  188. package/fesm2020/tft-crispr-forms-ui-radio-field.mjs.map +1 -0
  189. package/fesm2020/tft-crispr-forms-ui-select-field.mjs +80 -0
  190. package/fesm2020/tft-crispr-forms-ui-select-field.mjs.map +1 -0
  191. package/fesm2020/tft-crispr-forms-ui-selected-file.mjs +33 -0
  192. package/fesm2020/tft-crispr-forms-ui-selected-file.mjs.map +1 -0
  193. package/fesm2020/tft-crispr-forms-ui-slider-field.mjs +51 -0
  194. package/fesm2020/tft-crispr-forms-ui-slider-field.mjs.map +1 -0
  195. package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs +49 -0
  196. package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs.map +1 -0
  197. package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs +91 -0
  198. package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs.map +1 -0
  199. package/fesm2020/tft-crispr-forms-ui.mjs +12 -0
  200. package/fesm2020/tft-crispr-forms-ui.mjs.map +1 -0
  201. package/fesm2020/tft-crispr-forms-utils.mjs +269 -0
  202. package/fesm2020/tft-crispr-forms-utils.mjs.map +1 -0
  203. package/fesm2020/tft-crispr-forms.mjs +117 -1723
  204. package/fesm2020/tft-crispr-forms.mjs.map +1 -1
  205. package/index.d.ts +5 -1
  206. package/package.json +188 -15
  207. package/public-api.d.ts +3 -0
  208. package/src/index.d.ts +1 -0
  209. package/src/lib/crispr-forms.module.d.ts +15 -0
  210. package/src/lib/field-component-map.const.d.ts +42 -0
  211. package/{lib → src/lib}/field.directive.d.ts +4 -10
  212. package/{lib → src/lib}/form/form.component.d.ts +3 -3
  213. package/{lib → src/lib}/form-group-list/form-group-list.component.d.ts +12 -14
  214. package/{lib → src/lib}/form-group-list/index.d.ts +0 -1
  215. package/{lib → src/lib}/pipes/crispr-pipes.module.d.ts +0 -0
  216. package/{lib → src/lib}/pipes/initial-control-value.pipe.d.ts +2 -2
  217. package/src/lib/public_api.d.ts +2 -0
  218. package/{lib → src/lib}/sub-group/index.d.ts +0 -0
  219. package/src/lib/sub-group/sub-group.component.d.ts +22 -0
  220. package/{lib → src/lib}/sub-group/sub-group.module.d.ts +2 -2
  221. package/tft-crispr-forms-14.0.0.tgz +0 -0
  222. package/ui/README.md +3 -0
  223. package/{lib/material → ui}/autocomplete-chiplist-field/autocomplete-chiplist-field.component.d.ts +2 -3
  224. package/ui/autocomplete-chiplist-field/index.d.ts +5 -0
  225. package/ui/autocomplete-chiplist-field/public-api.d.ts +1 -0
  226. package/{lib/material → ui}/autocomplete-field/autocomplete-field.component.d.ts +2 -3
  227. package/ui/autocomplete-field/index.d.ts +5 -0
  228. package/ui/autocomplete-field/public-api.d.ts +1 -0
  229. package/{lib/material → ui}/button/button.component.d.ts +2 -3
  230. package/ui/button/index.d.ts +5 -0
  231. package/ui/button/public-api.d.ts +1 -0
  232. package/ui/checkbox-field/checkbox-field.component.d.ts +21 -0
  233. package/ui/checkbox-field/index.d.ts +5 -0
  234. package/ui/checkbox-field/public-api.d.ts +1 -0
  235. package/{lib/material → ui}/datepicker-field/datepicker-field.component.d.ts +14 -17
  236. package/ui/datepicker-field/index.d.ts +5 -0
  237. package/ui/datepicker-field/public-api.d.ts +1 -0
  238. package/{lib/material → ui}/divider/divider.component.d.ts +2 -3
  239. package/ui/divider/index.d.ts +5 -0
  240. package/ui/divider/public-api.d.ts +1 -0
  241. package/{lib → ui}/field-container/field-container.component.d.ts +3 -10
  242. package/ui/field-container/index.d.ts +5 -0
  243. package/{lib/field-container/index.d.ts → ui/field-container/public-api.d.ts} +0 -0
  244. package/{lib/material/file-upload → ui/file-dropzone}/file-dropzone.directive.d.ts +1 -1
  245. package/ui/file-dropzone/index.d.ts +5 -0
  246. package/{lib/material/file-upload/index.d.ts → ui/file-dropzone/public-api.d.ts} +0 -1
  247. package/ui/file-upload-field/file-upload-field.component.d.ts +37 -0
  248. package/ui/file-upload-field/index.d.ts +5 -0
  249. package/ui/file-upload-field/public-api.d.ts +1 -0
  250. package/ui/heading/heading.component.d.ts +8 -0
  251. package/ui/heading/index.d.ts +5 -0
  252. package/ui/heading/public-api.d.ts +1 -0
  253. package/ui/image-upload-field/image-upload-field.component.d.ts +48 -0
  254. package/ui/image-upload-field/index.d.ts +5 -0
  255. package/{lib/material/image-upload-field/index.d.ts → ui/image-upload-field/public-api.d.ts} +0 -0
  256. package/ui/index.d.ts +5 -0
  257. package/ui/info/index.d.ts +5 -0
  258. package/ui/info/info.component.d.ts +7 -0
  259. package/ui/info/public-api.d.ts +1 -0
  260. package/ui/input-field/index.d.ts +5 -0
  261. package/ui/input-field/input-field.component.d.ts +22 -0
  262. package/ui/input-field/public-api.d.ts +1 -0
  263. package/ui/option/index.d.ts +5 -0
  264. package/{lib/material → ui}/option/option.component.d.ts +2 -2
  265. package/{lib/material/option/index.d.ts → ui/option/public-api.d.ts} +0 -0
  266. package/ui/public-api.d.ts +5 -0
  267. package/ui/radio-field/index.d.ts +5 -0
  268. package/ui/radio-field/public-api.d.ts +1 -0
  269. package/ui/radio-field/radio-field.component.d.ts +23 -0
  270. package/ui/select-field/index.d.ts +5 -0
  271. package/ui/select-field/public-api.d.ts +1 -0
  272. package/{lib/material → ui}/select-field/select-field.component.d.ts +12 -14
  273. package/ui/selected-file/index.d.ts +5 -0
  274. package/ui/selected-file/public-api.d.ts +1 -0
  275. package/ui/selected-file/selected-file.component.d.ts +10 -0
  276. package/ui/slider-field/index.d.ts +5 -0
  277. package/ui/slider-field/public-api.d.ts +1 -0
  278. package/ui/slider-field/slider-field.component.d.ts +25 -0
  279. package/ui/textarea-field/index.d.ts +5 -0
  280. package/ui/textarea-field/public-api.d.ts +1 -0
  281. package/ui/textarea-field/textarea-field.component.d.ts +21 -0
  282. package/ui/unit-conversion-field/index.d.ts +5 -0
  283. package/ui/unit-conversion-field/public-api.d.ts +1 -0
  284. package/{lib/material → ui}/unit-conversion-field/unit-conversion-field.component.d.ts +14 -17
  285. package/utils/README.md +3 -0
  286. package/{lib → utils}/abstracts/autocomplete-field.abstract.d.ts +4 -4
  287. package/{lib → utils}/abstracts/crispr-control.mixin.d.ts +0 -0
  288. package/{lib → utils}/abstracts/crispr-field.abstract.d.ts +1 -1
  289. package/{lib → utils}/abstracts/index.d.ts +0 -0
  290. package/utils/functions/buildFormGroupFromConfig.d.ts +9 -0
  291. package/utils/functions/callOptionsIfFunction.d.ts +3 -0
  292. package/utils/functions/createControlForType.d.ts +9 -0
  293. package/utils/functions/filterOptionsByLabel.d.ts +7 -0
  294. package/utils/functions/image-compression.helpers.d.ts +5 -0
  295. package/utils/functions/index.d.ts +7 -0
  296. package/utils/functions/isControlConfig.d.ts +5 -0
  297. package/utils/functions/observablifyOptions.d.ts +12 -0
  298. package/utils/index.d.ts +5 -0
  299. package/{lib → utils}/models/autocomplete-chiplist-field.config.d.ts +2 -1
  300. package/{lib → utils}/models/autocomplete-field.config.d.ts +1 -2
  301. package/{lib → utils}/models/button.config.d.ts +0 -0
  302. package/{lib → utils}/models/checkbox-field.config.d.ts +1 -2
  303. package/{lib → utils}/models/crispr-field.config.d.ts +5 -7
  304. package/{lib → utils}/models/datepicker-field.config.d.ts +4 -6
  305. package/{lib → utils}/models/divider.config.d.ts +1 -1
  306. package/{lib → utils}/models/file-upload-field.config.d.ts +9 -4
  307. package/{lib → utils}/models/form-group-list.config.d.ts +1 -2
  308. package/{lib → utils}/models/heading.config.d.ts +1 -2
  309. package/{lib → utils}/models/image-upload-field.config.d.ts +2 -1
  310. package/{lib → utils}/models/index.d.ts +0 -0
  311. package/{lib → utils}/models/input-field.config.d.ts +1 -2
  312. package/{lib → utils}/models/radio-field.config.d.ts +0 -0
  313. package/{lib → utils}/models/select-field.config.d.ts +1 -2
  314. package/{lib → utils}/models/slider-field.config.d.ts +1 -2
  315. package/{lib → utils}/models/textarea-field.config.d.ts +1 -2
  316. package/{lib → utils}/models/unit-conversion-field.config.d.ts +1 -2
  317. package/{lib → utils/operators}/form.operators.d.ts +0 -0
  318. package/utils/operators/index.d.ts +1 -0
  319. package/utils/public-api.d.ts +4 -0
  320. package/esm2020/index.mjs +0 -2
  321. package/esm2020/lib/abstracts/autocomplete-field.abstract.mjs +0 -30
  322. package/esm2020/lib/abstracts/crispr-control.mixin.mjs +0 -27
  323. package/esm2020/lib/abstracts/crispr-field.abstract.mjs +0 -17
  324. package/esm2020/lib/abstracts/index.mjs +0 -4
  325. package/esm2020/lib/crispr-forms.module.mjs +0 -66
  326. package/esm2020/lib/field-component-map.const.mjs +0 -28
  327. package/esm2020/lib/field-container/field-container.component.mjs +0 -85
  328. package/esm2020/lib/field-container/index.mjs +0 -2
  329. package/esm2020/lib/field.directive.mjs +0 -90
  330. package/esm2020/lib/form/form.component.mjs +0 -53
  331. package/esm2020/lib/form-group-list/form-group-list.component.mjs +0 -77
  332. package/esm2020/lib/form-group-list/form-group-list.module.mjs +0 -54
  333. package/esm2020/lib/form-group-list/index.mjs +0 -3
  334. package/esm2020/lib/form.helpers.mjs +0 -190
  335. package/esm2020/lib/form.operators.mjs +0 -24
  336. package/esm2020/lib/material/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +0 -111
  337. package/esm2020/lib/material/autocomplete-field/autocomplete-field.component.mjs +0 -78
  338. package/esm2020/lib/material/button/button.component.mjs +0 -35
  339. package/esm2020/lib/material/checkbox-field/checkbox-field.component.mjs +0 -31
  340. package/esm2020/lib/material/datepicker-field/datepicker-field.component.mjs +0 -45
  341. package/esm2020/lib/material/divider/divider.component.mjs +0 -22
  342. package/esm2020/lib/material/file-upload/file-dropzone.directive.mjs +0 -39
  343. package/esm2020/lib/material/file-upload/file-upload.component.mjs +0 -145
  344. package/esm2020/lib/material/file-upload/index.mjs +0 -3
  345. package/esm2020/lib/material/heading/heading.component.mjs +0 -54
  346. package/esm2020/lib/material/image-upload-field/image-compression.helpers.mjs +0 -4
  347. package/esm2020/lib/material/image-upload-field/image-upload-field.component.mjs +0 -265
  348. package/esm2020/lib/material/image-upload-field/index.mjs +0 -2
  349. package/esm2020/lib/material/index.mjs +0 -18
  350. package/esm2020/lib/material/info/info.component.mjs +0 -46
  351. package/esm2020/lib/material/input-field/input-field.component.mjs +0 -27
  352. package/esm2020/lib/material/material.module.mjs +0 -200
  353. package/esm2020/lib/material/option/index.mjs +0 -2
  354. package/esm2020/lib/material/option/option.component.mjs +0 -15
  355. package/esm2020/lib/material/radio-field/radio-field.component.mjs +0 -29
  356. package/esm2020/lib/material/select-field/select-field.component.mjs +0 -58
  357. package/esm2020/lib/material/selected-file/selected-file.component.mjs +0 -47
  358. package/esm2020/lib/material/slider-field/slider-field.component.mjs +0 -30
  359. package/esm2020/lib/material/textarea-field/textarea-field.component.mjs +0 -28
  360. package/esm2020/lib/material/unit-conversion-field/unit-conversion-field.component.mjs +0 -69
  361. package/esm2020/lib/models/autocomplete-chiplist-field.config.mjs +0 -2
  362. package/esm2020/lib/models/autocomplete-field.config.mjs +0 -2
  363. package/esm2020/lib/models/button.config.mjs +0 -2
  364. package/esm2020/lib/models/checkbox-field.config.mjs +0 -2
  365. package/esm2020/lib/models/crispr-field.config.mjs +0 -23
  366. package/esm2020/lib/models/datepicker-field.config.mjs +0 -2
  367. package/esm2020/lib/models/divider.config.mjs +0 -2
  368. package/esm2020/lib/models/file-upload-field.config.mjs +0 -2
  369. package/esm2020/lib/models/form-group-list.config.mjs +0 -2
  370. package/esm2020/lib/models/heading.config.mjs +0 -3
  371. package/esm2020/lib/models/image-upload-field.config.mjs +0 -2
  372. package/esm2020/lib/models/index.mjs +0 -18
  373. package/esm2020/lib/models/input-field.config.mjs +0 -2
  374. package/esm2020/lib/models/radio-field.config.mjs +0 -2
  375. package/esm2020/lib/models/select-field.config.mjs +0 -2
  376. package/esm2020/lib/models/slider-field.config.mjs +0 -2
  377. package/esm2020/lib/models/textarea-field.config.mjs +0 -2
  378. package/esm2020/lib/models/unit-conversion-field.config.mjs +0 -2
  379. package/esm2020/lib/pipes/crispr-pipes.module.mjs +0 -26
  380. package/esm2020/lib/pipes/initial-control-value.pipe.mjs +0 -20
  381. package/esm2020/lib/public_api.mjs +0 -10
  382. package/esm2020/lib/sub-group/index.mjs +0 -3
  383. package/esm2020/lib/sub-group/sub-group.component.mjs +0 -20
  384. package/esm2020/lib/sub-group/sub-group.module.mjs +0 -45
  385. package/lib/crispr-forms.module.d.ts +0 -16
  386. package/lib/field-component-map.const.d.ts +0 -28
  387. package/lib/form-group-list/form-group-list.module.d.ts +0 -15
  388. package/lib/form.helpers.d.ts +0 -88
  389. package/lib/material/checkbox-field/checkbox-field.component.d.ts +0 -23
  390. package/lib/material/file-upload/file-upload.component.d.ts +0 -54
  391. package/lib/material/heading/heading.component.d.ts +0 -17
  392. package/lib/material/image-upload-field/image-compression.helpers.d.ts +0 -1
  393. package/lib/material/image-upload-field/image-upload-field.component.d.ts +0 -68
  394. package/lib/material/index.d.ts +0 -17
  395. package/lib/material/info/info.component.d.ts +0 -15
  396. package/lib/material/input-field/input-field.component.d.ts +0 -24
  397. package/lib/material/material.module.d.ts +0 -44
  398. package/lib/material/radio-field/radio-field.component.d.ts +0 -26
  399. package/lib/material/selected-file/selected-file.component.d.ts +0 -17
  400. package/lib/material/slider-field/slider-field.component.d.ts +0 -27
  401. package/lib/material/textarea-field/textarea-field.component.d.ts +0 -24
  402. package/lib/public_api.d.ts +0 -9
  403. package/lib/sub-group/sub-group.component.d.ts +0 -24
  404. package/tft-crispr-forms-13.0.23.tgz +0 -0
  405. package/tft-crispr-forms.d.ts +0 -5
@@ -0,0 +1,34 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component } from '@angular/core';
3
+ import * as i2 from '@angular/material/divider';
4
+ import { MatDividerModule } from '@angular/material/divider';
5
+ import * as i1 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+ import { CrisprFieldComponent } from '@tft/crispr-forms/utils';
8
+
9
+ class DividerComponent extends CrisprFieldComponent {
10
+ constructor() {
11
+ super(...arguments);
12
+ // TODO: pull in type after configs are better organized
13
+ this.defaultConfig = {};
14
+ }
15
+ ngOnInit() {
16
+ super.ngOnInit();
17
+ }
18
+ }
19
+ DividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
20
+ 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.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], preserveWhitespaces: true });
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, decorators: [{
22
+ type: Component,
23
+ args: [{ selector: 'crispr-divider', standalone: true, imports: [
24
+ CommonModule,
25
+ MatDividerModule
26
+ ], 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"] }]
27
+ }] });
28
+
29
+ /**
30
+ * Generated bundle index. Do not edit.
31
+ */
32
+
33
+ export { DividerComponent };
34
+ //# sourceMappingURL=tft-crispr-forms-ui-divider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tft-crispr-forms-ui-divider.mjs","sources":["../../../../libs/crispr-forms/ui/divider/divider.component.ts","../../../../libs/crispr-forms/ui/divider/divider.component.html","../../../../libs/crispr-forms/ui/divider/tft-crispr-forms-ui-divider.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { CommonModule } from '@angular/common';\n// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries\nimport { CrisprFieldComponent, DividerConfig } from '@tft/crispr-forms/utils';\n\n@Component({\n selector: 'crispr-divider',\n templateUrl: './divider.component.html',\n styleUrls: ['./divider.component.scss'],\n standalone: true,\n imports: [\n CommonModule,\n MatDividerModule\n ],\n})\nexport class DividerComponent extends CrisprFieldComponent<DividerConfig> implements OnInit {\n // TODO: pull in type after configs are better organized\n defaultConfig = {};\n ngOnInit() {\n super.ngOnInit();\n }\n\n}\n","<mat-divider [ngClass]=\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
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
3
+ import { of } from 'rxjs';
4
+ import '@angular/forms';
5
+ import { distinctUntilChanged, tap } from 'rxjs/operators';
6
+ import * as i1 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import { HeadingComponent } from '@tft/crispr-forms/ui/heading';
9
+
10
+ class FieldContainerComponent {
11
+ constructor() {
12
+ // boolean whether field-container is inline
13
+ this.inlineField = false;
14
+ this.subs = [];
15
+ }
16
+ ngOnInit() {
17
+ this.disabled$ = this.connectDisabledCallback(this.group, this.config);
18
+ // we tried moving this into afterViewChecked and afterContentChecked lifecycle hooks without any luck
19
+ if (this.config.computeValue) {
20
+ this.subs.push(this.config.computeValue(this.group).pipe(distinctUntilChanged(), tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))).subscribe());
21
+ }
22
+ }
23
+ ngOnDestroy() {
24
+ this.subs.forEach(sub => sub.unsubscribe);
25
+ }
26
+ /**
27
+ * Connects user defined disabledCallback function to the the view, so that the control is enabled/disabled
28
+ * appropriately. It also will hide disabled fields in the UI unless `hideDisabled` is set to
29
+ * false in the controls config
30
+ * @param group used to get valueChanges from control
31
+ * @param config configuration object used to
32
+ */
33
+ connectDisabledCallback(group, config = null) {
34
+ const control = group.get(config.controlName);
35
+ // If the disabled$ function exists on the field config then call it with the disabledCallbackConfig
36
+ // as a parameter otherwise return an observable of true.
37
+ return config?.disabledCallback && config.disabledCallback instanceof Function
38
+ ? config.disabledCallback(group).pipe(
39
+ // This enables/disables when callback conditions are met
40
+ tap((shouldDisable) => shouldDisable ? control.disable() : control.enable()))
41
+ : of(false);
42
+ }
43
+ }
44
+ FieldContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FieldContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
45
+ 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 });
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FieldContainerComponent, decorators: [{
47
+ type: Component,
48
+ args: [{ selector: 'crispr-field-container', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
49
+ CommonModule,
50
+ HeadingComponent,
51
+ ], 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"] }]
52
+ }], propDecorators: { config: [{
53
+ type: Input
54
+ }], group: [{
55
+ type: Input
56
+ }], inlineField: [{
57
+ type: Input
58
+ }] } });
59
+
60
+ /**
61
+ * Generated bundle index. Do not edit.
62
+ */
63
+
64
+ export { FieldContainerComponent };
65
+ //# sourceMappingURL=tft-crispr-forms-ui-field-container.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tft-crispr-forms-ui-field-container.mjs","sources":["../../../../libs/crispr-forms/ui/field-container/field-container.component.ts","../../../../libs/crispr-forms/ui/field-container/field-container.component.html","../../../../libs/crispr-forms/ui/field-container/tft-crispr-forms-ui-field-container.ts"],"sourcesContent":["import { Component, OnInit, Input, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { Observable, of, Subscription } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { tap, distinctUntilChanged } from 'rxjs/operators';\nimport { CommonModule } from '@angular/common';\nimport { HeadingComponent } from '@tft/crispr-forms/ui/heading';\n// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries\nimport type { CrisprControlConfig } from '@tft/crispr-forms/utils';\n\n@Component({\n selector: 'crispr-field-container',\n templateUrl: './field-container.component.html',\n styleUrls: ['./field-container.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n HeadingComponent,\n ],\n})\nexport class FieldContainerComponent implements OnInit, OnDestroy {\n // the configuration object for the field\n @Input() config: CrisprControlConfig;\n // the parent formGroup\n @Input() group: FormGroup;\n // boolean whether field-container is inline\n @Input() inlineField = false;\n // used to determine whether or not field should be shown\n disabled$: Observable<boolean>;\n\n subs: Subscription[] = [];\n\n ngOnInit() {\n this.disabled$ = this.connectDisabledCallback(this.group, this.config);\n // we tried moving this into afterViewChecked and afterContentChecked lifecycle hooks without any luck\n if (this.config.computeValue) {\n this.subs.push(\n this.config.computeValue(this.group).pipe(\n distinctUntilChanged(),\n tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))\n ).subscribe(),\n );\n }\n }\n\n ngOnDestroy(): void {\n this.subs.forEach(sub => sub.unsubscribe);\n }\n /**\n * Connects user defined disabledCallback function to the the view, so that the control is enabled/disabled\n * appropriately. It also will hide disabled fields in the UI unless `hideDisabled` is set to\n * false in the controls config\n * @param group used to get valueChanges from control\n * @param config configuration object used to\n */\n connectDisabledCallback(group: FormGroup, config: CrisprControlConfig = null) {\n const control = group.get(config.controlName);\n // If the disabled$ function exists on the field config then call it with the disabledCallbackConfig\n // as a parameter otherwise return an observable of true.\n return config?.disabledCallback && config.disabledCallback instanceof Function\n ? config.disabledCallback(group).pipe(\n // This enables/disables when callback conditions are met\n tap((shouldDisable) => shouldDisable ? control.disable() : control.enable())\n )\n : of(false);\n }\n}\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAoBa,uBAAuB,CAAA;AAXpC,IAAA,WAAA,GAAA;;QAiBW,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;QAI7B,IAAI,CAAA,IAAA,GAAmB,EAAE,CAAC;AAoC3B,KAAA;IAlCC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;;AAEvE,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CACZ,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CACvC,oBAAoB,EAAE,EACtB,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CACt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AA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAGP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAXnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wBAAwB,mBAGjB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,gBAAgB;AACjB,qBAAA,EAAA,QAAA,EAAA,oUAAA,EAAA,MAAA,EAAA,CAAA,6GAAA,CAAA,EAAA,CAAA;8BAIQ,MAAM,EAAA,CAAA;sBAAd,KAAK;gBAEG,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAEG,WAAW,EAAA,CAAA;sBAAnB,KAAK;;;AE1BR;;AAEG;;;;"}
@@ -0,0 +1,47 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Directive, Output, Input, HostListener } from '@angular/core';
3
+
4
+ class FileDropzoneDirective {
5
+ constructor() {
6
+ this.fileDrop = new EventEmitter();
7
+ this.crisprFileDropzone = true;
8
+ }
9
+ onDrop($event) {
10
+ if (this.crisprFileDropzone) {
11
+ $event.preventDefault();
12
+ this.fileDrop.emit($event.dataTransfer.files);
13
+ }
14
+ }
15
+ // Prevents DOM from trying to open file in browser
16
+ onDragOver($event) {
17
+ if (this.crisprFileDropzone) {
18
+ $event.preventDefault();
19
+ }
20
+ }
21
+ }
22
+ FileDropzoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileDropzoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
23
+ 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 });
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileDropzoneDirective, decorators: [{
25
+ type: Directive,
26
+ args: [{
27
+ selector: '[crisprFileDropzone]',
28
+ standalone: true,
29
+ }]
30
+ }], propDecorators: { fileDrop: [{
31
+ type: Output
32
+ }], crisprFileDropzone: [{
33
+ type: Input
34
+ }], onDrop: [{
35
+ type: HostListener,
36
+ args: ['drop', ['$event']]
37
+ }], onDragOver: [{
38
+ type: HostListener,
39
+ args: ['dragover', ['$event']]
40
+ }] } });
41
+
42
+ /**
43
+ * Generated bundle index. Do not edit.
44
+ */
45
+
46
+ export { FileDropzoneDirective };
47
+ //# sourceMappingURL=tft-crispr-forms-ui-file-dropzone.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tft-crispr-forms-ui-file-dropzone.mjs","sources":["../../../../libs/crispr-forms/ui/file-dropzone/file-dropzone.directive.ts","../../../../libs/crispr-forms/ui/file-dropzone/tft-crispr-forms-ui-file-dropzone.ts"],"sourcesContent":["import { Directive, HostListener, Output, EventEmitter, Input } from '@angular/core';\n\n@Directive({\n selector: '[crisprFileDropzone]',\n standalone: true,\n})\nexport class FileDropzoneDirective {\n\n @Output() fileDrop = new EventEmitter<FileList>();\n\n @Input() crisprFileDropzone = true;\n\n @HostListener('drop', ['$event'])\n onDrop($event: DragEvent) {\n if(this.crisprFileDropzone) {\n $event.preventDefault();\n this.fileDrop.emit($event.dataTransfer.files);\n }\n }\n\n // Prevents DOM from trying to open file in browser\n @HostListener('dragover', ['$event'])\n onDragOver($event: DragEvent) {\n if(this.crisprFileDropzone) {\n $event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,qBAAqB,CAAA;AAJlC,IAAA,WAAA,GAAA;AAMY,QAAA,I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,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAA;;;ACrBtC;;AAEG;;;;"}
@@ -0,0 +1,115 @@
1
+ import * as i2 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, Optional, Self, ViewChild } from '@angular/core';
5
+ import * as i1 from '@angular/forms';
6
+ import { ReactiveFormsModule } from '@angular/forms';
7
+ import * as i4 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import * as i5 from '@angular/material/form-field';
10
+ import { MatFormFieldModule } from '@angular/material/form-field';
11
+ import * as i3 from '@angular/material/icon';
12
+ import { MatIconModule } from '@angular/material/icon';
13
+ import * as i6 from '@angular/material/input';
14
+ import { MatInputModule } from '@angular/material/input';
15
+ import { of } from 'rxjs';
16
+ import { FileDropzoneDirective } from '@tft/crispr-forms/ui/file-dropzone';
17
+ import * as i7 from '@tft/form-validation-handler';
18
+ import { FormValidationHandlerModule } from '@tft/form-validation-handler';
19
+ import { crisprControlMixin, CrisprFieldComponent } from '@tft/crispr-forms/utils';
20
+ import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
21
+ import { SelectedFileComponent } from '@tft/crispr-forms/ui/selected-file';
22
+
23
+ /* eslint-disable @nrwl/nx/enforce-module-boundaries */
24
+ const FileUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
25
+ class FileUploadFieldComponent extends FileUploadFieldMixin {
26
+ // ngControl: NgControl = null;
27
+ constructor(ngControl) {
28
+ super();
29
+ this.ngControl = ngControl;
30
+ this.defaultConfig = {
31
+ allowMultipleFiles: false,
32
+ acceptedTypes: '*.*',
33
+ dropZoneText: 'DROP FILE HERE',
34
+ selectFilesButtonType: 'button',
35
+ selectButtonText: 'SELECT',
36
+ showClearFilesButton: true,
37
+ clearFilesButtonText: 'CLEAR',
38
+ uploadButtonText: 'UPLOAD',
39
+ uploadButtonType: 'button',
40
+ showUploadProgress: false,
41
+ disableOnUpload: true
42
+ };
43
+ this.isUploaded = false;
44
+ this.fileProgress = [];
45
+ if (this.ngControl != null) {
46
+ // Setting the value accessor directly (instead of using
47
+ // the providers) to avoid running into a circular import.
48
+ ngControl.valueAccessor = this;
49
+ }
50
+ }
51
+ ngOnInit() {
52
+ super.ngOnInit();
53
+ this.disabled$ = this.config.disabledCallback
54
+ ? this.config.disabledCallback(this.group)
55
+ : of(false);
56
+ }
57
+ filesChanged(files) {
58
+ if (files && files.length > 0) {
59
+ this.selectedFiles = files;
60
+ this.control.patchValue(files);
61
+ }
62
+ }
63
+ uploadFiles() {
64
+ if (this.selectedFiles && this.config.uploadFiles) {
65
+ this.isUploaded = true;
66
+ this.config.uploadFiles(this.group, this.selectedFiles, this);
67
+ }
68
+ }
69
+ resetFileInput() {
70
+ this.fileInputRef.nativeElement.value = '';
71
+ this.control.patchValue(null);
72
+ this.isUploaded = false;
73
+ }
74
+ writeValue(value) {
75
+ // clear file input
76
+ // this.host.nativeElement.value = '';
77
+ // this.file = null;
78
+ }
79
+ registerOnChange(fn) {
80
+ this.onChange = fn;
81
+ }
82
+ registerOnTouched(fn) {
83
+ }
84
+ }
85
+ FileUploadFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
86
+ 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: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.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: i4.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: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, decorators: [{
88
+ type: Component,
89
+ args: [{ selector: 'crispr-file-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
90
+ CommonModule,
91
+ FieldContainerComponent,
92
+ ReactiveFormsModule,
93
+ MatIconModule,
94
+ MatButtonModule,
95
+ MatFormFieldModule,
96
+ MatInputModule,
97
+ SelectedFileComponent,
98
+ FormValidationHandlerModule,
99
+ FileDropzoneDirective,
100
+ ], 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"] }]
101
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
102
+ type: Optional
103
+ }, {
104
+ type: Self
105
+ }] }]; }, propDecorators: { fileInputRef: [{
106
+ type: ViewChild,
107
+ args: ['fileInput']
108
+ }] } });
109
+
110
+ /**
111
+ * Generated bundle index. Do not edit.
112
+ */
113
+
114
+ export { FileUploadFieldComponent };
115
+ //# sourceMappingURL=tft-crispr-forms-ui-file-upload-field.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tft-crispr-forms-ui-file-upload-field.mjs","sources":["../../../../libs/crispr-forms/ui/file-upload-field/file-upload-field.component.ts","../../../../libs/crispr-forms/ui/file-upload-field/file-upload-field.component.html","../../../../libs/crispr-forms/ui/file-upload-field/tft-crispr-forms-ui-file-upload-field.ts"],"sourcesContent":["/* eslint-disable @nrwl/nx/enforce-module-boundaries */\nimport { CommonModule } from '@angular/common';\nimport {\n Component,\n ElementRef,\n ViewChild,\n OnInit,\n ChangeDetectionStrategy,\n Optional,\n Self,\n} from '@angular/core';\nimport { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { Observable, of } from 'rxjs';\nimport { FileDropzoneDirective } from '@tft/crispr-forms/ui/file-dropzone';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nimport { crisprControlMixin, CrisprFieldComponent, FileUploadFieldConfig } from '@tft/crispr-forms/utils';\nimport { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';\nimport { SelectedFileComponent } from '@tft/crispr-forms/ui/selected-file';\n\nconst FileUploadFieldMixin = crisprControlMixin<FileUploadFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-file-upload-field',\n templateUrl: './file-upload-field.component.html',\n styleUrls: ['./file-upload-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n FieldContainerComponent,\n ReactiveFormsModule,\n MatIconModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n SelectedFileComponent,\n FormValidationHandlerModule,\n FileDropzoneDirective,\n ],\n})\nexport class FileUploadFieldComponent extends FileUploadFieldMixin implements OnInit, ControlValueAccessor {\n\n onChange: () => void;\n\n defaultConfig: Partial<FileUploadFieldConfig> = {\n allowMultipleFiles: false,\n acceptedTypes: '*.*',\n dropZoneText: 'DROP FILE HERE',\n selectFilesButtonType: 'button',\n selectButtonText: 'SELECT',\n showClearFilesButton: true,\n clearFilesButtonText: 'CLEAR',\n uploadButtonText: 'UPLOAD',\n uploadButtonType: 'button',\n showUploadProgress: false,\n disableOnUpload: true\n }\n\n @ViewChild('fileInput') fileInputRef: ElementRef\n\n selectedFiles: FileList;\n\n isUploaded = false;\n\n fileProgress: Observable<number>[] = [];\n disabled$: Observable<boolean>;\n\n // ngControl: NgControl = null;\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n ) {\n super();\n if (this.ngControl != null) {\n // Setting the value accessor directly (instead of using\n // the providers) to avoid running into a circular import.\n ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit() {\n super.ngOnInit();\n this.disabled$ = this.config.disabledCallback\n ? this.config.disabledCallback(this.group)\n : of(false);\n }\n\n\n filesChanged(files: FileList): void {\n if (files && files.length > 0 ) {\n this.selectedFiles = files\n this.control.patchValue(files);\n }\n }\n\n uploadFiles() {\n if(this.selectedFiles && this.config.uploadFiles) {\n this.isUploaded = true;\n this.config.uploadFiles(this.group, this.selectedFiles, this);\n }\n }\n\n resetFileInput(): void {\n this.fileInputRef.nativeElement.value = ''\n this.control.patchValue(null);\n this.isUploaded = false;\n }\n\n writeValue( value: null ) {\n // clear file input\n // this.host.nativeElement.value = '';\n // this.file = null;\n }\n\n registerOnChange( fn: () => void ) {\n this.onChange = fn;\n }\n\n registerOnTouched( fn: () => void ) {\n }\n}\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAwBA,MAAM,oBAAoB,GAAG,kBAAkB,CAAwB,oBAAoB,CAAC,CAAC;AAqBvF,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;;AA4BhE,IAAA,WAAA,CAC6B,SAAoB,EAAA;AAE/C,QAAA,KAAK,EAAE,CAAC;QAFmB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;AAzBjD,QAAA,IAAA,CAAA,aAAa,GAAmC;AAC9C,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,qBAAqB,EAAE,QAAQ;AAC/B,YAAA,gBAAgB,EAAE,QAAQ;AAC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AQ;;0BAAI,IAAI;4CAXK,YAAY,EAAA,CAAA;sBAAnC,SAAS;uBAAC,WAAW,CAAA;;;AE/DxB;;AAEG;;;;"}
@@ -0,0 +1,37 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
3
+ import { CrisprFieldComponent } from '@tft/crispr-forms/utils';
4
+ import * as i1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i2 from '@angular/material/form-field';
7
+ import { MatFormFieldModule } from '@angular/material/form-field';
8
+ import { InfoComponent } from '@tft/crispr-forms/ui/info';
9
+
10
+ const defaultConfig = {
11
+ typographyClass: 'mat-h3'
12
+ };
13
+ class HeadingComponent extends CrisprFieldComponent {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.defaultConfig = defaultConfig;
17
+ }
18
+ }
19
+ HeadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: HeadingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
20
+ 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: i2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: HeadingComponent, decorators: [{
22
+ type: Component,
23
+ args: [{ selector: 'crispr-heading', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
24
+ CommonModule,
25
+ MatFormFieldModule,
26
+ InfoComponent
27
+ ], 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"] }]
28
+ }], propDecorators: { config: [{
29
+ type: Input
30
+ }] } });
31
+
32
+ /**
33
+ * Generated bundle index. Do not edit.
34
+ */
35
+
36
+ export { HeadingComponent };
37
+ //# sourceMappingURL=tft-crispr-forms-ui-heading.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tft-crispr-forms-ui-heading.mjs","sources":["../../../../libs/crispr-forms/ui/heading/heading.component.ts","../../../../libs/crispr-forms/ui/heading/heading.component.html","../../../../libs/crispr-forms/ui/heading/tft-crispr-forms-ui-heading.ts"],"sourcesContent":["import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\n// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries\nimport { CrisprFieldComponent, HeadingConfig } from '@tft/crispr-forms/utils';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { InfoComponent } from '@tft/crispr-forms/ui/info';\n\nconst defaultConfig: Partial<HeadingConfig> = {\n typographyClass: 'mat-h3'\n}\n@Component({\n selector: 'crispr-heading',\n templateUrl: './heading.component.html',\n styleUrls: ['./heading.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n MatFormFieldModule,\n InfoComponent\n ],\n})\nexport class HeadingComponent extends CrisprFieldComponent<HeadingConfig>{\n @Input() config: HeadingConfig;\n defaultConfig = defaultConfig;\n}\n"," <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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,aAAa,GAA2B;AAC5C,IAAA,eAAe,EAAE,QAAQ;CAC1B,CAAA;AAaK,MAAO,gBAAiB,SAAQ,oBAAmC,CAAA;AAZzE,IAAA,WAAA,GAAA;;QAcE,IAAa,CAAA,aAAA,GAAG,aAAa,CAAC;AAC/B,KAAA;;6GAHY,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,+HCtB7B,6OAUA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDOI,YAAY,EACZ,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,kBAAkB,mGAClB,aAAa,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAGJ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAZ5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,kBAAkB;wBAClB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,6OAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,CAAA;8BAGQ,MAAM,EAAA,CAAA;sBAAd,KAAK;;;AEvBR;;AAEG;;;;"}
@@ -0,0 +1,185 @@
1
+ import * as i3 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, Optional, Self, ViewChild } from '@angular/core';
5
+ import * as i1 from '@angular/forms';
6
+ import { ReactiveFormsModule } from '@angular/forms';
7
+ import * as i5 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import * as i6 from '@angular/material/form-field';
10
+ import { MatFormFieldModule } from '@angular/material/form-field';
11
+ import * as i4 from '@angular/material/icon';
12
+ import { MatIconModule } from '@angular/material/icon';
13
+ import * as i7 from '@angular/material/input';
14
+ import { MatInputModule } from '@angular/material/input';
15
+ import * as i2 from '@angular/platform-browser';
16
+ import imageCompression from 'browser-image-compression';
17
+ import { Subject, combineLatest, of } from 'rxjs';
18
+ import { shareReplay, switchMap, map, tap, startWith } from 'rxjs/operators';
19
+ import * as i8 from '@tft/form-validation-handler';
20
+ import { FormValidationHandlerModule } from '@tft/form-validation-handler';
21
+ import { FileDropzoneDirective } from '@tft/crispr-forms/ui/file-dropzone';
22
+ import { SelectedFileComponent } from '@tft/crispr-forms/ui/selected-file';
23
+ import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
24
+ import { crisprControlMixin, CrisprFieldComponent, convertBytesToMb } from '@tft/crispr-forms/utils';
25
+
26
+ /* eslint-disable @nrwl/nx/enforce-module-boundaries */
27
+ const ImageUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
28
+ class ImageUploadFieldComponent extends ImageUploadFieldMixin {
29
+ constructor(ngControl, domSanitizer, cdr) {
30
+ super();
31
+ this.ngControl = ngControl;
32
+ this.domSanitizer = domSanitizer;
33
+ this.cdr = cdr;
34
+ this.defaultConfig = {
35
+ // allowMultipleFiles: false,
36
+ acceptedTypes: 'image/*',
37
+ dropZoneText: 'DROP FILE HERE',
38
+ selectFilesButtonType: 'button',
39
+ selectButtonText: 'SELECT',
40
+ showClearFilesButton: true,
41
+ clearFilesButtonText: 'CLEAR',
42
+ resetFilesButtonText: 'RESET',
43
+ imagePreviewHeight: '250px',
44
+ compressImage: false,
45
+ targetCompressedImageFileSizeMb: .4,
46
+ minCompressionThresholdMb: .6,
47
+ useWebWorker: true,
48
+ };
49
+ this.inputImageFileSubject = new Subject();
50
+ this.inputImageFile$ = this.inputImageFileSubject.asObservable().pipe(shareReplay(1));
51
+ this.compressedFile$ = this.inputImageFile$.pipe(switchMap(async (file) => {
52
+ if (!file || !(file instanceof File))
53
+ return null;
54
+ const { compressImage, targetCompressedImageFileSizeMb, minCompressionThresholdMb, maxWidthOrHeight, useWebWorker } = this.config;
55
+ const fileSizeMb = convertBytesToMb(file.size);
56
+ const shouldCompress = compressImage
57
+ && targetCompressedImageFileSizeMb < fileSizeMb
58
+ && minCompressionThresholdMb < fileSizeMb;
59
+ if (shouldCompress) {
60
+ const options = {
61
+ // Use maxWidthOrHeight if it was provided, else use target compressed size
62
+ ...(maxWidthOrHeight ? { maxWidthOrHeight } : { maxSizeMB: targetCompressedImageFileSizeMb }),
63
+ useWebWorker,
64
+ maxIterations: 30,
65
+ onProgress: (progress) => {
66
+ this.progress = progress;
67
+ this.cdr.detectChanges();
68
+ }
69
+ };
70
+ return await imageCompression(file, options);
71
+ }
72
+ else
73
+ return file;
74
+ }), map((compressedFile) => {
75
+ if (!compressedFile)
76
+ return compressedFile;
77
+ const { type, name, lastModified } = compressedFile;
78
+ return new File([compressedFile], this.config.fileName || name, {
79
+ type,
80
+ lastModified
81
+ });
82
+ }), tap(file => {
83
+ // only set the value if there is a file because resetToInitialValue sets the control value
84
+ // to initial value and clears the compressed image, so setting it to null here would undo that
85
+ if (file) {
86
+ this.control.setValue(file);
87
+ }
88
+ if (file || this.value) {
89
+ this.control.markAsTouched();
90
+ setTimeout(() => {
91
+ this.cdr.detectChanges();
92
+ }, 100);
93
+ }
94
+ }), shareReplay(1));
95
+ this.compressedImageUrlString$ = this.compressedFile$.pipe(switchMap(async (file) => {
96
+ if (!file)
97
+ return null;
98
+ const compressedStringImage = await imageCompression.getDataUrlFromFile(file);
99
+ return this.domSanitizer.bypassSecurityTrustResourceUrl(compressedStringImage);
100
+ }), shareReplay(1));
101
+ this.isUploaded = false;
102
+ if (this.ngControl != null) {
103
+ // Setting the value accessor directly (instead of using
104
+ // the providers) to avoid running into a circular import.
105
+ ngControl.valueAccessor = this;
106
+ }
107
+ }
108
+ ngOnInit() {
109
+ super.ngOnInit();
110
+ this.imageSrcUrl$ = combineLatest([
111
+ this.compressedImageUrlString$.pipe(startWith(null)),
112
+ this.control.valueChanges.pipe(startWith(this.value), map((controlValue) => {
113
+ if (!controlValue)
114
+ return null;
115
+ if (controlValue instanceof File)
116
+ return null;
117
+ return this.config.mapInputValueToUrl?.(controlValue) || controlValue;
118
+ }))
119
+ ]).pipe(map(([compressedImageUrlString, controlUrl]) => {
120
+ return compressedImageUrlString || controlUrl || null;
121
+ }));
122
+ this.disabled$ = this.config.disabledCallback
123
+ ? this.config.disabledCallback(this.group)
124
+ : of(false);
125
+ }
126
+ filesChanged(files) {
127
+ if (files && files.length > 0) {
128
+ const imageFile = files[0];
129
+ // We clear the control here so that it is invalid while compressing
130
+ // the input pipeline will take care of resetting it
131
+ this.control.patchValue(null);
132
+ // this.control.setErrors({compressing: {loadingMessage: 'Please wait while file compresses'}});
133
+ this.control.markAsTouched();
134
+ this.inputImageFileSubject.next(imageFile);
135
+ }
136
+ }
137
+ clearFileInput() {
138
+ this.inputImageFileSubject.next(null);
139
+ this.fileInputRef.nativeElement.value = '';
140
+ this.control.patchValue(null);
141
+ this.control.markAsTouched();
142
+ this.isUploaded = false;
143
+ }
144
+ resetToInitialValue(initialValue) {
145
+ this.inputImageFileSubject.next(null);
146
+ this.control.patchValue(initialValue);
147
+ this.isUploaded = false;
148
+ }
149
+ writeValue(value) { }
150
+ registerOnChange(fn) {
151
+ this.onChange = fn;
152
+ }
153
+ registerOnTouched(fn) { }
154
+ }
155
+ ImageUploadFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ImageUploadFieldComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
156
+ 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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.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: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.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: i8.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i8.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ImageUploadFieldComponent, decorators: [{
158
+ type: Component,
159
+ args: [{ selector: 'crispr-image-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
160
+ CommonModule,
161
+ FieldContainerComponent,
162
+ ReactiveFormsModule,
163
+ MatIconModule,
164
+ MatButtonModule,
165
+ MatFormFieldModule,
166
+ MatInputModule,
167
+ SelectedFileComponent,
168
+ FileDropzoneDirective,
169
+ FormValidationHandlerModule
170
+ ], 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"] }]
171
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
172
+ type: Optional
173
+ }, {
174
+ type: Self
175
+ }] }, { type: i2.DomSanitizer }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { fileInputRef: [{
176
+ type: ViewChild,
177
+ args: ['fileInput']
178
+ }] } });
179
+
180
+ /**
181
+ * Generated bundle index. Do not edit.
182
+ */
183
+
184
+ export { ImageUploadFieldComponent };
185
+ //# sourceMappingURL=tft-crispr-forms-ui-image-upload-field.mjs.map