UNPKG

@ngx-formly/bootstrap

Version:

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

145 lines (129 loc) 7.05 kB
import * as i0 from '@angular/core'; import { Component, NgModule, Directive, Optional, ViewChild } from '@angular/core'; import * as i2 from '@angular/common'; import { CommonModule } from '@angular/common'; import * as i1 from '@ngx-formly/core'; import { FieldWrapper, FormlyModule, FieldType as FieldType$1 } from '@ngx-formly/core'; import { ReactiveFormsModule } from '@angular/forms'; class FormlyWrapperFormField extends FieldWrapper { } FormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyWrapperFormField, deps: null, target: i0.ɵɵFactoryTarget.Component }); FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyWrapperFormField, selector: "formly-wrapper-form-field", usesInheritance: true, ngImport: i0, template: ` <ng-template #labelTemplate> <label *ngIf="props.label && props.hideLabel !== true" [attr.for]="id" class="form-label"> {{ props.label }} <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span> </label> </ng-template> <div class="mb-3" [class.form-floating]="props.labelPosition === 'floating'" [class.has-error]="showError"> <ng-container *ngIf="props.labelPosition !== 'floating'"> <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container> </ng-container> <ng-template #fieldComponent></ng-template> <ng-container *ngIf="props.labelPosition === 'floating'"> <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container> </ng-container> <div *ngIf="showError" class="invalid-feedback" [style.display]="'block'"> <formly-validation-message id="{{ id }}-formly-validation-error" [field]="field" role="alert" ></formly-validation-message> </div> <small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small> </div> `, isInline: true, components: [{ type: i1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyWrapperFormField, decorators: [{ type: Component, args: [{ selector: 'formly-wrapper-form-field', template: ` <ng-template #labelTemplate> <label *ngIf="props.label && props.hideLabel !== true" [attr.for]="id" class="form-label"> {{ props.label }} <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span> </label> </ng-template> <div class="mb-3" [class.form-floating]="props.labelPosition === 'floating'" [class.has-error]="showError"> <ng-container *ngIf="props.labelPosition !== 'floating'"> <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container> </ng-container> <ng-template #fieldComponent></ng-template> <ng-container *ngIf="props.labelPosition === 'floating'"> <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container> </ng-container> <div *ngIf="showError" class="invalid-feedback" [style.display]="'block'"> <formly-validation-message id="{{ id }}-formly-validation-error" [field]="field" role="alert" ></formly-validation-message> </div> <small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small> </div> `, }] }] }); class FormlyBootstrapFormFieldModule { } FormlyBootstrapFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); FormlyBootstrapFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule, ReactiveFormsModule, i1.FormlyModule] }); FormlyBootstrapFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapFormFieldModule, imports: [[ CommonModule, ReactiveFormsModule, FormlyModule.forChild({ wrappers: [ { name: 'form-field', component: FormlyWrapperFormField, }, ], }), ]] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyBootstrapFormFieldModule, decorators: [{ type: NgModule, args: [{ declarations: [FormlyWrapperFormField], imports: [ CommonModule, ReactiveFormsModule, FormlyModule.forChild({ wrappers: [ { name: 'form-field', component: FormlyWrapperFormField, }, ], }), ], }] }] }); class FieldType extends FieldType$1 { constructor(hostContainerRef) { super(); this.hostContainerRef = hostContainerRef; } set content(templateRef) { if (templateRef && this.hostContainerRef) { this.hostContainerRef.createEmbeddedView(templateRef); } } } FieldType.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FieldType, deps: [{ token: i0.ViewContainerRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); FieldType.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FieldType, viewQueries: [{ propertyName: "content", first: true, predicate: ["fieldTypeTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FieldType, decorators: [{ type: Directive }], ctorParameters: function () { return [{ type: i0.ViewContainerRef, decorators: [{ type: Optional }] }]; }, propDecorators: { content: [{ type: ViewChild, args: ['fieldTypeTemplate', { static: true }] }] } }); /** * Generated bundle index. Do not edit. */ export { FieldType, FormlyBootstrapFormFieldModule }; //# sourceMappingURL=ngx-formly-bootstrap-form-field.mjs.map