@caribeng/ui 22.1.0 → 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 +52 -12
- 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 +70 -11
- 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,28 +1,247 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, Directive, ElementRef, Injector, model, input, output, contentChild, signal, computed, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
5
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
3
6
|
|
|
7
|
+
/** Plantilla de cada elemento de un `<cb-orderlist>`. */
|
|
8
|
+
class CbOrderListItemTemplate {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.template = inject(TemplateRef);
|
|
11
|
+
}
|
|
12
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbOrderListItemTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
16
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbOrderListItemTemplate, isStandalone: true, selector: "ng-template[cbOrderListItem]", ngImport: i0 }); }
|
|
17
|
+
}
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbOrderListItemTemplate, decorators: [{
|
|
19
|
+
type: Directive,
|
|
20
|
+
args: [{ selector: 'ng-template[cbOrderListItem]' }]
|
|
21
|
+
}] });
|
|
22
|
+
let nextUid = 0;
|
|
23
|
+
/**
|
|
24
|
+
* Lista reordenable de CaribeNG. Selecciona un elemento y muévelo con los
|
|
25
|
+
* botones o con Alt + ↑/↓.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```html
|
|
29
|
+
* <cb-orderlist [(value)]="pasos" header="Orden de aprobación">
|
|
30
|
+
* <ng-template cbOrderListItem let-paso>{{ paso.nombre }}</ng-template>
|
|
31
|
+
* </cb-orderlist>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
4
34
|
class CbOrderList {
|
|
5
35
|
constructor() {
|
|
36
|
+
this.t = injectCbTranslation();
|
|
37
|
+
this.host = inject(ElementRef);
|
|
38
|
+
this.injector = inject(Injector);
|
|
39
|
+
this.headerId = `cb-orderlist-${++nextUid}-header`;
|
|
40
|
+
/** Elementos, en orden (two-way). */
|
|
6
41
|
this.value = model([], /* @ts-ignore */
|
|
7
42
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
8
|
-
|
|
43
|
+
/** Título visible de la lista (también la nombra para el lector de pantalla). */
|
|
44
|
+
this.header = input('', /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/** Nombre accesible cuando no hay `header`. Por defecto, el del idioma activo. */
|
|
47
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
9
48
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
10
|
-
|
|
11
|
-
|
|
49
|
+
/** Se emite tras mover un elemento. */
|
|
50
|
+
this.reorder = output();
|
|
51
|
+
this.itemTemplate = contentChild(CbOrderListItemTemplate, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/** Índice seleccionado (se guarda por posición: admite elementos repetidos). */
|
|
54
|
+
this.selectedIndex = signal(-1, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
56
|
+
this.focusedIndex = signal(-1, /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
|
|
58
|
+
this.tabbableIndex = computed(() => {
|
|
59
|
+
const focused = this.focusedIndex();
|
|
60
|
+
if (focused >= 0 && focused < this.value().length)
|
|
61
|
+
return focused;
|
|
62
|
+
return this.selectedIndex() >= 0 ? this.selectedIndex() : 0;
|
|
63
|
+
}, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "tabbableIndex" }] : /* istanbul ignore next */ []));
|
|
65
|
+
this.listLabel = computed(() => this.ariaLabel() ?? this.t().sortableList, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "listLabel" }] : /* istanbul ignore next */ []));
|
|
67
|
+
this.canMoveUp = computed(() => this.selectedIndex() > 0, /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "canMoveUp" }] : /* istanbul ignore next */ []));
|
|
69
|
+
this.canMoveDown = computed(() => {
|
|
70
|
+
const i = this.selectedIndex();
|
|
71
|
+
return i >= 0 && i < this.value().length - 1;
|
|
72
|
+
}, /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "canMoveDown" }] : /* istanbul ignore next */ []));
|
|
74
|
+
}
|
|
75
|
+
select(index) {
|
|
76
|
+
this.selectedIndex.set(index);
|
|
77
|
+
this.focusedIndex.set(index);
|
|
78
|
+
}
|
|
79
|
+
moveBy(delta) {
|
|
80
|
+
this.moveTo(this.selectedIndex() + delta);
|
|
81
|
+
}
|
|
82
|
+
moveTo(to) {
|
|
83
|
+
const from = this.selectedIndex();
|
|
84
|
+
const items = this.value();
|
|
85
|
+
if (from < 0 || to < 0 || to >= items.length || to === from)
|
|
86
|
+
return;
|
|
87
|
+
const next = [...items];
|
|
88
|
+
const [moved] = next.splice(from, 1);
|
|
89
|
+
next.splice(to, 0, moved);
|
|
90
|
+
this.value.set(next);
|
|
91
|
+
this.selectedIndex.set(to);
|
|
92
|
+
this.focusedIndex.set(to);
|
|
93
|
+
this.reorder.emit({ from, to, value: next });
|
|
94
|
+
}
|
|
95
|
+
onKeydown(event) {
|
|
96
|
+
const count = this.value().length;
|
|
97
|
+
if (!count)
|
|
98
|
+
return;
|
|
99
|
+
const current = this.tabbableIndex();
|
|
100
|
+
let target = -1;
|
|
101
|
+
if (event.altKey && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
|
|
102
|
+
// Alt + flechas mueve el elemento seleccionado (o el enfocado).
|
|
103
|
+
if (this.selectedIndex() < 0)
|
|
104
|
+
this.selectedIndex.set(current);
|
|
105
|
+
this.moveBy(event.key === 'ArrowUp' ? -1 : 1);
|
|
106
|
+
target = this.selectedIndex();
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
switch (event.key) {
|
|
110
|
+
case 'ArrowDown':
|
|
111
|
+
target = Math.min(count - 1, current + 1);
|
|
112
|
+
break;
|
|
113
|
+
case 'ArrowUp':
|
|
114
|
+
target = Math.max(0, current - 1);
|
|
115
|
+
break;
|
|
116
|
+
case 'Home':
|
|
117
|
+
target = 0;
|
|
118
|
+
break;
|
|
119
|
+
case 'End':
|
|
120
|
+
target = count - 1;
|
|
121
|
+
break;
|
|
122
|
+
case 'Enter':
|
|
123
|
+
case ' ':
|
|
124
|
+
this.select(current);
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
if (target >= 0)
|
|
132
|
+
this.focusItem(target);
|
|
133
|
+
}
|
|
134
|
+
focusItem(index) {
|
|
135
|
+
this.focusedIndex.set(index);
|
|
136
|
+
// La lista puede haberse reordenado: se enfoca tras el siguiente render.
|
|
137
|
+
afterNextRender(() => this.host.nativeElement.querySelectorAll('[role="option"]')[index]?.focus(), {
|
|
138
|
+
injector: this.injector,
|
|
139
|
+
});
|
|
12
140
|
}
|
|
13
|
-
index() { return this.value().indexOf(this.selected()); }
|
|
14
|
-
move(direction) { const from = this.index(), to = from + direction; if (from < 0 || to < 0 || to >= this.value().length)
|
|
15
|
-
return; const next = [...this.value()]; [next[from], next[to]] = [next[to], next[from]]; this.value.set(next); }
|
|
16
141
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbOrderList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbOrderList, isStandalone: true, selector: "cb-orderlist", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null },
|
|
142
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbOrderList, isStandalone: true, selector: "cb-orderlist", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", reorder: "reorder" }, host: { classAttribute: "cb-orderlist-host" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: CbOrderListItemTemplate, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
143
|
+
<div class="cb-orderlist">
|
|
144
|
+
<div class="cb-orderlist__controls" role="group" [attr.aria-label]="listLabel()">
|
|
145
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveTop" [disabled]="!canMoveUp()" (click)="moveTo(0)">
|
|
146
|
+
<cb-icon name="chevrons-up" [size]="16" aria-hidden="true" />
|
|
147
|
+
</button>
|
|
148
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveUp" [disabled]="!canMoveUp()" (click)="moveBy(-1)">
|
|
149
|
+
<cb-icon name="chevron-up" [size]="16" aria-hidden="true" />
|
|
150
|
+
</button>
|
|
151
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveDown" [disabled]="!canMoveDown()" (click)="moveBy(1)">
|
|
152
|
+
<cb-icon name="chevron-down" [size]="16" aria-hidden="true" />
|
|
153
|
+
</button>
|
|
154
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveBottom" [disabled]="!canMoveDown()" (click)="moveTo(value().length - 1)">
|
|
155
|
+
<cb-icon name="chevrons-down" [size]="16" aria-hidden="true" />
|
|
156
|
+
</button>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<div class="cb-orderlist__panel">
|
|
160
|
+
@if (header()) {
|
|
161
|
+
<div class="cb-orderlist__header" [id]="headerId">{{ header() }}</div>
|
|
162
|
+
}
|
|
163
|
+
<ul
|
|
164
|
+
class="cb-orderlist__list"
|
|
165
|
+
role="listbox"
|
|
166
|
+
[attr.aria-labelledby]="header() ? headerId : null"
|
|
167
|
+
[attr.aria-label]="header() ? null : listLabel()"
|
|
168
|
+
(keydown)="onKeydown($event)"
|
|
169
|
+
>
|
|
170
|
+
@for (item of value(); track $index; let i = $index) {
|
|
171
|
+
<li
|
|
172
|
+
class="cb-orderlist__item"
|
|
173
|
+
role="option"
|
|
174
|
+
[attr.aria-selected]="selectedIndex() === i"
|
|
175
|
+
[attr.tabindex]="i === tabbableIndex() ? 0 : -1"
|
|
176
|
+
(focus)="focusedIndex.set(i)"
|
|
177
|
+
(click)="select(i)"
|
|
178
|
+
>
|
|
179
|
+
@if (itemTemplate(); as tpl) {
|
|
180
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: item, index: i }" />
|
|
181
|
+
} @else {
|
|
182
|
+
{{ item }}
|
|
183
|
+
}
|
|
184
|
+
</li>
|
|
185
|
+
}
|
|
186
|
+
</ul>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
`, isInline: true, styles: [":host{display:block;color:var(--cb-color-text)}.cb-orderlist{display:flex;gap:var(--cb-space-3, .75rem)}.cb-orderlist__controls{display:flex;flex-direction:column;justify-content:center;gap:var(--cb-space-2, .5rem)}.cb-orderlist__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);background:var(--cb-color-surface-raised);color:var(--cb-color-text);cursor:pointer}.cb-orderlist__btn:hover:not(:disabled){border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-600)}.cb-orderlist__btn:disabled{opacity:.45;cursor:not-allowed}.cb-orderlist__btn:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:2px}.cb-orderlist__panel{flex:1;min-width:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised);overflow:hidden}.cb-orderlist__header{padding:.65rem .85rem;font-weight:var(--cb-font-weight-semibold, 600);border-bottom:1px solid var(--cb-color-border)}.cb-orderlist__list{max-height:16rem;margin:0;padding:var(--cb-space-1, .25rem);list-style:none;overflow-y:auto}.cb-orderlist__item{padding:.6rem .75rem;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;outline:none;font-size:var(--cb-text-sm, .875rem)}.cb-orderlist__item:hover{background:color-mix(in srgb,var(--cb-color-text) 6%,transparent)}.cb-orderlist__item[aria-selected=true]{color:var(--cb-color-primary-700);background:color-mix(in srgb,var(--cb-color-primary-500) 14%,transparent);font-weight:var(--cb-font-weight-medium, 500)}.cb-orderlist__item:focus-visible{box-shadow:inset 0 0 0 2px var(--cb-color-focus-ring, var(--cb-color-primary-500))}:host-context([data-theme=\"dark\"]) .cb-orderlist__item[aria-selected=true]{color:var(--cb-color-primary-300)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18
190
|
}
|
|
19
191
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbOrderList, decorators: [{
|
|
20
192
|
type: Component,
|
|
21
|
-
args: [{ selector: 'cb-orderlist',
|
|
22
|
-
|
|
193
|
+
args: [{ selector: 'cb-orderlist', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [NgTemplateOutlet, CbIcon], host: { class: 'cb-orderlist-host' }, template: `
|
|
194
|
+
<div class="cb-orderlist">
|
|
195
|
+
<div class="cb-orderlist__controls" role="group" [attr.aria-label]="listLabel()">
|
|
196
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveTop" [disabled]="!canMoveUp()" (click)="moveTo(0)">
|
|
197
|
+
<cb-icon name="chevrons-up" [size]="16" aria-hidden="true" />
|
|
198
|
+
</button>
|
|
199
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveUp" [disabled]="!canMoveUp()" (click)="moveBy(-1)">
|
|
200
|
+
<cb-icon name="chevron-up" [size]="16" aria-hidden="true" />
|
|
201
|
+
</button>
|
|
202
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveDown" [disabled]="!canMoveDown()" (click)="moveBy(1)">
|
|
203
|
+
<cb-icon name="chevron-down" [size]="16" aria-hidden="true" />
|
|
204
|
+
</button>
|
|
205
|
+
<button type="button" class="cb-orderlist__btn" [attr.aria-label]="t().moveBottom" [disabled]="!canMoveDown()" (click)="moveTo(value().length - 1)">
|
|
206
|
+
<cb-icon name="chevrons-down" [size]="16" aria-hidden="true" />
|
|
207
|
+
</button>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="cb-orderlist__panel">
|
|
211
|
+
@if (header()) {
|
|
212
|
+
<div class="cb-orderlist__header" [id]="headerId">{{ header() }}</div>
|
|
213
|
+
}
|
|
214
|
+
<ul
|
|
215
|
+
class="cb-orderlist__list"
|
|
216
|
+
role="listbox"
|
|
217
|
+
[attr.aria-labelledby]="header() ? headerId : null"
|
|
218
|
+
[attr.aria-label]="header() ? null : listLabel()"
|
|
219
|
+
(keydown)="onKeydown($event)"
|
|
220
|
+
>
|
|
221
|
+
@for (item of value(); track $index; let i = $index) {
|
|
222
|
+
<li
|
|
223
|
+
class="cb-orderlist__item"
|
|
224
|
+
role="option"
|
|
225
|
+
[attr.aria-selected]="selectedIndex() === i"
|
|
226
|
+
[attr.tabindex]="i === tabbableIndex() ? 0 : -1"
|
|
227
|
+
(focus)="focusedIndex.set(i)"
|
|
228
|
+
(click)="select(i)"
|
|
229
|
+
>
|
|
230
|
+
@if (itemTemplate(); as tpl) {
|
|
231
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: item, index: i }" />
|
|
232
|
+
} @else {
|
|
233
|
+
{{ item }}
|
|
234
|
+
}
|
|
235
|
+
</li>
|
|
236
|
+
}
|
|
237
|
+
</ul>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
`, styles: [":host{display:block;color:var(--cb-color-text)}.cb-orderlist{display:flex;gap:var(--cb-space-3, .75rem)}.cb-orderlist__controls{display:flex;flex-direction:column;justify-content:center;gap:var(--cb-space-2, .5rem)}.cb-orderlist__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);background:var(--cb-color-surface-raised);color:var(--cb-color-text);cursor:pointer}.cb-orderlist__btn:hover:not(:disabled){border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-600)}.cb-orderlist__btn:disabled{opacity:.45;cursor:not-allowed}.cb-orderlist__btn:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:2px}.cb-orderlist__panel{flex:1;min-width:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised);overflow:hidden}.cb-orderlist__header{padding:.65rem .85rem;font-weight:var(--cb-font-weight-semibold, 600);border-bottom:1px solid var(--cb-color-border)}.cb-orderlist__list{max-height:16rem;margin:0;padding:var(--cb-space-1, .25rem);list-style:none;overflow-y:auto}.cb-orderlist__item{padding:.6rem .75rem;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;outline:none;font-size:var(--cb-text-sm, .875rem)}.cb-orderlist__item:hover{background:color-mix(in srgb,var(--cb-color-text) 6%,transparent)}.cb-orderlist__item[aria-selected=true]{color:var(--cb-color-primary-700);background:color-mix(in srgb,var(--cb-color-primary-500) 14%,transparent);font-weight:var(--cb-font-weight-medium, 500)}.cb-orderlist__item:focus-visible{box-shadow:inset 0 0 0 2px var(--cb-color-focus-ring, var(--cb-color-primary-500))}:host-context([data-theme=\"dark\"]) .cb-orderlist__item[aria-selected=true]{color:var(--cb-color-primary-300)}\n"] }]
|
|
241
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], reorder: [{ type: i0.Output, args: ["reorder"] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbOrderListItemTemplate), { isSignal: true }] }] } });
|
|
23
242
|
|
|
24
243
|
/**
|
|
25
244
|
* Generated bundle index. Do not edit.
|
|
26
245
|
*/
|
|
27
246
|
|
|
28
|
-
export { CbOrderList };
|
|
247
|
+
export { CbOrderList, CbOrderListItemTemplate };
|
|
@@ -2,14 +2,19 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { input, model, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
5
|
+
import { injectCbTranslation, cbFormat } from '@caribeng/ui';
|
|
5
6
|
|
|
6
7
|
class CbOrganizationChart {
|
|
7
8
|
constructor() {
|
|
9
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
10
|
+
this.t = injectCbTranslation();
|
|
11
|
+
/** Rellena `{0}`, `{1}`… de un texto traducido. */
|
|
12
|
+
this.fmt = cbFormat;
|
|
8
13
|
this.value = input([], /* @ts-ignore */
|
|
9
14
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
10
15
|
this.selection = model(null, /* @ts-ignore */
|
|
11
16
|
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
12
|
-
this.ariaLabel = input(
|
|
17
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
13
18
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
14
19
|
this.expanded = signal(new Set(), /* @ts-ignore */
|
|
15
20
|
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
@@ -24,7 +29,7 @@ class CbOrganizationChart {
|
|
|
24
29
|
}
|
|
25
30
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbOrganizationChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
31
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbOrganizationChart, isStandalone: true, selector: "cb-organization-chart", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange" }, ngImport: i0, template: `
|
|
27
|
-
<div class="cb-organization-chart" role="tree" [attr.aria-label]="ariaLabel()">
|
|
32
|
+
<div class="cb-organization-chart" role="tree" [attr.aria-label]="(ariaLabel() ?? t().orgChart)">
|
|
28
33
|
<ng-container
|
|
29
34
|
[ngTemplateOutlet]="nodesTemplate"
|
|
30
35
|
[ngTemplateOutletContext]="{ $implicit: value() }"
|
|
@@ -46,7 +51,7 @@ class CbOrganizationChart {
|
|
|
46
51
|
class="cb-organization-chart__select"
|
|
47
52
|
type="button"
|
|
48
53
|
(click)="selection.set(node)"
|
|
49
|
-
[attr.aria-label]="
|
|
54
|
+
[attr.aria-label]="fmt(t().selectItem, node.label)"
|
|
50
55
|
>
|
|
51
56
|
@if (node.icon) {
|
|
52
57
|
<cb-icon class="cb-organization-chart__icon" [name]="node.icon" [size]="18" aria-hidden="true" />
|
|
@@ -60,7 +65,7 @@ class CbOrganizationChart {
|
|
|
60
65
|
class="cb-organization-chart__toggle"
|
|
61
66
|
type="button"
|
|
62
67
|
(click)="toggle(node.key)"
|
|
63
|
-
[attr.aria-label]="(expanded().has(node.key) ?
|
|
68
|
+
[attr.aria-label]="fmt(expanded().has(node.key) ? t().collapseItem : t().expandItem, node.label)"
|
|
64
69
|
[attr.aria-expanded]="expanded().has(node.key)"
|
|
65
70
|
>{{ expanded().has(node.key) ? '−' : '+' }}</button>
|
|
66
71
|
}
|
|
@@ -80,7 +85,7 @@ class CbOrganizationChart {
|
|
|
80
85
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbOrganizationChart, decorators: [{
|
|
81
86
|
type: Component,
|
|
82
87
|
args: [{ selector: 'cb-organization-chart', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, CbIcon], template: `
|
|
83
|
-
<div class="cb-organization-chart" role="tree" [attr.aria-label]="ariaLabel()">
|
|
88
|
+
<div class="cb-organization-chart" role="tree" [attr.aria-label]="(ariaLabel() ?? t().orgChart)">
|
|
84
89
|
<ng-container
|
|
85
90
|
[ngTemplateOutlet]="nodesTemplate"
|
|
86
91
|
[ngTemplateOutletContext]="{ $implicit: value() }"
|
|
@@ -102,7 +107,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
102
107
|
class="cb-organization-chart__select"
|
|
103
108
|
type="button"
|
|
104
109
|
(click)="selection.set(node)"
|
|
105
|
-
[attr.aria-label]="
|
|
110
|
+
[attr.aria-label]="fmt(t().selectItem, node.label)"
|
|
106
111
|
>
|
|
107
112
|
@if (node.icon) {
|
|
108
113
|
<cb-icon class="cb-organization-chart__icon" [name]="node.icon" [size]="18" aria-hidden="true" />
|
|
@@ -116,7 +121,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
116
121
|
class="cb-organization-chart__toggle"
|
|
117
122
|
type="button"
|
|
118
123
|
(click)="toggle(node.key)"
|
|
119
|
-
[attr.aria-label]="(expanded().has(node.key) ?
|
|
124
|
+
[attr.aria-label]="fmt(expanded().has(node.key) ? t().collapseItem : t().expandItem, node.label)"
|
|
120
125
|
[attr.aria-expanded]="expanded().has(node.key)"
|
|
121
126
|
>{{ expanded().has(node.key) ? '−' : '+' }}</button>
|
|
122
127
|
}
|
|
@@ -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
|
/**
|
|
6
7
|
* Paginator de CaribeNG: control de paginación reutilizable (standalone o junto
|
|
@@ -14,6 +15,8 @@ import { CbIcon } from '@caribeng/ui/icon';
|
|
|
14
15
|
*/
|
|
15
16
|
class CbPaginator {
|
|
16
17
|
constructor() {
|
|
18
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
19
|
+
this.t = injectCbTranslation();
|
|
17
20
|
this.totalRecords = input(0, /* @ts-ignore */
|
|
18
21
|
...(ngDevMode ? [{ debugName: "totalRecords" }] : /* istanbul ignore next */ []));
|
|
19
22
|
this.rows = model(10, /* @ts-ignore */
|
|
@@ -43,7 +46,7 @@ class CbPaginator {
|
|
|
43
46
|
this.report = computed(() => {
|
|
44
47
|
const total = this.totalRecords();
|
|
45
48
|
if (total === 0)
|
|
46
|
-
return
|
|
49
|
+
return this.t().noRecords;
|
|
47
50
|
const from = this.first() + 1;
|
|
48
51
|
const to = Math.min(this.first() + this.rows(), total);
|
|
49
52
|
return `${from}–${to} de ${total}`;
|
|
@@ -73,7 +76,7 @@ class CbPaginator {
|
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
78
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPaginator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
76
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbPaginator, isStandalone: true, selector: "cb-paginator", inputs: { totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, showReport: { classPropertyName: "showReport", publicName: "showReport", isSignal: true, isRequired: false, transformFunction: null }, maxPageLinks: { classPropertyName: "maxPageLinks", publicName: "maxPageLinks", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rows: "rowsChange", first: "firstChange", pageChange: "pageChange" }, host: { attributes: { "role": "navigation", "aria-label": "
|
|
79
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbPaginator, isStandalone: true, selector: "cb-paginator", inputs: { totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, showReport: { classPropertyName: "showReport", publicName: "showReport", isSignal: true, isRequired: false, transformFunction: null }, maxPageLinks: { classPropertyName: "maxPageLinks", publicName: "maxPageLinks", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rows: "rowsChange", first: "firstChange", pageChange: "pageChange" }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "t().pagination" }, classAttribute: "cb-paginator" }, ngImport: i0, template: `
|
|
77
80
|
@if (showReport()) {
|
|
78
81
|
<span class="cb-paginator__report">{{ report() }}</span>
|
|
79
82
|
}
|
|
@@ -81,7 +84,7 @@ class CbPaginator {
|
|
|
81
84
|
<button
|
|
82
85
|
type="button"
|
|
83
86
|
class="cb-paginator__btn"
|
|
84
|
-
aria-label="
|
|
87
|
+
[attr.aria-label]="t().firstPage"
|
|
85
88
|
[disabled]="page() === 0"
|
|
86
89
|
(click)="goToPage(0)"
|
|
87
90
|
>
|
|
@@ -90,7 +93,7 @@ class CbPaginator {
|
|
|
90
93
|
<button
|
|
91
94
|
type="button"
|
|
92
95
|
class="cb-paginator__btn"
|
|
93
|
-
aria-label="
|
|
96
|
+
[attr.aria-label]="t().previousPage"
|
|
94
97
|
[disabled]="page() === 0"
|
|
95
98
|
(click)="goToPage(page() - 1)"
|
|
96
99
|
>
|
|
@@ -112,7 +115,7 @@ class CbPaginator {
|
|
|
112
115
|
<button
|
|
113
116
|
type="button"
|
|
114
117
|
class="cb-paginator__btn"
|
|
115
|
-
aria-label="
|
|
118
|
+
[attr.aria-label]="t().nextPage"
|
|
116
119
|
[disabled]="page() >= pageCount() - 1"
|
|
117
120
|
(click)="goToPage(page() + 1)"
|
|
118
121
|
>
|
|
@@ -121,7 +124,7 @@ class CbPaginator {
|
|
|
121
124
|
<button
|
|
122
125
|
type="button"
|
|
123
126
|
class="cb-paginator__btn"
|
|
124
|
-
aria-label="
|
|
127
|
+
[attr.aria-label]="t().lastPage"
|
|
125
128
|
[disabled]="page() >= pageCount() - 1"
|
|
126
129
|
(click)="goToPage(pageCount() - 1)"
|
|
127
130
|
>
|
|
@@ -131,7 +134,7 @@ class CbPaginator {
|
|
|
131
134
|
@if (rowsPerPageOptions().length) {
|
|
132
135
|
<select
|
|
133
136
|
class="cb-paginator__rows"
|
|
134
|
-
aria-label="
|
|
137
|
+
[attr.aria-label]="t().rowsPerPage"
|
|
135
138
|
[value]="rows()"
|
|
136
139
|
(change)="onRowsChange($event)"
|
|
137
140
|
>
|
|
@@ -140,11 +143,11 @@ class CbPaginator {
|
|
|
140
143
|
}
|
|
141
144
|
</select>
|
|
142
145
|
}
|
|
143
|
-
`, isInline: true, styles: [":host{display:flex;align-items:center;flex-wrap:wrap;gap:var(--cb-space-1);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);color:var(--cb-color-text)}.cb-paginator__report{margin-right:auto;color:var(--cb-color-text-muted)}.cb-paginator__btn,.cb-paginator__page{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 var(--cb-space-2);border:none;background:transparent;color:var(--cb-color-text);border-radius:var(--cb-radius-md);font:inherit;cursor:pointer;transition:background-color var(--cb-duration-fast) var(--cb-ease)}.cb-paginator__btn:hover:not(:disabled),.cb-paginator__page:hover:not(.cb-is-active){background-color:var(--cb-color-surface-
|
|
146
|
+
`, isInline: true, styles: [":host{display:flex;align-items:center;flex-wrap:wrap;gap:var(--cb-space-1);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);color:var(--cb-color-text)}.cb-paginator__report{margin-right:auto;color:var(--cb-color-text-muted)}.cb-paginator__btn,.cb-paginator__page{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 var(--cb-space-2);border:none;background:transparent;color:var(--cb-color-text);border-radius:var(--cb-radius-md);font:inherit;cursor:pointer;transition:background-color var(--cb-duration-fast) var(--cb-ease)}.cb-paginator__btn:hover:not(:disabled),.cb-paginator__page:hover:not(.cb-is-active){background-color:var(--cb-color-surface-hover)}.cb-paginator__btn:focus-visible,.cb-paginator__page:focus-visible,.cb-paginator__rows:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:1px}.cb-paginator__btn:disabled{color:var(--cb-color-text-muted);opacity:.5;cursor:default}.cb-paginator__page.cb-is-active{background-color:var(--cb-color-primary-500);color:var(--cb-color-primary-contrast);font-weight:var(--cb-font-weight-medium)}.cb-paginator__rows{height:2rem;margin-left:var(--cb-space-2);padding:0 var(--cb-space-2);border:var(--cb-border-width) solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);background-color:var(--cb-color-bg);color:var(--cb-color-text);font:inherit;cursor:pointer}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
144
147
|
}
|
|
145
148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPaginator, decorators: [{
|
|
146
149
|
type: Component,
|
|
147
|
-
args: [{ selector: 'cb-paginator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-paginator', role: 'navigation', 'aria-label': '
|
|
150
|
+
args: [{ selector: 'cb-paginator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-paginator', role: 'navigation', '[attr.aria-label]': 't().pagination' }, template: `
|
|
148
151
|
@if (showReport()) {
|
|
149
152
|
<span class="cb-paginator__report">{{ report() }}</span>
|
|
150
153
|
}
|
|
@@ -152,7 +155,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
152
155
|
<button
|
|
153
156
|
type="button"
|
|
154
157
|
class="cb-paginator__btn"
|
|
155
|
-
aria-label="
|
|
158
|
+
[attr.aria-label]="t().firstPage"
|
|
156
159
|
[disabled]="page() === 0"
|
|
157
160
|
(click)="goToPage(0)"
|
|
158
161
|
>
|
|
@@ -161,7 +164,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
161
164
|
<button
|
|
162
165
|
type="button"
|
|
163
166
|
class="cb-paginator__btn"
|
|
164
|
-
aria-label="
|
|
167
|
+
[attr.aria-label]="t().previousPage"
|
|
165
168
|
[disabled]="page() === 0"
|
|
166
169
|
(click)="goToPage(page() - 1)"
|
|
167
170
|
>
|
|
@@ -183,7 +186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
183
186
|
<button
|
|
184
187
|
type="button"
|
|
185
188
|
class="cb-paginator__btn"
|
|
186
|
-
aria-label="
|
|
189
|
+
[attr.aria-label]="t().nextPage"
|
|
187
190
|
[disabled]="page() >= pageCount() - 1"
|
|
188
191
|
(click)="goToPage(page() + 1)"
|
|
189
192
|
>
|
|
@@ -192,7 +195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
192
195
|
<button
|
|
193
196
|
type="button"
|
|
194
197
|
class="cb-paginator__btn"
|
|
195
|
-
aria-label="
|
|
198
|
+
[attr.aria-label]="t().lastPage"
|
|
196
199
|
[disabled]="page() >= pageCount() - 1"
|
|
197
200
|
(click)="goToPage(pageCount() - 1)"
|
|
198
201
|
>
|
|
@@ -202,7 +205,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
202
205
|
@if (rowsPerPageOptions().length) {
|
|
203
206
|
<select
|
|
204
207
|
class="cb-paginator__rows"
|
|
205
|
-
aria-label="
|
|
208
|
+
[attr.aria-label]="t().rowsPerPage"
|
|
206
209
|
[value]="rows()"
|
|
207
210
|
(change)="onRowsChange($event)"
|
|
208
211
|
>
|
|
@@ -211,7 +214,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
211
214
|
}
|
|
212
215
|
</select>
|
|
213
216
|
}
|
|
214
|
-
`, styles: [":host{display:flex;align-items:center;flex-wrap:wrap;gap:var(--cb-space-1);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);color:var(--cb-color-text)}.cb-paginator__report{margin-right:auto;color:var(--cb-color-text-muted)}.cb-paginator__btn,.cb-paginator__page{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 var(--cb-space-2);border:none;background:transparent;color:var(--cb-color-text);border-radius:var(--cb-radius-md);font:inherit;cursor:pointer;transition:background-color var(--cb-duration-fast) var(--cb-ease)}.cb-paginator__btn:hover:not(:disabled),.cb-paginator__page:hover:not(.cb-is-active){background-color:var(--cb-color-surface-
|
|
217
|
+
`, styles: [":host{display:flex;align-items:center;flex-wrap:wrap;gap:var(--cb-space-1);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);color:var(--cb-color-text)}.cb-paginator__report{margin-right:auto;color:var(--cb-color-text-muted)}.cb-paginator__btn,.cb-paginator__page{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 var(--cb-space-2);border:none;background:transparent;color:var(--cb-color-text);border-radius:var(--cb-radius-md);font:inherit;cursor:pointer;transition:background-color var(--cb-duration-fast) var(--cb-ease)}.cb-paginator__btn:hover:not(:disabled),.cb-paginator__page:hover:not(.cb-is-active){background-color:var(--cb-color-surface-hover)}.cb-paginator__btn:focus-visible,.cb-paginator__page:focus-visible,.cb-paginator__rows:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:1px}.cb-paginator__btn:disabled{color:var(--cb-color-text-muted);opacity:.5;cursor:default}.cb-paginator__page.cb-is-active{background-color:var(--cb-color-primary-500);color:var(--cb-color-primary-contrast);font-weight:var(--cb-font-weight-medium)}.cb-paginator__rows{height:2rem;margin-left:var(--cb-space-2);padding:0 var(--cb-space-2);border:var(--cb-border-width) solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);background-color:var(--cb-color-bg);color:var(--cb-color-text);font:inherit;cursor:pointer}\n"] }]
|
|
215
218
|
}], propDecorators: { totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }, { type: i0.Output, args: ["rowsChange"] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], showReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showReport", required: false }] }], maxPageLinks: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxPageLinks", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
|
|
216
219
|
function toBoolean(value) {
|
|
217
220
|
return value !== false && value != null && `${value}` !== 'false';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
5
|
|
|
5
6
|
let nextPanelUid = 0;
|
|
6
7
|
/**
|
|
@@ -16,6 +17,8 @@ let nextPanelUid = 0;
|
|
|
16
17
|
*/
|
|
17
18
|
class CbPanel {
|
|
18
19
|
constructor() {
|
|
20
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
21
|
+
this.t = injectCbTranslation();
|
|
19
22
|
this.uid = ++nextPanelUid;
|
|
20
23
|
/** Título mostrado en la cabecera del panel. */
|
|
21
24
|
this.header = input('', /* @ts-ignore */
|
|
@@ -49,7 +52,7 @@ class CbPanel {
|
|
|
49
52
|
class="cb-panel__toggler"
|
|
50
53
|
[attr.aria-expanded]="!collapsed()"
|
|
51
54
|
[attr.aria-controls]="contentId"
|
|
52
|
-
[attr.aria-label]="header() ||
|
|
55
|
+
[attr.aria-label]="header() || t().togglePanel"
|
|
53
56
|
(click)="toggle()"
|
|
54
57
|
>
|
|
55
58
|
<cb-icon
|
|
@@ -93,7 +96,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
93
96
|
class="cb-panel__toggler"
|
|
94
97
|
[attr.aria-expanded]="!collapsed()"
|
|
95
98
|
[attr.aria-controls]="contentId"
|
|
96
|
-
[attr.aria-label]="header() ||
|
|
99
|
+
[attr.aria-label]="header() || t().togglePanel"
|
|
97
100
|
(click)="toggle()"
|
|
98
101
|
>
|
|
99
102
|
<cb-icon
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, output, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
5
|
|
|
5
6
|
let nextPanelMenuId = 0;
|
|
6
7
|
/** Vertical menu with collapsible sections. */
|
|
7
8
|
class CbPanelMenu {
|
|
8
9
|
constructor() {
|
|
10
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
11
|
+
this.t = injectCbTranslation();
|
|
9
12
|
this.uid = ++nextPanelMenuId;
|
|
10
13
|
this.items = input([], /* @ts-ignore */
|
|
11
14
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
12
|
-
this.ariaLabel = input(
|
|
15
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
13
16
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
14
17
|
this.multiple = input(false, /* @ts-ignore */
|
|
15
18
|
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
@@ -32,7 +35,7 @@ class CbPanelMenu {
|
|
|
32
35
|
this.itemSelect.emit(item); }
|
|
33
36
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPanelMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
34
37
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbPanelMenu, isStandalone: true, selector: "cb-panelmenu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, host: { classAttribute: "cb-panelmenu" }, ngImport: i0, template: `
|
|
35
|
-
<nav [attr.aria-label]="ariaLabel()">
|
|
38
|
+
<nav [attr.aria-label]="(ariaLabel() ?? t().panelMenu)">
|
|
36
39
|
<ul class="cb-panelmenu__list">
|
|
37
40
|
@for (item of items(); track $index; let i = $index) {
|
|
38
41
|
<li class="cb-panelmenu__entry">
|
|
@@ -77,7 +80,7 @@ class CbPanelMenu {
|
|
|
77
80
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPanelMenu, decorators: [{
|
|
78
81
|
type: Component,
|
|
79
82
|
args: [{ selector: 'cb-panelmenu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-panelmenu' }, template: `
|
|
80
|
-
<nav [attr.aria-label]="ariaLabel()">
|
|
83
|
+
<nav [attr.aria-label]="(ariaLabel() ?? t().panelMenu)">
|
|
81
84
|
<ul class="cb-panelmenu__list">
|
|
82
85
|
@for (item of items(); track $index; let i = $index) {
|
|
83
86
|
<li class="cb-panelmenu__entry">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, signal, computed, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
import { cbFieldState } from '@caribeng/ui';
|
|
4
|
+
import { injectCbTranslation, cbFieldState } from '@caribeng/ui';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Password de CaribeNG: campo de contraseña con alternancia de visibilidad,
|
|
@@ -9,6 +9,8 @@ import { cbFieldState } from '@caribeng/ui';
|
|
|
9
9
|
*/
|
|
10
10
|
class CbPassword {
|
|
11
11
|
constructor() {
|
|
12
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
13
|
+
this.t = injectCbTranslation();
|
|
12
14
|
this.placeholder = input('', /* @ts-ignore */
|
|
13
15
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
14
16
|
this.disabled = input(false, /* @ts-ignore */
|
|
@@ -63,11 +65,11 @@ class CbPassword {
|
|
|
63
65
|
this.strengthLabel = computed(() => {
|
|
64
66
|
switch (this.strength()) {
|
|
65
67
|
case 'weak':
|
|
66
|
-
return
|
|
68
|
+
return this.t().passwordWeak;
|
|
67
69
|
case 'medium':
|
|
68
|
-
return
|
|
70
|
+
return this.t().passwordMedium;
|
|
69
71
|
case 'strong':
|
|
70
|
-
return
|
|
72
|
+
return this.t().passwordStrong;
|
|
71
73
|
default:
|
|
72
74
|
return '';
|
|
73
75
|
}
|
|
@@ -128,7 +130,7 @@ class CbPassword {
|
|
|
128
130
|
type="button"
|
|
129
131
|
class="cb-password__toggle"
|
|
130
132
|
[disabled]="isDisabled()"
|
|
131
|
-
[attr.aria-label]="revealed() ?
|
|
133
|
+
[attr.aria-label]="revealed() ? t().hidePassword : t().showPassword"
|
|
132
134
|
[attr.aria-pressed]="revealed()"
|
|
133
135
|
(click)="toggleReveal()"
|
|
134
136
|
>
|
|
@@ -207,7 +209,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
207
209
|
type="button"
|
|
208
210
|
class="cb-password__toggle"
|
|
209
211
|
[disabled]="isDisabled()"
|
|
210
|
-
[attr.aria-label]="revealed() ?
|
|
212
|
+
[attr.aria-label]="revealed() ? t().hidePassword : t().showPassword"
|
|
211
213
|
[attr.aria-pressed]="revealed()"
|
|
212
214
|
(click)="toggleReveal()"
|
|
213
215
|
>
|