@crowdfarming/oliva-ds 1.6.0 → 1.7.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/fesm2022/crowdfarming-oliva-ds.mjs +1286 -421
- package/fesm2022/crowdfarming-oliva-ds.mjs.map +1 -1
- package/index.d.ts +20 -8
- package/lib/accordion/src/index.d.ts +1 -0
- package/lib/accordion/src/lib/accordion/accordion.component.d.ts +18 -0
- package/lib/alert/src/index.d.ts +1 -0
- package/lib/alert/src/lib/alert/alert.component.d.ts +16 -0
- package/lib/badge/src/index.d.ts +1 -0
- package/lib/badge/src/lib/badge/badge.component.d.ts +8 -0
- package/lib/helper-text/src/index.d.ts +1 -0
- package/lib/input-payment/src/index.d.ts +1 -0
- package/lib/input-payment/src/lib/input-payment/input-payment.component.d.ts +42 -0
- package/lib/input-upload/src/index.d.ts +1 -0
- package/lib/input-upload/src/lib/input-upload/input-upload.component.d.ts +33 -0
- package/lib/pagination/src/index.d.ts +1 -0
- package/lib/pagination/src/lib/pagination/pagination.component.d.ts +18 -0
- package/lib/select/src/index.d.ts +1 -0
- package/lib/select/src/lib/select/select.component.d.ts +61 -0
- package/lib/switch/src/index.d.ts +1 -0
- package/lib/switch/src/lib/switch/switch.component.d.ts +12 -0
- package/lib/tabs/src/index.d.ts +1 -0
- package/lib/tabs/src/lib/tabs/tabs.component.d.ts +15 -0
- package/lib/tag/src/index.d.ts +1 -0
- package/lib/tag/src/lib/tag/tag.component.d.ts +14 -0
- package/lib/tile/src/index.d.ts +1 -0
- package/lib/tile/src/lib/tile/tile.component.d.ts +13 -0
- package/lib/toast/src/index.d.ts +1 -0
- package/lib/toast/src/lib/toast/toast.component.d.ts +16 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Component, ElementRef, ContentChild,
|
|
2
|
+
import { Input, Component, EventEmitter, Output, ElementRef, ContentChild, forwardRef, ViewChild, HostListener, ViewChildren } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import
|
|
5
|
+
import * as i2 from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
6
7
|
|
|
7
8
|
class IconComponent {
|
|
8
9
|
extraClass = '';
|
|
@@ -25,6 +26,141 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
25
26
|
type: Input
|
|
26
27
|
}] } });
|
|
27
28
|
|
|
29
|
+
class AccordionComponent {
|
|
30
|
+
id;
|
|
31
|
+
expanded = false;
|
|
32
|
+
size = 'md';
|
|
33
|
+
title = '';
|
|
34
|
+
showText = true;
|
|
35
|
+
text = '';
|
|
36
|
+
showSlot = false;
|
|
37
|
+
swapTemplate;
|
|
38
|
+
expandedChange = new EventEmitter();
|
|
39
|
+
toggled = new EventEmitter();
|
|
40
|
+
ngOnInit() {
|
|
41
|
+
if (!this.id) {
|
|
42
|
+
this.id = 'accordion-' + Math.random().toString(36).substr(2, 9);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
toggle() {
|
|
46
|
+
this.expanded = !this.expanded;
|
|
47
|
+
this.expandedChange.emit(this.expanded);
|
|
48
|
+
this.toggled.emit(this.expanded);
|
|
49
|
+
}
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AccordionComponent, isStandalone: true, selector: "lib-accordion", inputs: { id: "id", expanded: "expanded", size: "size", title: "title", showText: "showText", text: "text", showSlot: "showSlot", swapTemplate: "swapTemplate" }, outputs: { expandedChange: "expandedChange", toggled: "toggled" }, ngImport: i0, template: "<div\n class=\"c-accordion\"\n [class.c-accordion--expanded]=\"expanded\"\n [class.c-accordion--sm]=\"size==='sm'\"\n [class.c-accordion--md]=\"size==='md'\"\n>\n <div\n class=\"c-accordion__header\"\n role=\"button\"\n [id]=\"id + '-header'\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"expanded\"\n [attr.aria-controls]=\"id + '-content'\"\n (click)=\"toggle()\"\n (keydown.enter)=\"toggle()\"\n (keydown.space)=\"toggle()\"\n >\n <span class=\"c-accordion__title\">{{ title }}</span>\n <span class=\"c-accordion__arrow\" *ngIf=\"!expanded\" [class.open]=\"expanded\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'down'\" />\n </span>\n <span class=\"c-accordion__arrow\" *ngIf=\"expanded\" [class.open]=\"expanded\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'up'\" />\n </span>\n </div>\n\n <div\n class=\"c-accordion__content\"\n *ngIf=\"expanded\"\n [id]=\"id + '-content'\"\n role=\"region\"\n [attr.aria-labelledby]=\"id + '-header'\"\n >\n <ng-container *ngIf=\"swapTemplate; else normalContent\">\n <ng-container *ngTemplateOutlet=\"swapTemplate\"></ng-container>\n </ng-container>\n <ng-template #normalContent>\n <ng-container *ngIf=\"showSlot\">\n <ng-content></ng-content>\n </ng-container>\n <div class=\"c-accordion__text\" *ngIf=\"!showSlot && showText\">\n {{ text }}\n </div>\n </ng-template>\n </div>\n</div>\n", styles: [".c-accordion{display:flex;width:22.5rem;flex-direction:column;align-items:stretch;overflow:hidden;border-bottom:1px solid var(--color-core-border-soft, #D6E0DF)}.c-accordion--sm .c-accordion__header{padding:var(--space-component-padding-md, .75rem) var(--space-component-padding-sm, .5rem)}.c-accordion--sm .c-accordion__title{font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem)}.c-accordion--sm .c-accordion__text{font-size:var(--typography-body-sm-size, .875rem);font-style:normal;font-weight:var(--typography-body-sm-weight, 400);line-height:var(--typography-body-sm-line-height, 1.25rem);letter-spacing:var(--typography-body-sm-letter-spacing, 0rem)}.c-accordion--sm .c-accordion__content{display:flex;padding:0rem var(--space-component-padding-sm, .5rem) var(--space-component-padding-md, .75rem) var(--space-component-padding-sm, .5rem);flex-direction:column;align-items:flex-start;gap:var(--space-component-gap-md, .5rem);align-self:stretch}.c-accordion__header{display:flex;justify-content:space-between;align-items:center;background:var(--color-textfield-background-default, #f7f7f7);padding:var(--space-component-padding-xl, 1.5rem) var(--space-component-padding-lg, 1rem);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .2s;align-self:stretch;box-sizing:border-box}.c-accordion__header:hover{background:var(--color-action-neutral-background-hover, rgba(0, 0, 0, .04))}.c-accordion__header:focus{box-shadow:0 0 0 2px var(--color-effect-focus-color, #EAA42C) inset,0 0 0 4px var(--color-effect-focus-contrast, #FFF) inset}.c-accordion__header:pressed{background:var(--color-action-neutral-background-pressed, rgba(0, 0, 0, .06))}.c-accordion__title{flex:1;color:var(--color-core-content-default, #070707);font-family:var(--typography-label-lg-default-family, Satoshi);font-size:var(--typography-label-lg-strong-size, 1.125rem);font-style:normal;font-weight:var(--typography-label-lg-strong-weight, 700);line-height:var(--typography-label-lg-strong-line-height, 1.75rem);letter-spacing:var(--typography-label-lg-strong-letter-spacing, 0rem)}.c-accordion__content{display:flex;padding:0rem var(--space-component-padding-lg, 1rem) var(--space-component-padding-lg, 1rem) var(--space-component-padding-lg, 1rem);flex-direction:column;align-items:flex-start;gap:var(--space-component-gap-md, .5rem);align-self:stretch}.c-accordion__text{color:var(--color-core-content-soft, #535858);font-family:var(--typography-body-md-family, Satoshi);font-size:var(--typography-body-md-size, 1rem);font-style:normal;font-weight:var(--typography-body-md-weight, 400);line-height:var(--typography-body-md-line-height, 1.5rem);letter-spacing:var(--typography-body-md-letter-spacing, 0rem)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
54
|
+
type: Component,
|
|
55
|
+
args: [{ selector: 'lib-accordion', standalone: true, imports: [CommonModule, IconComponent], template: "<div\n class=\"c-accordion\"\n [class.c-accordion--expanded]=\"expanded\"\n [class.c-accordion--sm]=\"size==='sm'\"\n [class.c-accordion--md]=\"size==='md'\"\n>\n <div\n class=\"c-accordion__header\"\n role=\"button\"\n [id]=\"id + '-header'\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"expanded\"\n [attr.aria-controls]=\"id + '-content'\"\n (click)=\"toggle()\"\n (keydown.enter)=\"toggle()\"\n (keydown.space)=\"toggle()\"\n >\n <span class=\"c-accordion__title\">{{ title }}</span>\n <span class=\"c-accordion__arrow\" *ngIf=\"!expanded\" [class.open]=\"expanded\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'down'\" />\n </span>\n <span class=\"c-accordion__arrow\" *ngIf=\"expanded\" [class.open]=\"expanded\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'up'\" />\n </span>\n </div>\n\n <div\n class=\"c-accordion__content\"\n *ngIf=\"expanded\"\n [id]=\"id + '-content'\"\n role=\"region\"\n [attr.aria-labelledby]=\"id + '-header'\"\n >\n <ng-container *ngIf=\"swapTemplate; else normalContent\">\n <ng-container *ngTemplateOutlet=\"swapTemplate\"></ng-container>\n </ng-container>\n <ng-template #normalContent>\n <ng-container *ngIf=\"showSlot\">\n <ng-content></ng-content>\n </ng-container>\n <div class=\"c-accordion__text\" *ngIf=\"!showSlot && showText\">\n {{ text }}\n </div>\n </ng-template>\n </div>\n</div>\n", styles: [".c-accordion{display:flex;width:22.5rem;flex-direction:column;align-items:stretch;overflow:hidden;border-bottom:1px solid var(--color-core-border-soft, #D6E0DF)}.c-accordion--sm .c-accordion__header{padding:var(--space-component-padding-md, .75rem) var(--space-component-padding-sm, .5rem)}.c-accordion--sm .c-accordion__title{font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem)}.c-accordion--sm .c-accordion__text{font-size:var(--typography-body-sm-size, .875rem);font-style:normal;font-weight:var(--typography-body-sm-weight, 400);line-height:var(--typography-body-sm-line-height, 1.25rem);letter-spacing:var(--typography-body-sm-letter-spacing, 0rem)}.c-accordion--sm .c-accordion__content{display:flex;padding:0rem var(--space-component-padding-sm, .5rem) var(--space-component-padding-md, .75rem) var(--space-component-padding-sm, .5rem);flex-direction:column;align-items:flex-start;gap:var(--space-component-gap-md, .5rem);align-self:stretch}.c-accordion__header{display:flex;justify-content:space-between;align-items:center;background:var(--color-textfield-background-default, #f7f7f7);padding:var(--space-component-padding-xl, 1.5rem) var(--space-component-padding-lg, 1rem);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .2s;align-self:stretch;box-sizing:border-box}.c-accordion__header:hover{background:var(--color-action-neutral-background-hover, rgba(0, 0, 0, .04))}.c-accordion__header:focus{box-shadow:0 0 0 2px var(--color-effect-focus-color, #EAA42C) inset,0 0 0 4px var(--color-effect-focus-contrast, #FFF) inset}.c-accordion__header:pressed{background:var(--color-action-neutral-background-pressed, rgba(0, 0, 0, .06))}.c-accordion__title{flex:1;color:var(--color-core-content-default, #070707);font-family:var(--typography-label-lg-default-family, Satoshi);font-size:var(--typography-label-lg-strong-size, 1.125rem);font-style:normal;font-weight:var(--typography-label-lg-strong-weight, 700);line-height:var(--typography-label-lg-strong-line-height, 1.75rem);letter-spacing:var(--typography-label-lg-strong-letter-spacing, 0rem)}.c-accordion__content{display:flex;padding:0rem var(--space-component-padding-lg, 1rem) var(--space-component-padding-lg, 1rem) var(--space-component-padding-lg, 1rem);flex-direction:column;align-items:flex-start;gap:var(--space-component-gap-md, .5rem);align-self:stretch}.c-accordion__text{color:var(--color-core-content-soft, #535858);font-family:var(--typography-body-md-family, Satoshi);font-size:var(--typography-body-md-size, 1rem);font-style:normal;font-weight:var(--typography-body-md-weight, 400);line-height:var(--typography-body-md-line-height, 1.5rem);letter-spacing:var(--typography-body-md-letter-spacing, 0rem)}\n"] }]
|
|
56
|
+
}], propDecorators: { id: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], expanded: [{
|
|
59
|
+
type: Input
|
|
60
|
+
}], size: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], title: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], showText: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], text: [{
|
|
67
|
+
type: Input
|
|
68
|
+
}], showSlot: [{
|
|
69
|
+
type: Input
|
|
70
|
+
}], swapTemplate: [{
|
|
71
|
+
type: Input
|
|
72
|
+
}], expandedChange: [{
|
|
73
|
+
type: Output
|
|
74
|
+
}], toggled: [{
|
|
75
|
+
type: Output
|
|
76
|
+
}] } });
|
|
77
|
+
|
|
78
|
+
class ButtonIconComponent {
|
|
79
|
+
/** Si es un icon‑only button, pon aquí su etiqueta accesible */
|
|
80
|
+
ariaLabel;
|
|
81
|
+
/** Deshabilita la interacción nativa */
|
|
82
|
+
disabled = false;
|
|
83
|
+
/** Estado de carga */
|
|
84
|
+
loading = false;
|
|
85
|
+
/** Variant: afecta colores y contraste */
|
|
86
|
+
variant = 'primary';
|
|
87
|
+
/** Tamaño */
|
|
88
|
+
size = 'primary';
|
|
89
|
+
/** Combina clases BEM según inputs */
|
|
90
|
+
get classes() {
|
|
91
|
+
const c = [
|
|
92
|
+
'c-button-icon',
|
|
93
|
+
`c-button-icon--${this.variant}`,
|
|
94
|
+
`c-button-icon--${this.size}`,
|
|
95
|
+
this.loading ? 'is-loading' : '',
|
|
96
|
+
this.disabled ? 'c-button-icon--disabled' : ''
|
|
97
|
+
];
|
|
98
|
+
return c.filter(Boolean).join(' ');
|
|
99
|
+
}
|
|
100
|
+
/** Para aria-label cuando no hay texto */
|
|
101
|
+
get computedAriaLabel() {
|
|
102
|
+
if (this.ariaLabel)
|
|
103
|
+
return this.ariaLabel;
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ButtonIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
107
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: ButtonIconComponent, isStandalone: true, selector: "lib-button-icon", inputs: { ariaLabel: "ariaLabel", disabled: "disabled", loading: "loading", variant: "variant", size: "size" }, ngImport: i0, template: "<button\n type=\"button\"\n [ngClass]=\"classes\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"computedAriaLabel\"\n [attr.aria-busy]=\"loading ? 'true' : null\"\n>\n <!-- Spinner visual -->\n <span *ngIf=\"loading\" class=\"c-button-icon__loading\" aria-hidden=\"true\"><lib-icon icon=\"spinner\" [extraClass]=\"disabled ? 'disabled' : variant \"></lib-icon></span>\n <!-- Icon antes (siempre queda el slot) -->\n <span *ngIf=\"!loading\" class=\"c-button-icon__icon\">\n <ng-content select=\"[iconBefore]\"></ng-content>\n </span>\n</button>\n", styles: [".c-button-icon{display:flex;align-items:center;gap:var(--space-component-gap-md);cursor:pointer;font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-md) var(--space-component-padding-md);border-radius:var(--size-button-border-radius);background-color:var(--color-button-primary-background-default);border:var(--size-button-border-width) solid var(--color-button-primary-background-default)}.c-button-icon:hover{background-color:var(--color-button-primary-background-hover);border:var(--size-button-border-width) solid var(--color-button-primary-background-hover)}.c-button-icon:focus{outline:2px solid var(--focus-outset)}.c-button-icon:pressed{background-color:var(--color-button-primary-background-processed);border:var(--size-button-border-width) solid var(--color-button-primary-background-processed)}.c-button-icon:disabled{background-color:var(--color-button-primary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-primary-background-disabled);color:var(--color-button-primary-content-disabled)}.c-button-icon__icon,.c-button-icon__loading{width:24px;height:24px}.c-button-icon--md{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm)}.c-button-icon--sm{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-xs) var(--space-component-padding-xs)}.c-button-icon--sm .c-button-icon__icon,.c-button-icon--sm .c-button-icon__loading{width:20px;height:20px}.c-button-icon--xs{gap:var(--space-component-gap-md);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-2xs) var(--space-component-padding-2xs)}.c-button-icon--xs .c-button-icon__icon,.c-button-icon--xs .c-button-icon__loading{width:16px;height:16px}.c-button-icon--secondary{background-color:transparent;border:var(--size-button-border-width) solid var(--color-button-secondary-border-default);color:var(--color-button-secondary-content-default)}.c-button-icon--secondary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--secondary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--secondary:disabled{background-color:var(--color-button-secondary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-secondary-background-disabled);color:var(--color-button-secondary-content-disabled)}.c-button-icon--tertiary{background-color:transparent;border:var(--size-button-border-width) solid transparent;color:var(--color-button-secondary-content-default)}.c-button-icon--tertiary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--tertiary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--tertiary:disabled{background-color:transparent;border:0;color:var(--color-button-secondary-content-disabled)}.c-button-icon--danger{background-color:var(--color-button-danger-background-default);border:var(--size-button-border-width) solid var(--color-button-danger-background-default);color:var(--color-button-danger-content-default)}.c-button-icon--danger:hover{background-color:var(--color-button-danger-background-hover);border:var(--size-button-border-width) solid var(--color-button-danger-background-hover)}.c-button-icon--danger:pressed{background-color:var(--color-action-danger-background-pressed);border:var(--size-button-border-width) solid var(--color-button-danger-background-pressed)}.c-button-icon--danger:disabled{background-color:var(--color-button-danger-background-disabled);color:var(--color-button-tertiary-content-disabled);border:var(--size-button-border-width) solid var(--color-button-danger-background-disabled)}.c-button-icon--inverse{background-color:var(--color-button-inverse-background-default);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default);color:var(--color-button-inverse-content-default)}.c-button-icon--inverse:hover{background-color:var(--color-button-inverse-background-hover);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default)}.c-button-icon--inverse:pressed{background-color:var(--color-action-inverse-background-pressed);border:var(--size-button-border-width) solid var(--color-button-inverse-background-pressed)}.c-button-icon--inverse:disabled{background-color:var(--color-button-inverse-background-disabled);color:var(--color-button-inverse-content-disabled);border:var(--size-button-border-width) solid var(--color-button-inverse-background-disabled)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ButtonIconComponent, decorators: [{
|
|
110
|
+
type: Component,
|
|
111
|
+
args: [{ selector: 'lib-button-icon', imports: [CommonModule, IconComponent], template: "<button\n type=\"button\"\n [ngClass]=\"classes\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"computedAriaLabel\"\n [attr.aria-busy]=\"loading ? 'true' : null\"\n>\n <!-- Spinner visual -->\n <span *ngIf=\"loading\" class=\"c-button-icon__loading\" aria-hidden=\"true\"><lib-icon icon=\"spinner\" [extraClass]=\"disabled ? 'disabled' : variant \"></lib-icon></span>\n <!-- Icon antes (siempre queda el slot) -->\n <span *ngIf=\"!loading\" class=\"c-button-icon__icon\">\n <ng-content select=\"[iconBefore]\"></ng-content>\n </span>\n</button>\n", styles: [".c-button-icon{display:flex;align-items:center;gap:var(--space-component-gap-md);cursor:pointer;font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-md) var(--space-component-padding-md);border-radius:var(--size-button-border-radius);background-color:var(--color-button-primary-background-default);border:var(--size-button-border-width) solid var(--color-button-primary-background-default)}.c-button-icon:hover{background-color:var(--color-button-primary-background-hover);border:var(--size-button-border-width) solid var(--color-button-primary-background-hover)}.c-button-icon:focus{outline:2px solid var(--focus-outset)}.c-button-icon:pressed{background-color:var(--color-button-primary-background-processed);border:var(--size-button-border-width) solid var(--color-button-primary-background-processed)}.c-button-icon:disabled{background-color:var(--color-button-primary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-primary-background-disabled);color:var(--color-button-primary-content-disabled)}.c-button-icon__icon,.c-button-icon__loading{width:24px;height:24px}.c-button-icon--md{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm)}.c-button-icon--sm{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-xs) var(--space-component-padding-xs)}.c-button-icon--sm .c-button-icon__icon,.c-button-icon--sm .c-button-icon__loading{width:20px;height:20px}.c-button-icon--xs{gap:var(--space-component-gap-md);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-2xs) var(--space-component-padding-2xs)}.c-button-icon--xs .c-button-icon__icon,.c-button-icon--xs .c-button-icon__loading{width:16px;height:16px}.c-button-icon--secondary{background-color:transparent;border:var(--size-button-border-width) solid var(--color-button-secondary-border-default);color:var(--color-button-secondary-content-default)}.c-button-icon--secondary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--secondary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--secondary:disabled{background-color:var(--color-button-secondary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-secondary-background-disabled);color:var(--color-button-secondary-content-disabled)}.c-button-icon--tertiary{background-color:transparent;border:var(--size-button-border-width) solid transparent;color:var(--color-button-secondary-content-default)}.c-button-icon--tertiary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--tertiary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--tertiary:disabled{background-color:transparent;border:0;color:var(--color-button-secondary-content-disabled)}.c-button-icon--danger{background-color:var(--color-button-danger-background-default);border:var(--size-button-border-width) solid var(--color-button-danger-background-default);color:var(--color-button-danger-content-default)}.c-button-icon--danger:hover{background-color:var(--color-button-danger-background-hover);border:var(--size-button-border-width) solid var(--color-button-danger-background-hover)}.c-button-icon--danger:pressed{background-color:var(--color-action-danger-background-pressed);border:var(--size-button-border-width) solid var(--color-button-danger-background-pressed)}.c-button-icon--danger:disabled{background-color:var(--color-button-danger-background-disabled);color:var(--color-button-tertiary-content-disabled);border:var(--size-button-border-width) solid var(--color-button-danger-background-disabled)}.c-button-icon--inverse{background-color:var(--color-button-inverse-background-default);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default);color:var(--color-button-inverse-content-default)}.c-button-icon--inverse:hover{background-color:var(--color-button-inverse-background-hover);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default)}.c-button-icon--inverse:pressed{background-color:var(--color-action-inverse-background-pressed);border:var(--size-button-border-width) solid var(--color-button-inverse-background-pressed)}.c-button-icon--inverse:disabled{background-color:var(--color-button-inverse-background-disabled);color:var(--color-button-inverse-content-disabled);border:var(--size-button-border-width) solid var(--color-button-inverse-background-disabled)}\n"] }]
|
|
112
|
+
}], propDecorators: { ariaLabel: [{
|
|
113
|
+
type: Input
|
|
114
|
+
}], disabled: [{
|
|
115
|
+
type: Input
|
|
116
|
+
}], loading: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}], variant: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], size: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}] } });
|
|
123
|
+
|
|
124
|
+
class AlertComponent {
|
|
125
|
+
variant = 'neutral';
|
|
126
|
+
text = '';
|
|
127
|
+
title = '';
|
|
128
|
+
time = 10;
|
|
129
|
+
extraClass = '';
|
|
130
|
+
showIcon = true;
|
|
131
|
+
visibility = true;
|
|
132
|
+
closeActive = false;
|
|
133
|
+
ngOnInit() {
|
|
134
|
+
setTimeout(() => {
|
|
135
|
+
this.close();
|
|
136
|
+
}, this.time * 1000);
|
|
137
|
+
}
|
|
138
|
+
close() {
|
|
139
|
+
this.closeActive = true;
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.visibility = false;
|
|
142
|
+
}, 1000);
|
|
143
|
+
}
|
|
144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AlertComponent, isStandalone: true, selector: "lib-alert", inputs: { variant: "variant", text: "text", title: "title", time: "time", extraClass: "extraClass", showIcon: "showIcon" }, ngImport: i0, template: "<div role=\"alert\" *ngIf=\"visibility\" [ngClass]=\"['c-alert', variant ? 'c-alert--' + variant : '', extraClass ? extraClass : '', closeActive ? 'c-alert--hide': '']\">\n <lib-icon *ngIf=\"showIcon\" [icon]=\"variant\" size=\"lg\" />\n <div class=\"c-alert__content\">\n <p class=\"c-alert__title\">{{ title }}</p>\n <p class=\"c-alert__text\">{{ text }}</p>\n </div>\n <lib-button-icon\n role=\"button\"\n [ariaLabel]=\"variant\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-alert__close\"\n (click)=\"close()\"\n >\n <lib-icon icon=\"close\" size=\"sm\" iconBefore />\n </lib-button-icon>\n</div>", styles: ["@keyframes toast-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes toast-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}.c-alert{position:fixed;width:22.5rem;top:10px;right:10px;z-index:10;padding:var(--space-component-padding-lg) var(--space-component-padding-md);border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-core-border-soft);background:var(--color-core-background-surface-raised);gap:.5rem;box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;align-items:flex-start;transition:opacity .3s ease,transform .3s ease;animation:toast-in .3s ease forwards}.c-alert--alert{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-danger-surface-border);background:var(--color-feedback-danger-surface-background)}.c-alert--success{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-success-surface-border);background:var(--color-feedback-success-surface-background)}.c-alert--warning{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-warning-surface-border);background:var(--color-feedback-warning-surface-background)}.c-alert--info{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-info-surface-border);background:var(--color-feedback-info-surface-background)}.c-alert--neutral{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-core-border-default);background:var(--color-core-background-neutral-soft)}.c-alert__content{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:var(--space-component-gap-sm)}.c-alert__close{justify-self:flex-end;margin:0 0 0 auto}.c-alert__title{color:var(--color-core-content-default);font-family:var(--typography-title-sm-family);font-size:var(--typography-title-sm-size);font-style:normal;font-weight:var(--typography-title-sm-weight);line-height:var(--typography-title-sm-line-height);letter-spacing:var(--typography-title-sm-letter-spacing);margin:0 0 auto}.c-alert__text{color:var(--color-core-content-soft);font-family:var(--typography-body-sm-family);font-size:var(--typography-body-sm-size);font-style:normal;font-weight:var(--typography-body-sm-weight);line-height:var(--typography-body-sm-line-height);letter-spacing:var(--typography-body-sm-letter-spacing);margin:0 0 auto}.c-alert--hide{animation:toast-out .3s ease forwards}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }] });
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AlertComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'lib-alert', imports: [CommonModule, IconComponent, ButtonIconComponent], template: "<div role=\"alert\" *ngIf=\"visibility\" [ngClass]=\"['c-alert', variant ? 'c-alert--' + variant : '', extraClass ? extraClass : '', closeActive ? 'c-alert--hide': '']\">\n <lib-icon *ngIf=\"showIcon\" [icon]=\"variant\" size=\"lg\" />\n <div class=\"c-alert__content\">\n <p class=\"c-alert__title\">{{ title }}</p>\n <p class=\"c-alert__text\">{{ text }}</p>\n </div>\n <lib-button-icon\n role=\"button\"\n [ariaLabel]=\"variant\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-alert__close\"\n (click)=\"close()\"\n >\n <lib-icon icon=\"close\" size=\"sm\" iconBefore />\n </lib-button-icon>\n</div>", styles: ["@keyframes toast-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes toast-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}.c-alert{position:fixed;width:22.5rem;top:10px;right:10px;z-index:10;padding:var(--space-component-padding-lg) var(--space-component-padding-md);border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-core-border-soft);background:var(--color-core-background-surface-raised);gap:.5rem;box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;align-items:flex-start;transition:opacity .3s ease,transform .3s ease;animation:toast-in .3s ease forwards}.c-alert--alert{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-danger-surface-border);background:var(--color-feedback-danger-surface-background)}.c-alert--success{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-success-surface-border);background:var(--color-feedback-success-surface-background)}.c-alert--warning{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-warning-surface-border);background:var(--color-feedback-warning-surface-background)}.c-alert--info{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-feedback-info-surface-border);background:var(--color-feedback-info-surface-background)}.c-alert--neutral{border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-core-border-default);background:var(--color-core-background-neutral-soft)}.c-alert__content{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:var(--space-component-gap-sm)}.c-alert__close{justify-self:flex-end;margin:0 0 0 auto}.c-alert__title{color:var(--color-core-content-default);font-family:var(--typography-title-sm-family);font-size:var(--typography-title-sm-size);font-style:normal;font-weight:var(--typography-title-sm-weight);line-height:var(--typography-title-sm-line-height);letter-spacing:var(--typography-title-sm-letter-spacing);margin:0 0 auto}.c-alert__text{color:var(--color-core-content-soft);font-family:var(--typography-body-sm-family);font-size:var(--typography-body-sm-size);font-style:normal;font-weight:var(--typography-body-sm-weight);line-height:var(--typography-body-sm-line-height);letter-spacing:var(--typography-body-sm-letter-spacing);margin:0 0 auto}.c-alert--hide{animation:toast-out .3s ease forwards}\n"] }]
|
|
150
|
+
}], propDecorators: { variant: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], text: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], title: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], time: [{
|
|
157
|
+
type: Input
|
|
158
|
+
}], extraClass: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}], showIcon: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}] } });
|
|
163
|
+
|
|
28
164
|
class AvatarComponent {
|
|
29
165
|
size = 'lg';
|
|
30
166
|
initial = '';
|
|
@@ -46,6 +182,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
46
182
|
type: Input
|
|
47
183
|
}] } });
|
|
48
184
|
|
|
185
|
+
class BadgeComponent {
|
|
186
|
+
extraClass = '';
|
|
187
|
+
text = '';
|
|
188
|
+
showText = true;
|
|
189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
190
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: BadgeComponent, isStandalone: true, selector: "lib-badge", inputs: { extraClass: "extraClass", text: "text", showText: "showText" }, ngImport: i0, template: "<span [ngClass]=\"['c-badge',showText ? 'c-badge--text' : '', extraClass ? extraClass : '']\">\n <ng-container *ngIf=\"showText && text\">\n {{ text }}\n </ng-container>\n</span>", styles: [".c-badge{border-radius:.75rem;border:2px solid var(--color-core-border-inverse);background:var(--color-feedback-danger-default);display:flex;width:.5rem;height:.5rem;flex-direction:column;justify-content:center;align-items:center;flex-shrink:0;color:var(--color-core-content-inverse);text-align:center;font-family:var(--typography-label-xs-strong-family);font-size:var(--typography-label-xs-strong-size);font-style:normal;font-weight:var(--typography-label-xs-strong-weight);line-height:var(--typography-label-xs-strong-line-height);letter-spacing:var(--typography-label-xs-strong-letter-spacing)}.c-badge--text{width:1.25rem;height:1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
191
|
+
}
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
193
|
+
type: Component,
|
|
194
|
+
args: [{ selector: 'lib-badge', imports: [CommonModule], template: "<span [ngClass]=\"['c-badge',showText ? 'c-badge--text' : '', extraClass ? extraClass : '']\">\n <ng-container *ngIf=\"showText && text\">\n {{ text }}\n </ng-container>\n</span>", styles: [".c-badge{border-radius:.75rem;border:2px solid var(--color-core-border-inverse);background:var(--color-feedback-danger-default);display:flex;width:.5rem;height:.5rem;flex-direction:column;justify-content:center;align-items:center;flex-shrink:0;color:var(--color-core-content-inverse);text-align:center;font-family:var(--typography-label-xs-strong-family);font-size:var(--typography-label-xs-strong-size);font-style:normal;font-weight:var(--typography-label-xs-strong-weight);line-height:var(--typography-label-xs-strong-line-height);letter-spacing:var(--typography-label-xs-strong-letter-spacing)}.c-badge--text{width:1.25rem;height:1.25rem}\n"] }]
|
|
195
|
+
}], propDecorators: { extraClass: [{
|
|
196
|
+
type: Input
|
|
197
|
+
}], text: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}], showText: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}] } });
|
|
202
|
+
|
|
49
203
|
class ButtonComponent {
|
|
50
204
|
text;
|
|
51
205
|
ariaLabel;
|
|
@@ -105,52 +259,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
105
259
|
args: ['iconAfter', { read: ElementRef }]
|
|
106
260
|
}] } });
|
|
107
261
|
|
|
108
|
-
class ButtonIconComponent {
|
|
109
|
-
/** Si es un icon‑only button, pon aquí su etiqueta accesible */
|
|
110
|
-
ariaLabel;
|
|
111
|
-
/** Deshabilita la interacción nativa */
|
|
112
|
-
disabled = false;
|
|
113
|
-
/** Estado de carga */
|
|
114
|
-
loading = false;
|
|
115
|
-
/** Variant: afecta colores y contraste */
|
|
116
|
-
variant = 'primary';
|
|
117
|
-
/** Tamaño */
|
|
118
|
-
size = 'primary';
|
|
119
|
-
/** Combina clases BEM según inputs */
|
|
120
|
-
get classes() {
|
|
121
|
-
const c = [
|
|
122
|
-
'c-button-icon',
|
|
123
|
-
`c-button-icon--${this.variant}`,
|
|
124
|
-
`c-button-icon--${this.size}`,
|
|
125
|
-
this.loading ? 'is-loading' : '',
|
|
126
|
-
this.disabled ? 'c-button-icon--disabled' : ''
|
|
127
|
-
];
|
|
128
|
-
return c.filter(Boolean).join(' ');
|
|
129
|
-
}
|
|
130
|
-
/** Para aria-label cuando no hay texto */
|
|
131
|
-
get computedAriaLabel() {
|
|
132
|
-
if (this.ariaLabel)
|
|
133
|
-
return this.ariaLabel;
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ButtonIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
137
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: ButtonIconComponent, isStandalone: true, selector: "lib-button-icon", inputs: { ariaLabel: "ariaLabel", disabled: "disabled", loading: "loading", variant: "variant", size: "size" }, ngImport: i0, template: "<button\n type=\"button\"\n [ngClass]=\"classes\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"computedAriaLabel\"\n [attr.aria-busy]=\"loading ? 'true' : null\"\n>\n <!-- Spinner visual -->\n <span *ngIf=\"loading\" class=\"c-button-icon__loading\" aria-hidden=\"true\"><lib-icon icon=\"spinner\" [extraClass]=\"disabled ? 'disabled' : variant \"></lib-icon></span>\n <!-- Icon antes (siempre queda el slot) -->\n <span *ngIf=\"!loading\" class=\"c-button-icon__icon\">\n <ng-content select=\"[iconBefore]\"></ng-content>\n </span>\n</button>\n", styles: [".c-button-icon{display:flex;align-items:center;gap:var(--space-component-gap-md);cursor:pointer;font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-md) var(--space-component-padding-md);border-radius:var(--size-button-border-radius);background-color:var(--color-button-primary-background-default);border:var(--size-button-border-width) solid var(--color-button-primary-background-default)}.c-button-icon:hover{background-color:var(--color-button-primary-background-hover);border:var(--size-button-border-width) solid var(--color-button-primary-background-hover)}.c-button-icon:focus{outline:2px solid var(--focus-outset)}.c-button-icon:pressed{background-color:var(--color-button-primary-background-processed);border:var(--size-button-border-width) solid var(--color-button-primary-background-processed)}.c-button-icon:disabled{background-color:var(--color-button-primary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-primary-background-disabled);color:var(--color-button-primary-content-disabled)}.c-button-icon__icon,.c-button-icon__loading{width:24px;height:24px}.c-button-icon--md{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm)}.c-button-icon--sm{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-xs) var(--space-component-padding-xs)}.c-button-icon--sm .c-button-icon__icon,.c-button-icon--sm .c-button-icon__loading{width:20px;height:20px}.c-button-icon--xs{gap:var(--space-component-gap-md);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-2xs) var(--space-component-padding-2xs)}.c-button-icon--xs .c-button-icon__icon,.c-button-icon--xs .c-button-icon__loading{width:16px;height:16px}.c-button-icon--secondary{background-color:transparent;border:var(--size-button-border-width) solid var(--color-button-secondary-border-default);color:var(--color-button-secondary-content-default)}.c-button-icon--secondary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--secondary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--secondary:disabled{background-color:var(--color-button-secondary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-secondary-background-disabled);color:var(--color-button-secondary-content-disabled)}.c-button-icon--tertiary{background-color:transparent;border:var(--size-button-border-width) solid transparent;color:var(--color-button-secondary-content-default)}.c-button-icon--tertiary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--tertiary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--tertiary:disabled{background-color:transparent;border:0;color:var(--color-button-secondary-content-disabled)}.c-button-icon--danger{background-color:var(--color-button-danger-background-default);border:var(--size-button-border-width) solid var(--color-button-danger-background-default);color:var(--color-button-danger-content-default)}.c-button-icon--danger:hover{background-color:var(--color-button-danger-background-hover);border:var(--size-button-border-width) solid var(--color-button-danger-background-hover)}.c-button-icon--danger:pressed{background-color:var(--color-action-danger-background-pressed);border:var(--size-button-border-width) solid var(--color-button-danger-background-pressed)}.c-button-icon--danger:disabled{background-color:var(--color-button-danger-background-disabled);color:var(--color-button-tertiary-content-disabled);border:var(--size-button-border-width) solid var(--color-button-danger-background-disabled)}.c-button-icon--inverse{background-color:var(--color-button-inverse-background-default);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default);color:var(--color-button-inverse-content-default)}.c-button-icon--inverse:hover{background-color:var(--color-button-inverse-background-hover);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default)}.c-button-icon--inverse:pressed{background-color:var(--color-action-inverse-background-pressed);border:var(--size-button-border-width) solid var(--color-button-inverse-background-pressed)}.c-button-icon--inverse:disabled{background-color:var(--color-button-inverse-background-disabled);color:var(--color-button-inverse-content-disabled);border:var(--size-button-border-width) solid var(--color-button-inverse-background-disabled)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
138
|
-
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ButtonIconComponent, decorators: [{
|
|
140
|
-
type: Component,
|
|
141
|
-
args: [{ selector: 'lib-button-icon', imports: [CommonModule, IconComponent], template: "<button\n type=\"button\"\n [ngClass]=\"classes\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"computedAriaLabel\"\n [attr.aria-busy]=\"loading ? 'true' : null\"\n>\n <!-- Spinner visual -->\n <span *ngIf=\"loading\" class=\"c-button-icon__loading\" aria-hidden=\"true\"><lib-icon icon=\"spinner\" [extraClass]=\"disabled ? 'disabled' : variant \"></lib-icon></span>\n <!-- Icon antes (siempre queda el slot) -->\n <span *ngIf=\"!loading\" class=\"c-button-icon__icon\">\n <ng-content select=\"[iconBefore]\"></ng-content>\n </span>\n</button>\n", styles: [".c-button-icon{display:flex;align-items:center;gap:var(--space-component-gap-md);cursor:pointer;font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-md) var(--space-component-padding-md);border-radius:var(--size-button-border-radius);background-color:var(--color-button-primary-background-default);border:var(--size-button-border-width) solid var(--color-button-primary-background-default)}.c-button-icon:hover{background-color:var(--color-button-primary-background-hover);border:var(--size-button-border-width) solid var(--color-button-primary-background-hover)}.c-button-icon:focus{outline:2px solid var(--focus-outset)}.c-button-icon:pressed{background-color:var(--color-button-primary-background-processed);border:var(--size-button-border-width) solid var(--color-button-primary-background-processed)}.c-button-icon:disabled{background-color:var(--color-button-primary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-primary-background-disabled);color:var(--color-button-primary-content-disabled)}.c-button-icon__icon,.c-button-icon__loading{width:24px;height:24px}.c-button-icon--md{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm)}.c-button-icon--sm{gap:var(--space-component-gap-md);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-md-strong-weight);font-size:var(--typography-label-md-strong-size);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-xs) var(--space-component-padding-xs)}.c-button-icon--sm .c-button-icon__icon,.c-button-icon--sm .c-button-icon__loading{width:20px;height:20px}.c-button-icon--xs{gap:var(--space-component-gap-md);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-button-primary-content-default);padding:var(--space-component-padding-2xs) var(--space-component-padding-2xs)}.c-button-icon--xs .c-button-icon__icon,.c-button-icon--xs .c-button-icon__loading{width:16px;height:16px}.c-button-icon--secondary{background-color:transparent;border:var(--size-button-border-width) solid var(--color-button-secondary-border-default);color:var(--color-button-secondary-content-default)}.c-button-icon--secondary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--secondary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--secondary:disabled{background-color:var(--color-button-secondary-background-disabled);border:var(--size-button-border-width) solid var(--color-button-secondary-background-disabled);color:var(--color-button-secondary-content-disabled)}.c-button-icon--tertiary{background-color:transparent;border:var(--size-button-border-width) solid transparent;color:var(--color-button-secondary-content-default)}.c-button-icon--tertiary:hover{background-color:var(--color-button-secondary-background-hover)}.c-button-icon--tertiary:pressed{background-color:var(--color-button-secondary-background-processed)}.c-button-icon--tertiary:disabled{background-color:transparent;border:0;color:var(--color-button-secondary-content-disabled)}.c-button-icon--danger{background-color:var(--color-button-danger-background-default);border:var(--size-button-border-width) solid var(--color-button-danger-background-default);color:var(--color-button-danger-content-default)}.c-button-icon--danger:hover{background-color:var(--color-button-danger-background-hover);border:var(--size-button-border-width) solid var(--color-button-danger-background-hover)}.c-button-icon--danger:pressed{background-color:var(--color-action-danger-background-pressed);border:var(--size-button-border-width) solid var(--color-button-danger-background-pressed)}.c-button-icon--danger:disabled{background-color:var(--color-button-danger-background-disabled);color:var(--color-button-tertiary-content-disabled);border:var(--size-button-border-width) solid var(--color-button-danger-background-disabled)}.c-button-icon--inverse{background-color:var(--color-button-inverse-background-default);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default);color:var(--color-button-inverse-content-default)}.c-button-icon--inverse:hover{background-color:var(--color-button-inverse-background-hover);border:var(--size-button-border-width) solid var(--color-button-inverse-border-default)}.c-button-icon--inverse:pressed{background-color:var(--color-action-inverse-background-pressed);border:var(--size-button-border-width) solid var(--color-button-inverse-background-pressed)}.c-button-icon--inverse:disabled{background-color:var(--color-button-inverse-background-disabled);color:var(--color-button-inverse-content-disabled);border:var(--size-button-border-width) solid var(--color-button-inverse-background-disabled)}\n"] }]
|
|
142
|
-
}], propDecorators: { ariaLabel: [{
|
|
143
|
-
type: Input
|
|
144
|
-
}], disabled: [{
|
|
145
|
-
type: Input
|
|
146
|
-
}], loading: [{
|
|
147
|
-
type: Input
|
|
148
|
-
}], variant: [{
|
|
149
|
-
type: Input
|
|
150
|
-
}], size: [{
|
|
151
|
-
type: Input
|
|
152
|
-
}] } });
|
|
153
|
-
|
|
154
262
|
// libs/link/src/lib/link/link.component.ts
|
|
155
263
|
class LinkComponent {
|
|
156
264
|
text = '';
|
|
@@ -225,6 +333,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
225
333
|
type: Input
|
|
226
334
|
}] } });
|
|
227
335
|
|
|
336
|
+
class HelperTextComponent {
|
|
337
|
+
variant = 'default';
|
|
338
|
+
text = '';
|
|
339
|
+
extraClass = '';
|
|
340
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: HelperTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
341
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: HelperTextComponent, isStandalone: true, selector: "lib-helper-text", inputs: { variant: "variant", text: "text", extraClass: "extraClass" }, ngImport: i0, template: "<span [ngClass]=\"['c-helper', variant ? 'c-helper--' + variant : '', extraClass ? extraClass : '']\">\n <lib-icon *ngIf=\"variant !== 'default'\" [icon]=\"variant\" size=\"md\" />{{ text }}\n</span>", styles: [".c-helper{display:flex;color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);gap:var(--space-component-gap-sm)}.c-helper.is-error{color:var(--color-textfield-helper-error)}.c-helper.is-success{color:var(--color-textfield-helper-success)}.c-helper.is-default{color:var(--color-textfield-helper-default)}.c-helper--alert{color:var(--color-feedback-danger-default)}.c-helper--warning{color:var(--color-feedback-warning-default)}.c-helper--success{color:var(--color-feedback-success-default)}.c-helper--info{color:var(--color-feedback-info-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
342
|
+
}
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: HelperTextComponent, decorators: [{
|
|
344
|
+
type: Component,
|
|
345
|
+
args: [{ selector: 'lib-helper-text', imports: [CommonModule, IconComponent], template: "<span [ngClass]=\"['c-helper', variant ? 'c-helper--' + variant : '', extraClass ? extraClass : '']\">\n <lib-icon *ngIf=\"variant !== 'default'\" [icon]=\"variant\" size=\"md\" />{{ text }}\n</span>", styles: [".c-helper{display:flex;color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);gap:var(--space-component-gap-sm)}.c-helper.is-error{color:var(--color-textfield-helper-error)}.c-helper.is-success{color:var(--color-textfield-helper-success)}.c-helper.is-default{color:var(--color-textfield-helper-default)}.c-helper--alert{color:var(--color-feedback-danger-default)}.c-helper--warning{color:var(--color-feedback-warning-default)}.c-helper--success{color:var(--color-feedback-success-default)}.c-helper--info{color:var(--color-feedback-info-default)}\n"] }]
|
|
346
|
+
}], propDecorators: { variant: [{
|
|
347
|
+
type: Input
|
|
348
|
+
}], text: [{
|
|
349
|
+
type: Input
|
|
350
|
+
}], extraClass: [{
|
|
351
|
+
type: Input
|
|
352
|
+
}] } });
|
|
353
|
+
|
|
228
354
|
class CheckboxComponent {
|
|
229
355
|
label = '';
|
|
230
356
|
id = '';
|
|
@@ -294,24 +420,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
294
420
|
type: Output
|
|
295
421
|
}] } });
|
|
296
422
|
|
|
297
|
-
class HelperTextComponent {
|
|
298
|
-
variant = 'default';
|
|
299
|
-
text = '';
|
|
300
|
-
extraClass = '';
|
|
301
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: HelperTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
302
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: HelperTextComponent, isStandalone: true, selector: "lib-helper-text", inputs: { variant: "variant", text: "text", extraClass: "extraClass" }, ngImport: i0, template: "<span [ngClass]=\"['c-helper', variant ? 'c-helper--' + variant : '', extraClass ? extraClass : '']\">\n <lib-icon *ngIf=\"variant !== 'default'\" [icon]=\"variant\" size=\"md\" />{{ text }}\n</span>", styles: [".c-helper{display:flex;color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);gap:var(--space-component-gap-sm)}.c-helper.is-error{color:var(--color-textfield-helper-error)}.c-helper.is-success{color:var(--color-textfield-helper-success)}.c-helper.is-default{color:var(--color-textfield-helper-default)}.c-helper--alert{color:var(--color-feedback-danger-default)}.c-helper--warning{color:var(--color-feedback-warning-default)}.c-helper--success{color:var(--color-feedback-success-default)}.c-helper--info{color:var(--color-feedback-info-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
303
|
-
}
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: HelperTextComponent, decorators: [{
|
|
305
|
-
type: Component,
|
|
306
|
-
args: [{ selector: 'lib-helper-text', imports: [CommonModule, IconComponent], template: "<span [ngClass]=\"['c-helper', variant ? 'c-helper--' + variant : '', extraClass ? extraClass : '']\">\n <lib-icon *ngIf=\"variant !== 'default'\" [icon]=\"variant\" size=\"md\" />{{ text }}\n</span>", styles: [".c-helper{display:flex;color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);gap:var(--space-component-gap-sm)}.c-helper.is-error{color:var(--color-textfield-helper-error)}.c-helper.is-success{color:var(--color-textfield-helper-success)}.c-helper.is-default{color:var(--color-textfield-helper-default)}.c-helper--alert{color:var(--color-feedback-danger-default)}.c-helper--warning{color:var(--color-feedback-warning-default)}.c-helper--success{color:var(--color-feedback-success-default)}.c-helper--info{color:var(--color-feedback-info-default)}\n"] }]
|
|
307
|
-
}], propDecorators: { variant: [{
|
|
308
|
-
type: Input
|
|
309
|
-
}], text: [{
|
|
310
|
-
type: Input
|
|
311
|
-
}], extraClass: [{
|
|
312
|
-
type: Input
|
|
313
|
-
}] } });
|
|
314
|
-
|
|
315
423
|
class InputLabelComponent {
|
|
316
424
|
text = '';
|
|
317
425
|
required = false;
|
|
@@ -434,7 +542,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
434
542
|
args: [{ selector: 'lib-design-tokens', imports: [CommonModule], template: "<p>DesignTokens works!</p>\n" }]
|
|
435
543
|
}] });
|
|
436
544
|
|
|
437
|
-
class
|
|
545
|
+
class InputDateComponent {
|
|
438
546
|
label = '';
|
|
439
547
|
placeholder = '';
|
|
440
548
|
helperText = '';
|
|
@@ -448,7 +556,6 @@ class PasswordInputComponent {
|
|
|
448
556
|
size = 'md';
|
|
449
557
|
emitValue = new EventEmitter();
|
|
450
558
|
_value = '';
|
|
451
|
-
showPassword = false;
|
|
452
559
|
onChangeFn = () => { };
|
|
453
560
|
onTouchedFn = () => { };
|
|
454
561
|
writeValue(value) {
|
|
@@ -463,9 +570,6 @@ class PasswordInputComponent {
|
|
|
463
570
|
setDisabledState(isDisabled) {
|
|
464
571
|
this.disabled = isDisabled;
|
|
465
572
|
}
|
|
466
|
-
get inputType() {
|
|
467
|
-
return this.showPassword ? 'text' : 'password';
|
|
468
|
-
}
|
|
469
573
|
get inputClass() {
|
|
470
574
|
return [
|
|
471
575
|
'c-text-input__input',
|
|
@@ -473,14 +577,14 @@ class PasswordInputComponent {
|
|
|
473
577
|
this.error ? 'is-error' : '',
|
|
474
578
|
this.success ? 'is-success' : '',
|
|
475
579
|
this.disabled ? 'is-disabled' : '',
|
|
476
|
-
this.readonly ? 'is-readonly' : ''
|
|
580
|
+
this.readonly ? 'is-readonly' : '',
|
|
477
581
|
].filter(Boolean);
|
|
478
582
|
}
|
|
479
583
|
get ariaDescribedBy() {
|
|
480
584
|
return this.helperText ? 'password-input-helper' : null;
|
|
481
585
|
}
|
|
482
|
-
|
|
483
|
-
|
|
586
|
+
toggleCalendar() {
|
|
587
|
+
console.log('Toggle calendar functionality not implemented yet.');
|
|
484
588
|
}
|
|
485
589
|
onInput(event) {
|
|
486
590
|
const input = event.target;
|
|
@@ -491,18 +595,18 @@ class PasswordInputComponent {
|
|
|
491
595
|
onBlur() {
|
|
492
596
|
this.onTouchedFn();
|
|
493
597
|
}
|
|
494
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
495
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type:
|
|
598
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
599
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: InputDateComponent, isStandalone: true, selector: "lib-input-date", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", size: "size" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
496
600
|
{
|
|
497
601
|
provide: NG_VALUE_ACCESSOR,
|
|
498
|
-
useExisting: forwardRef(() =>
|
|
602
|
+
useExisting: forwardRef(() => InputDateComponent),
|
|
499
603
|
multi: true
|
|
500
604
|
}
|
|
501
|
-
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [
|
|
605
|
+
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"text\"\n [value]=\"_value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [required]=\"required\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n aria-label=\"date\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <lib-button-icon\n ariaLabel=\"Calendario\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__toggle\"\n (click)=\"toggleCalendar()\"\n >\n <lib-icon icon=\"calendar\" size=\"md\" iconBefore />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__toggle{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
502
606
|
}
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputDateComponent, decorators: [{
|
|
504
608
|
type: Component,
|
|
505
|
-
args: [{ selector: 'lib-
|
|
609
|
+
args: [{ selector: 'lib-input-date', standalone: true, imports: [
|
|
506
610
|
CommonModule,
|
|
507
611
|
ReactiveFormsModule,
|
|
508
612
|
InputLabelComponent,
|
|
@@ -512,10 +616,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
512
616
|
], providers: [
|
|
513
617
|
{
|
|
514
618
|
provide: NG_VALUE_ACCESSOR,
|
|
515
|
-
useExisting: forwardRef(() =>
|
|
619
|
+
useExisting: forwardRef(() => InputDateComponent),
|
|
516
620
|
multi: true
|
|
517
621
|
}
|
|
518
|
-
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [
|
|
622
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"text\"\n [value]=\"_value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [required]=\"required\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n aria-label=\"date\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <lib-button-icon\n ariaLabel=\"Calendario\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__toggle\"\n (click)=\"toggleCalendar()\"\n >\n <lib-icon icon=\"calendar\" size=\"md\" iconBefore />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__toggle{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"] }]
|
|
519
623
|
}], propDecorators: { label: [{
|
|
520
624
|
type: Input
|
|
521
625
|
}], placeholder: [{
|
|
@@ -542,19 +646,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
542
646
|
type: Output
|
|
543
647
|
}] } });
|
|
544
648
|
|
|
545
|
-
class
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
649
|
+
class InputNumberComponent {
|
|
650
|
+
label = '';
|
|
651
|
+
placeholder = '';
|
|
652
|
+
helperText = '';
|
|
653
|
+
alertText = '';
|
|
654
|
+
successText = '';
|
|
550
655
|
error = false;
|
|
656
|
+
success = false;
|
|
551
657
|
disabled = false;
|
|
552
|
-
|
|
553
|
-
|
|
658
|
+
required = false;
|
|
659
|
+
readonly = false;
|
|
660
|
+
size = 'md';
|
|
661
|
+
variant = 'default';
|
|
662
|
+
value = 0;
|
|
663
|
+
emitValue = new EventEmitter();
|
|
554
664
|
onChangeFn = () => { };
|
|
555
665
|
onTouchedFn = () => { };
|
|
556
666
|
writeValue(value) {
|
|
557
|
-
this.
|
|
667
|
+
this.value = value ?? 0;
|
|
558
668
|
}
|
|
559
669
|
registerOnChange(fn) {
|
|
560
670
|
this.onChangeFn = fn;
|
|
@@ -565,152 +675,123 @@ class RadioComponent {
|
|
|
565
675
|
setDisabledState(isDisabled) {
|
|
566
676
|
this.disabled = isDisabled;
|
|
567
677
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
678
|
+
get inputClass() {
|
|
679
|
+
return [
|
|
680
|
+
'c-text-input__input',
|
|
681
|
+
`c-text-input__input--${this.size}`,
|
|
682
|
+
this.error ? 'is-error' : '',
|
|
683
|
+
this.success ? 'is-success' : '',
|
|
684
|
+
this.disabled ? 'is-disabled' : '',
|
|
685
|
+
this.readonly ? 'is-readonly' : '',
|
|
686
|
+
].filter(Boolean);
|
|
687
|
+
}
|
|
688
|
+
get ariaDescribedBy() {
|
|
689
|
+
return this.helperText ? 'search-input-helper' : null;
|
|
690
|
+
}
|
|
691
|
+
onType(event) {
|
|
692
|
+
const input = event.target;
|
|
693
|
+
const newVal = input.value === '' ? 0 : Number(input.value);
|
|
694
|
+
this.value = newVal;
|
|
695
|
+
this.onChangeFn(newVal);
|
|
696
|
+
this.emitValue.emit(newVal);
|
|
697
|
+
}
|
|
698
|
+
upNumber() {
|
|
699
|
+
this.value++;
|
|
700
|
+
this.onChangeFn(this.value);
|
|
701
|
+
this.emitValue.emit(this.value);
|
|
702
|
+
}
|
|
703
|
+
downNumber() {
|
|
704
|
+
this.value--;
|
|
705
|
+
this.onChangeFn(this.value);
|
|
706
|
+
this.emitValue.emit(this.value);
|
|
572
707
|
}
|
|
573
708
|
onBlur() {
|
|
574
709
|
this.onTouchedFn();
|
|
575
710
|
}
|
|
576
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
577
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type:
|
|
711
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
712
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: InputNumberComponent, isStandalone: true, selector: "lib-input-number", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", required: "required", readonly: "readonly", size: "size", variant: "variant" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
578
713
|
{
|
|
579
714
|
provide: NG_VALUE_ACCESSOR,
|
|
580
|
-
useExisting: forwardRef(() =>
|
|
715
|
+
useExisting: forwardRef(() => InputNumberComponent),
|
|
581
716
|
multi: true
|
|
582
717
|
}
|
|
583
|
-
], ngImport: i0, template: "<div class=\"c-
|
|
718
|
+
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div\n class=\"c-text-input__wrapper\"\n [class.c-text-input__wrapper--right]=\"variant === 'right'\"\n >\n <input\n type=\"number\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n aria-label=\"number\"\n (input)=\"onType($event)\"\n (blur)=\"onBlur()\"\n />\n <lib-button-icon\n ariaLabel=\"menos\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__less\"\n (click)=\"downNumber()\"\n >\n <lib-icon icon=\"less\" size=\"md\" iconBefore />\n </lib-button-icon>\n <lib-button-icon\n ariaLabel=\"m\u00E1s\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__up\"\n (click)=\"upNumber()\"\n >\n <lib-icon icon=\"plus\" size=\"md\" iconBefore />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"search-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) 2rem var(--space-component-padding-sm) 2rem;align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing);text-align:center}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm,.c-text-input__input--md{padding:var(--space-component-padding-xs) 2rem var(--space-component-padding-xs) 2rem}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__up{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.c-text-input__less{position:absolute;top:50%;left:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__wrapper--right .c-text-input__less{position:absolute;top:50%;right:calc(2rem + var(--space-component-padding-sm));transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;left:initial}.c-text-input__wrapper--right .c-text-input__up{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
584
719
|
}
|
|
585
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputNumberComponent, decorators: [{
|
|
586
721
|
type: Component,
|
|
587
|
-
args: [{ selector: 'lib-
|
|
722
|
+
args: [{ selector: 'lib-input-number', standalone: true, imports: [
|
|
723
|
+
CommonModule,
|
|
724
|
+
ReactiveFormsModule,
|
|
725
|
+
InputLabelComponent,
|
|
726
|
+
IconComponent,
|
|
727
|
+
ButtonIconComponent,
|
|
728
|
+
HelperTextComponent
|
|
729
|
+
], providers: [
|
|
588
730
|
{
|
|
589
731
|
provide: NG_VALUE_ACCESSOR,
|
|
590
|
-
useExisting: forwardRef(() =>
|
|
732
|
+
useExisting: forwardRef(() => InputNumberComponent),
|
|
591
733
|
multi: true
|
|
592
734
|
}
|
|
593
|
-
], template: "<div class=\"c-
|
|
594
|
-
}], propDecorators: { id: [{
|
|
595
|
-
type: Input
|
|
596
|
-
}], name: [{
|
|
597
|
-
type: Input
|
|
598
|
-
}], value: [{
|
|
599
|
-
type: Input
|
|
600
|
-
}], label: [{
|
|
601
|
-
type: Input
|
|
602
|
-
}], error: [{
|
|
603
|
-
type: Input
|
|
604
|
-
}], disabled: [{
|
|
605
|
-
type: Input
|
|
606
|
-
}], modelChange: [{
|
|
607
|
-
type: Output
|
|
608
|
-
}] } });
|
|
609
|
-
|
|
610
|
-
class RadioGroupComponent {
|
|
611
|
-
label = '';
|
|
612
|
-
name = '';
|
|
613
|
-
options = [];
|
|
614
|
-
value = '';
|
|
615
|
-
error = false;
|
|
616
|
-
helperText = '';
|
|
617
|
-
required = false;
|
|
618
|
-
valueChange = new EventEmitter();
|
|
619
|
-
onChange(value) {
|
|
620
|
-
this.value = value;
|
|
621
|
-
this.valueChange.emit(value);
|
|
622
|
-
}
|
|
623
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
624
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: RadioGroupComponent, isStandalone: true, selector: "lib-radio-group", inputs: { label: "label", name: "name", options: "options", value: "value", error: "error", helperText: "helperText", required: "required" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<fieldset [attr.aria-invalid]=\"error\" class=\"c-radio-group\">\n <legend class=\"sr-only\">{{ label }}</legend>\n <lib-input-label [text]=\"label\" [required]=\"required\" />\n \n <div class=\"c-radio-group__options\">\n <lib-radio\n *ngFor=\"let option of options\"\n [label]=\"option.label\"\n [value]=\"option.value\"\n [name]=\"name\"\n [error]=\"error\"\n (change)=\"onChange(option.value)\"\n />\n </div>\n <p *ngIf=\"helperText\" class=\"c-radio-group__helper\"><lib-icon icon=\"alert\" class=\"c-radio-group__icon\" size=\"md\"/>{{ helperText }}</p>\n</fieldset>\n", styles: [".c-radio-group{display:flex;flex-direction:column;gap:var(--space-container-gap-sm);border:0;padding:0}.c-radio-group__options{display:flex;flex-direction:column;gap:var(--space-container-gap-md);padding-left:6px}.c-radio-group__helper{display:flex;align-items:center;gap:var(--space-component-gap-sm);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-size);line-height:var(--typography-label-sm-line-height);letter-spacing:var(--typography-label-sm-letter-spacing);color:var(--color-feedback-danger-default);padding:0;margin:0}.c-radio-group__icon{display:flex}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RadioComponent, selector: "lib-radio", inputs: ["id", "name", "value", "label", "error", "disabled"], outputs: ["modelChange"] }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
625
|
-
}
|
|
626
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RadioGroupComponent, decorators: [{
|
|
627
|
-
type: Component,
|
|
628
|
-
args: [{ selector: 'lib-radio-group', standalone: true, imports: [CommonModule, RadioComponent, InputLabelComponent, IconComponent], template: "<fieldset [attr.aria-invalid]=\"error\" class=\"c-radio-group\">\n <legend class=\"sr-only\">{{ label }}</legend>\n <lib-input-label [text]=\"label\" [required]=\"required\" />\n \n <div class=\"c-radio-group__options\">\n <lib-radio\n *ngFor=\"let option of options\"\n [label]=\"option.label\"\n [value]=\"option.value\"\n [name]=\"name\"\n [error]=\"error\"\n (change)=\"onChange(option.value)\"\n />\n </div>\n <p *ngIf=\"helperText\" class=\"c-radio-group__helper\"><lib-icon icon=\"alert\" class=\"c-radio-group__icon\" size=\"md\"/>{{ helperText }}</p>\n</fieldset>\n", styles: [".c-radio-group{display:flex;flex-direction:column;gap:var(--space-container-gap-sm);border:0;padding:0}.c-radio-group__options{display:flex;flex-direction:column;gap:var(--space-container-gap-md);padding-left:6px}.c-radio-group__helper{display:flex;align-items:center;gap:var(--space-component-gap-sm);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-size);line-height:var(--typography-label-sm-line-height);letter-spacing:var(--typography-label-sm-letter-spacing);color:var(--color-feedback-danger-default);padding:0;margin:0}.c-radio-group__icon{display:flex}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
|
|
735
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div\n class=\"c-text-input__wrapper\"\n [class.c-text-input__wrapper--right]=\"variant === 'right'\"\n >\n <input\n type=\"number\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n aria-label=\"number\"\n (input)=\"onType($event)\"\n (blur)=\"onBlur()\"\n />\n <lib-button-icon\n ariaLabel=\"menos\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__less\"\n (click)=\"downNumber()\"\n >\n <lib-icon icon=\"less\" size=\"md\" iconBefore />\n </lib-button-icon>\n <lib-button-icon\n ariaLabel=\"m\u00E1s\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__up\"\n (click)=\"upNumber()\"\n >\n <lib-icon icon=\"plus\" size=\"md\" iconBefore />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"search-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) 2rem var(--space-component-padding-sm) 2rem;align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing);text-align:center}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm,.c-text-input__input--md{padding:var(--space-component-padding-xs) 2rem var(--space-component-padding-xs) 2rem}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__up{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.c-text-input__less{position:absolute;top:50%;left:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__wrapper--right .c-text-input__less{position:absolute;top:50%;right:calc(2rem + var(--space-component-padding-sm));transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;left:initial}.c-text-input__wrapper--right .c-text-input__up{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}\n"] }]
|
|
629
736
|
}], propDecorators: { label: [{
|
|
630
737
|
type: Input
|
|
631
|
-
}],
|
|
738
|
+
}], placeholder: [{
|
|
632
739
|
type: Input
|
|
633
|
-
}],
|
|
740
|
+
}], helperText: [{
|
|
634
741
|
type: Input
|
|
635
|
-
}],
|
|
742
|
+
}], alertText: [{
|
|
743
|
+
type: Input
|
|
744
|
+
}], successText: [{
|
|
636
745
|
type: Input
|
|
637
746
|
}], error: [{
|
|
638
747
|
type: Input
|
|
639
|
-
}],
|
|
748
|
+
}], success: [{
|
|
749
|
+
type: Input
|
|
750
|
+
}], disabled: [{
|
|
640
751
|
type: Input
|
|
641
752
|
}], required: [{
|
|
642
753
|
type: Input
|
|
643
|
-
}],
|
|
644
|
-
type: Output
|
|
645
|
-
}] } });
|
|
646
|
-
|
|
647
|
-
class SegmentedControlComponent {
|
|
648
|
-
options = [];
|
|
649
|
-
selectedValue;
|
|
650
|
-
selectionChange = new EventEmitter();
|
|
651
|
-
fill = true;
|
|
652
|
-
/** Cuando el usuario hace click en un segmento */
|
|
653
|
-
onSelect(option) {
|
|
654
|
-
if (this.selectedValue !== option.value) {
|
|
655
|
-
this.selectedValue = option.value;
|
|
656
|
-
this.selectionChange.emit(this.selectedValue);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
/** Marca si ésta opción está activa */
|
|
660
|
-
isSelected(option) {
|
|
661
|
-
return this.selectedValue === option.value;
|
|
662
|
-
}
|
|
663
|
-
/** Manejo simple de flechas izquierda/derecha */
|
|
664
|
-
onKeydown(event) {
|
|
665
|
-
const idx = this.options.findIndex(o => this.isSelected(o));
|
|
666
|
-
if (event.key === 'ArrowRight' && idx < this.options.length - 1) {
|
|
667
|
-
this.onSelect(this.options[idx + 1]);
|
|
668
|
-
event.preventDefault();
|
|
669
|
-
}
|
|
670
|
-
if (event.key === 'ArrowLeft' && idx > 0) {
|
|
671
|
-
this.onSelect(this.options[idx - 1]);
|
|
672
|
-
event.preventDefault();
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
676
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: SegmentedControlComponent, isStandalone: true, selector: "lib-segmented-control", inputs: { options: "options", selectedValue: "selectedValue", fill: "fill" }, outputs: { selectionChange: "selectionChange" }, host: { listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0, template: "<div role=\"radiogroup\" [ngClass]=\"{'c-segmented-control': true,'c-segmented-control--fill': fill}\">\n <label\n *ngFor=\"let option of options; let i = index\"\n role=\"radio\"\n [attr.aria-checked]=\"isSelected(option)\"\n [attr.tabindex]=\"isSelected(option) ? 0 : -1\"\n class=\"c-segmented-control__item\"\n (click)=\"onSelect(option)\"\n (keydown.enter)=\"onSelect(option)\"\n (keydown.space)=\"onSelect(option)\"\n >\n <!-- Input real, oculto -->\n <input\n type=\"radio\"\n [value]=\"option.value\"\n [checked]=\"isSelected(option)\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n hidden\n />\n {{ option.label }}\n </label>\n</div>\n ", styles: ["@charset \"UTF-8\";.c-segmented-control{display:inline-flex;overflow:hidden}.c-segmented-control--fill{width:100%}.c-segmented-control__item{position:relative;width:100%;padding:var(--space-component-padding-sm);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid var(--color-action-primary-border-default);text-align:center;font-family:var(--typography-label-sm-default-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-default-size);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);color:var(--color-action-primary-content-default)}.c-segmented-control__item:not(:last-child){border-right:none}.c-segmented-control__item:first-child{border-radius:12px 0 0 12px}.c-segmented-control__item:last-child{border-radius:0 12px 12px 0}.c-segmented-control__item:hover\\a0 {background-color:var(--color-action-primary-background-hover);color:var(--color-action-primary-content-hover)}.c-segmented-control__item:pressed{background-color:var(--color-action-primary-background-pressed);color:var(--color-core-content-default)}.c-segmented-control__item:selected{background-color:var(--color-action-primary-background-selected);color:var(--color-action-primary-selected-content-default)}.c-segmented-control__item:focus{outline:2px solid var(--color-decorative-primary-default);font-weight:var(--typography-label-sm-strong-weight);color:var(--color-action-alternative-selected);z-index:1}.c-segmented-control__item[aria-checked=true]{background:var(--color-action-primary-selected-background-default);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-action-primary-selected-content-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
677
|
-
}
|
|
678
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
679
|
-
type: Component,
|
|
680
|
-
args: [{ selector: 'lib-segmented-control', imports: [CommonModule], template: "<div role=\"radiogroup\" [ngClass]=\"{'c-segmented-control': true,'c-segmented-control--fill': fill}\">\n <label\n *ngFor=\"let option of options; let i = index\"\n role=\"radio\"\n [attr.aria-checked]=\"isSelected(option)\"\n [attr.tabindex]=\"isSelected(option) ? 0 : -1\"\n class=\"c-segmented-control__item\"\n (click)=\"onSelect(option)\"\n (keydown.enter)=\"onSelect(option)\"\n (keydown.space)=\"onSelect(option)\"\n >\n <!-- Input real, oculto -->\n <input\n type=\"radio\"\n [value]=\"option.value\"\n [checked]=\"isSelected(option)\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n hidden\n />\n {{ option.label }}\n </label>\n</div>\n ", styles: ["@charset \"UTF-8\";.c-segmented-control{display:inline-flex;overflow:hidden}.c-segmented-control--fill{width:100%}.c-segmented-control__item{position:relative;width:100%;padding:var(--space-component-padding-sm);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid var(--color-action-primary-border-default);text-align:center;font-family:var(--typography-label-sm-default-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-default-size);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);color:var(--color-action-primary-content-default)}.c-segmented-control__item:not(:last-child){border-right:none}.c-segmented-control__item:first-child{border-radius:12px 0 0 12px}.c-segmented-control__item:last-child{border-radius:0 12px 12px 0}.c-segmented-control__item:hover\\a0 {background-color:var(--color-action-primary-background-hover);color:var(--color-action-primary-content-hover)}.c-segmented-control__item:pressed{background-color:var(--color-action-primary-background-pressed);color:var(--color-core-content-default)}.c-segmented-control__item:selected{background-color:var(--color-action-primary-background-selected);color:var(--color-action-primary-selected-content-default)}.c-segmented-control__item:focus{outline:2px solid var(--color-decorative-primary-default);font-weight:var(--typography-label-sm-strong-weight);color:var(--color-action-alternative-selected);z-index:1}.c-segmented-control__item[aria-checked=true]{background:var(--color-action-primary-selected-background-default);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-action-primary-selected-content-default)}\n"] }]
|
|
681
|
-
}], propDecorators: { options: [{
|
|
754
|
+
}], readonly: [{
|
|
682
755
|
type: Input
|
|
683
|
-
}],
|
|
756
|
+
}], size: [{
|
|
684
757
|
type: Input
|
|
685
|
-
}],
|
|
686
|
-
type: Output
|
|
687
|
-
}], fill: [{
|
|
758
|
+
}], variant: [{
|
|
688
759
|
type: Input
|
|
689
|
-
}],
|
|
690
|
-
type:
|
|
691
|
-
args: ['keydown', ['$event']]
|
|
760
|
+
}], emitValue: [{
|
|
761
|
+
type: Output
|
|
692
762
|
}] } });
|
|
693
763
|
|
|
694
|
-
class
|
|
764
|
+
class InputPaymentComponent {
|
|
695
765
|
label = '';
|
|
696
|
-
name = '';
|
|
697
766
|
placeholder = '';
|
|
698
767
|
helperText = '';
|
|
768
|
+
alertText = '';
|
|
769
|
+
successText = '';
|
|
699
770
|
error = false;
|
|
700
771
|
success = false;
|
|
701
|
-
successText = '';
|
|
702
|
-
alertText = '';
|
|
703
772
|
disabled = false;
|
|
704
773
|
readonly = false;
|
|
705
774
|
required = false;
|
|
706
|
-
type = 'text';
|
|
707
775
|
size = 'md';
|
|
708
|
-
|
|
709
|
-
|
|
776
|
+
emitCardNumber = new EventEmitter();
|
|
777
|
+
emitDateValue = new EventEmitter();
|
|
778
|
+
dateInput;
|
|
779
|
+
cardNumberRaw = '';
|
|
780
|
+
cardNumberDisplay = '';
|
|
781
|
+
dateNumberRaw = '';
|
|
782
|
+
dateNumberDisplay = '';
|
|
710
783
|
onChangeFn = () => { };
|
|
711
784
|
onTouchedFn = () => { };
|
|
712
785
|
writeValue(value) {
|
|
713
|
-
|
|
786
|
+
if (!value) {
|
|
787
|
+
this.cardNumberRaw = '';
|
|
788
|
+
this.cardNumberDisplay = '';
|
|
789
|
+
this.dateNumberRaw = '';
|
|
790
|
+
this.dateNumberDisplay = '';
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
this.formatCard(value.card || '');
|
|
794
|
+
this.formatDate(value.date || '');
|
|
714
795
|
}
|
|
715
796
|
registerOnChange(fn) {
|
|
716
797
|
this.onChangeFn = fn;
|
|
@@ -721,72 +802,111 @@ class TextInputComponent {
|
|
|
721
802
|
setDisabledState(isDisabled) {
|
|
722
803
|
this.disabled = isDisabled;
|
|
723
804
|
}
|
|
805
|
+
onCardInput(event) {
|
|
806
|
+
const input = event.target;
|
|
807
|
+
const digitsOnly = input.value.replace(/\D+/g, '');
|
|
808
|
+
const truncated = digitsOnly.slice(0, 16);
|
|
809
|
+
this.cardNumberRaw = truncated;
|
|
810
|
+
const groups = [];
|
|
811
|
+
for (let i = 0; i < truncated.length; i += 4) {
|
|
812
|
+
groups.push(truncated.substr(i, 4));
|
|
813
|
+
}
|
|
814
|
+
this.cardNumberDisplay = groups.join(' ');
|
|
815
|
+
input.value = this.cardNumberDisplay;
|
|
816
|
+
if (truncated.length === 16) {
|
|
817
|
+
this.dateInput.nativeElement.focus();
|
|
818
|
+
}
|
|
819
|
+
this.emitCardNumber.emit(this.cardNumberRaw);
|
|
820
|
+
this.onChangeFn({ card: this.cardNumberRaw, date: this.dateNumberRaw });
|
|
821
|
+
}
|
|
822
|
+
onDateInput(event) {
|
|
823
|
+
const input = event.target;
|
|
824
|
+
const digitsOnly = input.value.replace(/\D+/g, '');
|
|
825
|
+
const truncated = digitsOnly.slice(0, 4);
|
|
826
|
+
this.dateNumberRaw = truncated;
|
|
827
|
+
const groups = [];
|
|
828
|
+
for (let i = 0; i < truncated.length; i += 2) {
|
|
829
|
+
groups.push(truncated.substr(i, 2));
|
|
830
|
+
}
|
|
831
|
+
this.dateNumberDisplay = groups.join('/');
|
|
832
|
+
input.value = this.dateNumberDisplay;
|
|
833
|
+
this.emitDateValue.emit(this.dateNumberDisplay);
|
|
834
|
+
this.onChangeFn({ card: this.cardNumberRaw, date: this.dateNumberRaw });
|
|
835
|
+
}
|
|
836
|
+
/** marca como “tocado” */
|
|
837
|
+
onBlur() {
|
|
838
|
+
this.onTouchedFn();
|
|
839
|
+
}
|
|
724
840
|
get inputClass() {
|
|
725
841
|
return [
|
|
726
842
|
'c-text-input__input',
|
|
727
843
|
`c-text-input__input--${this.size}`,
|
|
728
|
-
this.error ? 'is-error' :
|
|
844
|
+
this.error ? 'is-error' : '',
|
|
845
|
+
this.success ? 'is-success' : '',
|
|
729
846
|
this.disabled ? 'is-disabled' : '',
|
|
730
847
|
this.readonly ? 'is-readonly' : ''
|
|
731
848
|
].filter(Boolean);
|
|
732
849
|
}
|
|
733
|
-
get helperClass() {
|
|
734
|
-
if (this.error)
|
|
735
|
-
return 'is-error';
|
|
736
|
-
if (this.success)
|
|
737
|
-
return 'is-success';
|
|
738
|
-
return 'is-default';
|
|
739
|
-
}
|
|
740
850
|
get ariaDescribedBy() {
|
|
741
|
-
return this.helperText ? '
|
|
742
|
-
}
|
|
743
|
-
onInput(event) {
|
|
744
|
-
const input = event.target;
|
|
745
|
-
this._value = input.value;
|
|
746
|
-
this.onChangeFn(this._value);
|
|
747
|
-
this.emitValue.emit(this._value);
|
|
851
|
+
return this.helperText ? 'search-input-helper' : null;
|
|
748
852
|
}
|
|
749
|
-
|
|
750
|
-
|
|
853
|
+
formatCard(raw) {
|
|
854
|
+
const digitsOnly = raw.replace(/\D+/g, '');
|
|
855
|
+
const truncated = digitsOnly.slice(0, 16);
|
|
856
|
+
this.cardNumberRaw = truncated;
|
|
857
|
+
const groups = [];
|
|
858
|
+
for (let i = 0; i < truncated.length; i += 4) {
|
|
859
|
+
groups.push(truncated.substr(i, 4));
|
|
860
|
+
}
|
|
861
|
+
this.cardNumberDisplay = groups.join(' ');
|
|
862
|
+
}
|
|
863
|
+
formatDate(raw) {
|
|
864
|
+
const digitsOnly = raw.replace(/\D+/g, '');
|
|
865
|
+
const truncated = digitsOnly.slice(0, 4);
|
|
866
|
+
this.dateNumberRaw = truncated;
|
|
867
|
+
const groups = [];
|
|
868
|
+
for (let i = 0; i < truncated.length; i += 2) {
|
|
869
|
+
groups.push(truncated.substr(i, 2));
|
|
870
|
+
}
|
|
871
|
+
this.dateNumberDisplay = groups.join('/');
|
|
751
872
|
}
|
|
752
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
753
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type:
|
|
873
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputPaymentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
874
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: InputPaymentComponent, isStandalone: true, selector: "lib-input-payment", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", size: "size" }, outputs: { emitCardNumber: "emitCardNumber", emitDateValue: "emitDateValue" }, providers: [
|
|
754
875
|
{
|
|
755
876
|
provide: NG_VALUE_ACCESSOR,
|
|
756
|
-
useExisting: forwardRef(() =>
|
|
877
|
+
useExisting: forwardRef(() => InputPaymentComponent),
|
|
757
878
|
multi: true
|
|
758
879
|
}
|
|
759
|
-
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label
|
|
880
|
+
], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true }], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n [value]=\"cardNumberDisplay\"\n (input)=\"onCardInput($event)\"\n (blur)=\"onBlur()\"\n />\n <input\n #dateInput\n type=\"text\"\n inputmode=\"numeric\"\n placeholder=\"dd/mm\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n class=\"c-text-input__mini\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n [value]=\"dateNumberDisplay\"\n (input)=\"onDateInput($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"c-text-input__icon\">\n <lib-icon [icon]=\"disabled ? 'card-disabled' : 'card'\" size=\"md\"></lib-icon>\n </span>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) 2rem;align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{outline:none}.c-text-input__input--sm,.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) 2rem}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__wrapper:focus-within input:first-of-type{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__icon{position:absolute;top:50%;left:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.c-text-input__mini{position:absolute;right:7px;border:0;height:calc(100% - 4px);top:0;bottom:0;margin:auto;border-radius:8px;width:81px;text-align:right;font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__mini:focus{outline:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
760
881
|
}
|
|
761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
882
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputPaymentComponent, decorators: [{
|
|
762
883
|
type: Component,
|
|
763
|
-
args: [{ selector: 'lib-
|
|
884
|
+
args: [{ selector: 'lib-input-payment', standalone: true, imports: [
|
|
764
885
|
CommonModule,
|
|
765
886
|
ReactiveFormsModule,
|
|
766
887
|
InputLabelComponent,
|
|
767
|
-
IconComponent
|
|
888
|
+
IconComponent,
|
|
889
|
+
HelperTextComponent
|
|
768
890
|
], providers: [
|
|
769
891
|
{
|
|
770
892
|
provide: NG_VALUE_ACCESSOR,
|
|
771
|
-
useExisting: forwardRef(() =>
|
|
893
|
+
useExisting: forwardRef(() => InputPaymentComponent),
|
|
772
894
|
multi: true
|
|
773
895
|
}
|
|
774
|
-
], template: "<div class=\"c-text-input\">\n <lib-input-label
|
|
896
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n [value]=\"cardNumberDisplay\"\n (input)=\"onCardInput($event)\"\n (blur)=\"onBlur()\"\n />\n <input\n #dateInput\n type=\"text\"\n inputmode=\"numeric\"\n placeholder=\"dd/mm\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n class=\"c-text-input__mini\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n [value]=\"dateNumberDisplay\"\n (input)=\"onDateInput($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"c-text-input__icon\">\n <lib-icon [icon]=\"disabled ? 'card-disabled' : 'card'\" size=\"md\"></lib-icon>\n </span>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) 2rem;align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{outline:none}.c-text-input__input--sm,.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) 2rem}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__wrapper:focus-within input:first-of-type{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__icon{position:absolute;top:50%;left:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.c-text-input__mini{position:absolute;right:7px;border:0;height:calc(100% - 4px);top:0;bottom:0;margin:auto;border-radius:8px;width:81px;text-align:right;font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__mini:focus{outline:none}\n"] }]
|
|
775
897
|
}], propDecorators: { label: [{
|
|
776
898
|
type: Input
|
|
777
|
-
}], name: [{
|
|
778
|
-
type: Input
|
|
779
899
|
}], placeholder: [{
|
|
780
900
|
type: Input
|
|
781
901
|
}], helperText: [{
|
|
782
902
|
type: Input
|
|
783
|
-
}],
|
|
784
|
-
type: Input
|
|
785
|
-
}], success: [{
|
|
903
|
+
}], alertText: [{
|
|
786
904
|
type: Input
|
|
787
905
|
}], successText: [{
|
|
788
906
|
type: Input
|
|
789
|
-
}],
|
|
907
|
+
}], error: [{
|
|
908
|
+
type: Input
|
|
909
|
+
}], success: [{
|
|
790
910
|
type: Input
|
|
791
911
|
}], disabled: [{
|
|
792
912
|
type: Input
|
|
@@ -794,23 +914,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
794
914
|
type: Input
|
|
795
915
|
}], required: [{
|
|
796
916
|
type: Input
|
|
797
|
-
}], type: [{
|
|
798
|
-
type: Input
|
|
799
917
|
}], size: [{
|
|
800
918
|
type: Input
|
|
801
|
-
}],
|
|
919
|
+
}], emitCardNumber: [{
|
|
802
920
|
type: Output
|
|
921
|
+
}], emitDateValue: [{
|
|
922
|
+
type: Output
|
|
923
|
+
}], dateInput: [{
|
|
924
|
+
type: ViewChild,
|
|
925
|
+
args: ['dateInput']
|
|
803
926
|
}] } });
|
|
804
927
|
|
|
805
|
-
class
|
|
928
|
+
class InputSearchComponent {
|
|
806
929
|
label = '';
|
|
807
930
|
placeholder = '';
|
|
808
931
|
helperText = '';
|
|
932
|
+
alertText = '';
|
|
933
|
+
successText = '';
|
|
809
934
|
error = false;
|
|
810
935
|
success = false;
|
|
811
|
-
successText = '';
|
|
812
|
-
alertText = '';
|
|
813
|
-
name = '';
|
|
814
936
|
disabled = false;
|
|
815
937
|
readonly = false;
|
|
816
938
|
required = false;
|
|
@@ -831,39 +953,41 @@ class TextareaComponent {
|
|
|
831
953
|
setDisabledState(isDisabled) {
|
|
832
954
|
this.disabled = isDisabled;
|
|
833
955
|
}
|
|
956
|
+
// ------------------------------
|
|
957
|
+
onInput(event) {
|
|
958
|
+
const input = event.target;
|
|
959
|
+
this._value = input.value;
|
|
960
|
+
this.onChangeFn(this._value);
|
|
961
|
+
this.emitValue.emit(this._value);
|
|
962
|
+
}
|
|
963
|
+
onBlur() {
|
|
964
|
+
this.onTouchedFn();
|
|
965
|
+
}
|
|
834
966
|
get inputClass() {
|
|
835
967
|
return [
|
|
836
968
|
'c-text-input__input',
|
|
837
969
|
`c-text-input__input--${this.size}`,
|
|
838
|
-
this.error ? 'is-error' :
|
|
970
|
+
this.error ? 'is-error' : '',
|
|
971
|
+
this.success ? 'is-success' : '',
|
|
839
972
|
this.disabled ? 'is-disabled' : '',
|
|
840
973
|
this.readonly ? 'is-readonly' : ''
|
|
841
974
|
].filter(Boolean);
|
|
842
975
|
}
|
|
843
976
|
get ariaDescribedBy() {
|
|
844
|
-
return this.helperText ? '
|
|
845
|
-
}
|
|
846
|
-
onInput(event) {
|
|
847
|
-
const input = event.target;
|
|
848
|
-
this._value = input.value;
|
|
849
|
-
this.onChangeFn(this._value);
|
|
850
|
-
this.emitValue.emit(this._value);
|
|
851
|
-
}
|
|
852
|
-
onBlur() {
|
|
853
|
-
this.onTouchedFn();
|
|
977
|
+
return this.helperText ? 'search-input-helper' : null;
|
|
854
978
|
}
|
|
855
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
856
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type:
|
|
979
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
980
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: InputSearchComponent, isStandalone: true, selector: "lib-input-search", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", size: "size" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
857
981
|
{
|
|
858
982
|
provide: NG_VALUE_ACCESSOR,
|
|
859
|
-
useExisting: forwardRef(() =>
|
|
983
|
+
useExisting: forwardRef(() => InputSearchComponent),
|
|
860
984
|
multi: true
|
|
861
985
|
}
|
|
862
|
-
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label
|
|
986
|
+
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"text\"\n [value]=\"_value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.aria-label]=\"label ? label : 'Search input'\"\n />\n <span class=\"c-text-input__icon\">\n <lib-icon icon=\"search\" size=\"md\"></lib-icon>\n </span>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"search-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) 2rem;align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm,.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) 2rem}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__icon{position:absolute;top:50%;left:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
863
987
|
}
|
|
864
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputSearchComponent, decorators: [{
|
|
865
989
|
type: Component,
|
|
866
|
-
args: [{ selector: 'lib-
|
|
990
|
+
args: [{ selector: 'lib-input-search', standalone: true, imports: [
|
|
867
991
|
CommonModule,
|
|
868
992
|
ReactiveFormsModule,
|
|
869
993
|
InputLabelComponent,
|
|
@@ -872,25 +996,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
872
996
|
], providers: [
|
|
873
997
|
{
|
|
874
998
|
provide: NG_VALUE_ACCESSOR,
|
|
875
|
-
useExisting: forwardRef(() =>
|
|
999
|
+
useExisting: forwardRef(() => InputSearchComponent),
|
|
876
1000
|
multi: true
|
|
877
1001
|
}
|
|
878
|
-
], template: "<div class=\"c-text-input\">\n <lib-input-label
|
|
1002
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"text\"\n [value]=\"_value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [required]=\"required\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.aria-label]=\"label ? label : 'Search input'\"\n />\n <span class=\"c-text-input__icon\">\n <lib-icon icon=\"search\" size=\"md\"></lib-icon>\n </span>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"search-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) 2rem;align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm,.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) 2rem}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__icon{position:absolute;top:50%;left:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"] }]
|
|
879
1003
|
}], propDecorators: { label: [{
|
|
880
1004
|
type: Input
|
|
881
1005
|
}], placeholder: [{
|
|
882
1006
|
type: Input
|
|
883
1007
|
}], helperText: [{
|
|
884
1008
|
type: Input
|
|
885
|
-
}],
|
|
886
|
-
type: Input
|
|
887
|
-
}], success: [{
|
|
1009
|
+
}], alertText: [{
|
|
888
1010
|
type: Input
|
|
889
1011
|
}], successText: [{
|
|
890
1012
|
type: Input
|
|
891
|
-
}],
|
|
1013
|
+
}], error: [{
|
|
892
1014
|
type: Input
|
|
893
|
-
}],
|
|
1015
|
+
}], success: [{
|
|
894
1016
|
type: Input
|
|
895
1017
|
}], disabled: [{
|
|
896
1018
|
type: Input
|
|
@@ -904,52 +1026,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
904
1026
|
type: Output
|
|
905
1027
|
}] } });
|
|
906
1028
|
|
|
907
|
-
class
|
|
908
|
-
size = 'xl';
|
|
909
|
-
src = '';
|
|
910
|
-
alt = '';
|
|
911
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ThumbnailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
912
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: ThumbnailComponent, isStandalone: true, selector: "lib-thumbnail", inputs: { size: "size", src: "src", alt: "alt" }, ngImport: i0, template: "<figure [ngClass]=\"['c-thumbnail','c-thumbnail__' + size, !src ? 'c-thumbnail--no-img' : '']\">\n <img *ngIf=\"src\" [src]=\"src\" [alt]=\"alt\" class=\"c-thumbnail__img\" />\n <lib-icon icon=\"thumb\" *ngIf=\"!src\" [size]=\"size === 'xl' ? 'lg' : size\"/>\n</figure>\n", styles: [".c-thumbnail{display:flex;align-items:center;justify-content:center;border-radius:var(--size-border-radius-md);overflow:hidden}.c-thumbnail__img{width:100%;height:100%;object-fit:cover;object-position:center}.c-thumbnail--no-img{border:1px solid var(--color-core-border-soft);background:var(--color-core-background-default)}.c-thumbnail__xl{width:5rem;height:5rem}.c-thumbnail__lg{width:3.75rem;height:3.75rem}.c-thumbnail__md{width:2.5rem;height:2.5rem}.c-thumbnail__sm{width:1.5rem;height:1.5rem;border-radius:var(--size-border-radius-sm)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
913
|
-
}
|
|
914
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ThumbnailComponent, decorators: [{
|
|
915
|
-
type: Component,
|
|
916
|
-
args: [{ selector: 'lib-thumbnail', imports: [CommonModule, IconComponent], template: "<figure [ngClass]=\"['c-thumbnail','c-thumbnail__' + size, !src ? 'c-thumbnail--no-img' : '']\">\n <img *ngIf=\"src\" [src]=\"src\" [alt]=\"alt\" class=\"c-thumbnail__img\" />\n <lib-icon icon=\"thumb\" *ngIf=\"!src\" [size]=\"size === 'xl' ? 'lg' : size\"/>\n</figure>\n", styles: [".c-thumbnail{display:flex;align-items:center;justify-content:center;border-radius:var(--size-border-radius-md);overflow:hidden}.c-thumbnail__img{width:100%;height:100%;object-fit:cover;object-position:center}.c-thumbnail--no-img{border:1px solid var(--color-core-border-soft);background:var(--color-core-background-default)}.c-thumbnail__xl{width:5rem;height:5rem}.c-thumbnail__lg{width:3.75rem;height:3.75rem}.c-thumbnail__md{width:2.5rem;height:2.5rem}.c-thumbnail__sm{width:1.5rem;height:1.5rem;border-radius:var(--size-border-radius-sm)}\n"] }]
|
|
917
|
-
}], propDecorators: { size: [{
|
|
918
|
-
type: Input
|
|
919
|
-
}], src: [{
|
|
920
|
-
type: Input
|
|
921
|
-
}], alt: [{
|
|
922
|
-
type: Input
|
|
923
|
-
}] } });
|
|
924
|
-
|
|
925
|
-
let nextId = 0;
|
|
926
|
-
class TooltipComponent {
|
|
927
|
-
text = '';
|
|
928
|
-
position = 'top';
|
|
929
|
-
triggerId = `tooltip-trigger-${++nextId}`;
|
|
930
|
-
tooltipId = `tooltip-${this.triggerId}`;
|
|
931
|
-
visible = true;
|
|
932
|
-
show() {
|
|
933
|
-
this.visible = true;
|
|
934
|
-
}
|
|
935
|
-
hide() {
|
|
936
|
-
// this.visible = false;
|
|
937
|
-
}
|
|
938
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
939
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TooltipComponent, isStandalone: true, selector: "lib-tooltip", inputs: { text: "text", position: "position", triggerId: "triggerId" }, ngImport: i0, template: "<div [attr.role]=\"'tooltip'\" *ngIf=\"visible\" [class]=\"['c-tooltip', 'c-tooltip--' + position]\" [attr.id]=\"triggerId\">\n <ng-content></ng-content>\n \n <div\n class=\"c-tooltip__text\"\n [attr.id]=\"tooltipId\"\n [class]=\"position\"\n >\n {{ text }}\n </div>\n </div>\n ", styles: [".c-tooltip{position:absolute;z-index:100;border-radius:var(--size-border-radius-sm);background:var(--color-core-background-surface-floating);box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;max-width:9rem;padding:var(--space-component-padding-md);flex-direction:column;justify-content:center;align-items:flex-start;color:var(--color-core-content-soft);font-family:var(--typography-body-xs-family);font-size:var(--typography-body-xs-size);font-style:normal;font-weight:var(--typography-body-xs-weight);line-height:var(--typography-body-xs-line-height);letter-spacing:var(--typography-body-xs-letter-spacing)}.c-tooltip--bottom{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--left{left:100%;top:50%;transform:translate(.5rem) translateY(-50%)}.c-tooltip--left:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-right:16px solid var(--color-core-background-surface-floating);bottom:0;left:-.5rem;top:0;margin:auto 0}.c-tooltip--top{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--right{right:100%;top:50%;transform:translate(-.5rem) translateY(-50%)}.c-tooltip--right:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-left:16px solid var(--color-core-background-surface-floating);bottom:0;right:-.5rem;top:0;margin:auto 0}.c-tooltip--bottom-left{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--bottom-right{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;right:.75rem;margin:0 auto}.c-tooltip--top-left{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--top-right{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;right:.75rem;margin:0 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
940
|
-
}
|
|
941
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
942
|
-
type: Component,
|
|
943
|
-
args: [{ selector: 'lib-tooltip', standalone: true, imports: [CommonModule], template: "<div [attr.role]=\"'tooltip'\" *ngIf=\"visible\" [class]=\"['c-tooltip', 'c-tooltip--' + position]\" [attr.id]=\"triggerId\">\n <ng-content></ng-content>\n \n <div\n class=\"c-tooltip__text\"\n [attr.id]=\"tooltipId\"\n [class]=\"position\"\n >\n {{ text }}\n </div>\n </div>\n ", styles: [".c-tooltip{position:absolute;z-index:100;border-radius:var(--size-border-radius-sm);background:var(--color-core-background-surface-floating);box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;max-width:9rem;padding:var(--space-component-padding-md);flex-direction:column;justify-content:center;align-items:flex-start;color:var(--color-core-content-soft);font-family:var(--typography-body-xs-family);font-size:var(--typography-body-xs-size);font-style:normal;font-weight:var(--typography-body-xs-weight);line-height:var(--typography-body-xs-line-height);letter-spacing:var(--typography-body-xs-letter-spacing)}.c-tooltip--bottom{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--left{left:100%;top:50%;transform:translate(.5rem) translateY(-50%)}.c-tooltip--left:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-right:16px solid var(--color-core-background-surface-floating);bottom:0;left:-.5rem;top:0;margin:auto 0}.c-tooltip--top{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--right{right:100%;top:50%;transform:translate(-.5rem) translateY(-50%)}.c-tooltip--right:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-left:16px solid var(--color-core-background-surface-floating);bottom:0;right:-.5rem;top:0;margin:auto 0}.c-tooltip--bottom-left{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--bottom-right{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;right:.75rem;margin:0 auto}.c-tooltip--top-left{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--top-right{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;right:.75rem;margin:0 auto}\n"] }]
|
|
944
|
-
}], propDecorators: { text: [{
|
|
945
|
-
type: Input
|
|
946
|
-
}], position: [{
|
|
947
|
-
type: Input
|
|
948
|
-
}], triggerId: [{
|
|
949
|
-
type: Input
|
|
950
|
-
}] } });
|
|
951
|
-
|
|
952
|
-
class InputDateComponent {
|
|
1029
|
+
class InputUploadComponent {
|
|
953
1030
|
label = '';
|
|
954
1031
|
placeholder = '';
|
|
955
1032
|
helperText = '';
|
|
@@ -961,12 +1038,19 @@ class InputDateComponent {
|
|
|
961
1038
|
readonly = false;
|
|
962
1039
|
required = false;
|
|
963
1040
|
size = 'md';
|
|
1041
|
+
allowedExtensions = [];
|
|
964
1042
|
emitValue = new EventEmitter();
|
|
965
|
-
|
|
1043
|
+
fileInput;
|
|
1044
|
+
fileName = '';
|
|
966
1045
|
onChangeFn = () => { };
|
|
967
1046
|
onTouchedFn = () => { };
|
|
968
1047
|
writeValue(value) {
|
|
969
|
-
|
|
1048
|
+
if (value instanceof File) {
|
|
1049
|
+
this.fileName = value.name;
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
this.fileName = '';
|
|
1053
|
+
}
|
|
970
1054
|
}
|
|
971
1055
|
registerOnChange(fn) {
|
|
972
1056
|
this.onChangeFn = fn;
|
|
@@ -977,43 +1061,57 @@ class InputDateComponent {
|
|
|
977
1061
|
setDisabledState(isDisabled) {
|
|
978
1062
|
this.disabled = isDisabled;
|
|
979
1063
|
}
|
|
1064
|
+
onFileSelected(event) {
|
|
1065
|
+
const input = event.target;
|
|
1066
|
+
const file = input.files?.[0] ?? null;
|
|
1067
|
+
if (file) {
|
|
1068
|
+
this.fileName = file.name;
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
this.fileName = '';
|
|
1072
|
+
}
|
|
1073
|
+
this.emitValue.emit(file);
|
|
1074
|
+
this.onChangeFn(file);
|
|
1075
|
+
this.onTouchedFn();
|
|
1076
|
+
}
|
|
1077
|
+
onBlur() {
|
|
1078
|
+
this.onTouchedFn();
|
|
1079
|
+
}
|
|
1080
|
+
get acceptString() {
|
|
1081
|
+
if (!this.allowedExtensions.length) {
|
|
1082
|
+
return null;
|
|
1083
|
+
}
|
|
1084
|
+
return this.allowedExtensions
|
|
1085
|
+
.map(ext => ext.startsWith('.') ? ext : `.${ext}`)
|
|
1086
|
+
.join(',');
|
|
1087
|
+
}
|
|
980
1088
|
get inputClass() {
|
|
981
1089
|
return [
|
|
1090
|
+
'c-text-input--upload',
|
|
982
1091
|
'c-text-input__input',
|
|
983
1092
|
`c-text-input__input--${this.size}`,
|
|
1093
|
+
this.fileName === '' ? 'c-text-input__input--no-file' : '',
|
|
984
1094
|
this.error ? 'is-error' : '',
|
|
985
1095
|
this.success ? 'is-success' : '',
|
|
986
1096
|
this.disabled ? 'is-disabled' : '',
|
|
987
|
-
this.readonly ? 'is-readonly' : ''
|
|
1097
|
+
this.readonly ? 'is-readonly' : ''
|
|
988
1098
|
].filter(Boolean);
|
|
989
1099
|
}
|
|
990
1100
|
get ariaDescribedBy() {
|
|
991
|
-
return this.helperText ? '
|
|
992
|
-
}
|
|
993
|
-
toggleCalendar() {
|
|
994
|
-
console.log('Toggle calendar functionality not implemented yet.');
|
|
995
|
-
}
|
|
996
|
-
onInput(event) {
|
|
997
|
-
const input = event.target;
|
|
998
|
-
this._value = input.value;
|
|
999
|
-
this.onChangeFn(this._value);
|
|
1000
|
-
this.emitValue.emit(this._value);
|
|
1001
|
-
}
|
|
1002
|
-
onBlur() {
|
|
1003
|
-
this.onTouchedFn();
|
|
1101
|
+
return this.helperText ? 'search-input-helper' : null;
|
|
1004
1102
|
}
|
|
1005
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
1006
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type:
|
|
1103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1104
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: InputUploadComponent, isStandalone: true, selector: "lib-input-upload", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", size: "size", allowedExtensions: "allowedExtensions" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
1007
1105
|
{
|
|
1008
1106
|
provide: NG_VALUE_ACCESSOR,
|
|
1009
|
-
useExisting: forwardRef(() =>
|
|
1107
|
+
useExisting: forwardRef(() => InputUploadComponent),
|
|
1010
1108
|
multi: true
|
|
1011
1109
|
}
|
|
1012
|
-
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"
|
|
1110
|
+
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n #fileInput\n type=\"file\"\n id=\"upload-input\"\n style=\"display: none;\"\n [attr.accept]=\"acceptString\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (change)=\"onFileSelected($event)\"\n (blur)=\"onBlur()\"\n />\n <label\n for=\"upload-input\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n >\n {{ fileName || placeholder }}\n </label>\n <lib-button-icon\n ariaLabel=\"Upload\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__toggle\"\n (click)=\"fileInput.click()\"\n >\n <lib-icon icon=\"upload\" size=\"md\" iconBefore />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input--no-file{color:var(--color-textfield-content-placeholder)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__toggle{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
1013
1111
|
}
|
|
1014
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
1112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputUploadComponent, decorators: [{
|
|
1015
1113
|
type: Component,
|
|
1016
|
-
args: [{ selector: 'lib-input-
|
|
1114
|
+
args: [{ selector: 'lib-input-upload', standalone: true, imports: [
|
|
1017
1115
|
CommonModule,
|
|
1018
1116
|
ReactiveFormsModule,
|
|
1019
1117
|
InputLabelComponent,
|
|
@@ -1023,10 +1121,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1023
1121
|
], providers: [
|
|
1024
1122
|
{
|
|
1025
1123
|
provide: NG_VALUE_ACCESSOR,
|
|
1026
|
-
useExisting: forwardRef(() =>
|
|
1124
|
+
useExisting: forwardRef(() => InputUploadComponent),
|
|
1027
1125
|
multi: true
|
|
1028
1126
|
}
|
|
1029
|
-
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n type=\"
|
|
1127
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n #fileInput\n type=\"file\"\n id=\"upload-input\"\n style=\"display: none;\"\n [attr.accept]=\"acceptString\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (change)=\"onFileSelected($event)\"\n (blur)=\"onBlur()\"\n />\n <label\n for=\"upload-input\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n >\n {{ fileName || placeholder }}\n </label>\n <lib-button-icon\n ariaLabel=\"Upload\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__toggle\"\n (click)=\"fileInput.click()\"\n >\n <lib-icon icon=\"upload\" size=\"md\" iconBefore />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input--no-file{color:var(--color-textfield-content-placeholder)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__toggle{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"] }]
|
|
1030
1128
|
}], propDecorators: { label: [{
|
|
1031
1129
|
type: Input
|
|
1032
1130
|
}], placeholder: [{
|
|
@@ -1049,11 +1147,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1049
1147
|
type: Input
|
|
1050
1148
|
}], size: [{
|
|
1051
1149
|
type: Input
|
|
1150
|
+
}], allowedExtensions: [{
|
|
1151
|
+
type: Input
|
|
1052
1152
|
}], emitValue: [{
|
|
1053
1153
|
type: Output
|
|
1154
|
+
}], fileInput: [{
|
|
1155
|
+
type: ViewChild,
|
|
1156
|
+
args: ['fileInput']
|
|
1054
1157
|
}] } });
|
|
1055
1158
|
|
|
1056
|
-
class
|
|
1159
|
+
class PaginationComponent {
|
|
1160
|
+
totalPages = 1;
|
|
1161
|
+
currentPage = 1;
|
|
1162
|
+
size = 'md';
|
|
1163
|
+
pageChange = new EventEmitter();
|
|
1164
|
+
pages = [];
|
|
1165
|
+
ngOnChanges(changes) {
|
|
1166
|
+
if (changes['totalPages'] ||
|
|
1167
|
+
changes['currentPage'] ||
|
|
1168
|
+
changes['size']) {
|
|
1169
|
+
this.buildPages();
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
buildPages() {
|
|
1173
|
+
const total = this.totalPages;
|
|
1174
|
+
const current = this.currentPage;
|
|
1175
|
+
const neighbors = this.size === 'sm' ? 1 : 3;
|
|
1176
|
+
const result = [];
|
|
1177
|
+
result.push(1);
|
|
1178
|
+
const left = Math.max(2, current - neighbors);
|
|
1179
|
+
const right = Math.min(total - 1, current + neighbors);
|
|
1180
|
+
if (left > 2) {
|
|
1181
|
+
result.push('ellipsis');
|
|
1182
|
+
}
|
|
1183
|
+
for (let i = left; i <= right; i++) {
|
|
1184
|
+
result.push(i);
|
|
1185
|
+
}
|
|
1186
|
+
if (right < total - 1) {
|
|
1187
|
+
result.push('ellipsis');
|
|
1188
|
+
}
|
|
1189
|
+
if (total > 1) {
|
|
1190
|
+
result.push(total);
|
|
1191
|
+
}
|
|
1192
|
+
this.pages = result;
|
|
1193
|
+
}
|
|
1194
|
+
select(page) {
|
|
1195
|
+
if (page === 'ellipsis' || page === this.currentPage) {
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
const newPage = page;
|
|
1199
|
+
this.currentPage = newPage;
|
|
1200
|
+
this.pageChange.emit(newPage);
|
|
1201
|
+
this.buildPages();
|
|
1202
|
+
}
|
|
1203
|
+
prev() {
|
|
1204
|
+
if (this.currentPage > 1) {
|
|
1205
|
+
this.select(this.currentPage - 1);
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
next() {
|
|
1209
|
+
if (this.currentPage < this.totalPages) {
|
|
1210
|
+
this.select(this.currentPage + 1);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1214
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: PaginationComponent, isStandalone: true, selector: "lib-pagination", inputs: { totalPages: "totalPages", currentPage: "currentPage", size: "size" }, outputs: { pageChange: "pageChange" }, usesOnChanges: true, ngImport: i0, template: "<nav\n class=\"c-pagination\"\n [class.c-pagination--sm]=\"size==='sm'\"\n [class.c-pagination--md]=\"size==='md'\"\n role=\"navigation\"\n aria-label=\"Paginaci\u00F3n\"\n>\n <ul class=\"c-pagination__list\" role=\"list\">\n <li class=\"c-pagination__item\">\n <button\n class=\"c-pagination__link c-pagination__prev\"\n (click)=\"prev()\"\n [disabled]=\"currentPage===1\"\n aria-label=\"P\u00E1gina anterior\"\n >\n <lib-icon icon=\"arrow\" variant=\"left\" size=\"lg\" iconBefore />\n </button>\n </li>\n\n <li\n *ngFor=\"let p of pages\"\n class=\"c-pagination__item\"\n [class.c-pagination__item--active]=\"p===currentPage\"\n >\n <button\n *ngIf=\"p!=='ellipsis'; else dotTpl\"\n class=\"c-pagination__link\"\n (click)=\"select(p)\"\n [attr.aria-current]=\"p===currentPage? 'page': null\"\n >\n {{ p }}\n </button>\n <ng-template #dotTpl>\n <span class=\"c-pagination__ellipsis\" aria-hidden=\"true\">\u2026</span>\n </ng-template>\n </li>\n\n <li class=\"c-pagination__item\">\n <button\n class=\"c-pagination__link c-pagination__next\"\n (click)=\"next()\"\n [disabled]=\"currentPage===totalPages\"\n aria-label=\"P\u00E1gina siguiente\"\n >\n <lib-icon icon=\"arrow\" variant=\"right\" size=\"lg\" iconBefore />\n </button>\n </li>\n </ul>\n</nav>\n", styles: [".c-pagination__list{display:flex;list-style:none;padding:0;margin:0;display:inline-flex;justify-content:center;align-items:center}.c-pagination__item{display:flex;width:2.5rem;height:2.5rem;flex-direction:column;justify-content:center;align-items:center}.c-pagination__item--active .c-pagination__link{position:relative;color:var(--color-button-neutral-content-default, #070707);text-align:center;font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem);cursor:default}.c-pagination__item--active .c-pagination__link:before{content:\"\";position:absolute;width:1.125rem;height:.125rem;background:var(--color-action-primary-selected-background-default, #217870);bottom:0;left:0;right:0;margin:0 auto}.c-pagination__link{background:none;border:none;cursor:pointer;color:var(--color-button-neutral-content-default, #070707);text-align:center;font-family:var(--typography-label-sm-default-family, Satoshi);font-size:var(--typography-label-sm-default-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-default-weight, 400);line-height:var(--typography-label-sm-default-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-default-letter-spacing, 0rem)}.c-pagination__link:hover:not(:disabled){background:var(--color-feedback-neutral-surface-background, #DEE7E6)}.c-pagination__link:disabled{cursor:not-allowed;opacity:.5}.c-pagination__ellipsis{display:inline-block;padding:0 .5rem;color:var(--color-textfield-content-placeholder, #676D6C)}.c-pagination__prev,.c-pagination__next{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
1215
|
+
}
|
|
1216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
1217
|
+
type: Component,
|
|
1218
|
+
args: [{ selector: 'lib-pagination', standalone: true, imports: [CommonModule, IconComponent], template: "<nav\n class=\"c-pagination\"\n [class.c-pagination--sm]=\"size==='sm'\"\n [class.c-pagination--md]=\"size==='md'\"\n role=\"navigation\"\n aria-label=\"Paginaci\u00F3n\"\n>\n <ul class=\"c-pagination__list\" role=\"list\">\n <li class=\"c-pagination__item\">\n <button\n class=\"c-pagination__link c-pagination__prev\"\n (click)=\"prev()\"\n [disabled]=\"currentPage===1\"\n aria-label=\"P\u00E1gina anterior\"\n >\n <lib-icon icon=\"arrow\" variant=\"left\" size=\"lg\" iconBefore />\n </button>\n </li>\n\n <li\n *ngFor=\"let p of pages\"\n class=\"c-pagination__item\"\n [class.c-pagination__item--active]=\"p===currentPage\"\n >\n <button\n *ngIf=\"p!=='ellipsis'; else dotTpl\"\n class=\"c-pagination__link\"\n (click)=\"select(p)\"\n [attr.aria-current]=\"p===currentPage? 'page': null\"\n >\n {{ p }}\n </button>\n <ng-template #dotTpl>\n <span class=\"c-pagination__ellipsis\" aria-hidden=\"true\">\u2026</span>\n </ng-template>\n </li>\n\n <li class=\"c-pagination__item\">\n <button\n class=\"c-pagination__link c-pagination__next\"\n (click)=\"next()\"\n [disabled]=\"currentPage===totalPages\"\n aria-label=\"P\u00E1gina siguiente\"\n >\n <lib-icon icon=\"arrow\" variant=\"right\" size=\"lg\" iconBefore />\n </button>\n </li>\n </ul>\n</nav>\n", styles: [".c-pagination__list{display:flex;list-style:none;padding:0;margin:0;display:inline-flex;justify-content:center;align-items:center}.c-pagination__item{display:flex;width:2.5rem;height:2.5rem;flex-direction:column;justify-content:center;align-items:center}.c-pagination__item--active .c-pagination__link{position:relative;color:var(--color-button-neutral-content-default, #070707);text-align:center;font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem);cursor:default}.c-pagination__item--active .c-pagination__link:before{content:\"\";position:absolute;width:1.125rem;height:.125rem;background:var(--color-action-primary-selected-background-default, #217870);bottom:0;left:0;right:0;margin:0 auto}.c-pagination__link{background:none;border:none;cursor:pointer;color:var(--color-button-neutral-content-default, #070707);text-align:center;font-family:var(--typography-label-sm-default-family, Satoshi);font-size:var(--typography-label-sm-default-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-default-weight, 400);line-height:var(--typography-label-sm-default-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-default-letter-spacing, 0rem)}.c-pagination__link:hover:not(:disabled){background:var(--color-feedback-neutral-surface-background, #DEE7E6)}.c-pagination__link:disabled{cursor:not-allowed;opacity:.5}.c-pagination__ellipsis{display:inline-block;padding:0 .5rem;color:var(--color-textfield-content-placeholder, #676D6C)}.c-pagination__prev,.c-pagination__next{font-weight:700}\n"] }]
|
|
1219
|
+
}], propDecorators: { totalPages: [{
|
|
1220
|
+
type: Input
|
|
1221
|
+
}], currentPage: [{
|
|
1222
|
+
type: Input
|
|
1223
|
+
}], size: [{
|
|
1224
|
+
type: Input
|
|
1225
|
+
}], pageChange: [{
|
|
1226
|
+
type: Output
|
|
1227
|
+
}] } });
|
|
1228
|
+
|
|
1229
|
+
class PasswordInputComponent {
|
|
1057
1230
|
label = '';
|
|
1058
1231
|
placeholder = '';
|
|
1059
1232
|
helperText = '';
|
|
@@ -1062,16 +1235,16 @@ class InputNumberComponent {
|
|
|
1062
1235
|
error = false;
|
|
1063
1236
|
success = false;
|
|
1064
1237
|
disabled = false;
|
|
1065
|
-
required = false;
|
|
1066
1238
|
readonly = false;
|
|
1239
|
+
required = false;
|
|
1067
1240
|
size = 'md';
|
|
1068
|
-
variant = 'default';
|
|
1069
|
-
value = 0;
|
|
1070
1241
|
emitValue = new EventEmitter();
|
|
1242
|
+
_value = '';
|
|
1243
|
+
showPassword = false;
|
|
1071
1244
|
onChangeFn = () => { };
|
|
1072
1245
|
onTouchedFn = () => { };
|
|
1073
1246
|
writeValue(value) {
|
|
1074
|
-
this.
|
|
1247
|
+
this._value = value ?? '';
|
|
1075
1248
|
}
|
|
1076
1249
|
registerOnChange(fn) {
|
|
1077
1250
|
this.onChangeFn = fn;
|
|
@@ -1082,6 +1255,9 @@ class InputNumberComponent {
|
|
|
1082
1255
|
setDisabledState(isDisabled) {
|
|
1083
1256
|
this.disabled = isDisabled;
|
|
1084
1257
|
}
|
|
1258
|
+
get inputType() {
|
|
1259
|
+
return this.showPassword ? 'text' : 'password';
|
|
1260
|
+
}
|
|
1085
1261
|
get inputClass() {
|
|
1086
1262
|
return [
|
|
1087
1263
|
'c-text-input__input',
|
|
@@ -1089,44 +1265,36 @@ class InputNumberComponent {
|
|
|
1089
1265
|
this.error ? 'is-error' : '',
|
|
1090
1266
|
this.success ? 'is-success' : '',
|
|
1091
1267
|
this.disabled ? 'is-disabled' : '',
|
|
1092
|
-
this.readonly ? 'is-readonly' : ''
|
|
1268
|
+
this.readonly ? 'is-readonly' : ''
|
|
1093
1269
|
].filter(Boolean);
|
|
1094
1270
|
}
|
|
1095
1271
|
get ariaDescribedBy() {
|
|
1096
|
-
return this.helperText ? '
|
|
1097
|
-
}
|
|
1098
|
-
onType(event) {
|
|
1099
|
-
const input = event.target;
|
|
1100
|
-
const newVal = input.value === '' ? 0 : Number(input.value);
|
|
1101
|
-
this.value = newVal;
|
|
1102
|
-
this.onChangeFn(newVal);
|
|
1103
|
-
this.emitValue.emit(newVal);
|
|
1272
|
+
return this.helperText ? 'password-input-helper' : null;
|
|
1104
1273
|
}
|
|
1105
|
-
|
|
1106
|
-
this.
|
|
1107
|
-
this.onChangeFn(this.value);
|
|
1108
|
-
this.emitValue.emit(this.value);
|
|
1274
|
+
togglePassword() {
|
|
1275
|
+
this.showPassword = !this.showPassword;
|
|
1109
1276
|
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
this.
|
|
1113
|
-
this.
|
|
1277
|
+
onInput(event) {
|
|
1278
|
+
const input = event.target;
|
|
1279
|
+
this._value = input.value;
|
|
1280
|
+
this.onChangeFn(this._value);
|
|
1281
|
+
this.emitValue.emit(this._value);
|
|
1114
1282
|
}
|
|
1115
1283
|
onBlur() {
|
|
1116
1284
|
this.onTouchedFn();
|
|
1117
1285
|
}
|
|
1118
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
1119
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type:
|
|
1286
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: PasswordInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1287
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: PasswordInputComponent, isStandalone: true, selector: "lib-password-input", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", size: "size" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
1120
1288
|
{
|
|
1121
1289
|
provide: NG_VALUE_ACCESSOR,
|
|
1122
|
-
useExisting: forwardRef(() =>
|
|
1290
|
+
useExisting: forwardRef(() => PasswordInputComponent),
|
|
1123
1291
|
multi: true
|
|
1124
1292
|
}
|
|
1125
|
-
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [
|
|
1293
|
+
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [text]=\"label\" [required]=\"required\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n [type]=\"inputType\"\n [value]=\"_value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [required]=\"required\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <lib-button-icon\n [ariaLabel]=\"showPassword ? 'Ocultar contrase\u00F1a' : 'Mostrar contrase\u00F1a'\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__toggle\"\n (click)=\"togglePassword()\"\n >\n <lib-icon\n icon=\"eye\"\n size=\"md\"\n iconBefore\n [variant]=\"showPassword ? 'close' : 'open'\"\n />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__toggle{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
1126
1294
|
}
|
|
1127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
1295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: PasswordInputComponent, decorators: [{
|
|
1128
1296
|
type: Component,
|
|
1129
|
-
args: [{ selector: 'lib-input
|
|
1297
|
+
args: [{ selector: 'lib-password-input', standalone: true, imports: [
|
|
1130
1298
|
CommonModule,
|
|
1131
1299
|
ReactiveFormsModule,
|
|
1132
1300
|
InputLabelComponent,
|
|
@@ -1136,10 +1304,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1136
1304
|
], providers: [
|
|
1137
1305
|
{
|
|
1138
1306
|
provide: NG_VALUE_ACCESSOR,
|
|
1139
|
-
useExisting: forwardRef(() =>
|
|
1307
|
+
useExisting: forwardRef(() => PasswordInputComponent),
|
|
1140
1308
|
multi: true
|
|
1141
1309
|
}
|
|
1142
|
-
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [
|
|
1310
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label *ngIf=\"label\" [text]=\"label\" [required]=\"required\"></lib-input-label>\n\n <div class=\"c-text-input__wrapper\">\n <input\n [type]=\"inputType\"\n [value]=\"_value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [class]=\"inputClass.join(' ')\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [required]=\"required\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <lib-button-icon\n [ariaLabel]=\"showPassword ? 'Ocultar contrase\u00F1a' : 'Mostrar contrase\u00F1a'\"\n [disabled]=\"disabled\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-text-input__toggle\"\n (click)=\"togglePassword()\"\n >\n <lib-icon\n icon=\"eye\"\n size=\"md\"\n iconBefore\n [variant]=\"showPassword ? 'close' : 'open'\"\n />\n </lib-button-icon>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}.c-text-input__wrapper{display:flex;position:relative;width:100%}.c-text-input__toggle{position:absolute;top:50%;right:var(--space-component-padding-sm);transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}\n"] }]
|
|
1143
1311
|
}], propDecorators: { label: [{
|
|
1144
1312
|
type: Input
|
|
1145
1313
|
}], placeholder: [{
|
|
@@ -1156,36 +1324,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1156
1324
|
type: Input
|
|
1157
1325
|
}], disabled: [{
|
|
1158
1326
|
type: Input
|
|
1159
|
-
}], required: [{
|
|
1160
|
-
type: Input
|
|
1161
1327
|
}], readonly: [{
|
|
1162
1328
|
type: Input
|
|
1163
|
-
}],
|
|
1329
|
+
}], required: [{
|
|
1164
1330
|
type: Input
|
|
1165
|
-
}],
|
|
1331
|
+
}], size: [{
|
|
1166
1332
|
type: Input
|
|
1167
1333
|
}], emitValue: [{
|
|
1168
1334
|
type: Output
|
|
1169
1335
|
}] } });
|
|
1170
1336
|
|
|
1171
|
-
class
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
successText = '';
|
|
1337
|
+
class RadioComponent {
|
|
1338
|
+
id;
|
|
1339
|
+
name;
|
|
1340
|
+
value;
|
|
1341
|
+
label;
|
|
1177
1342
|
error = false;
|
|
1178
|
-
success = false;
|
|
1179
1343
|
disabled = false;
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
size = 'md';
|
|
1183
|
-
emitValue = new EventEmitter();
|
|
1184
|
-
_value = '';
|
|
1344
|
+
modelChange = new EventEmitter();
|
|
1345
|
+
_value;
|
|
1185
1346
|
onChangeFn = () => { };
|
|
1186
1347
|
onTouchedFn = () => { };
|
|
1187
1348
|
writeValue(value) {
|
|
1188
|
-
this._value = value
|
|
1349
|
+
this._value = value;
|
|
1189
1350
|
}
|
|
1190
1351
|
registerOnChange(fn) {
|
|
1191
1352
|
this.onChangeFn = fn;
|
|
@@ -1196,82 +1357,786 @@ class InputSearchComponent {
|
|
|
1196
1357
|
setDisabledState(isDisabled) {
|
|
1197
1358
|
this.disabled = isDisabled;
|
|
1198
1359
|
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
const input = event.target;
|
|
1202
|
-
this._value = input.value;
|
|
1360
|
+
onInputChange() {
|
|
1361
|
+
this._value = this.value;
|
|
1203
1362
|
this.onChangeFn(this._value);
|
|
1204
|
-
this.
|
|
1363
|
+
this.modelChange.emit(this._value);
|
|
1205
1364
|
}
|
|
1206
1365
|
onBlur() {
|
|
1207
1366
|
this.onTouchedFn();
|
|
1208
1367
|
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
'c-text-input__input',
|
|
1212
|
-
`c-text-input__input--${this.size}`,
|
|
1213
|
-
this.error ? 'is-error' : '',
|
|
1214
|
-
this.success ? 'is-success' : '',
|
|
1215
|
-
this.disabled ? 'is-disabled' : '',
|
|
1216
|
-
this.readonly ? 'is-readonly' : ''
|
|
1217
|
-
].filter(Boolean);
|
|
1218
|
-
}
|
|
1219
|
-
get ariaDescribedBy() {
|
|
1220
|
-
return this.helperText ? 'search-input-helper' : null;
|
|
1221
|
-
}
|
|
1222
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: InputSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1223
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: InputSearchComponent, isStandalone: true, selector: "lib-input-search", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", size: "size" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
1368
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: RadioComponent, isStandalone: true, selector: "lib-radio", inputs: { id: "id", name: "name", value: "value", label: "label", error: "error", disabled: "disabled" }, outputs: { modelChange: "modelChange" }, providers: [
|
|
1224
1370
|
{
|
|
1225
1371
|
provide: NG_VALUE_ACCESSOR,
|
|
1226
|
-
useExisting: forwardRef(() =>
|
|
1372
|
+
useExisting: forwardRef(() => RadioComponent),
|
|
1227
1373
|
multi: true
|
|
1228
1374
|
}
|
|
1229
|
-
], ngImport: i0, template: "<div class=\"c-
|
|
1375
|
+
], ngImport: i0, template: "<div class=\"c-radio\">\n <label class=\"c-radio__label\" [for]=\"id || value\">\n <input\n type=\"radio\"\n class=\"c-radio__input\"\n [id]=\"id || value\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"value === _value\"\n (change)=\"onInputChange()\"\n (blur)=\"onBlur()\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n role=\"radio\"\n [attr.aria-checked]=\"value === _value ? 'true' : 'false'\"\n [attr.tabindex]=\"value === _value ? '0' : '-1'\"\n [disabled]=\"disabled\"\n />\n <span\n class=\"c-radio__custom\"\n [class.has-error]=\"error\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"c-radio__text\">{{ label }}</span>\n </label>\n</div>\n", styles: [".c-radio{display:flex;align-items:center;font-family:var(--typography-label-md-default-family),sans-serif;font-weight:var(--typography-label-md-default-weight);font-size:var(--typography-label-md-default-size);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing);color:var(--color-core-content-default)}.c-radio__input{position:absolute;opacity:0;pointer-events:none}.c-radio__label{display:flex;align-items:center;cursor:pointer;gap:var(--space-component-gap-sm)}.c-radio__custom{display:flex;align-items:center;justify-content:center;width:.9rem;height:.9rem;border-radius:var(--size-border-radius-full);border:var(--size-border-width-md) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);position:relative;transition:all .2s}.c-radio__input:checked+.c-radio__custom{border-color:var(--color-action-primary-selected-background-default);background:var(--color-action-primary-selected-background-default)}.c-radio__input:checked+.c-radio__custom:after{content:\"\";display:flex;width:calc(100% - 6px);height:calc(100% - 6px);border-radius:var(--size-border-radius-full);background:var(--color-action-primary-selected-content-default)}.c-radio__input:checked+.c-radio__custom:hover{background-color:var(--color-action-primary-selected-background-hover)}.c-radio__input:checked+.c-radio__custom:focus{outline:2px solid var(--focus-outset)}.c-radio__input:checked+.c-radio__custom:pressed{background-color:var(--color-textfield-border-pressed)}.c-radio__input:checked+.c-radio__custom:disabled{background-color:var(--color-action-primary-selected-background-disabled)}.c-radio__input:checked:disabled+.c-radio__custom{background-color:var(--color-textfield-content-disabled);border-color:var(--color-textfield-content-disabled)}.c-radio__input:disabled+.c-radio__custom{border-color:var(--color-textfield-content-disabled)}.c-radio__custom.has-error{border-color:var(--color-feedback-danger-surface-border)}.c-radio__input:checked+.c-radio__custom.has-error{background-color:var(--color-feedback-danger-surface-border);border-color:var(--color-feedback-danger-surface-border)}.c-radio__text{font-size:1rem;line-height:1.5;color:#000}.c-radio:hover__custom{border-color:var(--color-textfield-border-hover)}.c-radio:focus__custom{outline:2px solid var(--focus-outset)}.c-radio:pressed__custom{border-color:var(--color-textfield-border-pressed)}.c-radio:disabled{color:var(--color-textfield-content-disabled)}.c-radio:disabled__custom{border-color:var(--color-textfield-border-disabled)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }] });
|
|
1230
1376
|
}
|
|
1231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type:
|
|
1377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RadioComponent, decorators: [{
|
|
1232
1378
|
type: Component,
|
|
1233
|
-
args: [{ selector: 'lib-
|
|
1234
|
-
CommonModule,
|
|
1235
|
-
ReactiveFormsModule,
|
|
1236
|
-
InputLabelComponent,
|
|
1237
|
-
IconComponent,
|
|
1238
|
-
HelperTextComponent
|
|
1239
|
-
], providers: [
|
|
1379
|
+
args: [{ selector: 'lib-radio', standalone: true, imports: [CommonModule, ReactiveFormsModule], providers: [
|
|
1240
1380
|
{
|
|
1241
1381
|
provide: NG_VALUE_ACCESSOR,
|
|
1242
|
-
useExisting: forwardRef(() =>
|
|
1382
|
+
useExisting: forwardRef(() => RadioComponent),
|
|
1243
1383
|
multi: true
|
|
1244
1384
|
}
|
|
1245
|
-
], template: "<div class=\"c-
|
|
1246
|
-
}], propDecorators: {
|
|
1247
|
-
type: Input
|
|
1248
|
-
}], placeholder: [{
|
|
1385
|
+
], template: "<div class=\"c-radio\">\n <label class=\"c-radio__label\" [for]=\"id || value\">\n <input\n type=\"radio\"\n class=\"c-radio__input\"\n [id]=\"id || value\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"value === _value\"\n (change)=\"onInputChange()\"\n (blur)=\"onBlur()\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n role=\"radio\"\n [attr.aria-checked]=\"value === _value ? 'true' : 'false'\"\n [attr.tabindex]=\"value === _value ? '0' : '-1'\"\n [disabled]=\"disabled\"\n />\n <span\n class=\"c-radio__custom\"\n [class.has-error]=\"error\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"c-radio__text\">{{ label }}</span>\n </label>\n</div>\n", styles: [".c-radio{display:flex;align-items:center;font-family:var(--typography-label-md-default-family),sans-serif;font-weight:var(--typography-label-md-default-weight);font-size:var(--typography-label-md-default-size);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing);color:var(--color-core-content-default)}.c-radio__input{position:absolute;opacity:0;pointer-events:none}.c-radio__label{display:flex;align-items:center;cursor:pointer;gap:var(--space-component-gap-sm)}.c-radio__custom{display:flex;align-items:center;justify-content:center;width:.9rem;height:.9rem;border-radius:var(--size-border-radius-full);border:var(--size-border-width-md) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);position:relative;transition:all .2s}.c-radio__input:checked+.c-radio__custom{border-color:var(--color-action-primary-selected-background-default);background:var(--color-action-primary-selected-background-default)}.c-radio__input:checked+.c-radio__custom:after{content:\"\";display:flex;width:calc(100% - 6px);height:calc(100% - 6px);border-radius:var(--size-border-radius-full);background:var(--color-action-primary-selected-content-default)}.c-radio__input:checked+.c-radio__custom:hover{background-color:var(--color-action-primary-selected-background-hover)}.c-radio__input:checked+.c-radio__custom:focus{outline:2px solid var(--focus-outset)}.c-radio__input:checked+.c-radio__custom:pressed{background-color:var(--color-textfield-border-pressed)}.c-radio__input:checked+.c-radio__custom:disabled{background-color:var(--color-action-primary-selected-background-disabled)}.c-radio__input:checked:disabled+.c-radio__custom{background-color:var(--color-textfield-content-disabled);border-color:var(--color-textfield-content-disabled)}.c-radio__input:disabled+.c-radio__custom{border-color:var(--color-textfield-content-disabled)}.c-radio__custom.has-error{border-color:var(--color-feedback-danger-surface-border)}.c-radio__input:checked+.c-radio__custom.has-error{background-color:var(--color-feedback-danger-surface-border);border-color:var(--color-feedback-danger-surface-border)}.c-radio__text{font-size:1rem;line-height:1.5;color:#000}.c-radio:hover__custom{border-color:var(--color-textfield-border-hover)}.c-radio:focus__custom{outline:2px solid var(--focus-outset)}.c-radio:pressed__custom{border-color:var(--color-textfield-border-pressed)}.c-radio:disabled{color:var(--color-textfield-content-disabled)}.c-radio:disabled__custom{border-color:var(--color-textfield-border-disabled)}\n"] }]
|
|
1386
|
+
}], propDecorators: { id: [{
|
|
1249
1387
|
type: Input
|
|
1250
|
-
}],
|
|
1388
|
+
}], name: [{
|
|
1251
1389
|
type: Input
|
|
1252
|
-
}],
|
|
1390
|
+
}], value: [{
|
|
1253
1391
|
type: Input
|
|
1254
|
-
}],
|
|
1392
|
+
}], label: [{
|
|
1255
1393
|
type: Input
|
|
1256
1394
|
}], error: [{
|
|
1257
1395
|
type: Input
|
|
1258
|
-
}], success: [{
|
|
1259
|
-
type: Input
|
|
1260
1396
|
}], disabled: [{
|
|
1261
1397
|
type: Input
|
|
1262
|
-
}],
|
|
1398
|
+
}], modelChange: [{
|
|
1399
|
+
type: Output
|
|
1400
|
+
}] } });
|
|
1401
|
+
|
|
1402
|
+
class RadioGroupComponent {
|
|
1403
|
+
label = '';
|
|
1404
|
+
name = '';
|
|
1405
|
+
options = [];
|
|
1406
|
+
value = '';
|
|
1407
|
+
error = false;
|
|
1408
|
+
helperText = '';
|
|
1409
|
+
required = false;
|
|
1410
|
+
valueChange = new EventEmitter();
|
|
1411
|
+
onChange(value) {
|
|
1412
|
+
this.value = value;
|
|
1413
|
+
this.valueChange.emit(value);
|
|
1414
|
+
}
|
|
1415
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1416
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: RadioGroupComponent, isStandalone: true, selector: "lib-radio-group", inputs: { label: "label", name: "name", options: "options", value: "value", error: "error", helperText: "helperText", required: "required" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<fieldset [attr.aria-invalid]=\"error\" class=\"c-radio-group\">\n <legend class=\"sr-only\">{{ label }}</legend>\n <lib-input-label [text]=\"label\" [required]=\"required\" />\n \n <div class=\"c-radio-group__options\">\n <lib-radio\n *ngFor=\"let option of options\"\n [label]=\"option.label\"\n [value]=\"option.value\"\n [name]=\"name\"\n [error]=\"error\"\n (change)=\"onChange(option.value)\"\n />\n </div>\n <p *ngIf=\"helperText\" class=\"c-radio-group__helper\"><lib-icon icon=\"alert\" class=\"c-radio-group__icon\" size=\"md\"/>{{ helperText }}</p>\n</fieldset>\n", styles: [".c-radio-group{display:flex;flex-direction:column;gap:var(--space-container-gap-sm);border:0;padding:0}.c-radio-group__options{display:flex;flex-direction:column;gap:var(--space-container-gap-md);padding-left:6px}.c-radio-group__helper{display:flex;align-items:center;gap:var(--space-component-gap-sm);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-size);line-height:var(--typography-label-sm-line-height);letter-spacing:var(--typography-label-sm-letter-spacing);color:var(--color-feedback-danger-default);padding:0;margin:0}.c-radio-group__icon{display:flex}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RadioComponent, selector: "lib-radio", inputs: ["id", "name", "value", "label", "error", "disabled"], outputs: ["modelChange"] }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
1417
|
+
}
|
|
1418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RadioGroupComponent, decorators: [{
|
|
1419
|
+
type: Component,
|
|
1420
|
+
args: [{ selector: 'lib-radio-group', standalone: true, imports: [CommonModule, RadioComponent, InputLabelComponent, IconComponent], template: "<fieldset [attr.aria-invalid]=\"error\" class=\"c-radio-group\">\n <legend class=\"sr-only\">{{ label }}</legend>\n <lib-input-label [text]=\"label\" [required]=\"required\" />\n \n <div class=\"c-radio-group__options\">\n <lib-radio\n *ngFor=\"let option of options\"\n [label]=\"option.label\"\n [value]=\"option.value\"\n [name]=\"name\"\n [error]=\"error\"\n (change)=\"onChange(option.value)\"\n />\n </div>\n <p *ngIf=\"helperText\" class=\"c-radio-group__helper\"><lib-icon icon=\"alert\" class=\"c-radio-group__icon\" size=\"md\"/>{{ helperText }}</p>\n</fieldset>\n", styles: [".c-radio-group{display:flex;flex-direction:column;gap:var(--space-container-gap-sm);border:0;padding:0}.c-radio-group__options{display:flex;flex-direction:column;gap:var(--space-container-gap-md);padding-left:6px}.c-radio-group__helper{display:flex;align-items:center;gap:var(--space-component-gap-sm);font-family:var(--typography-label-md-strong-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-size);line-height:var(--typography-label-sm-line-height);letter-spacing:var(--typography-label-sm-letter-spacing);color:var(--color-feedback-danger-default);padding:0;margin:0}.c-radio-group__icon{display:flex}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
|
|
1421
|
+
}], propDecorators: { label: [{
|
|
1263
1422
|
type: Input
|
|
1264
|
-
}],
|
|
1423
|
+
}], name: [{
|
|
1265
1424
|
type: Input
|
|
1266
|
-
}],
|
|
1425
|
+
}], options: [{
|
|
1426
|
+
type: Input
|
|
1427
|
+
}], value: [{
|
|
1428
|
+
type: Input
|
|
1429
|
+
}], error: [{
|
|
1430
|
+
type: Input
|
|
1431
|
+
}], helperText: [{
|
|
1432
|
+
type: Input
|
|
1433
|
+
}], required: [{
|
|
1434
|
+
type: Input
|
|
1435
|
+
}], valueChange: [{
|
|
1436
|
+
type: Output
|
|
1437
|
+
}] } });
|
|
1438
|
+
|
|
1439
|
+
class SegmentedControlComponent {
|
|
1440
|
+
options = [];
|
|
1441
|
+
selectedValue;
|
|
1442
|
+
selectionChange = new EventEmitter();
|
|
1443
|
+
fill = true;
|
|
1444
|
+
/** Cuando el usuario hace click en un segmento */
|
|
1445
|
+
onSelect(option) {
|
|
1446
|
+
if (this.selectedValue !== option.value) {
|
|
1447
|
+
this.selectedValue = option.value;
|
|
1448
|
+
this.selectionChange.emit(this.selectedValue);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
/** Marca si ésta opción está activa */
|
|
1452
|
+
isSelected(option) {
|
|
1453
|
+
return this.selectedValue === option.value;
|
|
1454
|
+
}
|
|
1455
|
+
/** Manejo simple de flechas izquierda/derecha */
|
|
1456
|
+
onKeydown(event) {
|
|
1457
|
+
const idx = this.options.findIndex(o => this.isSelected(o));
|
|
1458
|
+
if (event.key === 'ArrowRight' && idx < this.options.length - 1) {
|
|
1459
|
+
this.onSelect(this.options[idx + 1]);
|
|
1460
|
+
event.preventDefault();
|
|
1461
|
+
}
|
|
1462
|
+
if (event.key === 'ArrowLeft' && idx > 0) {
|
|
1463
|
+
this.onSelect(this.options[idx - 1]);
|
|
1464
|
+
event.preventDefault();
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1468
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: SegmentedControlComponent, isStandalone: true, selector: "lib-segmented-control", inputs: { options: "options", selectedValue: "selectedValue", fill: "fill" }, outputs: { selectionChange: "selectionChange" }, host: { listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0, template: "<div role=\"radiogroup\" [ngClass]=\"{'c-segmented-control': true,'c-segmented-control--fill': fill}\">\n <label\n *ngFor=\"let option of options; let i = index\"\n role=\"radio\"\n [attr.aria-checked]=\"isSelected(option)\"\n [attr.tabindex]=\"isSelected(option) ? 0 : -1\"\n class=\"c-segmented-control__item\"\n (click)=\"onSelect(option)\"\n (keydown.enter)=\"onSelect(option)\"\n (keydown.space)=\"onSelect(option)\"\n >\n <!-- Input real, oculto -->\n <input\n type=\"radio\"\n [value]=\"option.value\"\n [checked]=\"isSelected(option)\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n hidden\n />\n {{ option.label }}\n </label>\n</div>\n ", styles: ["@charset \"UTF-8\";.c-segmented-control{display:inline-flex;overflow:hidden}.c-segmented-control--fill{width:100%}.c-segmented-control__item{position:relative;width:100%;padding:var(--space-component-padding-sm);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid var(--color-action-primary-border-default);text-align:center;font-family:var(--typography-label-sm-default-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-default-size);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);color:var(--color-action-primary-content-default)}.c-segmented-control__item:not(:last-child){border-right:none}.c-segmented-control__item:first-child{border-radius:12px 0 0 12px}.c-segmented-control__item:last-child{border-radius:0 12px 12px 0}.c-segmented-control__item:hover\\a0 {background-color:var(--color-action-primary-background-hover);color:var(--color-action-primary-content-hover)}.c-segmented-control__item:pressed{background-color:var(--color-action-primary-background-pressed);color:var(--color-core-content-default)}.c-segmented-control__item:selected{background-color:var(--color-action-primary-background-selected);color:var(--color-action-primary-selected-content-default)}.c-segmented-control__item:focus{outline:2px solid var(--color-decorative-primary-default);font-weight:var(--typography-label-sm-strong-weight);color:var(--color-action-alternative-selected);z-index:1}.c-segmented-control__item[aria-checked=true]{background:var(--color-action-primary-selected-background-default);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-action-primary-selected-content-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1469
|
+
}
|
|
1470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
1471
|
+
type: Component,
|
|
1472
|
+
args: [{ selector: 'lib-segmented-control', imports: [CommonModule], template: "<div role=\"radiogroup\" [ngClass]=\"{'c-segmented-control': true,'c-segmented-control--fill': fill}\">\n <label\n *ngFor=\"let option of options; let i = index\"\n role=\"radio\"\n [attr.aria-checked]=\"isSelected(option)\"\n [attr.tabindex]=\"isSelected(option) ? 0 : -1\"\n class=\"c-segmented-control__item\"\n (click)=\"onSelect(option)\"\n (keydown.enter)=\"onSelect(option)\"\n (keydown.space)=\"onSelect(option)\"\n >\n <!-- Input real, oculto -->\n <input\n type=\"radio\"\n [value]=\"option.value\"\n [checked]=\"isSelected(option)\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n hidden\n />\n {{ option.label }}\n </label>\n</div>\n ", styles: ["@charset \"UTF-8\";.c-segmented-control{display:inline-flex;overflow:hidden}.c-segmented-control--fill{width:100%}.c-segmented-control__item{position:relative;width:100%;padding:var(--space-component-padding-sm);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid var(--color-action-primary-border-default);text-align:center;font-family:var(--typography-label-sm-default-family),sans-serif;font-weight:var(--typography-label-sm-default-weight);font-size:var(--typography-label-sm-default-size);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing);color:var(--color-action-primary-content-default)}.c-segmented-control__item:not(:last-child){border-right:none}.c-segmented-control__item:first-child{border-radius:12px 0 0 12px}.c-segmented-control__item:last-child{border-radius:0 12px 12px 0}.c-segmented-control__item:hover\\a0 {background-color:var(--color-action-primary-background-hover);color:var(--color-action-primary-content-hover)}.c-segmented-control__item:pressed{background-color:var(--color-action-primary-background-pressed);color:var(--color-core-content-default)}.c-segmented-control__item:selected{background-color:var(--color-action-primary-background-selected);color:var(--color-action-primary-selected-content-default)}.c-segmented-control__item:focus{outline:2px solid var(--color-decorative-primary-default);font-weight:var(--typography-label-sm-strong-weight);color:var(--color-action-alternative-selected);z-index:1}.c-segmented-control__item[aria-checked=true]{background:var(--color-action-primary-selected-background-default);font-family:var(--typography-label-sm-strong-family),sans-serif;font-weight:var(--typography-label-sm-strong-weight);font-size:var(--typography-label-sm-strong-size);line-height:var(--typography-label-sm-strong-line-height);letter-spacing:var(--typography-label-sm-strong-letter-spacing);color:var(--color-action-primary-selected-content-default)}\n"] }]
|
|
1473
|
+
}], propDecorators: { options: [{
|
|
1474
|
+
type: Input
|
|
1475
|
+
}], selectedValue: [{
|
|
1476
|
+
type: Input
|
|
1477
|
+
}], selectionChange: [{
|
|
1478
|
+
type: Output
|
|
1479
|
+
}], fill: [{
|
|
1480
|
+
type: Input
|
|
1481
|
+
}], onKeydown: [{
|
|
1482
|
+
type: HostListener,
|
|
1483
|
+
args: ['keydown', ['$event']]
|
|
1484
|
+
}] } });
|
|
1485
|
+
|
|
1486
|
+
class SelectComponent {
|
|
1487
|
+
elementRef;
|
|
1488
|
+
cdr;
|
|
1489
|
+
options = [];
|
|
1490
|
+
multiple = false;
|
|
1491
|
+
placeholder = 'Select';
|
|
1492
|
+
label = '';
|
|
1493
|
+
helperText = '';
|
|
1494
|
+
alertText = '';
|
|
1495
|
+
successText = '';
|
|
1496
|
+
error = false;
|
|
1497
|
+
success = false;
|
|
1498
|
+
disabled = false;
|
|
1499
|
+
readonly = false;
|
|
1500
|
+
required = false;
|
|
1501
|
+
searchable = false;
|
|
1502
|
+
size = 'md';
|
|
1503
|
+
selectionChange = new EventEmitter();
|
|
1504
|
+
container;
|
|
1505
|
+
badgeElems;
|
|
1506
|
+
isOpen = false;
|
|
1507
|
+
filterText = '';
|
|
1508
|
+
selectedOptions = [];
|
|
1509
|
+
filteredOptions = [];
|
|
1510
|
+
visibleBadges = [];
|
|
1511
|
+
hiddenCount = 0;
|
|
1512
|
+
calculating = false;
|
|
1513
|
+
// ControlValueAccessor callbacks
|
|
1514
|
+
onChangeFn = () => { };
|
|
1515
|
+
onTouchedFn = () => { };
|
|
1516
|
+
constructor(elementRef, cdr) {
|
|
1517
|
+
this.elementRef = elementRef;
|
|
1518
|
+
this.cdr = cdr;
|
|
1519
|
+
}
|
|
1520
|
+
ngOnInit() {
|
|
1521
|
+
this.filteredOptions = this.options;
|
|
1522
|
+
}
|
|
1523
|
+
ngAfterViewInit() {
|
|
1524
|
+
this.badgeElems.changes.subscribe(() => this.updateVisibleBadges());
|
|
1525
|
+
}
|
|
1526
|
+
writeValue(value) {
|
|
1527
|
+
if (this.multiple) {
|
|
1528
|
+
this.selectedOptions = Array.isArray(value) ? value : [];
|
|
1529
|
+
}
|
|
1530
|
+
else {
|
|
1531
|
+
this.selectedOptions = value ? [value] : [];
|
|
1532
|
+
}
|
|
1533
|
+
this.updateVisibleBadges();
|
|
1534
|
+
}
|
|
1535
|
+
registerOnChange(fn) {
|
|
1536
|
+
this.onChangeFn = fn;
|
|
1537
|
+
}
|
|
1538
|
+
registerOnTouched(fn) {
|
|
1539
|
+
this.onTouchedFn = fn;
|
|
1540
|
+
}
|
|
1541
|
+
setDisabledState(isDisabled) {
|
|
1542
|
+
this.disabled = isDisabled;
|
|
1543
|
+
}
|
|
1544
|
+
isSelected(opt) {
|
|
1545
|
+
return this.selectedOptions.some(o => o.value === opt.value);
|
|
1546
|
+
}
|
|
1547
|
+
toggleDropdown() {
|
|
1548
|
+
if (this.disabled || this.readonly) {
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
this.isOpen = !this.isOpen;
|
|
1552
|
+
if (this.isOpen) {
|
|
1553
|
+
this.filterText = '';
|
|
1554
|
+
this.filteredOptions = this.options;
|
|
1555
|
+
}
|
|
1556
|
+
else {
|
|
1557
|
+
this.onTouchedFn();
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
selectOption(option) {
|
|
1561
|
+
if (this.multiple) {
|
|
1562
|
+
const idx = this.selectedOptions.findIndex(o => o.value === option.value);
|
|
1563
|
+
if (idx > -1) {
|
|
1564
|
+
this.selectedOptions.splice(idx, 1);
|
|
1565
|
+
}
|
|
1566
|
+
else {
|
|
1567
|
+
this.selectedOptions.push(option);
|
|
1568
|
+
}
|
|
1569
|
+
this.onChangeFn(this.selectedOptions);
|
|
1570
|
+
this.selectionChange.emit(this.selectedOptions);
|
|
1571
|
+
}
|
|
1572
|
+
else {
|
|
1573
|
+
this.selectedOptions = [option];
|
|
1574
|
+
this.isOpen = false;
|
|
1575
|
+
this.onChangeFn(option);
|
|
1576
|
+
this.selectionChange.emit(option);
|
|
1577
|
+
}
|
|
1578
|
+
this.updateVisibleBadges();
|
|
1579
|
+
this.onTouchedFn();
|
|
1580
|
+
}
|
|
1581
|
+
onDelete(opt) {
|
|
1582
|
+
if (!opt) {
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
this.selectedOptions = this.selectedOptions.filter(o => o.value !== opt.value);
|
|
1586
|
+
this.onChangeFn(this.multiple ? this.selectedOptions : this.selectedOptions[0] || null);
|
|
1587
|
+
this.selectionChange.emit(this.multiple ? this.selectedOptions : this.selectedOptions[0]);
|
|
1588
|
+
this.updateVisibleBadges();
|
|
1589
|
+
this.onTouchedFn();
|
|
1590
|
+
}
|
|
1591
|
+
onSearch(value) {
|
|
1592
|
+
this.filterText = value;
|
|
1593
|
+
this.filterOptions();
|
|
1594
|
+
}
|
|
1595
|
+
filterOptions() {
|
|
1596
|
+
const search = this.filterText.trim().toLowerCase();
|
|
1597
|
+
if (!search) {
|
|
1598
|
+
this.filteredOptions = this.options;
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
this.filteredOptions = this.options
|
|
1602
|
+
.map(group => {
|
|
1603
|
+
const matches = group.options.filter(opt => opt.label.toLowerCase().includes(search));
|
|
1604
|
+
return { ...group, options: matches };
|
|
1605
|
+
})
|
|
1606
|
+
.filter(group => group.options.length > 0);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
/** ControlValueAccessor touch on blur of the combobox */
|
|
1610
|
+
onBlur() {
|
|
1611
|
+
this.onTouchedFn();
|
|
1612
|
+
}
|
|
1613
|
+
updateVisibleBadges() {
|
|
1614
|
+
if (!this.calculating) {
|
|
1615
|
+
this.visibleBadges = [...this.selectedOptions];
|
|
1616
|
+
this.calculating = true;
|
|
1617
|
+
}
|
|
1618
|
+
else {
|
|
1619
|
+
this.calculating = false;
|
|
1620
|
+
const containerWidth = this.container.nativeElement.clientWidth;
|
|
1621
|
+
let usedWidth = 0;
|
|
1622
|
+
const badgeEls = this.badgeElems.toArray().map(el => el.nativeElement);
|
|
1623
|
+
const fits = [];
|
|
1624
|
+
for (let i = 0; i < badgeEls.length; i++) {
|
|
1625
|
+
const w = badgeEls[i].offsetWidth;
|
|
1626
|
+
if (usedWidth + w > containerWidth * 0.2)
|
|
1627
|
+
break;
|
|
1628
|
+
usedWidth += w;
|
|
1629
|
+
fits.push(this.selectedOptions[i]);
|
|
1630
|
+
}
|
|
1631
|
+
this.visibleBadges = fits;
|
|
1632
|
+
this.hiddenCount = this.selectedOptions.length - fits.length;
|
|
1633
|
+
this.cdr.markForCheck();
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
onResize() {
|
|
1637
|
+
this.updateVisibleBadges();
|
|
1638
|
+
}
|
|
1639
|
+
onClickOutside(target) {
|
|
1640
|
+
if (this.isOpen && !this.elementRef.nativeElement.contains(target)) {
|
|
1641
|
+
this.isOpen = false;
|
|
1642
|
+
this.onTouchedFn();
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SelectComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1646
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: SelectComponent, isStandalone: true, selector: "lib-select", inputs: { options: "options", multiple: "multiple", placeholder: "placeholder", label: "label", helperText: "helperText", alertText: "alertText", successText: "successText", error: "error", success: "success", disabled: "disabled", readonly: "readonly", required: "required", searchable: "searchable", size: "size" }, outputs: { selectionChange: "selectionChange" }, host: { listeners: { "window:resize": "onResize()", "document:click": "onClickOutside($event.target)" } }, providers: [
|
|
1647
|
+
{
|
|
1648
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1649
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1650
|
+
multi: true
|
|
1651
|
+
}
|
|
1652
|
+
], viewQueries: [{ propertyName: "container", first: true, predicate: ["selectionContainer"], descendants: true, static: true }, { propertyName: "badgeElems", predicate: ["badgeElem"], descendants: true }], ngImport: i0, template: "<div class=\"c-select\" [class.c-select--multiple]=\"multiple\">\n <lib-input-label\n *ngIf=\"label\"\n [required]=\"required\"\n [text]=\"label\"\n ></lib-input-label>\n\n <div\n class=\"c-select__wrapper\"\n aria-expanded=\"false\"\n (click)=\"toggleDropdown()\"\n (keydown.enter)=\"toggleDropdown()\"\n (blur)=\"onBlur()\"\n tabindex=\"0\"\n role=\"combobox\"\n aria-controls=\"selectionContainer\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"label ? label : 'Select'\"\n >\n <div\n class=\"c-select__selection\"\n [class.is-error]=\"error\"\n [class.is-success]=\"success\"\n [class.is-disabled]=\"disabled\"\n [class.is-readonly]=\"readonly\"\n [class.c-select__selection--md]=\"size === 'md'\"\n [class.c-select__selection--sm]=\"size === 'sm'\"\n [class.c-select__selection--lg]=\"size === 'lg'\"\n #selectionContainer\n id=\"selectionContainer\"\n >\n <ng-container *ngIf=\"selectedOptions.length; else placeholderTpl\">\n <span\n #badgeElem\n *ngFor=\"let sel of visibleBadges\"\n class=\"c-select__badge\"\n [class.c-select__badge--multiple]=\"multiple\"\n [class.is-disabled]=\"disabled\"\n >\n {{ sel.label }}\n <lib-icon\n icon=\"close\"\n *ngIf=\"multiple && !disabled\"\n size=\"sm\"\n (click)=\"onDelete(sel)\"\n iconBefore\n />\n <lib-icon\n icon=\"close-disabled\"\n *ngIf=\"multiple && disabled\"\n size=\"sm\"\n iconBefore\n />\n </span>\n\n <span\n *ngIf=\"hiddenCount > 0\"\n class=\"c-select__badge c-select__badge--more\"\n >\n +{{ hiddenCount }}\n </span>\n </ng-container>\n <ng-template #placeholderTpl>{{ placeholder }}</ng-template>\n\n <span class=\"c-select__arrow\" *ngIf=\"!isOpen\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'down'\" />\n </span>\n <span class=\"c-select__arrow\" *ngIf=\"isOpen\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'up'\" />\n </span>\n </div>\n\n <div class=\"c-select__dropdown\" *ngIf=\"isOpen\" role=\"listbox\">\n <div class=\"c-select__search-wrapper\" *ngIf=\"searchable\">\n <lib-input-search\n [(ngModel)]=\"filterText\"\n (emitValue)=\"onSearch($event)\"\n (input)=\"filterOptions()\"\n placeholder=\"Search...\"\n (click)=\"$event.stopPropagation()\"\n aria-label=\"Filtrar opciones\"\n />\n </div>\n\n <div *ngFor=\"let group of filteredOptions\">\n <div class=\"c-select__group-label\">{{ group.label }}</div>\n\n <div\n class=\"c-select__option\"\n *ngFor=\"let opt of group.options\"\n [class.is-selected]=\"isSelected(opt)\"\n (click)=\"$event.stopPropagation(); selectOption(opt)\"\n (keydown.enter)=\"$event.stopPropagation(); selectOption(opt)\"\n tabindex=\"0\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(opt)\"\n >\n <lib-checkbox\n *ngIf=\"multiple\"\n label=\"\"\n [disabled]=\"disabled\"\n [checked]=\"isSelected(opt)\"\n class=\"c-tile__check\"\n ></lib-checkbox>\n <span class=\"c-select__option-label\">{{ opt.label }}</span>\n <lib-icon\n icon=\"check-circle\"\n *ngIf=\"!multiple && !disabled && isSelected(opt)\"\n size=\"sm\"\n iconBefore\n />\n </div>\n </div>\n </div>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-select{display:flex;flex-direction:column;gap:var(--space-component-gap-sm, .25rem);max-width:300px}.c-select__search-wrapper{padding:var(--space-container-padding-sm, 1rem)}.c-select__dropdown{position:absolute;width:100%;max-height:25rem;overflow-y:auto;border-radius:var(--size-textfield-border-radius, .5rem);border:var(--size-textfield-border-width, 1px) solid var(--color-core-border-soft, #d6e0df);background:var(--color-core-background-surface-raised, #fff);box-shadow:0 0 4px 0 var(--color-effect-shadow-soft, rgba(4, 37, 34, .12)),0 2px 4px 0 var(--color-effect-shadow-strong, rgba(4, 37, 34, .16));scrollbar-width:thin;scrollbar-color:var(--color-effect-overlay, rgba(0, 0, 0, .16)) transparent}.c-select__badge{color:var(--color-textfield-content-default, #070707);font-family:var(--typography-label-md-default-family, Satoshi);font-size:var(--typography-label-md-default-size, 1rem);font-style:normal;font-weight:var(--typography-label-md-default-weight, 400);line-height:var(--typography-label-md-default-line-height, 1.5rem);letter-spacing:var(--typography-label-md-default-letter-spacing, 0rem)}.c-select__badge.is-disabled{background:var(--color-action-neutral-background-disabled, rgba(255, 255, 255, 0))}.c-select__badge--more{color:var(--color-textfield-content-default, #070707);font-family:var(--typography-label-md-default-family, Satoshi);font-size:var(--typography-label-md-default-size, 1rem);font-style:normal;font-weight:var(--typography-label-md-default-weight, 400);line-height:var(--typography-label-md-default-line-height, 1.5rem);letter-spacing:var(--typography-label-md-default-letter-spacing, 0rem)}.c-select__badge--multiple{display:flex;height:1.5rem;padding-left:var(--space-component-padding-sm, .5rem);padding-right:var(--space-component-padding-sm, .5rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);border-radius:var(--size-textfield-border-radius, .5rem);background:var(--color-feedback-neutral-surface-background, #dee7e6);color:var(--color-feedback-neutral-default, #535858);text-align:center;font-family:var(--typography-label-xs-strong-family, Satoshi);font-size:var(--typography-label-xs-strong-size, .75rem);font-style:normal;font-weight:var(--typography-label-xs-strong-weight, 700);line-height:var(--typography-label-xs-strong-line-height, 1rem);letter-spacing:var(--typography-label-xs-strong-letter-spacing, 0rem)}.c-select__wrapper{position:relative}.c-select__group-label{display:flex;min-height:3rem;padding:var(--space-component-padding-md, .75rem) var(--space-component-padding-lg, 1rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);color:var(--color-core-content-soft, #535858);font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem)}.c-select__option{display:flex;padding:var(--space-component-padding-md, .75rem) var(--space-component-padding-lg, 1rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);background:var(--color-action-neutral-background-default, rgba(255, 255, 255, 0));color:var(--color-action-neutral-content-default, #070707);font-family:var(--typography-label-sm-default-family, Satoshi);font-size:var(--typography-label-sm-default-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-default-weight, 400);line-height:var(--typography-label-sm-default-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-default-letter-spacing, 0rem);cursor:pointer;justify-content:space-between}.c-select__option.is-selected{color:var(--color-action-neutral-content-default, #070707);font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem)}.c-select__option:hover{background:var(--color-action-neutral-background-hover, rgba(0, 0, 0, .04))}.c-select__option-label{display:flex;justify-self:flex-start;margin:0 auto 0 0}.c-select__selection{display:flex;padding:var(--space-component-padding-md, .75rem) 2.5rem var(--space-component-padding-md, .75rem) var(--space-component-padding-lg, 1rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);align-self:stretch;border-radius:var(--size-textfield-border-radius, .5rem);border:var(--size-textfield-border-width, 1px) solid var(--color-textfield-border-default, #929a99);background:var(--color-textfield-background-default, #fff);color:var(--color-textfield-content-placeholder, #676d6c);font-family:var(--typography-label-md-default-family, Satoshi);font-size:var(--typography-label-md-default-size, 1rem);font-style:normal;font-weight:var(--typography-label-md-default-weight, 400);line-height:var(--typography-label-md-default-line-height, 1.5rem);letter-spacing:var(--typography-label-md-default-letter-spacing, 0rem);cursor:pointer;overflow:hidden;position:relative}.c-select__selection:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-select__selection--sm,.c-select__selection--md{padding:var(--space-component-padding-xs) 2rem var(--space-component-padding-xs) 2rem}.c-select__selection.is-error{border-color:var(--color-textfield-border-error)}.c-select__selection.is-success{border-color:var(--color-feedback-success-surface-border)}.c-select__selection.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-select__selection.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-select__arrow{position:absolute;right:1.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: InputSearchComponent, selector: "lib-input-search", inputs: ["label", "placeholder", "helperText", "alertText", "successText", "error", "success", "disabled", "readonly", "required", "size"], outputs: ["emitValue"] }, { kind: "component", type: CheckboxComponent, selector: "lib-checkbox", inputs: ["label", "id", "checked", "disabled", "error", "indeterminate"], outputs: ["changed"] }] });
|
|
1653
|
+
}
|
|
1654
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1655
|
+
type: Component,
|
|
1656
|
+
args: [{ selector: 'lib-select', standalone: true, imports: [
|
|
1657
|
+
CommonModule,
|
|
1658
|
+
FormsModule,
|
|
1659
|
+
ReactiveFormsModule,
|
|
1660
|
+
IconComponent,
|
|
1661
|
+
HelperTextComponent,
|
|
1662
|
+
InputLabelComponent,
|
|
1663
|
+
InputSearchComponent,
|
|
1664
|
+
CheckboxComponent
|
|
1665
|
+
], providers: [
|
|
1666
|
+
{
|
|
1667
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1668
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1669
|
+
multi: true
|
|
1670
|
+
}
|
|
1671
|
+
], template: "<div class=\"c-select\" [class.c-select--multiple]=\"multiple\">\n <lib-input-label\n *ngIf=\"label\"\n [required]=\"required\"\n [text]=\"label\"\n ></lib-input-label>\n\n <div\n class=\"c-select__wrapper\"\n aria-expanded=\"false\"\n (click)=\"toggleDropdown()\"\n (keydown.enter)=\"toggleDropdown()\"\n (blur)=\"onBlur()\"\n tabindex=\"0\"\n role=\"combobox\"\n aria-controls=\"selectionContainer\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"label ? label : 'Select'\"\n >\n <div\n class=\"c-select__selection\"\n [class.is-error]=\"error\"\n [class.is-success]=\"success\"\n [class.is-disabled]=\"disabled\"\n [class.is-readonly]=\"readonly\"\n [class.c-select__selection--md]=\"size === 'md'\"\n [class.c-select__selection--sm]=\"size === 'sm'\"\n [class.c-select__selection--lg]=\"size === 'lg'\"\n #selectionContainer\n id=\"selectionContainer\"\n >\n <ng-container *ngIf=\"selectedOptions.length; else placeholderTpl\">\n <span\n #badgeElem\n *ngFor=\"let sel of visibleBadges\"\n class=\"c-select__badge\"\n [class.c-select__badge--multiple]=\"multiple\"\n [class.is-disabled]=\"disabled\"\n >\n {{ sel.label }}\n <lib-icon\n icon=\"close\"\n *ngIf=\"multiple && !disabled\"\n size=\"sm\"\n (click)=\"onDelete(sel)\"\n iconBefore\n />\n <lib-icon\n icon=\"close-disabled\"\n *ngIf=\"multiple && disabled\"\n size=\"sm\"\n iconBefore\n />\n </span>\n\n <span\n *ngIf=\"hiddenCount > 0\"\n class=\"c-select__badge c-select__badge--more\"\n >\n +{{ hiddenCount }}\n </span>\n </ng-container>\n <ng-template #placeholderTpl>{{ placeholder }}</ng-template>\n\n <span class=\"c-select__arrow\" *ngIf=\"!isOpen\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'down'\" />\n </span>\n <span class=\"c-select__arrow\" *ngIf=\"isOpen\">\n <lib-icon icon=\"arrow\" size=\"lg\" iconBefore [variant]=\"'up'\" />\n </span>\n </div>\n\n <div class=\"c-select__dropdown\" *ngIf=\"isOpen\" role=\"listbox\">\n <div class=\"c-select__search-wrapper\" *ngIf=\"searchable\">\n <lib-input-search\n [(ngModel)]=\"filterText\"\n (emitValue)=\"onSearch($event)\"\n (input)=\"filterOptions()\"\n placeholder=\"Search...\"\n (click)=\"$event.stopPropagation()\"\n aria-label=\"Filtrar opciones\"\n />\n </div>\n\n <div *ngFor=\"let group of filteredOptions\">\n <div class=\"c-select__group-label\">{{ group.label }}</div>\n\n <div\n class=\"c-select__option\"\n *ngFor=\"let opt of group.options\"\n [class.is-selected]=\"isSelected(opt)\"\n (click)=\"$event.stopPropagation(); selectOption(opt)\"\n (keydown.enter)=\"$event.stopPropagation(); selectOption(opt)\"\n tabindex=\"0\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(opt)\"\n >\n <lib-checkbox\n *ngIf=\"multiple\"\n label=\"\"\n [disabled]=\"disabled\"\n [checked]=\"isSelected(opt)\"\n class=\"c-tile__check\"\n ></lib-checkbox>\n <span class=\"c-select__option-label\">{{ opt.label }}</span>\n <lib-icon\n icon=\"check-circle\"\n *ngIf=\"!multiple && !disabled && isSelected(opt)\"\n size=\"sm\"\n iconBefore\n />\n </div>\n </div>\n </div>\n </div>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"password-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-select{display:flex;flex-direction:column;gap:var(--space-component-gap-sm, .25rem);max-width:300px}.c-select__search-wrapper{padding:var(--space-container-padding-sm, 1rem)}.c-select__dropdown{position:absolute;width:100%;max-height:25rem;overflow-y:auto;border-radius:var(--size-textfield-border-radius, .5rem);border:var(--size-textfield-border-width, 1px) solid var(--color-core-border-soft, #d6e0df);background:var(--color-core-background-surface-raised, #fff);box-shadow:0 0 4px 0 var(--color-effect-shadow-soft, rgba(4, 37, 34, .12)),0 2px 4px 0 var(--color-effect-shadow-strong, rgba(4, 37, 34, .16));scrollbar-width:thin;scrollbar-color:var(--color-effect-overlay, rgba(0, 0, 0, .16)) transparent}.c-select__badge{color:var(--color-textfield-content-default, #070707);font-family:var(--typography-label-md-default-family, Satoshi);font-size:var(--typography-label-md-default-size, 1rem);font-style:normal;font-weight:var(--typography-label-md-default-weight, 400);line-height:var(--typography-label-md-default-line-height, 1.5rem);letter-spacing:var(--typography-label-md-default-letter-spacing, 0rem)}.c-select__badge.is-disabled{background:var(--color-action-neutral-background-disabled, rgba(255, 255, 255, 0))}.c-select__badge--more{color:var(--color-textfield-content-default, #070707);font-family:var(--typography-label-md-default-family, Satoshi);font-size:var(--typography-label-md-default-size, 1rem);font-style:normal;font-weight:var(--typography-label-md-default-weight, 400);line-height:var(--typography-label-md-default-line-height, 1.5rem);letter-spacing:var(--typography-label-md-default-letter-spacing, 0rem)}.c-select__badge--multiple{display:flex;height:1.5rem;padding-left:var(--space-component-padding-sm, .5rem);padding-right:var(--space-component-padding-sm, .5rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);border-radius:var(--size-textfield-border-radius, .5rem);background:var(--color-feedback-neutral-surface-background, #dee7e6);color:var(--color-feedback-neutral-default, #535858);text-align:center;font-family:var(--typography-label-xs-strong-family, Satoshi);font-size:var(--typography-label-xs-strong-size, .75rem);font-style:normal;font-weight:var(--typography-label-xs-strong-weight, 700);line-height:var(--typography-label-xs-strong-line-height, 1rem);letter-spacing:var(--typography-label-xs-strong-letter-spacing, 0rem)}.c-select__wrapper{position:relative}.c-select__group-label{display:flex;min-height:3rem;padding:var(--space-component-padding-md, .75rem) var(--space-component-padding-lg, 1rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);color:var(--color-core-content-soft, #535858);font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem)}.c-select__option{display:flex;padding:var(--space-component-padding-md, .75rem) var(--space-component-padding-lg, 1rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);background:var(--color-action-neutral-background-default, rgba(255, 255, 255, 0));color:var(--color-action-neutral-content-default, #070707);font-family:var(--typography-label-sm-default-family, Satoshi);font-size:var(--typography-label-sm-default-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-default-weight, 400);line-height:var(--typography-label-sm-default-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-default-letter-spacing, 0rem);cursor:pointer;justify-content:space-between}.c-select__option.is-selected{color:var(--color-action-neutral-content-default, #070707);font-family:var(--typography-label-sm-strong-family, Satoshi);font-size:var(--typography-label-sm-strong-size, .875rem);font-style:normal;font-weight:var(--typography-label-sm-strong-weight, 700);line-height:var(--typography-label-sm-strong-line-height, 1.25rem);letter-spacing:var(--typography-label-sm-strong-letter-spacing, 0rem)}.c-select__option:hover{background:var(--color-action-neutral-background-hover, rgba(0, 0, 0, .04))}.c-select__option-label{display:flex;justify-self:flex-start;margin:0 auto 0 0}.c-select__selection{display:flex;padding:var(--space-component-padding-md, .75rem) 2.5rem var(--space-component-padding-md, .75rem) var(--space-component-padding-lg, 1rem);align-items:center;gap:var(--space-component-gap-sm, .25rem);align-self:stretch;border-radius:var(--size-textfield-border-radius, .5rem);border:var(--size-textfield-border-width, 1px) solid var(--color-textfield-border-default, #929a99);background:var(--color-textfield-background-default, #fff);color:var(--color-textfield-content-placeholder, #676d6c);font-family:var(--typography-label-md-default-family, Satoshi);font-size:var(--typography-label-md-default-size, 1rem);font-style:normal;font-weight:var(--typography-label-md-default-weight, 400);line-height:var(--typography-label-md-default-line-height, 1.5rem);letter-spacing:var(--typography-label-md-default-letter-spacing, 0rem);cursor:pointer;overflow:hidden;position:relative}.c-select__selection:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-select__selection--sm,.c-select__selection--md{padding:var(--space-component-padding-xs) 2rem var(--space-component-padding-xs) 2rem}.c-select__selection.is-error{border-color:var(--color-textfield-border-error)}.c-select__selection.is-success{border-color:var(--color-feedback-success-surface-border)}.c-select__selection.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-select__selection.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-select__arrow{position:absolute;right:1.5rem}\n"] }]
|
|
1672
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { options: [{
|
|
1673
|
+
type: Input
|
|
1674
|
+
}], multiple: [{
|
|
1675
|
+
type: Input
|
|
1676
|
+
}], placeholder: [{
|
|
1677
|
+
type: Input
|
|
1678
|
+
}], label: [{
|
|
1679
|
+
type: Input
|
|
1680
|
+
}], helperText: [{
|
|
1681
|
+
type: Input
|
|
1682
|
+
}], alertText: [{
|
|
1683
|
+
type: Input
|
|
1684
|
+
}], successText: [{
|
|
1685
|
+
type: Input
|
|
1686
|
+
}], error: [{
|
|
1687
|
+
type: Input
|
|
1688
|
+
}], success: [{
|
|
1689
|
+
type: Input
|
|
1690
|
+
}], disabled: [{
|
|
1691
|
+
type: Input
|
|
1692
|
+
}], readonly: [{
|
|
1693
|
+
type: Input
|
|
1694
|
+
}], required: [{
|
|
1695
|
+
type: Input
|
|
1696
|
+
}], searchable: [{
|
|
1697
|
+
type: Input
|
|
1698
|
+
}], size: [{
|
|
1699
|
+
type: Input
|
|
1700
|
+
}], selectionChange: [{
|
|
1701
|
+
type: Output
|
|
1702
|
+
}], container: [{
|
|
1703
|
+
type: ViewChild,
|
|
1704
|
+
args: ['selectionContainer', { static: true }]
|
|
1705
|
+
}], badgeElems: [{
|
|
1706
|
+
type: ViewChildren,
|
|
1707
|
+
args: ['badgeElem']
|
|
1708
|
+
}], onResize: [{
|
|
1709
|
+
type: HostListener,
|
|
1710
|
+
args: ['window:resize']
|
|
1711
|
+
}], onClickOutside: [{
|
|
1712
|
+
type: HostListener,
|
|
1713
|
+
args: ['document:click', ['$event.target']]
|
|
1714
|
+
}] } });
|
|
1715
|
+
|
|
1716
|
+
class SwitchComponent {
|
|
1717
|
+
checked = false;
|
|
1718
|
+
disabled = false;
|
|
1719
|
+
label = '';
|
|
1720
|
+
required = false;
|
|
1721
|
+
checkedChange = new EventEmitter();
|
|
1722
|
+
onToggle() {
|
|
1723
|
+
if (this.disabled) {
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
this.checked = !this.checked;
|
|
1727
|
+
this.checkedChange.emit(this.checked);
|
|
1728
|
+
}
|
|
1729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1730
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: SwitchComponent, isStandalone: true, selector: "lib-switch", inputs: { checked: "checked", disabled: "disabled", label: "label", required: "required" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<div\n class=\"c-switch\"\n [class.c-switch--checked]=\"checked\"\n [class.c-switch--disabled]=\"disabled\"\n>\n <button\n type=\"button\"\n class=\"c-switch__track\"\n role=\"switch\"\n [attr.aria-checked]=\"checked\"\n [disabled]=\"disabled\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"label\"\n >\n <span class=\"c-switch__thumb\"></span>\n </button>\n\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n</div>\n", styles: [".c-switch{display:flex;width:19.5rem;min-width:2.75rem;align-items:center;gap:var(--space-component-gap-md)}.c-switch__track{position:relative;width:2rem;height:1rem;border:none;cursor:pointer;transition:background .2s;display:flex;padding:var(--space-component-padding-xs, .25rem) var(--space-component-padding-xl, 1.5rem) var(--space-component-padding-xs, .25rem) var(--space-component-padding-xs, .25rem);align-items:center;gap:.5rem;border-radius:var(--size-border-radius-full, 6.25rem);background:var(--color-switch-unchecked-background-default, #929A99)}.c-switch__track:hover{background:var(--color-switch-unchecked-background-hover, #7D8483)}.c-switch__track:focus{box-shadow:0 0 0 2px var(--color-effect-focus-contrast, #FFF),0 0 0 4px var(--color-effect-focus-color, #EAA42C)}.c-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:.75rem;height:.75rem;background:#fff;border-radius:50%;transition:transform .2s}.c-switch--checked .c-switch__track{border-radius:var(--size-border-radius-full, 6.25rem);background:var(--color-switch-checked-background-default, #217870)}.c-switch--checked .c-switch__track:hover{background:var(--color-switch-checked-background-hover, #19625B)}.c-switch--checked .c-switch__thumb{transform:translate(1rem)}.c-switch--disabled{cursor:not-allowed}.c-switch--disabled .c-switch__track{background:var(--color-switch-unchecked-background-disabled, rgba(0, 0, 0, .08))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }] });
|
|
1731
|
+
}
|
|
1732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1733
|
+
type: Component,
|
|
1734
|
+
args: [{ selector: 'lib-switch', standalone: true, imports: [CommonModule, FormsModule, InputLabelComponent], template: "<div\n class=\"c-switch\"\n [class.c-switch--checked]=\"checked\"\n [class.c-switch--disabled]=\"disabled\"\n>\n <button\n type=\"button\"\n class=\"c-switch__track\"\n role=\"switch\"\n [attr.aria-checked]=\"checked\"\n [disabled]=\"disabled\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"label\"\n >\n <span class=\"c-switch__thumb\"></span>\n </button>\n\n <lib-input-label *ngIf=\"label\" [required]=\"required\" [text]=\"label\"></lib-input-label>\n</div>\n", styles: [".c-switch{display:flex;width:19.5rem;min-width:2.75rem;align-items:center;gap:var(--space-component-gap-md)}.c-switch__track{position:relative;width:2rem;height:1rem;border:none;cursor:pointer;transition:background .2s;display:flex;padding:var(--space-component-padding-xs, .25rem) var(--space-component-padding-xl, 1.5rem) var(--space-component-padding-xs, .25rem) var(--space-component-padding-xs, .25rem);align-items:center;gap:.5rem;border-radius:var(--size-border-radius-full, 6.25rem);background:var(--color-switch-unchecked-background-default, #929A99)}.c-switch__track:hover{background:var(--color-switch-unchecked-background-hover, #7D8483)}.c-switch__track:focus{box-shadow:0 0 0 2px var(--color-effect-focus-contrast, #FFF),0 0 0 4px var(--color-effect-focus-color, #EAA42C)}.c-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:.75rem;height:.75rem;background:#fff;border-radius:50%;transition:transform .2s}.c-switch--checked .c-switch__track{border-radius:var(--size-border-radius-full, 6.25rem);background:var(--color-switch-checked-background-default, #217870)}.c-switch--checked .c-switch__track:hover{background:var(--color-switch-checked-background-hover, #19625B)}.c-switch--checked .c-switch__thumb{transform:translate(1rem)}.c-switch--disabled{cursor:not-allowed}.c-switch--disabled .c-switch__track{background:var(--color-switch-unchecked-background-disabled, rgba(0, 0, 0, .08))}\n"] }]
|
|
1735
|
+
}], propDecorators: { checked: [{
|
|
1736
|
+
type: Input
|
|
1737
|
+
}], disabled: [{
|
|
1738
|
+
type: Input
|
|
1739
|
+
}], label: [{
|
|
1740
|
+
type: Input
|
|
1741
|
+
}], required: [{
|
|
1742
|
+
type: Input
|
|
1743
|
+
}], checkedChange: [{
|
|
1744
|
+
type: Output
|
|
1745
|
+
}] } });
|
|
1746
|
+
|
|
1747
|
+
class TabsComponent {
|
|
1748
|
+
options = [];
|
|
1749
|
+
valueChange = new EventEmitter();
|
|
1750
|
+
selectedValue = 0;
|
|
1751
|
+
ngOnInit() {
|
|
1752
|
+
if (this.options?.length) {
|
|
1753
|
+
this.selectedValue = this.options[0].value;
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
onClick($event, value) {
|
|
1757
|
+
this.selectedValue = value;
|
|
1758
|
+
this.valueChange.emit(value);
|
|
1759
|
+
}
|
|
1760
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1761
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TabsComponent, isStandalone: true, selector: "lib-tabs", inputs: { options: "options" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<ul class=\"c-tabs\" role=\"tablist\">\n <li\n class=\"c-tabs__tab\"\n [class.c-tabs__tab--selected]=\"option.value === selectedValue\"\n role=\"tab\"\n tabindex=\"0\"\n (click)=\"onClick($event, option.value)\"\n (keydown)=\"onClick($event, option.value)\"\n *ngFor=\"let option of options\"\n >\n {{ option.label }}\n </li>\n</ul>", styles: [".c-tabs{width:100%;display:flex;align-items:flex-start;border-bottom:1px solid var(--color-core-border-soft);margin:0;padding:0;list-style:none}.c-tabs__tab{color:var(--color-action-neutral-content-default);text-align:center;font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing);padding:var(--space-component-padding-sm) var(--space-component-padding-md);background:var(--color-action-primary-background-default);gap:var(--space-component-gap-sm);cursor:pointer;margin:0;list-style:none}.c-tabs__tab:hover{color:var(--color-core-content-hover);background:var(--color-action-neutral-background-hover)}.c-tabs__tab:pressed{color:var(--color-core-content-pressed);background-color:var(--color-core-background-pressed)}.c-tabs__tab:focus{background:var(--color-action-primary-background-default);box-shadow:0 0 0 2px var(--color-effect-focus-color) inset,0 0 0 4px var(--color-effect-focus-contrast) inset}.c-tabs__tab--selected{position:relative;color:var(--color-core-content-default);background:var(--color-action-primary-background-default)}.c-tabs__tab--selected:before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:.125rem;background:var(--color-action-primary-selected-background-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1762
|
+
}
|
|
1763
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TabsComponent, decorators: [{
|
|
1764
|
+
type: Component,
|
|
1765
|
+
args: [{ selector: 'lib-tabs', imports: [CommonModule], template: "<ul class=\"c-tabs\" role=\"tablist\">\n <li\n class=\"c-tabs__tab\"\n [class.c-tabs__tab--selected]=\"option.value === selectedValue\"\n role=\"tab\"\n tabindex=\"0\"\n (click)=\"onClick($event, option.value)\"\n (keydown)=\"onClick($event, option.value)\"\n *ngFor=\"let option of options\"\n >\n {{ option.label }}\n </li>\n</ul>", styles: [".c-tabs{width:100%;display:flex;align-items:flex-start;border-bottom:1px solid var(--color-core-border-soft);margin:0;padding:0;list-style:none}.c-tabs__tab{color:var(--color-action-neutral-content-default);text-align:center;font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing);padding:var(--space-component-padding-sm) var(--space-component-padding-md);background:var(--color-action-primary-background-default);gap:var(--space-component-gap-sm);cursor:pointer;margin:0;list-style:none}.c-tabs__tab:hover{color:var(--color-core-content-hover);background:var(--color-action-neutral-background-hover)}.c-tabs__tab:pressed{color:var(--color-core-content-pressed);background-color:var(--color-core-background-pressed)}.c-tabs__tab:focus{background:var(--color-action-primary-background-default);box-shadow:0 0 0 2px var(--color-effect-focus-color) inset,0 0 0 4px var(--color-effect-focus-contrast) inset}.c-tabs__tab--selected{position:relative;color:var(--color-core-content-default);background:var(--color-action-primary-background-default)}.c-tabs__tab--selected:before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:.125rem;background:var(--color-action-primary-selected-background-default)}\n"] }]
|
|
1766
|
+
}], propDecorators: { options: [{
|
|
1767
|
+
type: Input
|
|
1768
|
+
}], valueChange: [{
|
|
1769
|
+
type: Output
|
|
1770
|
+
}] } });
|
|
1771
|
+
|
|
1772
|
+
class TagComponent {
|
|
1773
|
+
variant = 'neutral';
|
|
1774
|
+
text = '';
|
|
1775
|
+
extraClass = '';
|
|
1776
|
+
showBadge = true;
|
|
1777
|
+
closeActive = true;
|
|
1778
|
+
emphasis = false;
|
|
1779
|
+
closeEvent = new EventEmitter();
|
|
1780
|
+
onClose() {
|
|
1781
|
+
this.closeEvent.emit();
|
|
1782
|
+
}
|
|
1783
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1784
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TagComponent, isStandalone: true, selector: "lib-tag", inputs: { variant: "variant", text: "text", extraClass: "extraClass", showBadge: "showBadge", closeActive: "closeActive", emphasis: "emphasis" }, outputs: { closeEvent: "closeEvent" }, ngImport: i0, template: "<span [ngClass]=\"['c-tag', variant ? 'c-tag--' + variant : '', extraClass ? extraClass : '', emphasis ? 'c-tag--emphasis' : '']\">\n <span *ngIf=\"showBadge\" class=\"c-tag__dot\"></span>\n {{ text }}\n <lib-button-icon\n *ngIf=\"closeActive\"\n role=\"button\"\n [ariaLabel]=\"variant\"\n [loading]=\"false\"\n [disabled]=\"variant === 'disabled'\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-tag__close\"\n (click)=\"onClose()\"\n >\n <lib-icon *ngIf=\"!emphasis || variant === 'disabled'\" icon=\"close\" size=\"xs\" iconBefore />\n <lib-icon *ngIf=\"emphasis && variant !== 'disabled'\" icon=\"close-white\" size=\"xs\" iconBefore />\n </lib-button-icon>\n</span>", styles: [".c-tag{display:inline-flex;height:1.5rem;padding:0 var(--space-component-padding-sm);align-items:center;gap:var(--space-component-gap-sm);flex-shrink:0;border-radius:var(--size-textfield-border-radius);text-align:center;font-family:var(--typography-label-xs-strong-family);font-size:var(--typography-label-xs-strong-size);font-style:normal;font-weight:var(--typography-label-xs-strong-weight);line-height:var(--typography-label-xs-strong-line-height);letter-spacing:var(--typography-label-xs-strong-letter-spacing)}.c-tag__dot{width:.5rem;height:.5rem;border-radius:50%;flex-shrink:0}.c-tag--alert{background:var(--color-feedback-danger-surface-background);color:var(--color-feedback-danger-default)}.c-tag--alert .c-tag__dot{background:var(--color-feedback-danger-default)}.c-tag--warning{color:var(--color-feedback-warning-default);background:var(--color-feedback-warning-surface-background)}.c-tag--warning .c-tag__dot{background:var(--color-feedback-warning-default)}.c-tag--success{color:var(--color-feedback-success-default);background:var(--color-feedback-success-surface-background)}.c-tag--success .c-tag__dot{background:var(--color-feedback-success-default)}.c-tag--info{background:var(--color-feedback-info-surface-background);color:var(--color-feedback-info-default)}.c-tag--info .c-tag__dot{background:var(--color-feedback-info-default)}.c-tag--neutral{background:var(--color-feedback-neutral-surface-background);color:var(--color-feedback-neutral-default)}.c-tag--neutral .c-tag__dot{background:var(--color-feedback-neutral-default)}.c-tag--primary{background:var(--color-decorative-primary-soft);color:var(--color-decorative-primary-strong)}.c-tag--primary .c-tag__dot{background:var(--color-decorative-primary-default)}.c-tag--secondary{background:var(--color-decorative-secondary-soft);color:var(--color-decorative-secondary-strong)}.c-tag--secondary .c-tag__dot{background:var(--color-decorative-secondary-default)}.c-tag--disabled{background:var(--color-action-neutral-background-disabled);color:var(--color-action-neutral-content-disabled)}.c-tag--disabled .c-tag__dot{background:var(--color-feedback-neutral-default)}.c-tag--emphasis{padding-right:0}.c-tag--emphasis .c-tag__close{border:var(--size-button-border-width) solid var(--color-button-inverse-border-default);height:100%;align-items:center;text-align:center;display:flex;border-radius:var(--size-button-border-radius)}.c-tag--emphasis.c-tag--alert{color:var(--color-feedback-danger-on-default);background:var(--color-feedback-danger-default)}.c-tag--emphasis.c-tag--alert .c-tag__dot{background:var(--color-feedback-danger-on-default)}.c-tag--emphasis.c-tag--warning{color:var(--color-feedback-warning-on-default);background:var(--color-feedback-warning-default)}.c-tag--emphasis.c-tag--warning .c-tag__dot{background:var(--color-feedback-warning-on-default)}.c-tag--emphasis.c-tag--success{color:var(--color-feedback-success-on-default);background:var(--color-feedback-success-default)}.c-tag--emphasis.c-tag--success .c-tag__dot{background:var(--color-feedback-success-on-default)}.c-tag--emphasis.c-tag--info{color:var(--color-feedback-info-on-default);background:var(--color-feedback-info-default)}.c-tag--emphasis.c-tag--info .c-tag__dot{background:var(--color-feedback-info-on-default)}.c-tag--emphasis.c-tag--neutral{color:var(--color-feedback-neutral-on-default);background:var(--color-feedback-neutral-default)}.c-tag--emphasis.c-tag--neutral .c-tag__dot{background:var(--color-feedback-neutral-on-default)}.c-tag--emphasis.c-tag--primary{background:var(--color-decorative-primary-default);color:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--primary .c-tag__dot{background:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--secondary{background:var(--color-decorative-secondary-default);color:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--secondary .c-tag__dot{background:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--disabled{background:var(--color-action-neutral-background-disabled);color:var(--color-action-neutral-content-disabled)}.c-tag--emphasis.c-tag--disabled .c-tag__dot{background:var(--color-feedback-neutral-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }] });
|
|
1785
|
+
}
|
|
1786
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TagComponent, decorators: [{
|
|
1787
|
+
type: Component,
|
|
1788
|
+
args: [{ selector: 'lib-tag', imports: [CommonModule, IconComponent, ButtonIconComponent], template: "<span [ngClass]=\"['c-tag', variant ? 'c-tag--' + variant : '', extraClass ? extraClass : '', emphasis ? 'c-tag--emphasis' : '']\">\n <span *ngIf=\"showBadge\" class=\"c-tag__dot\"></span>\n {{ text }}\n <lib-button-icon\n *ngIf=\"closeActive\"\n role=\"button\"\n [ariaLabel]=\"variant\"\n [loading]=\"false\"\n [disabled]=\"variant === 'disabled'\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-tag__close\"\n (click)=\"onClose()\"\n >\n <lib-icon *ngIf=\"!emphasis || variant === 'disabled'\" icon=\"close\" size=\"xs\" iconBefore />\n <lib-icon *ngIf=\"emphasis && variant !== 'disabled'\" icon=\"close-white\" size=\"xs\" iconBefore />\n </lib-button-icon>\n</span>", styles: [".c-tag{display:inline-flex;height:1.5rem;padding:0 var(--space-component-padding-sm);align-items:center;gap:var(--space-component-gap-sm);flex-shrink:0;border-radius:var(--size-textfield-border-radius);text-align:center;font-family:var(--typography-label-xs-strong-family);font-size:var(--typography-label-xs-strong-size);font-style:normal;font-weight:var(--typography-label-xs-strong-weight);line-height:var(--typography-label-xs-strong-line-height);letter-spacing:var(--typography-label-xs-strong-letter-spacing)}.c-tag__dot{width:.5rem;height:.5rem;border-radius:50%;flex-shrink:0}.c-tag--alert{background:var(--color-feedback-danger-surface-background);color:var(--color-feedback-danger-default)}.c-tag--alert .c-tag__dot{background:var(--color-feedback-danger-default)}.c-tag--warning{color:var(--color-feedback-warning-default);background:var(--color-feedback-warning-surface-background)}.c-tag--warning .c-tag__dot{background:var(--color-feedback-warning-default)}.c-tag--success{color:var(--color-feedback-success-default);background:var(--color-feedback-success-surface-background)}.c-tag--success .c-tag__dot{background:var(--color-feedback-success-default)}.c-tag--info{background:var(--color-feedback-info-surface-background);color:var(--color-feedback-info-default)}.c-tag--info .c-tag__dot{background:var(--color-feedback-info-default)}.c-tag--neutral{background:var(--color-feedback-neutral-surface-background);color:var(--color-feedback-neutral-default)}.c-tag--neutral .c-tag__dot{background:var(--color-feedback-neutral-default)}.c-tag--primary{background:var(--color-decorative-primary-soft);color:var(--color-decorative-primary-strong)}.c-tag--primary .c-tag__dot{background:var(--color-decorative-primary-default)}.c-tag--secondary{background:var(--color-decorative-secondary-soft);color:var(--color-decorative-secondary-strong)}.c-tag--secondary .c-tag__dot{background:var(--color-decorative-secondary-default)}.c-tag--disabled{background:var(--color-action-neutral-background-disabled);color:var(--color-action-neutral-content-disabled)}.c-tag--disabled .c-tag__dot{background:var(--color-feedback-neutral-default)}.c-tag--emphasis{padding-right:0}.c-tag--emphasis .c-tag__close{border:var(--size-button-border-width) solid var(--color-button-inverse-border-default);height:100%;align-items:center;text-align:center;display:flex;border-radius:var(--size-button-border-radius)}.c-tag--emphasis.c-tag--alert{color:var(--color-feedback-danger-on-default);background:var(--color-feedback-danger-default)}.c-tag--emphasis.c-tag--alert .c-tag__dot{background:var(--color-feedback-danger-on-default)}.c-tag--emphasis.c-tag--warning{color:var(--color-feedback-warning-on-default);background:var(--color-feedback-warning-default)}.c-tag--emphasis.c-tag--warning .c-tag__dot{background:var(--color-feedback-warning-on-default)}.c-tag--emphasis.c-tag--success{color:var(--color-feedback-success-on-default);background:var(--color-feedback-success-default)}.c-tag--emphasis.c-tag--success .c-tag__dot{background:var(--color-feedback-success-on-default)}.c-tag--emphasis.c-tag--info{color:var(--color-feedback-info-on-default);background:var(--color-feedback-info-default)}.c-tag--emphasis.c-tag--info .c-tag__dot{background:var(--color-feedback-info-on-default)}.c-tag--emphasis.c-tag--neutral{color:var(--color-feedback-neutral-on-default);background:var(--color-feedback-neutral-default)}.c-tag--emphasis.c-tag--neutral .c-tag__dot{background:var(--color-feedback-neutral-on-default)}.c-tag--emphasis.c-tag--primary{background:var(--color-decorative-primary-default);color:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--primary .c-tag__dot{background:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--secondary{background:var(--color-decorative-secondary-default);color:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--secondary .c-tag__dot{background:var(--color-core-content-inverse)}.c-tag--emphasis.c-tag--disabled{background:var(--color-action-neutral-background-disabled);color:var(--color-action-neutral-content-disabled)}.c-tag--emphasis.c-tag--disabled .c-tag__dot{background:var(--color-feedback-neutral-default)}\n"] }]
|
|
1789
|
+
}], propDecorators: { variant: [{
|
|
1790
|
+
type: Input
|
|
1791
|
+
}], text: [{
|
|
1792
|
+
type: Input
|
|
1793
|
+
}], extraClass: [{
|
|
1794
|
+
type: Input
|
|
1795
|
+
}], showBadge: [{
|
|
1796
|
+
type: Input
|
|
1797
|
+
}], closeActive: [{
|
|
1798
|
+
type: Input
|
|
1799
|
+
}], emphasis: [{
|
|
1800
|
+
type: Input
|
|
1801
|
+
}], closeEvent: [{
|
|
1802
|
+
type: Output
|
|
1803
|
+
}] } });
|
|
1804
|
+
|
|
1805
|
+
class TextInputComponent {
|
|
1806
|
+
label = '';
|
|
1807
|
+
name = '';
|
|
1808
|
+
placeholder = '';
|
|
1809
|
+
helperText = '';
|
|
1810
|
+
error = false;
|
|
1811
|
+
success = false;
|
|
1812
|
+
successText = '';
|
|
1813
|
+
alertText = '';
|
|
1814
|
+
disabled = false;
|
|
1815
|
+
readonly = false;
|
|
1816
|
+
required = false;
|
|
1817
|
+
type = 'text';
|
|
1818
|
+
size = 'md';
|
|
1819
|
+
emitValue = new EventEmitter();
|
|
1820
|
+
_value = '';
|
|
1821
|
+
onChangeFn = () => { };
|
|
1822
|
+
onTouchedFn = () => { };
|
|
1823
|
+
writeValue(value) {
|
|
1824
|
+
this._value = value ?? '';
|
|
1825
|
+
}
|
|
1826
|
+
registerOnChange(fn) {
|
|
1827
|
+
this.onChangeFn = fn;
|
|
1828
|
+
}
|
|
1829
|
+
registerOnTouched(fn) {
|
|
1830
|
+
this.onTouchedFn = fn;
|
|
1831
|
+
}
|
|
1832
|
+
setDisabledState(isDisabled) {
|
|
1833
|
+
this.disabled = isDisabled;
|
|
1834
|
+
}
|
|
1835
|
+
get inputClass() {
|
|
1836
|
+
return [
|
|
1837
|
+
'c-text-input__input',
|
|
1838
|
+
`c-text-input__input--${this.size}`,
|
|
1839
|
+
this.error ? 'is-error' : this.success ? 'is-success' : 'is-default',
|
|
1840
|
+
this.disabled ? 'is-disabled' : '',
|
|
1841
|
+
this.readonly ? 'is-readonly' : ''
|
|
1842
|
+
].filter(Boolean);
|
|
1843
|
+
}
|
|
1844
|
+
get helperClass() {
|
|
1845
|
+
if (this.error)
|
|
1846
|
+
return 'is-error';
|
|
1847
|
+
if (this.success)
|
|
1848
|
+
return 'is-success';
|
|
1849
|
+
return 'is-default';
|
|
1850
|
+
}
|
|
1851
|
+
get ariaDescribedBy() {
|
|
1852
|
+
return this.helperText ? 'text-input-helper' : null;
|
|
1853
|
+
}
|
|
1854
|
+
onInput(event) {
|
|
1855
|
+
const input = event.target;
|
|
1856
|
+
this._value = input.value;
|
|
1857
|
+
this.onChangeFn(this._value);
|
|
1858
|
+
this.emitValue.emit(this._value);
|
|
1859
|
+
}
|
|
1860
|
+
onBlur() {
|
|
1861
|
+
this.onTouchedFn();
|
|
1862
|
+
}
|
|
1863
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1864
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TextInputComponent, isStandalone: true, selector: "lib-text-input", inputs: { label: "label", name: "name", placeholder: "placeholder", helperText: "helperText", error: "error", success: "success", successText: "successText", alertText: "alertText", disabled: "disabled", readonly: "readonly", required: "required", type: "type", size: "size" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
1865
|
+
{
|
|
1866
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1867
|
+
useExisting: forwardRef(() => TextInputComponent),
|
|
1868
|
+
multi: true
|
|
1869
|
+
}
|
|
1870
|
+
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label\n *ngIf=\"label\"\n [required]=\"required\"\n [for]=\"name\"\n [text]=\"label\"\n ></lib-input-label>\n\n <input\n [type]=\"type\"\n [class]=\"inputClass.join(' ')\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"_value\"\n [required]=\"required\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"label\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"text-input-helper\"\n class=\"c-text-input__helper\"\n [class]=\"helperClass\"\n >\n {{ helperText }}\n </span>\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-icon icon=\"alert\" size=\"md\"></lib-icon>{{ alertText }}\n </span>\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-icon icon=\"success\" size=\"md\"></lib-icon>{{ successText }}\n </span>\n</div>\n", styles: [".c-text-input{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
1871
|
+
}
|
|
1872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
1873
|
+
type: Component,
|
|
1874
|
+
args: [{ selector: 'lib-text-input', standalone: true, imports: [
|
|
1875
|
+
CommonModule,
|
|
1876
|
+
ReactiveFormsModule,
|
|
1877
|
+
InputLabelComponent,
|
|
1878
|
+
IconComponent
|
|
1879
|
+
], providers: [
|
|
1880
|
+
{
|
|
1881
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1882
|
+
useExisting: forwardRef(() => TextInputComponent),
|
|
1883
|
+
multi: true
|
|
1884
|
+
}
|
|
1885
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label\n *ngIf=\"label\"\n [required]=\"required\"\n [for]=\"name\"\n [text]=\"label\"\n ></lib-input-label>\n\n <input\n [type]=\"type\"\n [class]=\"inputClass.join(' ')\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [value]=\"_value\"\n [required]=\"required\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"label\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"text-input-helper\"\n class=\"c-text-input__helper\"\n [class]=\"helperClass\"\n >\n {{ helperText }}\n </span>\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-icon icon=\"alert\" size=\"md\"></lib-icon>{{ alertText }}\n </span>\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-icon icon=\"success\" size=\"md\"></lib-icon>{{ successText }}\n </span>\n</div>\n", styles: [".c-text-input{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input:focus{border:var(--size-textfield-border-width) solid var(--color-textfield-border-active);outline:none}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}\n"] }]
|
|
1886
|
+
}], propDecorators: { label: [{
|
|
1887
|
+
type: Input
|
|
1888
|
+
}], name: [{
|
|
1889
|
+
type: Input
|
|
1890
|
+
}], placeholder: [{
|
|
1891
|
+
type: Input
|
|
1892
|
+
}], helperText: [{
|
|
1893
|
+
type: Input
|
|
1894
|
+
}], error: [{
|
|
1895
|
+
type: Input
|
|
1896
|
+
}], success: [{
|
|
1897
|
+
type: Input
|
|
1898
|
+
}], successText: [{
|
|
1899
|
+
type: Input
|
|
1900
|
+
}], alertText: [{
|
|
1901
|
+
type: Input
|
|
1902
|
+
}], disabled: [{
|
|
1903
|
+
type: Input
|
|
1904
|
+
}], readonly: [{
|
|
1905
|
+
type: Input
|
|
1906
|
+
}], required: [{
|
|
1907
|
+
type: Input
|
|
1908
|
+
}], type: [{
|
|
1909
|
+
type: Input
|
|
1910
|
+
}], size: [{
|
|
1911
|
+
type: Input
|
|
1912
|
+
}], emitValue: [{
|
|
1913
|
+
type: Output
|
|
1914
|
+
}] } });
|
|
1915
|
+
|
|
1916
|
+
class TextareaComponent {
|
|
1917
|
+
label = '';
|
|
1918
|
+
placeholder = '';
|
|
1919
|
+
helperText = '';
|
|
1920
|
+
error = false;
|
|
1921
|
+
success = false;
|
|
1922
|
+
successText = '';
|
|
1923
|
+
alertText = '';
|
|
1924
|
+
name = '';
|
|
1925
|
+
disabled = false;
|
|
1926
|
+
readonly = false;
|
|
1927
|
+
required = false;
|
|
1928
|
+
size = 'md';
|
|
1929
|
+
emitValue = new EventEmitter();
|
|
1930
|
+
_value = '';
|
|
1931
|
+
onChangeFn = () => { };
|
|
1932
|
+
onTouchedFn = () => { };
|
|
1933
|
+
writeValue(value) {
|
|
1934
|
+
this._value = value ?? '';
|
|
1935
|
+
}
|
|
1936
|
+
registerOnChange(fn) {
|
|
1937
|
+
this.onChangeFn = fn;
|
|
1938
|
+
}
|
|
1939
|
+
registerOnTouched(fn) {
|
|
1940
|
+
this.onTouchedFn = fn;
|
|
1941
|
+
}
|
|
1942
|
+
setDisabledState(isDisabled) {
|
|
1943
|
+
this.disabled = isDisabled;
|
|
1944
|
+
}
|
|
1945
|
+
get inputClass() {
|
|
1946
|
+
return [
|
|
1947
|
+
'c-text-input__input',
|
|
1948
|
+
`c-text-input__input--${this.size}`,
|
|
1949
|
+
this.error ? 'is-error' : this.success ? 'is-success' : 'is-default',
|
|
1950
|
+
this.disabled ? 'is-disabled' : '',
|
|
1951
|
+
this.readonly ? 'is-readonly' : ''
|
|
1952
|
+
].filter(Boolean);
|
|
1953
|
+
}
|
|
1954
|
+
get ariaDescribedBy() {
|
|
1955
|
+
return this.helperText ? 'text-input-helper' : null;
|
|
1956
|
+
}
|
|
1957
|
+
onInput(event) {
|
|
1958
|
+
const input = event.target;
|
|
1959
|
+
this._value = input.value;
|
|
1960
|
+
this.onChangeFn(this._value);
|
|
1961
|
+
this.emitValue.emit(this._value);
|
|
1962
|
+
}
|
|
1963
|
+
onBlur() {
|
|
1964
|
+
this.onTouchedFn();
|
|
1965
|
+
}
|
|
1966
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1967
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TextareaComponent, isStandalone: true, selector: "lib-textarea", inputs: { label: "label", placeholder: "placeholder", helperText: "helperText", error: "error", success: "success", successText: "successText", alertText: "alertText", name: "name", disabled: "disabled", readonly: "readonly", required: "required", size: "size" }, outputs: { emitValue: "emitValue" }, providers: [
|
|
1968
|
+
{
|
|
1969
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1970
|
+
useExisting: forwardRef(() => TextareaComponent),
|
|
1971
|
+
multi: true
|
|
1972
|
+
}
|
|
1973
|
+
], ngImport: i0, template: "<div class=\"c-text-input\">\n <lib-input-label\n *ngIf=\"label\"\n [required]=\"required\"\n [text]=\"label\"\n ></lib-input-label>\n\n <textarea\n [class]=\"inputClass.join(' ')\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [attr.aria-label]=\"label\"\n [required]=\"required\"\n [value]=\"_value\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [name]=\"name\"\n ></textarea>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"text-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: InputLabelComponent, selector: "lib-input-label", inputs: ["text", "required", "md", "disabled", "for"] }, { kind: "component", type: HelperTextComponent, selector: "lib-helper-text", inputs: ["variant", "text", "extraClass"] }] });
|
|
1974
|
+
}
|
|
1975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1976
|
+
type: Component,
|
|
1977
|
+
args: [{ selector: 'lib-textarea', standalone: true, imports: [
|
|
1978
|
+
CommonModule,
|
|
1979
|
+
ReactiveFormsModule,
|
|
1980
|
+
InputLabelComponent,
|
|
1981
|
+
IconComponent,
|
|
1982
|
+
HelperTextComponent
|
|
1983
|
+
], providers: [
|
|
1984
|
+
{
|
|
1985
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1986
|
+
useExisting: forwardRef(() => TextareaComponent),
|
|
1987
|
+
multi: true
|
|
1988
|
+
}
|
|
1989
|
+
], template: "<div class=\"c-text-input\">\n <lib-input-label\n *ngIf=\"label\"\n [required]=\"required\"\n [text]=\"label\"\n ></lib-input-label>\n\n <textarea\n [class]=\"inputClass.join(' ')\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy\"\n [attr.aria-label]=\"label\"\n [required]=\"required\"\n [value]=\"_value\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [name]=\"name\"\n ></textarea>\n\n <span\n *ngIf=\"helperText && !error && !success\"\n id=\"text-input-helper\"\n class=\"c-text-input__helper\"\n >\n <lib-helper-text [text]=\"helperText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"alertText && error\" class=\"c-text-input__alert\">\n <lib-helper-text variant=\"alert\" [text]=\"alertText\"></lib-helper-text>\n </span>\n\n <span *ngIf=\"successText && success\" class=\"c-text-input__success\">\n <lib-helper-text variant=\"success\" [text]=\"successText\"></lib-helper-text>\n </span>\n</div>\n", styles: [".c-text-input{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:var(--space-component-gap-sm);max-width:300px}.c-text-input__input{width:100%;border-radius:var(--size-textfield-border-radius);border:var(--size-textfield-border-width) solid var(--color-textfield-border-default);background:var(--color-textfield-background-default);padding:var(--space-component-padding-sm) var(--space-component-padding-lg);align-items:center;gap:var(--space-component-gap-sm);align-self:stretch;color:var(--color-textfield-content-default);font-family:var(--typography-label-md-default-family);font-size:var(--typography-label-md-default-size);font-style:normal;font-weight:var(--typography-label-md-default-weight);line-height:var(--typography-label-md-default-line-height);letter-spacing:var(--typography-label-md-default-letter-spacing)}.c-text-input__input--sm{padding:var(--space-component-padding-xs) var(--space-component-padding-sm)}.c-text-input__input--md{padding:var(--space-component-padding-xs) var(--space-component-padding-md)}.c-text-input__input.is-error{border-color:var(--color-textfield-border-error)}.c-text-input__input.is-success{border-color:var(--color-feedback-success-surface-border)}.c-text-input__input.is-disabled{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled);color:var(--color-textfield-content-disabled)}.c-text-input__input.is-readonly{background-color:var(--color-textfield-background-disabled);border-color:var(--color-textfield-border-disabled)}.c-text-input__alert{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-danger-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__success{display:flex;gap:var(--space-component-gap-sm);color:var(--color-feedback-success-default);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper{color:var(--color-core-content-soft);font-family:var(--typography-label-sm-default-family);font-size:var(--typography-label-sm-default-size);font-style:normal;font-weight:var(--typography-label-sm-default-weight);line-height:var(--typography-label-sm-default-line-height);letter-spacing:var(--typography-label-sm-default-letter-spacing)}.c-text-input__helper.is-error{color:var(--color-textfield-helper-error)}.c-text-input__helper.is-success{color:var(--color-textfield-helper-success)}.c-text-input__helper.is-default{color:var(--color-textfield-helper-default)}\n"] }]
|
|
1990
|
+
}], propDecorators: { label: [{
|
|
1991
|
+
type: Input
|
|
1992
|
+
}], placeholder: [{
|
|
1993
|
+
type: Input
|
|
1994
|
+
}], helperText: [{
|
|
1995
|
+
type: Input
|
|
1996
|
+
}], error: [{
|
|
1997
|
+
type: Input
|
|
1998
|
+
}], success: [{
|
|
1999
|
+
type: Input
|
|
2000
|
+
}], successText: [{
|
|
2001
|
+
type: Input
|
|
2002
|
+
}], alertText: [{
|
|
2003
|
+
type: Input
|
|
2004
|
+
}], name: [{
|
|
2005
|
+
type: Input
|
|
2006
|
+
}], disabled: [{
|
|
2007
|
+
type: Input
|
|
2008
|
+
}], readonly: [{
|
|
2009
|
+
type: Input
|
|
2010
|
+
}], required: [{
|
|
2011
|
+
type: Input
|
|
2012
|
+
}], size: [{
|
|
2013
|
+
type: Input
|
|
2014
|
+
}], emitValue: [{
|
|
2015
|
+
type: Output
|
|
2016
|
+
}] } });
|
|
2017
|
+
|
|
2018
|
+
class ThumbnailComponent {
|
|
2019
|
+
size = 'xl';
|
|
2020
|
+
src = '';
|
|
2021
|
+
alt = '';
|
|
2022
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ThumbnailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2023
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: ThumbnailComponent, isStandalone: true, selector: "lib-thumbnail", inputs: { size: "size", src: "src", alt: "alt" }, ngImport: i0, template: "<figure [ngClass]=\"['c-thumbnail','c-thumbnail__' + size, !src ? 'c-thumbnail--no-img' : '']\">\n <img *ngIf=\"src\" [src]=\"src\" [alt]=\"alt\" class=\"c-thumbnail__img\" />\n <lib-icon icon=\"thumb\" *ngIf=\"!src\" [size]=\"size === 'xl' ? 'lg' : size\"/>\n</figure>\n", styles: [".c-thumbnail{display:flex;align-items:center;justify-content:center;border-radius:var(--size-border-radius-md);overflow:hidden}.c-thumbnail__img{width:100%;height:100%;object-fit:cover;object-position:center}.c-thumbnail--no-img{border:1px solid var(--color-core-border-soft);background:var(--color-core-background-default)}.c-thumbnail__xl{width:5rem;height:5rem}.c-thumbnail__lg{width:3.75rem;height:3.75rem}.c-thumbnail__md{width:2.5rem;height:2.5rem}.c-thumbnail__sm{width:1.5rem;height:1.5rem;border-radius:var(--size-border-radius-sm)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }] });
|
|
2024
|
+
}
|
|
2025
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ThumbnailComponent, decorators: [{
|
|
2026
|
+
type: Component,
|
|
2027
|
+
args: [{ selector: 'lib-thumbnail', imports: [CommonModule, IconComponent], template: "<figure [ngClass]=\"['c-thumbnail','c-thumbnail__' + size, !src ? 'c-thumbnail--no-img' : '']\">\n <img *ngIf=\"src\" [src]=\"src\" [alt]=\"alt\" class=\"c-thumbnail__img\" />\n <lib-icon icon=\"thumb\" *ngIf=\"!src\" [size]=\"size === 'xl' ? 'lg' : size\"/>\n</figure>\n", styles: [".c-thumbnail{display:flex;align-items:center;justify-content:center;border-radius:var(--size-border-radius-md);overflow:hidden}.c-thumbnail__img{width:100%;height:100%;object-fit:cover;object-position:center}.c-thumbnail--no-img{border:1px solid var(--color-core-border-soft);background:var(--color-core-background-default)}.c-thumbnail__xl{width:5rem;height:5rem}.c-thumbnail__lg{width:3.75rem;height:3.75rem}.c-thumbnail__md{width:2.5rem;height:2.5rem}.c-thumbnail__sm{width:1.5rem;height:1.5rem;border-radius:var(--size-border-radius-sm)}\n"] }]
|
|
2028
|
+
}], propDecorators: { size: [{
|
|
2029
|
+
type: Input
|
|
2030
|
+
}], src: [{
|
|
2031
|
+
type: Input
|
|
2032
|
+
}], alt: [{
|
|
2033
|
+
type: Input
|
|
2034
|
+
}] } });
|
|
2035
|
+
|
|
2036
|
+
class TileComponent {
|
|
2037
|
+
variant = 'neutral';
|
|
2038
|
+
title = '';
|
|
2039
|
+
name = '';
|
|
2040
|
+
value = false;
|
|
2041
|
+
disabled = false;
|
|
2042
|
+
valueExport = new EventEmitter();
|
|
2043
|
+
onClick() {
|
|
2044
|
+
if (this.disabled) {
|
|
2045
|
+
return;
|
|
2046
|
+
}
|
|
2047
|
+
this.value = !this.value;
|
|
2048
|
+
this.valueExport.emit(this.value);
|
|
2049
|
+
}
|
|
2050
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2051
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TileComponent, isStandalone: true, selector: "lib-tile", inputs: { variant: "variant", title: "title", name: "name", value: "value", disabled: "disabled" }, outputs: { valueExport: "valueExport" }, ngImport: i0, template: "<div class=\"c-tile\" [class.c-tile--selected]=\"value\" [class.c-tile--neutral]=\"variant === 'neutral'\" [class.c-tile--disabled]=\"disabled\" tabindex=\"0\" role=\"button\" (click)=\"onClick()\" (keyup.enter)=\"onClick()\">\n <div class=\"c-tile__wrapper\">\n <p class=\"c-tile__title\">{{ title }}</p>\n <lib-radio *ngIf=\"variant === 'radio'\" [name]=\"name\" label=\"\" [disabled]=\"disabled\" [value]=\"value ? 'true' : ''\" class=\"c-tile__check\"></lib-radio>\n <lib-checkbox *ngIf=\"variant === 'checkbox'\" label=\"\" [disabled]=\"disabled\" [checked]=\"value\" class=\"c-tile__check\"></lib-checkbox>\n </div>\n <div class=\"c-tile__content\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".c-tile{display:flex;width:18rem;padding:var(--space-page-padding-sm) var(--space-container-padding-sm);flex-direction:column;align-items:flex-start;gap:var(--space-container-gap-sm);border-radius:var(--size-border-radius-md);border:var(--size-border-width-sm) solid var(--color-tile-border-default);background:var(--color-tile-background-default);cursor:pointer}.c-tile:hover{border:var(--size-border-width-sm) solid var(--color-tile-border-hover);background:var(--color-tile-background-hover)}.c-tile--disabled,.c-tile--disabled:hover,.c-tile--disabled.c-tile--selected{border:var(--size-border-width-sm) solid var(--color-tile-border-disabled);background:var(--color-tile-background-disabled)}.c-tile__wrapper{display:flex;width:100%;height:100%;justify-content:space-between;align-items:center}.c-tile--selected,.c-tile--selected:hover{border:var(--size-border-width-sm, 1px) solid var(--color-tile-checked-border-default, #217870);background:var(--color-tile-checked-background-default, #EDFDFA)}.c-tile--neutral:focus{box-shadow:0 0 0 2px var(--color-effect-focus-contrast),0 0 0 4px var(--color-effect-focus-color)}.c-tile:focus .c-tile__check{box-shadow:0 0 0 2px var(--color-effect-focus-contrast),0 0 0 4px var(--color-effect-focus-color)}.c-tile__title{margin:0;color:var(--color-tile-content-default);font-family:var(--typography-label-md-strong-family);font-size:var(--typography-label-md-strong-size);font-style:normal;font-weight:var(--typography-label-md-strong-weight);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing)}.c-tile__check{display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RadioComponent, selector: "lib-radio", inputs: ["id", "name", "value", "label", "error", "disabled"], outputs: ["modelChange"] }, { kind: "component", type: CheckboxComponent, selector: "lib-checkbox", inputs: ["label", "id", "checked", "disabled", "error", "indeterminate"], outputs: ["changed"] }] });
|
|
2052
|
+
}
|
|
2053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TileComponent, decorators: [{
|
|
2054
|
+
type: Component,
|
|
2055
|
+
args: [{ selector: 'lib-tile', imports: [CommonModule, RadioComponent, CheckboxComponent], template: "<div class=\"c-tile\" [class.c-tile--selected]=\"value\" [class.c-tile--neutral]=\"variant === 'neutral'\" [class.c-tile--disabled]=\"disabled\" tabindex=\"0\" role=\"button\" (click)=\"onClick()\" (keyup.enter)=\"onClick()\">\n <div class=\"c-tile__wrapper\">\n <p class=\"c-tile__title\">{{ title }}</p>\n <lib-radio *ngIf=\"variant === 'radio'\" [name]=\"name\" label=\"\" [disabled]=\"disabled\" [value]=\"value ? 'true' : ''\" class=\"c-tile__check\"></lib-radio>\n <lib-checkbox *ngIf=\"variant === 'checkbox'\" label=\"\" [disabled]=\"disabled\" [checked]=\"value\" class=\"c-tile__check\"></lib-checkbox>\n </div>\n <div class=\"c-tile__content\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".c-tile{display:flex;width:18rem;padding:var(--space-page-padding-sm) var(--space-container-padding-sm);flex-direction:column;align-items:flex-start;gap:var(--space-container-gap-sm);border-radius:var(--size-border-radius-md);border:var(--size-border-width-sm) solid var(--color-tile-border-default);background:var(--color-tile-background-default);cursor:pointer}.c-tile:hover{border:var(--size-border-width-sm) solid var(--color-tile-border-hover);background:var(--color-tile-background-hover)}.c-tile--disabled,.c-tile--disabled:hover,.c-tile--disabled.c-tile--selected{border:var(--size-border-width-sm) solid var(--color-tile-border-disabled);background:var(--color-tile-background-disabled)}.c-tile__wrapper{display:flex;width:100%;height:100%;justify-content:space-between;align-items:center}.c-tile--selected,.c-tile--selected:hover{border:var(--size-border-width-sm, 1px) solid var(--color-tile-checked-border-default, #217870);background:var(--color-tile-checked-background-default, #EDFDFA)}.c-tile--neutral:focus{box-shadow:0 0 0 2px var(--color-effect-focus-contrast),0 0 0 4px var(--color-effect-focus-color)}.c-tile:focus .c-tile__check{box-shadow:0 0 0 2px var(--color-effect-focus-contrast),0 0 0 4px var(--color-effect-focus-color)}.c-tile__title{margin:0;color:var(--color-tile-content-default);font-family:var(--typography-label-md-strong-family);font-size:var(--typography-label-md-strong-size);font-style:normal;font-weight:var(--typography-label-md-strong-weight);line-height:var(--typography-label-md-strong-line-height);letter-spacing:var(--typography-label-md-strong-letter-spacing)}.c-tile__check{display:flex;align-items:center;justify-content:center}\n"] }]
|
|
2056
|
+
}], propDecorators: { variant: [{
|
|
2057
|
+
type: Input
|
|
2058
|
+
}], title: [{
|
|
2059
|
+
type: Input
|
|
2060
|
+
}], name: [{
|
|
2061
|
+
type: Input
|
|
2062
|
+
}], value: [{
|
|
2063
|
+
type: Input
|
|
2064
|
+
}], disabled: [{
|
|
2065
|
+
type: Input
|
|
2066
|
+
}], valueExport: [{
|
|
2067
|
+
type: Output
|
|
2068
|
+
}] } });
|
|
2069
|
+
|
|
2070
|
+
class ToastComponent {
|
|
2071
|
+
variant = 'neutral';
|
|
2072
|
+
text = '';
|
|
2073
|
+
title = '';
|
|
2074
|
+
time = 10;
|
|
2075
|
+
extraClass = '';
|
|
2076
|
+
showIcon = true;
|
|
2077
|
+
visibility = true;
|
|
2078
|
+
closeActive = false;
|
|
2079
|
+
ngOnInit() {
|
|
2080
|
+
setTimeout(() => {
|
|
2081
|
+
this.close();
|
|
2082
|
+
}, this.time * 1000);
|
|
2083
|
+
}
|
|
2084
|
+
close() {
|
|
2085
|
+
this.closeActive = true;
|
|
2086
|
+
setTimeout(() => {
|
|
2087
|
+
this.visibility = false;
|
|
2088
|
+
}, 1000);
|
|
2089
|
+
}
|
|
2090
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2091
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: ToastComponent, isStandalone: true, selector: "lib-toast", inputs: { variant: "variant", text: "text", title: "title", time: "time", extraClass: "extraClass", showIcon: "showIcon" }, ngImport: i0, template: "<div *ngIf=\"visibility\" [ngClass]=\"['c-toast', variant ? 'c-toast--' + variant : '', extraClass ? extraClass : '', closeActive ? 'c-toast--hide': '']\">\n <lib-icon *ngIf=\"showIcon\" [icon]=\"variant\" size=\"lg\" />\n <div class=\"c-toast__content\">\n <p class=\"c-toast__title\">{{ title }}</p>\n <p class=\"c-toast__text\">{{ text }}</p>\n </div>\n <lib-button-icon\n role=\"button\"\n [ariaLabel]=\"variant\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-toast__close\"\n (click)=\"close()\"\n >\n <lib-icon icon=\"close\" size=\"sm\" iconBefore />\n </lib-button-icon>\n</div>", styles: ["@keyframes toast-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes toast-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}.c-toast{position:fixed;width:22.5rem;top:10;right:0;z-index:10;padding:var(--space-component-padding-lg) var(--space-component-padding-md);border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-core-border-soft);background:var(--color-core-background-surface-raised);gap:.5rem;box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;align-items:flex-start;transition:opacity .3s ease,transform .3s ease;animation:toast-in .3s ease forwards}.c-toast__content{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:var(--space-component-gap-sm)}.c-toast__close{justify-self:flex-end;margin:0 0 0 auto}.c-toast__title{color:var(--color-core-content-default);font-family:var(--typography-title-sm-family);font-size:var(--typography-title-sm-size);font-style:normal;font-weight:var(--typography-title-sm-weight);line-height:var(--typography-title-sm-line-height);letter-spacing:var(--typography-title-sm-letter-spacing);margin:0 0 auto}.c-toast__text{color:var(--color-core-content-soft);font-family:var(--typography-body-sm-family);font-size:var(--typography-body-sm-size);font-style:normal;font-weight:var(--typography-body-sm-weight);line-height:var(--typography-body-sm-line-height);letter-spacing:var(--typography-body-sm-letter-spacing);margin:0 0 auto}.c-toast--hide{animation:toast-out .3s ease forwards}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["extraClass", "variant", "size", "icon"] }, { kind: "component", type: ButtonIconComponent, selector: "lib-button-icon", inputs: ["ariaLabel", "disabled", "loading", "variant", "size"] }] });
|
|
2092
|
+
}
|
|
2093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ToastComponent, decorators: [{
|
|
2094
|
+
type: Component,
|
|
2095
|
+
args: [{ selector: 'lib-toast', imports: [CommonModule, IconComponent, ButtonIconComponent], template: "<div *ngIf=\"visibility\" [ngClass]=\"['c-toast', variant ? 'c-toast--' + variant : '', extraClass ? extraClass : '', closeActive ? 'c-toast--hide': '']\">\n <lib-icon *ngIf=\"showIcon\" [icon]=\"variant\" size=\"lg\" />\n <div class=\"c-toast__content\">\n <p class=\"c-toast__title\">{{ title }}</p>\n <p class=\"c-toast__text\">{{ text }}</p>\n </div>\n <lib-button-icon\n role=\"button\"\n [ariaLabel]=\"variant\"\n [loading]=\"false\"\n variant=\"tertiary\"\n size=\"sm\"\n class=\"c-toast__close\"\n (click)=\"close()\"\n >\n <lib-icon icon=\"close\" size=\"sm\" iconBefore />\n </lib-button-icon>\n</div>", styles: ["@keyframes toast-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes toast-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}.c-toast{position:fixed;width:22.5rem;top:10;right:0;z-index:10;padding:var(--space-component-padding-lg) var(--space-component-padding-md);border-radius:var(--size-textfield-border-radius);border:1px solid var(--color-core-border-soft);background:var(--color-core-background-surface-raised);gap:.5rem;box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;align-items:flex-start;transition:opacity .3s ease,transform .3s ease;animation:toast-in .3s ease forwards}.c-toast__content{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:var(--space-component-gap-sm)}.c-toast__close{justify-self:flex-end;margin:0 0 0 auto}.c-toast__title{color:var(--color-core-content-default);font-family:var(--typography-title-sm-family);font-size:var(--typography-title-sm-size);font-style:normal;font-weight:var(--typography-title-sm-weight);line-height:var(--typography-title-sm-line-height);letter-spacing:var(--typography-title-sm-letter-spacing);margin:0 0 auto}.c-toast__text{color:var(--color-core-content-soft);font-family:var(--typography-body-sm-family);font-size:var(--typography-body-sm-size);font-style:normal;font-weight:var(--typography-body-sm-weight);line-height:var(--typography-body-sm-line-height);letter-spacing:var(--typography-body-sm-letter-spacing);margin:0 0 auto}.c-toast--hide{animation:toast-out .3s ease forwards}\n"] }]
|
|
2096
|
+
}], propDecorators: { variant: [{
|
|
2097
|
+
type: Input
|
|
2098
|
+
}], text: [{
|
|
2099
|
+
type: Input
|
|
2100
|
+
}], title: [{
|
|
2101
|
+
type: Input
|
|
2102
|
+
}], time: [{
|
|
2103
|
+
type: Input
|
|
2104
|
+
}], extraClass: [{
|
|
2105
|
+
type: Input
|
|
2106
|
+
}], showIcon: [{
|
|
2107
|
+
type: Input
|
|
2108
|
+
}] } });
|
|
2109
|
+
|
|
2110
|
+
let nextId = 0;
|
|
2111
|
+
class TooltipComponent {
|
|
2112
|
+
text = '';
|
|
2113
|
+
position = 'top';
|
|
2114
|
+
triggerId = `tooltip-trigger-${++nextId}`;
|
|
2115
|
+
tooltipId = `tooltip-${this.triggerId}`;
|
|
2116
|
+
visible = true;
|
|
2117
|
+
show() {
|
|
2118
|
+
this.visible = true;
|
|
2119
|
+
}
|
|
2120
|
+
hide() {
|
|
2121
|
+
// this.visible = false;
|
|
2122
|
+
}
|
|
2123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2124
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TooltipComponent, isStandalone: true, selector: "lib-tooltip", inputs: { text: "text", position: "position", triggerId: "triggerId" }, ngImport: i0, template: "<div [attr.role]=\"'tooltip'\" *ngIf=\"visible\" [class]=\"['c-tooltip', 'c-tooltip--' + position]\" [attr.id]=\"triggerId\">\n <ng-content></ng-content>\n \n <div\n class=\"c-tooltip__text\"\n [attr.id]=\"tooltipId\"\n [class]=\"position\"\n >\n {{ text }}\n </div>\n </div>\n ", styles: [".c-tooltip{position:absolute;z-index:100;border-radius:var(--size-border-radius-sm);background:var(--color-core-background-surface-floating);box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;max-width:9rem;padding:var(--space-component-padding-md);flex-direction:column;justify-content:center;align-items:flex-start;color:var(--color-core-content-soft);font-family:var(--typography-body-xs-family);font-size:var(--typography-body-xs-size);font-style:normal;font-weight:var(--typography-body-xs-weight);line-height:var(--typography-body-xs-line-height);letter-spacing:var(--typography-body-xs-letter-spacing)}.c-tooltip--bottom{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--left{left:100%;top:50%;transform:translate(.5rem) translateY(-50%)}.c-tooltip--left:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-right:16px solid var(--color-core-background-surface-floating);bottom:0;left:-.5rem;top:0;margin:auto 0}.c-tooltip--top{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--right{right:100%;top:50%;transform:translate(-.5rem) translateY(-50%)}.c-tooltip--right:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-left:16px solid var(--color-core-background-surface-floating);bottom:0;right:-.5rem;top:0;margin:auto 0}.c-tooltip--bottom-left{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--bottom-right{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;right:.75rem;margin:0 auto}.c-tooltip--top-left{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--top-right{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;right:.75rem;margin:0 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2125
|
+
}
|
|
2126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
2127
|
+
type: Component,
|
|
2128
|
+
args: [{ selector: 'lib-tooltip', standalone: true, imports: [CommonModule], template: "<div [attr.role]=\"'tooltip'\" *ngIf=\"visible\" [class]=\"['c-tooltip', 'c-tooltip--' + position]\" [attr.id]=\"triggerId\">\n <ng-content></ng-content>\n \n <div\n class=\"c-tooltip__text\"\n [attr.id]=\"tooltipId\"\n [class]=\"position\"\n >\n {{ text }}\n </div>\n </div>\n ", styles: [".c-tooltip{position:absolute;z-index:100;border-radius:var(--size-border-radius-sm);background:var(--color-core-background-surface-floating);box-shadow:0 0 4px 0 var(--color-effect-shadow-soft),0 4px 8px 0 var(--color-effect-shadow-soft);display:flex;max-width:9rem;padding:var(--space-component-padding-md);flex-direction:column;justify-content:center;align-items:flex-start;color:var(--color-core-content-soft);font-family:var(--typography-body-xs-family);font-size:var(--typography-body-xs-size);font-style:normal;font-weight:var(--typography-body-xs-weight);line-height:var(--typography-body-xs-line-height);letter-spacing:var(--typography-body-xs-letter-spacing)}.c-tooltip--bottom{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--left{left:100%;top:50%;transform:translate(.5rem) translateY(-50%)}.c-tooltip--left:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-right:16px solid var(--color-core-background-surface-floating);bottom:0;left:-.5rem;top:0;margin:auto 0}.c-tooltip--top{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:0;right:0;margin:0 auto}.c-tooltip--right{right:100%;top:50%;transform:translate(-.5rem) translateY(-50%)}.c-tooltip--right:before{content:\"\";position:absolute;width:0;height:0;border-top:16px solid transparent;border-bottom:16px solid transparent;border-left:16px solid var(--color-core-background-surface-floating);bottom:0;right:-.5rem;top:0;margin:auto 0}.c-tooltip--bottom-left{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--bottom-right{bottom:100%;left:50%;transform:translate(-50%) translateY(-.5rem)}.c-tooltip--bottom-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-top:16px solid var(--color-core-background-surface-floating);bottom:-.5rem;right:.75rem;margin:0 auto}.c-tooltip--top-left{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-left:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;left:.75rem;margin:0 auto}.c-tooltip--top-right{top:100%;left:50%;transform:translate(-50%) translateY(.5rem)}.c-tooltip--top-right:before{content:\"\";position:absolute;width:0;height:0;border-left:16px solid transparent;border-right:16px solid transparent;border-bottom:16px solid var(--color-core-background-surface-floating);top:-.5rem;right:.75rem;margin:0 auto}\n"] }]
|
|
2129
|
+
}], propDecorators: { text: [{
|
|
2130
|
+
type: Input
|
|
2131
|
+
}], position: [{
|
|
2132
|
+
type: Input
|
|
2133
|
+
}], triggerId: [{
|
|
1267
2134
|
type: Input
|
|
1268
|
-
}], emitValue: [{
|
|
1269
|
-
type: Output
|
|
1270
2135
|
}] } });
|
|
1271
2136
|
|
|
1272
2137
|
/**
|
|
1273
2138
|
* Generated bundle index. Do not edit.
|
|
1274
2139
|
*/
|
|
1275
2140
|
|
|
1276
|
-
export { AvatarComponent, ButtonComponent, ButtonIconComponent, ButtonSetComponent, CheckboxComponent, CheckboxGroupComponent, ChipsComponent, DesignTokensComponent, IconComponent, InputDateComponent, InputLabelComponent, InputNumberComponent, InputSearchComponent, LinkComponent, PasswordInputComponent, RadioComponent, RadioGroupComponent, SegmentedControlComponent, TextInputComponent, TextareaComponent, ThumbnailComponent, TooltipComponent };
|
|
2141
|
+
export { AccordionComponent, AlertComponent, AvatarComponent, BadgeComponent, ButtonComponent, ButtonIconComponent, ButtonSetComponent, CheckboxComponent, CheckboxGroupComponent, ChipsComponent, DesignTokensComponent, HelperTextComponent, IconComponent, InputDateComponent, InputLabelComponent, InputNumberComponent, InputPaymentComponent, InputSearchComponent, InputUploadComponent, LinkComponent, PaginationComponent, PasswordInputComponent, RadioComponent, RadioGroupComponent, SegmentedControlComponent, SelectComponent, SwitchComponent, TabsComponent, TagComponent, TextInputComponent, TextareaComponent, ThumbnailComponent, TileComponent, ToastComponent, TooltipComponent };
|
|
1277
2142
|
//# sourceMappingURL=crowdfarming-oliva-ds.mjs.map
|