valtech-components 2.0.787 → 2.0.794
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/esm2022/lib/components/molecules/select-input/select-input.component.mjs +26 -8
- package/esm2022/lib/components/organisms/form/form.component.mjs +39 -2
- package/esm2022/lib/components/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +63 -9
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +1 -1
- package/lib/components/molecules/select-input/select-input.component.d.ts +9 -0
- package/lib/components/molecules/username-input/username-input.component.d.ts +1 -1
- package/lib/components/organisms/form/form.component.d.ts +7 -0
- package/lib/components/types.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/components/styles/overrides.scss +2 -0
|
@@ -52,7 +52,7 @@ import 'prismjs/components/prism-json';
|
|
|
52
52
|
* Current version of valtech-components.
|
|
53
53
|
* This is automatically updated during the publish process.
|
|
54
54
|
*/
|
|
55
|
-
const VERSION = '2.0.
|
|
55
|
+
const VERSION = '2.0.794';
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Servicio para gestionar presets de componentes.
|
|
@@ -9901,17 +9901,35 @@ class SearchSelectorComponent {
|
|
|
9901
9901
|
breakpoints: [0, 0.6],
|
|
9902
9902
|
initialBreakpoint: 0.6,
|
|
9903
9903
|
};
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9904
|
+
this.customPopoverOptions = { cssClass: 'val-select-popover' };
|
|
9905
|
+
// Set button texts from props or use i18n defaults.
|
|
9906
|
+
// Fallback chain: namespace-less i18n → 'Common' namespace → hardcoded.
|
|
9907
|
+
// El namespace-less busca en _global; si no existe (caso typical app),
|
|
9908
|
+
// probamos en 'Common' que la mayoría de apps tienen poblado.
|
|
9909
|
+
this.cancelText = this.resolvedProps.cancelText || this.resolveI18n('cancel', 'Cancelar');
|
|
9910
|
+
this.okText = this.resolvedProps.okText || this.resolveI18n('ok', 'OK');
|
|
9911
|
+
}
|
|
9912
|
+
/**
|
|
9913
|
+
* Busca un key en `_global` primero, luego en `Common`, finalmente cae al
|
|
9914
|
+
* default hardcoded. Útil para textos cross-cutting (cancel/ok/close/etc.)
|
|
9915
|
+
* sin obligar a cada app a duplicarlos en cada namespace.
|
|
9916
|
+
*/
|
|
9917
|
+
resolveI18n(key, fallback) {
|
|
9918
|
+
const tryGlobal = this.i18n.t(key);
|
|
9919
|
+
if (tryGlobal && !tryGlobal.startsWith('['))
|
|
9920
|
+
return tryGlobal;
|
|
9921
|
+
const tryCommon = this.i18n.t(key, 'Common');
|
|
9922
|
+
if (tryCommon && !tryCommon.startsWith('['))
|
|
9923
|
+
return tryCommon;
|
|
9924
|
+
return fallback;
|
|
9907
9925
|
}
|
|
9908
9926
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SearchSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9909
9927
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SearchSelectorComponent, isStandalone: true, selector: "val-select-input", inputs: { preset: "preset", props: "props" }, usesOnChanges: true, ngImport: i0, template: `
|
|
9910
9928
|
<ion-select
|
|
9911
9929
|
[formControl]="resolvedProps.control"
|
|
9912
9930
|
[label]="resolvedProps.label"
|
|
9913
|
-
[interfaceOptions]="
|
|
9914
|
-
interface="
|
|
9931
|
+
[interfaceOptions]="customPopoverOptions"
|
|
9932
|
+
[interface]="resolvedProps.selectInterface || 'popover'"
|
|
9915
9933
|
[placeholder]="[resolvedProps.placeholder]"
|
|
9916
9934
|
[cancelText]="cancelText"
|
|
9917
9935
|
[okText]="okText"
|
|
@@ -9928,8 +9946,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
9928
9946
|
<ion-select
|
|
9929
9947
|
[formControl]="resolvedProps.control"
|
|
9930
9948
|
[label]="resolvedProps.label"
|
|
9931
|
-
[interfaceOptions]="
|
|
9932
|
-
interface="
|
|
9949
|
+
[interfaceOptions]="customPopoverOptions"
|
|
9950
|
+
[interface]="resolvedProps.selectInterface || 'popover'"
|
|
9933
9951
|
[placeholder]="[resolvedProps.placeholder]"
|
|
9934
9952
|
[cancelText]="cancelText"
|
|
9935
9953
|
[okText]="okText"
|
|
@@ -27185,6 +27203,7 @@ class FormComponent {
|
|
|
27185
27203
|
// WeakMap: si la referencia del field cambia, el cache se libera.
|
|
27186
27204
|
this.fieldPropMemo = new WeakMap();
|
|
27187
27205
|
this.usernamePropMemo = new WeakMap();
|
|
27206
|
+
this.textareaPropMemo = new WeakMap();
|
|
27188
27207
|
}
|
|
27189
27208
|
ngOnInit() {
|
|
27190
27209
|
const formControls = {};
|
|
@@ -27343,6 +27362,34 @@ class FormComponent {
|
|
|
27343
27362
|
this.usernamePropMemo.set(field, result);
|
|
27344
27363
|
return result;
|
|
27345
27364
|
}
|
|
27365
|
+
/**
|
|
27366
|
+
* Adapter — convierte un `InputMetadata` (con type=TEXTAREA) a `TextareaInputMetadata`.
|
|
27367
|
+
* Defaults sensatos: autoGrow + counter habilitado, 4-12 rows.
|
|
27368
|
+
*/
|
|
27369
|
+
getTextareaProp(field) {
|
|
27370
|
+
const cached = this.textareaPropMemo.get(field);
|
|
27371
|
+
if (cached)
|
|
27372
|
+
return cached;
|
|
27373
|
+
const control = this.getControl(field.name);
|
|
27374
|
+
const result = {
|
|
27375
|
+
control: control,
|
|
27376
|
+
name: field.name,
|
|
27377
|
+
label: field.label,
|
|
27378
|
+
hint: field.hint,
|
|
27379
|
+
placeholder: field.placeholder,
|
|
27380
|
+
autoGrow: true,
|
|
27381
|
+
minRows: 4,
|
|
27382
|
+
maxRows: 12,
|
|
27383
|
+
maxLength: field.range?.max ?? 2000,
|
|
27384
|
+
showCounter: true,
|
|
27385
|
+
counterFormat: 'current',
|
|
27386
|
+
fill: 'outline',
|
|
27387
|
+
errors: field.errors,
|
|
27388
|
+
state: field.state,
|
|
27389
|
+
};
|
|
27390
|
+
this.textareaPropMemo.set(field, result);
|
|
27391
|
+
return result;
|
|
27392
|
+
}
|
|
27346
27393
|
get isAtEndOfForm() {
|
|
27347
27394
|
return isAtEnd(this.elementRef);
|
|
27348
27395
|
}
|
|
@@ -27387,6 +27434,9 @@ class FormComponent {
|
|
|
27387
27434
|
@case (types.TEXT) {
|
|
27388
27435
|
<val-text-input [props]="getFieldProp(f)"></val-text-input>
|
|
27389
27436
|
}
|
|
27437
|
+
@case (types.TEXTAREA) {
|
|
27438
|
+
<val-textarea-input [props]="getTextareaProp(f)"></val-textarea-input>
|
|
27439
|
+
}
|
|
27390
27440
|
@case (types.CHECK) {
|
|
27391
27441
|
<val-check-input></val-check-input>
|
|
27392
27442
|
}
|
|
@@ -27455,7 +27505,7 @@ class FormComponent {
|
|
|
27455
27505
|
></val-button-group>
|
|
27456
27506
|
</form>
|
|
27457
27507
|
</div>
|
|
27458
|
-
`, isInline: true, styles: ["@charset \"UTF-8\";:root{--val-container-sm: 540px;--val-container-md: 720px;--val-container-lg: 880px;--val-container-xl: 1100px;--val-container-padding: 16px;--ion-color-primary: #7026df;--ion-color-primary-rgb: 112, 38, 223;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #6321c4;--ion-color-primary-tint: #7e3ce2;--ion-color-secondary: #e2ccff;--ion-color-secondary-rgb: 226, 204, 255;--ion-color-secondary-contrast: #000000;--ion-color-secondary-contrast-rgb: 0, 0, 0;--ion-color-secondary-shade: #c7b4e0;--ion-color-secondary-tint: #e5d1ff;--ion-color-texti: #354c69;--ion-color-texti-rgb: 53, 76, 105;--ion-color-texti-contrast: #ffffff;--ion-color-texti-contrast-rgb: 255, 255, 255;--ion-color-texti-shade: #2f435c;--ion-color-texti-tint: #495e78;--ion-color-darki: #090f1b;--ion-color-darki-rgb: 9, 15, 27;--ion-color-darki-contrast: #ffffff;--ion-color-darki-contrast-rgb: 255, 255, 255;--ion-color-darki-shade: #080d18;--ion-color-darki-tint: #222732;--ion-color-medium: #9e9e9e;--ion-color-medium-rgb: 158, 158, 158;--ion-color-medium-contrast: #000000;--ion-color-medium-contrast-rgb: 0, 0, 0;--ion-color-medium-shade: #8b8b8b;--ion-color-medium-tint: #a8a8a8;--swiper-pagination-color: var(--ion-color-primary);--swiper-navigation-color: var(--ion-color-primary);--swiper-pagination-bullet-inactive-color: var(--ion-color-medium)}body.dark,html.ion-palette-dark,body[data-theme=dark]{--ion-color-texti: #8fc1ff;--ion-color-texti-rgb: 143, 193, 255;--ion-color-texti-contrast: #000000;--ion-color-texti-contrast-rgb: 0, 0, 0;--ion-color-texti-shade: #7eaae0;--ion-color-texti-tint: #9ac7ff;--ion-color-darki: #ffffff;--ion-color-darki-rgb: 255, 255, 255;--ion-color-darki-contrast: #000000;--ion-color-darki-contrast-rgb: 0, 0, 0;--ion-color-darki-shade: #e0e0e0;--ion-color-darki-tint: #ffffff;--ion-color-primary: #8f49f8;--ion-color-primary-rgb: 143, 73, 248;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #7e40da;--ion-color-primary-tint: #9a5bf9}.ion-color-texti{--ion-color-base: var(--ion-color-texti);--ion-color-base-rgb: var(--ion-color-texti-rgb);--ion-color-contrast: var(--ion-color-texti-contrast);--ion-color-contrast-rgb: var(--ion-color-texti-contrast-rgb);--ion-color-shade: var(--ion-color-texti-shade);--ion-color-tint: var(--ion-color-texti-tint)}.ion-color-darki{--ion-color-base: var(--ion-color-darki);--ion-color-base-rgb: var(--ion-color-darki-rgb);--ion-color-contrast: var(--ion-color-darki-contrast);--ion-color-contrast-rgb: var(--ion-color-darki-contrast-rgb);--ion-color-shade: var(--ion-color-darki-shade);--ion-color-tint: var(--ion-color-darki-tint)}.section{margin-top:1rem}.input{margin:.5rem 0}@media (min-width: 768px){.input{margin:.75rem 0}}.field-description{display:block;font-size:.75rem;color:var(--ion-color-medium);margin-bottom:.25rem;line-height:1.4}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DisplayComponent, selector: "val-display", inputs: ["props"] }, { kind: "component", type: TitleComponent, selector: "val-title", inputs: ["props"] }, { kind: "component", type: TextInputComponent, selector: "val-text-input", inputs: ["preset", "props"] }, { kind: "component", type: CheckInputComponent, selector: "val-check-input", inputs: ["preset", "props"] }, { kind: "component", type: ButtonGroupComponent, selector: "val-button-group", inputs: ["props"], outputs: ["onClick"] }, { kind: "component", type: DividerComponent, selector: "val-divider", inputs: ["props"] }, { kind: "component", type: HintComponent, selector: "val-hint", inputs: ["props"] }, { kind: "component", type: CommentInputComponent, selector: "val-comment-input", inputs: ["props"] }, { kind: "component", type: DateInputComponent, selector: "val-date-input", inputs: ["preset", "props"] }, { kind: "component", type: FileInputComponent, selector: "val-file-input", inputs: ["props"] }, { kind: "component", type: HourInputComponent, selector: "val-hour-input", inputs: ["props"] }, { kind: "component", type: EmailInputComponent, selector: "val-email-input", inputs: ["preset", "props"] }, { kind: "component", type: NumberInputComponent, selector: "val-number-input", inputs: ["props"] }, { kind: "component", type: NumberFromToComponent, selector: "val-number-from-to", inputs: ["props"] }, { kind: "component", type: RadioInputComponent, selector: "val-radio-input", inputs: ["props"] }, { kind: "component", type: PasswordInputComponent, selector: "val-password-input", inputs: ["preset", "props"] }, { kind: "component", type: PinInputComponent, selector: "val-pin-input", inputs: ["props"] }, { kind: "component", type: SelectSearchComponent, selector: "val-select-search", inputs: ["label", "labelProperty", "valueProperty", "multiple", "placeholder", "props"] }, { kind: "component", type: MultiSelectSearchComponent, selector: "val-multi-select-search", inputs: ["label", "labelProperty", "valueProperty", "placeholder", "props"] }, { kind: "component", type: SearchSelectorComponent, selector: "val-select-input", inputs: ["preset", "props"] }, { kind: "component", type: PhoneInputComponent, selector: "val-phone-input", inputs: ["preset", "props"], outputs: ["phoneChange"] }, { kind: "component", type: ToggleInputComponent, selector: "val-toggle-input", inputs: ["preset", "props"] }, { kind: "component", type: CheckboxRadioInputComponent, selector: "val-checkbox-radio-input", inputs: ["props"] }, { kind: "component", type: UsernameInputComponent, selector: "val-username-input", inputs: ["props"] }] }); }
|
|
27508
|
+
`, isInline: true, styles: ["@charset \"UTF-8\";:root{--val-container-sm: 540px;--val-container-md: 720px;--val-container-lg: 880px;--val-container-xl: 1100px;--val-container-padding: 16px;--ion-color-primary: #7026df;--ion-color-primary-rgb: 112, 38, 223;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #6321c4;--ion-color-primary-tint: #7e3ce2;--ion-color-secondary: #e2ccff;--ion-color-secondary-rgb: 226, 204, 255;--ion-color-secondary-contrast: #000000;--ion-color-secondary-contrast-rgb: 0, 0, 0;--ion-color-secondary-shade: #c7b4e0;--ion-color-secondary-tint: #e5d1ff;--ion-color-texti: #354c69;--ion-color-texti-rgb: 53, 76, 105;--ion-color-texti-contrast: #ffffff;--ion-color-texti-contrast-rgb: 255, 255, 255;--ion-color-texti-shade: #2f435c;--ion-color-texti-tint: #495e78;--ion-color-darki: #090f1b;--ion-color-darki-rgb: 9, 15, 27;--ion-color-darki-contrast: #ffffff;--ion-color-darki-contrast-rgb: 255, 255, 255;--ion-color-darki-shade: #080d18;--ion-color-darki-tint: #222732;--ion-color-medium: #9e9e9e;--ion-color-medium-rgb: 158, 158, 158;--ion-color-medium-contrast: #000000;--ion-color-medium-contrast-rgb: 0, 0, 0;--ion-color-medium-shade: #8b8b8b;--ion-color-medium-tint: #a8a8a8;--swiper-pagination-color: var(--ion-color-primary);--swiper-navigation-color: var(--ion-color-primary);--swiper-pagination-bullet-inactive-color: var(--ion-color-medium)}body.dark,html.ion-palette-dark,body[data-theme=dark]{--ion-color-texti: #8fc1ff;--ion-color-texti-rgb: 143, 193, 255;--ion-color-texti-contrast: #000000;--ion-color-texti-contrast-rgb: 0, 0, 0;--ion-color-texti-shade: #7eaae0;--ion-color-texti-tint: #9ac7ff;--ion-color-darki: #ffffff;--ion-color-darki-rgb: 255, 255, 255;--ion-color-darki-contrast: #000000;--ion-color-darki-contrast-rgb: 0, 0, 0;--ion-color-darki-shade: #e0e0e0;--ion-color-darki-tint: #ffffff;--ion-color-primary: #8f49f8;--ion-color-primary-rgb: 143, 73, 248;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #7e40da;--ion-color-primary-tint: #9a5bf9}.ion-color-texti{--ion-color-base: var(--ion-color-texti);--ion-color-base-rgb: var(--ion-color-texti-rgb);--ion-color-contrast: var(--ion-color-texti-contrast);--ion-color-contrast-rgb: var(--ion-color-texti-contrast-rgb);--ion-color-shade: var(--ion-color-texti-shade);--ion-color-tint: var(--ion-color-texti-tint)}.ion-color-darki{--ion-color-base: var(--ion-color-darki);--ion-color-base-rgb: var(--ion-color-darki-rgb);--ion-color-contrast: var(--ion-color-darki-contrast);--ion-color-contrast-rgb: var(--ion-color-darki-contrast-rgb);--ion-color-shade: var(--ion-color-darki-shade);--ion-color-tint: var(--ion-color-darki-tint)}.section{margin-top:1rem}.input{margin:.5rem 0}@media (min-width: 768px){.input{margin:.75rem 0}}.field-description{display:block;font-size:.75rem;color:var(--ion-color-medium);margin-bottom:.25rem;line-height:1.4}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DisplayComponent, selector: "val-display", inputs: ["props"] }, { kind: "component", type: TitleComponent, selector: "val-title", inputs: ["props"] }, { kind: "component", type: TextInputComponent, selector: "val-text-input", inputs: ["preset", "props"] }, { kind: "component", type: TextareaInputComponent, selector: "val-textarea-input", inputs: ["preset", "props"] }, { kind: "component", type: CheckInputComponent, selector: "val-check-input", inputs: ["preset", "props"] }, { kind: "component", type: ButtonGroupComponent, selector: "val-button-group", inputs: ["props"], outputs: ["onClick"] }, { kind: "component", type: DividerComponent, selector: "val-divider", inputs: ["props"] }, { kind: "component", type: HintComponent, selector: "val-hint", inputs: ["props"] }, { kind: "component", type: CommentInputComponent, selector: "val-comment-input", inputs: ["props"] }, { kind: "component", type: DateInputComponent, selector: "val-date-input", inputs: ["preset", "props"] }, { kind: "component", type: FileInputComponent, selector: "val-file-input", inputs: ["props"] }, { kind: "component", type: HourInputComponent, selector: "val-hour-input", inputs: ["props"] }, { kind: "component", type: EmailInputComponent, selector: "val-email-input", inputs: ["preset", "props"] }, { kind: "component", type: NumberInputComponent, selector: "val-number-input", inputs: ["props"] }, { kind: "component", type: NumberFromToComponent, selector: "val-number-from-to", inputs: ["props"] }, { kind: "component", type: RadioInputComponent, selector: "val-radio-input", inputs: ["props"] }, { kind: "component", type: PasswordInputComponent, selector: "val-password-input", inputs: ["preset", "props"] }, { kind: "component", type: PinInputComponent, selector: "val-pin-input", inputs: ["props"] }, { kind: "component", type: SelectSearchComponent, selector: "val-select-search", inputs: ["label", "labelProperty", "valueProperty", "multiple", "placeholder", "props"] }, { kind: "component", type: MultiSelectSearchComponent, selector: "val-multi-select-search", inputs: ["label", "labelProperty", "valueProperty", "placeholder", "props"] }, { kind: "component", type: SearchSelectorComponent, selector: "val-select-input", inputs: ["preset", "props"] }, { kind: "component", type: PhoneInputComponent, selector: "val-phone-input", inputs: ["preset", "props"], outputs: ["phoneChange"] }, { kind: "component", type: ToggleInputComponent, selector: "val-toggle-input", inputs: ["preset", "props"] }, { kind: "component", type: CheckboxRadioInputComponent, selector: "val-checkbox-radio-input", inputs: ["props"] }, { kind: "component", type: UsernameInputComponent, selector: "val-username-input", inputs: ["props"] }] }); }
|
|
27459
27509
|
}
|
|
27460
27510
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormComponent, decorators: [{
|
|
27461
27511
|
type: Component,
|
|
@@ -27465,6 +27515,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
27465
27515
|
DisplayComponent,
|
|
27466
27516
|
TitleComponent,
|
|
27467
27517
|
TextInputComponent,
|
|
27518
|
+
TextareaInputComponent,
|
|
27468
27519
|
CheckInputComponent,
|
|
27469
27520
|
ButtonGroupComponent,
|
|
27470
27521
|
DividerComponent,
|
|
@@ -27513,6 +27564,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
27513
27564
|
@case (types.TEXT) {
|
|
27514
27565
|
<val-text-input [props]="getFieldProp(f)"></val-text-input>
|
|
27515
27566
|
}
|
|
27567
|
+
@case (types.TEXTAREA) {
|
|
27568
|
+
<val-textarea-input [props]="getTextareaProp(f)"></val-textarea-input>
|
|
27569
|
+
}
|
|
27516
27570
|
@case (types.CHECK) {
|
|
27517
27571
|
<val-check-input></val-check-input>
|
|
27518
27572
|
}
|