@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.
- package/README.md +134 -12
- package/fesm2022/caribeng-ui-accordion.mjs +4 -4
- package/fesm2022/caribeng-ui-anchor.mjs +169 -0
- package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
- package/fesm2022/caribeng-ui-avatar.mjs +2 -2
- package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
- package/fesm2022/caribeng-ui-badge.mjs +8 -2
- package/fesm2022/caribeng-ui-blockui.mjs +12 -4
- package/fesm2022/caribeng-ui-breadcrumb.mjs +17 -7
- package/fesm2022/caribeng-ui-button.mjs +22 -2
- package/fesm2022/caribeng-ui-caribe-alert.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-animation-lottie.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-button-group.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +11 -6
- package/fesm2022/caribeng-ui-caribe-card-content.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-card-move.mjs +29 -7
- package/fesm2022/caribeng-ui-caribe-card-select.mjs +56 -14
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +10 -7
- package/fesm2022/caribeng-ui-caribe-coachmark.mjs +42 -19
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +15 -9
- package/fesm2022/caribeng-ui-caribe-dots-indicator.mjs +38 -5
- package/fesm2022/caribeng-ui-caribe-expansion-panel.mjs +16 -5
- package/fesm2022/caribeng-ui-caribe-fab-menu.mjs +56 -7
- package/fesm2022/caribeng-ui-caribe-file-download.mjs +68 -27
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +22 -17
- package/fesm2022/caribeng-ui-caribe-float-menu.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-footer.mjs +8 -4
- package/fesm2022/caribeng-ui-caribe-header.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-icon-button.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-illustration.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-input-search.mjs +14 -10
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +12 -10
- package/fesm2022/caribeng-ui-caribe-input-token.mjs +61 -11
- package/fesm2022/caribeng-ui-caribe-link.mjs +7 -2
- package/fesm2022/caribeng-ui-caribe-loader.mjs +8 -5
- package/fesm2022/caribeng-ui-caribe-modal.mjs +32 -16
- package/fesm2022/caribeng-ui-caribe-off-canvas.mjs +26 -12
- package/fesm2022/caribeng-ui-caribe-onboarding.mjs +44 -19
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +34 -10
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +9 -6
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-shortcut.mjs +8 -3
- package/fesm2022/caribeng-ui-caribe-step-indicator.mjs +12 -5
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-switch.mjs +5 -3
- package/fesm2022/caribeng-ui-caribe-tag-button.mjs +1 -1
- package/fesm2022/caribeng-ui-caribe-tracker.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-transaction-status.mjs +1 -1
- package/fesm2022/caribeng-ui-caribe-voucher.mjs +11 -8
- package/fesm2022/caribeng-ui-carousel.mjs +49 -14
- package/fesm2022/caribeng-ui-cascadeselect.mjs +22 -8
- package/fesm2022/caribeng-ui-chart.mjs +2601 -303
- package/fesm2022/caribeng-ui-chat.mjs +1303 -0
- package/fesm2022/caribeng-ui-chip.mjs +9 -4
- package/fesm2022/caribeng-ui-chips.mjs +9 -5
- package/fesm2022/caribeng-ui-code-block.mjs +332 -0
- package/fesm2022/caribeng-ui-colorpicker.mjs +107 -11
- package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
- package/fesm2022/caribeng-ui-confirmdialog.mjs +140 -10
- package/fesm2022/caribeng-ui-confirmpopup.mjs +209 -9
- package/fesm2022/caribeng-ui-contextmenu.mjs +13 -6
- package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
- package/fesm2022/caribeng-ui-dataview.mjs +214 -6
- package/fesm2022/caribeng-ui-datepicker.mjs +1630 -393
- package/fesm2022/caribeng-ui-descriptions.mjs +124 -0
- package/fesm2022/caribeng-ui-dialog.mjs +10 -7
- package/fesm2022/caribeng-ui-dock.mjs +58 -15
- package/fesm2022/caribeng-ui-drawer.mjs +17 -9
- package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
- package/fesm2022/caribeng-ui-editor.mjs +4413 -243
- package/fesm2022/caribeng-ui-empty.mjs +80 -0
- package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
- package/fesm2022/caribeng-ui-file-card.mjs +136 -19
- package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
- package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
- package/fesm2022/caribeng-ui-folder-card.mjs +132 -15
- package/fesm2022/caribeng-ui-galleria.mjs +76 -45
- package/fesm2022/caribeng-ui-image.mjs +52 -29
- package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
- package/fesm2022/caribeng-ui-inplace.mjs +22 -6
- package/fesm2022/caribeng-ui-input-number.mjs +9 -7
- package/fesm2022/caribeng-ui-inputgroup.mjs +2 -2
- package/fesm2022/caribeng-ui-inputmask.mjs +22 -13
- package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
- package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
- package/fesm2022/caribeng-ui-kbd.mjs +122 -0
- package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
- package/fesm2022/caribeng-ui-listbox.mjs +13 -11
- package/fesm2022/caribeng-ui-megamenu.mjs +228 -32
- package/fesm2022/caribeng-ui-mentions.mjs +495 -0
- package/fesm2022/caribeng-ui-menu.mjs +18 -8
- package/fesm2022/caribeng-ui-menubar.mjs +17 -8
- package/fesm2022/caribeng-ui-message.mjs +13 -7
- package/fesm2022/caribeng-ui-metergroup.mjs +29 -11
- package/fesm2022/caribeng-ui-multiselect.mjs +399 -97
- package/fesm2022/caribeng-ui-orderlist.mjs +230 -11
- package/fesm2022/caribeng-ui-organizationchart.mjs +16 -15
- package/fesm2022/caribeng-ui-paginator.mjs +18 -15
- package/fesm2022/caribeng-ui-panel.mjs +11 -8
- package/fesm2022/caribeng-ui-panelmenu.mjs +14 -8
- package/fesm2022/caribeng-ui-password.mjs +8 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
- package/fesm2022/caribeng-ui-picklist.mjs +251 -14
- package/fesm2022/caribeng-ui-pricing.mjs +272 -75
- package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
- package/fesm2022/caribeng-ui-rating.mjs +7 -3
- package/fesm2022/caribeng-ui-repeater.mjs +223 -0
- package/fesm2022/caribeng-ui-result.mjs +91 -0
- package/fesm2022/caribeng-ui-ripple.mjs +2 -0
- package/fesm2022/caribeng-ui-scrollpanel.mjs +6 -3
- package/fesm2022/caribeng-ui-scrolltop.mjs +9 -4
- package/fesm2022/caribeng-ui-select.mjs +379 -87
- package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
- package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
- package/fesm2022/caribeng-ui-slider.mjs +171 -75
- package/fesm2022/caribeng-ui-speeddial.mjs +7 -4
- package/fesm2022/caribeng-ui-spinner.mjs +5 -2
- package/fesm2022/caribeng-ui-splitbutton.mjs +163 -0
- package/fesm2022/caribeng-ui-splitter.mjs +5 -2
- package/fesm2022/caribeng-ui-statistic.mjs +183 -0
- package/fesm2022/caribeng-ui-stepper.mjs +17 -7
- package/fesm2022/caribeng-ui-steps.mjs +6 -3
- package/fesm2022/caribeng-ui-table.mjs +716 -84
- package/fesm2022/caribeng-ui-tabmenu.mjs +13 -6
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-terminal.mjs +45 -9
- package/fesm2022/caribeng-ui-themetoggle.mjs +82 -0
- package/fesm2022/caribeng-ui-tieredmenu.mjs +113 -20
- package/fesm2022/caribeng-ui-timeline.mjs +175 -6
- package/fesm2022/caribeng-ui-toast.mjs +7 -4
- package/fesm2022/caribeng-ui-togglebutton.mjs +8 -6
- package/fesm2022/caribeng-ui-toolbar.mjs +6 -3
- package/fesm2022/caribeng-ui-tree.mjs +302 -6
- package/fesm2022/caribeng-ui-treeselect.mjs +26 -10
- package/fesm2022/caribeng-ui-treetable.mjs +269 -6
- package/fesm2022/caribeng-ui-virtualscroller.mjs +123 -10
- package/fesm2022/caribeng-ui.mjs +1216 -6
- package/package.json +93 -3
- package/schematics/collection.json +15 -0
- package/schematics/migrate-from-primeng/core-icons.json +1 -0
- package/schematics/migrate-from-primeng/icons.js +269 -0
- package/schematics/migrate-from-primeng/index.js +290 -0
- package/schematics/migrate-from-primeng/mappings/button.js +93 -0
- package/schematics/migrate-from-primeng/mappings/card.js +33 -0
- package/schematics/migrate-from-primeng/mappings/checkbox.js +44 -0
- package/schematics/migrate-from-primeng/mappings/confirm.js +221 -0
- package/schematics/migrate-from-primeng/mappings/datepicker.js +121 -0
- package/schematics/migrate-from-primeng/mappings/dialog.js +84 -0
- package/schematics/migrate-from-primeng/mappings/index.js +88 -0
- package/schematics/migrate-from-primeng/mappings/inputnumber.js +62 -0
- package/schematics/migrate-from-primeng/mappings/inputtext.js +60 -0
- package/schematics/migrate-from-primeng/mappings/menu.js +468 -0
- package/schematics/migrate-from-primeng/mappings/multiselect.js +49 -0
- package/schematics/migrate-from-primeng/mappings/radiobutton.js +22 -0
- package/schematics/migrate-from-primeng/mappings/rules.js +206 -0
- package/schematics/migrate-from-primeng/mappings/select.js +97 -0
- package/schematics/migrate-from-primeng/mappings/service-calls.js +100 -0
- package/schematics/migrate-from-primeng/mappings/table.js +613 -0
- package/schematics/migrate-from-primeng/mappings/tabs.js +225 -0
- package/schematics/migrate-from-primeng/mappings/tag.js +29 -0
- package/schematics/migrate-from-primeng/mappings/textarea.js +44 -0
- package/schematics/migrate-from-primeng/mappings/toast.js +173 -0
- package/schematics/migrate-from-primeng/mappings/toggleswitch.js +37 -0
- package/schematics/migrate-from-primeng/mappings/tooltip.js +44 -0
- package/schematics/migrate-from-primeng/mappings/types.js +10 -0
- package/schematics/migrate-from-primeng/report.js +79 -0
- package/schematics/migrate-from-primeng/schema.js +2 -0
- package/schematics/migrate-from-primeng/schema.json +34 -0
- package/schematics/migrate-from-primeng/template.js +387 -0
- package/schematics/migrate-from-primeng/todo.js +5 -0
- package/schematics/migrate-from-primeng/typescript.js +442 -0
- package/schematics/migrate-from-primeng/workspace.js +117 -0
- package/schematics/ng-add/index.js +140 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +66 -0
- package/types/caribeng-ui-anchor.d.ts +50 -0
- package/types/caribeng-ui-autocomplete.d.ts +4 -2
- package/types/caribeng-ui-avatargroup.d.ts +3 -1
- package/types/caribeng-ui-badge.d.ts +3 -1
- package/types/caribeng-ui-blockui.d.ts +9 -4
- package/types/caribeng-ui-breadcrumb.d.ts +11 -0
- package/types/caribeng-ui-button.d.ts +9 -1
- package/types/caribeng-ui-caribe-alert.d.ts +3 -0
- package/types/caribeng-ui-caribe-animation-lottie.d.ts +4 -1
- package/types/caribeng-ui-caribe-button-group.d.ts +4 -1
- package/types/caribeng-ui-caribe-calendar.d.ts +5 -1
- package/types/caribeng-ui-caribe-card-content.d.ts +4 -1
- package/types/caribeng-ui-caribe-card-move.d.ts +13 -13
- package/types/caribeng-ui-caribe-card-select.d.ts +10 -1
- package/types/caribeng-ui-caribe-circle-loading.d.ts +4 -1
- package/types/caribeng-ui-caribe-coachmark.d.ts +6 -0
- package/types/caribeng-ui-caribe-data-table.d.ts +7 -2
- package/types/caribeng-ui-caribe-dots-indicator.d.ts +9 -0
- package/types/caribeng-ui-caribe-expansion-panel.d.ts +7 -10
- package/types/caribeng-ui-caribe-fab-menu.d.ts +10 -1
- package/types/caribeng-ui-caribe-file-download.d.ts +8 -10
- package/types/caribeng-ui-caribe-file-select.d.ts +7 -1
- package/types/caribeng-ui-caribe-float-menu.d.ts +4 -1
- package/types/caribeng-ui-caribe-header.d.ts +3 -0
- package/types/caribeng-ui-caribe-icon-button.d.ts +4 -1
- package/types/caribeng-ui-caribe-illustration.d.ts +4 -1
- package/types/caribeng-ui-caribe-inline-alert.d.ts +3 -0
- package/types/caribeng-ui-caribe-input-search.d.ts +4 -2
- package/types/caribeng-ui-caribe-input-select.d.ts +4 -2
- package/types/caribeng-ui-caribe-input-token.d.ts +16 -1
- package/types/caribeng-ui-caribe-link.d.ts +3 -0
- package/types/caribeng-ui-caribe-loader.d.ts +4 -1
- package/types/caribeng-ui-caribe-modal.d.ts +7 -10
- package/types/caribeng-ui-caribe-off-canvas.d.ts +6 -1
- package/types/caribeng-ui-caribe-onboarding.d.ts +6 -0
- package/types/caribeng-ui-caribe-pictogram.d.ts +4 -1
- package/types/caribeng-ui-caribe-pop-over.d.ts +7 -10
- package/types/caribeng-ui-caribe-preloader.d.ts +4 -1
- package/types/caribeng-ui-caribe-progress-bar.d.ts +3 -0
- package/types/caribeng-ui-caribe-shortcut.d.ts +3 -1
- package/types/caribeng-ui-caribe-step-indicator.d.ts +6 -0
- package/types/caribeng-ui-caribe-stroke.d.ts +4 -1
- package/types/caribeng-ui-caribe-switch.d.ts +3 -1
- package/types/caribeng-ui-caribe-tracker.d.ts +3 -0
- package/types/caribeng-ui-caribe-voucher.d.ts +5 -2
- package/types/caribeng-ui-carousel.d.ts +10 -1
- package/types/caribeng-ui-cascadeselect.d.ts +7 -2
- package/types/caribeng-ui-chart.d.ts +471 -44
- package/types/caribeng-ui-chat.d.ts +299 -0
- package/types/caribeng-ui-chip.d.ts +6 -0
- package/types/caribeng-ui-chips.d.ts +6 -2
- package/types/caribeng-ui-code-block.d.ts +65 -0
- package/types/caribeng-ui-colorpicker.d.ts +8 -2
- package/types/caribeng-ui-command-palette.d.ts +133 -0
- package/types/caribeng-ui-confirmdialog.d.ts +57 -6
- package/types/caribeng-ui-confirmpopup.d.ts +74 -5
- package/types/caribeng-ui-contextmenu.d.ts +11 -1
- package/types/caribeng-ui-copy-button.d.ts +90 -0
- package/types/caribeng-ui-dataview.d.ts +65 -5
- package/types/caribeng-ui-datepicker.d.ts +186 -21
- package/types/caribeng-ui-descriptions.d.ts +63 -0
- package/types/caribeng-ui-dialog.d.ts +4 -1
- package/types/caribeng-ui-dock.d.ts +17 -2
- package/types/caribeng-ui-drawer.d.ts +7 -2
- package/types/caribeng-ui-dynamicdialog.d.ts +93 -3
- package/types/caribeng-ui-editor.d.ts +486 -13
- package/types/caribeng-ui-empty.d.ts +34 -0
- package/types/caribeng-ui-file-card.d.ts +28 -3
- package/types/caribeng-ui-fileupload.d.ts +27 -4
- package/types/caribeng-ui-folder-card.d.ts +31 -6
- package/types/caribeng-ui-galleria.d.ts +9 -0
- package/types/caribeng-ui-image.d.ts +10 -0
- package/types/caribeng-ui-inplace.d.ts +8 -0
- package/types/caribeng-ui-input-number.d.ts +3 -1
- package/types/caribeng-ui-inputmask.d.ts +8 -1
- package/types/caribeng-ui-inputotp.d.ts +7 -2
- package/types/caribeng-ui-kanban.d.ts +783 -0
- package/types/caribeng-ui-kbd.d.ts +36 -0
- package/types/caribeng-ui-keyfilter.d.ts +30 -0
- package/types/caribeng-ui-listbox.d.ts +5 -3
- package/types/caribeng-ui-megamenu.d.ts +37 -2
- package/types/caribeng-ui-mentions.d.ts +127 -0
- package/types/caribeng-ui-menu.d.ts +14 -2
- package/types/caribeng-ui-menubar.d.ts +12 -1
- package/types/caribeng-ui-message.d.ts +5 -0
- package/types/caribeng-ui-metergroup.d.ts +9 -1
- package/types/caribeng-ui-multiselect.d.ts +71 -10
- package/types/caribeng-ui-orderlist.d.ts +58 -6
- package/types/caribeng-ui-organizationchart.d.ts +7 -1
- package/types/caribeng-ui-paginator.d.ts +3 -0
- package/types/caribeng-ui-panel.d.ts +3 -0
- package/types/caribeng-ui-panelmenu.d.ts +11 -1
- package/types/caribeng-ui-password.d.ts +4 -2
- package/types/caribeng-ui-pdfviewer.d.ts +258 -0
- package/types/caribeng-ui-phone-input.d.ts +168 -0
- package/types/caribeng-ui-picklist.d.ts +67 -7
- package/types/caribeng-ui-pricing.d.ts +49 -9
- package/types/caribeng-ui-qrcode.d.ts +88 -0
- package/types/caribeng-ui-rating.d.ts +6 -2
- package/types/caribeng-ui-repeater.d.ts +79 -0
- package/types/caribeng-ui-result.d.ts +35 -0
- package/types/caribeng-ui-scrollpanel.d.ts +4 -1
- package/types/caribeng-ui-scrolltop.d.ts +4 -1
- package/types/caribeng-ui-select.d.ts +73 -9
- package/types/caribeng-ui-sidebar.d.ts +167 -0
- package/types/caribeng-ui-slider.d.ts +63 -10
- package/types/caribeng-ui-speeddial.d.ts +5 -2
- package/types/caribeng-ui-spinner.d.ts +3 -0
- package/types/caribeng-ui-splitbutton.d.ts +49 -0
- package/types/caribeng-ui-splitter.d.ts +3 -0
- package/types/caribeng-ui-statistic.d.ts +65 -0
- package/types/caribeng-ui-stepper.d.ts +5 -0
- package/types/caribeng-ui-steps.d.ts +4 -1
- package/types/caribeng-ui-table.d.ts +185 -17
- package/types/caribeng-ui-tabmenu.d.ts +11 -1
- package/types/caribeng-ui-terminal.d.ts +10 -0
- package/types/caribeng-ui-themetoggle.d.ts +32 -0
- package/types/caribeng-ui-tieredmenu.d.ts +22 -3
- package/types/caribeng-ui-timeline.d.ts +63 -4
- package/types/caribeng-ui-toast.d.ts +3 -0
- package/types/caribeng-ui-togglebutton.d.ts +5 -3
- package/types/caribeng-ui-toolbar.d.ts +7 -4
- package/types/caribeng-ui-tree.d.ts +76 -4
- package/types/caribeng-ui-treeselect.d.ts +10 -2
- package/types/caribeng-ui-treetable.d.ts +68 -4
- package/types/caribeng-ui-virtualscroller.d.ts +45 -5
- 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.
|
|
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
|
-
*
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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: {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
|
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.
|
|
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>
|