@ngx-formly/ionic
Version:
Formly is a dynamic (JSON powered) form library for Angular that bring unmatched maintainability to your application's forms.
107 lines (100 loc) • 6.08 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, Input, Inject, Directive, NgModule } from '@angular/core';
import * as i3 from '@ngx-formly/core';
import { FieldWrapper, FormlyAttributes, FormlyModule } from '@ngx-formly/core';
import * as i1 from '@angular/common';
import { DOCUMENT, CommonModule } from '@angular/common';
import * as i2 from '@ionic/angular';
import { IonicModule } from '@ionic/angular';
import { ReactiveFormsModule } from '@angular/forms';
class FormlyWrapperFormField extends FieldWrapper {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FormlyWrapperFormField, selector: "formly-wrapper-ion-form-field", usesInheritance: true, ngImport: i0, template: `
<ion-item [lines]="props.itemLines">
<ng-template #fieldComponent></ng-template>
</ion-item>
<ion-item lines="none" *ngIf="showError">
<ion-label>
<ion-text color="danger">
<p>
<formly-validation-message [field]="field"></formly-validation-message>
</p>
</ion-text>
</ion-label>
</ion-item>
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: i3.LegacyFormlyValidationMessage, selector: "formly-validation-message" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
type: Component,
args: [{
selector: 'formly-wrapper-ion-form-field',
template: `
<ion-item [lines]="props.itemLines">
<ng-template #fieldComponent></ng-template>
</ion-item>
<ion-item lines="none" *ngIf="showError">
<ion-label>
<ion-text color="danger">
<p>
<formly-validation-message [field]="field"></formly-validation-message>
</p>
</ion-text>
</ion-label>
</ion-item>
`,
}]
}] });
function withFormlyFormField() {
return {
wrappers: [
{
name: 'form-field',
component: FormlyWrapperFormField,
},
],
};
}
class IonFormlyAttributes extends FormlyAttributes {
constructor(renderer, elementRef, _document) {
super(renderer, elementRef, _document);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IonFormlyAttributes, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: IonFormlyAttributes, selector: "[ionFormlyAttributes]", inputs: { field: ["ionFormlyAttributes", "field"] }, host: { listeners: { "ionFocus": "onFocus($event)", "ionBlur": "onBlur($event)", "ionChange": "onChange($event)", "ionInput": "onChange($event)" } }, usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IonFormlyAttributes, decorators: [{
type: Directive,
args: [{
// eslint-disable-next-line
selector: '[ionFormlyAttributes]',
host: {
'(ionFocus)': 'onFocus($event)',
'(ionBlur)': 'onBlur($event)',
'(ionChange)': 'onChange($event)',
'(ionInput)': 'onChange($event)',
},
}]
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: undefined, decorators: [{
type: Inject,
args: [DOCUMENT]
}] }], propDecorators: { field: [{
type: Input,
args: ['ionFormlyAttributes']
}] } });
class FormlyFormFieldModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FormlyFormFieldModule, declarations: [FormlyWrapperFormField, IonFormlyAttributes], imports: [CommonModule, ReactiveFormsModule, IonicModule, i3.FormlyModule], exports: [IonFormlyAttributes] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFormFieldModule, imports: [CommonModule, ReactiveFormsModule, IonicModule, FormlyModule.forChild(withFormlyFormField())] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFormFieldModule, decorators: [{
type: NgModule,
args: [{
declarations: [FormlyWrapperFormField, IonFormlyAttributes],
exports: [IonFormlyAttributes],
imports: [CommonModule, ReactiveFormsModule, IonicModule, FormlyModule.forChild(withFormlyFormField())],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { FormlyFormFieldModule, withFormlyFormField, IonFormlyAttributes as ɵIonFormlyAttributes };
//# sourceMappingURL=ngx-formly-ionic-form-field.mjs.map