@caribeng/ui 22.4.0 → 22.5.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 +311 -313
- package/fesm2022/caribeng-ui-account-picker.mjs +533 -0
- package/fesm2022/caribeng-ui-aging.mjs +488 -0
- package/fesm2022/{caribeng-ui-caribe-alert.mjs → caribeng-ui-alert.mjs} +45 -45
- package/fesm2022/caribeng-ui-amount.mjs +249 -0
- package/fesm2022/caribeng-ui-anchor.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-animation-lottie.mjs → caribeng-ui-animation-lottie.mjs} +41 -41
- package/fesm2022/caribeng-ui-audit-log.mjs +323 -0
- package/fesm2022/caribeng-ui-avatar.mjs +2 -2
- package/fesm2022/caribeng-ui-breadcrumb.mjs +13 -3
- package/fesm2022/{caribeng-ui-caribe-button-group.mjs → caribeng-ui-button-group.mjs} +15 -15
- package/fesm2022/caribeng-ui-button.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-card-content.mjs → caribeng-ui-card-content.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-card-move.mjs → caribeng-ui-card-move.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-card-primary.mjs → caribeng-ui-card-primary.mjs} +31 -31
- package/fesm2022/{caribeng-ui-caribe-card-select.mjs → caribeng-ui-card-select.mjs} +67 -67
- package/fesm2022/caribeng-ui-carousel.mjs +2 -2
- package/fesm2022/caribeng-ui-cascadeselect.mjs +45 -9
- package/fesm2022/caribeng-ui-chat.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-coachmark.mjs → caribeng-ui-coachmark.mjs} +85 -85
- package/fesm2022/caribeng-ui-command-palette.mjs +2 -2
- package/fesm2022/caribeng-ui-comments.mjs +864 -0
- package/fesm2022/caribeng-ui-datagrid.mjs +1635 -0
- package/fesm2022/caribeng-ui-dataview.mjs +2 -2
- package/fesm2022/caribeng-ui-datepicker.mjs +2 -2
- package/fesm2022/caribeng-ui-document.mjs +495 -0
- package/fesm2022/{caribeng-ui-caribe-dots-indicator.mjs → caribeng-ui-dots-indicator.mjs} +41 -41
- package/fesm2022/caribeng-ui-dynamic-form.mjs +1581 -0
- package/fesm2022/caribeng-ui-editor.mjs +2303 -1311
- package/fesm2022/{caribeng-ui-caribe-expansion-panel.mjs → caribeng-ui-expansion-panel.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-fab-menu.mjs → caribeng-ui-fab-menu.mjs} +75 -75
- package/fesm2022/caribeng-ui-file-card.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-file-download.mjs → caribeng-ui-file-download.mjs} +63 -63
- package/fesm2022/caribeng-ui-financial-report.mjs +380 -0
- package/fesm2022/{caribeng-ui-caribe-float-menu.mjs → caribeng-ui-float-menu.mjs} +31 -31
- package/fesm2022/caribeng-ui-floatlabel.mjs +2 -2
- package/fesm2022/caribeng-ui-flow.mjs +1508 -0
- package/fesm2022/{caribeng-ui-caribe-footer.mjs → caribeng-ui-footer.mjs} +19 -19
- package/fesm2022/caribeng-ui-gantt.mjs +1094 -0
- package/fesm2022/{caribeng-ui-caribe-header.mjs → caribeng-ui-header.mjs} +49 -49
- package/fesm2022/{caribeng-ui-caribe-icon-button.mjs → caribeng-ui-icon-button.mjs} +23 -23
- package/fesm2022/caribeng-ui-image-cropper.mjs +671 -0
- package/fesm2022/caribeng-ui-import-wizard.mjs +746 -0
- package/fesm2022/caribeng-ui-infinite-scroll.mjs +226 -0
- package/fesm2022/caribeng-ui-input-number.mjs +22 -6
- package/fesm2022/{caribeng-ui-caribe-input-search.mjs → caribeng-ui-input-search.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-input-token.mjs → caribeng-ui-input-token.mjs} +59 -59
- package/fesm2022/caribeng-ui-inputotp.mjs +2 -2
- package/fesm2022/caribeng-ui-journal-entry.mjs +340 -0
- package/fesm2022/caribeng-ui-kanban.mjs +6 -6
- package/fesm2022/caribeng-ui-kpi.mjs +189 -0
- package/fesm2022/{caribeng-ui-caribe-link.mjs → caribeng-ui-link.mjs} +37 -37
- package/fesm2022/caribeng-ui-masonry.mjs +93 -0
- package/fesm2022/caribeng-ui-media-player.mjs +821 -0
- package/fesm2022/caribeng-ui-mentions.mjs +2 -2
- package/fesm2022/caribeng-ui-notification-center.mjs +636 -0
- package/fesm2022/{caribeng-ui-caribe-off-canvas.mjs → caribeng-ui-off-canvas.mjs} +55 -55
- package/fesm2022/{caribeng-ui-caribe-onboarding.mjs → caribeng-ui-onboarding.mjs} +105 -105
- package/fesm2022/caribeng-ui-orderlist.mjs +2 -2
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1755 -25
- package/fesm2022/caribeng-ui-period-picker.mjs +637 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +2 -2
- package/fesm2022/caribeng-ui-picklist.mjs +2 -2
- package/fesm2022/caribeng-ui-pivot.mjs +419 -0
- package/fesm2022/caribeng-ui-pricing.mjs +2 -2
- package/fesm2022/caribeng-ui-rating.mjs +14 -17
- package/fesm2022/caribeng-ui-reconciliation.mjs +386 -0
- package/fesm2022/caribeng-ui-scheduler.mjs +1027 -0
- package/fesm2022/caribeng-ui-select.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-shortcut.mjs → caribeng-ui-shortcut.mjs} +29 -29
- package/fesm2022/caribeng-ui-sidebar.mjs +2 -2
- package/fesm2022/caribeng-ui-signature-pad.mjs +654 -0
- package/fesm2022/{caribeng-ui-caribe-status.mjs → caribeng-ui-status.mjs} +11 -11
- package/fesm2022/{caribeng-ui-caribe-step-indicator.mjs → caribeng-ui-step-indicator.mjs} +53 -53
- package/fesm2022/caribeng-ui-stepper.mjs +2 -2
- package/fesm2022/caribeng-ui-steps.mjs +2 -2
- package/fesm2022/caribeng-ui-table.mjs +323 -15
- package/fesm2022/caribeng-ui-tabmenu.mjs +2 -2
- package/fesm2022/caribeng-ui-tabs.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-tag-button.mjs → caribeng-ui-tag-button.mjs} +25 -25
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-tieredmenu.mjs +6 -6
- package/fesm2022/{caribeng-ui-caribe-tracker.mjs → caribeng-ui-tracker.mjs} +29 -29
- package/fesm2022/{caribeng-ui-caribe-transaction-status.mjs → caribeng-ui-transaction-status.mjs} +11 -11
- package/fesm2022/caribeng-ui-treeselect.mjs +44 -9
- package/fesm2022/caribeng-ui-treetable.mjs +236 -17
- package/fesm2022/{caribeng-ui-caribe-voucher.mjs → caribeng-ui-voucher.mjs} +45 -45
- package/fesm2022/caribeng-ui-xlsx.mjs +486 -0
- package/fesm2022/caribeng-ui.mjs +1181 -1
- package/package.json +217 -177
- package/types/caribeng-ui-account-picker.d.ts +142 -0
- package/types/caribeng-ui-aging.d.ts +123 -0
- package/types/{caribeng-ui-caribe-alert.d.ts → caribeng-ui-alert.d.ts} +2 -2
- package/types/caribeng-ui-amount.d.ts +82 -0
- package/types/{caribeng-ui-caribe-animation-lottie.d.ts → caribeng-ui-animation-lottie.d.ts} +2 -2
- package/types/caribeng-ui-audit-log.d.ts +86 -0
- package/types/caribeng-ui-breadcrumb.d.ts +2 -2
- package/types/{caribeng-ui-caribe-button-group.d.ts → caribeng-ui-button-group.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-content.d.ts → caribeng-ui-card-content.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-move.d.ts → caribeng-ui-card-move.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-card-primary.d.ts → caribeng-ui-card-primary.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-select.d.ts → caribeng-ui-card-select.d.ts} +2 -2
- package/types/caribeng-ui-cascadeselect.d.ts +6 -0
- package/types/{caribeng-ui-caribe-coachmark.d.ts → caribeng-ui-coachmark.d.ts} +2 -2
- package/types/caribeng-ui-comments.d.ts +214 -0
- package/types/caribeng-ui-datagrid.d.ts +269 -0
- package/types/caribeng-ui-document.d.ts +138 -0
- package/types/{caribeng-ui-caribe-dots-indicator.d.ts → caribeng-ui-dots-indicator.d.ts} +2 -2
- package/types/caribeng-ui-dynamic-form.d.ts +409 -0
- package/types/caribeng-ui-editor.d.ts +110 -12
- package/types/{caribeng-ui-caribe-expansion-panel.d.ts → caribeng-ui-expansion-panel.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-fab-menu.d.ts → caribeng-ui-fab-menu.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-file-download.d.ts → caribeng-ui-file-download.d.ts} +1 -1
- package/types/caribeng-ui-financial-report.d.ts +102 -0
- package/types/{caribeng-ui-caribe-float-menu.d.ts → caribeng-ui-float-menu.d.ts} +2 -2
- package/types/caribeng-ui-flow.d.ts +228 -0
- package/types/{caribeng-ui-caribe-footer.d.ts → caribeng-ui-footer.d.ts} +2 -2
- package/types/caribeng-ui-gantt.d.ts +244 -0
- package/types/{caribeng-ui-caribe-header.d.ts → caribeng-ui-header.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-icon-button.d.ts → caribeng-ui-icon-button.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-illustration.d.ts → caribeng-ui-illustration.d.ts} +1 -1
- package/types/caribeng-ui-image-cropper.d.ts +169 -0
- package/types/caribeng-ui-import-wizard.d.ts +149 -0
- package/types/caribeng-ui-infinite-scroll.d.ts +75 -0
- package/types/caribeng-ui-input-number.d.ts +1 -1
- package/types/{caribeng-ui-caribe-input-search.d.ts → caribeng-ui-input-search.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-input-token.d.ts → caribeng-ui-input-token.d.ts} +2 -2
- package/types/caribeng-ui-journal-entry.d.ts +110 -0
- package/types/caribeng-ui-kpi.d.ts +64 -0
- package/types/{caribeng-ui-caribe-link.d.ts → caribeng-ui-link.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-logo.d.ts → caribeng-ui-logo.d.ts} +1 -1
- package/types/caribeng-ui-masonry.d.ts +32 -0
- package/types/caribeng-ui-media-player.d.ts +140 -0
- package/types/caribeng-ui-notification-center.d.ts +153 -0
- package/types/{caribeng-ui-caribe-off-canvas.d.ts → caribeng-ui-off-canvas.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-onboarding.d.ts → caribeng-ui-onboarding.d.ts} +2 -2
- package/types/caribeng-ui-pdfviewer.d.ts +245 -5
- package/types/caribeng-ui-period-picker.d.ts +148 -0
- package/types/caribeng-ui-pivot.d.ts +116 -0
- package/types/caribeng-ui-reconciliation.d.ts +109 -0
- package/types/caribeng-ui-scheduler.d.ts +188 -0
- package/types/{caribeng-ui-caribe-shortcut.d.ts → caribeng-ui-shortcut.d.ts} +2 -2
- package/types/caribeng-ui-signature-pad.d.ts +151 -0
- package/types/{caribeng-ui-caribe-status.d.ts → caribeng-ui-status.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-step-indicator.d.ts → caribeng-ui-step-indicator.d.ts} +2 -2
- package/types/caribeng-ui-table.d.ts +66 -2
- package/types/{caribeng-ui-caribe-tag-button.d.ts → caribeng-ui-tag-button.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-tracker.d.ts → caribeng-ui-tracker.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-transaction-status.d.ts → caribeng-ui-transaction-status.d.ts} +2 -2
- package/types/caribeng-ui-treeselect.d.ts +6 -0
- package/types/caribeng-ui-treetable.d.ts +67 -2
- package/types/{caribeng-ui-caribe-voucher.d.ts → caribeng-ui-voucher.d.ts} +2 -2
- package/types/caribeng-ui-xlsx.d.ts +79 -0
- package/types/caribeng-ui.d.ts +711 -2
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +0 -92
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +0 -130
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +0 -94
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +0 -88
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +0 -100
- package/fesm2022/caribeng-ui-caribe-input-date.mjs +0 -138
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +0 -154
- package/fesm2022/caribeng-ui-caribe-loader.mjs +0 -48
- package/fesm2022/caribeng-ui-caribe-modal.mjs +0 -119
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +0 -52
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +0 -104
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +0 -57
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +0 -84
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +0 -69
- package/fesm2022/caribeng-ui-caribe-switch.mjs +0 -182
- package/types/caribeng-ui-caribe-calendar.d.ts +0 -27
- package/types/caribeng-ui-caribe-circle-loading.d.ts +0 -28
- package/types/caribeng-ui-caribe-data-table.d.ts +0 -26
- package/types/caribeng-ui-caribe-file-select.d.ts +0 -31
- package/types/caribeng-ui-caribe-inline-alert.d.ts +0 -28
- package/types/caribeng-ui-caribe-input-date.d.ts +0 -40
- package/types/caribeng-ui-caribe-input-select.d.ts +0 -47
- package/types/caribeng-ui-caribe-loader.d.ts +0 -22
- package/types/caribeng-ui-caribe-modal.d.ts +0 -21
- package/types/caribeng-ui-caribe-pictogram.d.ts +0 -15
- package/types/caribeng-ui-caribe-pop-over.d.ts +0 -17
- package/types/caribeng-ui-caribe-preloader.d.ts +0 -24
- package/types/caribeng-ui-caribe-progress-bar.d.ts +0 -28
- package/types/caribeng-ui-caribe-stroke.d.ts +0 -17
- package/types/caribeng-ui-caribe-switch.d.ts +0 -55
- /package/fesm2022/{caribeng-ui-caribe-illustration.mjs → caribeng-ui-illustration.mjs} +0 -0
- /package/fesm2022/{caribeng-ui-caribe-logo.mjs → caribeng-ui-logo.mjs} +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Injector, input, booleanAttribute, numberAttribute, output, signal, computed, viewChild, DestroyRef, afterNextRender, effect, untracked, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation, cbFormat } from '@caribeng/ui';
|
|
4
|
+
import { CbSpinner } from '@caribeng/ui/spinner';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Scroll infinito de CaribeNG: envuelve una lista y pide más elementos (`loadMore`) al acercarse
|
|
8
|
+
* al final, con un botón "Cargar más" como alternativa. Tras `autoLimit` cargas automáticas pasa
|
|
9
|
+
* al botón, para que el pie de página siga siendo alcanzable; anuncia las cargas y, al cargar con
|
|
10
|
+
* el botón, lleva el foco al primer elemento nuevo.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <cb-infinite-scroll [loading]="cargando()" [hasMore]="hayMas()" [count]="items().length" (loadMore)="cargar()">
|
|
15
|
+
* <ul>@for (i of items(); track i.id) { <li>{{ i.nombre }}</li> }</ul>
|
|
16
|
+
* </cb-infinite-scroll>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
class CbInfiniteScroll {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.t = injectCbTranslation();
|
|
22
|
+
this.host = inject(ElementRef);
|
|
23
|
+
this.injector = inject(Injector);
|
|
24
|
+
/** Hay una carga en curso (muestra el indicador y evita pedir otra). */
|
|
25
|
+
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
26
|
+
/** Quedan elementos por cargar. */
|
|
27
|
+
this.hasMore = input(true, { ...(ngDevMode ? { debugName: "hasMore" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
28
|
+
/** La última carga falló: muestra el aviso y "Reintentar". */
|
|
29
|
+
this.error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
30
|
+
/** Número de elementos ya cargados: para anunciar cuántos llegaron y enfocar el primero nuevo. */
|
|
31
|
+
this.count = input(undefined, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/** Carga automática al llegar al final o solo con el botón. */
|
|
34
|
+
this.mode = input('auto', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
36
|
+
/** Cargas automáticas seguidas antes de pasar al botón (0 = sin límite). */
|
|
37
|
+
this.autoLimit = input(3, { ...(ngDevMode ? { debugName: "autoLimit" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
38
|
+
/** Distancia al final a la que se empieza a cargar (margen del IntersectionObserver). */
|
|
39
|
+
this.threshold = input('200px', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "threshold" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** El propio componente hace scroll, con este alto máximo (si no, se usa la página). */
|
|
42
|
+
this.scrollable = input(false, { ...(ngDevMode ? { debugName: "scrollable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
43
|
+
this.height = input('24rem', /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** Elementos de la lista, para llevar el foco al primero nuevo tras "Cargar más". */
|
|
46
|
+
this.itemSelector = input('li, [role="listitem"], article', /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "itemSelector" }] : /* istanbul ignore next */ []));
|
|
48
|
+
/** Mensaje al llegar al final (con `showEnd`). */
|
|
49
|
+
this.showEnd = input(true, { ...(ngDevMode ? { debugName: "showEnd" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
50
|
+
this.endMessage = input(undefined, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "endMessage" }] : /* istanbul ignore next */ []));
|
|
52
|
+
this.errorMessage = input(undefined, /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
54
|
+
this.loadMoreLabel = input(undefined, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "loadMoreLabel" }] : /* istanbul ignore next */ []));
|
|
56
|
+
/** Pide la siguiente página. */
|
|
57
|
+
this.loadMore = output();
|
|
58
|
+
this.announcement = signal('', /* @ts-ignore */
|
|
59
|
+
...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
60
|
+
/** Cargas automáticas desde la última con el botón. */
|
|
61
|
+
this.autoCount = signal(0, /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "autoCount" }] : /* istanbul ignore next */ []));
|
|
63
|
+
this.showButton = computed(() => this.mode() === 'button' || (this.autoLimit() > 0 && this.autoCount() >= this.autoLimit()) || !this.observerSupported, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "showButton" }] : /* istanbul ignore next */ []));
|
|
65
|
+
this.sentinel = viewChild.required('sentinel');
|
|
66
|
+
this.observerSupported = typeof IntersectionObserver !== 'undefined';
|
|
67
|
+
/** Cuántos había al pedir la carga y si la pidió el botón (para el anuncio y el foco). */
|
|
68
|
+
this.pending = null;
|
|
69
|
+
this.visible = false;
|
|
70
|
+
this.announceFlip = false;
|
|
71
|
+
const destroyRef = inject(DestroyRef);
|
|
72
|
+
afterNextRender(() => {
|
|
73
|
+
if (!this.observerSupported)
|
|
74
|
+
return;
|
|
75
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
76
|
+
this.visible = entry.isIntersecting;
|
|
77
|
+
if (this.visible)
|
|
78
|
+
this.tryAuto();
|
|
79
|
+
}, { root: this.scrollable() ? this.host.nativeElement : null, rootMargin: `0px 0px ${this.threshold()} 0px` });
|
|
80
|
+
observer.observe(this.sentinel().nativeElement);
|
|
81
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
82
|
+
});
|
|
83
|
+
// Fin de una carga: anuncio, foco al primer elemento nuevo (si la pidió el botón) y, si el
|
|
84
|
+
// final sigue a la vista (pocos elementos), se pide otra.
|
|
85
|
+
// Una carga termina cuando `loading` vuelve a false, o —si la app carga de forma síncrona y
|
|
86
|
+
// `loading` no llega a verse en true— cuando cambia `count` o se activa `error`.
|
|
87
|
+
let wasLoading = false;
|
|
88
|
+
effect(() => {
|
|
89
|
+
const loading = this.loading();
|
|
90
|
+
const count = this.count();
|
|
91
|
+
const error = this.error();
|
|
92
|
+
untracked(() => {
|
|
93
|
+
if (loading) {
|
|
94
|
+
if (!wasLoading)
|
|
95
|
+
this.announce(this.t().infiniteLoading);
|
|
96
|
+
wasLoading = true;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const pending = this.pending;
|
|
100
|
+
const done = wasLoading || (pending !== null && (count !== pending.count || error));
|
|
101
|
+
wasLoading = false;
|
|
102
|
+
if (!done)
|
|
103
|
+
return;
|
|
104
|
+
this.pending = null;
|
|
105
|
+
if (this.error()) {
|
|
106
|
+
this.announce(this.errorMessage() ?? this.t().infiniteError);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const now = this.count();
|
|
110
|
+
if (pending?.count !== undefined && now !== undefined && now > pending.count) {
|
|
111
|
+
this.announce(cbFormat(this.t().infiniteLoaded, now - pending.count, now));
|
|
112
|
+
if (pending.source !== 'scroll')
|
|
113
|
+
this.focusItem(pending.count);
|
|
114
|
+
}
|
|
115
|
+
else if (!this.hasMore()) {
|
|
116
|
+
this.announce(this.endMessage() ?? this.t().infiniteEnd);
|
|
117
|
+
}
|
|
118
|
+
afterNextRender(() => this.tryAuto(), { injector: this.injector });
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** Vuelve a permitir cargas automáticas (p. ej. al cambiar un filtro y reiniciar la lista). */
|
|
123
|
+
reset() {
|
|
124
|
+
this.autoCount.set(0);
|
|
125
|
+
this.pending = null;
|
|
126
|
+
}
|
|
127
|
+
request(source) {
|
|
128
|
+
if (this.loading())
|
|
129
|
+
return;
|
|
130
|
+
// Con el botón, se vuelve a contar desde cero el límite de cargas automáticas.
|
|
131
|
+
if (source !== 'scroll')
|
|
132
|
+
this.autoCount.set(0);
|
|
133
|
+
this.pending = { count: this.count(), source };
|
|
134
|
+
this.loadMore.emit(source);
|
|
135
|
+
}
|
|
136
|
+
tryAuto() {
|
|
137
|
+
if (!this.visible || this.mode() !== 'auto' || this.loading() || this.error() || !this.hasMore() || this.pending)
|
|
138
|
+
return;
|
|
139
|
+
if (this.autoLimit() > 0 && this.autoCount() >= this.autoLimit())
|
|
140
|
+
return;
|
|
141
|
+
this.autoCount.update((n) => n + 1);
|
|
142
|
+
this.request('scroll');
|
|
143
|
+
}
|
|
144
|
+
focusItem(index) {
|
|
145
|
+
afterNextRender(() => {
|
|
146
|
+
const items = this.host.nativeElement.querySelectorAll(this.itemSelector());
|
|
147
|
+
const target = items[index];
|
|
148
|
+
if (!target)
|
|
149
|
+
return;
|
|
150
|
+
// Un elemento de lista no es enfocable: se le da tabindex -1 para poder llevar el foco.
|
|
151
|
+
if (!target.matches('a[href], button, input, select, textarea, [tabindex]'))
|
|
152
|
+
target.setAttribute('tabindex', '-1');
|
|
153
|
+
target.focus();
|
|
154
|
+
}, { injector: this.injector });
|
|
155
|
+
}
|
|
156
|
+
/** Un espacio duro alterno hace que el mismo texto cuente como cambio y se vuelva a anunciar. */
|
|
157
|
+
announce(text) {
|
|
158
|
+
this.announceFlip = !this.announceFlip;
|
|
159
|
+
this.announcement.set(this.announceFlip ? text : `${text} `);
|
|
160
|
+
}
|
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInfiniteScroll, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
162
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbInfiniteScroll, isStandalone: true, selector: "cb-infinite-scroll", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, hasMore: { classPropertyName: "hasMore", publicName: "hasMore", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, autoLimit: { classPropertyName: "autoLimit", publicName: "autoLimit", isSignal: true, isRequired: false, transformFunction: null }, threshold: { classPropertyName: "threshold", publicName: "threshold", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, itemSelector: { classPropertyName: "itemSelector", publicName: "itemSelector", isSignal: true, isRequired: false, transformFunction: null }, showEnd: { classPropertyName: "showEnd", publicName: "showEnd", isSignal: true, isRequired: false, transformFunction: null }, endMessage: { classPropertyName: "endMessage", publicName: "endMessage", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, loadMoreLabel: { classPropertyName: "loadMoreLabel", publicName: "loadMoreLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loadMore: "loadMore" }, host: { properties: { "class.cb-infinite-scroll--self": "scrollable()", "style.max-height": "scrollable() ? height() : null", "attr.aria-busy": "loading() ? \"true\" : null" }, classAttribute: "cb-infinite-scroll" }, viewQueries: [{ propertyName: "sentinel", first: true, predicate: ["sentinel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
163
|
+
<ng-content />
|
|
164
|
+
<div #sentinel class="cb-is__sentinel" aria-hidden="true"></div>
|
|
165
|
+
<div class="cb-is__footer">
|
|
166
|
+
@if (loading()) {
|
|
167
|
+
<!-- Lo anuncia la región aria-live de abajo (el spinner es role="status" y lo repetiría). -->
|
|
168
|
+
<span class="cb-is__status" aria-hidden="true">
|
|
169
|
+
<cb-spinner [size]="20" />
|
|
170
|
+
{{ t().infiniteLoading }}
|
|
171
|
+
</span>
|
|
172
|
+
} @else if (error()) {
|
|
173
|
+
<span class="cb-is__error">{{ errorMessage() ?? t().infiniteError }}</span>
|
|
174
|
+
<button type="button" class="cb-is__btn" (click)="request('retry')">{{ t().infiniteRetry }}</button>
|
|
175
|
+
} @else if (hasMore()) {
|
|
176
|
+
@if (showButton()) {
|
|
177
|
+
<button #more type="button" class="cb-is__btn" (click)="request('button')">{{ loadMoreLabel() ?? t().infiniteLoadMore }}</button>
|
|
178
|
+
}
|
|
179
|
+
} @else if (showEnd()) {
|
|
180
|
+
<span class="cb-is__end">{{ endMessage() ?? t().infiniteEnd }}</span>
|
|
181
|
+
}
|
|
182
|
+
</div>
|
|
183
|
+
<span class="cb-is__sr" aria-live="polite">{{ announcement() }}</span>
|
|
184
|
+
`, isInline: true, styles: [":host{display:block;color:var(--cb-color-text);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm, .875rem)}:host(.cb-infinite-scroll--self){overflow-y:auto;overscroll-behavior:contain}.cb-is__sentinel{height:1px}.cb-is__footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.75rem;min-height:3rem;padding:.5rem}.cb-is__footer:empty{min-height:0;padding:0}.cb-is__status{display:inline-flex;align-items:center;gap:.5rem;color:var(--cb-color-text-muted)}.cb-is__end{color:var(--cb-color-text-muted)}.cb-is__error{color:var(--cb-color-danger)}.cb-is__btn{min-height:2.25rem;padding:0 1rem;border:1px solid var(--cb-color-border-strong, var(--cb-color-border));border-radius:var(--cb-radius-md, 6px);background:transparent;color:var(--cb-color-text);font:inherit;font-weight:var(--cb-font-weight-medium, 500);cursor:pointer}.cb-is__btn:hover{background:var(--cb-color-surface-hover)}.cb-is__btn:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:1px}.cb-is__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: "component", type: CbSpinner, selector: "cb-spinner", inputs: ["size", "strokeWidth", "severity", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
185
|
+
}
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInfiniteScroll, decorators: [{
|
|
187
|
+
type: Component,
|
|
188
|
+
args: [{ selector: 'cb-infinite-scroll', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbSpinner], host: {
|
|
189
|
+
class: 'cb-infinite-scroll',
|
|
190
|
+
'[class.cb-infinite-scroll--self]': 'scrollable()',
|
|
191
|
+
'[style.max-height]': 'scrollable() ? height() : null',
|
|
192
|
+
'[attr.aria-busy]': 'loading() ? "true" : null',
|
|
193
|
+
}, template: `
|
|
194
|
+
<ng-content />
|
|
195
|
+
<div #sentinel class="cb-is__sentinel" aria-hidden="true"></div>
|
|
196
|
+
<div class="cb-is__footer">
|
|
197
|
+
@if (loading()) {
|
|
198
|
+
<!-- Lo anuncia la región aria-live de abajo (el spinner es role="status" y lo repetiría). -->
|
|
199
|
+
<span class="cb-is__status" aria-hidden="true">
|
|
200
|
+
<cb-spinner [size]="20" />
|
|
201
|
+
{{ t().infiniteLoading }}
|
|
202
|
+
</span>
|
|
203
|
+
} @else if (error()) {
|
|
204
|
+
<span class="cb-is__error">{{ errorMessage() ?? t().infiniteError }}</span>
|
|
205
|
+
<button type="button" class="cb-is__btn" (click)="request('retry')">{{ t().infiniteRetry }}</button>
|
|
206
|
+
} @else if (hasMore()) {
|
|
207
|
+
@if (showButton()) {
|
|
208
|
+
<button #more type="button" class="cb-is__btn" (click)="request('button')">{{ loadMoreLabel() ?? t().infiniteLoadMore }}</button>
|
|
209
|
+
}
|
|
210
|
+
} @else if (showEnd()) {
|
|
211
|
+
<span class="cb-is__end">{{ endMessage() ?? t().infiniteEnd }}</span>
|
|
212
|
+
}
|
|
213
|
+
</div>
|
|
214
|
+
<span class="cb-is__sr" aria-live="polite">{{ announcement() }}</span>
|
|
215
|
+
`, styles: [":host{display:block;color:var(--cb-color-text);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm, .875rem)}:host(.cb-infinite-scroll--self){overflow-y:auto;overscroll-behavior:contain}.cb-is__sentinel{height:1px}.cb-is__footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.75rem;min-height:3rem;padding:.5rem}.cb-is__footer:empty{min-height:0;padding:0}.cb-is__status{display:inline-flex;align-items:center;gap:.5rem;color:var(--cb-color-text-muted)}.cb-is__end{color:var(--cb-color-text-muted)}.cb-is__error{color:var(--cb-color-danger)}.cb-is__btn{min-height:2.25rem;padding:0 1rem;border:1px solid var(--cb-color-border-strong, var(--cb-color-border));border-radius:var(--cb-radius-md, 6px);background:transparent;color:var(--cb-color-text);font:inherit;font-weight:var(--cb-font-weight-medium, 500);cursor:pointer}.cb-is__btn:hover{background:var(--cb-color-surface-hover)}.cb-is__btn:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:1px}.cb-is__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"] }]
|
|
216
|
+
}], ctorParameters: () => [], propDecorators: { loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], hasMore: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasMore", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], autoLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoLimit", required: false }] }], threshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "threshold", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], itemSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSelector", required: false }] }], showEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEnd", required: false }] }], endMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "endMessage", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], loadMoreLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadMoreLabel", required: false }] }], loadMore: [{ type: i0.Output, args: ["loadMore"] }], sentinel: [{ type: i0.ViewChild, args: ['sentinel', { isSignal: true }] }] } });
|
|
217
|
+
|
|
218
|
+
/*
|
|
219
|
+
* Public API Surface de @caribeng/ui/infinite-scroll
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Generated bundle index. Do not edit.
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
export { CbInfiniteScroll };
|
|
@@ -149,10 +149,20 @@ class CbInputNumber {
|
|
|
149
149
|
this.cvaDisabled.set(isDisabled);
|
|
150
150
|
}
|
|
151
151
|
// --- Interacción -----------------------------------------------------------
|
|
152
|
-
onFocus() {
|
|
152
|
+
onFocus(event) {
|
|
153
|
+
// De solo lectura: se sigue viendo con formato (no se edita).
|
|
154
|
+
if (this.readonly())
|
|
155
|
+
return;
|
|
153
156
|
this.focused.set(true);
|
|
154
157
|
const v = this.value();
|
|
155
|
-
|
|
158
|
+
const raw = v == null ? '' : this.toRawString(v);
|
|
159
|
+
this.editing.set(raw);
|
|
160
|
+
// El texto crudo se escribe ya (sin esperar al render) y queda seleccionado:
|
|
161
|
+
// así lo que se escribe reemplaza el valor y las teclas no actúan sobre el texto con formato.
|
|
162
|
+
const field = event.target;
|
|
163
|
+
if (field.value !== raw)
|
|
164
|
+
field.value = raw;
|
|
165
|
+
field.select();
|
|
156
166
|
}
|
|
157
167
|
onInput(event) {
|
|
158
168
|
this.editing.set(event.target.value);
|
|
@@ -200,12 +210,16 @@ class CbInputNumber {
|
|
|
200
210
|
const options = {
|
|
201
211
|
useGrouping: this.useGrouping(),
|
|
202
212
|
};
|
|
213
|
+
const minF = this.minFractionDigits();
|
|
214
|
+
const maxF = this.maxFractionDigits();
|
|
203
215
|
if (this.mode() === 'currency') {
|
|
204
216
|
options.style = 'currency';
|
|
205
217
|
options.currency = this.currency();
|
|
218
|
+
// Decimales fijos de la moneda, iguales en todos los navegadores (Chrome usa 0 para COP).
|
|
219
|
+
const digits = ZERO_DECIMALS.has(this.currency().toUpperCase()) ? 0 : 2;
|
|
220
|
+
options.minimumFractionDigits = Math.min(digits, maxF ?? digits);
|
|
221
|
+
options.maximumFractionDigits = Math.max(digits, minF ?? digits);
|
|
206
222
|
}
|
|
207
|
-
const minF = this.minFractionDigits();
|
|
208
|
-
const maxF = this.maxFractionDigits();
|
|
209
223
|
if (minF != null)
|
|
210
224
|
options.minimumFractionDigits = minF;
|
|
211
225
|
if (maxF != null)
|
|
@@ -285,7 +299,7 @@ class CbInputNumber {
|
|
|
285
299
|
[attr.aria-valuenow]="value()"
|
|
286
300
|
[attr.aria-valuemin]="min()"
|
|
287
301
|
[attr.aria-valuemax]="max()"
|
|
288
|
-
(focus)="onFocus()"
|
|
302
|
+
(focus)="onFocus($event)"
|
|
289
303
|
(input)="onInput($event)"
|
|
290
304
|
(blur)="onBlur()"
|
|
291
305
|
(keydown)="onKeydown($event)"
|
|
@@ -373,7 +387,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
373
387
|
[attr.aria-valuenow]="value()"
|
|
374
388
|
[attr.aria-valuemin]="min()"
|
|
375
389
|
[attr.aria-valuemax]="max()"
|
|
376
|
-
(focus)="onFocus()"
|
|
390
|
+
(focus)="onFocus($event)"
|
|
377
391
|
(input)="onInput($event)"
|
|
378
392
|
(blur)="onBlur()"
|
|
379
393
|
(keydown)="onKeydown($event)"
|
|
@@ -416,6 +430,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
416
430
|
}
|
|
417
431
|
`, styles: [":host{display:block}.cb-input-number__label{display:block;margin-bottom:var(--cb-space-1);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);font-weight:var(--cb-font-weight-medium);color:var(--cb-color-text)}.cb-input-number__required{color:var(--cb-color-danger);margin-left:2px}.cb-input-number{position:relative;display:flex;align-items:stretch;box-sizing:border-box;width:100%;background-color:var(--cb-color-bg);border:var(--cb-border-width) solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);transition:border-color var(--cb-duration-fast) var(--cb-ease),box-shadow var(--cb-duration-fast) var(--cb-ease)}.cb-input-number:hover:not(.cb-is-disabled):not(:focus-within){border-color:var(--cb-color-text-muted)}.cb-input-number:focus-within{border-color:var(--cb-color-primary-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500) 25%,transparent)}.cb-input-number.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-input-number.cb-is-invalid:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}.cb-input-number.cb-is-disabled{background-color:var(--cb-color-surface);opacity:.8}.cb-input-number__field{flex:1 1 auto;min-width:0;box-sizing:border-box;font-family:var(--cb-font-sans);color:var(--cb-color-text);background:transparent;border:none;border-radius:inherit;text-align:right}.cb-input-number__field::placeholder{color:var(--cb-color-text-muted)}.cb-input-number__field:focus{outline:none}.cb-input-number__field:disabled{color:var(--cb-color-text-muted);cursor:not-allowed}.cb-input-number--sm .cb-input-number__field{min-height:2rem;padding:var(--cb-space-1) var(--cb-space-2);font-size:var(--cb-text-sm)}.cb-input-number--md .cb-input-number__field{min-height:2.5rem;padding:var(--cb-space-2) var(--cb-space-3);font-size:var(--cb-text-base)}.cb-input-number--lg .cb-input-number__field{min-height:3rem;padding:var(--cb-space-3) var(--cb-space-4);font-size:var(--cb-text-lg)}.cb-input-number__buttons{display:flex;flex:none;flex-direction:column;border-left:var(--cb-border-width) solid var(--cb-color-border)}.cb-input-number__btn{display:flex;flex:1 1 50%;align-items:center;justify-content:center;width:2rem;padding:0;color:var(--cb-color-text-muted);background-color:var(--cb-color-surface-subtle);border:none;cursor:pointer;transition:background-color var(--cb-duration-fast) var(--cb-ease)}.cb-input-number__btn:hover:not(:disabled){background-color:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-input-number__btn:disabled{opacity:.4;cursor:not-allowed}.cb-input-number__btn--up{border-top-right-radius:var(--cb-radius-md);border-bottom:var(--cb-border-width) solid var(--cb-color-border)}.cb-input-number__btn--down{border-bottom-right-radius:var(--cb-radius-md)}.cb-input-number__btn cb-icon{color:currentColor}.cb-input-number__message{margin:var(--cb-space-1) 0 0;font-size:var(--cb-text-sm);line-height:var(--cb-line-height-normal)}.cb-input-number__message--hint{color:var(--cb-color-text-muted)}.cb-input-number__message--error{color:var(--cb-color-danger)}.cb-input-number__required--required,.cb-input-number__required--optional{margin-left:.25rem;color:var(--cb-color-text-muted);font-size:.85em;font-weight:var(--cb-font-weight-normal, 400)}\n"] }]
|
|
418
432
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], requiredIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredIndicator", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], useGrouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "useGrouping", required: false }] }], minFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "minFractionDigits", required: false }] }], maxFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFractionDigits", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
|
|
433
|
+
/** Monedas sin decimales (ISO 4217). */
|
|
434
|
+
const ZERO_DECIMALS = new Set(['BIF', 'CLP', 'DJF', 'GNF', 'ISK', 'JPY', 'KMF', 'KRW', 'PYG', 'RWF', 'UGX', 'UYI', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']);
|
|
419
435
|
function toBoolean(value) {
|
|
420
436
|
return value !== false && value != null && `${value}` !== 'false';
|
|
421
437
|
}
|
|
@@ -4,7 +4,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
4
4
|
import { injectCbTranslation, cbFieldState } from '@caribeng/ui';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Input-search
|
|
7
|
+
* Input-search: campo de búsqueda con icono, botón de limpiar
|
|
8
8
|
* e integración con Angular Forms (CVA).
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
@@ -63,38 +63,38 @@ class CbInputSearch {
|
|
|
63
63
|
useExisting: forwardRef(() => CbInputSearch),
|
|
64
64
|
multi: true,
|
|
65
65
|
},
|
|
66
|
-
], ngImport: i0, template: `
|
|
67
|
-
<div
|
|
68
|
-
class="cb-input-search"
|
|
69
|
-
[class.cb-is-invalid]="fieldState.invalid()"
|
|
70
|
-
[class.cb-is-disabled]="disabled() || cvaDisabled()"
|
|
71
|
-
>
|
|
72
|
-
<span class="cb-input-search__icon" aria-hidden="true">⌕</span>
|
|
73
|
-
<input
|
|
74
|
-
#field
|
|
75
|
-
class="cb-input-search__field"
|
|
76
|
-
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
77
|
-
[attr.aria-required]="fieldState.required() || null"
|
|
78
|
-
type="search"
|
|
79
|
-
[value]="value()"
|
|
80
|
-
[placeholder]="(placeholder() ?? t().search)"
|
|
81
|
-
[disabled]="disabled() || cvaDisabled()"
|
|
82
|
-
[attr.aria-label]="(placeholder() ?? t().search)"
|
|
83
|
-
(input)="onInput($event)"
|
|
84
|
-
(blur)="onTouched()"
|
|
85
|
-
(keydown.enter)="search.emit(value())"
|
|
86
|
-
/>
|
|
87
|
-
@if (clearable() && value()) {
|
|
88
|
-
<button
|
|
89
|
-
type="button"
|
|
90
|
-
class="cb-input-search__clear"
|
|
91
|
-
[attr.aria-label]="t().clearSearch"
|
|
92
|
-
(click)="clear(); field.focus()"
|
|
93
|
-
>
|
|
94
|
-
×
|
|
95
|
-
</button>
|
|
96
|
-
}
|
|
97
|
-
</div>
|
|
66
|
+
], ngImport: i0, template: `
|
|
67
|
+
<div
|
|
68
|
+
class="cb-input-search"
|
|
69
|
+
[class.cb-is-invalid]="fieldState.invalid()"
|
|
70
|
+
[class.cb-is-disabled]="disabled() || cvaDisabled()"
|
|
71
|
+
>
|
|
72
|
+
<span class="cb-input-search__icon" aria-hidden="true">⌕</span>
|
|
73
|
+
<input
|
|
74
|
+
#field
|
|
75
|
+
class="cb-input-search__field"
|
|
76
|
+
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
77
|
+
[attr.aria-required]="fieldState.required() || null"
|
|
78
|
+
type="search"
|
|
79
|
+
[value]="value()"
|
|
80
|
+
[placeholder]="(placeholder() ?? t().search)"
|
|
81
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
82
|
+
[attr.aria-label]="(placeholder() ?? t().search)"
|
|
83
|
+
(input)="onInput($event)"
|
|
84
|
+
(blur)="onTouched()"
|
|
85
|
+
(keydown.enter)="search.emit(value())"
|
|
86
|
+
/>
|
|
87
|
+
@if (clearable() && value()) {
|
|
88
|
+
<button
|
|
89
|
+
type="button"
|
|
90
|
+
class="cb-input-search__clear"
|
|
91
|
+
[attr.aria-label]="t().clearSearch"
|
|
92
|
+
(click)="clear(); field.focus()"
|
|
93
|
+
>
|
|
94
|
+
×
|
|
95
|
+
</button>
|
|
96
|
+
}
|
|
97
|
+
</div>
|
|
98
98
|
`, isInline: true, styles: [":host{display:inline-block;width:100%;max-width:20rem}.cb-input-search{display:flex;align-items:center;gap:var(--cb-space-2, .5rem);box-sizing:border-box;width:100%;padding:0 var(--cb-space-3, .75rem);height:2.5rem;font-family:var(--cb-font-sans, inherit);color:var(--cb-color-text-strong, #0f172a);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #cbd5e1);border-radius:var(--cb-radius-md, .5rem);transition:border-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-input-search:focus-within{border-color:var(--cb-color-primary-500, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500, #10b981) 18%,transparent)}.cb-input-search.cb-is-disabled{opacity:.6;background-color:var(--cb-color-surface-100, #f1f5f9)}.cb-input-search__icon{flex:none;font-size:1.1rem;color:var(--cb-color-text-muted, #64748b)}.cb-input-search__field{flex:1;min-width:0;border:none;outline:none;background:transparent;color:inherit;font:inherit;font-size:var(--cb-text-sm, .875rem)}.cb-input-search__field::-webkit-search-cancel-button{display:none}.cb-input-search__clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1rem;color:var(--cb-color-text-muted, #64748b);background:transparent;border:none;border-radius:var(--cb-radius-full, 999px);cursor:pointer}.cb-input-search__clear:hover{background-color:var(--cb-color-surface-100, #f1f5f9)}:host-context([data-theme=\"dark\"]) .cb-input-search{color:var(--cb-color-surface-0, #f8fafc);background-color:var(--cb-color-surface-900, #0f172a);border-color:var(--cb-color-surface-600, #475569)}.cb-input-search.cb-is-invalid{border-color:var(--cb-color-danger)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
99
99
|
}
|
|
100
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInputSearch, decorators: [{
|
|
@@ -105,38 +105,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
105
105
|
useExisting: forwardRef(() => CbInputSearch),
|
|
106
106
|
multi: true,
|
|
107
107
|
},
|
|
108
|
-
], host: { class: 'cb-input-search-host' }, template: `
|
|
109
|
-
<div
|
|
110
|
-
class="cb-input-search"
|
|
111
|
-
[class.cb-is-invalid]="fieldState.invalid()"
|
|
112
|
-
[class.cb-is-disabled]="disabled() || cvaDisabled()"
|
|
113
|
-
>
|
|
114
|
-
<span class="cb-input-search__icon" aria-hidden="true">⌕</span>
|
|
115
|
-
<input
|
|
116
|
-
#field
|
|
117
|
-
class="cb-input-search__field"
|
|
118
|
-
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
119
|
-
[attr.aria-required]="fieldState.required() || null"
|
|
120
|
-
type="search"
|
|
121
|
-
[value]="value()"
|
|
122
|
-
[placeholder]="(placeholder() ?? t().search)"
|
|
123
|
-
[disabled]="disabled() || cvaDisabled()"
|
|
124
|
-
[attr.aria-label]="(placeholder() ?? t().search)"
|
|
125
|
-
(input)="onInput($event)"
|
|
126
|
-
(blur)="onTouched()"
|
|
127
|
-
(keydown.enter)="search.emit(value())"
|
|
128
|
-
/>
|
|
129
|
-
@if (clearable() && value()) {
|
|
130
|
-
<button
|
|
131
|
-
type="button"
|
|
132
|
-
class="cb-input-search__clear"
|
|
133
|
-
[attr.aria-label]="t().clearSearch"
|
|
134
|
-
(click)="clear(); field.focus()"
|
|
135
|
-
>
|
|
136
|
-
×
|
|
137
|
-
</button>
|
|
138
|
-
}
|
|
139
|
-
</div>
|
|
108
|
+
], host: { class: 'cb-input-search-host' }, template: `
|
|
109
|
+
<div
|
|
110
|
+
class="cb-input-search"
|
|
111
|
+
[class.cb-is-invalid]="fieldState.invalid()"
|
|
112
|
+
[class.cb-is-disabled]="disabled() || cvaDisabled()"
|
|
113
|
+
>
|
|
114
|
+
<span class="cb-input-search__icon" aria-hidden="true">⌕</span>
|
|
115
|
+
<input
|
|
116
|
+
#field
|
|
117
|
+
class="cb-input-search__field"
|
|
118
|
+
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
119
|
+
[attr.aria-required]="fieldState.required() || null"
|
|
120
|
+
type="search"
|
|
121
|
+
[value]="value()"
|
|
122
|
+
[placeholder]="(placeholder() ?? t().search)"
|
|
123
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
124
|
+
[attr.aria-label]="(placeholder() ?? t().search)"
|
|
125
|
+
(input)="onInput($event)"
|
|
126
|
+
(blur)="onTouched()"
|
|
127
|
+
(keydown.enter)="search.emit(value())"
|
|
128
|
+
/>
|
|
129
|
+
@if (clearable() && value()) {
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
class="cb-input-search__clear"
|
|
133
|
+
[attr.aria-label]="t().clearSearch"
|
|
134
|
+
(click)="clear(); field.focus()"
|
|
135
|
+
>
|
|
136
|
+
×
|
|
137
|
+
</button>
|
|
138
|
+
}
|
|
139
|
+
</div>
|
|
140
140
|
`, styles: [":host{display:inline-block;width:100%;max-width:20rem}.cb-input-search{display:flex;align-items:center;gap:var(--cb-space-2, .5rem);box-sizing:border-box;width:100%;padding:0 var(--cb-space-3, .75rem);height:2.5rem;font-family:var(--cb-font-sans, inherit);color:var(--cb-color-text-strong, #0f172a);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #cbd5e1);border-radius:var(--cb-radius-md, .5rem);transition:border-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-input-search:focus-within{border-color:var(--cb-color-primary-500, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500, #10b981) 18%,transparent)}.cb-input-search.cb-is-disabled{opacity:.6;background-color:var(--cb-color-surface-100, #f1f5f9)}.cb-input-search__icon{flex:none;font-size:1.1rem;color:var(--cb-color-text-muted, #64748b)}.cb-input-search__field{flex:1;min-width:0;border:none;outline:none;background:transparent;color:inherit;font:inherit;font-size:var(--cb-text-sm, .875rem)}.cb-input-search__field::-webkit-search-cancel-button{display:none}.cb-input-search__clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1rem;color:var(--cb-color-text-muted, #64748b);background:transparent;border:none;border-radius:var(--cb-radius-full, 999px);cursor:pointer}.cb-input-search__clear:hover{background-color:var(--cb-color-surface-100, #f1f5f9)}:host-context([data-theme=\"dark\"]) .cb-input-search{color:var(--cb-color-surface-0, #f8fafc);background-color:var(--cb-color-surface-900, #0f172a);border-color:var(--cb-color-surface-600, #475569)}.cb-input-search.cb-is-invalid{border-color:var(--cb-color-danger)}\n"] }]
|
|
141
141
|
}], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], search: [{ type: i0.Output, args: ["search"] }] } });
|
|
142
142
|
|
|
@@ -4,7 +4,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
4
4
|
import { injectCbTranslation, cbFormat, cbFieldState } from '@caribeng/ui';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Input-token
|
|
7
|
+
* Input-token: entrada de código OTP con casillas por dígito,
|
|
8
8
|
* enmascarado opcional y CVA.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
@@ -112,35 +112,35 @@ class CbInputToken {
|
|
|
112
112
|
useExisting: forwardRef(() => CbInputToken),
|
|
113
113
|
multi: true,
|
|
114
114
|
},
|
|
115
|
-
], ngImport: i0, template: `
|
|
116
|
-
<div class="cb-input-token">
|
|
117
|
-
<div
|
|
118
|
-
class="cb-input-token__slots"
|
|
119
|
-
role="group"
|
|
120
|
-
[attr.aria-label]="t().verificationCode"
|
|
121
|
-
>
|
|
122
|
-
@for (slot of slots(); track slot) {
|
|
123
|
-
<input
|
|
124
|
-
class="cb-input-token__slot"
|
|
125
|
-
[class.cb-is-invalid]="fieldState.invalid()"
|
|
126
|
-
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
127
|
-
[type]="unmasked() ? 'text' : 'password'"
|
|
128
|
-
maxlength="1"
|
|
129
|
-
inputmode="numeric"
|
|
130
|
-
[value]="charAt(slot)"
|
|
131
|
-
[disabled]="disabled() || cvaDisabled()"
|
|
132
|
-
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
133
|
-
(input)="onDigitInput($event, slot)"
|
|
134
|
-
(keydown)="onKeydown($event, slot)"
|
|
135
|
-
(paste)="onPaste($event)"
|
|
136
|
-
(blur)="onTouched()"
|
|
137
|
-
/>
|
|
138
|
-
}
|
|
139
|
-
</div>
|
|
140
|
-
@if (helpText()) {
|
|
141
|
-
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
142
|
-
}
|
|
143
|
-
</div>
|
|
115
|
+
], ngImport: i0, template: `
|
|
116
|
+
<div class="cb-input-token">
|
|
117
|
+
<div
|
|
118
|
+
class="cb-input-token__slots"
|
|
119
|
+
role="group"
|
|
120
|
+
[attr.aria-label]="t().verificationCode"
|
|
121
|
+
>
|
|
122
|
+
@for (slot of slots(); track slot) {
|
|
123
|
+
<input
|
|
124
|
+
class="cb-input-token__slot"
|
|
125
|
+
[class.cb-is-invalid]="fieldState.invalid()"
|
|
126
|
+
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
127
|
+
[type]="unmasked() ? 'text' : 'password'"
|
|
128
|
+
maxlength="1"
|
|
129
|
+
inputmode="numeric"
|
|
130
|
+
[value]="charAt(slot)"
|
|
131
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
132
|
+
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
133
|
+
(input)="onDigitInput($event, slot)"
|
|
134
|
+
(keydown)="onKeydown($event, slot)"
|
|
135
|
+
(paste)="onPaste($event)"
|
|
136
|
+
(blur)="onTouched()"
|
|
137
|
+
/>
|
|
138
|
+
}
|
|
139
|
+
</div>
|
|
140
|
+
@if (helpText()) {
|
|
141
|
+
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
142
|
+
}
|
|
143
|
+
</div>
|
|
144
144
|
`, isInline: true, styles: [":host{display:inline-block}.cb-input-token{display:inline-flex;flex-direction:column;gap:var(--cb-space-2, .4rem);font-family:var(--cb-font-sans, inherit)}.cb-input-token__slots{display:inline-flex;gap:var(--cb-space-2, .45rem)}.cb-input-token__slot{width:2.5rem;height:3rem;text-align:center;font:inherit;font-size:var(--cb-text-lg, 1.1rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong, #0f172a);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #cbd5e1);border-radius:var(--cb-radius-md, .5rem);transition:border-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-input-token__slot:focus-visible{outline:none;border-color:var(--cb-color-primary-500, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500, #10b981) 20%,transparent)}.cb-input-token__slot:disabled{opacity:.6;background-color:var(--cb-color-surface-100, #f1f5f9)}.cb-input-token__help{font-size:var(--cb-text-xs, .75rem);color:var(--cb-color-text-muted, #64748b)}:host-context([data-theme=\"dark\"]) .cb-input-token__slot{color:var(--cb-color-surface-0, #f8fafc);background-color:var(--cb-color-surface-900, #0f172a);border-color:var(--cb-color-surface-600, #475569)}.cb-input-token__slot.cb-is-invalid{border-color:var(--cb-color-danger)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
145
145
|
}
|
|
146
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInputToken, decorators: [{
|
|
@@ -151,35 +151,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
151
151
|
useExisting: forwardRef(() => CbInputToken),
|
|
152
152
|
multi: true,
|
|
153
153
|
},
|
|
154
|
-
], host: { class: 'cb-input-token-host' }, template: `
|
|
155
|
-
<div class="cb-input-token">
|
|
156
|
-
<div
|
|
157
|
-
class="cb-input-token__slots"
|
|
158
|
-
role="group"
|
|
159
|
-
[attr.aria-label]="t().verificationCode"
|
|
160
|
-
>
|
|
161
|
-
@for (slot of slots(); track slot) {
|
|
162
|
-
<input
|
|
163
|
-
class="cb-input-token__slot"
|
|
164
|
-
[class.cb-is-invalid]="fieldState.invalid()"
|
|
165
|
-
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
166
|
-
[type]="unmasked() ? 'text' : 'password'"
|
|
167
|
-
maxlength="1"
|
|
168
|
-
inputmode="numeric"
|
|
169
|
-
[value]="charAt(slot)"
|
|
170
|
-
[disabled]="disabled() || cvaDisabled()"
|
|
171
|
-
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
172
|
-
(input)="onDigitInput($event, slot)"
|
|
173
|
-
(keydown)="onKeydown($event, slot)"
|
|
174
|
-
(paste)="onPaste($event)"
|
|
175
|
-
(blur)="onTouched()"
|
|
176
|
-
/>
|
|
177
|
-
}
|
|
178
|
-
</div>
|
|
179
|
-
@if (helpText()) {
|
|
180
|
-
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
181
|
-
}
|
|
182
|
-
</div>
|
|
154
|
+
], host: { class: 'cb-input-token-host' }, template: `
|
|
155
|
+
<div class="cb-input-token">
|
|
156
|
+
<div
|
|
157
|
+
class="cb-input-token__slots"
|
|
158
|
+
role="group"
|
|
159
|
+
[attr.aria-label]="t().verificationCode"
|
|
160
|
+
>
|
|
161
|
+
@for (slot of slots(); track slot) {
|
|
162
|
+
<input
|
|
163
|
+
class="cb-input-token__slot"
|
|
164
|
+
[class.cb-is-invalid]="fieldState.invalid()"
|
|
165
|
+
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
166
|
+
[type]="unmasked() ? 'text' : 'password'"
|
|
167
|
+
maxlength="1"
|
|
168
|
+
inputmode="numeric"
|
|
169
|
+
[value]="charAt(slot)"
|
|
170
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
171
|
+
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
172
|
+
(input)="onDigitInput($event, slot)"
|
|
173
|
+
(keydown)="onKeydown($event, slot)"
|
|
174
|
+
(paste)="onPaste($event)"
|
|
175
|
+
(blur)="onTouched()"
|
|
176
|
+
/>
|
|
177
|
+
}
|
|
178
|
+
</div>
|
|
179
|
+
@if (helpText()) {
|
|
180
|
+
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
181
|
+
}
|
|
182
|
+
</div>
|
|
183
183
|
`, styles: [":host{display:inline-block}.cb-input-token{display:inline-flex;flex-direction:column;gap:var(--cb-space-2, .4rem);font-family:var(--cb-font-sans, inherit)}.cb-input-token__slots{display:inline-flex;gap:var(--cb-space-2, .45rem)}.cb-input-token__slot{width:2.5rem;height:3rem;text-align:center;font:inherit;font-size:var(--cb-text-lg, 1.1rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong, #0f172a);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #cbd5e1);border-radius:var(--cb-radius-md, .5rem);transition:border-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-input-token__slot:focus-visible{outline:none;border-color:var(--cb-color-primary-500, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500, #10b981) 20%,transparent)}.cb-input-token__slot:disabled{opacity:.6;background-color:var(--cb-color-surface-100, #f1f5f9)}.cb-input-token__help{font-size:var(--cb-text-xs, .75rem);color:var(--cb-color-text-muted, #64748b)}:host-context([data-theme=\"dark\"]) .cb-input-token__slot{color:var(--cb-color-surface-0, #f8fafc);background-color:var(--cb-color-surface-900, #0f172a);border-color:var(--cb-color-surface-600, #475569)}.cb-input-token__slot.cb-is-invalid{border-color:var(--cb-color-danger)}\n"] }]
|
|
184
184
|
}], propDecorators: { numInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "numInputs", required: false }] }], unmasked: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmasked", required: false }] }], helpText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
185
185
|
|