@caribeng/ui 22.1.1 → 22.2.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 +48 -8
- package/fesm2022/caribeng-ui-accordion.mjs +2 -2
- package/fesm2022/caribeng-ui-anchor.mjs +169 -0
- package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
- package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
- package/fesm2022/caribeng-ui-blockui.mjs +12 -4
- package/fesm2022/caribeng-ui-breadcrumb.mjs +5 -2
- 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 +2598 -303
- package/fesm2022/caribeng-ui-chip.mjs +9 -4
- package/fesm2022/caribeng-ui-chips.mjs +9 -5
- package/fesm2022/caribeng-ui-colorpicker.mjs +9 -7
- package/fesm2022/caribeng-ui-confirmdialog.mjs +74 -9
- package/fesm2022/caribeng-ui-confirmpopup.mjs +134 -9
- package/fesm2022/caribeng-ui-contextmenu.mjs +6 -3
- package/fesm2022/caribeng-ui-dataview.mjs +211 -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 +6 -3
- package/fesm2022/caribeng-ui-drawer.mjs +10 -7
- package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
- package/fesm2022/caribeng-ui-editor.mjs +4392 -243
- package/fesm2022/caribeng-ui-empty.mjs +80 -0
- package/fesm2022/caribeng-ui-file-card.mjs +2 -2
- package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
- package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
- package/fesm2022/caribeng-ui-folder-card.mjs +10 -3
- package/fesm2022/caribeng-ui-galleria.mjs +76 -45
- package/fesm2022/caribeng-ui-image.mjs +52 -29
- 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 +14 -11
- package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
- package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
- package/fesm2022/caribeng-ui-listbox.mjs +13 -11
- package/fesm2022/caribeng-ui-megamenu.mjs +222 -30
- package/fesm2022/caribeng-ui-menu.mjs +11 -5
- package/fesm2022/caribeng-ui-menubar.mjs +10 -5
- package/fesm2022/caribeng-ui-message.mjs +7 -4
- 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 +12 -7
- package/fesm2022/caribeng-ui-paginator.mjs +18 -15
- package/fesm2022/caribeng-ui-panel.mjs +5 -2
- package/fesm2022/caribeng-ui-panelmenu.mjs +6 -3
- package/fesm2022/caribeng-ui-password.mjs +8 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
- package/fesm2022/caribeng-ui-picklist.mjs +251 -14
- package/fesm2022/caribeng-ui-pricing.mjs +17 -14
- 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-scrollpanel.mjs +6 -3
- package/fesm2022/caribeng-ui-scrolltop.mjs +6 -3
- package/fesm2022/caribeng-ui-select.mjs +379 -87
- package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
- 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 +8 -5
- package/fesm2022/caribeng-ui-steps.mjs +6 -3
- package/fesm2022/caribeng-ui-table.mjs +708 -82
- package/fesm2022/caribeng-ui-tabmenu.mjs +6 -3
- 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 +9 -6
- 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 +829 -6
- package/package.json +53 -3
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.js +125 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +66 -0
- package/styles/caribeng.css +380 -0
- package/styles/scss/_mixins.scss +46 -0
- package/styles/scss/_overlay.scss +15 -0
- package/styles/scss/_tokens.scss +267 -0
- package/styles/scss/_utilities.scss +73 -0
- package/styles/scss/_variables.scss +33 -0
- package/styles/scss/index.scss +16 -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-blockui.d.ts +9 -4
- package/types/caribeng-ui-breadcrumb.d.ts +3 -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 +469 -44
- package/types/caribeng-ui-chip.d.ts +6 -0
- package/types/caribeng-ui-chips.d.ts +6 -2
- package/types/caribeng-ui-colorpicker.d.ts +3 -1
- package/types/caribeng-ui-confirmdialog.d.ts +25 -6
- package/types/caribeng-ui-confirmpopup.d.ts +37 -5
- package/types/caribeng-ui-contextmenu.d.ts +4 -1
- package/types/caribeng-ui-dataview.d.ts +63 -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 +4 -1
- package/types/caribeng-ui-drawer.d.ts +4 -1
- 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 +1 -1
- package/types/caribeng-ui-fileupload.d.ts +27 -4
- package/types/caribeng-ui-folder-card.d.ts +4 -1
- 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 +5 -0
- package/types/caribeng-ui-inputotp.d.ts +7 -2
- 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 +26 -2
- package/types/caribeng-ui-menu.d.ts +7 -2
- package/types/caribeng-ui-menubar.d.ts +5 -1
- package/types/caribeng-ui-message.d.ts +3 -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 +4 -1
- package/types/caribeng-ui-password.d.ts +4 -2
- package/types/caribeng-ui-pdfviewer.d.ts +258 -0
- package/types/caribeng-ui-picklist.d.ts +67 -7
- package/types/caribeng-ui-pricing.d.ts +8 -5
- 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-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 +3 -0
- package/types/caribeng-ui-steps.d.ts +4 -1
- package/types/caribeng-ui-table.d.ts +184 -16
- package/types/caribeng-ui-tabmenu.d.ts +4 -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 +5 -2
- 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 +501 -12
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, output, computed, 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. */
|
|
@@ -56,13 +59,13 @@ class CbMessage {
|
|
|
56
59
|
}
|
|
57
60
|
<div class="cb-message__content"><ng-content /></div>
|
|
58
61
|
@if (closable()) {
|
|
59
|
-
<button type="button" class="cb-message__close" aria-label="
|
|
62
|
+
<button type="button" class="cb-message__close" [attr.aria-label]="t().close" (click)="close()">
|
|
60
63
|
<cb-icon name="x" [size]="16" aria-hidden="true" />
|
|
61
64
|
</button>
|
|
62
65
|
}
|
|
63
66
|
</div>
|
|
64
67
|
}
|
|
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-
|
|
68
|
+
`, 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
69
|
}
|
|
67
70
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMessage, decorators: [{
|
|
68
71
|
type: Component,
|
|
@@ -74,13 +77,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
74
77
|
}
|
|
75
78
|
<div class="cb-message__content"><ng-content /></div>
|
|
76
79
|
@if (closable()) {
|
|
77
|
-
<button type="button" class="cb-message__close" aria-label="
|
|
80
|
+
<button type="button" class="cb-message__close" [attr.aria-label]="t().close" (click)="close()">
|
|
78
81
|
<cb-icon name="x" [size]="16" aria-hidden="true" />
|
|
79
82
|
</button>
|
|
80
83
|
}
|
|
81
84
|
</div>
|
|
82
85
|
}
|
|
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-
|
|
86
|
+
`, 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
87
|
}], 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
88
|
function toBoolean(value) {
|
|
86
89
|
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.
|