@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,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, output, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, model, output, inject, ElementRef, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Card-select de Caribe Design: tarjeta con buscador y lista de opciones
|
|
@@ -12,18 +13,47 @@ import { input, model, output, computed, ViewEncapsulation, ChangeDetectionStrat
|
|
|
12
13
|
*/
|
|
13
14
|
class CbCardSelect {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
15
18
|
this.items = input([], /* @ts-ignore */
|
|
16
19
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
17
|
-
this.label = input(
|
|
20
|
+
this.label = input(undefined, /* @ts-ignore */
|
|
18
21
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
19
22
|
this.selected = model(null, /* @ts-ignore */
|
|
20
23
|
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
21
24
|
this.selectionChange = output();
|
|
22
25
|
this.query = model('', /* @ts-ignore */
|
|
23
26
|
...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.host = inject(ElementRef);
|
|
28
|
+
/** Opción que entra en el orden de tabulación: la elegida o, si no está visible, la primera. */
|
|
29
|
+
this.tabbable = computed(() => Math.max(0, this.filtered().indexOf(this.selected() ?? '')), /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "tabbable" }] : /* istanbul ignore next */ []));
|
|
24
31
|
this.filtered = computed(() => this.items().filter((x) => x.toLocaleLowerCase().includes(this.query().toLocaleLowerCase())), /* @ts-ignore */
|
|
25
32
|
...(ngDevMode ? [{ debugName: "filtered" }] : /* istanbul ignore next */ []));
|
|
26
33
|
}
|
|
34
|
+
choose(item) {
|
|
35
|
+
this.selected.set(item);
|
|
36
|
+
this.selectionChange.emit(item);
|
|
37
|
+
}
|
|
38
|
+
/** Patrón *listbox*: flechas (circular), Inicio y Fin mueven el foco; Enter / Espacio eligen (botón nativo). */
|
|
39
|
+
onListKeydown(event) {
|
|
40
|
+
const options = Array.from(this.host.nativeElement.querySelectorAll('.cb-card-select__option'));
|
|
41
|
+
const cur = options.indexOf(event.target);
|
|
42
|
+
if (cur < 0)
|
|
43
|
+
return;
|
|
44
|
+
const last = options.length - 1;
|
|
45
|
+
const target = event.key === 'ArrowDown' ? (cur < last ? cur + 1 : 0)
|
|
46
|
+
: event.key === 'ArrowUp' ? (cur > 0 ? cur - 1 : last)
|
|
47
|
+
: event.key === 'Home' ? 0
|
|
48
|
+
: event.key === 'End' ? last
|
|
49
|
+
: -1;
|
|
50
|
+
if (target < 0)
|
|
51
|
+
return;
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
for (const [i, option] of options.entries())
|
|
54
|
+
option.tabIndex = i === target ? 0 : -1;
|
|
55
|
+
options[target].focus();
|
|
56
|
+
}
|
|
27
57
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbCardSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28
58
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbCardSelect, isStandalone: true, selector: "cb-card-select", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", selectionChange: "selectionChange", query: "queryChange" }, ngImport: i0, template: `
|
|
29
59
|
<section class="cb-card-select">
|
|
@@ -32,23 +62,29 @@ class CbCardSelect {
|
|
|
32
62
|
type="search"
|
|
33
63
|
[value]="query()"
|
|
34
64
|
(input)="query.set($any($event.target).value)"
|
|
35
|
-
aria-label="
|
|
36
|
-
placeholder="
|
|
65
|
+
[attr.aria-label]="t().filterOptions"
|
|
66
|
+
[placeholder]="t().search"
|
|
37
67
|
/>
|
|
38
|
-
<div
|
|
39
|
-
|
|
68
|
+
<div
|
|
69
|
+
class="cb-card-select__list"
|
|
70
|
+
role="listbox"
|
|
71
|
+
[attr.aria-label]="(label() ?? t().options)"
|
|
72
|
+
(keydown)="onListKeydown($event)"
|
|
73
|
+
>
|
|
74
|
+
@for (item of filtered(); track $index) {
|
|
40
75
|
<button
|
|
41
76
|
type="button"
|
|
42
77
|
class="cb-card-select__option"
|
|
43
78
|
role="option"
|
|
44
79
|
[class.cb-is-selected]="selected() === item"
|
|
45
80
|
[attr.aria-selected]="selected() === item"
|
|
46
|
-
|
|
81
|
+
[attr.tabindex]="$index === tabbable() ? 0 : -1"
|
|
82
|
+
(click)="choose(item)"
|
|
47
83
|
>
|
|
48
84
|
{{ item }}
|
|
49
85
|
</button>
|
|
50
86
|
} @empty {
|
|
51
|
-
<span class="cb-card-select__empty">
|
|
87
|
+
<span class="cb-card-select__empty">{{ t().noResults }}</span>
|
|
52
88
|
}
|
|
53
89
|
</div>
|
|
54
90
|
</section>
|
|
@@ -63,23 +99,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
63
99
|
type="search"
|
|
64
100
|
[value]="query()"
|
|
65
101
|
(input)="query.set($any($event.target).value)"
|
|
66
|
-
aria-label="
|
|
67
|
-
placeholder="
|
|
102
|
+
[attr.aria-label]="t().filterOptions"
|
|
103
|
+
[placeholder]="t().search"
|
|
68
104
|
/>
|
|
69
|
-
<div
|
|
70
|
-
|
|
105
|
+
<div
|
|
106
|
+
class="cb-card-select__list"
|
|
107
|
+
role="listbox"
|
|
108
|
+
[attr.aria-label]="(label() ?? t().options)"
|
|
109
|
+
(keydown)="onListKeydown($event)"
|
|
110
|
+
>
|
|
111
|
+
@for (item of filtered(); track $index) {
|
|
71
112
|
<button
|
|
72
113
|
type="button"
|
|
73
114
|
class="cb-card-select__option"
|
|
74
115
|
role="option"
|
|
75
116
|
[class.cb-is-selected]="selected() === item"
|
|
76
117
|
[attr.aria-selected]="selected() === item"
|
|
77
|
-
|
|
118
|
+
[attr.tabindex]="$index === tabbable() ? 0 : -1"
|
|
119
|
+
(click)="choose(item)"
|
|
78
120
|
>
|
|
79
121
|
{{ item }}
|
|
80
122
|
</button>
|
|
81
123
|
} @empty {
|
|
82
|
-
<span class="cb-card-select__empty">
|
|
124
|
+
<span class="cb-card-select__empty">{{ t().noResults }}</span>
|
|
83
125
|
}
|
|
84
126
|
</div>
|
|
85
127
|
</section>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Circle-loading de Caribe Design: progreso circular determinado o
|
|
@@ -13,13 +14,15 @@ import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component
|
|
|
13
14
|
*/
|
|
14
15
|
class CbCircleLoading {
|
|
15
16
|
constructor() {
|
|
17
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
18
|
+
this.t = injectCbTranslation();
|
|
16
19
|
this.progress = input(65, /* @ts-ignore */
|
|
17
20
|
...(ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
18
21
|
this.size = input(48, /* @ts-ignore */
|
|
19
22
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
20
23
|
this.indeterminate = input(false, /* @ts-ignore */
|
|
21
24
|
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
22
|
-
this.label = input(
|
|
25
|
+
this.label = input(undefined, /* @ts-ignore */
|
|
23
26
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
24
27
|
this.circumference = 2 * Math.PI * 20;
|
|
25
28
|
this.dashOffset = computed(() => {
|
|
@@ -38,7 +41,7 @@ class CbCircleLoading {
|
|
|
38
41
|
[attr.aria-valuenow]="indeterminate() ? null : progress()"
|
|
39
42
|
aria-valuemin="0"
|
|
40
43
|
aria-valuemax="100"
|
|
41
|
-
[attr.aria-label]="label()"
|
|
44
|
+
[attr.aria-label]="(label() ?? t().loading)"
|
|
42
45
|
>
|
|
43
46
|
<svg
|
|
44
47
|
class="cb-circle-loading__svg"
|
|
@@ -68,8 +71,8 @@ class CbCircleLoading {
|
|
|
68
71
|
transform="rotate(-90 24 24)"
|
|
69
72
|
/>
|
|
70
73
|
</svg>
|
|
71
|
-
@if (label()) {
|
|
72
|
-
<span class="cb-circle-loading__label">{{ label() }}</span>
|
|
74
|
+
@if ((label() ?? t().loading)) {
|
|
75
|
+
<span class="cb-circle-loading__label">{{ (label() ?? t().loading) }}</span>
|
|
73
76
|
}
|
|
74
77
|
</div>
|
|
75
78
|
`, isInline: true, styles: [":host{display:inline-flex}.cb-circle-loading{display:inline-flex;flex-direction:column;align-items:center;gap:var(--cb-space-2, .4rem);font-family:var(--cb-font-sans, inherit)}.cb-circle-loading__track{stroke:var(--cb-color-surface-200, #e2e8f0)}.cb-circle-loading__bar{stroke:var(--cb-color-primary-500, #10b981);transition:stroke-dashoffset var(--cb-duration-normal, .2s) var(--cb-ease, ease)}.cb-circle-loading__svg.cb-is-indeterminate{animation:cb-circle-spin .9s linear infinite;transform-origin:center}.cb-circle-loading__label{font-size:var(--cb-text-xs, .75rem);color:var(--cb-color-text-muted, #64748b)}@keyframes cb-circle-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.cb-circle-loading__svg.cb-is-indeterminate{animation-duration:2.4s}}:host-context([data-theme=\"dark\"]) .cb-circle-loading__track{stroke:var(--cb-color-surface-700, #334155)}:host-context([data-theme=\"dark\"]) .cb-circle-loading__label{color:var(--cb-color-surface-300, #cbd5e1)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -83,7 +86,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
83
86
|
[attr.aria-valuenow]="indeterminate() ? null : progress()"
|
|
84
87
|
aria-valuemin="0"
|
|
85
88
|
aria-valuemax="100"
|
|
86
|
-
[attr.aria-label]="label()"
|
|
89
|
+
[attr.aria-label]="(label() ?? t().loading)"
|
|
87
90
|
>
|
|
88
91
|
<svg
|
|
89
92
|
class="cb-circle-loading__svg"
|
|
@@ -113,8 +116,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
113
116
|
transform="rotate(-90 24 24)"
|
|
114
117
|
/>
|
|
115
118
|
</svg>
|
|
116
|
-
@if (label()) {
|
|
117
|
-
<span class="cb-circle-loading__label">{{ label() }}</span>
|
|
119
|
+
@if ((label() ?? t().loading)) {
|
|
120
|
+
<span class="cb-circle-loading__label">{{ (label() ?? t().loading) }}</span>
|
|
118
121
|
}
|
|
119
122
|
</div>
|
|
120
123
|
`, styles: [":host{display:inline-flex}.cb-circle-loading{display:inline-flex;flex-direction:column;align-items:center;gap:var(--cb-space-2, .4rem);font-family:var(--cb-font-sans, inherit)}.cb-circle-loading__track{stroke:var(--cb-color-surface-200, #e2e8f0)}.cb-circle-loading__bar{stroke:var(--cb-color-primary-500, #10b981);transition:stroke-dashoffset var(--cb-duration-normal, .2s) var(--cb-ease, ease)}.cb-circle-loading__svg.cb-is-indeterminate{animation:cb-circle-spin .9s linear infinite;transform-origin:center}.cb-circle-loading__label{font-size:var(--cb-text-xs, .75rem);color:var(--cb-color-text-muted, #64748b)}@keyframes cb-circle-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.cb-circle-loading__svg.cb-is-indeterminate{animation-duration:2.4s}}:host-context([data-theme=\"dark\"]) .cb-circle-loading__track{stroke:var(--cb-color-surface-700, #334155)}:host-context([data-theme=\"dark\"]) .cb-circle-loading__label{color:var(--cb-color-surface-300, #cbd5e1)}\n"] }]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation, cbFormat } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Coachmark de Caribe Design: tarjeta de ayuda guiada paso a paso para resaltar
|
|
@@ -12,6 +13,10 @@ import { input, model, output, ViewEncapsulation, ChangeDetectionStrategy, Compo
|
|
|
12
13
|
*/
|
|
13
14
|
class CbCoachmark {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
18
|
+
/** Rellena `{0}`, `{1}`… de un texto traducido. */
|
|
19
|
+
this.fmt = cbFormat;
|
|
15
20
|
this.steps = input([], /* @ts-ignore */
|
|
16
21
|
...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
|
|
17
22
|
this.visible = model(true, /* @ts-ignore */
|
|
@@ -21,7 +26,9 @@ class CbCoachmark {
|
|
|
21
26
|
this.stepChange = output();
|
|
22
27
|
}
|
|
23
28
|
previous() {
|
|
24
|
-
this.index
|
|
29
|
+
if (this.index() === 0)
|
|
30
|
+
return;
|
|
31
|
+
this.index.update((i) => i - 1);
|
|
25
32
|
this.stepChange.emit(this.index());
|
|
26
33
|
}
|
|
27
34
|
next() {
|
|
@@ -38,18 +45,26 @@ class CbCoachmark {
|
|
|
38
45
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbCoachmark, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
46
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbCoachmark, isStandalone: true, selector: "cb-coachmark", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", index: "indexChange", stepChange: "stepChange" }, ngImport: i0, template: `
|
|
40
47
|
@if (visible() && steps().length) {
|
|
41
|
-
<aside
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
<aside
|
|
49
|
+
class="cb-coachmark"
|
|
50
|
+
role="dialog"
|
|
51
|
+
[attr.aria-label]="t().guidedHelp"
|
|
52
|
+
(keydown.escape)="close()"
|
|
53
|
+
>
|
|
54
|
+
<!-- Región viva: al cambiar de paso se anuncian el contador y el título. -->
|
|
55
|
+
<div class="cb-coachmark__announce" aria-live="polite" aria-atomic="true">
|
|
56
|
+
<span class="cb-coachmark__counter">
|
|
57
|
+
{{ fmt(t().stepOf, index() + 1, steps().length) }}
|
|
58
|
+
</span>
|
|
59
|
+
<h3 class="cb-coachmark__title">{{ steps()[index()] }}</h3>
|
|
60
|
+
</div>
|
|
46
61
|
<div class="cb-coachmark__actions">
|
|
47
62
|
<button
|
|
48
63
|
type="button"
|
|
49
64
|
class="cb-coachmark__btn cb-coachmark__btn--ghost"
|
|
50
65
|
(click)="close()"
|
|
51
66
|
>
|
|
52
|
-
|
|
67
|
+
{{ t().skip }}
|
|
53
68
|
</button>
|
|
54
69
|
<button
|
|
55
70
|
type="button"
|
|
@@ -57,36 +72,44 @@ class CbCoachmark {
|
|
|
57
72
|
(click)="previous()"
|
|
58
73
|
[disabled]="index() === 0"
|
|
59
74
|
>
|
|
60
|
-
|
|
75
|
+
{{ t().previous }}
|
|
61
76
|
</button>
|
|
62
77
|
<button
|
|
63
78
|
type="button"
|
|
64
79
|
class="cb-coachmark__btn cb-coachmark__btn--primary"
|
|
65
80
|
(click)="next()"
|
|
66
81
|
>
|
|
67
|
-
{{ index() === steps().length - 1 ?
|
|
82
|
+
{{ index() === steps().length - 1 ? t().finish : t().next }}
|
|
68
83
|
</button>
|
|
69
84
|
</div>
|
|
70
85
|
</aside>
|
|
71
86
|
}
|
|
72
|
-
`, isInline: true, styles: [":host{display:block;width:100%;max-width:20rem}.cb-coachmark{position:relative;display:flex;flex-direction:column;gap:var(--cb-space-2, .5rem);box-sizing:border-box;padding:var(--cb-space-4, 1rem);font-family:var(--cb-font-sans, inherit);color:var(--cb-color-surface-0, #ffffff);background-color:var(--cb-color-surface-900, #0f172a);border-radius:var(--cb-radius-lg, .75rem);box-shadow:var(--cb-shadow-lg, 0 16px 36px rgba(0, 0, 0, .3))}.cb-coachmark__counter{font-size:var(--cb-text-xs, .72rem);font-weight:var(--cb-font-weight-semibold, 600);letter-spacing:.04em;text-transform:uppercase;color:var(--cb-color-primary-300, #6ee7b7)}.cb-coachmark__title{margin:0;font-size:var(--cb-text-base, .95rem);font-weight:var(--cb-font-weight-semibold, 600);line-height:var(--cb-line-height-normal, 1.45)}.cb-coachmark__actions{display:flex;justify-content:flex-end;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-2, .5rem)}.cb-coachmark__btn{padding:var(--cb-space-2, .4rem) var(--cb-space-3, .75rem);font:inherit;font-size:var(--cb-text-sm, .8125rem);font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-surface-0, #ffffff);background-color:#ffffff1f;border:none;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;transition:background-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-coachmark__btn:hover:not(:disabled){background-color:#ffffff38}.cb-coachmark__btn:disabled{opacity:.4;cursor:not-allowed}.cb-coachmark__btn--ghost{background-color:transparent}.cb-coachmark__btn--primary{color:var(--cb-color-primary-contrast, #ffffff);background-color:var(--cb-color-primary-600, #047857)}.cb-coachmark__btn--primary:hover:not(:disabled){background-color:var(--cb-color-primary-500, #10b981)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
87
|
+
`, isInline: true, styles: [":host{display:block;width:100%;max-width:20rem}.cb-coachmark{position:relative;display:flex;flex-direction:column;gap:var(--cb-space-2, .5rem);box-sizing:border-box;padding:var(--cb-space-4, 1rem);font-family:var(--cb-font-sans, inherit);color:var(--cb-color-surface-0, #ffffff);background-color:var(--cb-color-surface-900, #0f172a);border-radius:var(--cb-radius-lg, .75rem);box-shadow:var(--cb-shadow-lg, 0 16px 36px rgba(0, 0, 0, .3))}.cb-coachmark__announce{display:flex;flex-direction:column;gap:var(--cb-space-2, .5rem)}.cb-coachmark__counter{font-size:var(--cb-text-xs, .72rem);font-weight:var(--cb-font-weight-semibold, 600);letter-spacing:.04em;text-transform:uppercase;color:var(--cb-color-primary-300, #6ee7b7)}.cb-coachmark__title{margin:0;font-size:var(--cb-text-base, .95rem);font-weight:var(--cb-font-weight-semibold, 600);line-height:var(--cb-line-height-normal, 1.45)}.cb-coachmark__actions{display:flex;justify-content:flex-end;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-2, .5rem)}.cb-coachmark__btn{padding:var(--cb-space-2, .4rem) var(--cb-space-3, .75rem);font:inherit;font-size:var(--cb-text-sm, .8125rem);font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-surface-0, #ffffff);background-color:#ffffff1f;border:none;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;transition:background-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-coachmark__btn:hover:not(:disabled){background-color:#ffffff38}.cb-coachmark__btn:disabled{opacity:.4;cursor:not-allowed}.cb-coachmark__btn--ghost{background-color:transparent}.cb-coachmark__btn--primary{color:var(--cb-color-primary-contrast, #ffffff);background-color:var(--cb-color-primary-600, #047857)}.cb-coachmark__btn--primary:hover:not(:disabled){background-color:var(--cb-color-primary-500, #10b981)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
73
88
|
}
|
|
74
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbCoachmark, decorators: [{
|
|
75
90
|
type: Component,
|
|
76
91
|
args: [{ selector: 'cb-coachmark', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: `
|
|
77
92
|
@if (visible() && steps().length) {
|
|
78
|
-
<aside
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
93
|
+
<aside
|
|
94
|
+
class="cb-coachmark"
|
|
95
|
+
role="dialog"
|
|
96
|
+
[attr.aria-label]="t().guidedHelp"
|
|
97
|
+
(keydown.escape)="close()"
|
|
98
|
+
>
|
|
99
|
+
<!-- Región viva: al cambiar de paso se anuncian el contador y el título. -->
|
|
100
|
+
<div class="cb-coachmark__announce" aria-live="polite" aria-atomic="true">
|
|
101
|
+
<span class="cb-coachmark__counter">
|
|
102
|
+
{{ fmt(t().stepOf, index() + 1, steps().length) }}
|
|
103
|
+
</span>
|
|
104
|
+
<h3 class="cb-coachmark__title">{{ steps()[index()] }}</h3>
|
|
105
|
+
</div>
|
|
83
106
|
<div class="cb-coachmark__actions">
|
|
84
107
|
<button
|
|
85
108
|
type="button"
|
|
86
109
|
class="cb-coachmark__btn cb-coachmark__btn--ghost"
|
|
87
110
|
(click)="close()"
|
|
88
111
|
>
|
|
89
|
-
|
|
112
|
+
{{ t().skip }}
|
|
90
113
|
</button>
|
|
91
114
|
<button
|
|
92
115
|
type="button"
|
|
@@ -94,19 +117,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
94
117
|
(click)="previous()"
|
|
95
118
|
[disabled]="index() === 0"
|
|
96
119
|
>
|
|
97
|
-
|
|
120
|
+
{{ t().previous }}
|
|
98
121
|
</button>
|
|
99
122
|
<button
|
|
100
123
|
type="button"
|
|
101
124
|
class="cb-coachmark__btn cb-coachmark__btn--primary"
|
|
102
125
|
(click)="next()"
|
|
103
126
|
>
|
|
104
|
-
{{ index() === steps().length - 1 ?
|
|
127
|
+
{{ index() === steps().length - 1 ? t().finish : t().next }}
|
|
105
128
|
</button>
|
|
106
129
|
</div>
|
|
107
130
|
</aside>
|
|
108
131
|
}
|
|
109
|
-
`, styles: [":host{display:block;width:100%;max-width:20rem}.cb-coachmark{position:relative;display:flex;flex-direction:column;gap:var(--cb-space-2, .5rem);box-sizing:border-box;padding:var(--cb-space-4, 1rem);font-family:var(--cb-font-sans, inherit);color:var(--cb-color-surface-0, #ffffff);background-color:var(--cb-color-surface-900, #0f172a);border-radius:var(--cb-radius-lg, .75rem);box-shadow:var(--cb-shadow-lg, 0 16px 36px rgba(0, 0, 0, .3))}.cb-coachmark__counter{font-size:var(--cb-text-xs, .72rem);font-weight:var(--cb-font-weight-semibold, 600);letter-spacing:.04em;text-transform:uppercase;color:var(--cb-color-primary-300, #6ee7b7)}.cb-coachmark__title{margin:0;font-size:var(--cb-text-base, .95rem);font-weight:var(--cb-font-weight-semibold, 600);line-height:var(--cb-line-height-normal, 1.45)}.cb-coachmark__actions{display:flex;justify-content:flex-end;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-2, .5rem)}.cb-coachmark__btn{padding:var(--cb-space-2, .4rem) var(--cb-space-3, .75rem);font:inherit;font-size:var(--cb-text-sm, .8125rem);font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-surface-0, #ffffff);background-color:#ffffff1f;border:none;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;transition:background-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-coachmark__btn:hover:not(:disabled){background-color:#ffffff38}.cb-coachmark__btn:disabled{opacity:.4;cursor:not-allowed}.cb-coachmark__btn--ghost{background-color:transparent}.cb-coachmark__btn--primary{color:var(--cb-color-primary-contrast, #ffffff);background-color:var(--cb-color-primary-600, #047857)}.cb-coachmark__btn--primary:hover:not(:disabled){background-color:var(--cb-color-primary-500, #10b981)}\n"] }]
|
|
132
|
+
`, styles: [":host{display:block;width:100%;max-width:20rem}.cb-coachmark{position:relative;display:flex;flex-direction:column;gap:var(--cb-space-2, .5rem);box-sizing:border-box;padding:var(--cb-space-4, 1rem);font-family:var(--cb-font-sans, inherit);color:var(--cb-color-surface-0, #ffffff);background-color:var(--cb-color-surface-900, #0f172a);border-radius:var(--cb-radius-lg, .75rem);box-shadow:var(--cb-shadow-lg, 0 16px 36px rgba(0, 0, 0, .3))}.cb-coachmark__announce{display:flex;flex-direction:column;gap:var(--cb-space-2, .5rem)}.cb-coachmark__counter{font-size:var(--cb-text-xs, .72rem);font-weight:var(--cb-font-weight-semibold, 600);letter-spacing:.04em;text-transform:uppercase;color:var(--cb-color-primary-300, #6ee7b7)}.cb-coachmark__title{margin:0;font-size:var(--cb-text-base, .95rem);font-weight:var(--cb-font-weight-semibold, 600);line-height:var(--cb-line-height-normal, 1.45)}.cb-coachmark__actions{display:flex;justify-content:flex-end;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-2, .5rem)}.cb-coachmark__btn{padding:var(--cb-space-2, .4rem) var(--cb-space-3, .75rem);font:inherit;font-size:var(--cb-text-sm, .8125rem);font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-surface-0, #ffffff);background-color:#ffffff1f;border:none;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;transition:background-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-coachmark__btn:hover:not(:disabled){background-color:#ffffff38}.cb-coachmark__btn:disabled{opacity:.4;cursor:not-allowed}.cb-coachmark__btn--ghost{background-color:transparent}.cb-coachmark__btn--primary{color:var(--cb-color-primary-contrast, #ffffff);background-color:var(--cb-color-primary-600, #047857)}.cb-coachmark__btn--primary:hover:not(:disabled){background-color:var(--cb-color-primary-500, #10b981)}\n"] }]
|
|
110
133
|
}], propDecorators: { steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }, { type: i0.Output, args: ["indexChange"] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }] } });
|
|
111
134
|
|
|
112
135
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Data-table de Caribe Design: tabla simple de columnas y filas con mensaje de
|
|
@@ -12,21 +13,26 @@ import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@a
|
|
|
12
13
|
*/
|
|
13
14
|
class CbDataTable {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
15
18
|
this.columns = input([], /* @ts-ignore */
|
|
16
19
|
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
17
20
|
this.rows = input([], /* @ts-ignore */
|
|
18
21
|
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
19
|
-
this.emptyMessage = input(
|
|
22
|
+
this.emptyMessage = input(undefined, /* @ts-ignore */
|
|
20
23
|
...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Nombre accesible de la tabla (p. ej. "Movimientos del mes"). */
|
|
25
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
21
27
|
}
|
|
22
28
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDataTable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDataTable, isStandalone: true, selector: "cb-data-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
29
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDataTable, isStandalone: true, selector: "cb-data-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
24
30
|
<div class="cb-data-table">
|
|
25
|
-
<table class="cb-data-table__table">
|
|
31
|
+
<table class="cb-data-table__table" [attr.aria-label]="ariaLabel() || null">
|
|
26
32
|
<thead>
|
|
27
33
|
<tr>
|
|
28
34
|
@for (col of columns(); track col) {
|
|
29
|
-
<th class="cb-data-table__th">{{ col }}</th>
|
|
35
|
+
<th class="cb-data-table__th" scope="col">{{ col }}</th>
|
|
30
36
|
}
|
|
31
37
|
</tr>
|
|
32
38
|
</thead>
|
|
@@ -40,7 +46,7 @@ class CbDataTable {
|
|
|
40
46
|
} @empty {
|
|
41
47
|
<tr>
|
|
42
48
|
<td class="cb-data-table__empty" [attr.colspan]="columns().length">
|
|
43
|
-
{{ emptyMessage() }}
|
|
49
|
+
{{ (emptyMessage() ?? t().noData) }}
|
|
44
50
|
</td>
|
|
45
51
|
</tr>
|
|
46
52
|
}
|
|
@@ -53,11 +59,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
53
59
|
type: Component,
|
|
54
60
|
args: [{ selector: 'cb-data-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: `
|
|
55
61
|
<div class="cb-data-table">
|
|
56
|
-
<table class="cb-data-table__table">
|
|
62
|
+
<table class="cb-data-table__table" [attr.aria-label]="ariaLabel() || null">
|
|
57
63
|
<thead>
|
|
58
64
|
<tr>
|
|
59
65
|
@for (col of columns(); track col) {
|
|
60
|
-
<th class="cb-data-table__th">{{ col }}</th>
|
|
66
|
+
<th class="cb-data-table__th" scope="col">{{ col }}</th>
|
|
61
67
|
}
|
|
62
68
|
</tr>
|
|
63
69
|
</thead>
|
|
@@ -71,7 +77,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
71
77
|
} @empty {
|
|
72
78
|
<tr>
|
|
73
79
|
<td class="cb-data-table__empty" [attr.colspan]="columns().length">
|
|
74
|
-
{{ emptyMessage() }}
|
|
80
|
+
{{ (emptyMessage() ?? t().noData) }}
|
|
75
81
|
</td>
|
|
76
82
|
</tr>
|
|
77
83
|
}
|
|
@@ -79,7 +85,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
79
85
|
</table>
|
|
80
86
|
</div>
|
|
81
87
|
`, styles: [":host{display:block;width:100%}.cb-data-table{width:100%;overflow-x:auto;font-family:var(--cb-font-sans, inherit);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #e2e8f0);border-radius:var(--cb-radius-lg, .75rem)}.cb-data-table__table{width:100%;border-collapse:collapse;font-size:var(--cb-text-sm, .875rem)}.cb-data-table__th{padding:var(--cb-space-3, .75rem) var(--cb-space-4, 1rem);text-align:left;font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-muted, #64748b);background-color:var(--cb-color-surface-50, #f8fafc);border-bottom:1px solid var(--cb-color-border, #e2e8f0);white-space:nowrap}.cb-data-table__td{padding:var(--cb-space-3, .75rem) var(--cb-space-4, 1rem);color:var(--cb-color-text, #334155);border-bottom:1px solid var(--cb-color-border, #e2e8f0)}.cb-data-table__row:last-child .cb-data-table__td{border-bottom:none}.cb-data-table__row:hover .cb-data-table__td{background-color:var(--cb-color-surface-50, #f8fafc)}.cb-data-table__empty{padding:var(--cb-space-5, 1.25rem);text-align:center;color:var(--cb-color-text-muted, #64748b)}:host-context([data-theme=\"dark\"]) .cb-data-table{background-color:var(--cb-color-surface-800, #1e293b);border-color:var(--cb-color-surface-600, #475569)}:host-context([data-theme=\"dark\"]) .cb-data-table__th{color:var(--cb-color-surface-300, #cbd5e1);background-color:var(--cb-color-surface-900, #0f172a);border-bottom-color:var(--cb-color-surface-600, #475569)}:host-context([data-theme=\"dark\"]) .cb-data-table__td{color:var(--cb-color-surface-100, #f1f5f9);border-bottom-color:var(--cb-color-surface-700, #334155)}:host-context([data-theme=\"dark\"]) .cb-data-table__row:hover .cb-data-table__td{background-color:var(--cb-color-surface-700, #334155)}\n"] }]
|
|
82
|
-
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }] } });
|
|
88
|
+
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
83
89
|
|
|
84
90
|
/**
|
|
85
91
|
* Generated bundle index. Do not edit.
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
+
import { injectCbTranslation, cbFormat } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Dots-indicator de Caribe Design: indicador de paginación por puntos. El punto
|
|
@@ -12,18 +13,43 @@ import { input, model, computed, ViewEncapsulation, ChangeDetectionStrategy, Com
|
|
|
12
13
|
*/
|
|
13
14
|
class CbDotsIndicator {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
18
|
+
/** Rellena `{0}`, `{1}`… de un texto traducido. */
|
|
19
|
+
this.fmt = cbFormat;
|
|
15
20
|
/** Número de puntos. */
|
|
16
21
|
this.count = input(4, /* @ts-ignore */
|
|
17
22
|
...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
18
23
|
/** Índice activo (two-way). */
|
|
19
24
|
this.activeIndex = model(0, /* @ts-ignore */
|
|
20
25
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.host = inject(ElementRef);
|
|
21
27
|
this.indices = computed(() => Array.from({ length: Math.max(1, this.count()) }, (_, i) => i), /* @ts-ignore */
|
|
22
28
|
...(ngDevMode ? [{ debugName: "indices" }] : /* istanbul ignore next */ []));
|
|
23
29
|
}
|
|
30
|
+
/** Patrón *tabs*: flechas (circular), Inicio y Fin cambian de página y mueven el foco. */
|
|
31
|
+
onKeydown(event) {
|
|
32
|
+
const last = this.indices().length - 1;
|
|
33
|
+
const cur = this.activeIndex();
|
|
34
|
+
const target = event.key === 'ArrowRight' ? (cur < last ? cur + 1 : 0)
|
|
35
|
+
: event.key === 'ArrowLeft' ? (cur > 0 ? cur - 1 : last)
|
|
36
|
+
: event.key === 'Home' ? 0
|
|
37
|
+
: event.key === 'End' ? last
|
|
38
|
+
: -1;
|
|
39
|
+
if (target < 0)
|
|
40
|
+
return;
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
this.activeIndex.set(target);
|
|
43
|
+
this.host.nativeElement.querySelectorAll('.cb-dots-indicator__dot')[target]?.focus();
|
|
44
|
+
}
|
|
24
45
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDotsIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
25
46
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDotsIndicator, isStandalone: true, selector: "cb-dots-indicator", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange" }, host: { classAttribute: "cb-dots-indicator-host" }, ngImport: i0, template: `
|
|
26
|
-
<div
|
|
47
|
+
<div
|
|
48
|
+
class="cb-dots-indicator"
|
|
49
|
+
role="tablist"
|
|
50
|
+
[attr.aria-label]="t().pageIndicator"
|
|
51
|
+
(keydown)="onKeydown($event)"
|
|
52
|
+
>
|
|
27
53
|
@for (idx of indices(); track idx) {
|
|
28
54
|
<button
|
|
29
55
|
type="button"
|
|
@@ -31,7 +57,8 @@ class CbDotsIndicator {
|
|
|
31
57
|
[class.cb-dots-indicator__dot--active]="activeIndex() === idx"
|
|
32
58
|
role="tab"
|
|
33
59
|
[attr.aria-selected]="activeIndex() === idx"
|
|
34
|
-
[attr.
|
|
60
|
+
[attr.tabindex]="activeIndex() === idx ? 0 : -1"
|
|
61
|
+
[attr.aria-label]="fmt(t().page, idx + 1)"
|
|
35
62
|
(click)="activeIndex.set(idx)"
|
|
36
63
|
></button>
|
|
37
64
|
}
|
|
@@ -41,7 +68,12 @@ class CbDotsIndicator {
|
|
|
41
68
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDotsIndicator, decorators: [{
|
|
42
69
|
type: Component,
|
|
43
70
|
args: [{ selector: 'cb-dots-indicator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: { class: 'cb-dots-indicator-host' }, template: `
|
|
44
|
-
<div
|
|
71
|
+
<div
|
|
72
|
+
class="cb-dots-indicator"
|
|
73
|
+
role="tablist"
|
|
74
|
+
[attr.aria-label]="t().pageIndicator"
|
|
75
|
+
(keydown)="onKeydown($event)"
|
|
76
|
+
>
|
|
45
77
|
@for (idx of indices(); track idx) {
|
|
46
78
|
<button
|
|
47
79
|
type="button"
|
|
@@ -49,7 +81,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
49
81
|
[class.cb-dots-indicator__dot--active]="activeIndex() === idx"
|
|
50
82
|
role="tab"
|
|
51
83
|
[attr.aria-selected]="activeIndex() === idx"
|
|
52
|
-
[attr.
|
|
84
|
+
[attr.tabindex]="activeIndex() === idx ? 0 : -1"
|
|
85
|
+
[attr.aria-label]="fmt(t().page, idx + 1)"
|
|
53
86
|
(click)="activeIndex.set(idx)"
|
|
54
87
|
></button>
|
|
55
88
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Expansion-panel de Caribe Design: panel colapsable con cabecera pulsable y
|
|
@@ -10,14 +11,20 @@ import { input, model, ViewEncapsulation, ChangeDetectionStrategy, Component } f
|
|
|
10
11
|
* <cb-expansion-panel title="Detalles" [(expanded)]="open">…</cb-expansion-panel>
|
|
11
12
|
* ```
|
|
12
13
|
*/
|
|
14
|
+
let nextId = 0;
|
|
13
15
|
class CbExpansionPanel {
|
|
14
16
|
constructor() {
|
|
17
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
18
|
+
this.t = injectCbTranslation();
|
|
15
19
|
/** Título de la cabecera. */
|
|
16
|
-
this.title = input(
|
|
20
|
+
this.title = input(undefined, /* @ts-ignore */
|
|
17
21
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
18
22
|
/** Estado abierto/cerrado (two-way). */
|
|
19
23
|
this.expanded = model(false, /* @ts-ignore */
|
|
20
24
|
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
25
|
+
this.uid = ++nextId;
|
|
26
|
+
this.headerId = `cb-expansion-panel-${this.uid}-header`;
|
|
27
|
+
this.bodyId = `cb-expansion-panel-${this.uid}-body`;
|
|
21
28
|
}
|
|
22
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbExpansionPanel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
30
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbExpansionPanel, isStandalone: true, selector: "cb-expansion-panel", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { classAttribute: "cb-expansion-panel-host" }, ngImport: i0, template: `
|
|
@@ -25,14 +32,16 @@ class CbExpansionPanel {
|
|
|
25
32
|
<button
|
|
26
33
|
type="button"
|
|
27
34
|
class="cb-expansion-panel__header"
|
|
35
|
+
[id]="headerId"
|
|
28
36
|
[attr.aria-expanded]="expanded()"
|
|
37
|
+
[attr.aria-controls]="expanded() ? bodyId : null"
|
|
29
38
|
(click)="expanded.set(!expanded())"
|
|
30
39
|
>
|
|
31
|
-
<span class="cb-expansion-panel__title">{{ title() }}</span>
|
|
40
|
+
<span class="cb-expansion-panel__title">{{ (title() ?? t().details) }}</span>
|
|
32
41
|
<span class="cb-expansion-panel__chevron" aria-hidden="true">▾</span>
|
|
33
42
|
</button>
|
|
34
43
|
@if (expanded()) {
|
|
35
|
-
<div class="cb-expansion-panel__body">
|
|
44
|
+
<div class="cb-expansion-panel__body" role="region" [id]="bodyId" [attr.aria-labelledby]="headerId">
|
|
36
45
|
<ng-content />
|
|
37
46
|
</div>
|
|
38
47
|
}
|
|
@@ -46,14 +55,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
46
55
|
<button
|
|
47
56
|
type="button"
|
|
48
57
|
class="cb-expansion-panel__header"
|
|
58
|
+
[id]="headerId"
|
|
49
59
|
[attr.aria-expanded]="expanded()"
|
|
60
|
+
[attr.aria-controls]="expanded() ? bodyId : null"
|
|
50
61
|
(click)="expanded.set(!expanded())"
|
|
51
62
|
>
|
|
52
|
-
<span class="cb-expansion-panel__title">{{ title() }}</span>
|
|
63
|
+
<span class="cb-expansion-panel__title">{{ (title() ?? t().details) }}</span>
|
|
53
64
|
<span class="cb-expansion-panel__chevron" aria-hidden="true">▾</span>
|
|
54
65
|
</button>
|
|
55
66
|
@if (expanded()) {
|
|
56
|
-
<div class="cb-expansion-panel__body">
|
|
67
|
+
<div class="cb-expansion-panel__body" role="region" [id]="bodyId" [attr.aria-labelledby]="headerId">
|
|
57
68
|
<ng-content />
|
|
58
69
|
</div>
|
|
59
70
|
}
|