UNPKG

@ngx-formly/bootstrap

Version:

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

1 lines 6.38 kB
{"version":3,"file":"ngx-formly-bootstrap-form-field.mjs","sources":["../../../../src/ui/bootstrap/form-field/src/form-field.wrapper.ts","../../../../src/ui/bootstrap/form-field/src/form-field.config.ts","../../../../src/ui/bootstrap/form-field/src/form-field.module.ts","../../../../src/ui/bootstrap/form-field/src/field.type.ts","../../../../src/ui/bootstrap/form-field/src/ngx-formly-bootstrap-form-field.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { FieldWrapper, FormlyFieldConfig, FormlyFieldProps as CoreFormlyFieldProps } from '@ngx-formly/core';\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n labelPosition?: 'floating';\n}\n\n@Component({\n selector: 'formly-wrapper-form-field',\n template: `\n <ng-template #labelTemplate>\n <label *ngIf=\"props.label && props.hideLabel !== true\" [attr.for]=\"id\" class=\"form-label\">\n {{ props.label }}\n <span *ngIf=\"props.required && props.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n </label>\n </ng-template>\n\n <div [class.form-floating]=\"props.labelPosition === 'floating'\" [class.has-error]=\"showError\">\n <ng-container *ngIf=\"props.labelPosition !== 'floating'\">\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n </ng-container>\n\n <ng-template #fieldComponent></ng-template>\n\n <ng-container *ngIf=\"props.labelPosition === 'floating'\">\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n </ng-container>\n\n <div *ngIf=\"showError\" class=\"invalid-feedback\" [style.display]=\"'block'\">\n <formly-validation-message\n id=\"{{ id }}-formly-validation-error\"\n [field]=\"field\"\n role=\"alert\"\n ></formly-validation-message>\n </div>\n\n <small *ngIf=\"props.description\" class=\"form-text text-muted\">{{ props.description }}</small>\n </div>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n})\nexport class FormlyWrapperFormField extends FieldWrapper<FormlyFieldConfig<FormlyFieldProps>> {}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\nexport function withFormlyFormField(): ConfigOption {\n return {\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\nimport { withFormlyFormField } from './form-field.config';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [CommonModule, ReactiveFormsModule, FormlyModule.forChild(withFormlyFormField())],\n})\nexport class FormlyBootstrapFormFieldModule {}\n","import { Directive, Optional, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig } from '@ngx-formly/core';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig = FormlyFieldConfig> extends CoreFieldType<F> {\n @ViewChild('fieldTypeTemplate', { static: true }) set content(templateRef: TemplateRef<any>) {\n if (templateRef && this.hostContainerRef) {\n this.hostContainerRef.createEmbeddedView(templateRef);\n }\n }\n\n constructor(@Optional() private hostContainerRef?: ViewContainerRef) {\n super();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","CoreFieldType"],"mappings":";;;;;;;;AA2CM,MAAO,sBAAuB,SAAQ,YAAiD,CAAA;+GAAhF,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,sBAAsB,EAhCvB,QAAA,EAAA,2BAA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