@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
@@ -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 carpeta de CaribeNG: icono de carpeta, nombre y una fila con
7
- * número de archivos y tamaño. Proyecta acciones (menú) por `[cb-folder-actions]`.
9
+ * número de archivos y tamaño.
10
+ *
11
+ * Con `actions` muestra un botón ⋮ que abre un menú (`cb-menu`) con esas
12
+ * acciones y emite `actionSelect`. Con `clickable`, toda la tarjeta abre la
13
+ * carpeta (`open`) sin interferir con el botón del menú. Sigue aceptando un
14
+ * trigger propio proyectado por `[cb-folder-actions]`.
8
15
  *
9
16
  * @example
10
17
  * ```html
11
- * <cb-folder-card name="Imágenes" files="345" size="26.4 GB">
12
- * <button cb-folder-actions aria-label="Opciones">⋮</button>
13
- * </cb-folder-card>
18
+ * <cb-folder-card name="Imágenes" files="345" size="26.4 GB" clickable
19
+ * [actions]="acciones" (actionSelect)="onAccion($event)" (open)="abrir()" />
14
20
  * ```
15
21
  */
16
22
  class CbFolderCard {
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 de la carpeta. */
19
31
  this.name = input('', /* @ts-ignore */
20
32
  ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
@@ -22,7 +34,7 @@ class CbFolderCard {
22
34
  this.files = input('', /* @ts-ignore */
23
35
  ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
24
36
  /** Etiqueta tras el número de archivos. */
25
- this.filesLabel = input('archivos', /* @ts-ignore */
37
+ this.filesLabel = input(undefined, /* @ts-ignore */
26
38
  ...(ngDevMode ? [{ debugName: "filesLabel" }] : /* istanbul ignore next */ []));
27
39
  /** Tamaño mostrado a la derecha. */
28
40
  this.size = input('', /* @ts-ignore */
@@ -30,42 +42,147 @@ class CbFolderCard {
30
42
  /** Color del icono de carpeta. */
31
43
  this.color = input('#f5b301', /* @ts-ignore */
32
44
  ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
45
+ /** Acciones del menú ⋮ (abrir, renombrar, eliminar…). Sin acciones no se muestra el botón. */
46
+ this.actions = input([], /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
48
+ /** Nombre del botón ⋮ y del menú. Por defecto, "Más acciones: {nombre}" del idioma activo. */
49
+ this.actionsAriaLabel = input(undefined, /* @ts-ignore */
50
+ ...(ngDevMode ? [{ debugName: "actionsAriaLabel" }] : /* istanbul ignore next */ []));
51
+ /** Toda la tarjeta es pulsable y emite `open` (clic, Enter o Espacio). */
52
+ this.clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
53
+ /** Acción elegida en el menú ⋮. */
54
+ this.actionSelect = output();
55
+ /** Se pidió abrir la carpeta (solo con `clickable`). */
56
+ this.open = output();
57
+ this.menuOpen = signal(false, /* @ts-ignore */
58
+ ...(ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []));
59
+ this.menuLabel = computed(() => {
60
+ const custom = this.actionsAriaLabel();
61
+ if (custom)
62
+ return custom;
63
+ const name = this.name();
64
+ return name ? `${this.t().moreActions}: ${name}` : this.t().moreActions;
65
+ }, /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "menuLabel" }] : /* istanbul ignore next */ []));
67
+ }
68
+ /** Abre o cierra el menú de acciones anclado al botón ⋮. */
69
+ toggleMenu() {
70
+ const menu = this.menu();
71
+ const trigger = this.trigger()?.nativeElement;
72
+ if (!menu || !trigger)
73
+ return;
74
+ if (menu.isOpen) {
75
+ menu.hide();
76
+ return;
77
+ }
78
+ menu.show(trigger);
79
+ this.menuOpen.set(true);
80
+ }
81
+ openFromKeyboard(event) {
82
+ event.preventDefault();
83
+ if (!this.menu()?.isOpen)
84
+ this.toggleMenu();
33
85
  }
34
86
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFolderCard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
35
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFolderCard, isStandalone: true, selector: "cb-folder-card", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, filesLabel: { classPropertyName: "filesLabel", publicName: "filesLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-folder-card" }, ngImport: i0, template: `
87
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFolderCard, isStandalone: true, selector: "cb-folder-card", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, filesLabel: { classPropertyName: "filesLabel", publicName: "filesLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", 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-folder-card--clickable": "clickable()" }, classAttribute: "cb-folder-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: `
36
88
  <div class="cb-folder-card__top">
37
89
  <cb-icon name="folder" [size]="30" class="cb-folder-card__icon" [style.color]="color() || null" aria-hidden="true" />
38
90
  <span class="cb-folder-card__actions">
39
91
  <ng-content select="[cb-folder-actions]" />
92
+ @if (actions().length) {
93
+ <button
94
+ #trigger
95
+ type="button"
96
+ class="cb-folder-card__menu-button"
97
+ [attr.aria-label]="menuLabel()"
98
+ aria-haspopup="menu"
99
+ [attr.aria-expanded]="menuOpen()"
100
+ (click)="toggleMenu()"
101
+ (keydown.arrowdown)="openFromKeyboard($event)"
102
+ >
103
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
104
+ <circle cx="12" cy="5" r="2" />
105
+ <circle cx="12" cy="12" r="2" />
106
+ <circle cx="12" cy="19" r="2" />
107
+ </svg>
108
+ </button>
109
+ <cb-menu
110
+ #menu
111
+ [items]="actions()"
112
+ [ariaLabel]="menuLabel()"
113
+ (itemSelect)="actionSelect.emit($event)"
114
+ (hidden)="menuOpen.set(false)"
115
+ />
116
+ }
40
117
  </span>
41
118
  </div>
42
- <div class="cb-folder-card__name">{{ name() }}</div>
119
+ @if (clickable()) {
120
+ <button type="button" class="cb-folder-card__name cb-folder-card__open" (click)="open.emit($event)">{{ name() }}</button>
121
+ } @else {
122
+ <div class="cb-folder-card__name">{{ name() }}</div>
123
+ }
43
124
  <div class="cb-folder-card__meta">
44
- <span>{{ files() }} {{ filesLabel() }}</span>
125
+ @if (files() !== '') {
126
+ <span>{{ files() }} {{ (filesLabel() ?? t().files) }}</span>
127
+ }
45
128
  @if (size()) {
46
129
  <span>{{ size() }}</span>
47
130
  }
48
131
  </div>
49
- `, isInline: true, styles: [":host{display:block;padding: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-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__name{margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
132
+ `, isInline: true, styles: [":host{position:relative;display:block;padding: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-folder-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-folder-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-folder-card--clickable:has(.cb-folder-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{position:relative;z-index:1;display:inline-flex;align-items:center;gap:.25rem;color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__menu-button{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:-.375rem -.5rem 0 0;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:inherit;cursor:pointer}.cb-folder-card__menu-button:hover,.cb-folder-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-folder-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__name{display:block;margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__open{width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.95rem;text-align:start;cursor:pointer}.cb-folder-card__open:focus-visible{outline:none}.cb-folder-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;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 }); }
50
133
  }
51
134
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFolderCard, decorators: [{
52
135
  type: Component,
53
- args: [{ selector: 'cb-folder-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-folder-card' }, template: `
136
+ args: [{ selector: 'cb-folder-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon, CbMenu], host: {
137
+ class: 'cb-folder-card',
138
+ '[class.cb-folder-card--clickable]': 'clickable()',
139
+ }, template: `
54
140
  <div class="cb-folder-card__top">
55
141
  <cb-icon name="folder" [size]="30" class="cb-folder-card__icon" [style.color]="color() || null" aria-hidden="true" />
56
142
  <span class="cb-folder-card__actions">
57
143
  <ng-content select="[cb-folder-actions]" />
144
+ @if (actions().length) {
145
+ <button
146
+ #trigger
147
+ type="button"
148
+ class="cb-folder-card__menu-button"
149
+ [attr.aria-label]="menuLabel()"
150
+ aria-haspopup="menu"
151
+ [attr.aria-expanded]="menuOpen()"
152
+ (click)="toggleMenu()"
153
+ (keydown.arrowdown)="openFromKeyboard($event)"
154
+ >
155
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
156
+ <circle cx="12" cy="5" r="2" />
157
+ <circle cx="12" cy="12" r="2" />
158
+ <circle cx="12" cy="19" r="2" />
159
+ </svg>
160
+ </button>
161
+ <cb-menu
162
+ #menu
163
+ [items]="actions()"
164
+ [ariaLabel]="menuLabel()"
165
+ (itemSelect)="actionSelect.emit($event)"
166
+ (hidden)="menuOpen.set(false)"
167
+ />
168
+ }
58
169
  </span>
59
170
  </div>
60
- <div class="cb-folder-card__name">{{ name() }}</div>
171
+ @if (clickable()) {
172
+ <button type="button" class="cb-folder-card__name cb-folder-card__open" (click)="open.emit($event)">{{ name() }}</button>
173
+ } @else {
174
+ <div class="cb-folder-card__name">{{ name() }}</div>
175
+ }
61
176
  <div class="cb-folder-card__meta">
62
- <span>{{ files() }} {{ filesLabel() }}</span>
177
+ @if (files() !== '') {
178
+ <span>{{ files() }} {{ (filesLabel() ?? t().files) }}</span>
179
+ }
63
180
  @if (size()) {
64
181
  <span>{{ size() }}</span>
65
182
  }
66
183
  </div>
67
- `, styles: [":host{display:block;padding: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-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__name{margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"] }]
68
- }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], filesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }] } });
184
+ `, styles: [":host{position:relative;display:block;padding: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-folder-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-folder-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-folder-card--clickable:has(.cb-folder-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{position:relative;z-index:1;display:inline-flex;align-items:center;gap:.25rem;color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__menu-button{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:-.375rem -.5rem 0 0;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:inherit;cursor:pointer}.cb-folder-card__menu-button:hover,.cb-folder-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-folder-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__name{display:block;margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__open{width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.95rem;text-align:start;cursor:pointer}.cb-folder-card__open:focus-visible{outline:none}.cb-folder-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"] }]
185
+ }], propDecorators: { menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], filesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", 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"] }] } });
69
186
 
