@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,15 +1,18 @@
|
|
|
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
|
/** Horizontal navigation menu with an active item. */
|
|
6
7
|
class CbTabMenu {
|
|
7
8
|
constructor() {
|
|
9
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
10
|
+
this.t = injectCbTranslation();
|
|
8
11
|
this.items = input([], /* @ts-ignore */
|
|
9
12
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
10
13
|
this.activeIndex = model(0, /* @ts-ignore */
|
|
11
14
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* 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.itemSelect = output();
|
|
15
18
|
}
|
|
@@ -21,7 +24,7 @@ class CbTabMenu {
|
|
|
21
24
|
}
|
|
22
25
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTabMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
26
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbTabMenu, isStandalone: true, selector: "cb-tabmenu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange", itemSelect: "itemSelect" }, host: { classAttribute: "cb-tabmenu" }, ngImport: i0, template: `
|
|
24
|
-
<nav [attr.aria-label]="ariaLabel()">
|
|
27
|
+
<nav [attr.aria-label]="(ariaLabel() ?? t().sectionNavigation)">
|
|
25
28
|
<ul class="cb-tabmenu__list">
|
|
26
29
|
@for (item of items(); track $index; let i = $index) {
|
|
27
30
|
<li class="cb-tabmenu__entry">
|
|
@@ -45,7 +48,7 @@ class CbTabMenu {
|
|
|
45
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTabMenu, decorators: [{
|
|
46
49
|
type: Component,
|
|
47
50
|
args: [{ selector: 'cb-tabmenu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-tabmenu' }, template: `
|
|
48
|
-
<nav [attr.aria-label]="ariaLabel()">
|
|
51
|
+
<nav [attr.aria-label]="(ariaLabel() ?? t().sectionNavigation)">
|
|
49
52
|
<ul class="cb-tabmenu__list">
|
|
50
53
|
@for (item of items(); track $index; let i = $index) {
|
|
51
54
|
<li class="cb-tabmenu__entry">
|
|
@@ -31,7 +31,7 @@ class CbTag {
|
|
|
31
31
|
<span class="cb-tag__label">{{ value() }}</span>
|
|
32
32
|
}
|
|
33
33
|
<ng-content />
|
|
34
|
-
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:var(--cb-radius-sm);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-medium);line-height:1.4;color:var(--_fg);background-color:var(--_bg)}:host(.cb-tag--rounded){border-radius:var(--cb-radius-full);padding-inline:.625rem}:host(.cb-tag--primary){--_bg: var(--cb-color-primary-100);--_fg: var(--cb-color-primary-500)}:host(.cb-tag--secondary){--_bg: var(--cb-color-surface-
|
|
34
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:var(--cb-radius-sm);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-medium);line-height:1.4;color:var(--_fg);background-color:var(--_bg)}:host(.cb-tag--rounded){border-radius:var(--cb-radius-full);padding-inline:.625rem}:host(.cb-tag--primary){--_bg: var(--cb-color-primary-100);--_fg: var(--cb-color-primary-500)}:host(.cb-tag--secondary){--_bg: var(--cb-color-surface-hover);--_fg: var(--cb-color-text-muted)}:host(.cb-tag--success){--_bg: var(--cb-color-success-100);--_fg: var(--cb-color-success-500)}:host(.cb-tag--info){--_bg: var(--cb-color-info-100);--_fg: var(--cb-color-info-500)}:host(.cb-tag--warning){--_bg: var(--cb-color-warning-100);--_fg: var(--cb-color-warning-500)}:host(.cb-tag--danger){--_bg: var(--cb-color-danger-100);--_fg: var(--cb-color-danger-500)}:host(.cb-tag--help){--_bg: var(--cb-color-help-100);--_fg: var(--cb-color-help-500)}:host(.cb-tag--contrast){--_bg: var(--cb-color-text);--_fg: var(--cb-color-bg)}:host-context([data-theme=\"dark\"]){--_bg: color-mix(in srgb, var(--_fg) 22%, transparent)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
35
35
|
}
|
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTag, decorators: [{
|
|
37
37
|
type: Component,
|
|
@@ -47,7 +47,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
47
47
|
<span class="cb-tag__label">{{ value() }}</span>
|
|
48
48
|
}
|
|
49
49
|
<ng-content />
|
|
50
|
-
`, styles: [":host{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:var(--cb-radius-sm);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-medium);line-height:1.4;color:var(--_fg);background-color:var(--_bg)}:host(.cb-tag--rounded){border-radius:var(--cb-radius-full);padding-inline:.625rem}:host(.cb-tag--primary){--_bg: var(--cb-color-primary-100);--_fg: var(--cb-color-primary-500)}:host(.cb-tag--secondary){--_bg: var(--cb-color-surface-
|
|
50
|
+
`, styles: [":host{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:var(--cb-radius-sm);font-family:var(--cb-font-sans);font-size:var(--cb-text-xs);font-weight:var(--cb-font-weight-medium);line-height:1.4;color:var(--_fg);background-color:var(--_bg)}:host(.cb-tag--rounded){border-radius:var(--cb-radius-full);padding-inline:.625rem}:host(.cb-tag--primary){--_bg: var(--cb-color-primary-100);--_fg: var(--cb-color-primary-500)}:host(.cb-tag--secondary){--_bg: var(--cb-color-surface-hover);--_fg: var(--cb-color-text-muted)}:host(.cb-tag--success){--_bg: var(--cb-color-success-100);--_fg: var(--cb-color-success-500)}:host(.cb-tag--info){--_bg: var(--cb-color-info-100);--_fg: var(--cb-color-info-500)}:host(.cb-tag--warning){--_bg: var(--cb-color-warning-100);--_fg: var(--cb-color-warning-500)}:host(.cb-tag--danger){--_bg: var(--cb-color-danger-100);--_fg: var(--cb-color-danger-500)}:host(.cb-tag--help){--_bg: var(--cb-color-help-100);--_fg: var(--cb-color-help-500)}:host(.cb-tag--contrast){--_bg: var(--cb-color-text);--_fg: var(--cb-color-bg)}:host-context([data-theme=\"dark\"]){--_bg: color-mix(in srgb, var(--_fg) 22%, transparent)}\n"] }]
|
|
51
51
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }] } });
|
|
52
52
|
function toBoolean(value) {
|
|
53
53
|
return value !== false && value != null && `${value}` !== 'false';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, output, signal, viewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Terminal de CaribeNG: consola interactiva basada en señales con historial de comandos.
|
|
6
7
|
*/
|
|
7
8
|
class CbTerminal {
|
|
8
9
|
constructor() {
|
|
10
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
11
|
+
this.t = injectCbTranslation();
|
|
9
12
|
this.welcomeMessage = input('', /* @ts-ignore */
|
|
10
13
|
...(ngDevMode ? [{ debugName: "welcomeMessage" }] : /* istanbul ignore next */ []));
|
|
11
14
|
this.prompt = input('caribeng $', /* @ts-ignore */
|
|
@@ -15,6 +18,17 @@ class CbTerminal {
|
|
|
15
18
|
...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
|
|
16
19
|
this.currentCommand = signal('', /* @ts-ignore */
|
|
17
20
|
...(ngDevMode ? [{ debugName: "currentCommand" }] : /* istanbul ignore next */ []));
|
|
21
|
+
/** Posición en el historial al recorrerlo con flechas (`null` = escribiendo uno nuevo). */
|
|
22
|
+
this.historyIndex = null;
|
|
23
|
+
this.commandInput = viewChild('commandInput', /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "commandInput" }] : /* istanbul ignore next */ []));
|
|
25
|
+
}
|
|
26
|
+
/** Fija el comando actual también en el DOM (el binding no detecta '' → '' si no hubo render entre medias). */
|
|
27
|
+
setCommand(value) {
|
|
28
|
+
this.currentCommand.set(value);
|
|
29
|
+
const input = this.commandInput()?.nativeElement;
|
|
30
|
+
if (input)
|
|
31
|
+
input.value = value;
|
|
18
32
|
}
|
|
19
33
|
onInput(event) {
|
|
20
34
|
this.currentCommand.set(event.target.value);
|
|
@@ -25,13 +39,29 @@ class CbTerminal {
|
|
|
25
39
|
return;
|
|
26
40
|
if (cmd === 'clear') {
|
|
27
41
|
this.entries.set([]);
|
|
28
|
-
this.
|
|
42
|
+
this.setCommand('');
|
|
29
43
|
return;
|
|
30
44
|
}
|
|
31
45
|
this.entries.update((list) => [...list, { command: cmd }]);
|
|
32
|
-
this.
|
|
46
|
+
this.setCommand('');
|
|
47
|
+
this.historyIndex = null;
|
|
33
48
|
this.commandEntered.emit(cmd);
|
|
34
49
|
}
|
|
50
|
+
/** Flecha arriba / abajo recorren los comandos anteriores. */
|
|
51
|
+
recall(event, step) {
|
|
52
|
+
const commands = this.entries().map((e) => e.command);
|
|
53
|
+
if (!commands.length)
|
|
54
|
+
return;
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
const next = (this.historyIndex ?? commands.length) + step;
|
|
57
|
+
if (next >= commands.length) {
|
|
58
|
+
this.historyIndex = null;
|
|
59
|
+
this.setCommand('');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.historyIndex = Math.max(0, next);
|
|
63
|
+
this.setCommand(commands[this.historyIndex]);
|
|
64
|
+
}
|
|
35
65
|
sendResponse(response) {
|
|
36
66
|
this.entries.update((list) => {
|
|
37
67
|
if (list.length === 0)
|
|
@@ -42,11 +72,11 @@ class CbTerminal {
|
|
|
42
72
|
});
|
|
43
73
|
}
|
|
44
74
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTerminal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
45
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbTerminal, isStandalone: true, selector: "cb-terminal", inputs: { welcomeMessage: { classPropertyName: "welcomeMessage", publicName: "welcomeMessage", isSignal: true, isRequired: false, transformFunction: null }, prompt: { classPropertyName: "prompt", publicName: "prompt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { commandEntered: "commandEntered" }, host: { classAttribute: "cb-terminal" }, ngImport: i0, template: `
|
|
75
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbTerminal, isStandalone: true, selector: "cb-terminal", inputs: { welcomeMessage: { classPropertyName: "welcomeMessage", publicName: "welcomeMessage", isSignal: true, isRequired: false, transformFunction: null }, prompt: { classPropertyName: "prompt", publicName: "prompt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { commandEntered: "commandEntered" }, host: { classAttribute: "cb-terminal" }, viewQueries: [{ propertyName: "commandInput", first: true, predicate: ["commandInput"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
46
76
|
@if (welcomeMessage()) {
|
|
47
77
|
<div class="cb-terminal__welcome">{{ welcomeMessage() }}</div>
|
|
48
78
|
}
|
|
49
|
-
<div class="cb-terminal__history">
|
|
79
|
+
<div class="cb-terminal__history" role="log" aria-live="polite">
|
|
50
80
|
@for (entry of entries(); track $index) {
|
|
51
81
|
<div class="cb-terminal__entry">
|
|
52
82
|
<div class="cb-terminal__line">
|
|
@@ -62,12 +92,15 @@ class CbTerminal {
|
|
|
62
92
|
<div class="cb-terminal__input-row">
|
|
63
93
|
<span class="cb-terminal__prompt">{{ prompt() }}</span>
|
|
64
94
|
<input
|
|
95
|
+
#commandInput
|
|
65
96
|
type="text"
|
|
66
97
|
class="cb-terminal__input"
|
|
67
98
|
[value]="currentCommand()"
|
|
68
|
-
[attr.aria-label]="prompt() ||
|
|
99
|
+
[attr.aria-label]="prompt() || t().command"
|
|
69
100
|
(input)="onInput($event)"
|
|
70
101
|
(keydown.enter)="submitCommand()"
|
|
102
|
+
(keydown.arrowup)="recall($event, -1)"
|
|
103
|
+
(keydown.arrowdown)="recall($event, 1)"
|
|
71
104
|
/>
|
|
72
105
|
</div>
|
|
73
106
|
`, isInline: true, styles: [":host{display:block;width:100%;padding:var(--cb-space-4);border-radius:var(--cb-radius-lg);background:#0f172a;color:#e2e8f0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.85rem;box-sizing:border-box}.cb-terminal__welcome{margin-bottom:var(--cb-space-2);color:#94a3b8}.cb-terminal__entry{margin-bottom:.375rem}.cb-terminal__line,.cb-terminal__input-row{display:flex;align-items:center;gap:.5rem}.cb-terminal__prompt{color:#10b981;font-weight:600;white-space:nowrap}.cb-terminal__response{margin-top:.125rem;color:#cbd5e1;white-space:pre-wrap}.cb-terminal__input{flex:1;border:none;background:transparent;color:#f8fafc;font-family:inherit;font-size:inherit;outline:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -78,7 +111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
78
111
|
@if (welcomeMessage()) {
|
|
79
112
|
<div class="cb-terminal__welcome">{{ welcomeMessage() }}</div>
|
|
80
113
|
}
|
|
81
|
-
<div class="cb-terminal__history">
|
|
114
|
+
<div class="cb-terminal__history" role="log" aria-live="polite">
|
|
82
115
|
@for (entry of entries(); track $index) {
|
|
83
116
|
<div class="cb-terminal__entry">
|
|
84
117
|
<div class="cb-terminal__line">
|
|
@@ -94,16 +127,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
94
127
|
<div class="cb-terminal__input-row">
|
|
95
128
|
<span class="cb-terminal__prompt">{{ prompt() }}</span>
|
|
96
129
|
<input
|
|
130
|
+
#commandInput
|
|
97
131
|
type="text"
|
|
98
132
|
class="cb-terminal__input"
|
|
99
133
|
[value]="currentCommand()"
|
|
100
|
-
[attr.aria-label]="prompt() ||
|
|
134
|
+
[attr.aria-label]="prompt() || t().command"
|
|
101
135
|
(input)="onInput($event)"
|
|
102
136
|
(keydown.enter)="submitCommand()"
|
|
137
|
+
(keydown.arrowup)="recall($event, -1)"
|
|
138
|
+
(keydown.arrowdown)="recall($event, 1)"
|
|
103
139
|
/>
|
|
104
140
|
</div>
|
|
105
141
|
`, styles: [":host{display:block;width:100%;padding:var(--cb-space-4);border-radius:var(--cb-radius-lg);background:#0f172a;color:#e2e8f0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.85rem;box-sizing:border-box}.cb-terminal__welcome{margin-bottom:var(--cb-space-2);color:#94a3b8}.cb-terminal__entry{margin-bottom:.375rem}.cb-terminal__line,.cb-terminal__input-row{display:flex;align-items:center;gap:.5rem}.cb-terminal__prompt{color:#10b981;font-weight:600;white-space:nowrap}.cb-terminal__response{margin-top:.125rem;color:#cbd5e1;white-space:pre-wrap}.cb-terminal__input{flex:1;border:none;background:transparent;color:#f8fafc;font-family:inherit;font-size:inherit;outline:none}\n"] }]
|
|
106
|
-
}], propDecorators: { welcomeMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "welcomeMessage", required: false }] }], prompt: [{ type: i0.Input, args: [{ isSignal: true, alias: "prompt", required: false }] }], commandEntered: [{ type: i0.Output, args: ["commandEntered"] }] } });
|
|
142
|
+
}], propDecorators: { welcomeMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "welcomeMessage", required: false }] }], prompt: [{ type: i0.Input, args: [{ isSignal: true, alias: "prompt", required: false }] }], commandEntered: [{ type: i0.Output, args: ["commandEntered"] }], commandInput: [{ type: i0.ViewChild, args: ['commandInput', { isSignal: true }] }] } });
|
|
107
143
|
|
|
108
144
|
/**
|
|
109
145
|
* Generated bundle index. Do not edit.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation, CbThemeService } from '@caribeng/ui';
|
|
4
|
+
import { CbButton } from '@caribeng/ui/button';
|
|
5
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Botón de cambio de tema claro / oscuro sobre `CbThemeService` (con
|
|
9
|
+
* `provideCaribeNG({ persistTheme: true })` recuerda la elección).
|
|
10
|
+
*
|
|
11
|
+
* Su nombre accesible describe la acción ("Cambiar a tema oscuro"), por eso
|
|
12
|
+
* no usa `aria-pressed`.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <cb-theme-toggle />
|
|
17
|
+
* <cb-theme-toggle showLabel size="sm" />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
class CbThemeToggle {
|
|
21
|
+
constructor() {
|
|
22
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
23
|
+
this.t = injectCbTranslation();
|
|
24
|
+
this.theme = inject(CbThemeService);
|
|
25
|
+
this.size = input('md', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** Muestra el texto además del icono. */
|
|
28
|
+
this.showLabel = input(false, { ...(ngDevMode ? { debugName: "showLabel" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
29
|
+
/** Acción que hará el botón: cambiar al tema contrario al actual. */
|
|
30
|
+
this.label = computed(() => (this.theme.isDark() ? this.t().switchToLight : this.t().switchToDark), /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
32
|
+
}
|
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbThemeToggle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
34
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbThemeToggle, isStandalone: true, selector: "cb-theme-toggle", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-theme-toggle" }, ngImport: i0, template: `
|
|
35
|
+
<cb-button
|
|
36
|
+
variant="text"
|
|
37
|
+
severity="secondary"
|
|
38
|
+
[size]="size()"
|
|
39
|
+
[ariaLabel]="showLabel() ? undefined : label()"
|
|
40
|
+
(click)="theme.toggle()"
|
|
41
|
+
>
|
|
42
|
+
<cb-icon [name]="theme.isDark() ? 'sun' : 'moon'" [size]="18" aria-hidden="true" />
|
|
43
|
+
@if (showLabel()) {
|
|
44
|
+
{{ label() }}
|
|
45
|
+
}
|
|
46
|
+
</cb-button>
|
|
47
|
+
`, isInline: true, dependencies: [{ 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 }); }
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbThemeToggle, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{
|
|
52
|
+
selector: 'cb-theme-toggle',
|
|
53
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
54
|
+
encapsulation: ViewEncapsulation.Emulated,
|
|
55
|
+
imports: [CbButton, CbIcon],
|
|
56
|
+
host: { class: 'cb-theme-toggle' },
|
|
57
|
+
template: `
|
|
58
|
+
<cb-button
|
|
59
|
+
variant="text"
|
|
60
|
+
severity="secondary"
|
|
61
|
+
[size]="size()"
|
|
62
|
+
[ariaLabel]="showLabel() ? undefined : label()"
|
|
63
|
+
(click)="theme.toggle()"
|
|
64
|
+
>
|
|
65
|
+
<cb-icon [name]="theme.isDark() ? 'sun' : 'moon'" [size]="18" aria-hidden="true" />
|
|
66
|
+
@if (showLabel()) {
|
|
67
|
+
{{ label() }}
|
|
68
|
+
}
|
|
69
|
+
</cb-button>
|
|
70
|
+
`,
|
|
71
|
+
}]
|
|
72
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }] } });
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
* Public API Surface de @caribeng/ui/themetoggle
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generated bundle index. Do not edit.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
export { CbThemeToggle };
|
|
@@ -3,18 +3,21 @@ import { inject, ViewContainerRef, DestroyRef, input, output, signal, viewChild,
|
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
5
5
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
6
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
6
7
|
|
|
7
8
|
/** Popup menu with cascading submenus. */
|
|
8
9
|
class CbTieredMenu {
|
|
9
10
|
constructor() {
|
|
11
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
12
|
+
this.t = injectCbTranslation();
|
|
10
13
|
this.overlay = inject(Overlay);
|
|
11
14
|
this.vcr = inject(ViewContainerRef);
|
|
12
15
|
this.destroyRef = inject(DestroyRef);
|
|
13
16
|
this.items = input([], /* @ts-ignore */
|
|
14
17
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
15
|
-
this.ariaLabel = input(
|
|
18
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
16
19
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
17
|
-
this.triggerLabel = input(
|
|
20
|
+
this.triggerLabel = input(undefined, /* @ts-ignore */
|
|
18
21
|
...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
19
22
|
this.itemSelect = output();
|
|
20
23
|
this.isOpen = signal(false, /* @ts-ignore */
|
|
@@ -54,9 +57,9 @@ class CbTieredMenu {
|
|
|
54
57
|
hide() { this.overlayRef?.dispose(); this.overlayRef = null; this.isOpen.set(false); this.openIndex.set(null); this.openChildIndex.set(null); }
|
|
55
58
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTieredMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
59
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbTieredMenu, isStandalone: true, selector: "cb-tieredmenu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
57
|
-
<button class="cb-tieredmenu__trigger" type="button" [attr.aria-expanded]="isOpen()" aria-haspopup="menu" (click)="toggle($event)">{{ triggerLabel() }}</button>
|
|
60
|
+
<button class="cb-tieredmenu__trigger" type="button" [attr.aria-expanded]="isOpen()" aria-haspopup="menu" (click)="toggle($event)">{{ (triggerLabel() ?? t().menu) }}</button>
|
|
58
61
|
<ng-template #content>
|
|
59
|
-
<ul class="cb-tieredmenu__list" role="menu" [attr.aria-label]="ariaLabel()">
|
|
62
|
+
<ul class="cb-tieredmenu__list" role="menu" [attr.aria-label]="(ariaLabel() ?? t().menu)">
|
|
60
63
|
@for (item of items(); track $index; let i = $index) {
|
|
61
64
|
@if (item.separator) { <li class="cb-tieredmenu__separator" role="separator"></li> }
|
|
62
65
|
@else {
|
|
@@ -102,9 +105,9 @@ class CbTieredMenu {
|
|
|
102
105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTieredMenu, decorators: [{
|
|
103
106
|
type: Component,
|
|
104
107
|
args: [{ selector: 'cb-tieredmenu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], template: `
|
|
105
|
-
<button class="cb-tieredmenu__trigger" type="button" [attr.aria-expanded]="isOpen()" aria-haspopup="menu" (click)="toggle($event)">{{ triggerLabel() }}</button>
|
|
108
|
+
<button class="cb-tieredmenu__trigger" type="button" [attr.aria-expanded]="isOpen()" aria-haspopup="menu" (click)="toggle($event)">{{ (triggerLabel() ?? t().menu) }}</button>
|
|
106
109
|
<ng-template #content>
|
|
107
|
-
<ul class="cb-tieredmenu__list" role="menu" [attr.aria-label]="ariaLabel()">
|
|
110
|
+
<ul class="cb-tieredmenu__list" role="menu" [attr.aria-label]="(ariaLabel() ?? t().menu)">
|
|
108
111
|
@for (item of items(); track $index; let i = $index) {
|
|
109
112
|
@if (item.separator) { <li class="cb-tieredmenu__separator" role="separator"></li> }
|
|
110
113
|
@else {
|
|
@@ -1,25 +1,194 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, Directive, input, contentChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
5
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
3
6
|
|
|
7
|
+
/** Plantilla del contenido de cada evento. */
|
|
8
|
+
class CbTimelineContentTemplate {
|
|
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: CbTimelineContentTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
16
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbTimelineContentTemplate, isStandalone: true, selector: "ng-template[cbTimelineContent]", ngImport: i0 }); }
|
|
17
|
+
}
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimelineContentTemplate, decorators: [{
|
|
19
|
+
type: Directive,
|
|
20
|
+
args: [{ selector: 'ng-template[cbTimelineContent]' }]
|
|
21
|
+
}] });
|
|
22
|
+
/** Plantilla del lado opuesto al contenido (p. ej. la fecha). */
|
|
23
|
+
class CbTimelineOppositeTemplate {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.template = inject(TemplateRef);
|
|
26
|
+
}
|
|
27
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimelineOppositeTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
31
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbTimelineOppositeTemplate, isStandalone: true, selector: "ng-template[cbTimelineOpposite]", ngImport: i0 }); }
|
|
32
|
+
}
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimelineOppositeTemplate, decorators: [{
|
|
34
|
+
type: Directive,
|
|
35
|
+
args: [{ selector: 'ng-template[cbTimelineOpposite]' }]
|
|
36
|
+
}] });
|
|
37
|
+
/** Plantilla del marcador de cada evento. */
|
|
38
|
+
class CbTimelineMarkerTemplate {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.template = inject(TemplateRef);
|
|
41
|
+
}
|
|
42
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimelineMarkerTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
46
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbTimelineMarkerTemplate, isStandalone: true, selector: "ng-template[cbTimelineMarker]", ngImport: i0 }); }
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimelineMarkerTemplate, decorators: [{
|
|
49
|
+
type: Directive,
|
|
50
|
+
args: [{ selector: 'ng-template[cbTimelineMarker]' }]
|
|
51
|
+
}] });
|
|
52
|
+
/**
|
|
53
|
+
* Línea de tiempo de CaribeNG: eventos en vertical u horizontal, alineados a
|
|
54
|
+
* un lado o alternados, con plantillas para el contenido, el lado opuesto y
|
|
55
|
+
* el marcador.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```html
|
|
59
|
+
* <cb-timeline [value]="eventos" align="alternate" />
|
|
60
|
+
*
|
|
61
|
+
* <cb-timeline [value]="eventos">
|
|
62
|
+
* <ng-template cbTimelineContent let-evento>{{ evento.title }}</ng-template>
|
|
63
|
+
* </cb-timeline>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
4
66
|
class CbTimeline {
|
|
5
67
|
constructor() {
|
|
68
|
+
this.t = injectCbTranslation();
|
|
69
|
+
/** Eventos, en orden. */
|
|
6
70
|
this.value = input([], /* @ts-ignore */
|
|
7
71
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
72
|
+
/** Disposición: vertical (por defecto) u horizontal. */
|
|
8
73
|
this.orientation = input('vertical', /* @ts-ignore */
|
|
9
74
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
10
|
-
|
|
75
|
+
/** Lado del contenido respecto a la línea: izquierda, derecha o alternado. */
|
|
76
|
+
this.align = input('left', /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
78
|
+
/** Nombre accesible de la lista. Por defecto, el del idioma activo. */
|
|
79
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
11
80
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
81
|
+
this.contentTemplate = contentChild(CbTimelineContentTemplate, /* @ts-ignore */
|
|
82
|
+
...(ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []));
|
|
83
|
+
this.oppositeTemplate = contentChild(CbTimelineOppositeTemplate, /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "oppositeTemplate" }] : /* istanbul ignore next */ []));
|
|
85
|
+
this.markerTemplate = contentChild(CbTimelineMarkerTemplate, /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "markerTemplate" }] : /* istanbul ignore next */ []));
|
|
12
87
|
}
|
|
13
88
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimeline, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbTimeline, isStandalone: true, selector: "cb-timeline", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null },
|
|
89
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbTimeline, isStandalone: true, selector: "cb-timeline", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-timeline-host" }, queries: [{ propertyName: "contentTemplate", first: true, predicate: CbTimelineContentTemplate, descendants: true, isSignal: true }, { propertyName: "oppositeTemplate", first: true, predicate: CbTimelineOppositeTemplate, descendants: true, isSignal: true }, { propertyName: "markerTemplate", first: true, predicate: CbTimelineMarkerTemplate, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
90
|
+
<ol
|
|
91
|
+
class="cb-timeline"
|
|
92
|
+
[class]="'cb-timeline cb-timeline--' + orientation() + ' cb-timeline--' + align()"
|
|
93
|
+
[attr.aria-label]="ariaLabel() ?? t().timeline"
|
|
94
|
+
>
|
|
95
|
+
@for (event of value(); track $index; let i = $index; let last = $last) {
|
|
96
|
+
<li class="cb-timeline__event" [class.cb-timeline__event--alt]="align() === 'alternate' && i % 2 === 1">
|
|
97
|
+
<div class="cb-timeline__opposite">
|
|
98
|
+
@if (oppositeTemplate(); as tpl) {
|
|
99
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: event, index: i }" />
|
|
100
|
+
}
|
|
101
|
+
</div>
|
|
102
|
+
<div class="cb-timeline__separator" aria-hidden="true">
|
|
103
|
+
@if (markerTemplate(); as tpl) {
|
|
104
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: event, index: i }" />
|
|
105
|
+
} @else {
|
|
106
|
+
<span
|
|
107
|
+
class="cb-timeline__marker"
|
|
108
|
+
[class.cb-timeline__marker--icon]="!!event.icon"
|
|
109
|
+
[style.--cb-timeline-color]="event.color || null"
|
|
110
|
+
>
|
|
111
|
+
@if (event.icon) {
|
|
112
|
+
<cb-icon [name]="event.icon" [size]="14" />
|
|
113
|
+
}
|
|
114
|
+
</span>
|
|
115
|
+
}
|
|
116
|
+
@if (!last) {
|
|
117
|
+
<span class="cb-timeline__connector"></span>
|
|
118
|
+
}
|
|
119
|
+
</div>
|
|
120
|
+
<div class="cb-timeline__content">
|
|
121
|
+
@if (contentTemplate(); as tpl) {
|
|
122
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: event, index: i }" />
|
|
123
|
+
} @else {
|
|
124
|
+
@if (event.date) {
|
|
125
|
+
<time class="cb-timeline__date" [attr.datetime]="event.datetime || null">{{ event.date }}</time>
|
|
126
|
+
}
|
|
127
|
+
<strong class="cb-timeline__title">{{ event.title }}</strong>
|
|
128
|
+
@if (event.description) {
|
|
129
|
+
<p class="cb-timeline__description">{{ event.description }}</p>
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</div>
|
|
133
|
+
</li>
|
|
134
|
+
}
|
|
135
|
+
</ol>
|
|
136
|
+
`, isInline: true, styles: [":host{display:block;color:var(--cb-color-text);--cb-timeline-color: var(--cb-color-primary-500)}.cb-timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.cb-timeline__event{display:flex;gap:var(--cb-space-3, .75rem);min-height:4.5rem}.cb-timeline__opposite,.cb-timeline__content{flex:1;min-width:0;padding-bottom:var(--cb-space-4, 1rem)}.cb-timeline--left .cb-timeline__opposite:empty,.cb-timeline--right .cb-timeline__opposite:empty{display:none}.cb-timeline--left .cb-timeline__opposite{flex:0 0 auto;text-align:right}.cb-timeline--right .cb-timeline__event{flex-direction:row-reverse}.cb-timeline--right .cb-timeline__content{text-align:right}.cb-timeline--right .cb-timeline__opposite{flex:0 0 auto}.cb-timeline--alternate .cb-timeline__opposite{text-align:right}.cb-timeline--alternate .cb-timeline__event--alt{flex-direction:row-reverse}.cb-timeline--alternate .cb-timeline__event--alt .cb-timeline__opposite{text-align:left}.cb-timeline--alternate .cb-timeline__event--alt .cb-timeline__content{text-align:right}.cb-timeline__separator{display:flex;flex-direction:column;align-items:center;flex:none}.cb-timeline__marker{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:.875rem;height:.875rem;margin-top:.2rem;border-radius:50%;background:var(--cb-timeline-color);color:#fff;box-shadow:0 0 0 3px var(--cb-color-bg, #fff),0 0 0 4px var(--cb-color-border)}.cb-timeline__marker--icon{width:1.75rem;height:1.75rem;margin-top:0}.cb-timeline__connector{flex:1;width:2px;margin:.25rem 0;background:var(--cb-color-border)}.cb-timeline__date{display:block;color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem)}.cb-timeline__title{display:block;color:var(--cb-color-text-strong)}.cb-timeline__description{margin:.25rem 0 0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem)}.cb-timeline--horizontal{flex-direction:row;overflow-x:auto}.cb-timeline--horizontal .cb-timeline__event{flex:1 0 10rem;flex-direction:column;min-height:0;gap:var(--cb-space-2, .5rem)}.cb-timeline--horizontal .cb-timeline__event--alt{flex-direction:column-reverse}.cb-timeline--horizontal .cb-timeline__opposite,.cb-timeline--horizontal .cb-timeline__content{flex:0 0 auto;padding-bottom:0;padding-inline-end:var(--cb-space-3, .75rem);text-align:left}.cb-timeline--horizontal .cb-timeline__separator{flex-direction:row}.cb-timeline--horizontal .cb-timeline__marker{margin-top:0}.cb-timeline--horizontal .cb-timeline__connector{width:auto;height:2px;margin:0 .25rem}\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 }); }
|
|
15
137
|
}
|
|
16
138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbTimeline, decorators: [{
|
|
17
139
|
type: Component,
|
|
18
|
-
args: [{ selector: 'cb-timeline',
|
|
19
|
-
|
|
140
|
+
args: [{ selector: 'cb-timeline', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [NgTemplateOutlet, CbIcon], host: { class: 'cb-timeline-host' }, template: `
|
|
141
|
+
<ol
|
|
142
|
+
class="cb-timeline"
|
|
143
|
+
[class]="'cb-timeline cb-timeline--' + orientation() + ' cb-timeline--' + align()"
|
|
144
|
+
[attr.aria-label]="ariaLabel() ?? t().timeline"
|
|
145
|
+
>
|
|
146
|
+
@for (event of value(); track $index; let i = $index; let last = $last) {
|
|
147
|
+
<li class="cb-timeline__event" [class.cb-timeline__event--alt]="align() === 'alternate' && i % 2 === 1">
|
|
148
|
+
<div class="cb-timeline__opposite">
|
|
149
|
+
@if (oppositeTemplate(); as tpl) {
|
|
150
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: event, index: i }" />
|
|
151
|
+
}
|
|
152
|
+
</div>
|
|
153
|
+
<div class="cb-timeline__separator" aria-hidden="true">
|
|
154
|
+
@if (markerTemplate(); as tpl) {
|
|
155
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: event, index: i }" />
|
|
156
|
+
} @else {
|
|
157
|
+
<span
|
|
158
|
+
class="cb-timeline__marker"
|
|
159
|
+
[class.cb-timeline__marker--icon]="!!event.icon"
|
|
160
|
+
[style.--cb-timeline-color]="event.color || null"
|
|
161
|
+
>
|
|
162
|
+
@if (event.icon) {
|
|
163
|
+
<cb-icon [name]="event.icon" [size]="14" />
|
|
164
|
+
}
|
|
165
|
+
</span>
|
|
166
|
+
}
|
|
167
|
+
@if (!last) {
|
|
168
|
+
<span class="cb-timeline__connector"></span>
|
|
169
|
+
}
|
|
170
|
+
</div>
|
|
171
|
+
<div class="cb-timeline__content">
|
|
172
|
+
@if (contentTemplate(); as tpl) {
|
|
173
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: event, index: i }" />
|
|
174
|
+
} @else {
|
|
175
|
+
@if (event.date) {
|
|
176
|
+
<time class="cb-timeline__date" [attr.datetime]="event.datetime || null">{{ event.date }}</time>
|
|
177
|
+
}
|
|
178
|
+
<strong class="cb-timeline__title">{{ event.title }}</strong>
|
|
179
|
+
@if (event.description) {
|
|
180
|
+
<p class="cb-timeline__description">{{ event.description }}</p>
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
</div>
|
|
184
|
+
</li>
|
|
185
|
+
}
|
|
186
|
+
</ol>
|
|
187
|
+
`, styles: [":host{display:block;color:var(--cb-color-text);--cb-timeline-color: var(--cb-color-primary-500)}.cb-timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.cb-timeline__event{display:flex;gap:var(--cb-space-3, .75rem);min-height:4.5rem}.cb-timeline__opposite,.cb-timeline__content{flex:1;min-width:0;padding-bottom:var(--cb-space-4, 1rem)}.cb-timeline--left .cb-timeline__opposite:empty,.cb-timeline--right .cb-timeline__opposite:empty{display:none}.cb-timeline--left .cb-timeline__opposite{flex:0 0 auto;text-align:right}.cb-timeline--right .cb-timeline__event{flex-direction:row-reverse}.cb-timeline--right .cb-timeline__content{text-align:right}.cb-timeline--right .cb-timeline__opposite{flex:0 0 auto}.cb-timeline--alternate .cb-timeline__opposite{text-align:right}.cb-timeline--alternate .cb-timeline__event--alt{flex-direction:row-reverse}.cb-timeline--alternate .cb-timeline__event--alt .cb-timeline__opposite{text-align:left}.cb-timeline--alternate .cb-timeline__event--alt .cb-timeline__content{text-align:right}.cb-timeline__separator{display:flex;flex-direction:column;align-items:center;flex:none}.cb-timeline__marker{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:.875rem;height:.875rem;margin-top:.2rem;border-radius:50%;background:var(--cb-timeline-color);color:#fff;box-shadow:0 0 0 3px var(--cb-color-bg, #fff),0 0 0 4px var(--cb-color-border)}.cb-timeline__marker--icon{width:1.75rem;height:1.75rem;margin-top:0}.cb-timeline__connector{flex:1;width:2px;margin:.25rem 0;background:var(--cb-color-border)}.cb-timeline__date{display:block;color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem)}.cb-timeline__title{display:block;color:var(--cb-color-text-strong)}.cb-timeline__description{margin:.25rem 0 0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem)}.cb-timeline--horizontal{flex-direction:row;overflow-x:auto}.cb-timeline--horizontal .cb-timeline__event{flex:1 0 10rem;flex-direction:column;min-height:0;gap:var(--cb-space-2, .5rem)}.cb-timeline--horizontal .cb-timeline__event--alt{flex-direction:column-reverse}.cb-timeline--horizontal .cb-timeline__opposite,.cb-timeline--horizontal .cb-timeline__content{flex:0 0 auto;padding-bottom:0;padding-inline-end:var(--cb-space-3, .75rem);text-align:left}.cb-timeline--horizontal .cb-timeline__separator{flex-direction:row}.cb-timeline--horizontal .cb-timeline__marker{margin-top:0}.cb-timeline--horizontal .cb-timeline__connector{width:auto;height:2px;margin:0 .25rem}\n"] }]
|
|
188
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], contentTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbTimelineContentTemplate), { isSignal: true }] }], oppositeTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbTimelineOppositeTemplate), { isSignal: true }] }], markerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbTimelineMarkerTemplate), { isSignal: true }] }] } });
|
|
20
189
|
|
|
21
190
|
/**
|
|
22
191
|
* Generated bundle index. Do not edit.
|
|
23
192
|
*/
|
|
24
193
|
|
|
25
|
-
export { CbTimeline };
|
|
194
|
+
export { CbTimeline, CbTimelineContentTemplate, CbTimelineMarkerTemplate, CbTimelineOppositeTemplate };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, Injectable, inject, input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
3
4
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
5
|
|
|
5
6
|
let nextId = 0;
|
|
@@ -94,6 +95,8 @@ const ICONS = {
|
|
|
94
95
|
*/
|
|
95
96
|
class CbToast {
|
|
96
97
|
constructor() {
|
|
98
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
99
|
+
this.t = injectCbTranslation();
|
|
97
100
|
this.service = inject(CbToastService);
|
|
98
101
|
this.position = input('top-right', /* @ts-ignore */
|
|
99
102
|
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
@@ -125,7 +128,7 @@ class CbToast {
|
|
|
125
128
|
<button
|
|
126
129
|
type="button"
|
|
127
130
|
class="cb-toast__close"
|
|
128
|
-
aria-label="
|
|
131
|
+
[attr.aria-label]="t().close"
|
|
129
132
|
(click)="service.remove(toast.id)"
|
|
130
133
|
>
|
|
131
134
|
<cb-icon name="x" size="sm" />
|
|
@@ -134,7 +137,7 @@ class CbToast {
|
|
|
134
137
|
</div>
|
|
135
138
|
}
|
|
136
139
|
</div>
|
|
137
|
-
`, isInline: true, styles: [":host{display:contents}.cb-toast-wrap{position:fixed;z-index:var(--cb-z-toast);display:flex;flex-direction:column;gap:var(--cb-space-3);width:22rem;max-width:calc(100vw - 2 * var(--cb-space-4));pointer-events:none}.cb-toast-wrap--top-right{top:var(--cb-space-5);right:var(--cb-space-5)}.cb-toast-wrap--top-left{top:var(--cb-space-5);left:var(--cb-space-5)}.cb-toast-wrap--top-center{top:var(--cb-space-5);left:50%;transform:translate(-50%)}.cb-toast-wrap--bottom-right{bottom:var(--cb-space-5);right:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-left{bottom:var(--cb-space-5);left:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-center{bottom:var(--cb-space-5);left:50%;transform:translate(-50%);flex-direction:column-reverse}.cb-toast{--_accent: var(--cb-color-info-500);pointer-events:auto;display:flex;align-items:flex-start;gap:var(--cb-space-3);padding:var(--cb-space-4);background:var(--cb-color-surface-raised);color:var(--cb-color-text);border:1px solid var(--cb-color-border);border-left:4px solid var(--_accent);border-radius:var(--cb-radius-md);box-shadow:var(--cb-shadow-lg);font-family:var(--cb-font-sans);animation:cb-toast-in var(--cb-duration-normal) var(--cb-ease-out)}.cb-toast--success{--_accent: var(--cb-color-success-500)}.cb-toast--info{--_accent: var(--cb-color-info-500)}.cb-toast--warning{--_accent: var(--cb-color-warning-500)}.cb-toast--danger{--_accent: var(--cb-color-danger-500)}.cb-toast--help{--_accent: var(--cb-color-help-500)}.cb-toast--primary{--_accent: var(--cb-color-primary-500)}.cb-toast--secondary{--_accent: var(--cb-color-surface-500)}.cb-toast--contrast{--_accent: var(--cb-color-surface-900)}.cb-toast__icon{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border-radius:var(--cb-radius-full);background:color-mix(in srgb,var(--_accent) 16%,transparent);color:var(--_accent);font-weight:var(--cb-font-weight-bold);font-size:var(--cb-text-sm)}.cb-toast__content{flex:1 1 auto;min-width:0}.cb-toast__summary{margin:0;font-weight:var(--cb-font-weight-semibold);color:var(--cb-color-text-strong)}.cb-toast__detail{margin:var(--cb-space-1) 0 0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-toast__close{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border:none;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-toast__close:hover{background:var(--cb-color-surface-
|
|
140
|
+
`, isInline: true, styles: [":host{display:contents}.cb-toast-wrap{position:fixed;z-index:var(--cb-z-toast);display:flex;flex-direction:column;gap:var(--cb-space-3);width:22rem;max-width:calc(100vw - 2 * var(--cb-space-4));pointer-events:none}.cb-toast-wrap--top-right{top:var(--cb-space-5);right:var(--cb-space-5)}.cb-toast-wrap--top-left{top:var(--cb-space-5);left:var(--cb-space-5)}.cb-toast-wrap--top-center{top:var(--cb-space-5);left:50%;transform:translate(-50%)}.cb-toast-wrap--bottom-right{bottom:var(--cb-space-5);right:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-left{bottom:var(--cb-space-5);left:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-center{bottom:var(--cb-space-5);left:50%;transform:translate(-50%);flex-direction:column-reverse}.cb-toast{--_accent: var(--cb-color-info-500);pointer-events:auto;display:flex;align-items:flex-start;gap:var(--cb-space-3);padding:var(--cb-space-4);background:var(--cb-color-surface-raised);color:var(--cb-color-text);border:1px solid var(--cb-color-border);border-left:4px solid var(--_accent);border-radius:var(--cb-radius-md);box-shadow:var(--cb-shadow-lg);font-family:var(--cb-font-sans);animation:cb-toast-in var(--cb-duration-normal) var(--cb-ease-out)}.cb-toast--success{--_accent: var(--cb-color-success-500)}.cb-toast--info{--_accent: var(--cb-color-info-500)}.cb-toast--warning{--_accent: var(--cb-color-warning-500)}.cb-toast--danger{--_accent: var(--cb-color-danger-500)}.cb-toast--help{--_accent: var(--cb-color-help-500)}.cb-toast--primary{--_accent: var(--cb-color-primary-500)}.cb-toast--secondary{--_accent: var(--cb-color-surface-500)}.cb-toast--contrast{--_accent: var(--cb-color-surface-900)}.cb-toast__icon{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border-radius:var(--cb-radius-full);background:color-mix(in srgb,var(--_accent) 16%,transparent);color:var(--_accent);font-weight:var(--cb-font-weight-bold);font-size:var(--cb-text-sm)}.cb-toast__content{flex:1 1 auto;min-width:0}.cb-toast__summary{margin:0;font-weight:var(--cb-font-weight-semibold);color:var(--cb-color-text-strong)}.cb-toast__detail{margin:var(--cb-space-1) 0 0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-toast__close{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border:none;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-toast__close:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-toast__close:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}@keyframes cb-toast-in{0%{opacity:0;transform:translate(16px)}to{opacity:1;transform:translate(0)}}@media(prefers-reduced-motion:reduce){.cb-toast{animation:none}}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
138
141
|
}
|
|
139
142
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbToast, decorators: [{
|
|
140
143
|
type: Component,
|
|
@@ -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-toast__close"
|
|
164
|
-
aria-label="
|
|
167
|
+
[attr.aria-label]="t().close"
|
|
165
168
|
(click)="service.remove(toast.id)"
|
|
166
169
|
>
|
|
167
170
|
<cb-icon name="x" size="sm" />
|
|
@@ -170,7 +173,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
170
173
|
</div>
|
|
171
174
|
}
|
|
172
175
|
</div>
|
|
173
|
-
`, styles: [":host{display:contents}.cb-toast-wrap{position:fixed;z-index:var(--cb-z-toast);display:flex;flex-direction:column;gap:var(--cb-space-3);width:22rem;max-width:calc(100vw - 2 * var(--cb-space-4));pointer-events:none}.cb-toast-wrap--top-right{top:var(--cb-space-5);right:var(--cb-space-5)}.cb-toast-wrap--top-left{top:var(--cb-space-5);left:var(--cb-space-5)}.cb-toast-wrap--top-center{top:var(--cb-space-5);left:50%;transform:translate(-50%)}.cb-toast-wrap--bottom-right{bottom:var(--cb-space-5);right:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-left{bottom:var(--cb-space-5);left:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-center{bottom:var(--cb-space-5);left:50%;transform:translate(-50%);flex-direction:column-reverse}.cb-toast{--_accent: var(--cb-color-info-500);pointer-events:auto;display:flex;align-items:flex-start;gap:var(--cb-space-3);padding:var(--cb-space-4);background:var(--cb-color-surface-raised);color:var(--cb-color-text);border:1px solid var(--cb-color-border);border-left:4px solid var(--_accent);border-radius:var(--cb-radius-md);box-shadow:var(--cb-shadow-lg);font-family:var(--cb-font-sans);animation:cb-toast-in var(--cb-duration-normal) var(--cb-ease-out)}.cb-toast--success{--_accent: var(--cb-color-success-500)}.cb-toast--info{--_accent: var(--cb-color-info-500)}.cb-toast--warning{--_accent: var(--cb-color-warning-500)}.cb-toast--danger{--_accent: var(--cb-color-danger-500)}.cb-toast--help{--_accent: var(--cb-color-help-500)}.cb-toast--primary{--_accent: var(--cb-color-primary-500)}.cb-toast--secondary{--_accent: var(--cb-color-surface-500)}.cb-toast--contrast{--_accent: var(--cb-color-surface-900)}.cb-toast__icon{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border-radius:var(--cb-radius-full);background:color-mix(in srgb,var(--_accent) 16%,transparent);color:var(--_accent);font-weight:var(--cb-font-weight-bold);font-size:var(--cb-text-sm)}.cb-toast__content{flex:1 1 auto;min-width:0}.cb-toast__summary{margin:0;font-weight:var(--cb-font-weight-semibold);color:var(--cb-color-text-strong)}.cb-toast__detail{margin:var(--cb-space-1) 0 0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-toast__close{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border:none;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-toast__close:hover{background:var(--cb-color-surface-
|
|
176
|
+
`, styles: [":host{display:contents}.cb-toast-wrap{position:fixed;z-index:var(--cb-z-toast);display:flex;flex-direction:column;gap:var(--cb-space-3);width:22rem;max-width:calc(100vw - 2 * var(--cb-space-4));pointer-events:none}.cb-toast-wrap--top-right{top:var(--cb-space-5);right:var(--cb-space-5)}.cb-toast-wrap--top-left{top:var(--cb-space-5);left:var(--cb-space-5)}.cb-toast-wrap--top-center{top:var(--cb-space-5);left:50%;transform:translate(-50%)}.cb-toast-wrap--bottom-right{bottom:var(--cb-space-5);right:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-left{bottom:var(--cb-space-5);left:var(--cb-space-5);flex-direction:column-reverse}.cb-toast-wrap--bottom-center{bottom:var(--cb-space-5);left:50%;transform:translate(-50%);flex-direction:column-reverse}.cb-toast{--_accent: var(--cb-color-info-500);pointer-events:auto;display:flex;align-items:flex-start;gap:var(--cb-space-3);padding:var(--cb-space-4);background:var(--cb-color-surface-raised);color:var(--cb-color-text);border:1px solid var(--cb-color-border);border-left:4px solid var(--_accent);border-radius:var(--cb-radius-md);box-shadow:var(--cb-shadow-lg);font-family:var(--cb-font-sans);animation:cb-toast-in var(--cb-duration-normal) var(--cb-ease-out)}.cb-toast--success{--_accent: var(--cb-color-success-500)}.cb-toast--info{--_accent: var(--cb-color-info-500)}.cb-toast--warning{--_accent: var(--cb-color-warning-500)}.cb-toast--danger{--_accent: var(--cb-color-danger-500)}.cb-toast--help{--_accent: var(--cb-color-help-500)}.cb-toast--primary{--_accent: var(--cb-color-primary-500)}.cb-toast--secondary{--_accent: var(--cb-color-surface-500)}.cb-toast--contrast{--_accent: var(--cb-color-surface-900)}.cb-toast__icon{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border-radius:var(--cb-radius-full);background:color-mix(in srgb,var(--_accent) 16%,transparent);color:var(--_accent);font-weight:var(--cb-font-weight-bold);font-size:var(--cb-text-sm)}.cb-toast__content{flex:1 1 auto;min-width:0}.cb-toast__summary{margin:0;font-weight:var(--cb-font-weight-semibold);color:var(--cb-color-text-strong)}.cb-toast__detail{margin:var(--cb-space-1) 0 0;font-size:var(--cb-text-sm);color:var(--cb-color-text-muted)}.cb-toast__close{flex:none;display:grid;place-items:center;width:1.5rem;height:1.5rem;border:none;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-toast__close:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-toast__close:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}@keyframes cb-toast-in{0%{opacity:0;transform:translate(16px)}to{opacity:1;transform:translate(0)}}@media(prefers-reduced-motion:reduce){.cb-toast{animation:none}}\n"] }]
|
|
174
177
|
}], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
|
|
175
178
|
|
|
176
179
|
/*
|