@vality/matez 22.0.1-5a02952.0 → 22.0.1-5e10ac0.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.
@@ -28,7 +28,7 @@ import * as i3$1 from '@angular/material/tooltip';
28
28
  import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
29
29
  import { random, isNil as isNil$1, get, difference, isEqual as isEqual$1, isObject as isObject$2, capitalize, negate, isEmpty as isEmpty$1, lowerFirst } from 'lodash-es';
30
30
  import * as i3 from '@angular/forms/signals';
31
- import { form, required, disabled, FormField, transformedValue } from '@angular/forms/signals';
31
+ import { transformedValue, form, required, disabled, FormField } from '@angular/forms/signals';
32
32
  import * as i2$2 from '@angular/material/input';
33
33
  import { MatInputModule } from '@angular/material/input';
34
34
  import * as i2$3 from '@angular/material/chips';
@@ -358,13 +358,9 @@ class InputFieldComponent {
358
358
  ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
359
359
  required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
360
360
  touch = output();
361
- control = form(this.value, (path) => {
362
- required(path, { when: () => this.required() });
363
- disabled(path, () => this.disabled());
364
- });
365
361
  label;
366
362
  placeholder = '';
367
- type = 'string';
363
+ type = 'text';
368
364
  appearance;
369
365
  size;
370
366
  cleanButton = input(false, { ...(ngDevMode ? { debugName: "cleanButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
@@ -372,8 +368,23 @@ class InputFieldComponent {
372
368
  ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
373
369
  hintText = input(/* @ts-ignore */
374
370
  ...(ngDevMode ? [undefined, { debugName: "hintText" }] : /* istanbul ignore next */ []));
371
+ formValue = transformedValue(this.value, {
372
+ parse: (rawValue) => ({
373
+ value: rawValue,
374
+ }),
375
+ format: (value) => {
376
+ if (this.type === 'number') {
377
+ return value ?? null;
378
+ }
379
+ return value ?? '';
380
+ },
381
+ });
382
+ control = form(this.formValue, (path) => {
383
+ required(path, { when: () => this.required() });
384
+ disabled(path, () => this.disabled());
385
+ });
375
386
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
376
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: InputFieldComponent, isStandalone: false, selector: "v-input-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, cleanButton: { classPropertyName: "cleanButton", publicName: "cleanButton", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, hintText: { classPropertyName: "hintText", publicName: "hintText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, ngImport: i0, template: "<mat-form-field\n [appearance]=\"appearance\"\n [ngClass]=\"{\n 'v-input-field__small': size === 'small',\n 'v-input-field__outline': appearance === 'outline',\n }\"\n class=\"v-input-field\"\n>\n @if (icon()) {\n <div class=\"prefix\" matPrefix>\n <mat-icon>{{ icon() }}</mat-icon>\n </div>\n }\n <mat-label>{{ label }}</mat-label>\n <input\n [formField]=\"control\"\n [placeholder]=\"placeholder\"\n [type]=\"type\"\n autocomplete=\"false\"\n matInput\n (blur)=\"touch.emit()\"\n />\n <div class=\"postfix\" matSuffix>\n @if (cleanButton()) {\n <button\n [disabled]=\"!value()\"\n [style.visibility]=\"value() ? '' : 'hidden'\"\n mat-icon-button\n type=\"button\"\n (click)=\"control().reset(); value.set(undefined)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n }\n </div>\n @if (hintText()) {\n <mat-hint>{{ hintText() }}</mat-hint>\n }\n</mat-form-field>\n", styles: [".v-input-field{width:100%}.v-input-field .postfix{white-space:nowrap}.v-input-field__small ::ng-deep .mat-icon{transform:scale(.75)!important}.v-input-field__outline .postfix{padding-right:4px}.v-input-field__outline .prefix{padding-left:4px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i3.FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
387
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: InputFieldComponent, isStandalone: false, selector: "v-input-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: (v) => (v === 'string' ? 'text' : v) }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, cleanButton: { classPropertyName: "cleanButton", publicName: "cleanButton", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, hintText: { classPropertyName: "hintText", publicName: "hintText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, ngImport: i0, template: "<mat-form-field\n [appearance]=\"appearance\"\n [ngClass]=\"{\n 'v-input-field__small': size === 'small',\n 'v-input-field__outline': appearance === 'outline',\n }\"\n class=\"v-input-field\"\n>\n @if (icon()) {\n <div class=\"prefix\" matPrefix>\n <mat-icon>{{ icon() }}</mat-icon>\n </div>\n }\n <mat-label>{{ label }}</mat-label>\n <input\n [formField]=\"control\"\n [placeholder]=\"placeholder\"\n [type]=\"type\"\n autocomplete=\"false\"\n matInput\n (blur)=\"touch.emit()\"\n />\n <div class=\"postfix\" matSuffix>\n @if (cleanButton()) {\n <button\n [disabled]=\"!value()\"\n [style.visibility]=\"value() ? '' : 'hidden'\"\n mat-icon-button\n type=\"button\"\n (click)=\"control().reset(); value.set(undefined)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n }\n </div>\n @if (hintText()) {\n <mat-hint>{{ hintText() }}</mat-hint>\n }\n</mat-form-field>\n", styles: [".v-input-field{width:100%}.v-input-field .postfix{white-space:nowrap}.v-input-field__small ::ng-deep .mat-icon{transform:scale(.75)!important}.v-input-field__outline .postfix{padding-right:4px}.v-input-field__outline .prefix{padding-left:4px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i3.FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
377
388
  }
378
389
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: InputFieldComponent, decorators: [{
379
390
  type: Component,
@@ -383,7 +394,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
383
394
  }], placeholder: [{
384
395
  type: Input
385
396
  }], type: [{
386
- type: Input
397
+ type: Input,
398
+ args: [{ transform: (v) => (v === 'string' ? 'text' : v) }]
387
399
  }], appearance: [{
388
400
  type: Input
389
401
  }], size: [{