@caribeng/ui 22.1.1 → 22.4.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 (305) hide show
  1. package/README.md +134 -12
  2. package/fesm2022/caribeng-ui-accordion.mjs +4 -4
  3. package/fesm2022/caribeng-ui-anchor.mjs +169 -0
  4. package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
  5. package/fesm2022/caribeng-ui-avatar.mjs +2 -2
  6. package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
  7. package/fesm2022/caribeng-ui-badge.mjs +8 -2
  8. package/fesm2022/caribeng-ui-blockui.mjs +12 -4
  9. package/fesm2022/caribeng-ui-breadcrumb.mjs +17 -7
  10. package/fesm2022/caribeng-ui-button.mjs +22 -2
  11. package/fesm2022/caribeng-ui-caribe-alert.mjs +5 -2
  12. package/fesm2022/caribeng-ui-caribe-animation-lottie.mjs +6 -3
  13. package/fesm2022/caribeng-ui-caribe-button-group.mjs +6 -3
  14. package/fesm2022/caribeng-ui-caribe-calendar.mjs +11 -6
  15. package/fesm2022/caribeng-ui-caribe-card-content.mjs +6 -3
  16. package/fesm2022/caribeng-ui-caribe-card-move.mjs +29 -7
  17. package/fesm2022/caribeng-ui-caribe-card-select.mjs +56 -14
  18. package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +10 -7
  19. package/fesm2022/caribeng-ui-caribe-coachmark.mjs +42 -19
  20. package/fesm2022/caribeng-ui-caribe-data-table.mjs +15 -9
  21. package/fesm2022/caribeng-ui-caribe-dots-indicator.mjs +38 -5
  22. package/fesm2022/caribeng-ui-caribe-expansion-panel.mjs +16 -5
  23. package/fesm2022/caribeng-ui-caribe-fab-menu.mjs +56 -7
  24. package/fesm2022/caribeng-ui-caribe-file-download.mjs +68 -27
  25. package/fesm2022/caribeng-ui-caribe-file-select.mjs +22 -17
  26. package/fesm2022/caribeng-ui-caribe-float-menu.mjs +6 -3
  27. package/fesm2022/caribeng-ui-caribe-footer.mjs +8 -4
  28. package/fesm2022/caribeng-ui-caribe-header.mjs +6 -3
  29. package/fesm2022/caribeng-ui-caribe-icon-button.mjs +6 -3
  30. package/fesm2022/caribeng-ui-caribe-illustration.mjs +6 -3
  31. package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +5 -2
  32. package/fesm2022/caribeng-ui-caribe-input-search.mjs +14 -10
  33. package/fesm2022/caribeng-ui-caribe-input-select.mjs +12 -10
  34. package/fesm2022/caribeng-ui-caribe-input-token.mjs +61 -11
  35. package/fesm2022/caribeng-ui-caribe-link.mjs +7 -2
  36. package/fesm2022/caribeng-ui-caribe-loader.mjs +8 -5
  37. package/fesm2022/caribeng-ui-caribe-modal.mjs +32 -16
  38. package/fesm2022/caribeng-ui-caribe-off-canvas.mjs +26 -12
  39. package/fesm2022/caribeng-ui-caribe-onboarding.mjs +44 -19
  40. package/fesm2022/caribeng-ui-caribe-pictogram.mjs +6 -3
  41. package/fesm2022/caribeng-ui-caribe-pop-over.mjs +34 -10
  42. package/fesm2022/caribeng-ui-caribe-preloader.mjs +9 -6
  43. package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +5 -2
  44. package/fesm2022/caribeng-ui-caribe-shortcut.mjs +8 -3
  45. package/fesm2022/caribeng-ui-caribe-step-indicator.mjs +12 -5
  46. package/fesm2022/caribeng-ui-caribe-stroke.mjs +6 -3
  47. package/fesm2022/caribeng-ui-caribe-switch.mjs +5 -3
  48. package/fesm2022/caribeng-ui-caribe-tag-button.mjs +1 -1
  49. package/fesm2022/caribeng-ui-caribe-tracker.mjs +5 -2
  50. package/fesm2022/caribeng-ui-caribe-transaction-status.mjs +1 -1
  51. package/fesm2022/caribeng-ui-caribe-voucher.mjs +11 -8
  52. package/fesm2022/caribeng-ui-carousel.mjs +49 -14
  53. package/fesm2022/caribeng-ui-cascadeselect.mjs +22 -8
  54. package/fesm2022/caribeng-ui-chart.mjs +2601 -303
  55. package/fesm2022/caribeng-ui-chat.mjs +1303 -0
  56. package/fesm2022/caribeng-ui-chip.mjs +9 -4
  57. package/fesm2022/caribeng-ui-chips.mjs +9 -5
  58. package/fesm2022/caribeng-ui-code-block.mjs +332 -0
  59. package/fesm2022/caribeng-ui-colorpicker.mjs +107 -11
  60. package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
  61. package/fesm2022/caribeng-ui-confirmdialog.mjs +140 -10
  62. package/fesm2022/caribeng-ui-confirmpopup.mjs +209 -9
  63. package/fesm2022/caribeng-ui-contextmenu.mjs +13 -6
  64. package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
  65. package/fesm2022/caribeng-ui-dataview.mjs +214 -6
  66. package/fesm2022/caribeng-ui-datepicker.mjs +1630 -393
  67. package/fesm2022/caribeng-ui-descriptions.mjs +124 -0
  68. package/fesm2022/caribeng-ui-dialog.mjs +10 -7
  69. package/fesm2022/caribeng-ui-dock.mjs +58 -15
  70. package/fesm2022/caribeng-ui-drawer.mjs +17 -9
  71. package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
  72. package/fesm2022/caribeng-ui-editor.mjs +4413 -243
  73. package/fesm2022/caribeng-ui-empty.mjs +80 -0
  74. package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
  75. package/fesm2022/caribeng-ui-file-card.mjs +136 -19
  76. package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
  77. package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
  78. package/fesm2022/caribeng-ui-folder-card.mjs +132 -15
  79. package/fesm2022/caribeng-ui-galleria.mjs +76 -45
  80. package/fesm2022/caribeng-ui-image.mjs +52 -29
  81. package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
  82. package/fesm2022/caribeng-ui-inplace.mjs +22 -6
  83. package/fesm2022/caribeng-ui-input-number.mjs +9 -7
  84. package/fesm2022/caribeng-ui-inputgroup.mjs +2 -2
  85. package/fesm2022/caribeng-ui-inputmask.mjs +22 -13
  86. package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
  87. package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
  88. package/fesm2022/caribeng-ui-kbd.mjs +122 -0
  89. package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
  90. package/fesm2022/caribeng-ui-listbox.mjs +13 -11
  91. package/fesm2022/caribeng-ui-megamenu.mjs +228 -32
  92. package/fesm2022/caribeng-ui-mentions.mjs +495 -0
  93. package/fesm2022/caribeng-ui-menu.mjs +18 -8
  94. package/fesm2022/caribeng-ui-menubar.mjs +17 -8
  95. package/fesm2022/caribeng-ui-message.mjs +13 -7
  96. package/fesm2022/caribeng-ui-metergroup.mjs +29 -11
  97. package/fesm2022/caribeng-ui-multiselect.mjs +399 -97
  98. package/fesm2022/caribeng-ui-orderlist.mjs +230 -11
  99. package/fesm2022/caribeng-ui-organizationchart.mjs +16 -15
  100. package/fesm2022/caribeng-ui-paginator.mjs +18 -15
  101. package/fesm2022/caribeng-ui-panel.mjs +11 -8
  102. package/fesm2022/caribeng-ui-panelmenu.mjs +14 -8
  103. package/fesm2022/caribeng-ui-password.mjs +8 -6
  104. package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
  105. package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
  106. package/fesm2022/caribeng-ui-picklist.mjs +251 -14
  107. package/fesm2022/caribeng-ui-pricing.mjs +272 -75
  108. package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
  109. package/fesm2022/caribeng-ui-rating.mjs +7 -3
  110. package/fesm2022/caribeng-ui-repeater.mjs +223 -0
  111. package/fesm2022/caribeng-ui-result.mjs +91 -0
  112. package/fesm2022/caribeng-ui-ripple.mjs +2 -0
  113. package/fesm2022/caribeng-ui-scrollpanel.mjs +6 -3
  114. package/fesm2022/caribeng-ui-scrolltop.mjs +9 -4
  115. package/fesm2022/caribeng-ui-select.mjs +379 -87
  116. package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
  117. package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
  118. package/fesm2022/caribeng-ui-slider.mjs +171 -75
  119. package/fesm2022/caribeng-ui-speeddial.mjs +7 -4
  120. package/fesm2022/caribeng-ui-spinner.mjs +5 -2
  121. package/fesm2022/caribeng-ui-splitbutton.mjs +163 -0
  122. package/fesm2022/caribeng-ui-splitter.mjs +5 -2
  123. package/fesm2022/caribeng-ui-statistic.mjs +183 -0
  124. package/fesm2022/caribeng-ui-stepper.mjs +17 -7
  125. package/fesm2022/caribeng-ui-steps.mjs +6 -3
  126. package/fesm2022/caribeng-ui-table.mjs +716 -84
  127. package/fesm2022/caribeng-ui-tabmenu.mjs +13 -6
  128. package/fesm2022/caribeng-ui-tag.mjs +2 -2
  129. package/fesm2022/caribeng-ui-terminal.mjs +45 -9
  130. package/fesm2022/caribeng-ui-themetoggle.mjs +82 -0
  131. package/fesm2022/caribeng-ui-tieredmenu.mjs +113 -20
  132. package/fesm2022/caribeng-ui-timeline.mjs +175 -6
  133. package/fesm2022/caribeng-ui-toast.mjs +7 -4
  134. package/fesm2022/caribeng-ui-togglebutton.mjs +8 -6
  135. package/fesm2022/caribeng-ui-toolbar.mjs +6 -3
  136. package/fesm2022/caribeng-ui-tree.mjs +302 -6
  137. package/fesm2022/caribeng-ui-treeselect.mjs +26 -10
  138. package/fesm2022/caribeng-ui-treetable.mjs +269 -6
  139. package/fesm2022/caribeng-ui-virtualscroller.mjs +123 -10
  140. package/fesm2022/caribeng-ui.mjs +1216 -6
  141. package/package.json +93 -3
  142. package/schematics/collection.json +15 -0
  143. package/schematics/migrate-from-primeng/core-icons.json +1 -0
  144. package/schematics/migrate-from-primeng/icons.js +269 -0
  145. package/schematics/migrate-from-primeng/index.js +290 -0
  146. package/schematics/migrate-from-primeng/mappings/button.js +93 -0
  147. package/schematics/migrate-from-primeng/mappings/card.js +33 -0
  148. package/schematics/migrate-from-primeng/mappings/checkbox.js +44 -0
  149. package/schematics/migrate-from-primeng/mappings/confirm.js +221 -0
  150. package/schematics/migrate-from-primeng/mappings/datepicker.js +121 -0
  151. package/schematics/migrate-from-primeng/mappings/dialog.js +84 -0
  152. package/schematics/migrate-from-primeng/mappings/index.js +88 -0
  153. package/schematics/migrate-from-primeng/mappings/inputnumber.js +62 -0
  154. package/schematics/migrate-from-primeng/mappings/inputtext.js +60 -0
  155. package/schematics/migrate-from-primeng/mappings/menu.js +468 -0
  156. package/schematics/migrate-from-primeng/mappings/multiselect.js +49 -0
  157. package/schematics/migrate-from-primeng/mappings/radiobutton.js +22 -0
  158. package/schematics/migrate-from-primeng/mappings/rules.js +206 -0
  159. package/schematics/migrate-from-primeng/mappings/select.js +97 -0
  160. package/schematics/migrate-from-primeng/mappings/service-calls.js +100 -0
  161. package/schematics/migrate-from-primeng/mappings/table.js +613 -0
  162. package/schematics/migrate-from-primeng/mappings/tabs.js +225 -0
  163. package/schematics/migrate-from-primeng/mappings/tag.js +29 -0
  164. package/schematics/migrate-from-primeng/mappings/textarea.js +44 -0
  165. package/schematics/migrate-from-primeng/mappings/toast.js +173 -0
  166. package/schematics/migrate-from-primeng/mappings/toggleswitch.js +37 -0
  167. package/schematics/migrate-from-primeng/mappings/tooltip.js +44 -0
  168. package/schematics/migrate-from-primeng/mappings/types.js +10 -0
  169. package/schematics/migrate-from-primeng/report.js +79 -0
  170. package/schematics/migrate-from-primeng/schema.js +2 -0
  171. package/schematics/migrate-from-primeng/schema.json +34 -0
  172. package/schematics/migrate-from-primeng/template.js +387 -0
  173. package/schematics/migrate-from-primeng/todo.js +5 -0
  174. package/schematics/migrate-from-primeng/typescript.js +442 -0
  175. package/schematics/migrate-from-primeng/workspace.js +117 -0
  176. package/schematics/ng-add/index.js +140 -0
  177. package/schematics/ng-add/schema.js +2 -0
  178. package/schematics/ng-add/schema.json +66 -0
  179. package/types/caribeng-ui-anchor.d.ts +50 -0
  180. package/types/caribeng-ui-autocomplete.d.ts +4 -2
  181. package/types/caribeng-ui-avatargroup.d.ts +3 -1
  182. package/types/caribeng-ui-badge.d.ts +3 -1
  183. package/types/caribeng-ui-blockui.d.ts +9 -4
  184. package/types/caribeng-ui-breadcrumb.d.ts +11 -0
  185. package/types/caribeng-ui-button.d.ts +9 -1
  186. package/types/caribeng-ui-caribe-alert.d.ts +3 -0
  187. package/types/caribeng-ui-caribe-animation-lottie.d.ts +4 -1
  188. package/types/caribeng-ui-caribe-button-group.d.ts +4 -1
  189. package/types/caribeng-ui-caribe-calendar.d.ts +5 -1
  190. package/types/caribeng-ui-caribe-card-content.d.ts +4 -1
  191. package/types/caribeng-ui-caribe-card-move.d.ts +13 -13
  192. package/types/caribeng-ui-caribe-card-select.d.ts +10 -1
  193. package/types/caribeng-ui-caribe-circle-loading.d.ts +4 -1
  194. package/types/caribeng-ui-caribe-coachmark.d.ts +6 -0
  195. package/types/caribeng-ui-caribe-data-table.d.ts +7 -2
  196. package/types/caribeng-ui-caribe-dots-indicator.d.ts +9 -0
  197. package/types/caribeng-ui-caribe-expansion-panel.d.ts +7 -10
  198. package/types/caribeng-ui-caribe-fab-menu.d.ts +10 -1
  199. package/types/caribeng-ui-caribe-file-download.d.ts +8 -10
  200. package/types/caribeng-ui-caribe-file-select.d.ts +7 -1
  201. package/types/caribeng-ui-caribe-float-menu.d.ts +4 -1
  202. package/types/caribeng-ui-caribe-header.d.ts +3 -0
  203. package/types/caribeng-ui-caribe-icon-button.d.ts +4 -1
  204. package/types/caribeng-ui-caribe-illustration.d.ts +4 -1
  205. package/types/caribeng-ui-caribe-inline-alert.d.ts +3 -0
  206. package/types/caribeng-ui-caribe-input-search.d.ts +4 -2
  207. package/types/caribeng-ui-caribe-input-select.d.ts +4 -2
  208. package/types/caribeng-ui-caribe-input-token.d.ts +16 -1
  209. package/types/caribeng-ui-caribe-link.d.ts +3 -0
  210. package/types/caribeng-ui-caribe-loader.d.ts +4 -1
  211. package/types/caribeng-ui-caribe-modal.d.ts +7 -10
  212. package/types/caribeng-ui-caribe-off-canvas.d.ts +6 -1
  213. package/types/caribeng-ui-caribe-onboarding.d.ts +6 -0
  214. package/types/caribeng-ui-caribe-pictogram.d.ts +4 -1
  215. package/types/caribeng-ui-caribe-pop-over.d.ts +7 -10
  216. package/types/caribeng-ui-caribe-preloader.d.ts +4 -1
  217. package/types/caribeng-ui-caribe-progress-bar.d.ts +3 -0
  218. package/types/caribeng-ui-caribe-shortcut.d.ts +3 -1
  219. package/types/caribeng-ui-caribe-step-indicator.d.ts +6 -0
  220. package/types/caribeng-ui-caribe-stroke.d.ts +4 -1
  221. package/types/caribeng-ui-caribe-switch.d.ts +3 -1
  222. package/types/caribeng-ui-caribe-tracker.d.ts +3 -0
  223. package/types/caribeng-ui-caribe-voucher.d.ts +5 -2
  224. package/types/caribeng-ui-carousel.d.ts +10 -1
  225. package/types/caribeng-ui-cascadeselect.d.ts +7 -2
  226. package/types/caribeng-ui-chart.d.ts +471 -44
  227. package/types/caribeng-ui-chat.d.ts +299 -0
  228. package/types/caribeng-ui-chip.d.ts +6 -0
  229. package/types/caribeng-ui-chips.d.ts +6 -2
  230. package/types/caribeng-ui-code-block.d.ts +65 -0
  231. package/types/caribeng-ui-colorpicker.d.ts +8 -2
  232. package/types/caribeng-ui-command-palette.d.ts +133 -0
  233. package/types/caribeng-ui-confirmdialog.d.ts +57 -6
  234. package/types/caribeng-ui-confirmpopup.d.ts +74 -5
  235. package/types/caribeng-ui-contextmenu.d.ts +11 -1
  236. package/types/caribeng-ui-copy-button.d.ts +90 -0
  237. package/types/caribeng-ui-dataview.d.ts +65 -5
  238. package/types/caribeng-ui-datepicker.d.ts +186 -21
  239. package/types/caribeng-ui-descriptions.d.ts +63 -0
  240. package/types/caribeng-ui-dialog.d.ts +4 -1
  241. package/types/caribeng-ui-dock.d.ts +17 -2
  242. package/types/caribeng-ui-drawer.d.ts +7 -2
  243. package/types/caribeng-ui-dynamicdialog.d.ts +93 -3
  244. package/types/caribeng-ui-editor.d.ts +486 -13
  245. package/types/caribeng-ui-empty.d.ts +34 -0
  246. package/types/caribeng-ui-file-card.d.ts +28 -3
  247. package/types/caribeng-ui-fileupload.d.ts +27 -4
  248. package/types/caribeng-ui-folder-card.d.ts +31 -6
  249. package/types/caribeng-ui-galleria.d.ts +9 -0
  250. package/types/caribeng-ui-image.d.ts +10 -0
  251. package/types/caribeng-ui-inplace.d.ts +8 -0
  252. package/types/caribeng-ui-input-number.d.ts +3 -1
  253. package/types/caribeng-ui-inputmask.d.ts +8 -1
  254. package/types/caribeng-ui-inputotp.d.ts +7 -2
  255. package/types/caribeng-ui-kanban.d.ts +783 -0
  256. package/types/caribeng-ui-kbd.d.ts +36 -0
  257. package/types/caribeng-ui-keyfilter.d.ts +30 -0
  258. package/types/caribeng-ui-listbox.d.ts +5 -3
  259. package/types/caribeng-ui-megamenu.d.ts +37 -2
  260. package/types/caribeng-ui-mentions.d.ts +127 -0
  261. package/types/caribeng-ui-menu.d.ts +14 -2
  262. package/types/caribeng-ui-menubar.d.ts +12 -1
  263. package/types/caribeng-ui-message.d.ts +5 -0
  264. package/types/caribeng-ui-metergroup.d.ts +9 -1
  265. package/types/caribeng-ui-multiselect.d.ts +71 -10
  266. package/types/caribeng-ui-orderlist.d.ts +58 -6
  267. package/types/caribeng-ui-organizationchart.d.ts +7 -1
  268. package/types/caribeng-ui-paginator.d.ts +3 -0
  269. package/types/caribeng-ui-panel.d.ts +3 -0
  270. package/types/caribeng-ui-panelmenu.d.ts +11 -1
  271. package/types/caribeng-ui-password.d.ts +4 -2
  272. package/types/caribeng-ui-pdfviewer.d.ts +258 -0
  273. package/types/caribeng-ui-phone-input.d.ts +168 -0
  274. package/types/caribeng-ui-picklist.d.ts +67 -7
  275. package/types/caribeng-ui-pricing.d.ts +49 -9
  276. package/types/caribeng-ui-qrcode.d.ts +88 -0
  277. package/types/caribeng-ui-rating.d.ts +6 -2
  278. package/types/caribeng-ui-repeater.d.ts +79 -0
  279. package/types/caribeng-ui-result.d.ts +35 -0
  280. package/types/caribeng-ui-scrollpanel.d.ts +4 -1
  281. package/types/caribeng-ui-scrolltop.d.ts +4 -1
  282. package/types/caribeng-ui-select.d.ts +73 -9
  283. package/types/caribeng-ui-sidebar.d.ts +167 -0
  284. package/types/caribeng-ui-slider.d.ts +63 -10
  285. package/types/caribeng-ui-speeddial.d.ts +5 -2
  286. package/types/caribeng-ui-spinner.d.ts +3 -0
  287. package/types/caribeng-ui-splitbutton.d.ts +49 -0
  288. package/types/caribeng-ui-splitter.d.ts +3 -0
  289. package/types/caribeng-ui-statistic.d.ts +65 -0
  290. package/types/caribeng-ui-stepper.d.ts +5 -0
  291. package/types/caribeng-ui-steps.d.ts +4 -1
  292. package/types/caribeng-ui-table.d.ts +185 -17
  293. package/types/caribeng-ui-tabmenu.d.ts +11 -1
  294. package/types/caribeng-ui-terminal.d.ts +10 -0
  295. package/types/caribeng-ui-themetoggle.d.ts +32 -0
  296. package/types/caribeng-ui-tieredmenu.d.ts +22 -3
  297. package/types/caribeng-ui-timeline.d.ts +63 -4
  298. package/types/caribeng-ui-toast.d.ts +3 -0
  299. package/types/caribeng-ui-togglebutton.d.ts +5 -3
  300. package/types/caribeng-ui-toolbar.d.ts +7 -4
  301. package/types/caribeng-ui-tree.d.ts +76 -4
  302. package/types/caribeng-ui-treeselect.d.ts +10 -2
  303. package/types/caribeng-ui-treetable.d.ts +68 -4
  304. package/types/caribeng-ui-virtualscroller.d.ts +45 -5
  305. package/types/caribeng-ui.d.ts +775 -12
