@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
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, Directive, ElementRef, Injector, contentChild, input, output, signal, computed, effect, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { injectCbTranslation, cbFormat } from '@caribeng/ui';
|
|
5
|
+
import { CbButton } from '@caribeng/ui/button';
|
|
6
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
7
|
+
|
|
8
|
+
/** Plantilla de cada elemento: `<ng-template cbRepeaterItem let-grupo let-i="index">`. */
|
|
9
|
+
class CbRepeaterItem {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.template = inject(TemplateRef);
|
|
12
|
+
}
|
|
13
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbRepeaterItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
17
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbRepeaterItem, isStandalone: true, selector: "ng-template[cbRepeaterItem]", ngImport: i0 }); }
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbRepeaterItem, decorators: [{
|
|
20
|
+
type: Directive,
|
|
21
|
+
args: [{
|
|
22
|
+
selector: 'ng-template[cbRepeaterItem]',
|
|
23
|
+
standalone: true,
|
|
24
|
+
}]
|
|
25
|
+
}] });
|
|
26
|
+
/**
|
|
27
|
+
* Repeater de CaribeNG: lista repetible de campos sobre un `FormArray`
|
|
28
|
+
* ("Agregar beneficiario"). Cada elemento es un grupo nombrado con su botón de
|
|
29
|
+
* quitar; respeta `min` y `max`, mueve el foco al agregar y quitar, y anuncia
|
|
30
|
+
* los cambios al lector de pantalla.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```html
|
|
34
|
+
* <cb-repeater [formArray]="beneficiarios" [createItem]="nuevoBeneficiario" itemLabel="Beneficiario" [max]="5">
|
|
35
|
+
* <ng-template cbRepeaterItem let-grupo>
|
|
36
|
+
* <ng-container [formGroup]="grupo">
|
|
37
|
+
* <cb-input label="Nombre" formControlName="nombre" />
|
|
38
|
+
* </ng-container>
|
|
39
|
+
* </ng-template>
|
|
40
|
+
* </cb-repeater>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
class CbRepeater {
|
|
44
|
+
constructor() {
|
|
45
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
46
|
+
this.t = injectCbTranslation();
|
|
47
|
+
/** Rellena `{0}`, `{1}`… de un texto traducido. */
|
|
48
|
+
this.fmt = cbFormat;
|
|
49
|
+
this.host = inject(ElementRef);
|
|
50
|
+
this.injector = inject(Injector);
|
|
51
|
+
this.itemTemplate = contentChild(CbRepeaterItem, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/** FormArray con un control por elemento. */
|
|
54
|
+
this.formArray = input.required(/* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "formArray" }] : /* istanbul ignore next */ []));
|
|
56
|
+
/** Crea el control de un elemento nuevo (p. ej. `() => fb.group({ nombre: [''] })`). */
|
|
57
|
+
this.createItem = input.required(/* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "createItem" }] : /* istanbul ignore next */ []));
|
|
59
|
+
/** Nombre de cada elemento ("Beneficiario" → "Beneficiario 1", "Beneficiario 2"…). Por defecto, "Elemento" del idioma activo. */
|
|
60
|
+
this.itemLabel = input(undefined, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "itemLabel" }] : /* istanbul ignore next */ []));
|
|
62
|
+
/** Texto del botón de agregar. Por defecto, "Agregar beneficiario". */
|
|
63
|
+
this.addLabel = input(undefined, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "addLabel" }] : /* istanbul ignore next */ []));
|
|
65
|
+
/** Mínimo de elementos (no se puede quitar por debajo). */
|
|
66
|
+
this.min = input(0, /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
68
|
+
/** Máximo de elementos (el botón de agregar se deshabilita). */
|
|
69
|
+
this.max = input(Number.POSITIVE_INFINITY, /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
71
|
+
this.disabled = input(false, /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
73
|
+
this.itemAdd = output();
|
|
74
|
+
this.itemRemove = output();
|
|
75
|
+
/** Controles del FormArray (se actualiza también si el FormArray cambia desde fuera). */
|
|
76
|
+
this.controls = signal([], /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "controls" }] : /* istanbul ignore next */ []));
|
|
78
|
+
this.announcement = signal('', /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
80
|
+
this.canAdd = computed(() => !this.disabled() && this.controls().length < this.max(), /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "canAdd" }] : /* istanbul ignore next */ []));
|
|
82
|
+
this.addText = computed(() => {
|
|
83
|
+
const label = this.itemLabel();
|
|
84
|
+
return this.addLabel() ?? (label ? `${this.t().add} ${label.toLocaleLowerCase()}` : this.t().add);
|
|
85
|
+
}, /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "addText" }] : /* istanbul ignore next */ []));
|
|
87
|
+
effect((onCleanup) => {
|
|
88
|
+
const array = this.formArray();
|
|
89
|
+
const sync = () => this.controls.set([...array.controls]);
|
|
90
|
+
sync();
|
|
91
|
+
const sub = array.valueChanges.subscribe(sync);
|
|
92
|
+
onCleanup(() => sub.unsubscribe());
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
labelFor(index) {
|
|
96
|
+
const label = this.itemLabel();
|
|
97
|
+
return label ? `${label} ${index + 1}` : cbFormat(this.t().chartItem, index + 1);
|
|
98
|
+
}
|
|
99
|
+
/** Agrega un elemento al final y lleva el foco a su primer campo. */
|
|
100
|
+
add() {
|
|
101
|
+
if (!this.canAdd())
|
|
102
|
+
return;
|
|
103
|
+
const array = this.formArray();
|
|
104
|
+
array.push(this.createItem()());
|
|
105
|
+
array.markAsDirty();
|
|
106
|
+
const index = array.length - 1;
|
|
107
|
+
this.controls.set([...array.controls]);
|
|
108
|
+
this.announcement.set(cbFormat(this.t().itemAdded, this.labelFor(index)));
|
|
109
|
+
this.itemAdd.emit(index);
|
|
110
|
+
this.focusAfterRender(() => {
|
|
111
|
+
const item = this.host.nativeElement.querySelector(`.cb-repeater__item[data-index="${index}"]`);
|
|
112
|
+
return item?.querySelector('.cb-repeater__body :is(input, select, textarea, button, [tabindex]:not([tabindex="-1"]))') ?? null;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** Quita un elemento y deja el foco en el anterior (o en el botón de agregar). */
|
|
116
|
+
remove(index) {
|
|
117
|
+
const array = this.formArray();
|
|
118
|
+
if (array.length <= this.min() || this.disabled())
|
|
119
|
+
return;
|
|
120
|
+
const label = this.labelFor(index);
|
|
121
|
+
array.removeAt(index);
|
|
122
|
+
array.markAsDirty();
|
|
123
|
+
this.controls.set([...array.controls]);
|
|
124
|
+
this.announcement.set(cbFormat(this.t().itemRemoved, label));
|
|
125
|
+
this.itemRemove.emit(index);
|
|
126
|
+
// El foco pasa al botón de quitar del elemento anterior (o del nuevo primero); si no queda ninguno, a "Agregar".
|
|
127
|
+
this.focusAfterRender(() => {
|
|
128
|
+
const next = array.length ? Math.max(0, index - 1) : -1;
|
|
129
|
+
const item = next >= 0 ? this.host.nativeElement.querySelector(`.cb-repeater__item[data-index="${next}"]`) : null;
|
|
130
|
+
const remove = item?.querySelector('.cb-repeater__remove button:not(:disabled)');
|
|
131
|
+
return remove ?? this.host.nativeElement.querySelector('.cb-repeater__add button');
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
focusAfterRender(find) {
|
|
135
|
+
afterNextRender(() => find()?.focus(), { injector: this.injector });
|
|
136
|
+
}
|
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbRepeater, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
138
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbRepeater, isStandalone: true, selector: "cb-repeater", inputs: { formArray: { classPropertyName: "formArray", publicName: "formArray", isSignal: true, isRequired: true, transformFunction: null }, createItem: { classPropertyName: "createItem", publicName: "createItem", isSignal: true, isRequired: true, transformFunction: null }, itemLabel: { classPropertyName: "itemLabel", publicName: "itemLabel", isSignal: true, isRequired: false, transformFunction: null }, addLabel: { classPropertyName: "addLabel", publicName: "addLabel", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemAdd: "itemAdd", itemRemove: "itemRemove" }, host: { classAttribute: "cb-repeater" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: CbRepeaterItem, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
139
|
+
@for (control of controls(); track control; let i = $index) {
|
|
140
|
+
<div class="cb-repeater__item" role="group" [attr.aria-label]="labelFor(i)" [attr.data-index]="i">
|
|
141
|
+
<div class="cb-repeater__head">
|
|
142
|
+
<span class="cb-repeater__title">{{ labelFor(i) }}</span>
|
|
143
|
+
<cb-button
|
|
144
|
+
class="cb-repeater__remove"
|
|
145
|
+
variant="text"
|
|
146
|
+
severity="secondary"
|
|
147
|
+
size="sm"
|
|
148
|
+
[disabled]="controls().length <= min() || disabled()"
|
|
149
|
+
[ariaLabel]="fmt(t().removeItem, labelFor(i))"
|
|
150
|
+
(click)="remove(i)"
|
|
151
|
+
>
|
|
152
|
+
<cb-icon name="trash" [size]="15" aria-hidden="true" />
|
|
153
|
+
</cb-button>
|
|
154
|
+
</div>
|
|
155
|
+
@if (itemTemplate(); as tpl) {
|
|
156
|
+
<div class="cb-repeater__body">
|
|
157
|
+
<ng-container [ngTemplateOutlet]="tpl.template" [ngTemplateOutletContext]="{ $implicit: control, index: i, label: labelFor(i) }" />
|
|
158
|
+
</div>
|
|
159
|
+
}
|
|
160
|
+
</div>
|
|
161
|
+
}
|
|
162
|
+
<cb-button
|
|
163
|
+
class="cb-repeater__add"
|
|
164
|
+
variant="outlined"
|
|
165
|
+
size="sm"
|
|
166
|
+
[disabled]="!canAdd()"
|
|
167
|
+
(click)="add()"
|
|
168
|
+
>
|
|
169
|
+
<cb-icon name="plus" [size]="15" aria-hidden="true" />
|
|
170
|
+
{{ addText() }}
|
|
171
|
+
</cb-button>
|
|
172
|
+
<span class="cb-repeater__sr" aria-live="polite">{{ announcement() }}</span>
|
|
173
|
+
`, isInline: true, styles: [":host{display:grid;gap:var(--cb-space-3, .75rem);font-family:var(--cb-font-sans, inherit)}.cb-repeater__item{display:grid;gap:var(--cb-space-3, .75rem);padding:var(--cb-space-4, 1rem);background:var(--cb-color-surface-raised);border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem)}.cb-repeater__head{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-2, .5rem)}.cb-repeater__title{font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}.cb-repeater__body{display:grid;gap:var(--cb-space-3, .75rem)}.cb-repeater__add{justify-self:start}.cb-repeater__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CbButton, selector: "cb-button", inputs: ["severity", "variant", "size", "disabled", "loading", "fullWidth", "type", "ariaLabel", "ariaHaspopup", "ariaExpanded", "ariaControls"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
174
|
+
}
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbRepeater, decorators: [{
|
|
176
|
+
type: Component,
|
|
177
|
+
args: [{ selector: 'cb-repeater', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [NgTemplateOutlet, CbButton, CbIcon], host: { class: 'cb-repeater' }, template: `
|
|
178
|
+
@for (control of controls(); track control; let i = $index) {
|
|
179
|
+
<div class="cb-repeater__item" role="group" [attr.aria-label]="labelFor(i)" [attr.data-index]="i">
|
|
180
|
+
<div class="cb-repeater__head">
|
|
181
|
+
<span class="cb-repeater__title">{{ labelFor(i) }}</span>
|
|
182
|
+
<cb-button
|
|
183
|
+
class="cb-repeater__remove"
|
|
184
|
+
variant="text"
|
|
185
|
+
severity="secondary"
|
|
186
|
+
size="sm"
|
|
187
|
+
[disabled]="controls().length <= min() || disabled()"
|
|
188
|
+
[ariaLabel]="fmt(t().removeItem, labelFor(i))"
|
|
189
|
+
(click)="remove(i)"
|
|
190
|
+
>
|
|
191
|
+
<cb-icon name="trash" [size]="15" aria-hidden="true" />
|
|
192
|
+
</cb-button>
|
|
193
|
+
</div>
|
|
194
|
+
@if (itemTemplate(); as tpl) {
|
|
195
|
+
<div class="cb-repeater__body">
|
|
196
|
+
<ng-container [ngTemplateOutlet]="tpl.template" [ngTemplateOutletContext]="{ $implicit: control, index: i, label: labelFor(i) }" />
|
|
197
|
+
</div>
|
|
198
|
+
}
|
|
199
|
+
</div>
|
|
200
|
+
}
|
|
201
|
+
<cb-button
|
|
202
|
+
class="cb-repeater__add"
|
|
203
|
+
variant="outlined"
|
|
204
|
+
size="sm"
|
|
205
|
+
[disabled]="!canAdd()"
|
|
206
|
+
(click)="add()"
|
|
207
|
+
>
|
|
208
|
+
<cb-icon name="plus" [size]="15" aria-hidden="true" />
|
|
209
|
+
{{ addText() }}
|
|
210
|
+
</cb-button>
|
|
211
|
+
<span class="cb-repeater__sr" aria-live="polite">{{ announcement() }}</span>
|
|
212
|
+
`, styles: [":host{display:grid;gap:var(--cb-space-3, .75rem);font-family:var(--cb-font-sans, inherit)}.cb-repeater__item{display:grid;gap:var(--cb-space-3, .75rem);padding:var(--cb-space-4, 1rem);background:var(--cb-color-surface-raised);border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem)}.cb-repeater__head{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-2, .5rem)}.cb-repeater__title{font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}.cb-repeater__body{display:grid;gap:var(--cb-space-3, .75rem)}.cb-repeater__add{justify-self:start}.cb-repeater__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"] }]
|
|
213
|
+
}], ctorParameters: () => [], propDecorators: { itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbRepeaterItem), { isSignal: true }] }], formArray: [{ type: i0.Input, args: [{ isSignal: true, alias: "formArray", required: true }] }], createItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "createItem", required: true }] }], itemLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemLabel", required: false }] }], addLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "addLabel", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemAdd: [{ type: i0.Output, args: ["itemAdd"] }], itemRemove: [{ type: i0.Output, args: ["itemRemove"] }] } });
|
|
214
|
+
|
|
215
|
+
/*
|
|
216
|
+
* Public API Surface de @caribeng/ui/repeater
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Generated bundle index. Do not edit.
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
export { CbRepeater, CbRepeaterItem };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
|
|
5
|
+
const ICONS = {
|
|
6
|
+
success: 'circle-check',
|
|
7
|
+
error: 'circle-x',
|
|
8
|
+
warning: 'triangle-alert',
|
|
9
|
+
info: 'info',
|
|
10
|
+
'404': 'search',
|
|
11
|
+
'403': 'lock',
|
|
12
|
+
'500': 'circle-alert',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Result de CaribeNG: pantalla de resultado (operación exitosa, error,
|
|
16
|
+
* aviso) o de error HTTP (404, 403, 500) con título, subtítulo, contenido extra
|
|
17
|
+
* y acciones proyectadas.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <cb-result status="success" title="Transferencia enviada" subtitle="Comprobante #48213">
|
|
22
|
+
* <cb-button>Volver al inicio</cb-button>
|
|
23
|
+
* </cb-result>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
class CbResult {
|
|
27
|
+
constructor() {
|
|
28
|
+
/** Tipo de resultado: define el icono y el color. */
|
|
29
|
+
this.status = input('info', /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.title = input('', /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
33
|
+
this.subtitle = input('', /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Icono propio (en lugar del del estado). */
|
|
36
|
+
this.icon = input(undefined, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** Nivel del encabezado del título (por defecto 2). */
|
|
39
|
+
this.headingLevel = input(2, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
|
|
41
|
+
this.isHttp = computed(() => /^\d{3}$/.test(this.status()), /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "isHttp" }] : /* istanbul ignore next */ []));
|
|
43
|
+
this.defaultIcon = computed(() => ICONS[this.status()], /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "defaultIcon" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** Los errores HTTP usan el color neutro; los demás, el de su estado. */
|
|
46
|
+
this.statusClass = computed(() => (this.isHttp() ? 'http' : this.status()), /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "statusClass" }] : /* istanbul ignore next */ []));
|
|
48
|
+
}
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbResult, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbResult, isStandalone: true, selector: "cb-result", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "'cb-result cb-result--' + statusClass()" }, classAttribute: "cb-result" }, ngImport: i0, template: `
|
|
51
|
+
@if (isHttp()) {
|
|
52
|
+
<span class="cb-result__code" aria-hidden="true">{{ status() }}</span>
|
|
53
|
+
} @else {
|
|
54
|
+
<span class="cb-result__icon" aria-hidden="true">
|
|
55
|
+
<cb-icon [name]="icon() ?? defaultIcon()" [size]="40" />
|
|
56
|
+
</span>
|
|
57
|
+
}
|
|
58
|
+
<div class="cb-result__title" role="heading" [attr.aria-level]="headingLevel()">{{ title() }}</div>
|
|
59
|
+
@if (subtitle()) {
|
|
60
|
+
<p class="cb-result__subtitle">{{ subtitle() }}</p>
|
|
61
|
+
}
|
|
62
|
+
<div class="cb-result__content"><ng-content /></div>
|
|
63
|
+
`, isInline: true, styles: [":host{--_accent: var(--cb-color-info-500);display:flex;flex-direction:column;align-items:center;gap:var(--cb-space-2, .5rem);padding:var(--cb-space-8, 2rem) var(--cb-space-4, 1rem);text-align:center;font-family:var(--cb-font-sans, inherit);color:var(--cb-color-text)}:host(.cb-result--success){--_accent: var(--cb-color-success-500)}:host(.cb-result--error){--_accent: var(--cb-color-danger-500)}:host(.cb-result--warning){--_accent: var(--cb-color-warning-500)}:host(.cb-result--info){--_accent: var(--cb-color-info-500)}:host(.cb-result--http){--_accent: var(--cb-color-primary-500)}.cb-result__icon{display:inline-flex;align-items:center;justify-content:center;width:5rem;height:5rem;margin-bottom:var(--cb-space-2, .5rem);color:var(--_accent);background-color:color-mix(in srgb,var(--_accent) 14%,transparent);border-radius:999px}.cb-result__code{font-size:clamp(3.5rem,12vw,6rem);font-weight:var(--cb-font-weight-bold, 700);line-height:1;letter-spacing:-.04em;color:var(--_accent)}.cb-result__title{margin:0;font-size:var(--cb-text-xl, 1.25rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}.cb-result__subtitle{max-width:32rem;margin:0;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted)}.cb-result__content{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-4, 1rem)}.cb-result__content:empty{display:none}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbResult, decorators: [{
|
|
66
|
+
type: Component,
|
|
67
|
+
args: [{ selector: 'cb-result', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-result', '[class]': "'cb-result cb-result--' + statusClass()" }, template: `
|
|
68
|
+
@if (isHttp()) {
|
|
69
|
+
<span class="cb-result__code" aria-hidden="true">{{ status() }}</span>
|
|
70
|
+
} @else {
|
|
71
|
+
<span class="cb-result__icon" aria-hidden="true">
|
|
72
|
+
<cb-icon [name]="icon() ?? defaultIcon()" [size]="40" />
|
|
73
|
+
</span>
|
|
74
|
+
}
|
|
75
|
+
<div class="cb-result__title" role="heading" [attr.aria-level]="headingLevel()">{{ title() }}</div>
|
|
76
|
+
@if (subtitle()) {
|
|
77
|
+
<p class="cb-result__subtitle">{{ subtitle() }}</p>
|
|
78
|
+
}
|
|
79
|
+
<div class="cb-result__content"><ng-content /></div>
|
|
80
|
+
`, styles: [":host{--_accent: var(--cb-color-info-500);display:flex;flex-direction:column;align-items:center;gap:var(--cb-space-2, .5rem);padding:var(--cb-space-8, 2rem) var(--cb-space-4, 1rem);text-align:center;font-family:var(--cb-font-sans, inherit);color:var(--cb-color-text)}:host(.cb-result--success){--_accent: var(--cb-color-success-500)}:host(.cb-result--error){--_accent: var(--cb-color-danger-500)}:host(.cb-result--warning){--_accent: var(--cb-color-warning-500)}:host(.cb-result--info){--_accent: var(--cb-color-info-500)}:host(.cb-result--http){--_accent: var(--cb-color-primary-500)}.cb-result__icon{display:inline-flex;align-items:center;justify-content:center;width:5rem;height:5rem;margin-bottom:var(--cb-space-2, .5rem);color:var(--_accent);background-color:color-mix(in srgb,var(--_accent) 14%,transparent);border-radius:999px}.cb-result__code{font-size:clamp(3.5rem,12vw,6rem);font-weight:var(--cb-font-weight-bold, 700);line-height:1;letter-spacing:-.04em;color:var(--_accent)}.cb-result__title{margin:0;font-size:var(--cb-text-xl, 1.25rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}.cb-result__subtitle{max-width:32rem;margin:0;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted)}.cb-result__content{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--cb-space-2, .5rem);margin-top:var(--cb-space-4, 1rem)}.cb-result__content:empty{display:none}\n"] }]
|
|
81
|
+
}], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }] } });
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* Public API Surface de @caribeng/ui/result
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Generated bundle index. Do not edit.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
export { CbResult };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, viewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* ScrollPanel de CaribeNG: contenedor de desplazamiento con barras estilizadas
|
|
@@ -14,6 +15,8 @@ import { input, viewChild, ViewEncapsulation, ChangeDetectionStrategy, Component
|
|
|
14
15
|
*/
|
|
15
16
|
class CbScrollPanel {
|
|
16
17
|
constructor() {
|
|
18
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
19
|
+
this.t = injectCbTranslation();
|
|
17
20
|
/** Ancho CSS del contenedor (ej. `'100%'`, `'320px'`). */
|
|
18
21
|
this.width = input('100%', /* @ts-ignore */
|
|
19
22
|
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
@@ -21,7 +24,7 @@ class CbScrollPanel {
|
|
|
21
24
|
this.height = input('200px', /* @ts-ignore */
|
|
22
25
|
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
23
26
|
/** Etiqueta accesible para la región con scroll. */
|
|
24
|
-
this.ariaLabel = input(
|
|
27
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
25
28
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
26
29
|
this.viewportRef = viewChild('viewport', /* @ts-ignore */
|
|
27
30
|
...(ngDevMode ? [{ debugName: "viewportRef" }] : /* istanbul ignore next */ []));
|
|
@@ -40,7 +43,7 @@ class CbScrollPanel {
|
|
|
40
43
|
class="cb-scroll-panel__viewport"
|
|
41
44
|
role="region"
|
|
42
45
|
tabindex="0"
|
|
43
|
-
[attr.aria-label]="ariaLabel()
|
|
46
|
+
[attr.aria-label]="(ariaLabel() ?? t().scrollableArea)"
|
|
44
47
|
>
|
|
45
48
|
<div class="cb-scroll-panel__content">
|
|
46
49
|
<ng-content />
|
|
@@ -60,7 +63,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
60
63
|
class="cb-scroll-panel__viewport"
|
|
61
64
|
role="region"
|
|
62
65
|
tabindex="0"
|
|
63
|
-
[attr.aria-label]="ariaLabel()
|
|
66
|
+
[attr.aria-label]="(ariaLabel() ?? t().scrollableArea)"
|
|
64
67
|
>
|
|
65
68
|
<div class="cb-scroll-panel__content">
|
|
66
69
|
<ng-content />
|
|
@@ -2,6 +2,7 @@ import { DOCUMENT } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, ElementRef, DestroyRef, input, signal, afterNextRender, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
5
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* ScrollTop de CaribeNG: botón flotante que aparece cuando el usuario supera
|
|
@@ -19,6 +20,8 @@ import { CbIcon } from '@caribeng/ui/icon';
|
|
|
19
20
|
*/
|
|
20
21
|
class CbScrollTop {
|
|
21
22
|
constructor() {
|
|
23
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
24
|
+
this.t = injectCbTranslation();
|
|
22
25
|
this.doc = inject(DOCUMENT);
|
|
23
26
|
this.hostRef = inject(ElementRef);
|
|
24
27
|
this.destroyRef = inject(DestroyRef);
|
|
@@ -35,7 +38,7 @@ class CbScrollTop {
|
|
|
35
38
|
this.icon = input('chevron-up', /* @ts-ignore */
|
|
36
39
|
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
37
40
|
/** Etiqueta accesible para el botón. */
|
|
38
|
-
this.ariaLabel = input(
|
|
41
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
39
42
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
40
43
|
this.visible = signal(false, /* @ts-ignore */
|
|
41
44
|
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
@@ -117,7 +120,7 @@ class CbScrollTop {
|
|
|
117
120
|
<button
|
|
118
121
|
type="button"
|
|
119
122
|
class="cb-scroll-top__button"
|
|
120
|
-
[attr.aria-label]="ariaLabel()"
|
|
123
|
+
[attr.aria-label]="(ariaLabel() ?? t().scrollTop)"
|
|
121
124
|
(click)="scrollToTop()"
|
|
122
125
|
>
|
|
123
126
|
<cb-icon [name]="icon()" [size]="18" aria-hidden="true" />
|
|
@@ -136,7 +139,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
136
139
|
<button
|
|
137
140
|
type="button"
|
|
138
141
|
class="cb-scroll-top__button"
|
|
139
|
-
[attr.aria-label]="ariaLabel()"
|
|
142
|
+
[attr.aria-label]="(ariaLabel() ?? t().scrollTop)"
|
|
140
143
|
(click)="scrollToTop()"
|
|
141
144
|
>
|
|
142
145
|
<cb-icon [name]="icon()" [size]="18" aria-hidden="true" />
|