@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
|
@@ -23,9 +23,12 @@ class CbBadge {
|
|
|
23
23
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
24
24
|
/** Muestra solo un punto (sin texto). */
|
|
25
25
|
this.dot = input(false, { ...(ngDevMode ? { debugName: "dot" } : /* istanbul ignore next */ {}), transform: toBoolean });
|
|
26
|
+
/** Nombre accesible que sustituye al valor (p. ej. "3 mensajes sin leer"). Sin él, un `dot` es decorativo. */
|
|
27
|
+
this.ariaLabel = input('', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
26
29
|
}
|
|
27
30
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbBadge, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbBadge, isStandalone: true, selector: "cb-badge", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "dot", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "'cb-badge cb-badge--' + severity() + ' cb-badge--' + size()", "class.cb-badge--dot": "dot()" }, classAttribute: "cb-badge" }, ngImport: i0, template: `@if (!dot()) {{{ value() }}}`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:1.25rem;height:1.25rem;padding:0 .375rem;border-radius:var(--cb-radius-full);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-bold);line-height:1;color:var(--_fg);background-color:var(--_bg)}:host(.cb-badge--sm){min-width:1rem;height:1rem;font-size:.625rem;padding:0 .25rem}:host(.cb-badge--lg){min-width:1.5rem;height:1.5rem;font-size:var(--cb-text-sm);padding:0 .5rem}:host(.cb-badge--dot){min-width:.625rem;width:.625rem;height:.625rem;padding:0}:host(.cb-badge--dot.cb-badge--sm){min-width:.5rem;width:.5rem;height:.5rem}:host(.cb-badge--dot.cb-badge--lg){min-width:.75rem;width:.75rem;height:.75rem}:host(.cb-badge--primary){--_bg: var(--cb-color-primary-500);--_fg: var(--cb-color-primary-contrast)}:host(.cb-badge--secondary){--_bg: var(--cb-color-surface-500);--_fg: var(--cb-color-surface-50)}:host(.cb-badge--success){--_bg: var(--cb-color-success-500);--_fg: var(--cb-color-success-contrast)}:host(.cb-badge--info){--_bg: var(--cb-color-info-500);--_fg: var(--cb-color-info-contrast)}:host(.cb-badge--warning){--_bg: var(--cb-color-warning-500);--_fg: var(--cb-color-warning-contrast)}:host(.cb-badge--danger){--_bg: var(--cb-color-danger-500);--_fg: var(--cb-color-danger-contrast)}:host(.cb-badge--help){--_bg: var(--cb-color-help-500);--_fg: var(--cb-color-help-contrast)}:host(.cb-badge--contrast){--_bg: var(--cb-color-text);--_fg: var(--cb-color-bg)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
31
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbBadge, isStandalone: true, selector: "cb-badge", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "dot", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "'cb-badge cb-badge--' + severity() + ' cb-badge--' + size()", "class.cb-badge--dot": "dot()", "attr.role": "ariaLabel() ? \"img\" : null", "attr.aria-label": "ariaLabel() || null", "attr.aria-hidden": "dot() && !ariaLabel() ? \"true\" : null" }, classAttribute: "cb-badge" }, ngImport: i0, template: `@if (!dot()) {{{ value() }}}`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:1.25rem;height:1.25rem;padding:0 .375rem;border-radius:var(--cb-radius-full);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-bold);line-height:1;color:var(--_fg);background-color:var(--_bg)}:host(.cb-badge--sm){min-width:1rem;height:1rem;font-size:.625rem;padding:0 .25rem}:host(.cb-badge--lg){min-width:1.5rem;height:1.5rem;font-size:var(--cb-text-sm);padding:0 .5rem}:host(.cb-badge--dot){min-width:.625rem;width:.625rem;height:.625rem;padding:0}:host(.cb-badge--dot.cb-badge--sm){min-width:.5rem;width:.5rem;height:.5rem}:host(.cb-badge--dot.cb-badge--lg){min-width:.75rem;width:.75rem;height:.75rem}:host(.cb-badge--primary){--_bg: var(--cb-color-primary-500);--_fg: var(--cb-color-primary-contrast)}:host(.cb-badge--secondary){--_bg: var(--cb-color-surface-500);--_fg: var(--cb-color-surface-50)}:host(.cb-badge--success){--_bg: var(--cb-color-success-500);--_fg: var(--cb-color-success-contrast)}:host(.cb-badge--info){--_bg: var(--cb-color-info-500);--_fg: var(--cb-color-info-contrast)}:host(.cb-badge--warning){--_bg: var(--cb-color-warning-500);--_fg: var(--cb-color-warning-contrast)}:host(.cb-badge--danger){--_bg: var(--cb-color-danger-500);--_fg: var(--cb-color-danger-contrast)}:host(.cb-badge--help){--_bg: var(--cb-color-help-500);--_fg: var(--cb-color-help-contrast)}:host(.cb-badge--contrast){--_bg: var(--cb-color-text);--_fg: var(--cb-color-bg)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
29
32
|
}
|
|
30
33
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbBadge, decorators: [{
|
|
31
34
|
type: Component,
|
|
@@ -33,8 +36,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
33
36
|
class: 'cb-badge',
|
|
34
37
|
'[class]': "'cb-badge cb-badge--' + severity() + ' cb-badge--' + size()",
|
|
35
38
|
'[class.cb-badge--dot]': 'dot()',
|
|
39
|
+
'[attr.role]': 'ariaLabel() ? "img" : null',
|
|
40
|
+
'[attr.aria-label]': 'ariaLabel() || null',
|
|
41
|
+
'[attr.aria-hidden]': 'dot() && !ariaLabel() ? "true" : null',
|
|
36
42
|
}, template: `@if (!dot()) {{{ value() }}}`, styles: [":host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:1.25rem;height:1.25rem;padding:0 .375rem;border-radius:var(--cb-radius-full);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-bold);line-height:1;color:var(--_fg);background-color:var(--_bg)}:host(.cb-badge--sm){min-width:1rem;height:1rem;font-size:.625rem;padding:0 .25rem}:host(.cb-badge--lg){min-width:1.5rem;height:1.5rem;font-size:var(--cb-text-sm);padding:0 .5rem}:host(.cb-badge--dot){min-width:.625rem;width:.625rem;height:.625rem;padding:0}:host(.cb-badge--dot.cb-badge--sm){min-width:.5rem;width:.5rem;height:.5rem}:host(.cb-badge--dot.cb-badge--lg){min-width:.75rem;width:.75rem;height:.75rem}:host(.cb-badge--primary){--_bg: var(--cb-color-primary-500);--_fg: var(--cb-color-primary-contrast)}:host(.cb-badge--secondary){--_bg: var(--cb-color-surface-500);--_fg: var(--cb-color-surface-50)}:host(.cb-badge--success){--_bg: var(--cb-color-success-500);--_fg: var(--cb-color-success-contrast)}:host(.cb-badge--info){--_bg: var(--cb-color-info-500);--_fg: var(--cb-color-info-contrast)}:host(.cb-badge--warning){--_bg: var(--cb-color-warning-500);--_fg: var(--cb-color-warning-contrast)}:host(.cb-badge--danger){--_bg: var(--cb-color-danger-500);--_fg: var(--cb-color-danger-contrast)}:host(.cb-badge--help){--_bg: var(--cb-color-help-500);--_fg: var(--cb-color-help-contrast)}:host(.cb-badge--contrast){--_bg: var(--cb-color-text);--_fg: var(--cb-color-bg)}\n"] }]
|
|
37
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }] } });
|
|
43
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
38
44
|
function toBoolean(value) {
|
|
39
45
|
return value !== false && value != null && `${value}` !== 'false';
|
|
40
46
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* BlockUI de CaribeNG: bloquea la interacción sobre el contenido proyectado
|
|
@@ -8,20 +9,26 @@ import { CbIcon } from '@caribeng/ui/icon';
|
|
|
8
9
|
*/
|
|
9
10
|
class CbBlockUi {
|
|
10
11
|
constructor() {
|
|
12
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
13
|
+
this.t = injectCbTranslation();
|
|
11
14
|
this.blocked = input(false, /* @ts-ignore */
|
|
12
15
|
...(ngDevMode ? [{ debugName: "blocked" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/** Texto que anuncia el lector de pantalla al bloquear. Por defecto, "Cargando" del idioma activo. */
|
|
17
|
+
this.message = input(undefined, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
13
19
|
}
|
|
14
20
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbBlockUi, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbBlockUi, isStandalone: true, selector: "cb-block-ui", inputs: { blocked: { classPropertyName: "blocked", publicName: "blocked", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-is-blocked": "blocked()", "attr.aria-busy": "blocked()" }, classAttribute: "cb-block-ui" }, ngImport: i0, template: `
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbBlockUi, isStandalone: true, selector: "cb-block-ui", inputs: { blocked: { classPropertyName: "blocked", publicName: "blocked", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-is-blocked": "blocked()", "attr.aria-busy": "blocked()" }, classAttribute: "cb-block-ui" }, ngImport: i0, template: `
|
|
16
22
|
<div class="cb-block-ui__content" [attr.inert]="blocked() ? '' : null">
|
|
17
23
|
<ng-content />
|
|
18
24
|
</div>
|
|
19
25
|
@if (blocked()) {
|
|
20
26
|
<div class="cb-block-ui__mask" role="status" aria-live="polite">
|
|
21
27
|
<cb-icon name="loader" [size]="22" [spin]="true" aria-hidden="true" />
|
|
28
|
+
<span class="cb-block-ui__sr">{{ message() ?? t().loading }}</span>
|
|
22
29
|
</div>
|
|
23
30
|
}
|
|
24
|
-
`, isInline: true, styles: [":host{position:relative;display:block;width:100%;font-family:var(--cb-font-sans)}.cb-block-ui__mask{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;border-radius:var(--cb-radius-lg);background:#0f172a59;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);color:#fff}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
31
|
+
`, isInline: true, styles: [":host{position:relative;display:block;width:100%;font-family:var(--cb-font-sans)}.cb-block-ui__mask{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;border-radius:var(--cb-radius-lg);background:#0f172a59;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);color:#fff}.cb-block-ui__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
25
32
|
}
|
|
26
33
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbBlockUi, decorators: [{
|
|
27
34
|
type: Component,
|
|
@@ -36,10 +43,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
36
43
|
@if (blocked()) {
|
|
37
44
|
<div class="cb-block-ui__mask" role="status" aria-live="polite">
|
|
38
45
|
<cb-icon name="loader" [size]="22" [spin]="true" aria-hidden="true" />
|
|
46
|
+
<span class="cb-block-ui__sr">{{ message() ?? t().loading }}</span>
|
|
39
47
|
</div>
|
|
40
48
|
}
|
|
41
|
-
`, styles: [":host{position:relative;display:block;width:100%;font-family:var(--cb-font-sans)}.cb-block-ui__mask{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;border-radius:var(--cb-radius-lg);background:#0f172a59;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);color:#fff}\n"] }]
|
|
42
|
-
}], propDecorators: { blocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "blocked", required: false }] }] } });
|
|
49
|
+
`, styles: [":host{position:relative;display:block;width:100%;font-family:var(--cb-font-sans)}.cb-block-ui__mask{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;border-radius:var(--cb-radius-lg);background:#0f172a59;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);color:#fff}.cb-block-ui__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"] }]
|
|
50
|
+
}], propDecorators: { blocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "blocked", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
|
|
43
51
|
|
|
44
52
|
/**
|
|
45
53
|
* Generated bundle index. Do not edit.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, computed, output, 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
|
/**
|
|
6
7
|
* Breadcrumb de CaribeNG: rastro de navegación jerárquica.
|
|
@@ -16,22 +17,31 @@ import { CbIcon } from '@caribeng/ui/icon';
|
|
|
16
17
|
*/
|
|
17
18
|
class CbBreadcrumb {
|
|
18
19
|
constructor() {
|
|
20
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
21
|
+
this.t = injectCbTranslation();
|
|
19
22
|
this.items = input([], /* @ts-ignore */
|
|
20
23
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Items sin los de `visible: false`. */
|
|
25
|
+
this.visibleItems = computed(() => cbVisibleItems(this.items()), /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "visibleItems" }] : /* istanbul ignore next */ []));
|
|
21
27
|
/** Icono separador entre elementos. */
|
|
22
28
|
this.separator = input('chevron-right', /* @ts-ignore */
|
|
23
29
|
...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
24
30
|
/** Se emite al hacer clic en un elemento con enlace. */
|
|
25
31
|
this.itemClick = output();
|
|
26
32
|
}
|
|
33
|
+
select(item, event) {
|
|
34
|
+
cbRunCommand(item, event);
|
|
35
|
+
this.itemClick.emit(item);
|
|
36
|
+
}
|
|
27
37
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbBreadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28
38
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbBreadcrumb, isStandalone: true, selector: "cb-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, host: { classAttribute: "cb-breadcrumb" }, ngImport: i0, template: `
|
|
29
|
-
<nav aria-label="
|
|
39
|
+
<nav [attr.aria-label]="t().breadcrumb">
|
|
30
40
|
<ol class="cb-breadcrumb__list">
|
|
31
|
-
@for (item of
|
|
41
|
+
@for (item of visibleItems(); track $index; let last = $last) {
|
|
32
42
|
<li class="cb-breadcrumb__item">
|
|
33
43
|
@if (item.url && !last) {
|
|
34
|
-
<a class="cb-breadcrumb__link" [href]="item.url" (click)="
|
|
44
|
+
<a class="cb-breadcrumb__link" [href]="item.url" (click)="select(item, $event)">
|
|
35
45
|
@if (item.icon) { <cb-icon [name]="item.icon" [size]="15" aria-hidden="true" /> }
|
|
36
46
|
<span>{{ item.label }}</span>
|
|
37
47
|
</a>
|
|
@@ -53,12 +63,12 @@ class CbBreadcrumb {
|
|
|
53
63
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbBreadcrumb, decorators: [{
|
|
54
64
|
type: Component,
|
|
55
65
|
args: [{ selector: 'cb-breadcrumb', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-breadcrumb' }, template: `
|
|
56
|
-
<nav aria-label="
|
|
66
|
+
<nav [attr.aria-label]="t().breadcrumb">
|
|
57
67
|
<ol class="cb-breadcrumb__list">
|
|
58
|
-
@for (item of
|
|
68
|
+
@for (item of visibleItems(); track $index; let last = $last) {
|
|
59
69
|
<li class="cb-breadcrumb__item">
|
|
60
70
|
@if (item.url && !last) {
|
|
61
|
-
<a class="cb-breadcrumb__link" [href]="item.url" (click)="
|
|
71
|
+
<a class="cb-breadcrumb__link" [href]="item.url" (click)="select(item, $event)">
|
|
62
72
|
@if (item.icon) { <cb-icon [name]="item.icon" [size]="15" aria-hidden="true" /> }
|
|
63
73
|
<span>{{ item.label }}</span>
|
|
64
74
|
</a>
|
|
@@ -35,6 +35,18 @@ class CbButton {
|
|
|
35
35
|
/** Tipo nativo del botón. */
|
|
36
36
|
this.type = input('button', /* @ts-ignore */
|
|
37
37
|
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** Nombre accesible (imprescindible en botones de solo icono). */
|
|
39
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Tipo de elemento que abre (`menu`, `dialog`, `listbox`…). */
|
|
42
|
+
this.ariaHaspopup = input(undefined, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "ariaHaspopup" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Si lo que abre está desplegado. */
|
|
45
|
+
this.ariaExpanded = input(undefined, /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "ariaExpanded" }] : /* istanbul ignore next */ []));
|
|
47
|
+
/** Id del elemento que controla. */
|
|
48
|
+
this.ariaControls = input(undefined, /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "ariaControls" }] : /* istanbul ignore next */ []));
|
|
38
50
|
this.variantClasses = computed(() => {
|
|
39
51
|
const severity = this.severity();
|
|
40
52
|
const classes = [
|
|
@@ -58,7 +70,7 @@ class CbButton {
|
|
|
58
70
|
'help',
|
|
59
71
|
]); }
|
|
60
72
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
61
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbButton, isStandalone: true, selector: "cb-button", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-button-host--block": "fullWidth()" }, classAttribute: "cb-button-host" }, ngImport: i0, template: `
|
|
73
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbButton, isStandalone: true, selector: "cb-button", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaHaspopup: { classPropertyName: "ariaHaspopup", publicName: "ariaHaspopup", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "ariaExpanded", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "ariaControls", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-button-host--block": "fullWidth()" }, classAttribute: "cb-button-host" }, ngImport: i0, template: `
|
|
62
74
|
<button
|
|
63
75
|
class="cb-button"
|
|
64
76
|
[class]="variantClasses()"
|
|
@@ -67,6 +79,10 @@ class CbButton {
|
|
|
67
79
|
[attr.type]="type()"
|
|
68
80
|
[disabled]="disabled() || loading()"
|
|
69
81
|
[attr.aria-busy]="loading() ? 'true' : null"
|
|
82
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
83
|
+
[attr.aria-haspopup]="ariaHaspopup() || null"
|
|
84
|
+
[attr.aria-expanded]="ariaExpanded() ?? null"
|
|
85
|
+
[attr.aria-controls]="ariaControls() || null"
|
|
70
86
|
>
|
|
71
87
|
@if (loading()) {
|
|
72
88
|
<cb-icon class="cb-button__spinner" name="loader" spin [size]="16" aria-hidden="true" />
|
|
@@ -91,6 +107,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
91
107
|
[attr.type]="type()"
|
|
92
108
|
[disabled]="disabled() || loading()"
|
|
93
109
|
[attr.aria-busy]="loading() ? 'true' : null"
|
|
110
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
111
|
+
[attr.aria-haspopup]="ariaHaspopup() || null"
|
|
112
|
+
[attr.aria-expanded]="ariaExpanded() ?? null"
|
|
113
|
+
[attr.aria-controls]="ariaControls() || null"
|
|
94
114
|
>
|
|
95
115
|
@if (loading()) {
|
|
96
116
|
<cb-icon class="cb-button__spinner" name="loader" spin [size]="16" aria-hidden="true" />
|
|
@@ -100,7 +120,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
100
120
|
</span>
|
|
101
121
|
</button>
|
|
102
122
|
`, styles: [":host{display:inline-flex}:host(.cb-button-host--block){display:flex;width:100%}:host(.cb-button-host--block) .cb-button{width:100%}.cb-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--cb-space-2);box-sizing:border-box;border:var(--cb-border-width) solid transparent;border-radius:var(--cb-radius-md);font-family:var(--cb-font-sans);font-weight:var(--cb-font-weight-semibold);line-height:var(--cb-line-height-tight);text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none;background-color:transparent;transition:background-color var(--cb-duration-fast) var(--cb-ease),color var(--cb-duration-fast) var(--cb-ease),border-color var(--cb-duration-fast) var(--cb-ease),box-shadow var(--cb-duration-fast) var(--cb-ease)}.cb-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-button:disabled,.cb-button.cb-is-disabled{cursor:not-allowed;opacity:.55}.cb-button.cb-is-loading{cursor:progress}.cb-button--primary{--_50: var(--cb-color-primary-50);--_100: var(--cb-color-primary-100);--_200: var(--cb-color-primary-200);--_300: var(--cb-color-primary-300);--_400: var(--cb-color-primary-400);--_500: var(--cb-color-primary-500);--_600: var(--cb-color-primary-600);--_700: var(--cb-color-primary-700);--_950: var(--cb-color-primary-950)}.cb-button--success{--_50: var(--cb-color-success-50);--_100: var(--cb-color-success-100);--_200: var(--cb-color-success-200);--_300: var(--cb-color-success-300);--_400: var(--cb-color-success-400);--_500: var(--cb-color-success-500);--_600: var(--cb-color-success-600);--_700: var(--cb-color-success-700);--_950: var(--cb-color-success-950)}.cb-button--info{--_50: var(--cb-color-info-50);--_100: var(--cb-color-info-100);--_200: var(--cb-color-info-200);--_300: var(--cb-color-info-300);--_400: var(--cb-color-info-400);--_500: var(--cb-color-info-500);--_600: var(--cb-color-info-600);--_700: var(--cb-color-info-700);--_950: var(--cb-color-info-950)}.cb-button--warning{--_50: var(--cb-color-warning-50);--_100: var(--cb-color-warning-100);--_200: var(--cb-color-warning-200);--_300: var(--cb-color-warning-300);--_400: var(--cb-color-warning-400);--_500: var(--cb-color-warning-500);--_600: var(--cb-color-warning-600);--_700: var(--cb-color-warning-700);--_950: var(--cb-color-warning-950)}.cb-button--danger{--_50: var(--cb-color-danger-50);--_100: var(--cb-color-danger-100);--_200: var(--cb-color-danger-200);--_300: var(--cb-color-danger-300);--_400: var(--cb-color-danger-400);--_500: var(--cb-color-danger-500);--_600: var(--cb-color-danger-600);--_700: var(--cb-color-danger-700);--_950: var(--cb-color-danger-950)}.cb-button--help{--_50: var(--cb-color-help-50);--_100: var(--cb-color-help-100);--_200: var(--cb-color-help-200);--_300: var(--cb-color-help-300);--_400: var(--cb-color-help-400);--_500: var(--cb-color-help-500);--_600: var(--cb-color-help-600);--_700: var(--cb-color-help-700);--_950: var(--cb-color-help-950)}.cb-button--chromatic.cb-button--solid{background-color:var(--_500);color:#fff;border-color:var(--_500)}.cb-button--chromatic.cb-button--solid:hover:not(:disabled):not(.cb-is-loading){background-color:var(--_600);border-color:var(--_600)}.cb-button--chromatic.cb-button--solid:active:not(:disabled):not(.cb-is-loading){background-color:var(--_700);border-color:var(--_700)}.cb-button--chromatic.cb-button--outlined{color:var(--_500);border-color:var(--_200)}.cb-button--chromatic.cb-button--outlined:hover:not(:disabled):not(.cb-is-loading){background-color:var(--_50)}.cb-button--chromatic.cb-button--outlined:active:not(:disabled):not(.cb-is-loading){background-color:var(--_100)}.cb-button--chromatic.cb-button--text{color:var(--_500)}.cb-button--chromatic.cb-button--text:hover:not(:disabled):not(.cb-is-loading){background-color:var(--_50)}.cb-button--chromatic.cb-button--text:active:not(:disabled):not(.cb-is-loading){background-color:var(--_100)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--solid{background-color:var(--_400);color:var(--_950);border-color:var(--_400)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--solid:hover:not(:disabled):not(.cb-is-loading){background-color:var(--_300);border-color:var(--_300)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--solid:active:not(:disabled):not(.cb-is-loading){background-color:var(--_200);border-color:var(--_200)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--outlined{color:var(--_400);border-color:var(--_700)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--text{color:var(--_400)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--outlined:hover:not(:disabled):not(.cb-is-loading),:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--text:hover:not(:disabled):not(.cb-is-loading){background-color:color-mix(in srgb,var(--_400) 6%,transparent)}:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--outlined:active:not(:disabled):not(.cb-is-loading),:host-context([data-theme=\"dark\"]) .cb-button--chromatic.cb-button--text:active:not(:disabled):not(.cb-is-loading){background-color:color-mix(in srgb,var(--_400) 16%,transparent)}.cb-button--secondary.cb-button--solid{background-color:var(--cb-color-surface-100);color:var(--cb-color-surface-600);border-color:var(--cb-color-surface-100)}.cb-button--secondary.cb-button--solid:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-200);border-color:var(--cb-color-surface-200)}.cb-button--secondary.cb-button--solid:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-300);border-color:var(--cb-color-surface-300)}.cb-button--secondary.cb-button--outlined{color:var(--cb-color-surface-500);border-color:var(--cb-color-surface-200)}.cb-button--secondary.cb-button--text{color:var(--cb-color-surface-500)}.cb-button--secondary.cb-button--outlined:hover:not(:disabled):not(.cb-is-loading),.cb-button--secondary.cb-button--text:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-50)}.cb-button--secondary.cb-button--outlined:active:not(:disabled):not(.cb-is-loading),.cb-button--secondary.cb-button--text:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-100)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--solid{background-color:var(--cb-color-surface-800);color:var(--cb-color-surface-300);border-color:var(--cb-color-surface-800)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--solid:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-700);border-color:var(--cb-color-surface-700)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--solid:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-600);border-color:var(--cb-color-surface-600)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--outlined{color:var(--cb-color-surface-400);border-color:var(--cb-color-surface-700)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--text{color:var(--cb-color-surface-400)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--outlined:hover:not(:disabled):not(.cb-is-loading),:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--text:hover:not(:disabled):not(.cb-is-loading){background-color:color-mix(in srgb,var(--cb-color-surface-0) 6%,transparent)}:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--outlined:active:not(:disabled):not(.cb-is-loading),:host-context([data-theme=\"dark\"]) .cb-button--secondary.cb-button--text:active:not(:disabled):not(.cb-is-loading){background-color:color-mix(in srgb,var(--cb-color-surface-0) 14%,transparent)}.cb-button--contrast.cb-button--solid{background-color:var(--cb-color-surface-950);color:var(--cb-color-surface-0);border-color:var(--cb-color-surface-950)}.cb-button--contrast.cb-button--solid:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-900);border-color:var(--cb-color-surface-900)}.cb-button--contrast.cb-button--solid:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-800);border-color:var(--cb-color-surface-800)}.cb-button--contrast.cb-button--outlined{color:var(--cb-color-surface-950);border-color:var(--cb-color-surface-700)}.cb-button--contrast.cb-button--text{color:var(--cb-color-surface-950)}.cb-button--contrast.cb-button--outlined:hover:not(:disabled):not(.cb-is-loading),.cb-button--contrast.cb-button--text:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-50)}.cb-button--contrast.cb-button--outlined:active:not(:disabled):not(.cb-is-loading),.cb-button--contrast.cb-button--text:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-100)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--solid{background-color:var(--cb-color-surface-0);color:var(--cb-color-surface-950);border-color:var(--cb-color-surface-0)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--solid:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-100);border-color:var(--cb-color-surface-100)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--solid:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-200);border-color:var(--cb-color-surface-200)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--outlined{color:var(--cb-color-surface-0);border-color:var(--cb-color-surface-500)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--text{color:var(--cb-color-surface-0)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--outlined:hover:not(:disabled):not(.cb-is-loading),:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--text:hover:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-800)}:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--outlined:active:not(:disabled):not(.cb-is-loading),:host-context([data-theme=\"dark\"]) .cb-button--contrast.cb-button--text:active:not(:disabled):not(.cb-is-loading){background-color:var(--cb-color-surface-700)}.cb-button--sm{min-height:2rem;padding:var(--cb-space-1) var(--cb-space-3);font-size:var(--cb-text-sm)}.cb-button--md{min-height:2.5rem;padding:var(--cb-space-2) var(--cb-space-4);font-size:var(--cb-text-base)}.cb-button--lg{min-height:3rem;padding:var(--cb-space-3) var(--cb-space-6);font-size:var(--cb-text-lg)}.cb-button__content{display:inline-flex;align-items:center;gap:var(--cb-space-2)}.cb-button__spinner{color:currentColor}\n"] }]
|
|
103
|
-
}], propDecorators: { severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
123
|
+
}], propDecorators: { severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaHaspopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaHaspopup", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaExpanded", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControls", required: false }] }] } });
|
|
104
124
|
function toBoolean(value) {
|
|
105
125
|
return value !== false && value != null && `${value}` !== 'false';
|
|
106
126
|
}
|
|
@@ -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 } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Alert de Caribe Design: banner de notificación con severidad, título,
|
|
@@ -12,6 +13,8 @@ import { input, model, output, ViewEncapsulation, ChangeDetectionStrategy, Compo
|
|
|
12
13
|
*/
|
|
13
14
|
class CbAlert {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
15
18
|
this.title = input('', /* @ts-ignore */
|
|
16
19
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
17
20
|
this.severity = input('info', /* @ts-ignore */
|
|
@@ -53,7 +56,7 @@ class CbAlert {
|
|
|
53
56
|
<button
|
|
54
57
|
type="button"
|
|
55
58
|
class="cb-alert__close"
|
|
56
|
-
aria-label="
|
|
59
|
+
[attr.aria-label]="t().close"
|
|
57
60
|
(click)="close()"
|
|
58
61
|
>
|
|
59
62
|
×
|
|
@@ -79,7 +82,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
79
82
|
<button
|
|
80
83
|
type="button"
|
|
81
84
|
class="cb-alert__close"
|
|
82
|
-
aria-label="
|
|
85
|
+
[attr.aria-label]="t().close"
|
|
83
86
|
(click)="close()"
|
|
84
87
|
>
|
|
85
88
|
×
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Animation-lottie de Caribe Design: contenedor de animación (placeholder
|
|
@@ -12,6 +13,8 @@ import { input, signal, ViewEncapsulation, ChangeDetectionStrategy, Component }
|
|
|
12
13
|
*/
|
|
13
14
|
class CbAnimationLottie {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
15
18
|
this.src = input('', /* @ts-ignore */
|
|
16
19
|
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
17
20
|
this.autoplay = input(true, /* @ts-ignore */
|
|
@@ -20,7 +23,7 @@ class CbAnimationLottie {
|
|
|
20
23
|
...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
|
|
21
24
|
this.size = input('96px', /* @ts-ignore */
|
|
22
25
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
23
|
-
this.ariaLabel = input(
|
|
26
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
24
27
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
25
28
|
this.playing = signal(true, /* @ts-ignore */
|
|
26
29
|
...(ngDevMode ? [{ debugName: "playing" }] : /* istanbul ignore next */ []));
|
|
@@ -33,7 +36,7 @@ class CbAnimationLottie {
|
|
|
33
36
|
}
|
|
34
37
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbAnimationLottie, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
35
38
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbAnimationLottie, isStandalone: true, selector: "cb-animation-lottie", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width": "size()", "style.height": "size()" }, classAttribute: "cb-animation-lottie-host" }, ngImport: i0, template: `
|
|
36
|
-
<div class="cb-animation-lottie" role="img" [attr.aria-label]="ariaLabel()">
|
|
39
|
+
<div class="cb-animation-lottie" role="img" [attr.aria-label]="(ariaLabel() ?? t().animation)">
|
|
37
40
|
<svg
|
|
38
41
|
class="cb-animation-lottie__svg"
|
|
39
42
|
[class.cb-is-playing]="playing()"
|
|
@@ -61,7 +64,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
61
64
|
'[style.width]': 'size()',
|
|
62
65
|
'[style.height]': 'size()',
|
|
63
66
|
}, template: `
|
|
64
|
-
<div class="cb-animation-lottie" role="img" [attr.aria-label]="ariaLabel()">
|
|
67
|
+
<div class="cb-animation-lottie" role="img" [attr.aria-label]="(ariaLabel() ?? t().animation)">
|
|
65
68
|
<svg
|
|
66
69
|
class="cb-animation-lottie__svg"
|
|
67
70
|
[class.cb-is-playing]="playing()"
|
|
@@ -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
|
* Button-group de Caribe Design: contenedor que agrupa acciones relacionadas
|
|
@@ -14,15 +15,17 @@ import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@a
|
|
|
14
15
|
*/
|
|
15
16
|
class CbButtonGroup {
|
|
16
17
|
constructor() {
|
|
18
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
19
|
+
this.t = injectCbTranslation();
|
|
17
20
|
/** Dirección del grupo. */
|
|
18
21
|
this.orientation = input('horizontal', /* @ts-ignore */
|
|
19
22
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
20
23
|
/** Etiqueta accesible del grupo. */
|
|
21
|
-
this.ariaLabel = input(
|
|
24
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
22
25
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
23
26
|
}
|
|
24
27
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbButtonGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
25
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbButtonGroup, isStandalone: true, selector: "cb-button-group", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class.cb-button-group-host--vertical": "orientation() === 'vertical'" }, classAttribute: "cb-button-group-host" }, ngImport: i0, template: `
|
|
28
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbButtonGroup, isStandalone: true, selector: "cb-button-group", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "(ariaLabel() ?? t().actionGroup)", "class.cb-button-group-host--vertical": "orientation() === 'vertical'" }, classAttribute: "cb-button-group-host" }, ngImport: i0, template: `
|
|
26
29
|
<div
|
|
27
30
|
class="cb-button-group"
|
|
28
31
|
[class.cb-button-group--vertical]="orientation() === 'vertical'"
|
|
@@ -36,7 +39,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
36
39
|
args: [{ selector: 'cb-button-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
37
40
|
class: 'cb-button-group-host',
|
|
38
41
|
role: 'group',
|
|
39
|
-
'[attr.aria-label]': 'ariaLabel()',
|
|
42
|
+
'[attr.aria-label]': '(ariaLabel() ?? t().actionGroup)',
|
|
40
43
|
'[class.cb-button-group-host--vertical]': "orientation() === 'vertical'",
|
|
41
44
|
}, template: `
|
|
42
45
|
<div
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Calendar de Caribe Design: cuadrícula mensual con selección de día.
|
|
@@ -11,13 +12,17 @@ import { input, model, computed, ViewEncapsulation, ChangeDetectionStrategy, Com
|
|
|
11
12
|
*/
|
|
12
13
|
class CbCalendar {
|
|
13
14
|
constructor() {
|
|
14
|
-
this.monthLabel = input('
|
|
15
|
+
this.monthLabel = input('', /* @ts-ignore */
|
|
15
16
|
...(ngDevMode ? [{ debugName: "monthLabel" }] : /* istanbul ignore next */ []));
|
|
16
17
|
this.totalDays = input(31, /* @ts-ignore */
|
|
17
18
|
...(ngDevMode ? [{ debugName: "totalDays" }] : /* istanbul ignore next */ []));
|
|
18
19
|
this.selectedDay = model(17, /* @ts-ignore */
|
|
19
20
|
...(ngDevMode ? [{ debugName: "selectedDay" }] : /* istanbul ignore next */ []));
|
|
20
|
-
|
|
21
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
22
|
+
this.t = injectCbTranslation();
|
|
23
|
+
/** Iniciales de lunes a domingo en el idioma activo. */
|
|
24
|
+
this.weekdays = computed(() => this.t().weekdaysMin.split(','), /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
|
|
21
26
|
this.days = computed(() => Array.from({ length: Math.max(28, Math.min(31, this.totalDays())) }, (_, i) => i + 1), /* @ts-ignore */
|
|
22
27
|
...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
23
28
|
}
|
|
@@ -31,11 +36,11 @@ class CbCalendar {
|
|
|
31
36
|
<strong class="cb-calendar__month">{{ monthLabel() }}</strong>
|
|
32
37
|
</header>
|
|
33
38
|
<div class="cb-calendar__weekdays" aria-hidden="true">
|
|
34
|
-
@for (w of weekdays; track
|
|
39
|
+
@for (w of weekdays(); track $index) {
|
|
35
40
|
<span class="cb-calendar__weekday">{{ w }}</span>
|
|
36
41
|
}
|
|
37
42
|
</div>
|
|
38
|
-
<div class="cb-calendar__grid" role="
|
|
43
|
+
<div class="cb-calendar__grid" role="group" [attr.aria-label]="monthLabel() || null">
|
|
39
44
|
@for (d of days(); track d) {
|
|
40
45
|
<button
|
|
41
46
|
type="button"
|
|
@@ -59,11 +64,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
59
64
|
<strong class="cb-calendar__month">{{ monthLabel() }}</strong>
|
|
60
65
|
</header>
|
|
61
66
|
<div class="cb-calendar__weekdays" aria-hidden="true">
|
|
62
|
-
@for (w of weekdays; track
|
|
67
|
+
@for (w of weekdays(); track $index) {
|
|
63
68
|
<span class="cb-calendar__weekday">{{ w }}</span>
|
|
64
69
|
}
|
|
65
70
|
</div>
|
|
66
|
-
<div class="cb-calendar__grid" role="
|
|
71
|
+
<div class="cb-calendar__grid" role="group" [attr.aria-label]="monthLabel() || null">
|
|
67
72
|
@for (d of days(); track d) {
|
|
68
73
|
<button
|
|
69
74
|
type="button"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Card-content de Caribe Design: tarjeta de contenido con título, subtítulo,
|
|
@@ -12,11 +13,13 @@ import { input, output, ViewEncapsulation, ChangeDetectionStrategy, Component }
|
|
|
12
13
|
*/
|
|
13
14
|
class CbCardContent {
|
|
14
15
|
constructor() {
|
|
16
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
17
|
+
this.t = injectCbTranslation();
|
|
15
18
|
this.title = input('', /* @ts-ignore */
|
|
16
19
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
17
20
|
this.subtitle = input('', /* @ts-ignore */
|
|
18
21
|
...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
19
|
-
this.actionLabel = input(
|
|
22
|
+
this.actionLabel = input(undefined, /* @ts-ignore */
|
|
20
23
|
...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
21
24
|
this.action = output();
|
|
22
25
|
}
|
|
@@ -36,7 +39,7 @@ class CbCardContent {
|
|
|
36
39
|
class="cb-card-content__action"
|
|
37
40
|
(click)="action.emit()"
|
|
38
41
|
>
|
|
39
|
-
{{ actionLabel() }}
|
|
42
|
+
{{ (actionLabel() ?? t().viewDetails) }}
|
|
40
43
|
</button>
|
|
41
44
|
</footer>
|
|
42
45
|
</article>
|
|
@@ -59,7 +62,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
59
62
|
class="cb-card-content__action"
|
|
60
63
|
(click)="action.emit()"
|
|
61
64
|
>
|
|
62
|
-
{{ actionLabel() }}
|
|
65
|
+
{{ (actionLabel() ?? t().viewDetails) }}
|
|
63
66
|
</button>
|
|
64
67
|
</footer>
|
|
65
68
|
</article>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { model, inject, ElementRef, Injector, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Card-move de Caribe Design: lista de elementos reordenables mediante botones
|
|
@@ -10,10 +11,17 @@ import { model, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@a
|
|
|
10
11
|
* <cb-card-move [(items)]="opciones" />
|
|
11
12
|
* ```
|
|
12
13
|
*/
|
|
14
|
+
let nextId = 0;
|
|
13
15
|
class CbCardMove {
|
|
14
16
|
constructor() {
|
|
17
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
18
|
+
this.t = injectCbTranslation();
|
|
15
19
|
this.items = model([], /* @ts-ignore */
|
|
16
20
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
21
|
+
/** Prefijo de ids: cada botón se describe con la etiqueta de su elemento. */
|
|
22
|
+
this.uid = `cb-card-move-${++nextId}`;
|
|
23
|
+
this.host = inject(ElementRef);
|
|
24
|
+
this.injector = inject(Injector);
|
|
17
25
|
}
|
|
18
26
|
move(index, delta) {
|
|
19
27
|
const next = [...this.items()];
|
|
@@ -22,6 +30,16 @@ class CbCardMove {
|
|
|
22
30
|
return;
|
|
23
31
|
[next[index], next[target]] = [next[target], next[index]];
|
|
24
32
|
this.items.set(next);
|
|
33
|
+
this.followItem(target, delta);
|
|
34
|
+
}
|
|
35
|
+
/** El foco sigue al elemento movido; si su botón queda deshabilitado (extremo), pasa al otro. */
|
|
36
|
+
followItem(row, delta) {
|
|
37
|
+
afterNextRender(() => {
|
|
38
|
+
const items = this.host.nativeElement.querySelectorAll('.cb-card-move__item');
|
|
39
|
+
const buttons = Array.from(items[row]?.querySelectorAll('.cb-card-move__btn') ?? []);
|
|
40
|
+
const same = buttons[delta < 0 ? 0 : 1];
|
|
41
|
+
(same && !same.disabled ? same : buttons.find((b) => !b.disabled))?.focus();
|
|
42
|
+
}, { injector: this.injector });
|
|
25
43
|
}
|
|
26
44
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbCardMove, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
27
45
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbCardMove, isStandalone: true, selector: "cb-card-move", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { items: "itemsChange" }, ngImport: i0, template: `
|
|
@@ -29,12 +47,13 @@ class CbCardMove {
|
|
|
29
47
|
<ul class="cb-card-move__list">
|
|
30
48
|
@for (item of items(); track $index) {
|
|
31
49
|
<li class="cb-card-move__item">
|
|
32
|
-
<span class="cb-card-move__label">{{ item }}</span>
|
|
50
|
+
<span class="cb-card-move__label" [id]="uid + '-' + $index">{{ item }}</span>
|
|
33
51
|
<span class="cb-card-move__controls">
|
|
34
52
|
<button
|
|
35
53
|
type="button"
|
|
36
54
|
class="cb-card-move__btn"
|
|
37
|
-
aria-label="
|
|
55
|
+
[attr.aria-label]="t().moveUp"
|
|
56
|
+
[attr.aria-describedby]="uid + '-' + $index"
|
|
38
57
|
[disabled]="$first"
|
|
39
58
|
(click)="move($index, -1)"
|
|
40
59
|
>
|
|
@@ -43,7 +62,8 @@ class CbCardMove {
|
|
|
43
62
|
<button
|
|
44
63
|
type="button"
|
|
45
64
|
class="cb-card-move__btn"
|
|
46
|
-
aria-label="
|
|
65
|
+
[attr.aria-label]="t().moveDown"
|
|
66
|
+
[attr.aria-describedby]="uid + '-' + $index"
|
|
47
67
|
[disabled]="$last"
|
|
48
68
|
(click)="move($index, 1)"
|
|
49
69
|
>
|
|
@@ -63,12 +83,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
63
83
|
<ul class="cb-card-move__list">
|
|
64
84
|
@for (item of items(); track $index) {
|
|
65
85
|
<li class="cb-card-move__item">
|
|
66
|
-
<span class="cb-card-move__label">{{ item }}</span>
|
|
86
|
+
<span class="cb-card-move__label" [id]="uid + '-' + $index">{{ item }}</span>
|
|
67
87
|
<span class="cb-card-move__controls">
|
|
68
88
|
<button
|
|
69
89
|
type="button"
|
|
70
90
|
class="cb-card-move__btn"
|
|
71
|
-
aria-label="
|
|
91
|
+
[attr.aria-label]="t().moveUp"
|
|
92
|
+
[attr.aria-describedby]="uid + '-' + $index"
|
|
72
93
|
[disabled]="$first"
|
|
73
94
|
(click)="move($index, -1)"
|
|
74
95
|
>
|
|
@@ -77,7 +98,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
77
98
|
<button
|
|
78
99
|
type="button"
|
|
79
100
|
class="cb-card-move__btn"
|
|
80
|
-
aria-label="
|
|
101
|
+
[attr.aria-label]="t().moveDown"
|
|
102
|
+
[attr.aria-describedby]="uid + '-' + $index"
|
|
81
103
|
[disabled]="$last"
|
|
82
104
|
(click)="move($index, 1)"
|
|
83
105
|
>
|