@@ -0,0 +1,80 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { injectCbTranslation } from '@caribeng/ui';
4
+ import { CbIcon } from '@caribeng/ui/icon';
5
+
6
+ /**
7
+ * Empty de CaribeNG: estado vacío con icono o imagen, mensaje y acciones
8
+ * opcionales (proyectadas). Úsalo cuando una lista, búsqueda o tabla no tiene
9
+ * datos.
10
+ *
11
+ * @example
12
+ * ```html
13
+ * <cb-empty title="Aún no tienes movimientos" description="Cuando hagas tu primera compra aparecerá aquí.">
14
+ * <cb-button size="sm">Hacer una transferencia</cb-button>
15
+ * </cb-empty>
16
+ * ```
17
+ */
18
+ class CbEmpty {
19
+ constructor() {
20
+ /** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
21
+ this.t = injectCbTranslation();
22
+ /** Mensaje principal. Por defecto, "Sin datos" del idioma activo. */
23
+ this.title = input(undefined, /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
25
+ /** Texto de apoyo opcional. */
26
+ this.description = input('', /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
28
+ /** Icono (se ignora si hay `image`). */
29
+ this.icon = input('folder', /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
31
+ /** Ilustración opcional (decorativa). */
32
+ this.image = input('', /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "image" }] : /* istanbul ignore next */ []));
34
+ /** `sm` para tablas, listas y paneles pequeños. */
35
+ this.size = input('md', /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
37
+ }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbEmpty, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
39
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbEmpty, isStandalone: true, selector: "cb-empty", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-empty--sm": "size() === 'sm'" }, classAttribute: "cb-empty" }, ngImport: i0, template: `
40
+ @if (image()) {
41
+ <img class="cb-empty__image" [src]="image()" alt="" />
42
+ } @else {
43
+ <span class="cb-empty__icon" aria-hidden="true">
44
+ <cb-icon [name]="icon()" [size]="size() === 'sm' ? 22 : 32" />
45
+ </span>
46
+ }
47
+ <p class="cb-empty__title">{{ title() ?? t().noData }}</p>
48
+ @if (description()) {
49
+ <p class="cb-empty__description">{{ description() }}</p>
50
+ }
51
+ <div class="cb-empty__actions"><ng-content /></div>
52
+ `, isInline: true, styles: [":host{display:flex;flex-direction:column;align-items:center;gap:var(--cb-space-2, .5rem);padding:var(--cb-space-8, 2rem) var(--cb-space-4, 1rem);text-align:center;font-family:var(--cb-font-sans, inherit);color:var(--cb-color-text)}:host(.cb-empty--sm){padding:var(--cb-space-4, 1rem);gap:var(--cb-space-1, .25rem)}.cb-empty__icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;margin-bottom:var(--cb-space-1, .25rem);color:var(--cb-color-text-muted);background-color:var(--cb-color-surface-subtle);border-radius:999px}:host(.cb-empty--sm) .cb-empty__icon{width:2.75rem;height:2.75rem}.cb-empty__image{max-width:10rem;max-height:8rem;margin-bottom:var(--cb-space-2, .5rem)}.cb-empty__title{margin:0;font-size:var(--cb-text-base, 1rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}:host(.cb-empty--sm) .cb-empty__title{font-size:var(--cb-text-sm, .875rem)}.cb-empty__description{max-width:28rem;margin:0;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted)}.cb-empty__actions{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-2, .5rem)}.cb-empty__actions:empty{display:none}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
53
+ }
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbEmpty, decorators: [{
55
+ type: Component,
56
+ args: [{ selector: 'cb-empty', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-empty', '[class.cb-empty--sm]': "size() === 'sm'" }, template: `
57
+ @if (image()) {
58
+ <img class="cb-empty__image" [src]="image()" alt="" />
59
+ } @else {
60
+ <span class="cb-empty__icon" aria-hidden="true">
61
+ <cb-icon [name]="icon()" [size]="size() === 'sm' ? 22 : 32" />
62
+ </span>
63
+ }
64
+ <p class="cb-empty__title">{{ title() ?? t().noData }}</p>
65
+ @if (description()) {
66
+ <p class="cb-empty__description">{{ description() }}</p>
67
+ }
68
+ <div class="cb-empty__actions"><ng-content /></div>
69
+ `, styles: [":host{display:flex;flex-direction:column;align-items:center;gap:var(--cb-space-2, .5rem);padding:var(--cb-space-8, 2rem) var(--cb-space-4, 1rem);text-align:center;font-family:var(--cb-font-sans, inherit);color:var(--cb-color-text)}:host(.cb-empty--sm){padding:var(--cb-space-4, 1rem);gap:var(--cb-space-1, .25rem)}.cb-empty__icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;margin-bottom:var(--cb-space-1, .25rem);color:var(--cb-color-text-muted);background-color:var(--cb-color-surface-subtle);border-radius:999px}:host(.cb-empty--sm) .cb-empty__icon{width:2.75rem;height:2.75rem}.cb-empty__image{max-width:10rem;max-height:8rem;margin-bottom:var(--cb-space-2, .5rem)}.cb-empty__title{margin:0;font-size:var(--cb-text-base, 1rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}:host(.cb-empty--sm) .cb-empty__title{font-size:var(--cb-text-sm, .875rem)}.cb-empty__description{max-width:28rem;margin:0;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted)}.cb-empty__actions{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-2, .5rem)}.cb-empty__actions:empty{display:none}\n"] }]
70
+ }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
71
+
72
+ /*
73
+ * Public API Surface de @caribeng/ui/empty
74
+ */
75
+
76
+ /**
77
+ * Generated bundle index. Do not edit.
78
+ */
79
+
80
+ export { CbEmpty };
@@ -42,7 +42,7 @@ class CbFieldset {
42
42
  type="button"
43
43
  class="cb-fieldset__toggler"
44
44
  [attr.aria-expanded]="!collapsed()"
45
- [attr.aria-controls]="contentId"
45
+ [attr.aria-controls]="collapsed() ? null : contentId"
46
46
  (click)="toggle()"
47
47
  >
48
48
  <cb-icon
@@ -84,7 +84,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
84
84
  type="button"
85
85
  class="cb-fieldset__toggler"
86
86
  [attr.aria-expanded]="!collapsed()"
87
- [attr.aria-controls]="contentId"
87
+ [attr.aria-controls]="collapsed() ? null : contentId"
88
88
  (click)="toggle()"
89
89
  >
90
90
  <cb-icon
@@ -1,20 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { viewChild, input, booleanAttribute, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { CbIcon } from '@caribeng/ui/icon';
4
+ import { CbMenu } from '@caribeng/ui/menu';
5
+ import { injectCbTranslation } from '@caribeng/ui';
4
6
 
5
7
  /**
6
8
  * Tarjeta de categoría/almacenamiento de CaribeNG: icono con tinte, título y
7
9
  * subtítulo a la izquierda; dos valores alineados a la derecha. Útil para
8
10
  * resúmenes de media, almacenamiento o métricas de categoría.
9
11
  *
12
+ * Como `cb-folder-card`: con `actions` muestra un botón ⋮ con un menú
13
+ * (`actionSelect`) y con `clickable` toda la tarjeta emite `open`.
14
+ *
10
15
  * @example
11
16
  * ```html
12
17
  * <cb-file-card icon="image" color="#10b981" title="Imágenes"
13
- * subtitle="17% usado" value="245 archivos" valueSub="26.4 GB" />
18
+ * subtitle="17% usado" value="245 archivos" valueSub="26.4 GB"
19
+ * clickable (open)="verImagenes()" />
14
20
  * ```
15
21
  */
16
22
  class CbFileCard {
17
23
  constructor() {
24
+ /** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
25
+ this.t = injectCbTranslation();
26
+ this.menu = viewChild('menu', /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
28
+ this.trigger = viewChild('trigger', /* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
18
30
  /** Nombre del icono (del set de CaribeNG). */
19
31
  this.icon = input('file', /* @ts-ignore */
20
32
  ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
@@ -33,55 +45,160 @@ class CbFileCard {
33
45
  /** Valor secundario a la derecha (p. ej. "26.4 GB"). */
34
46
  this.valueSub = input('', /* @ts-ignore */
35
47
  ...(ngDevMode ? [{ debugName: "valueSub" }] : /* istanbul ignore next */ []));
48
+ /** Acciones del menú ⋮. Sin acciones no se muestra el botón. */
49
+ this.actions = input([], /* @ts-ignore */
50
+ ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
51
+ /** Nombre del botón ⋮ y del menú. Por defecto, "Más acciones: {título}" del idioma activo. */
52
+ this.actionsAriaLabel = input(undefined, /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "actionsAriaLabel" }] : /* istanbul ignore next */ []));
54
+ /** Toda la tarjeta es pulsable y emite `open` (clic, Enter o Espacio). */
55
+ this.clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
56
+ /** Acción elegida en el menú ⋮. */
57
+ this.actionSelect = output();
58
+ /** Se pulsó la tarjeta (solo con `clickable`). */
59
+ this.open = output();
60
+ this.menuOpen = signal(false, /* @ts-ignore */
61
+ ...(ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []));
62
+ this.menuLabel = computed(() => {
63
+ const custom = this.actionsAriaLabel();
64
+ if (custom)
65
+ return custom;
66
+ const title = this.title();
67
+ return title ? `${this.t().moreActions}: ${title}` : this.t().moreActions;
68
+ }, /* @ts-ignore */
69
+ ...(ngDevMode ? [{ debugName: "menuLabel" }] : /* istanbul ignore next */ []));
36
70
  }
37
- /** Fondo tintado derivado del color (con alpha). */
71
+ /** Fondo tintado derivado del color (cualquier color CSS: hex, rgb(), var(--…)). */
38
72
  tintBg() {
39
73
  const c = this.color();
40
- return c ? `${c}1f` : null;
74
+ return c ? `color-mix(in srgb, ${c} 12%, transparent)` : null;
75
+ }
76
+ /** Abre o cierra el menú de acciones anclado al botón ⋮. */
77
+ toggleMenu() {
78
+ const menu = this.menu();
79
+ const trigger = this.trigger()?.nativeElement;
80
+ if (!menu || !trigger)
81
+ return;
82
+ if (menu.isOpen) {
83
+ menu.hide();
84
+ return;
85
+ }
86
+ menu.show(trigger);
87
+ this.menuOpen.set(true);
88
+ }
89
+ openFromKeyboard(event) {
90
+ event.preventDefault();
91
+ if (!this.menu()?.isOpen)
92
+ this.toggleMenu();
41
93
  }
42
94
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFileCard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
43
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFileCard, isStandalone: true, selector: "cb-file-card", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueSub: { classPropertyName: "valueSub", publicName: "valueSub", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-file-card" }, ngImport: i0, template: `
95
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFileCard, isStandalone: true, selector: "cb-file-card", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueSub: { classPropertyName: "valueSub", publicName: "valueSub", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, actionsAriaLabel: { classPropertyName: "actionsAriaLabel", publicName: "actionsAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionSelect: "actionSelect", open: "open" }, host: { properties: { "class.cb-file-card--clickable": "clickable()" }, classAttribute: "cb-file-card" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
44
96
  <div class="cb-file-card__left">
45
97
  <span class="cb-file-card__icon" [style.background]="tintBg()" [style.color]="color() || null">
46
98
  <cb-icon [name]="icon()" [size]="20" aria-hidden="true" />
47
99
  </span>
48
100
  <div class="cb-file-card__text">
49
- <span class="cb-file-card__title">{{ title() }}</span>
101
+ @if (clickable()) {
102
+ <button type="button" class="cb-file-card__title cb-file-card__open" (click)="open.emit($event)">{{ title() }}</button>
103
+ } @else {
104
+ <span class="cb-file-card__title">{{ title() }}</span>
105
+ }
50
106
  @if (subtitle()) {
51
107
  <span class="cb-file-card__subtitle">{{ subtitle() }}</span>
52
108
  }
53
109
  </div>
54
110
  </div>
55
- <div class="cb-file-card__values">
56
- <span class="cb-file-card__value">{{ value() }}</span>
57
- @if (valueSub()) {
58
- <span class="cb-file-card__value-sub">{{ valueSub() }}</span>
111
+ <div class="cb-file-card__end">
112
+ <div class="cb-file-card__values">
113
+ <span class="cb-file-card__value">{{ value() }}</span>
114
+ @if (valueSub()) {
115
+ <span class="cb-file-card__value-sub">{{ valueSub() }}</span>
116
+ }
117
+ </div>
118
+ @if (actions().length) {
119
+ <button
120
+ #trigger
121
+ type="button"
122
+ class="cb-file-card__menu-button"
123
+ [attr.aria-label]="menuLabel()"
124
+ aria-haspopup="menu"
125
+ [attr.aria-expanded]="menuOpen()"
126
+ (click)="toggleMenu()"
127
+ (keydown.arrowdown)="openFromKeyboard($event)"
128
+ >
129
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
130
+ <circle cx="12" cy="5" r="2" />
131
+ <circle cx="12" cy="12" r="2" />
132
+ <circle cx="12" cy="19" r="2" />
133
+ </svg>
134
+ </button>
135
+ <cb-menu
136
+ #menu
137
+ [items]="actions()"
138
+ [ariaLabel]="menuLabel()"
139
+ (itemSelect)="actionSelect.emit($event)"
140
+ (hidden)="menuOpen.set(false)"
141
+ />
59
142
  }
60
143
  </div>
61
- `, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
144
+ `, isInline: true, styles: [":host{position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}:host(.cb-file-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-file-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-file-card--clickable:has(.cb-file-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__open{padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.9rem;text-align:start;cursor:pointer}.cb-file-card__open:focus-visible{outline:none}.cb-file-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__end{display:flex;align-items:center;gap:.25rem;flex:none}.cb-file-card__menu-button{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin-right:-.5rem;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-file-card__menu-button:hover,.cb-file-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-file-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }, { kind: "component", type: CbMenu, selector: "cb-menu", inputs: ["items", "ariaLabel"], outputs: ["itemSelect", "hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
62
145
  }
63
146
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFileCard, decorators: [{
64
147
  type: Component,
65
- args: [{ selector: 'cb-file-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-file-card' }, template: `
148
+ args: [{ selector: 'cb-file-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon, CbMenu], host: {
149
+ class: 'cb-file-card',
150
+ '[class.cb-file-card--clickable]': 'clickable()',
151
+ }, template: `
66
152
  <div class="cb-file-card__left">
67
153
  <span class="cb-file-card__icon" [style.background]="tintBg()" [style.color]="color() || null">
68
154
  <cb-icon [name]="icon()" [size]="20" aria-hidden="true" />
69
155
  </span>
70
156
  <div class="cb-file-card__text">
71
- <span class="cb-file-card__title">{{ title() }}</span>
157
+ @if (clickable()) {
158
+ <button type="button" class="cb-file-card__title cb-file-card__open" (click)="open.emit($event)">{{ title() }}</button>
159
+ } @else {
160
+ <span class="cb-file-card__title">{{ title() }}</span>
161
+ }
72
162
  @if (subtitle()) {
73
163
  <span class="cb-file-card__subtitle">{{ subtitle() }}</span>
74
164
  }
75
165
  </div>
76
166
  </div>
77
- <div class="cb-file-card__values">
78
- <span class="cb-file-card__value">{{ value() }}</span>
79
- @if (valueSub()) {
80
- <span class="cb-file-card__value-sub">{{ valueSub() }}</span>
167
+ <div class="cb-file-card__end">
168
+ <div class="cb-file-card__values">
169
+ <span class="cb-file-card__value">{{ value() }}</span>
170
+ @if (valueSub()) {
171
+ <span class="cb-file-card__value-sub">{{ valueSub() }}</span>
172
+ }
173
+ </div>
174
+ @if (actions().length) {
175
+ <button
176
+ #trigger
177
+ type="button"
178
+ class="cb-file-card__menu-button"
179
+ [attr.aria-label]="menuLabel()"
180
+ aria-haspopup="menu"
181
+ [attr.aria-expanded]="menuOpen()"
182
+ (click)="toggleMenu()"
183
+ (keydown.arrowdown)="openFromKeyboard($event)"
184
+ >
185
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
186
+ <circle cx="12" cy="5" r="2" />
187
+ <circle cx="12" cy="12" r="2" />
188
+ <circle cx="12" cy="19" r="2" />
189
+ </svg>
190
+ </button>
191
+ <cb-menu
192
+ #menu
193
+ [items]="actions()"
194
+ [ariaLabel]="menuLabel()"
195
+ (itemSelect)="actionSelect.emit($event)"
196
+ (hidden)="menuOpen.set(false)"
197
+ />
81
198
  }
82
199
  </div>
83
- `, styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"] }]
84
- }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueSub: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSub", required: false }] }] } });
200
+ `, styles: [":host{position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}:host(.cb-file-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-file-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-file-card--clickable:has(.cb-file-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__open{padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.9rem;text-align:start;cursor:pointer}.cb-file-card__open:focus-visible{outline:none}.cb-file-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__end{display:flex;align-items:center;gap:.25rem;flex:none}.cb-file-card__menu-button{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin-right:-.5rem;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-file-card__menu-button:hover,.cb-file-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-file-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"] }]
201
+ }], propDecorators: { menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueSub: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSub", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], actionsAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsAriaLabel", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], actionSelect: [{ type: i0.Output, args: ["actionSelect"] }], open: [{ type: i0.Output, args: ["open"] }] } });
85
202
 
86
203
  /*
87
204
  * Public API Surface de @caribeng/ui/file-card
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, output, signal, viewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { CbIcon } from '@caribeng/ui/icon';
4
+ import { injectCbTranslation, cbFormat } from '@caribeng/ui';
4
5
 
5
6
  /**
6
7
  * FileUpload de CaribeNG: selector de archivos con arrastrar y soltar,
@@ -8,6 +9,10 @@ import { CbIcon } from '@caribeng/ui/icon';
8
9
  */
9
10
  class CbFileUpload {
10
11
  constructor() {
12
+ /** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
13
+ this.t = injectCbTranslation();
14
+ /** Rellena `{0}`, `{1}`… de un texto traducido. */
15
+ this.fmt = cbFormat;
11
16
  this.accept = input('', /* @ts-ignore */
12
17
  ...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
13
18
  this.multiple = input(false, /* @ts-ignore */
@@ -16,14 +21,19 @@ class CbFileUpload {
16
21
  ...(ngDevMode ? [{ debugName: "maxFileSize" }] : /* istanbul ignore next */ []));
17
22
  this.disabled = input(false, /* @ts-ignore */
18
23
  ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
19
- this.chooseLabel = input('Elegir archivo', /* @ts-ignore */
24
+ this.chooseLabel = input(undefined, /* @ts-ignore */
20
25
  ...(ngDevMode ? [{ debugName: "chooseLabel" }] : /* istanbul ignore next */ []));
21
- this.uploadLabel = input('Subir', /* @ts-ignore */
26
+ this.uploadLabel = input(undefined, /* @ts-ignore */
22
27
  ...(ngDevMode ? [{ debugName: "uploadLabel" }] : /* istanbul ignore next */ []));
23
28
  this.selectFiles = output();
24
29
  this.uploadHandler = output();
30
+ /** Se emite con los archivos descartados por tamaño (`maxFileSize`) o tipo (`accept`). */
31
+ this.rejectFiles = output();
25
32
  this.files = signal([], /* @ts-ignore */
26
33
  ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
34
+ /** Archivos descartados en la última selección (se muestran como aviso). */
35
+ this.rejected = signal([], /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "rejected" }] : /* istanbul ignore next */ []));
27
37
  this.dragging = signal(false, /* @ts-ignore */
28
38
  ...(ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []));
29
39
  this.fileInputRef = viewChild('fileInput', /* @ts-ignore */
@@ -60,10 +70,28 @@ class CbFileUpload {
60
70
  this.addFiles(Array.from(dropped));
61
71
  }
62
72
  }
73
+ /** Añade archivos validando `accept` y `maxFileSize`; ignora los repetidos. */
63
74
  addFiles(incoming) {
64
75
  const max = this.maxFileSize();
65
- const valid = max != null ? incoming.filter((f) => f.size <= max) : incoming;
66
- const next = this.multiple() ? [...this.files(), ...valid] : valid.slice(0, 1);
76
+ const valid = [];
77
+ const rejected = [];
78
+ for (const file of incoming) {
79
+ if (!this.isAccepted(file))
80
+ rejected.push({ file, reason: 'type' });
81
+ else if (max != null && file.size > max)
82
+ rejected.push({ file, reason: 'size' });
83
+ else
84
+ valid.push(file);
85
+ }
86
+ this.rejected.set(rejected);
87
+ if (rejected.length)
88
+ this.rejectFiles.emit({ files: rejected });
89
+ if (!valid.length)
90
+ return;
91
+ const same = (a, b) => a.name === b.name && a.size === b.size && a.lastModified === b.lastModified;
92
+ const next = this.multiple()
93
+ ? [...this.files(), ...valid.filter((f, i) => !this.files().some((e) => same(e, f)) && valid.findIndex((v) => same(v, f)) === i)]
94
+ : valid.slice(0, 1);
67
95
  this.files.set(next);
68
96
  this.selectFiles.emit({ files: next });
69
97
  }
@@ -73,6 +101,7 @@ class CbFileUpload {
73
101
  }
74
102
  clear() {
75
103
  this.files.set([]);
104
+ this.rejected.set([]);
76
105
  }
77
106
  triggerUpload() {
78
107
  this.uploadHandler.emit({ files: [...this.files()] });
@@ -80,10 +109,30 @@ class CbFileUpload {
80
109
  formatSize(bytes) {
81
110
  if (bytes < 1024)
82
111
  return `${bytes} B`;
83
- return `${(bytes / 1024).toFixed(1)} KB`;
112
+ if (bytes < 1024 * 1024)
113
+ return `${(bytes / 1024).toFixed(1)} KB`;
114
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
115
+ }
116
+ /** Comprueba `accept` (extensiones `.pdf`, tipos `image/png` o comodines `image/*`). */
117
+ isAccepted(file) {
118
+ const rules = this.accept()
119
+ .split(',')
120
+ .map((r) => r.trim().toLowerCase())
121
+ .filter(Boolean);
122
+ if (!rules.length)
123
+ return true;
124
+ const name = file.name.toLowerCase();
125
+ const type = (file.type || '').toLowerCase();
126
+ return rules.some((rule) => {
127
+ if (rule.startsWith('.'))
128
+ return name.endsWith(rule);
129
+ if (rule.endsWith('/*'))
130
+ return type.startsWith(rule.slice(0, -1));
131
+ return type === rule;
132
+ });
84
133
  }
85
134
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
86
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFileUpload, isStandalone: true, selector: "cb-file-upload", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, chooseLabel: { classPropertyName: "chooseLabel", publicName: "chooseLabel", isSignal: true, isRequired: false, transformFunction: null }, uploadLabel: { classPropertyName: "uploadLabel", publicName: "uploadLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectFiles: "selectFiles", uploadHandler: "uploadHandler" }, host: { properties: { "class.cb-is-dragover": "dragging()" }, classAttribute: "cb-file-upload" }, viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: `
135
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFileUpload, isStandalone: true, selector: "cb-file-upload", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, chooseLabel: { classPropertyName: "chooseLabel", publicName: "chooseLabel", isSignal: true, isRequired: false, transformFunction: null }, uploadLabel: { classPropertyName: "uploadLabel", publicName: "uploadLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectFiles: "selectFiles", uploadHandler: "uploadHandler", rejectFiles: "rejectFiles" }, host: { properties: { "class.cb-is-dragover": "dragging()" }, classAttribute: "cb-file-upload" }, viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: `
87
136
  <input
88
137
  #fileInput
89
138
  type="file"
@@ -107,7 +156,7 @@ class CbFileUpload {
107
156
  (click)="openPicker()"
108
157
  >
109
158
  <cb-icon name="upload" [size]="15" aria-hidden="true" />
110
- <span>{{ chooseLabel() }}</span>
159
+ <span>{{ (chooseLabel() ?? t().chooseFile) }}</span>
111
160
  </button>
112
161
  @if (files().length > 0) {
113
162
  <button
@@ -117,7 +166,7 @@ class CbFileUpload {
117
166
  (click)="triggerUpload()"
118
167
  >
119
168
  <cb-icon name="check" [size]="15" aria-hidden="true" />
120
- <span>{{ uploadLabel() }}</span>
169
+ <span>{{ (uploadLabel() ?? t().upload) }}</span>
121
170
  </button>
122
171
  <button
123
172
  type="button"
@@ -126,13 +175,27 @@ class CbFileUpload {
126
175
  (click)="clear()"
127
176
  >
128
177
  <cb-icon name="x" [size]="15" aria-hidden="true" />
129
- <span>Limpiar</span>
178
+ <span>{{ t().clear }}</span>
130
179
  </button>
131
180
  }
132
181
  </div>
133
182
 
183
+ @if (rejected().length) {
184
+ <ul class="cb-file-upload__errors" role="alert">
185
+ @for (r of rejected(); track $index) {
186
+ <li>
187
+ {{
188
+ r.reason === 'size'
189
+ ? fmt(t().fileTooLarge, r.file.name, formatSize(maxFileSize() ?? 0))
190
+ : fmt(t().fileTypeNotAllowed, r.file.name)
191
+ }}
192
+ </li>
193
+ }
194
+ </ul>
195
+ }
196
+
134
197
  @if (files().length === 0) {
135
- <p class="cb-file-upload__empty">Arrastra archivos aquí o pulsa "{{ chooseLabel() }}".</p>
198
+ <p class="cb-file-upload__empty">{{ fmt(t().dropFiles, (chooseLabel() ?? t().chooseFile)) }}</p>
136
199
  } @else {
137
200
  <ul class="cb-file-upload__list">
138
201
  @for (file of files(); track file.name + file.size; let idx = $index) {
@@ -142,7 +205,7 @@ class CbFileUpload {
142
205
  <button
143
206
  type="button"
144
207
  class="cb-file-upload__remove"
145
- [attr.aria-label]="'Quitar ' + file.name"
208
+ [attr.aria-label]="fmt(t().removeItem, file.name)"
146
209
  (click)="removeAt(idx)"
147
210
  >
148
211
  <cb-icon name="x" [size]="14" aria-hidden="true" />
@@ -152,7 +215,7 @@ class CbFileUpload {
152
215
  </ul>
153
216
  }
154
217
  </div>
155
- `, isInline: true, styles: [":host{display:block;width:100%;font-family:var(--cb-font-sans)}.cb-file-upload__native{display:none}.cb-file-upload__dropzone{padding:var(--cb-space-4);border:1px dashed var(--cb-color-border);border-radius:var(--cb-radius-lg);background:var(--cb-color-surface);color:var(--cb-color-text);transition:border-color .14s ease,background-color .14s ease}:host(.cb-is-dragover) .cb-file-upload__dropzone{border-color:var(--cb-color-primary-500);background:color-mix(in srgb,var(--cb-color-primary-500) 8%,transparent)}.cb-file-upload__actions{display:flex;flex-wrap:wrap;gap:var(--cb-space-2);margin-bottom:var(--cb-space-3)}.cb-file-upload__btn{display:inline-flex;align-items:center;gap:.375rem;padding:.4rem .75rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-sm);font-weight:var(--cb-font-medium);cursor:pointer}.cb-file-upload__btn--primary{background:var(--cb-color-primary-500);border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-contrast, #fff)}.cb-file-upload__empty{margin:0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-file-upload__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.cb-file-upload__item{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-2);padding:.375rem .625rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);font-size:var(--cb-text-sm)}.cb-file-upload__size{margin-left:auto;color:var(--cb-color-text-muted);font-size:.75rem}.cb-file-upload__remove{border:none;background:transparent;color:var(--cb-color-text-muted);cursor:pointer;padding:.125rem}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
218
+ `, isInline: true, styles: [":host{display:block;width:100%;font-family:var(--cb-font-sans)}.cb-file-upload__native{display:none}.cb-file-upload__dropzone{padding:var(--cb-space-4);border:1px dashed var(--cb-color-border);border-radius:var(--cb-radius-lg);background:var(--cb-color-surface);color:var(--cb-color-text);transition:border-color .14s ease,background-color .14s ease}:host(.cb-is-dragover) .cb-file-upload__dropzone{border-color:var(--cb-color-primary-500);background:color-mix(in srgb,var(--cb-color-primary-500) 8%,transparent)}.cb-file-upload__actions{display:flex;flex-wrap:wrap;gap:var(--cb-space-2);margin-bottom:var(--cb-space-3)}.cb-file-upload__btn{display:inline-flex;align-items:center;gap:.375rem;padding:.4rem .75rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-sm);font-weight:var(--cb-font-medium);cursor:pointer}.cb-file-upload__btn--primary{background:var(--cb-color-primary-500);border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-contrast, #fff)}.cb-file-upload__errors{list-style:none;margin:0;padding:0;display:grid;gap:.25rem;font-size:var(--cb-text-sm);color:var(--cb-color-danger)}.cb-file-upload__empty{margin:0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-file-upload__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.cb-file-upload__item{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-2);padding:.375rem .625rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);font-size:var(--cb-text-sm)}.cb-file-upload__size{margin-left:auto;color:var(--cb-color-text-muted);font-size:.75rem}.cb-file-upload__remove{border:none;background:transparent;color:var(--cb-color-text-muted);cursor:pointer;padding:.125rem}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
156
219
  }
157
220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFileUpload, decorators: [{
158
221
  type: Component,
@@ -183,7 +246,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
183
246
  (click)="openPicker()"
184
247
  >
185
248
  <cb-icon name="upload" [size]="15" aria-hidden="true" />
186
- <span>{{ chooseLabel() }}</span>
249
+ <span>{{ (chooseLabel() ?? t().chooseFile) }}</span>
187
250
  </button>
188
251
  @if (files().length > 0) {
189
252
  <button
@@ -193,7 +256,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
193
256
  (click)="triggerUpload()"
194
257
  >
195
258
  <cb-icon name="check" [size]="15" aria-hidden="true" />
196
- <span>{{ uploadLabel() }}</span>
259
+ <span>{{ (uploadLabel() ?? t().upload) }}</span>
197
260
  </button>
198
261
  <button
199
262
  type="button"
@@ -202,13 +265,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
202
265
  (click)="clear()"
203
266
  >
204
267
  <cb-icon name="x" [size]="15" aria-hidden="true" />
205
- <span>Limpiar</span>
268
+ <span>{{ t().clear }}</span>
206
269
  </button>
207
270
  }
208
271
  </div>
209
272
 
273
+ @if (rejected().length) {
274
+ <ul class="cb-file-upload__errors" role="alert">
275
+ @for (r of rejected(); track $index) {
276
+ <li>
277
+ {{
278
+ r.reason === 'size'
279
+ ? fmt(t().fileTooLarge, r.file.name, formatSize(maxFileSize() ?? 0))
280
+ : fmt(t().fileTypeNotAllowed, r.file.name)
281
+ }}
282
+ </li>
283
+ }
284
+ </ul>
285
+ }
286
+
210
287
  @if (files().length === 0) {
211
- <p class="cb-file-upload__empty">Arrastra archivos aquí o pulsa "{{ chooseLabel() }}".</p>
288
+ <p class="cb-file-upload__empty">{{ fmt(t().dropFiles, (chooseLabel() ?? t().chooseFile)) }}</p>
212
289
  } @else {
213
290
  <ul class="cb-file-upload__list">
214
291
  @for (file of files(); track file.name + file.size; let idx = $index) {
@@ -218,7 +295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
218
295
  <button
219
296
  type="button"
220
297
  class="cb-file-upload__remove"
221
- [attr.aria-label]="'Quitar ' + file.name"
298
+ [attr.aria-label]="fmt(t().removeItem, file.name)"
222
299
  (click)="removeAt(idx)"
223
300
  >
224
301
  <cb-icon name="x" [size]="14" aria-hidden="true" />
@@ -228,8 +305,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
228
305
  </ul>
229
306
  }
230
307
  </div>
231
- `, styles: [":host{display:block;width:100%;font-family:var(--cb-font-sans)}.cb-file-upload__native{display:none}.cb-file-upload__dropzone{padding:var(--cb-space-4);border:1px dashed var(--cb-color-border);border-radius:var(--cb-radius-lg);background:var(--cb-color-surface);color:var(--cb-color-text);transition:border-color .14s ease,background-color .14s ease}:host(.cb-is-dragover) .cb-file-upload__dropzone{border-color:var(--cb-color-primary-500);background:color-mix(in srgb,var(--cb-color-primary-500) 8%,transparent)}.cb-file-upload__actions{display:flex;flex-wrap:wrap;gap:var(--cb-space-2);margin-bottom:var(--cb-space-3)}.cb-file-upload__btn{display:inline-flex;align-items:center;gap:.375rem;padding:.4rem .75rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-sm);font-weight:var(--cb-font-medium);cursor:pointer}.cb-file-upload__btn--primary{background:var(--cb-color-primary-500);border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-contrast, #fff)}.cb-file-upload__empty{margin:0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-file-upload__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.cb-file-upload__item{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-2);padding:.375rem .625rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);font-size:var(--cb-text-sm)}.cb-file-upload__size{margin-left:auto;color:var(--cb-color-text-muted);font-size:.75rem}.cb-file-upload__remove{border:none;background:transparent;color:var(--cb-color-text-muted);cursor:pointer;padding:.125rem}\n"] }]
232
- }], propDecorators: { accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], chooseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseLabel", required: false }] }], uploadLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadLabel", required: false }] }], selectFiles: [{ type: i0.Output, args: ["selectFiles"] }], uploadHandler: [{ type: i0.Output, args: ["uploadHandler"] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
308
+ `, styles: [":host{display:block;width:100%;font-family:var(--cb-font-sans)}.cb-file-upload__native{display:none}.cb-file-upload__dropzone{padding:var(--cb-space-4);border:1px dashed var(--cb-color-border);border-radius:var(--cb-radius-lg);background:var(--cb-color-surface);color:var(--cb-color-text);transition:border-color .14s ease,background-color .14s ease}:host(.cb-is-dragover) .cb-file-upload__dropzone{border-color:var(--cb-color-primary-500);background:color-mix(in srgb,var(--cb-color-primary-500) 8%,transparent)}.cb-file-upload__actions{display:flex;flex-wrap:wrap;gap:var(--cb-space-2);margin-bottom:var(--cb-space-3)}.cb-file-upload__btn{display:inline-flex;align-items:center;gap:.375rem;padding:.4rem .75rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-sm);font-weight:var(--cb-font-medium);cursor:pointer}.cb-file-upload__btn--primary{background:var(--cb-color-primary-500);border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-contrast, #fff)}.cb-file-upload__errors{list-style:none;margin:0;padding:0;display:grid;gap:.25rem;font-size:var(--cb-text-sm);color:var(--cb-color-danger)}.cb-file-upload__empty{margin:0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-file-upload__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.cb-file-upload__item{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-2);padding:.375rem .625rem;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);font-size:var(--cb-text-sm)}.cb-file-upload__size{margin-left:auto;color:var(--cb-color-text-muted);font-size:.75rem}.cb-file-upload__remove{border:none;background:transparent;color:var(--cb-color-text-muted);cursor:pointer;padding:.125rem}\n"] }]
309
+ }], propDecorators: { accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], chooseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseLabel", required: false }] }], uploadLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadLabel", required: false }] }], selectFiles: [{ type: i0.Output, args: ["selectFiles"] }], uploadHandler: [{ type: i0.Output, args: ["uploadHandler"] }], rejectFiles: [{ type: i0.Output, args: ["rejectFiles"] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
233
310
 
234
311
  /**
235
312
  * Generated bundle index. Do not edit.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, signal, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, ElementRef, input, signal, afterEveryRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
 
4
4
  /**
5
5
  * FloatLabel de CaribeNG: contenedor que eleva visualmente la etiqueta `<label>`
@@ -14,7 +14,9 @@ class CbFloatLabel {
14
14
  ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
15
15
  this.filled = signal(false, /* @ts-ignore */
16
16
  ...(ngDevMode ? [{ debugName: "filled" }] : /* istanbul ignore next */ []));
17
- afterNextRender(() => {
17
+ // Tras cada render: detecta también valores asignados por código (p. ej. `patchValue`),
18
+ // que no disparan los eventos `input` / `change`.
19
+ afterEveryRender(() => {
18
20
  this.checkFilled();
19
21
  });
20
22
  }