@ngx-formly/material
Version:
Formly is a dynamic (JSON powered) form library for Angular that bring unmatched maintainability to your application's forms.
177 lines (172 loc) • 8.26 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i4 from '@ngx-formly/core';
import { FormlyModule } from '@ngx-formly/core';
import * as i3 from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
import * as i2 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
class FormlyFieldInput extends FieldType {
get type() {
return this.props.type || 'text';
}
}
FormlyFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
FormlyFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldInput, selector: "formly-field-mat-input", usesInheritance: true, ngImport: i0, template: `
<input
*ngIf="type !== 'number'; else numberTmp"
matInput
[id]="id"
[name]="field.name"
[type]="type || 'text'"
[readonly]="props.readonly"
[required]="required"
[errorStateMatcher]="errorStateMatcher"
[formControl]="formControl"
[formlyAttributes]="field"
[tabIndex]="props.tabindex"
[placeholder]="props.placeholder"
/>
<ng-template #numberTmp>
<input
matInput
[id]="id"
[name]="field.name"
type="number"
[readonly]="props.readonly"
[required]="required"
[errorStateMatcher]="errorStateMatcher"
[formControl]="formControl"
[formlyAttributes]="field"
[tabIndex]="props.tabindex"
[placeholder]="props.placeholder"
/>
</ng-template>
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldInput, decorators: [{
type: Component,
args: [{
selector: 'formly-field-mat-input',
template: `
<input
*ngIf="type !== 'number'; else numberTmp"
matInput
[id]="id"
[name]="field.name"
[type]="type || 'text'"
[readonly]="props.readonly"
[required]="required"
[errorStateMatcher]="errorStateMatcher"
[formControl]="formControl"
[formlyAttributes]="field"
[tabIndex]="props.tabindex"
[placeholder]="props.placeholder"
/>
<ng-template #numberTmp>
<input
matInput
[id]="id"
[name]="field.name"
type="number"
[readonly]="props.readonly"
[required]="required"
[errorStateMatcher]="errorStateMatcher"
[formControl]="formControl"
[formlyAttributes]="field"
[tabIndex]="props.tabindex"
[placeholder]="props.placeholder"
/>
</ng-template>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
}]
}] });
class FormlyMatInputModule {
}
FormlyMatInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
FormlyMatInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
ReactiveFormsModule,
MatInputModule,
FormlyMatFormFieldModule, i4.FormlyModule] });
FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, imports: [[
CommonModule,
ReactiveFormsModule,
MatInputModule,
FormlyMatFormFieldModule,
FormlyModule.forChild({
types: [
{
name: 'input',
component: FormlyFieldInput,
wrappers: ['form-field'],
},
{ name: 'string', extends: 'input' },
{
name: 'number',
extends: 'input',
defaultOptions: {
props: {
type: 'number',
},
},
},
{
name: 'integer',
extends: 'input',
defaultOptions: {
props: {
type: 'number',
},
},
},
],
}),
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatInputModule, decorators: [{
type: NgModule,
args: [{
declarations: [FormlyFieldInput],
imports: [
CommonModule,
ReactiveFormsModule,
MatInputModule,
FormlyMatFormFieldModule,
FormlyModule.forChild({
types: [
{
name: 'input',
component: FormlyFieldInput,
wrappers: ['form-field'],
},
{ name: 'string', extends: 'input' },
{
name: 'number',
extends: 'input',
defaultOptions: {
props: {
type: 'number',
},
},
},
{
name: 'integer',
extends: 'input',
defaultOptions: {
props: {
type: 'number',
},
},
},
],
}),
],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { FormlyFieldInput, FormlyMatInputModule };
//# sourceMappingURL=ngx-formly-material-input.mjs.map