70
187
  /*
71
188
  * Public API Surface de @caribeng/ui/folder-card
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, model, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, model, inject, ElementRef, computed, 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
  * Galleria de CaribeNG: galería de imágenes con visor principal, leyenda y
@@ -8,6 +9,10 @@ import { CbIcon } from '@caribeng/ui/icon';
8
9
  */
9
10
  class CbGalleria {
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.value = input([], /* @ts-ignore */
12
17
  ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
13
18
  this.showThumbnails = input(true, /* @ts-ignore */
@@ -16,6 +21,7 @@ class CbGalleria {
16
21
  ...(ngDevMode ? [{ debugName: "circular" }] : /* istanbul ignore next */ []));
17
22
  this.activeIndex = model(0, /* @ts-ignore */
18
23
  ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
24
+ this.host = inject(ElementRef);
19
25
  this.activeItem = computed(() => this.value()[this.activeIndex()] ?? this.value()[0] ?? null, /* @ts-ignore */
20
26
  ...(ngDevMode ? [{ debugName: "activeItem" }] : /* istanbul ignore next */ []));
21
27
  }
@@ -39,31 +45,52 @@ class CbGalleria {
39
45
  else if (this.circular())
40
46
  this.activeIndex.set(0);
41
47
  }
48
+ /** Miniaturas (patrón *tabs*): flechas, Inicio y Fin cambian de imagen y mueven el foco. */
49
+ onThumbKeydown(event) {
50
+ const last = this.value().length - 1;
51
+ const cur = this.activeIndex();
52
+ const target = event.key === 'ArrowRight' ? (cur < last ? cur + 1 : 0)
53
+ : event.key === 'ArrowLeft' ? (cur > 0 ? cur - 1 : last)
54
+ : event.key === 'Home' ? 0
55
+ : event.key === 'End' ? last
56
+ : null;
57
+ if (target === null)
58
+ return;
59
+ event.preventDefault();
60
+ this.activeIndex.set(target);
61
+ this.host.nativeElement.querySelectorAll('.cb-galleria__thumb')[target]?.focus();
62
+ }
42
63
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbGalleria, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
43
64
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbGalleria, isStandalone: true, selector: "cb-galleria", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showThumbnails: { classPropertyName: "showThumbnails", publicName: "showThumbnails", isSignal: true, isRequired: false, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "circular", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange" }, host: { classAttribute: "cb-galleria" }, ngImport: i0, template: `
44
65
  @if (activeItem(); as current) {
45
66
  <div class="cb-galleria__stage">
46
- <button
47
- type="button"
48
- class="cb-galleria__nav cb-galleria__nav--prev"
49
- aria-label="Imagen anterior"
50
- (click)="prev()"
51
- >
52
- <cb-icon name="chevron-left" [size]="18" aria-hidden="true" />
53
- </button>
67
+ @if (value().length > 1) {
68
+ <button
69
+ type="button"
70
+ class="cb-galleria__nav cb-galleria__nav--prev"
71
+ [attr.aria-label]="t().previousImage"
72
+ [disabled]="!circular() && activeIndex() === 0"
73
+ (click)="prev()"
74
+ >
75
+ <cb-icon name="chevron-left" [size]="18" aria-hidden="true" />
76
+ </button>
77
+ }
54
78
  <img
55
79
  class="cb-galleria__main-img"
56
80
  [src]="current.itemImageSrc"
57
81
  [alt]="current.alt || current.title || ''"
58
82
  />
59
- <button
60
- type="button"
61
- class="cb-galleria__nav cb-galleria__nav--next"
62
- aria-label="Imagen siguiente"
63
- (click)="next()"
64
- >
65
- <cb-icon name="chevron-right" [size]="18" aria-hidden="true" />
66
- </button>
83
+ @if (value().length > 1) {
84
+ <button
85
+ type="button"
86
+ class="cb-galleria__nav cb-galleria__nav--next"
87
+ [attr.aria-label]="t().nextImage"
88
+ [disabled]="!circular() && activeIndex() === value().length - 1"
89
+ (click)="next()"
90
+ >
91
+ <cb-icon name="chevron-right" [size]="18" aria-hidden="true" />
92
+ </button>
93
+ }
67
94
  @if (current.title) {
68
95
  <div class="cb-galleria__caption">{{ current.title }}</div>
69
96
  }
@@ -71,20 +98,19 @@ class CbGalleria {
71
98
  }
72
99
  @if (showThumbnails() && value().length > 1) {
73
100
  <div class="cb-galleria__thumbs" role="tablist">
74
- @for (item of value(); track item.itemImageSrc; let idx = $index) {
101
+ @for (item of value(); track $index; let idx = $index) {
75
102
  <button
76
103
  type="button"
77
104
  class="cb-galleria__thumb"
78
105
  role="tab"
79
106
  [class.cb-is-active]="activeIndex() === idx"
80
107
  [attr.aria-selected]="activeIndex() === idx"
81
- [attr.aria-label]="item.title || ('Miniatura ' + (idx + 1))"
108
+ [attr.tabindex]="activeIndex() === idx ? 0 : -1"
109
+ [attr.aria-label]="item.title || item.alt || fmt(t().thumbnail, idx + 1)"
82
110
  (click)="activeIndex.set(idx)"
111
+ (keydown)="onThumbKeydown($event)"
83
112
  >
84
- <img
85
- [src]="item.thumbnailImageSrc || item.itemImageSrc"
86
- [alt]="item.alt || item.title || ''"
87
- />
113
+ <img [src]="item.thumbnailImageSrc || item.itemImageSrc" alt="" />
88
114
  </button>
89
115
  }
90
116
  </div>
@@ -96,27 +122,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
96
122
  args: [{ selector: 'cb-galleria', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-galleria' }, template: `
97
123
  @if (activeItem(); as current) {
98
124
  <div class="cb-galleria__stage">
99
- <button
100
- type="button"
101
- class="cb-galleria__nav cb-galleria__nav--prev"
102
- aria-label="Imagen anterior"
103
- (click)="prev()"
104
- >
105
- <cb-icon name="chevron-left" [size]="18" aria-hidden="true" />
106
- </button>
125
+ @if (value().length > 1) {
126
+ <button
127
+ type="button"
128
+ class="cb-galleria__nav cb-galleria__nav--prev"
129
+ [attr.aria-label]="t().previousImage"
130
+ [disabled]="!circular() && activeIndex() === 0"
131
+ (click)="prev()"
132
+ >
133
+ <cb-icon name="chevron-left" [size]="18" aria-hidden="true" />
134
+ </button>
135
+ }
107
136
  <img
108
137
  class="cb-galleria__main-img"
109
138
  [src]="current.itemImageSrc"
110
139
  [alt]="current.alt || current.title || ''"
111
140
  />
112
- <button
113
- type="button"
114
- class="cb-galleria__nav cb-galleria__nav--next"
115
- aria-label="Imagen siguiente"
116
- (click)="next()"
117
- >
118
- <cb-icon name="chevron-right" [size]="18" aria-hidden="true" />
119
- </button>
141
+ @if (value().length > 1) {
142
+ <button
143
+ type="button"
144
+ class="cb-galleria__nav cb-galleria__nav--next"
145
+ [attr.aria-label]="t().nextImage"
146
+ [disabled]="!circular() && activeIndex() === value().length - 1"
147
+ (click)="next()"
148
+ >
149
+ <cb-icon name="chevron-right" [size]="18" aria-hidden="true" />
150
+ </button>
151
+ }
120
152
  @if (current.title) {
121
153
  <div class="cb-galleria__caption">{{ current.title }}</div>
122
154
  }
@@ -124,20 +156,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
124
156
  }
125
157
  @if (showThumbnails() && value().length > 1) {
126
158
  <div class="cb-galleria__thumbs" role="tablist">
127
- @for (item of value(); track item.itemImageSrc; let idx = $index) {
159
+ @for (item of value(); track $index; let idx = $index) {
128
160
  <button
129
161
  type="button"
130
162
  class="cb-galleria__thumb"
131
163
  role="tab"
132
164
  [class.cb-is-active]="activeIndex() === idx"
133
165
  [attr.aria-selected]="activeIndex() === idx"
134
- [attr.aria-label]="item.title || ('Miniatura ' + (idx + 1))"
166
+ [attr.tabindex]="activeIndex() === idx ? 0 : -1"
167
+ [attr.aria-label]="item.title || item.alt || fmt(t().thumbnail, idx + 1)"
135
168
  (click)="activeIndex.set(idx)"
169
+ (keydown)="onThumbKeydown($event)"
136
170
  >
137
- <img
138
- [src]="item.thumbnailImageSrc || item.itemImageSrc"
139
- [alt]="item.alt || item.title || ''"
140
- />
171
+ <img [src]="item.thumbnailImageSrc || item.itemImageSrc" alt="" />
141
172
  </button>
142
173
  }
143
174
  </div>