@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,14 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, output, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Injector, input, computed, output, signal, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { injectCbTranslation, cbVisibleItems, cbRunCommand } from '@caribeng/ui';
|
|
4
5
|
|
|
5
6
|
/** Horizontal navigation bar with optional one-level dropdown menus. */
|
|
6
7
|
class CbMenubar {
|
|
7
8
|
constructor() {
|
|
9
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
10
|
+
this.t = injectCbTranslation();
|
|
8
11
|
this.host = inject((ElementRef));
|
|
12
|
+
this.injector = inject(Injector);
|
|
9
13
|
this.items = input([], /* @ts-ignore */
|
|
10
14
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
11
|
-
|
|
15
|
+
/** Items sin los de `visible: false`. */
|
|
16
|
+
this.visibleItems = computed(() => cbVisibleItems(this.items()), /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "visibleItems" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
12
19
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
13
20
|
this.itemSelect = output();
|
|
14
21
|
this.openIndex = signal(null, /* @ts-ignore */
|
|
@@ -22,6 +29,7 @@ class CbMenubar {
|
|
|
22
29
|
event.preventDefault();
|
|
23
30
|
return;
|
|
24
31
|
}
|
|
32
|
+
cbRunCommand(item);
|
|
25
33
|
this.itemSelect.emit(item);
|
|
26
34
|
if (parentIndex !== undefined)
|
|
27
35
|
this.openIndex.set(null);
|
|
@@ -53,10 +61,11 @@ class CbMenubar {
|
|
|
53
61
|
this.openIndex.set(null);
|
|
54
62
|
return;
|
|
55
63
|
}
|
|
56
|
-
if (event.key === 'ArrowDown' && root && this.
|
|
64
|
+
if (event.key === 'ArrowDown' && root && this.visibleItems()[rootIndex]?.items?.length) {
|
|
57
65
|
event.preventDefault();
|
|
58
66
|
this.openIndex.set(rootIndex);
|
|
59
|
-
|
|
67
|
+
// El submenú se pinta en el siguiente render (zoneless): se enfoca después.
|
|
68
|
+
afterNextRender(() => this.host.nativeElement.querySelector('.cb-menubar__submenu [role="menuitem"]:not([aria-disabled="true"]):not(:disabled)')?.focus(), { injector: this.injector });
|
|
60
69
|
}
|
|
61
70
|
if ((event.key === 'ArrowDown' || event.key === 'ArrowUp') && target.closest('.cb-menubar__submenu')) {
|
|
62
71
|
const children = Array.from(target.closest('.cb-menubar__submenu').querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not(:disabled)'));
|
|
@@ -68,9 +77,9 @@ class CbMenubar {
|
|
|
68
77
|
}
|
|
69
78
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMenubar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
79
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbMenubar, isStandalone: true, selector: "cb-menubar", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, host: { listeners: { "keydown": "onKeydown($event)", "document:click": "onDocumentClick($event)" }, classAttribute: "cb-menubar" }, ngImport: i0, template: `
|
|
71
|
-
<nav [attr.aria-label]="ariaLabel()">
|
|
80
|
+
<nav [attr.aria-label]="(ariaLabel() ?? t().mainNavigation)">
|
|
72
81
|
<ul class="cb-menubar__list" role="menubar">
|
|
73
|
-
@for (item of
|
|
82
|
+
@for (item of visibleItems(); track $index; let i = $index) {
|
|
74
83
|
<li class="cb-menubar__entry" role="none">
|
|
75
84
|
@if (item.items?.length) {
|
|
76
85
|
<button
|
|
@@ -129,9 +138,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
129
138
|
'(keydown)': 'onKeydown($event)',
|
|
130
139
|
'(document:click)': 'onDocumentClick($event)',
|
|
131
140
|
}, template: `
|
|
132
|
-
<nav [attr.aria-label]="ariaLabel()">
|
|
141
|
+
<nav [attr.aria-label]="(ariaLabel() ?? t().mainNavigation)">
|
|
133
142
|
<ul class="cb-menubar__list" role="menubar">
|
|
134
|
-
@for (item of
|
|
143
|
+
@for (item of visibleItems(); track $index; let i = $index) {
|
|
135
144
|
<li class="cb-menubar__entry" role="none">
|
|
136
145
|
@if (item.items?.length) {
|
|
137
146
|
<button
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model,
|
|
2
|
+
import { input, model, computed, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
5
|
|
|
5
6
|
const SEVERITY_ICON = {
|
|
6
7
|
success: 'circle-check',
|
|
@@ -23,6 +24,8 @@ const SEVERITY_ICON = {
|
|
|
23
24
|
*/
|
|
24
25
|
class CbMessage {
|
|
25
26
|
constructor() {
|
|
27
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
28
|
+
this.t = injectCbTranslation();
|
|
26
29
|
this.severity = input('info', /* @ts-ignore */
|
|
27
30
|
...(ngDevMode ? [{ debugName: "severity" }] : /* istanbul ignore next */ []));
|
|
28
31
|
/** Muestra el botón de cerrar. */
|
|
@@ -33,6 +36,9 @@ class CbMessage {
|
|
|
33
36
|
/** Visibilidad (two-way). */
|
|
34
37
|
this.visible = model(true, /* @ts-ignore */
|
|
35
38
|
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
39
|
+
/** danger y warning se anuncian al momento (`alert`); el resto, sin interrumpir (`status`). */
|
|
40
|
+
this.urgent = computed(() => this.severity() === 'danger' || this.severity() === 'warning', /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "urgent" }] : /* istanbul ignore next */ []));
|
|
36
42
|
/** Se emite al cerrar. */
|
|
37
43
|
this.closed = output();
|
|
38
44
|
this.iconName = computed(() => {
|
|
@@ -50,37 +56,37 @@ class CbMessage {
|
|
|
50
56
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMessage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
57
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbMessage, isStandalone: true, selector: "cb-message", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", closed: "closed" }, host: { classAttribute: "cb-message-host" }, ngImport: i0, template: `
|
|
52
58
|
@if (visible()) {
|
|
53
|
-
<div class="cb-message" [class]="'cb-message--' + severity()" role="alert">
|
|
59
|
+
<div class="cb-message" [class]="'cb-message--' + severity()" [attr.role]="urgent() ? 'alert' : 'status'">
|
|
54
60
|
@if (iconName()) {
|
|
55
61
|
<cb-icon class="cb-message__icon" [name]="iconName()" [size]="18" aria-hidden="true" />
|
|
56
62
|
}
|
|
57
63
|
<div class="cb-message__content"><ng-content /></div>
|
|
58
64
|
@if (closable()) {
|
|
59
|
-
<button type="button" class="cb-message__close" aria-label="
|
|
65
|
+
<button type="button" class="cb-message__close" [attr.aria-label]="t().close" (click)="close()">
|
|
60
66
|
<cb-icon name="x" [size]="16" aria-hidden="true" />
|
|
61
67
|
</button>
|
|
62
68
|
}
|
|
63
69
|
</div>
|
|
64
70
|
}
|
|
65
|
-
`, isInline: true, styles: [":host{display:block}.cb-message{display:flex;align-items:flex-start;gap:var(--cb-space-2);padding:var(--cb-space-3) var(--cb-space-4);border-radius:var(--cb-radius-md);border:var(--cb-border-width) solid transparent;font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);line-height:var(--cb-line-height-normal);color:var(--_fg);background-color:var(--_bg);border-color:var(--_border)}.cb-message__icon{flex:none;margin-top:1px;color:var(--_accent)}.cb-message__content{flex:1 1 auto;min-width:0}.cb-message__close{flex:none;display:inline-flex;padding:2px;margin:-2px -2px 0 0;border:none;background:transparent;color:inherit;border-radius:var(--cb-radius-sm);cursor:pointer;opacity:.7}.cb-message__close:hover{opacity:1}.cb-message--primary{--_accent: var(--cb-color-primary-500);--_bg: var(--cb-color-primary-50);--_fg: var(--cb-color-primary-500);--_border: var(--cb-color-primary-100)}.cb-message--secondary{--_accent: var(--cb-color-text-muted);--_bg: var(--cb-color-surface-
|
|
71
|
+
`, isInline: true, styles: [":host{display:block}.cb-message{display:flex;align-items:flex-start;gap:var(--cb-space-2);padding:var(--cb-space-3) var(--cb-space-4);border-radius:var(--cb-radius-md);border:var(--cb-border-width) solid transparent;font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);line-height:var(--cb-line-height-normal);color:var(--_fg);background-color:var(--_bg);border-color:var(--_border)}.cb-message__icon{flex:none;margin-top:1px;color:var(--_accent)}.cb-message__content{flex:1 1 auto;min-width:0}.cb-message__close{flex:none;display:inline-flex;padding:2px;margin:-2px -2px 0 0;border:none;background:transparent;color:inherit;border-radius:var(--cb-radius-sm);cursor:pointer;opacity:.7}.cb-message__close:hover{opacity:1}.cb-message--primary{--_accent: var(--cb-color-primary-500);--_bg: var(--cb-color-primary-50);--_fg: var(--cb-color-primary-500);--_border: var(--cb-color-primary-100)}.cb-message--secondary{--_accent: var(--cb-color-text-muted);--_bg: var(--cb-color-surface-hover);--_fg: var(--cb-color-text);--_border: var(--cb-color-border)}.cb-message--success{--_accent: var(--cb-color-success-500);--_bg: var(--cb-color-success-50);--_fg: var(--cb-color-success-500);--_border: var(--cb-color-success-100)}.cb-message--info{--_accent: var(--cb-color-info-500);--_bg: var(--cb-color-info-50);--_fg: var(--cb-color-info-500);--_border: var(--cb-color-info-100)}.cb-message--warning{--_accent: var(--cb-color-warning-500);--_bg: var(--cb-color-warning-50);--_fg: var(--cb-color-warning-500);--_border: var(--cb-color-warning-100)}.cb-message--danger{--_accent: var(--cb-color-danger-500);--_bg: var(--cb-color-danger-50);--_fg: var(--cb-color-danger-500);--_border: var(--cb-color-danger-100)}.cb-message--help{--_accent: var(--cb-color-help-500);--_bg: var(--cb-color-help-50);--_fg: var(--cb-color-help-500);--_border: var(--cb-color-help-100)}.cb-message--contrast{--_accent: var(--cb-color-text);--_bg: var(--cb-color-surface-hover);--_fg: var(--cb-color-text);--_border: var(--cb-color-border-strong)}:host-context([data-theme=\"dark\"]) .cb-message{--_bg: color-mix(in srgb, var(--_accent) 16%, transparent);--_fg: var(--cb-color-text);--_border: color-mix(in srgb, var(--_accent) 35%, transparent)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
66
72
|
}
|
|
67
73
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMessage, decorators: [{
|
|
68
74
|
type: Component,
|
|
69
75
|
args: [{ selector: 'cb-message', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-message-host' }, template: `
|
|
70
76
|
@if (visible()) {
|
|
71
|
-
<div class="cb-message" [class]="'cb-message--' + severity()" role="alert">
|
|
77
|
+
<div class="cb-message" [class]="'cb-message--' + severity()" [attr.role]="urgent() ? 'alert' : 'status'">
|
|
72
78
|
@if (iconName()) {
|
|
73
79
|
<cb-icon class="cb-message__icon" [name]="iconName()" [size]="18" aria-hidden="true" />
|
|
74
80
|
}
|
|
75
81
|
<div class="cb-message__content"><ng-content /></div>
|
|
76
82
|
@if (closable()) {
|
|
77
|
-
<button type="button" class="cb-message__close" aria-label="
|
|
83
|
+
<button type="button" class="cb-message__close" [attr.aria-label]="t().close" (click)="close()">
|
|
78
84
|
<cb-icon name="x" [size]="16" aria-hidden="true" />
|
|
79
85
|
</button>
|
|
80
86
|
}
|
|
81
87
|
</div>
|
|
82
88
|
}
|
|
83
|
-
`, styles: [":host{display:block}.cb-message{display:flex;align-items:flex-start;gap:var(--cb-space-2);padding:var(--cb-space-3) var(--cb-space-4);border-radius:var(--cb-radius-md);border:var(--cb-border-width) solid transparent;font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);line-height:var(--cb-line-height-normal);color:var(--_fg);background-color:var(--_bg);border-color:var(--_border)}.cb-message__icon{flex:none;margin-top:1px;color:var(--_accent)}.cb-message__content{flex:1 1 auto;min-width:0}.cb-message__close{flex:none;display:inline-flex;padding:2px;margin:-2px -2px 0 0;border:none;background:transparent;color:inherit;border-radius:var(--cb-radius-sm);cursor:pointer;opacity:.7}.cb-message__close:hover{opacity:1}.cb-message--primary{--_accent: var(--cb-color-primary-500);--_bg: var(--cb-color-primary-50);--_fg: var(--cb-color-primary-500);--_border: var(--cb-color-primary-100)}.cb-message--secondary{--_accent: var(--cb-color-text-muted);--_bg: var(--cb-color-surface-
|
|
89
|
+
`, styles: [":host{display:block}.cb-message{display:flex;align-items:flex-start;gap:var(--cb-space-2);padding:var(--cb-space-3) var(--cb-space-4);border-radius:var(--cb-radius-md);border:var(--cb-border-width) solid transparent;font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);line-height:var(--cb-line-height-normal);color:var(--_fg);background-color:var(--_bg);border-color:var(--_border)}.cb-message__icon{flex:none;margin-top:1px;color:var(--_accent)}.cb-message__content{flex:1 1 auto;min-width:0}.cb-message__close{flex:none;display:inline-flex;padding:2px;margin:-2px -2px 0 0;border:none;background:transparent;color:inherit;border-radius:var(--cb-radius-sm);cursor:pointer;opacity:.7}.cb-message__close:hover{opacity:1}.cb-message--primary{--_accent: var(--cb-color-primary-500);--_bg: var(--cb-color-primary-50);--_fg: var(--cb-color-primary-500);--_border: var(--cb-color-primary-100)}.cb-message--secondary{--_accent: var(--cb-color-text-muted);--_bg: var(--cb-color-surface-hover);--_fg: var(--cb-color-text);--_border: var(--cb-color-border)}.cb-message--success{--_accent: var(--cb-color-success-500);--_bg: var(--cb-color-success-50);--_fg: var(--cb-color-success-500);--_border: var(--cb-color-success-100)}.cb-message--info{--_accent: var(--cb-color-info-500);--_bg: var(--cb-color-info-50);--_fg: var(--cb-color-info-500);--_border: var(--cb-color-info-100)}.cb-message--warning{--_accent: var(--cb-color-warning-500);--_bg: var(--cb-color-warning-50);--_fg: var(--cb-color-warning-500);--_border: var(--cb-color-warning-100)}.cb-message--danger{--_accent: var(--cb-color-danger-500);--_bg: var(--cb-color-danger-50);--_fg: var(--cb-color-danger-500);--_border: var(--cb-color-danger-100)}.cb-message--help{--_accent: var(--cb-color-help-500);--_bg: var(--cb-color-help-50);--_fg: var(--cb-color-help-500);--_border: var(--cb-color-help-100)}.cb-message--contrast{--_accent: var(--cb-color-text);--_bg: var(--cb-color-surface-hover);--_fg: var(--cb-color-text);--_border: var(--cb-color-border-strong)}:host-context([data-theme=\"dark\"]) .cb-message{--_bg: color-mix(in srgb, var(--_accent) 16%, transparent);--_fg: var(--cb-color-text);--_border: color-mix(in srgb, var(--_accent) 35%, transparent)}\n"] }]
|
|
84
90
|
}], propDecorators: { severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
85
91
|
function toBoolean(value) {
|
|
86
92
|
return value !== false && value != null && `${value}` !== 'false';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -11,6 +11,17 @@ class CbMeterGroup {
|
|
|
11
11
|
...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
|
|
12
12
|
this.max = input(100, /* @ts-ignore */
|
|
13
13
|
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
14
|
+
/** Nombre accesible del medidor (p. ej. "Almacenamiento"). */
|
|
15
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/** Suma de los valores (valor actual del `role="meter"`). */
|
|
18
|
+
this.total = computed(() => this.values().reduce((sum, v) => sum + v.value, 0), /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Desglose legible para el lector de pantalla ("Apps 16 %, Fotos 8 %"). */
|
|
21
|
+
this.valueText = computed(() => this.values()
|
|
22
|
+
.map((v) => `${v.label} ${this.format(v.value)}%`)
|
|
23
|
+
.join(', '), /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
|
|
14
25
|
this.palette = [
|
|
15
26
|
'var(--cb-color-primary-500)',
|
|
16
27
|
'var(--cb-color-info-500)',
|
|
@@ -22,13 +33,17 @@ class CbMeterGroup {
|
|
|
22
33
|
const m = Math.max(1, this.max());
|
|
23
34
|
return Math.min(100, Math.max(0, (val / m) * 100));
|
|
24
35
|
}
|
|
36
|
+
/** Porcentaje respecto a `max`, redondeado a un decimal. */
|
|
37
|
+
format(val) {
|
|
38
|
+
return Math.round(this.percent(val) * 10) / 10;
|
|
39
|
+
}
|
|
25
40
|
defaultColor(idx) {
|
|
26
41
|
return this.palette[idx % this.palette.length];
|
|
27
42
|
}
|
|
28
43
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMeterGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbMeterGroup, isStandalone: true, selector: "cb-meter-group", inputs: { values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "meter" }, properties: { "attr.aria-valuemin": "0", "attr.aria-valuemax": "max()" }, classAttribute: "cb-meter-group" }, ngImport: i0, template: `
|
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbMeterGroup, isStandalone: true, selector: "cb-meter-group", inputs: { values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "meter" }, properties: { "attr.aria-valuemin": "0", "attr.aria-valuemax": "max()", "attr.aria-valuenow": "total()", "attr.aria-valuetext": "valueText()", "attr.aria-label": "ariaLabel() || null" }, classAttribute: "cb-meter-group" }, ngImport: i0, template: `
|
|
30
45
|
<div class="cb-meter-group__track">
|
|
31
|
-
@for (item of values(); track
|
|
46
|
+
@for (item of values(); track $index; let idx = $index) {
|
|
32
47
|
<span
|
|
33
48
|
class="cb-meter-group__bar"
|
|
34
49
|
[style.width.%]="percent(item.value)"
|
|
@@ -36,8 +51,8 @@ class CbMeterGroup {
|
|
|
36
51
|
></span>
|
|
37
52
|
}
|
|
38
53
|
</div>
|
|
39
|
-
<ol class="cb-meter-group__legend">
|
|
40
|
-
@for (item of values(); track
|
|
54
|
+
<ol class="cb-meter-group__legend" aria-hidden="true">
|
|
55
|
+
@for (item of values(); track $index; let idx = $index) {
|
|
41
56
|
<li class="cb-meter-group__item">
|
|
42
57
|
<span
|
|
43
58
|
class="cb-meter-group__dot"
|
|
@@ -47,7 +62,7 @@ class CbMeterGroup {
|
|
|
47
62
|
<cb-icon [name]="item.icon" [size]="14" aria-hidden="true" />
|
|
48
63
|
}
|
|
49
64
|
<span class="cb-meter-group__label">{{ item.label }}</span>
|
|
50
|
-
<span class="cb-meter-group__value">({{ item.value }}%)</span>
|
|
65
|
+
<span class="cb-meter-group__value">({{ format(item.value) }}%)</span>
|
|
51
66
|
</li>
|
|
52
67
|
}
|
|
53
68
|
</ol>
|
|
@@ -60,9 +75,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
60
75
|
role: 'meter',
|
|
61
76
|
'[attr.aria-valuemin]': '0',
|
|
62
77
|
'[attr.aria-valuemax]': 'max()',
|
|
78
|
+
'[attr.aria-valuenow]': 'total()',
|
|
79
|
+
'[attr.aria-valuetext]': 'valueText()',
|
|
80
|
+
'[attr.aria-label]': 'ariaLabel() || null',
|
|
63
81
|
}, template: `
|
|
64
82
|
<div class="cb-meter-group__track">
|
|
65
|
-
@for (item of values(); track
|
|
83
|
+
@for (item of values(); track $index; let idx = $index) {
|
|
66
84
|
<span
|
|
67
85
|
class="cb-meter-group__bar"
|
|
68
86
|
[style.width.%]="percent(item.value)"
|
|
@@ -70,8 +88,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
70
88
|
></span>
|
|
71
89
|
}
|
|
72
90
|
</div>
|
|
73
|
-
<ol class="cb-meter-group__legend">
|
|
74
|
-
@for (item of values(); track
|
|
91
|
+
<ol class="cb-meter-group__legend" aria-hidden="true">
|
|
92
|
+
@for (item of values(); track $index; let idx = $index) {
|
|
75
93
|
<li class="cb-meter-group__item">
|
|
76
94
|
<span
|
|
77
95
|
class="cb-meter-group__dot"
|
|
@@ -81,12 +99,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
81
99
|
<cb-icon [name]="item.icon" [size]="14" aria-hidden="true" />
|
|
82
100
|
}
|
|
83
101
|
<span class="cb-meter-group__label">{{ item.label }}</span>
|
|
84
|
-
<span class="cb-meter-group__value">({{ item.value }}%)</span>
|
|
102
|
+
<span class="cb-meter-group__value">({{ format(item.value) }}%)</span>
|
|
85
103
|
</li>
|
|
86
104
|
}
|
|
87
105
|
</ol>
|
|
88
106
|
`, styles: [":host{display:block;width:100%;font-family:var(--cb-font-sans)}.cb-meter-group__track{display:flex;width:100%;height:.65rem;border-radius:999px;background:var(--cb-color-border);overflow:hidden;gap:2px}.cb-meter-group__bar{display:block;height:100%;transition:width .2s ease}.cb-meter-group__legend{list-style:none;margin:var(--cb-space-3) 0 0;padding:0;display:flex;flex-wrap:wrap;gap:var(--cb-space-4)}.cb-meter-group__item{display:inline-flex;align-items:center;gap:.375rem;font-size:var(--cb-text-sm);color:var(--cb-color-text)}.cb-meter-group__dot{width:.6rem;height:.6rem;border-radius:999px}.cb-meter-group__value{color:var(--cb-color-text-muted)}\n"] }]
|
|
89
|
-
}], propDecorators: { values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }] } });
|
|
107
|
+
}], propDecorators: { values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
90
108
|
|
|
91
109
|
/**
|
|
92
110
|
* Generated bundle index. Do not edit.
|