@sixbell-telco/sdk 0.10.1 → 0.12.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 (334) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +30 -280
  3. package/_index.css +452 -0
  4. package/assets/styles/combobox.css +197 -0
  5. package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
  6. package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +2 -2
  7. package/components/audio-player/button-play/button-play.component.d.ts +6 -6
  8. package/components/audio-player/services/audio.service.d.ts +1 -0
  9. package/components/audio-player/src/audio-player.component.d.ts +1 -0
  10. package/components/audio-player/volume-control/volume-control.component.d.ts +2 -2
  11. package/components/avatar/src/avatar.component.d.ts +1 -1
  12. package/components/badge/src/badge.component.d.ts +69 -7
  13. package/components/button/src/button.component.d.ts +23 -9
  14. package/components/card/card-actions/card-actions.component.d.ts +29 -1
  15. package/components/card/card-content/card-content.component.d.ts +25 -0
  16. package/components/card/card-title/card-title.component.d.ts +22 -0
  17. package/components/card/src/card.component.d.ts +90 -5
  18. package/components/countdown/src/countdown.component.d.ts +2 -2
  19. package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +35 -2
  20. package/components/dropdown/src/dropdown.component.d.ts +151 -9
  21. package/components/dual-list/src/dual-list.component.d.ts +6 -6
  22. package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +254 -0
  23. package/components/file-upload/file-uploader/file-uploader.component.d.ts +209 -0
  24. package/components/file-upload/index.d.ts +5 -0
  25. package/components/file-upload/public-api.d.ts +4 -0
  26. package/components/file-upload/shared/types/file-upload.d.ts +8 -0
  27. package/components/forms/checkbox/src/checkbox.component.d.ts +68 -5
  28. package/components/forms/combobox/src/combobox.component.d.ts +3 -3
  29. package/components/forms/datepicker/src/datepicker.component.d.ts +2 -2
  30. package/components/forms/form-error/src/form-error.component.d.ts +8 -1
  31. package/components/forms/input/input-content/input-content.component.d.ts +8 -0
  32. package/components/forms/input/public-api.d.ts +1 -0
  33. package/components/forms/input/src/input.component.d.ts +148 -25
  34. package/components/forms/radio/src/radio.component.d.ts +83 -7
  35. package/components/forms/range/src/range.component.d.ts +101 -6
  36. package/components/forms/select/src/select.component.d.ts +139 -13
  37. package/components/forms/switch/src/switch.component.d.ts +74 -7
  38. package/components/forms/textarea/src/textarea.component.d.ts +172 -16
  39. package/components/forms/toggle/src/toggle.component.d.ts +3 -3
  40. package/components/icon/src/icon.component.d.ts +3 -3
  41. package/components/link/src/link.component.d.ts +1 -1
  42. package/components/modal/modal-actions/modal-actions.component.d.ts +1 -1
  43. package/components/modal/src/modal.component.d.ts +10 -10
  44. package/components/notification/src/notification.component.d.ts +2 -3
  45. package/components/paginator/components/pagination-item/pagination-item.component.d.ts +64 -15
  46. package/components/paginator/src/paginator.component.d.ts +93 -2
  47. package/components/product-card/src/product-card.component.d.ts +6 -6
  48. package/components/progress/src/progress.component.d.ts +59 -4
  49. package/components/tab/directives/tab-content/tab-content.directive.d.ts +1 -1
  50. package/components/tab/directives/tab-header/tab-header.directive.d.ts +1 -1
  51. package/components/tab/src/tab.component.d.ts +3 -3
  52. package/components/table/src/table.component.d.ts +15 -11
  53. package/components/toast/toast-message/toast-message.component.d.ts +3 -3
  54. package/components/tooltip/public-api.d.ts +1 -0
  55. package/components/tooltip/src/tooltip.component.d.ts +66 -5
  56. package/components/tooltip/tooltip-content/tooltip-content.component.d.ts +38 -0
  57. package/components/wizard/wizard-actions/wizard-actions.component.d.ts +1 -1
  58. package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +20 -20
  59. package/directives/auto-focus/index.d.ts +5 -0
  60. package/directives/auto-focus/public-api.d.ts +1 -0
  61. package/directives/auto-focus/src/autofocus.directive.d.ts +93 -0
  62. package/directives/click-outside/src/click-outside.directive.d.ts +48 -3
  63. package/directives/only-numbers/index.d.ts +5 -0
  64. package/directives/only-numbers/public-api.d.ts +1 -0
  65. package/directives/only-numbers/src/only-numbers.directive.d.ts +9 -0
  66. package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +10 -12
  67. package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
  68. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +71 -50
  69. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
  70. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +7 -7
  71. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
  72. package/fesm2022/sixbell-telco-sdk-components-badge.mjs +92 -47
  73. package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
  74. package/fesm2022/sixbell-telco-sdk-components-button.mjs +35 -28
  75. package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
  76. package/fesm2022/sixbell-telco-sdk-components-card.mjs +194 -32
  77. package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
  78. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +7 -7
  79. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
  80. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +201 -30
  81. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
  82. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +18 -16
  83. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  84. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +706 -0
  85. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -0
  86. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +85 -25
  87. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
  88. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +20 -20
  89. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
  90. package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +11 -11
  91. package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
  92. package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +12 -4
  93. package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
  94. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +221 -122
  95. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
  96. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +98 -26
  97. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
  98. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +117 -25
  99. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
  100. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +190 -65
  101. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  102. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +95 -45
  103. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
  104. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +229 -80
  105. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  106. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +56 -243
  107. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
  108. package/fesm2022/sixbell-telco-sdk-components-icon.mjs +14 -15
  109. package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
  110. package/fesm2022/sixbell-telco-sdk-components-link.mjs +16 -16
  111. package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
  112. package/fesm2022/sixbell-telco-sdk-components-modal.mjs +39 -36
  113. package/fesm2022/sixbell-telco-sdk-components-modal.mjs.map +1 -1
  114. package/fesm2022/sixbell-telco-sdk-components-notification.mjs +12 -9
  115. package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
  116. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +189 -59
  117. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
  118. package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +34 -39
  119. package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
  120. package/fesm2022/sixbell-telco-sdk-components-progress.mjs +60 -12
  121. package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
  122. package/fesm2022/sixbell-telco-sdk-components-tab.mjs +32 -34
  123. package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
  124. package/fesm2022/sixbell-telco-sdk-components-table.mjs +50 -48
  125. package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
  126. package/fesm2022/sixbell-telco-sdk-components-toast.mjs +28 -44
  127. package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
  128. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +111 -9
  129. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
  130. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +59 -59
  131. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
  132. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +206 -0
  133. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -0
  134. package/fesm2022/sixbell-telco-sdk-directives-click-outside.mjs +54 -11
  135. package/fesm2022/sixbell-telco-sdk-directives-click-outside.mjs.map +1 -1
  136. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +52 -0
  137. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -0
  138. package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +14 -13
  139. package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -1
  140. package/fesm2022/sixbell-telco-sdk-utils-cn.mjs.map +1 -1
  141. package/fesm2022/sixbell-telco-sdk-utils-generators-uuid.mjs.map +1 -1
  142. package/fesm2022/sixbell-telco-sdk-utils-pipes-extract-extension.mjs +3 -3
  143. package/fesm2022/sixbell-telco-sdk-utils-pipes-extract-extension.mjs.map +1 -1
  144. package/fesm2022/sixbell-telco-sdk-utils-pipes-time.mjs +3 -3
  145. package/fesm2022/sixbell-telco-sdk-utils-pipes-time.mjs.map +1 -1
  146. package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +3 -3
  147. package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs.map +1 -1
  148. package/package.json +51 -147
  149. package/_index.scss +0 -146
  150. package/assets/styles/combobox.scss +0 -454
  151. package/components/file-upload/file-dropzone/index.d.ts +0 -5
  152. package/components/file-upload/file-dropzone/public-api.d.ts +0 -1
  153. package/components/file-upload/file-dropzone/src/file-dropzone.component.d.ts +0 -68
  154. package/components/file-upload/file-uploader/index.d.ts +0 -5
  155. package/components/file-upload/file-uploader/public-api.d.ts +0 -1
  156. package/components/file-upload/file-uploader/src/file-uploader.component.d.ts +0 -46
  157. package/esm2022/components/accordion/accordion-item/accordion-item.component.mjs +0 -43
  158. package/esm2022/components/accordion/public-api.mjs +0 -3
  159. package/esm2022/components/accordion/sixbell-telco-sdk-components-accordion.mjs +0 -5
  160. package/esm2022/components/accordion/src/accordion.component.mjs +0 -13
  161. package/esm2022/components/audio-player/audio-timeline/audio-timeline.component.mjs +0 -76
  162. package/esm2022/components/audio-player/button-play/button-play.component.mjs +0 -71
  163. package/esm2022/components/audio-player/public-api.mjs +0 -4
  164. package/esm2022/components/audio-player/services/audio.service.mjs +0 -189
  165. package/esm2022/components/audio-player/sixbell-telco-sdk-components-audio-player.mjs +0 -5
  166. package/esm2022/components/audio-player/src/audio-player.component.mjs +0 -105
  167. package/esm2022/components/audio-player/track-info/track-info.component.mjs +0 -18
  168. package/esm2022/components/audio-player/volume-control/volume-control.component.mjs +0 -83
  169. package/esm2022/components/avatar/public-api.mjs +0 -2
  170. package/esm2022/components/avatar/sixbell-telco-sdk-components-avatar.mjs +0 -5
  171. package/esm2022/components/avatar/src/avatar.component.mjs +0 -149
  172. package/esm2022/components/badge/public-api.mjs +0 -2
  173. package/esm2022/components/badge/sixbell-telco-sdk-components-badge.mjs +0 -5
  174. package/esm2022/components/badge/src/badge.component.mjs +0 -77
  175. package/esm2022/components/button/public-api.mjs +0 -2
  176. package/esm2022/components/button/sixbell-telco-sdk-components-button.mjs +0 -5
  177. package/esm2022/components/button/src/button.component.mjs +0 -182
  178. package/esm2022/components/card/card-actions/card-actions.component.mjs +0 -22
  179. package/esm2022/components/card/card-content/card-content.component.mjs +0 -12
  180. package/esm2022/components/card/card-title/card-title.component.mjs +0 -12
  181. package/esm2022/components/card/public-api.mjs +0 -5
  182. package/esm2022/components/card/sixbell-telco-sdk-components-card.mjs +0 -5
  183. package/esm2022/components/card/src/card.component.mjs +0 -32
  184. package/esm2022/components/countdown/public-api.mjs +0 -2
  185. package/esm2022/components/countdown/sixbell-telco-sdk-components-countdown.mjs +0 -5
  186. package/esm2022/components/countdown/src/countdown.component.mjs +0 -57
  187. package/esm2022/components/dropdown/dropdown-item/dropdown-item.component.mjs +0 -24
  188. package/esm2022/components/dropdown/public-api.mjs +0 -3
  189. package/esm2022/components/dropdown/sixbell-telco-sdk-components-dropdown.mjs +0 -5
  190. package/esm2022/components/dropdown/src/dropdown.component.mjs +0 -127
  191. package/esm2022/components/dual-list/public-api.mjs +0 -2
  192. package/esm2022/components/dual-list/sixbell-telco-sdk-components-dual-list.mjs +0 -5
  193. package/esm2022/components/dual-list/src/dual-list.component.mjs +0 -184
  194. package/esm2022/components/file-upload/file-dropzone/public-api.mjs +0 -2
  195. package/esm2022/components/file-upload/file-dropzone/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +0 -5
  196. package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +0 -232
  197. package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.constants.mjs +0 -7
  198. package/esm2022/components/file-upload/file-uploader/public-api.mjs +0 -2
  199. package/esm2022/components/file-upload/file-uploader/sixbell-telco-sdk-components-file-upload-file-uploader.mjs +0 -5
  200. package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +0 -115
  201. package/esm2022/components/forms/checkbox/public-api.mjs +0 -2
  202. package/esm2022/components/forms/checkbox/sixbell-telco-sdk-components-forms-checkbox.mjs +0 -5
  203. package/esm2022/components/forms/checkbox/src/checkbox.component.mjs +0 -94
  204. package/esm2022/components/forms/combobox/public-api.mjs +0 -2
  205. package/esm2022/components/forms/combobox/sixbell-telco-sdk-components-forms-combobox.mjs +0 -5
  206. package/esm2022/components/forms/combobox/src/combobox.component.mjs +0 -188
  207. package/esm2022/components/forms/datepicker/public-api.mjs +0 -3
  208. package/esm2022/components/forms/datepicker/sixbell-telco-sdk-components-forms-datepicker.mjs +0 -5
  209. package/esm2022/components/forms/datepicker/src/datepicker-format-month.pipe.mjs +0 -20
  210. package/esm2022/components/forms/datepicker/src/datepicker.component.mjs +0 -190
  211. package/esm2022/components/forms/form-error/public-api.mjs +0 -2
  212. package/esm2022/components/forms/form-error/sixbell-telco-sdk-components-forms-form-error.mjs +0 -5
  213. package/esm2022/components/forms/form-error/src/form-error.component.mjs +0 -25
  214. package/esm2022/components/forms/input/public-api.mjs +0 -2
  215. package/esm2022/components/forms/input/sixbell-telco-sdk-components-forms-input.mjs +0 -5
  216. package/esm2022/components/forms/input/src/input.component.mjs +0 -202
  217. package/esm2022/components/forms/radio/public-api.mjs +0 -2
  218. package/esm2022/components/forms/radio/sixbell-telco-sdk-components-forms-radio.mjs +0 -5
  219. package/esm2022/components/forms/radio/src/radio.component.mjs +0 -96
  220. package/esm2022/components/forms/range/public-api.mjs +0 -2
  221. package/esm2022/components/forms/range/sixbell-telco-sdk-components-forms-range.mjs +0 -5
  222. package/esm2022/components/forms/range/src/range.component.mjs +0 -103
  223. package/esm2022/components/forms/select/public-api.mjs +0 -2
  224. package/esm2022/components/forms/select/sixbell-telco-sdk-components-forms-select.mjs +0 -5
  225. package/esm2022/components/forms/select/src/select.component.mjs +0 -162
  226. package/esm2022/components/forms/switch/public-api.mjs +0 -2
  227. package/esm2022/components/forms/switch/sixbell-telco-sdk-components-forms-switch.mjs +0 -5
  228. package/esm2022/components/forms/switch/src/switch.component.mjs +0 -108
  229. package/esm2022/components/forms/textarea/public-api.mjs +0 -2
  230. package/esm2022/components/forms/textarea/sixbell-telco-sdk-components-forms-textarea.mjs +0 -5
  231. package/esm2022/components/forms/textarea/src/textarea.component.mjs +0 -168
  232. package/esm2022/components/forms/toggle/public-api.mjs +0 -2
  233. package/esm2022/components/forms/toggle/sixbell-telco-sdk-components-forms-toggle.mjs +0 -5
  234. package/esm2022/components/forms/toggle/src/toggle.component.mjs +0 -404
  235. package/esm2022/components/icon/heroicons/mini/public-api.mjs +0 -2
  236. package/esm2022/components/icon/heroicons/mini/sixbell-telco-sdk-components-icon-heroicons-mini.mjs +0 -5
  237. package/esm2022/components/icon/heroicons/outline/public-api.mjs +0 -2
  238. package/esm2022/components/icon/heroicons/outline/sixbell-telco-sdk-components-icon-heroicons-outline.mjs +0 -5
  239. package/esm2022/components/icon/heroicons/solid/public-api.mjs +0 -2
  240. package/esm2022/components/icon/heroicons/solid/sixbell-telco-sdk-components-icon-heroicons-solid.mjs +0 -5
  241. package/esm2022/components/icon/ionicons/public-api.mjs +0 -2
  242. package/esm2022/components/icon/ionicons/sixbell-telco-sdk-components-icon-ionicons.mjs +0 -5
  243. package/esm2022/components/icon/material/baseline/public-api.mjs +0 -2
  244. package/esm2022/components/icon/material/baseline/sixbell-telco-sdk-components-icon-material-baseline.mjs +0 -5
  245. package/esm2022/components/icon/material/outline/public-api.mjs +0 -2
  246. package/esm2022/components/icon/material/outline/sixbell-telco-sdk-components-icon-material-outline.mjs +0 -5
  247. package/esm2022/components/icon/material/round/public-api.mjs +0 -2
  248. package/esm2022/components/icon/material/round/sixbell-telco-sdk-components-icon-material-round.mjs +0 -5
  249. package/esm2022/components/icon/material/sharp/public-api.mjs +0 -2
  250. package/esm2022/components/icon/material/sharp/sixbell-telco-sdk-components-icon-material-sharp.mjs +0 -5
  251. package/esm2022/components/icon/public-api.mjs +0 -2
  252. package/esm2022/components/icon/sixbell-telco-sdk-components-icon.mjs +0 -5
  253. package/esm2022/components/icon/src/icon.component.mjs +0 -42
  254. package/esm2022/components/link/public-api.mjs +0 -2
  255. package/esm2022/components/link/sixbell-telco-sdk-components-link.mjs +0 -5
  256. package/esm2022/components/link/src/link.component.mjs +0 -63
  257. package/esm2022/components/modal/modal-actions/modal-actions.component.mjs +0 -22
  258. package/esm2022/components/modal/modal-content/modal-content.component.mjs +0 -12
  259. package/esm2022/components/modal/modal-title/modal-title.component.mjs +0 -13
  260. package/esm2022/components/modal/public-api.mjs +0 -5
  261. package/esm2022/components/modal/sixbell-telco-sdk-components-modal.mjs +0 -5
  262. package/esm2022/components/modal/src/modal.component.mjs +0 -154
  263. package/esm2022/components/notification/public-api.mjs +0 -2
  264. package/esm2022/components/notification/sixbell-telco-sdk-components-notification.mjs +0 -5
  265. package/esm2022/components/notification/src/notification.component.mjs +0 -55
  266. package/esm2022/components/paginator/components/pagination-item/pagination-item.component.mjs +0 -113
  267. package/esm2022/components/paginator/public-api.mjs +0 -3
  268. package/esm2022/components/paginator/sixbell-telco-sdk-components-paginator.mjs +0 -5
  269. package/esm2022/components/paginator/src/paginator.component.mjs +0 -52
  270. package/esm2022/components/product-card/directives/product-card-actions.directive.mjs +0 -15
  271. package/esm2022/components/product-card/directives/product-card-content.directive.mjs +0 -15
  272. package/esm2022/components/product-card/directives/product-card-header.directive.mjs +0 -15
  273. package/esm2022/components/product-card/public-api.mjs +0 -5
  274. package/esm2022/components/product-card/sixbell-telco-sdk-components-product-card.mjs +0 -5
  275. package/esm2022/components/product-card/src/product-card.component.mjs +0 -137
  276. package/esm2022/components/progress/public-api.mjs +0 -2
  277. package/esm2022/components/progress/sixbell-telco-sdk-components-progress.mjs +0 -5
  278. package/esm2022/components/progress/src/progress.component.mjs +0 -43
  279. package/esm2022/components/tab/directives/tab-content/tab-content.directive.mjs +0 -51
  280. package/esm2022/components/tab/directives/tab-header/tab-header.directive.mjs +0 -56
  281. package/esm2022/components/tab/public-api.mjs +0 -4
  282. package/esm2022/components/tab/sixbell-telco-sdk-components-tab.mjs +0 -5
  283. package/esm2022/components/tab/src/tab.component.mjs +0 -42
  284. package/esm2022/components/table/public-api.mjs +0 -4
  285. package/esm2022/components/table/sixbell-telco-sdk-components-table.mjs +0 -5
  286. package/esm2022/components/table/src/table.component.mjs +0 -283
  287. package/esm2022/components/table/table-header-checkbox/table-header-checkbox.component.mjs +0 -67
  288. package/esm2022/components/table/table-row-checkbox/table-row-checkbox.component.mjs +0 -72
  289. package/esm2022/components/toast/public-api.mjs +0 -4
  290. package/esm2022/components/toast/services/toast.service.mjs +0 -67
  291. package/esm2022/components/toast/sixbell-telco-sdk-components-toast.mjs +0 -5
  292. package/esm2022/components/toast/toast-message/toast-message.component.mjs +0 -80
  293. package/esm2022/components/toast/toasts-container/toasts-container.component.mjs +0 -41
  294. package/esm2022/components/tooltip/public-api.mjs +0 -2
  295. package/esm2022/components/tooltip/sixbell-telco-sdk-components-tooltip.mjs +0 -5
  296. package/esm2022/components/tooltip/src/tooltip.component.mjs +0 -45
  297. package/esm2022/components/wizard/public-api.mjs +0 -5
  298. package/esm2022/components/wizard/services/wizard.service.mjs +0 -312
  299. package/esm2022/components/wizard/sixbell-telco-sdk-components-wizard.mjs +0 -5
  300. package/esm2022/components/wizard/wizard-actions/wizard-actions.component.mjs +0 -22
  301. package/esm2022/components/wizard/wizard-content/wizard-content.component.mjs +0 -84
  302. package/esm2022/components/wizard/wizard-marker/wizard-marker.component.mjs +0 -111
  303. package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +0 -126
  304. package/esm2022/components/wizard/wizard-sub-step/wizard-sub-step.component.mjs +0 -121
  305. package/esm2022/components/wizard/wizard-wrapper/wizard-wrapper.component.mjs +0 -173
  306. package/esm2022/directives/click-outside/public-api.mjs +0 -2
  307. package/esm2022/directives/click-outside/sixbell-telco-sdk-directives-click-outside.mjs +0 -5
  308. package/esm2022/directives/click-outside/src/click-outside.directive.mjs +0 -30
  309. package/esm2022/directives/typography/public-api.mjs +0 -2
  310. package/esm2022/directives/typography/sixbell-telco-sdk-directives-typography.mjs +0 -5
  311. package/esm2022/directives/typography/src/typography.directive.mjs +0 -118
  312. package/esm2022/public_api.mjs +0 -2
  313. package/esm2022/sixbell-telco-sdk.mjs +0 -5
  314. package/esm2022/utils/cn/public-api.mjs +0 -2
  315. package/esm2022/utils/cn/sixbell-telco-sdk-utils-cn.mjs +0 -5
  316. package/esm2022/utils/cn/src/cn.mjs +0 -6
  317. package/esm2022/utils/generators/uuid/public-api.mjs +0 -2
  318. package/esm2022/utils/generators/uuid/sixbell-telco-sdk-utils-generators-uuid.mjs +0 -5
  319. package/esm2022/utils/generators/uuid/src/uuid.mjs +0 -5
  320. package/esm2022/utils/pipes/extract-extension/public-api.mjs +0 -2
  321. package/esm2022/utils/pipes/extract-extension/sixbell-telco-sdk-utils-pipes-extract-extension.mjs +0 -5
  322. package/esm2022/utils/pipes/extract-extension/src/extract-extension.mjs +0 -30
  323. package/esm2022/utils/pipes/time/public-api.mjs +0 -2
  324. package/esm2022/utils/pipes/time/sixbell-telco-sdk-utils-pipes-time.mjs +0 -5
  325. package/esm2022/utils/pipes/time/src/time.pipe.mjs +0 -19
  326. package/esm2022/utils/pipes/to-bytes-extesion/public-api.mjs +0 -2
  327. package/esm2022/utils/pipes/to-bytes-extesion/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +0 -5
  328. package/esm2022/utils/pipes/to-bytes-extesion/src/to-bytes.pipe.mjs +0 -29
  329. package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +0 -245
  330. package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs.map +0 -1
  331. package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs +0 -122
  332. package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +0 -1
  333. /package/assets/styles/{toast.scss → toast.css} +0 -0
  334. /package/components/file-upload/{file-dropzone/src/file-dropzone.constants.d.ts → shared/const/file-upload.constants.d.ts} +0 -0
