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