@ngx-formly/ionic
Version:
Formly is a dynamic (JSON powered) form library for Angular that bring unmatched maintainability to your application's forms.
74 lines (68 loc) • 4.2 kB
JavaScript
import * as i0 from '@angular/core';
import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import * as i1$1 from '@ngx-formly/core';
import { FieldType, FormlyModule } from '@ngx-formly/core';
import * as i1 from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import * as i2 from '@ionic/angular';
import { IonicModule } from '@ionic/angular';
import * as i3 from '@ngx-formly/ionic/form-field';
import { FormlyFormFieldModule } from '@ngx-formly/ionic/form-field';
import { CommonModule } from '@angular/common';
class FormlyFieldToggle extends FieldType {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldToggle, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FormlyFieldToggle, selector: "formly-field-ion-toggle", usesInheritance: true, ngImport: i0, template: `
<ion-toggle [formControl]="formControl" [ionFormlyAttributes]="field">
{{ props.label }}
</ion-toggle>
`, isInline: true, styles: [":host{display:inherit}\n"], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.IonToggle, selector: "ion-toggle", inputs: ["alignment", "checked", "color", "disabled", "enableOnOffLabels", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "directive", type: i2.BooleanValueAccessor, selector: "ion-checkbox,ion-toggle" }, { kind: "directive", type: i3.ɵIonFormlyAttributes, selector: "[ionFormlyAttributes]", inputs: ["ionFormlyAttributes"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldToggle, decorators: [{
type: Component,
args: [{ selector: 'formly-field-ion-toggle', template: `
<ion-toggle [formControl]="formControl" [ionFormlyAttributes]="field">
{{ props.label }}
</ion-toggle>
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inherit}\n"] }]
}] });
function withFormlyFieldToggle() {
return {
types: [
{
name: 'toggle',
component: FormlyFieldToggle,
wrappers: ['form-field'],
},
],
};
}
class FormlyToggleModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FormlyToggleModule, declarations: [FormlyFieldToggle], imports: [CommonModule,
ReactiveFormsModule,
IonicModule,
FormlyFormFieldModule, i1$1.FormlyModule] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyToggleModule, imports: [CommonModule,
ReactiveFormsModule,
IonicModule,
FormlyFormFieldModule,
FormlyModule.forChild(withFormlyFieldToggle())] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyToggleModule, decorators: [{
type: NgModule,
args: [{
declarations: [FormlyFieldToggle],
imports: [
CommonModule,
ReactiveFormsModule,
IonicModule,
FormlyFormFieldModule,
FormlyModule.forChild(withFormlyFieldToggle()),
],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { FormlyToggleModule, withFormlyFieldToggle };
//# sourceMappingURL=ngx-formly-ionic-toggle.mjs.map