UNPKG

@ngx-formly/bootstrap

Version:

Formly is a dynamic (JSON powered) form library for Angular that bring unmatched maintainability to your application's forms.

141 lines (136 loc) 6.85 kB
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 i3 from '@ngx-formly/core'; import { FormlyModule } from '@ngx-formly/core'; import * as i2 from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms'; import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field'; class FormlyFieldCheckbox extends FieldType { constructor() { super(...arguments); this.defaultOptions = { props: { indeterminate: true, hideLabel: true, formCheck: 'default', }, }; } } FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldCheckbox, selector: "formly-field-checkbox", usesInheritance: true, ngImport: i0, template: ` <ng-template #fieldTypeTemplate> <div class="form-check" [ngClass]="{ 'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch', 'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch' }" > <input type="checkbox" [class.is-invalid]="showError" class="form-check-input" [class.position-static]="props.formCheck === 'nolabel'" [indeterminate]="props.indeterminate && formControl.value == null" [formControl]="formControl" [formlyAttributes]="field" [attr.aria-describedby]="id + '-formly-validation-error'" [attr.aria-invalid]="showError" /> <label *ngIf="props.formCheck !== 'nolabel'" [for]="id" class="form-check-label"> {{ props.label }} <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span> </label> </div> </ng-template> `, isInline: true, directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{ type: Component, args: [{ selector: 'formly-field-checkbox', template: ` <ng-template #fieldTypeTemplate> <div class="form-check" [ngClass]="{ 'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch', 'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch' }" > <input type="checkbox" [class.is-invalid]="showError" class="form-check-input" [class.position-static]="props.formCheck === 'nolabel'" [indeterminate]="props.indeterminate && formControl.value == null" [formControl]="formControl" [formlyAttributes]="field" [attr.aria-describedby]="id + '-formly-validation-error'" [attr.aria-invalid]="showError" /> <label *ngIf="props.formCheck !== 'nolabel'" [for]="id" class="form-check-label"> {{ props.label }} <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span> </label> </div> </ng-template> `, changeDetection: ChangeDetectionStrategy.OnPush, }] }] }); class FormlyBootstrapCheckboxModule { } FormlyBootstrapCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); FormlyBootstrapCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule, ReactiveFormsModule, FormlyBootstrapFormFieldModule, i3.FormlyModule] }); FormlyBootstrapCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapCheckboxModule, imports: [[ CommonModule, ReactiveFormsModule, FormlyBootstrapFormFieldModule, FormlyModule.forChild({ types: [ { name: 'checkbox', component: FormlyFieldCheckbox, wrappers: ['form-field'], }, { name: 'boolean', extends: 'checkbox', }, ], }), ]] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapCheckboxModule, decorators: [{ type: NgModule, args: [{ declarations: [FormlyFieldCheckbox], imports: [ CommonModule, ReactiveFormsModule, FormlyBootstrapFormFieldModule, FormlyModule.forChild({ types: [ { name: 'checkbox', component: FormlyFieldCheckbox, wrappers: ['form-field'], }, { name: 'boolean', extends: 'checkbox', }, ], }), ], }] }] }); /** * Generated bundle index. Do not edit. */ export { FormlyBootstrapCheckboxModule, FormlyFieldCheckbox }; //# sourceMappingURL=ngx-formly-bootstrap-checkbox.mjs.map