@@ -0,0 +1,706 @@
1
+ import { NgClass } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, input, model, computed, signal, output, viewChild, forwardRef, Component, ChangeDetectionStrategy } from '@angular/core';
4
+ import { toObservable, toSignal } from '@angular/core/rxjs-interop';
5
+ import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
6
+ import { TranslateService, _, TranslatePipe } from '@ngx-translate/core';
7
+ import { AudioPlayerService, ButtonPlayComponent, AudioPlayerComponent } from '@sixbell-telco/sdk/components/audio-player';
8
+ import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
9
+ import { IconComponent } from '@sixbell-telco/sdk/components/icon';
10
+ import { matDelete, matDownload, matInsertDriveFile, matCloudUpload, matError, matVisibility, matVisibilityOff } from '@sixbell-telco/sdk/components/icon/material/baseline';
11
+ import { TooltipComponent } from '@sixbell-telco/sdk/components/tooltip';
12
+ import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
13
+ import { cn } from '@sixbell-telco/sdk/utils/cn';
14
+ import { ExtractExtensionPipe } from '@sixbell-telco/sdk/utils/pipes/extract-extension';
15
+ import { ToBytesPipe } from '@sixbell-telco/sdk/utils/pipes/to-bytes-extesion';
16
+ import { switchMap, startWith } from 'rxjs';
17
+ import { InputComponent } from '@sixbell-telco/sdk/components/forms/input';
18
+
19
+ const AUDIO_EXTENSIONS = ['.mp3', '.wav', '.ogg', '.m4a', '.aac', '.wma'];
20
+ const VIDEO_EXTENSIONS = ['.mp4', '.avi', '.mov', '.wmv', '.mkv', '.flv', '.webm'];
21
+ const IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.webp'];
22
+ const DOCUMENT_EXTENSIONS = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.csv'];
23
+ const ARCHIVE_EXTENSIONS = ['.zip', '.rar', '.7z'];
24
+ const CODE_EXTENSIONS = ['.html', '.xml', '.json', '.js', '.ts', '.css'];
25
+
26
+ /**
27
+ * A customizable drag-and-drop file upload zone with audio playback capabilities
28
+ *
29
+ * @remarks
30
+ * Supports file validation, multi-file uploads, and audio file preview/playback.
31
+ * Implements ControlValueAccessor for Angular form integration.
32
+ *
33
+ * @example
34
+ * ```html
35
+ * <st-file-dropzone
36
+ * [extensions]="['.mp3', '.wav']"
37
+ * [maxFiles]="3"
38
+ * (fileDropped)="handleUpload($event)"
39
+ * ></st-file-dropzone>
40
+ * ```
41
+ *
42
+ * @example
43
+ * ```html
44
+ * <!-- Form integration -->
45
+ * <st-file-dropzone
46
+ * [parentForm]="mediaForm"
47
+ * formControlName="attachments"
48
+ * [multiple]="true"
49
+ * ></st-file-dropzone>
50
+ * ```
51
+ */
52
+ class DropzoneComponent {
53
+ /** @internal Translation service instance */
54
+ translateService = inject(TranslateService);
55
+ /** @internal Audio player service instance */
56
+ audioService = inject(AudioPlayerService);
57
+ // Input properties
58
+ /**
59
+ * Maximum number of allowed files
60
+ * @defaultValue 1
61
+ */
62
+ maxFiles = input(1);
63
+ /**
64
+ * Maximum file size in bytes (0 for unlimited)
65
+ * @defaultValue 0
66
+ */
67
+ maxFileSize = input(0);
68
+ /**
69
+ * Whether to display uploaded files list
70
+ * @defaultValue true
71
+ */
72
+ showFiles = input(true);
73
+ /**
74
+ * Allowed file extensions (e.g., ['.pdf', '.mp3'])
75
+ */
76
+ extensions = input.required();
77
+ /**
78
+ * Whether upload is in progress
79
+ * @defaultValue false
80
+ */
81
+ uploading = input(false);
82
+ /**
83
+ * Whether the component is disabled
84
+ * @defaultValue false
85
+ */
86
+ disabled = model(false);
87
+ /**
88
+ * Whether multiple files can be uploaded
89
+ * @defaultValue false
90
+ */
91
+ multiple = input(false);
92
+ /**
93
+ * HTML name attribute for the input
94
+ * @defaultValue 'file'
95
+ */
96
+ name = input('file');
97
+ /**
98
+ * Computed accept attribute for file input
99
+ * @internal
100
+ */
101
+ accept = computed(() => this.extensions().join(','));
102
+ /** @internal Tracks audio player open state */
103
+ opened = signal(false);
104
+ /** @internal Tracks blur events for validation */
105
+ blurTrigger = signal(0);
106
+ // Form integration
107
+ /**
108
+ * Parent form group for reactive forms
109
+ */
110
+ parentForm = input(null);
111
+ /**
112
+ * Form control name for reactive forms
113
+ */
114
+ formControlName = input('');
115
+ // Output events
116
+ /**
117
+ * Emitted when valid files are dropped/selected
118
+ */
119
+ fileDropped = output();
120
+ /**
121
+ * Emitted when a file is removed
122
+ */
123
+ fileRemoved = output();
124
+ // Internal state
125
+ /** @internal Current list of uploaded files */
126
+ files = signal([]);
127
+ /** @internal Drag state tracker */
128
+ isDragging = signal(false);
129
+ /** @internal Validation error message */
130
+ errorMessage = signal('');
131
+ // ControlValueAccessor implementation
132
+ /** @internal Change callback function */
133
+ onControlChange = () => { };
134
+ /** @internal Touch callback function */
135
+ onControlTouch = () => { };
136
+ /** @internal Reference to file input element */
137
+ fileInput = viewChild('fileInput');
138
+ // Icon references
139
+ /** @internal Material icon references */
140
+ iconDelete = matDelete;
141
+ iconDownload = matDownload;
142
+ iconInsertDriveFile = matInsertDriveFile;
143
+ iconCloudUpload = matCloudUpload;
144
+ iconError = matError;
145
+ iconVisibility = matVisibility;
146
+ iconVisibilityOff = matVisibilityOff;
147
+ /**
148
+ * Computed audio tracks from uploaded files
149
+ * @internal
150
+ */
151
+ tracks = computed(() => {
152
+ return this.files()
153
+ .filter((audio) => this.checkIfIsAudioFile(audio))
154
+ .map((audio) => ({
155
+ title: audio.name,
156
+ description: new ToBytesPipe().transform(audio.size),
157
+ url: URL.createObjectURL(audio),
158
+ }));
159
+ });
160
+ /**
161
+ * Whether to show audio player controls
162
+ * @internal
163
+ */
164
+ addAudioPlayer = computed(() => this.extensions().some((ext) => AUDIO_EXTENSIONS.includes(ext)));
165
+ /**
166
+ * Gets track index for audio files
167
+ * @param file - File to check
168
+ * @returns Index in audio tracks array
169
+ * @internal
170
+ */
171
+ getIndexForTracks(file) {
172
+ return this.files()
173
+ .filter((audio) => this.checkIfIsAudioFile(audio))
174
+ .indexOf(file);
175
+ }
176
+ // Drag and drop handlers
177
+ /**
178
+ * Handles drag over event
179
+ * @param event - Drag event
180
+ * @internal
181
+ */
182
+ handleDragOver(event) {
183
+ event.preventDefault();
184
+ if (this.disabled())
185
+ return;
186
+ this.isDragging.set(true);
187
+ }
188
+ /**
189
+ * Handles drag leave event
190
+ * @param event - Drag event
191
+ * @internal
192
+ */
193
+ handleDragLeave(event) {
194
+ event.preventDefault();
195
+ this.isDragging.set(false);
196
+ }
197
+ /**
198
+ * Handles file drop event
199
+ * @param event - Drag event
200
+ * @internal
201
+ */
202
+ handleDrop(event) {
203
+ event.preventDefault();
204
+ this.isDragging.set(false);
205
+ if (this.disabled())
206
+ return;
207
+ const files = Array.from(event.dataTransfer?.files || []);
208
+ this.processFiles(files);
209
+ }
210
+ /**
211
+ * Handles file input selection
212
+ * @param event - Input change event
213
+ * @internal
214
+ */
215
+ handleFileSelect(event) {
216
+ const input = event.target;
217
+ const files = Array.from(input.files || []);
218
+ this.processFiles(files);
219
+ input.value = ''; // Reset input
220
+ }
221
+ /** @internal Processes and validates uploaded files */
222
+ processFiles(files) {
223
+ this.errorMessage.set('');
224
+ // Validate max files
225
+ const totalFiles = this.files().length + files.length;
226
+ if (this.maxFiles() > 0 && totalFiles > this.maxFiles()) {
227
+ this.translateService.get(_('sdk.fileUpload.dropzone.maxFilesExceeded'), { max: this.maxFiles() }).subscribe((res) => {
228
+ this.errorMessage.set(res);
229
+ });
230
+ return;
231
+ }
232
+ // File validation
233
+ const validFiles = files.filter((file) => {
234
+ const isValidSize = this.validateFileSize(file);
235
+ const isValidType = this.validateFileType(file);
236
+ if (!isValidSize) {
237
+ console.warn(`File ${file.name} exceeds size limit`);
238
+ return false;
239
+ }
240
+ if (!isValidType) {
241
+ console.warn(`File ${file.name} has invalid type`);
242
+ return false;
243
+ }
244
+ return true;
245
+ });
246
+ if (validFiles.length > 0) {
247
+ this.files.update((current) => [...current, ...validFiles]);
248
+ this.onControlChange(this.files());
249
+ this.onControlTouch();
250
+ this.fileDropped.emit(validFiles);
251
+ }
252
+ else {
253
+ this.translateService.get(_('sdk.fileUpload.dropzone.noValidFiles')).subscribe((res) => {
254
+ this.errorMessage.set(res);
255
+ });
256
+ }
257
+ }
258
+ /**
259
+ * Validates file size against maxFileSize
260
+ * @param file - File to validate
261
+ * @returns True if file size is valid
262
+ * @internal
263
+ */
264
+ validateFileSize(file) {
265
+ return this.maxFileSize() === 0 || file.size <= this.maxFileSize();
266
+ }
267
+ /**
268
+ * Validates file type against allowed extensions
269
+ * @param file - File to validate
270
+ * @returns True if file type is valid
271
+ * @internal
272
+ */
273
+ validateFileType(file) {
274
+ if (this.extensions().length === 0)
275
+ return true;
276
+ const extension = file.name.match(/\.([0-9a-z]+)$/i)?.[0]?.toLowerCase() || '';
277
+ return this.extensions().some((ext) => ext.toLowerCase() === extension);
278
+ }
279
+ /**
280
+ * Handles file download
281
+ * @param file - File to download
282
+ * @internal
283
+ */
284
+ handlefileDownload(file) {
285
+ const url = URL.createObjectURL(file);
286
+ const a = document.createElement('a');
287
+ a.href = url;
288
+ a.download = file.name;
289
+ document.body.appendChild(a);
290
+ a.click();
291
+ URL.revokeObjectURL(url);
292
+ document.body.removeChild(a);
293
+ }
294
+ /**
295
+ * Removes a file from the list
296
+ * @param file - File to remove
297
+ * @internal
298
+ */
299
+ handleRemove(file) {
300
+ this.files.update((current) => current.filter((f) => f !== file));
301
+ this.onControlChange(this.files());
302
+ this.onControlTouch();
303
+ this.fileRemoved.emit(file);
304
+ }
305
+ /**
306
+ * Checks if a file is an audio file
307
+ * @param file - File to check
308
+ * @returns True if audio file
309
+ * @internal
310
+ */
311
+ checkIfIsAudioFile(file) {
312
+ return AUDIO_EXTENSIONS.some((ext) => file.name.endsWith(ext));
313
+ }
314
+ /**
315
+ * Toggles audio player visibility
316
+ * @internal
317
+ */
318
+ handleAudioPlayerOpen() {
319
+ this.opened.set(!this.opened());
320
+ }
321
+ /** @internal Cleans up object URLs */
322
+ ngDestroy() {
323
+ this.tracks().forEach((track) => URL.revokeObjectURL(track.url));
324
+ }
325
+ // ControlValueAccessor implementation
326
+ /**
327
+ * Writes form value to component
328
+ * @param files - Array of files from form control
329
+ */
330
+ writeValue(files) {
331
+ this.files.set(files || []);
332
+ }
333
+ /**
334
+ * Registers change callback
335
+ * @param fn - Callback function for value changes
336
+ */
337
+ registerOnChange(fn) {
338
+ this.onControlChange = fn;
339
+ }
340
+ /**
341
+ * Registers touch callback
342
+ * @param fn - Callback function for touch events
343
+ */
344
+ registerOnTouched(fn) {
345
+ this.onControlTouch = fn;
346
+ }
347
+ /**
348
+ * Sets disabled state
349
+ * @param isDisabled - Whether component is disabled
350
+ */
351
+ setDisabledState(isDisabled) {
352
+ this.disabled.set(isDisabled);
353
+ }
354
+ /**
355
+ * Triggers file input dialog
356
+ * @internal
357
+ */
358
+ triggerFileInput() {
359
+ if (!this.disabled()) {
360
+ this.fileInput()?.nativeElement.click();
361
+ }
362
+ }
363
+ // Form control integration
364
+ /** @internal Form control reference */
365
+ formControl = computed(() => this.parentForm()?.get(this.formControlName()));
366
+ /** @internal Form control observable */
367
+ formControl$ = toObservable(this.formControl);
368
+ /** @internal Status changes observable */
369
+ statusChanges$ = this.formControl$.pipe(switchMap((control) => control?.statusChanges.pipe(startWith(control.status)) || []));
370
+ /** @internal Value changes observable */
371
+ stateChanges$ = this.formControl$.pipe(switchMap((control) => control?.valueChanges.pipe(startWith(control.value)) || []));
372
+ /** @internal Status signal */
373
+ statusSignal = toSignal(this.statusChanges$);
374
+ /** @internal State signal */
375
+ stateSignal = toSignal(this.stateChanges$);
376
+ /**
377
+ * Handles blur events for validation
378
+ * @internal
379
+ */
380
+ handleBlur() {
381
+ this.onControlTouch();
382
+ this.blurTrigger.update((v) => v + 1);
383
+ }
384
+ /**
385
+ * Computes CSS classes for dropzone based on state
386
+ * @internal
387
+ */
388
+ dropzoneClass = computed(() => {
389
+ const control = this.formControl();
390
+ const trigger = this.blurTrigger();
391
+ const baseClasses = 'cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors duration-300 border-secondary hover:bg-secondary/10';
392
+ if (!control)
393
+ return baseClasses;
394
+ const isTouched = control.touched || trigger > 0;
395
+ this.statusSignal();
396
+ this.stateSignal();
397
+ const isFormError = control.invalid && (control.touched || isTouched);
398
+ const isComponentError = !!this.errorMessage();
399
+ return cn(baseClasses, {
400
+ 'border-secondary bg-secondary/30': this.isDragging() && !this.disabled(),
401
+ 'cursor-not-allowed bg-base-100/40 text-base-content/40': this.disabled(),
402
+ 'border-error bg-error/15 hover:border-error hover:bg-error/10': isComponentError || isFormError,
403
+ });
404
+ });
405
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: DropzoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
406
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: DropzoneComponent, isStandalone: true, selector: "st-file-dropzone", inputs: { maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, showFiles: { classPropertyName: "showFiles", publicName: "showFiles", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: true, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", fileDropped: "fileDropped", fileRemoved: "fileRemoved" }, providers: [
407
+ {
408
+ provide: NG_VALUE_ACCESSOR,
409
+ useExisting: forwardRef(() => DropzoneComponent),
410
+ multi: true,
411
+ },
412
+ ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<div class=\"w-full\">\n\t<div\n\t\t[class]=\"dropzoneClass()\"\n\t\t(dragover)=\"handleDragOver($event)\"\n\t\t(dragleave)=\"handleDragLeave($event)\"\n\t\t(drop)=\"handleDrop($event)\"\n\t\t(click)=\"triggerFileInput()\"\n\t\t(blur)=\"handleBlur()\"\n\t\ttabindex=\"0\"\n\t>\n\t\t@if (parentForm()) {\n\t\t\t<input\n\t\t\t\t#fileInput\n\t\t\t\ttype=\"file\"\n\t\t\t\t[multiple]=\"multiple()\"\n\t\t\t\t[accept]=\"accept()\"\n\t\t\t\t(change)=\"handleFileSelect($event)\"\n\t\t\t\t[name]=\"name()\"\n\t\t\t\t(blur)=\"handleBlur()\"\n\t\t\t\trequired\n\t\t\t\thidden\n\t\t\t/>\n\t\t} @else {\n\t\t\t<input #fileInput type=\"file\" [multiple]=\"multiple()\" [accept]=\"accept()\" (change)=\"handleFileSelect($event)\" [name]=\"name()\" required hidden />\n\t\t}\n\n\t\t<div class=\"grid h-48 place-content-center\">\n\t\t\t@let errorMessageVar = this.errorMessage();\n\t\t\t@if (errorMessageVar) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconError\" size=\"xl\" class=\"text-error\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ errorMessageVar }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (!uploading()) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconCloudUpload\" size=\"xl\" class=\"text-accent\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ 'sdk.fileUpload.dropzone.selectPrompt' | translate }}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'sdk.fileUpload.dropzone.maxSizeLabel' | translate }} <span class=\"text-accent\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t@if (extensions().length > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'sdk.fileUpload.dropzone.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t@if (maxFiles() > 0) {\n\t\t<div class=\"mt-4 flex items-center justify-between\">\n\t\t\t<ng-content></ng-content>\n\t\t\t<span typography [tyVariant]=\"'body-sm'\" [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ 'sdk.fileUpload.dropzone.fileCounter' | translate: { current: files().length, max: maxFiles() } }}\n\t\t\t</span>\n\t\t</div>\n\t}\n\n\t@if (showFiles() && files().length > 0) {\n\t\t<div class=\"mt-4 space-y-2\">\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<div class=\"bg-neutral/30 flex items-center justify-between rounded-md py-3 pr-5 pl-3\">\n\t\t\t\t\t<div class=\"flex items-center justify-start\">\n\t\t\t\t\t\t<div class=\"text-primary relative\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconInsertDriveFile\" size=\"xl\" />\n\t\t\t\t\t\t\t<div class=\"text-primary-content absolute bottom-2 left-1/2 -translate-x-1/2\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xxs'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t\t{{ file.name | extractExtension }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex flex-col items-start justify-between\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t\t\t{{ file.name }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class=\"text-tertiary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\"> {{ file.size | toBytes }} </span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"inline-flex items-center justify-end gap-1 align-top\">\n\t\t\t\t\t\t@if (checkIfIsAudioFile(file)) {\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!this.audioService.isPlayingATrack()\n\t\t\t\t\t\t\t\t\t\t? ('sdk.fileUpload.dropzone.fileActions.play' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('sdk.fileUpload.dropzone.fileActions.pause' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button-play\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t[asButton]=\"true\"\n\t\t\t\t\t\t\t\t\t[trackIndex]=\"getIndexForTracks(file)\"\n\t\t\t\t\t\t\t\t\t(togglePlay)=\"handleAudioPlayerOpen()\"\n\t\t\t\t\t\t\t\t></st-button-play>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<div></div>\n\t\t\t\t\t\t<st-tooltip [label]=\"'sdk.fileUpload.dropzone.fileActions.download' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"text-lg\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDownload\"\n\t\t\t\t\t\t\t\tvariant=\"info\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handlefileDownload(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t<st-tooltip [label]=\"'sdk.fileUpload.dropzone.fileActions.remove' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"text-lg\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDelete\"\n\t\t\t\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handleRemove(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t}\n</div>\n@if (addAudioPlayer()) {\n\t<st-audio-player [tracks]=\"tracks()\" [showTrackList]=\"false\" variant=\"fixed\" [(opened)]=\"opened\"></st-audio-player>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "pipe", type: ToBytesPipe, name: "toBytes" }, { kind: "pipe", type: ExtractExtensionPipe, name: "extractExtension" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "component", type: ButtonPlayComponent, selector: "st-button-play", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "size", "shadow", "asButton", "trackIndex"], outputs: ["togglePlay"] }, { kind: "component", type: AudioPlayerComponent, selector: "st-audio-player", inputs: ["variant", "shadow", "opened", "tracks", "showTrackList", "currentTrackIndex"], outputs: ["openedChange", "currentTrackIndexChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: TooltipComponent, selector: "st-tooltip", inputs: ["variant", "position", "label"] }] });
413
+ }
414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: DropzoneComponent, decorators: [{
415
+ type: Component,
416
+ args: [{ selector: 'st-file-dropzone', imports: [
417
+ NgClass,
418
+ ButtonComponent,
419
+ TypographyDirective,
420
+ ToBytesPipe,
421
+ ExtractExtensionPipe,
422
+ IconComponent,
423
+ ButtonPlayComponent,
424
+ AudioPlayerComponent,
425
+ FormsModule,
426
+ TranslatePipe,
427
+ TooltipComponent,
428
+ ], providers: [
429
+ {
430
+ provide: NG_VALUE_ACCESSOR,
431
+ useExisting: forwardRef(() => DropzoneComponent),
432
+ multi: true,
433
+ },
434
+ ], template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<div class=\"w-full\">\n\t<div\n\t\t[class]=\"dropzoneClass()\"\n\t\t(dragover)=\"handleDragOver($event)\"\n\t\t(dragleave)=\"handleDragLeave($event)\"\n\t\t(drop)=\"handleDrop($event)\"\n\t\t(click)=\"triggerFileInput()\"\n\t\t(blur)=\"handleBlur()\"\n\t\ttabindex=\"0\"\n\t>\n\t\t@if (parentForm()) {\n\t\t\t<input\n\t\t\t\t#fileInput\n\t\t\t\ttype=\"file\"\n\t\t\t\t[multiple]=\"multiple()\"\n\t\t\t\t[accept]=\"accept()\"\n\t\t\t\t(change)=\"handleFileSelect($event)\"\n\t\t\t\t[name]=\"name()\"\n\t\t\t\t(blur)=\"handleBlur()\"\n\t\t\t\trequired\n\t\t\t\thidden\n\t\t\t/>\n\t\t} @else {\n\t\t\t<input #fileInput type=\"file\" [multiple]=\"multiple()\" [accept]=\"accept()\" (change)=\"handleFileSelect($event)\" [name]=\"name()\" required hidden />\n\t\t}\n\n\t\t<div class=\"grid h-48 place-content-center\">\n\t\t\t@let errorMessageVar = this.errorMessage();\n\t\t\t@if (errorMessageVar) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconError\" size=\"xl\" class=\"text-error\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ errorMessageVar }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (!uploading()) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconCloudUpload\" size=\"xl\" class=\"text-accent\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ 'sdk.fileUpload.dropzone.selectPrompt' | translate }}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'sdk.fileUpload.dropzone.maxSizeLabel' | translate }} <span class=\"text-accent\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t@if (extensions().length > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'sdk.fileUpload.dropzone.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t@if (maxFiles() > 0) {\n\t\t<div class=\"mt-4 flex items-center justify-between\">\n\t\t\t<ng-content></ng-content>\n\t\t\t<span typography [tyVariant]=\"'body-sm'\" [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ 'sdk.fileUpload.dropzone.fileCounter' | translate: { current: files().length, max: maxFiles() } }}\n\t\t\t</span>\n\t\t</div>\n\t}\n\n\t@if (showFiles() && files().length > 0) {\n\t\t<div class=\"mt-4 space-y-2\">\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<div class=\"bg-neutral/30 flex items-center justify-between rounded-md py-3 pr-5 pl-3\">\n\t\t\t\t\t<div class=\"flex items-center justify-start\">\n\t\t\t\t\t\t<div class=\"text-primary relative\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconInsertDriveFile\" size=\"xl\" />\n\t\t\t\t\t\t\t<div class=\"text-primary-content absolute bottom-2 left-1/2 -translate-x-1/2\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xxs'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t\t{{ file.name | extractExtension }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex flex-col items-start justify-between\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t\t\t{{ file.name }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class=\"text-tertiary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\"> {{ file.size | toBytes }} </span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"inline-flex items-center justify-end gap-1 align-top\">\n\t\t\t\t\t\t@if (checkIfIsAudioFile(file)) {\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!this.audioService.isPlayingATrack()\n\t\t\t\t\t\t\t\t\t\t? ('sdk.fileUpload.dropzone.fileActions.play' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('sdk.fileUpload.dropzone.fileActions.pause' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button-play\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t[asButton]=\"true\"\n\t\t\t\t\t\t\t\t\t[trackIndex]=\"getIndexForTracks(file)\"\n\t\t\t\t\t\t\t\t\t(togglePlay)=\"handleAudioPlayerOpen()\"\n\t\t\t\t\t\t\t\t></st-button-play>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<div></div>\n\t\t\t\t\t\t<st-tooltip [label]=\"'sdk.fileUpload.dropzone.fileActions.download' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"text-lg\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDownload\"\n\t\t\t\t\t\t\t\tvariant=\"info\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handlefileDownload(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t<st-tooltip [label]=\"'sdk.fileUpload.dropzone.fileActions.remove' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"text-lg\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDelete\"\n\t\t\t\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handleRemove(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t}\n</div>\n@if (addAudioPlayer()) {\n\t<st-audio-player [tracks]=\"tracks()\" [showTrackList]=\"false\" variant=\"fixed\" [(opened)]=\"opened\"></st-audio-player>\n}\n" }]
435
+ }] });
436
+
437
+ /* eslint-disable @typescript-eslint/no-explicit-any */
438
+ /**
439
+ * A customizable file upload component with form integration and validation support
440
+ *
441
+ * @remarks
442
+ * Supports file type restrictions, form control integration, and visual validation states.
443
+ * Implements ControlValueAccessor for Angular form compatibility.
444
+ *
445
+ * @example
446
+ * ```html
447
+ * <!-- Basic file upload -->
448
+ * <st-file-uploader
449
+ * [extensions]="['.pdf', '.docx']"
450
+ * label="Upload Resume"
451
+ * ></st-file-uploader>
452
+ * ```
453
+ *
454
+ * @example
455
+ * ```html
456
+ * <!-- Reactive form integration -->
457
+ * <st-file-uploader
458
+ * [parentForm]="documentForm"
459
+ * formControlName="attachment"
460
+ * variant="primary"
461
+ * ></st-file-uploader>
462
+ * ```
463
+ */
464
+ class FileUploaderComponent {
465
+ /**
466
+ * Visual style variant
467
+ * @defaultValue 'secondary'
468
+ */
469
+ variant = input('secondary');
470
+ /**
471
+ * Component size variant
472
+ * @defaultValue 'md'
473
+ */
474
+ size = input('md');
475
+ /**
476
+ * Label displayed above the uploader
477
+ */
478
+ label = input('');
479
+ /**
480
+ * HTML name attribute for the input
481
+ */
482
+ name = input(null);
483
+ /**
484
+ * Placeholder text when no file is selected
485
+ */
486
+ placeholder = input('');
487
+ /**
488
+ * Whether to show allowed file extensions
489
+ * @defaultValue true
490
+ */
491
+ showExtensions = input(true);
492
+ /**
493
+ * Allowed file extensions (e.g., ['.pdf', '.docx'])
494
+ */
495
+ extensions = input.required();
496
+ /**
497
+ * Computed accept attribute for native file input
498
+ * @internal
499
+ */
500
+ accept = computed(() => this.extensions().join(','));
501
+ /**
502
+ * Event emitted when a valid file is selected
503
+ */
504
+ fileUpdated = output();
505
+ /**
506
+ * Current selected filename
507
+ * @internal
508
+ */
509
+ filename = '';
510
+ /**
511
+ * Current file value
512
+ * @internal
513
+ */
514
+ fileValue = null;
515
+ /**
516
+ * Formatted extensions string for display
517
+ * @internal
518
+ */
519
+ formattedExtensions = computed(() => this.extensions().join(', '));
520
+ /**
521
+ * Reference to the hidden file input
522
+ * @internal
523
+ */
524
+ fileInput = viewChild('uploader');
525
+ /**
526
+ * Event emitted on component blur
527
+ */
528
+ blurred = output();
529
+ /**
530
+ * Whether the component is disabled
531
+ * @defaultValue false
532
+ */
533
+ disabled = model(false);
534
+ /** @internal Track blur events for validation */
535
+ blurTrigger = signal(0);
536
+ /**
537
+ * Parent form group for reactive forms
538
+ */
539
+ parentForm = input(null);
540
+ /**
541
+ * Form control name for reactive forms
542
+ */
543
+ formControlName = input('');
544
+ /**
545
+ * Two-way bindable file value
546
+ */
547
+ value = model(null);
548
+ // ControlValueAccessor implementation
549
+ /** @internal */
550
+ onControlChange = () => { };
551
+ /** @internal */
552
+ onControlTouch = () => { };
553
+ /**
554
+ * Writes form value to component
555
+ * @param obj - The incoming form value
556
+ */
557
+ writeValue(obj) {
558
+ this.value.set(obj);
559
+ }
560
+ /**
561
+ * Registers change callback
562
+ * @param fn - Callback function for value changes
563
+ */
564
+ registerOnChange(fn) {
565
+ this.onControlChange = fn;
566
+ }
567
+ /**
568
+ * Registers touch callback
569
+ * @param fn - Callback function for touch events
570
+ */
571
+ registerOnTouched(fn) {
572
+ this.onControlTouch = fn;
573
+ }
574
+ /**
575
+ * Sets disabled state
576
+ * @param isDisabled - Whether the component should be disabled
577
+ */
578
+ setDisabledState(isDisabled) {
579
+ this.disabled.set(isDisabled);
580
+ }
581
+ /**
582
+ * Handles click event on the upload area
583
+ * @internal
584
+ */
585
+ handleClick() {
586
+ if (!this.fileInput())
587
+ return;
588
+ this.fileInput()?.nativeElement.click();
589
+ this.handleBlur();
590
+ }
591
+ /**
592
+ * Notifies form control of value changes
593
+ * @internal
594
+ */
595
+ handleChange() {
596
+ this.onControlChange(this.value());
597
+ }
598
+ /**
599
+ * Handles file selection from input
600
+ * @param event - File input change event
601
+ * @internal
602
+ */
603
+ handleFileChange(event) {
604
+ const file = event.target.files?.[0];
605
+ if (file instanceof File) {
606
+ this.filename = file.name;
607
+ this.value.set(file);
608
+ this.fileUpdated.emit(file);
609
+ this.handleChange();
610
+ }
611
+ }
612
+ /**
613
+ * Clears selected file
614
+ * @internal
615
+ */
616
+ removeFile() {
617
+ this.filename = '';
618
+ this.value.set(null);
619
+ this.handleChange();
620
+ }
621
+ /**
622
+ * @internal
623
+ * Returns base component classes
624
+ */
625
+ componentClass() {
626
+ return {
627
+ variant: this.variant(),
628
+ size: this.size(),
629
+ };
630
+ }
631
+ /**
632
+ * @internal
633
+ * Returns error state classes
634
+ */
635
+ errorClass() {
636
+ return {
637
+ variant: 'error',
638
+ size: this.size(),
639
+ };
640
+ }
641
+ /**
642
+ * @internal
643
+ * Returns success state classes
644
+ */
645
+ successClass() {
646
+ return {
647
+ variant: 'success',
648
+ size: this.size(),
649
+ };
650
+ }
651
+ /**
652
+ * Handles blur events and validation
653
+ * @internal
654
+ */
655
+ handleBlur() {
656
+ this.blurred.emit(this.value());
657
+ this.onControlTouch();
658
+ this.blurTrigger.update((v) => v + 1);
659
+ }
660
+ // Form control integration
661
+ /** @internal */
662
+ formControl = computed(() => this.parentForm()?.get(this.formControlName()));
663
+ /** @internal */
664
+ formControl$ = toObservable(this.formControl);
665
+ /** @internal */
666
+ statusChanges$ = this.formControl$.pipe(switchMap((control) => control?.statusChanges.pipe(startWith(control.status)) || []));
667
+ /** @internal */
668
+ stateChanges$ = this.formControl$.pipe(switchMap((control) => control?.valueChanges.pipe(startWith(control.value)) || []));
669
+ /** @internal */
670
+ statusSignal = toSignal(this.statusChanges$);
671
+ /** @internal */
672
+ stateSignal = toSignal(this.stateChanges$);
673
+ /**
674
+ * Computes validation classes based on form state
675
+ * @internal
676
+ */
677
+ validationClass = computed(() => {
678
+ const control = this.formControl();
679
+ const trigger = this.blurTrigger();
680
+ if (!control)
681
+ return this.componentClass();
682
+ const isTouched = control.touched || trigger > 0;
683
+ this.statusSignal();
684
+ this.stateSignal();
685
+ if (control.dirty || isTouched) {
686
+ if (control.invalid)
687
+ return this.errorClass();
688
+ if (control.valid)
689
+ return this.successClass();
690
+ }
691
+ return this.componentClass();
692
+ });
693
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: FileUploaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
694
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: FileUploaderComponent, isStandalone: true, selector: "st-file-uploader", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showExtensions: { classPropertyName: "showExtensions", publicName: "showExtensions", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileUpdated: "fileUpdated", blurred: "blurred", disabled: "disabledChange", value: "valueChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["uploader"], descendants: true, isSignal: true }], ngImport: i0, template: "<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t(blur)=\"handleBlur()\"\n\t[disabled]=\"disabled()\"\n\t(valueChange)=\"handleChange()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" tyFontWeight=\"normal\">\n\t\t\t\t\t{{ 'sdk.fileUpload.fileUploader.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ formattedExtensions() }}</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</st-input>\n\n<input type=\"file\" #uploader hidden (change)=\"handleFileChange($event)\" (blur)=\"handleBlur()\" [accept]=\"accept()\" required />\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: InputComponent, selector: "st-input", inputs: ["variant", "size", "label", "type", "name", "placeholder", "readonly", "focus", "onlyNumbers", "ghost", "value", "parentForm", "formControlName", "disabled", "debounceTime"], outputs: ["valueChange", "disabledChange", "enterPressed", "blurred", "valueDebounced"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default });
695
+ }
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: FileUploaderComponent, decorators: [{
697
+ type: Component,
698
+ args: [{ selector: 'st-file-uploader', imports: [FormsModule, InputComponent, TypographyDirective, TranslatePipe], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], changeDetection: ChangeDetectionStrategy.Default, template: "<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t(blur)=\"handleBlur()\"\n\t[disabled]=\"disabled()\"\n\t(valueChange)=\"handleChange()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" tyFontWeight=\"normal\">\n\t\t\t\t\t{{ 'sdk.fileUpload.fileUploader.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ formattedExtensions() }}</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</st-input>\n\n<input type=\"file\" #uploader hidden (change)=\"handleFileChange($event)\" (blur)=\"handleBlur()\" [accept]=\"accept()\" required />\n" }]
699
+ }] });
700
+
701
+ /**
702
+ * Generated bundle index. Do not edit.
703
+ */
704
+
705
+ export { ARCHIVE_EXTENSIONS, AUDIO_EXTENSIONS, CODE_EXTENSIONS, DOCUMENT_EXTENSIONS, DropzoneComponent, FileUploaderComponent, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS };
706
+ //# sourceMappingURL=sixbell-telco-sdk-components-file-upload.mjs.map