ngx-form-lib
Version:
Dynamic form library for Angular 18 with Material 3 support. Create complex reactive forms easily using JSON configuration with modern Angular 18 control flow syntax.
1 lines • 84.3 kB
Source Map (JSON)
{"version":3,"file":"ngx-form-lib.mjs","sources":["../../../projects/ngx-form-lib/src/lib/shared/decorators/auto-unsubscribe.decorator.ts","../../../projects/ngx-form-lib/src/lib/shared/models/validation-type.model.ts","../../../projects/ngx-form-lib/src/lib/core/services/forms.service.ts","../../../projects/ngx-form-lib/src/lib/core/services/dependencies.service.ts","../../../projects/ngx-form-lib/src/lib/core/components/base/base.component.ts","../../../projects/ngx-form-lib/src/lib/features/button/button-attribute.model.ts","../../../projects/ngx-form-lib/src/lib/shared/pipes/set-parent-config/set-parent-config.pipe.ts","../../../projects/ngx-form-lib/src/lib/features/button/button.component.ts","../../../projects/ngx-form-lib/src/lib/features/button/button.component.html","../../../projects/ngx-form-lib/src/lib/features/checkbox/checkbox.component.ts","../../../projects/ngx-form-lib/src/lib/features/checkbox/checkbox.component.html","../../../projects/ngx-form-lib/src/lib/shared/models/prefix-suffix.model.ts","../../../projects/ngx-form-lib/src/lib/shared/components/prefix-suffix/prefix-suffix.component.ts","../../../projects/ngx-form-lib/src/lib/shared/components/prefix-suffix/prefix-suffix.component.html","../../../projects/ngx-form-lib/src/lib/features/dropdown/dropdown.component.ts","../../../projects/ngx-form-lib/src/lib/features/dropdown/dropdown.component.html","../../../projects/ngx-form-lib/src/lib/features/input/input.component.ts","../../../projects/ngx-form-lib/src/lib/features/input/input.component.html","../../../projects/ngx-form-lib/src/lib/features/radio/radio.component.ts","../../../projects/ngx-form-lib/src/lib/features/radio/radio.component.html","../../../projects/ngx-form-lib/src/lib/features/textarea/textarea.component.ts","../../../projects/ngx-form-lib/src/lib/features/textarea/textarea.component.html","../../../projects/ngx-form-lib/src/lib/core/containers/container.component.ts","../../../projects/ngx-form-lib/src/lib/shared/pipes/sort-by-order/sort-by-order.pipe.ts","../../../projects/ngx-form-lib/src/lib/core/components/form/form.component.ts","../../../projects/ngx-form-lib/src/lib/core/components/form/form.component.html","../../../projects/ngx-form-lib/src/lib/core/containers/container.module.ts","../../../projects/ngx-form-lib/src/lib/shared/pipes/sort-by-order/sort-by-order.module.ts","../../../projects/ngx-form-lib/src/lib/core/components/form/form.module.ts","../../../projects/ngx-form-lib/src/lib/shared/components/prefix-suffix/prefix-suffix.module.ts","../../../projects/ngx-form-lib/src/lib/shared/pipes/set-parent-config/set-parent-config.module.ts","../../../projects/ngx-form-lib/src/lib/core/components/base/base.module.ts","../../../projects/ngx-form-lib/src/lib/features/button/button.module.ts","../../../projects/ngx-form-lib/src/lib/shared/enums/field-type.enum.ts","../../../projects/ngx-form-lib/src/lib/shared/models/field.model.ts","../../../projects/ngx-form-lib/src/lib/features/button/button.model.ts","../../../projects/ngx-form-lib/src/lib/features/checkbox/checkbox.module.ts","../../../projects/ngx-form-lib/src/lib/features/checkbox/checkbox.model.ts","../../../projects/ngx-form-lib/src/lib/features/checkbox/checkbox-label-position.model.ts","../../../projects/ngx-form-lib/src/lib/features/dropdown/dropdown.module.ts","../../../projects/ngx-form-lib/src/lib/features/dropdown/dropdown.model.ts","../../../projects/ngx-form-lib/src/lib/features/input/input.module.ts","../../../projects/ngx-form-lib/src/lib/features/input/field-sub-type.model.ts","../../../projects/ngx-form-lib/src/lib/features/input/input.model.ts","../../../projects/ngx-form-lib/src/lib/features/radio/radio.module.ts","../../../projects/ngx-form-lib/src/lib/features/radio/radio.model.ts","../../../projects/ngx-form-lib/src/lib/features/textarea/textarea.module.ts","../../../projects/ngx-form-lib/src/lib/features/textarea/textarea.model.ts","../../../projects/ngx-form-lib/src/lib/shared/models/appearance.model.ts","../../../projects/ngx-form-lib/src/lib/shared/models/color.model.ts","../../../projects/ngx-form-lib/src/lib/shared/models/parent-config.model.ts","../../../projects/ngx-form-lib/src/public-api.ts","../../../projects/ngx-form-lib/src/ngx-form-lib.ts"],"sourcesContent":["export function AutoUnsubscribe() {\r\n return function (constructor: any) {\r\n const ngDestroy = constructor.prototype.ngOnDestroy;\r\n constructor.prototype.ngOnDestroy = function () {\r\n for (const prop in this) {\r\n const property = this[prop];\r\n if (typeof property.subscribe === 'function') {\r\n property.unsubscribe();\r\n }\r\n }\r\n ngDestroy.apply();\r\n };\r\n };\r\n}\r\n","export enum ValidationTypeEnum {\r\n Email = 'email',\r\n Required = 'required',\r\n Min = 'min',\r\n Max = 'max',\r\n MinLength = 'minlength',\r\n MaxLength = 'maxlength',\r\n}\r\n\r\nexport type ValidationType =\r\n | 'email'\r\n | 'required'\r\n | 'min'\r\n | 'max'\r\n | 'minlength'\r\n | 'maxlength';\r\n","import { Injectable } from '@angular/core';\r\nimport { UntypedFormArray, UntypedFormControl, UntypedFormGroup, ValidatorFn, Validators } from '@angular/forms';\r\n\r\nimport { Validation } from '../../shared/models/validation.model';\r\nimport { ValidationTypeEnum } from '../../shared/models/validation-type.model';\r\nimport { Section } from '../../shared/models/section.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class FormsService {\r\n initForm(sections: Section[]): UntypedFormGroup {\r\n const list: UntypedFormGroup[] = [];\r\n sections.forEach((sectionItem) => {\r\n const group: { [key: string]: UntypedFormControl } = {};\r\n sectionItem.fields.forEach((config) => {\r\n group[config.name] = new UntypedFormControl(\r\n { value: config.value, disabled: config.facets?.disabled },\r\n config.validators ? this.createValidations(config.validators) : null\r\n );\r\n });\r\n list.push(new UntypedFormGroup(group))\r\n })\r\n\r\n return new UntypedFormGroup({sections: new UntypedFormArray(list)});\r\n }\r\n\r\n createValidations(validators: Validation[]): ValidatorFn[] | null {\r\n if (!validators) {\r\n return null;\r\n }\r\n const validatorsList: ValidatorFn[] = [];\r\n\r\n for (const validationItem of validators) {\r\n switch (validationItem.type) {\r\n case ValidationTypeEnum.Min: {\r\n validatorsList.push(Validators.min(validationItem.value));\r\n break;\r\n }\r\n case ValidationTypeEnum.Max: {\r\n validatorsList.push(Validators.max(validationItem.value));\r\n break;\r\n }\r\n case ValidationTypeEnum.MinLength: {\r\n validatorsList.push(Validators.minLength(validationItem.value));\r\n break;\r\n }\r\n case ValidationTypeEnum.MaxLength: {\r\n validatorsList.push(Validators.maxLength(validationItem.value));\r\n break;\r\n }\r\n case ValidationTypeEnum.Required: {\r\n validatorsList.push(Validators.required);\r\n break;\r\n }\r\n case ValidationTypeEnum.Email: {\r\n validatorsList.push(Validators.email);\r\n break;\r\n }\r\n default: {\r\n return null;\r\n }\r\n }\r\n }\r\n return validatorsList;\r\n }\r\n}","import { Injectable } from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\nimport { BehaviorSubject, Observable } from 'rxjs';\r\n\r\nimport { Dependency } from '../../shared/models/dependency.model';\r\nimport { Field } from '../../shared/models/field.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DependenciesService {\r\n _hiddenFields: BehaviorSubject<{ [key: string]: unknown }> =\r\n new BehaviorSubject<{ [key: string]: unknown }>({});\r\n\r\n setDependenciesFields(\r\n group: UntypedFormGroup,\r\n config: Field<unknown>,\r\n formValue: any\r\n ) {\r\n this.setFieldPropertiesToDefault(group, config);\r\n config.facets.dependencies?.forEach((dependency) => {\r\n if (dependency.value === formValue[dependency.fieldPath]) {\r\n switch (dependency.type) {\r\n case 'value-change':\r\n this.setDependentValue(group, dependency, config.name);\r\n break;\r\n case 'disabled':\r\n this.disableDependentField(group, dependency, config.name);\r\n break;\r\n case 'hidden':\r\n this.hideDependentField(config.name, dependency);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getHiddenFields(): Observable<{[key: string]: unknown}> {\r\n return this._hiddenFields.asObservable();\r\n }\r\n\r\n setFieldPropertiesToDefault(group: UntypedFormGroup, config: Field<unknown>) {\r\n if (config.facets.disabled === true) {\r\n group.get(config.name)?.disable({ emitEvent: false });\r\n } else if (config.facets.disabled === false) {\r\n group.get(config.name)?.enable({ emitEvent: false });\r\n }\r\n if (config.facets.hidden === true || config.facets.hidden === false) {\r\n this.hideDependentField(config.name, {} as Dependency, config.facets.hidden);\r\n }\r\n }\r\n\r\n disableDependentField(\r\n group: UntypedFormGroup,\r\n dependency: Dependency,\r\n controlName: string\r\n ): void {\r\n if (\r\n dependency.setDependentValueTo === true ||\r\n dependency.setDependentValueTo === 'true'\r\n ) {\r\n group.get(controlName)?.disable({ emitEvent: false });\r\n } else if (\r\n dependency.setDependentValueTo === false ||\r\n dependency.setDependentValueTo === 'false'\r\n ) {\r\n group.get(controlName)?.enable({ emitEvent: false });\r\n }\r\n }\r\n\r\n setDependentValue(\r\n group: UntypedFormGroup,\r\n dependency: Dependency,\r\n controlName: string\r\n ): void {\r\n group\r\n .get(controlName)\r\n ?.setValue(dependency.setDependentValueTo, { emitEvent: false });\r\n }\r\n\r\n hideDependentField(\r\n controlName: string,\r\n dependency: Dependency,\r\n hiddenProperty: boolean = false\r\n ): void {\r\n const hiddenFields = this._hiddenFields.getValue();\r\n hiddenFields[controlName] = dependency.setDependentValueTo || hiddenProperty;\r\n this._hiddenFields.next(hiddenFields);\r\n }\r\n}\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\n\r\nimport { Field } from '../../../shared/models/field.model';\r\nimport { ParentConfig } from '../../../shared/models/parent-config.model';\r\nimport { DependenciesService } from '../../services/dependencies.service';\r\nimport { AutoUnsubscribe } from '../../../shared/decorators/auto-unsubscribe.decorator';\r\nimport { Dependency } from '../../../shared/models/dependency.model';\r\n\r\n@Component({\r\n template: '',\r\n})\r\n@AutoUnsubscribe()\r\nexport class BaseComponent<T = unknown> implements OnInit {\r\n @Input() config: Field<T> | null = null;\r\n @Input() group: UntypedFormGroup | null = null;\r\n @Input() parentConfig: ParentConfig | null = null;\r\n\r\n subscription: Subscription = new Subscription();\r\n\r\n constructor(private readonly dependenciesService: DependenciesService) {}\r\n\r\n ngOnInit(): void {\r\n this.setupDependenciesControls();\r\n }\r\n\r\n setupDependenciesControls(): void {\r\n if (this.config?.facets.hidden) {\r\n this.dependenciesService.hideDependentField(\r\n this.config.name,\r\n {} as Dependency,\r\n this.config.facets.hidden\r\n );\r\n }\r\n if (this.config?.facets.dependencies) {\r\n this.group?.valueChanges.subscribe((formValue) => {\r\n this.config &&\r\n this.group &&\r\n this.dependenciesService.setDependenciesFields(\r\n this.group,\r\n this.config,\r\n formValue\r\n );\r\n });\r\n }\r\n }\r\n}\r\n","export enum ButtonAttributeEnum {\r\n MatButton = 'mat-button',\r\n MatRaisedButton = 'mat-raised-button',\r\n MatFlatButton = 'mat-flat-button',\r\n MatIconButton = 'mat-icon-button',\r\n MatStrokedButton = 'mat-stroked-button',\r\n MatFab = 'mat-fab',\r\n MatMiniFab = 'mat-mini-fab',\r\n // Material 3 variants\r\n MatFilledButton = 'mat-fill',\r\n MatOutlinedButton = 'mat-outline',\r\n MatTextButton = 'mat-text',\r\n MatElevatedButton = 'mat-elevated',\r\n MatTonalButton = 'mat-tonal',\r\n}\r\n\r\nexport type ButtonAttribute =\r\n | 'mat-button'\r\n | 'mat-raised-button'\r\n | 'mat-flat-button'\r\n | 'mat-icon-button'\r\n | 'mat-stroked-button'\r\n | 'mat-fab'\r\n | 'mat-mini-fab'\r\n // Material 3 variants\r\n | 'mat-fill'\r\n | 'mat-outline'\r\n | 'mat-text'\r\n | 'mat-elevated'\r\n | 'mat-tonal';\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\nimport { Field } from '../../models/field.model';\r\nimport { ParentConfig } from '../../models/parent-config.model';\r\n\r\n@Pipe({\r\n name: 'setParentConfig',\r\n})\r\nexport class SetParentConfigPipe implements PipeTransform {\r\n transform(\r\n parent: ParentConfig | null,\r\n child: Field<unknown>,\r\n field: keyof ParentConfig\r\n ): any {\r\n if (!parent) {\r\n return '';\r\n }\r\n return child[field as keyof ParentConfig]\r\n ? child[field as keyof ParentConfig]\r\n : parent[field as keyof ParentConfig];\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { BaseComponent } from '../../core/components/base/base.component';\r\nimport { ButtonAttributeEnum } from './button-attribute.model';\r\nimport { Button } from './button.model';\r\n\r\n@Component({\r\n selector: 'ngf-button',\r\n templateUrl: './button.component.html',\r\n styleUrls: ['./button.component.scss'],\r\n})\r\nexport class ButtonComponent extends BaseComponent<string> {\r\n override config: Button | null = null;\r\n ButtonAttribute = ButtonAttributeEnum;\r\n}\r\n","@if (config) {\r\n<div class=\"ngf-wrapper ngf-button-wrapper\">\r\n <button\r\n mat-button\r\n [ngClass]=\"{\r\n 'mat-button': config.attribute === ButtonAttribute.MatButton,\r\n 'mat-flat-button': config.attribute === ButtonAttribute.MatFlatButton,\r\n 'mat-raised-button': config.attribute === ButtonAttribute.MatRaisedButton,\r\n 'mat-stroked-button':\r\n config.attribute === ButtonAttribute.MatStrokedButton,\r\n 'mat-icon-button': config.attribute === ButtonAttribute.MatIconButton,\r\n 'mat-fab': config.attribute === ButtonAttribute.MatFab,\r\n 'mat-mini-fab': config.attribute === ButtonAttribute.MatMiniFab,\r\n 'mat-fill': config.attribute === ButtonAttribute.MatFilledButton,\r\n 'mat-outline': config.attribute === ButtonAttribute.MatOutlinedButton,\r\n 'mat-text': config.attribute === ButtonAttribute.MatTextButton,\r\n 'mat-elevated': config.attribute === ButtonAttribute.MatElevatedButton,\r\n 'mat-tonal': config.attribute === ButtonAttribute.MatTonalButton\r\n }\"\r\n [type]=\"config.subType\"\r\n [color]=\"parentConfig | setParentConfig : config : 'color'\"\r\n >\r\n @if (config.attribute === ButtonAttribute.MatIconButton || config.attribute\r\n === ButtonAttribute.MatFab || config.attribute ===\r\n ButtonAttribute.MatMiniFab) {\r\n <mat-icon>\r\n {{ config.label }}\r\n </mat-icon>\r\n } @else {\r\n {{ config.label }}\r\n }\r\n </button>\r\n</div>\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { BaseComponent } from '../../core/components/base/base.component';\r\nimport { Checkbox } from './checkbox.model';\r\n\r\n@Component({\r\n selector: 'ngf-checkbox',\r\n templateUrl: './checkbox.component.html',\r\n})\r\nexport class CheckboxComponent extends BaseComponent<string> {\r\n override config: Checkbox | null = null;\r\n}\r\n","@if (group && config) {\r\n<div [formGroup]=\"group\" class=\"ngf-wrapper ngf-checkbox-wrapper\">\r\n <mat-checkbox\r\n class=\"ngf-checkbox\"\r\n [formControlName]=\"config.name\"\r\n [indeterminate]=\"config.indeterminate\"\r\n [labelPosition]=\"config.labelPosition\"\r\n [color]=\"parentConfig | setParentConfig : config : 'color'\"\r\n >\r\n @if (config.label) {\r\n <mat-label [attr.for]=\"config.name\">{{ config.label }}</mat-label>\r\n }\r\n </mat-checkbox>\r\n</div>\r\n}\r\n","export enum PrefixSuffixEnum {\r\n String = 'string',\r\n Icon = 'icon',\r\n}\r\n\r\nexport interface PrefixSuffix {\r\n type: 'string' | 'icon';\r\n value: string;\r\n method?: (param?: any) => any;\r\n}\r\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\r\n\r\nimport { PrefixSuffix, PrefixSuffixEnum } from '../../models/prefix-suffix.model';\r\n\r\n@Component({\r\n selector: 'ngf-prefix-suffix',\r\n templateUrl: './prefix-suffix.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class PrefixSuffixComponent {\r\n @Input() config: PrefixSuffix = {} as PrefixSuffix;\r\n\r\n readonly PrefixSuffixEnum = PrefixSuffixEnum;\r\n}\r\n","@if (config.type === PrefixSuffixEnum.Icon) {\r\n<mat-icon>{{ config.value }}</mat-icon>\r\n} @else {\r\n<span>{{ config.value }}</span>\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\nimport { BaseComponent } from '../../core/components/base/base.component';\r\nimport { Dropdown } from './dropdown.model';\r\n\r\n@Component({\r\n selector: 'lib-dropdown',\r\n templateUrl: './dropdown.component.html',\r\n})\r\nexport class DropdownComponent extends BaseComponent<string> implements OnInit {\r\n override config: Dropdown | null = null;\r\n\r\n /**\r\n * Splitting ',' separated value to an array of values and setting to multiple control\r\n * @property {string} value Multiple comma seperated values\r\n */\r\n override ngOnInit(): void {\r\n super.ngOnInit();\r\n if (this.config?.multiple) {\r\n this.group\r\n ?.get(this.config.name)\r\n ?.setValue(this.config.value?.split(','));\r\n }\r\n }\r\n}\r\n","@if (group && config) {\r\n<div [formGroup]=\"group\" class=\"ngf-wrapper ngf-dropdown-wrapper\">\r\n <mat-form-field\r\n class=\"ngf-form-field\"\r\n [appearance]=\"parentConfig | setParentConfig : config : 'appearance'\"\r\n [color]=\"parentConfig | setParentConfig : config : 'color'\"\r\n >\r\n @if (config.label) {\r\n <mat-label [attr.for]=\"config.name\">{{ config.label }}</mat-label>\r\n } @if (!config.multiple) {\r\n <mat-select [formControlName]=\"config.name\">\r\n @for (option of config.options; track option.value) {\r\n <mat-option [value]=\"option.value\">{{ option.label }}</mat-option>\r\n }\r\n </mat-select>\r\n } @else {\r\n <mat-select [formControlName]=\"config.name\" multiple>\r\n <!-- <mat-select-trigger>\r\n TODO: Added select trigger for multiple and custom value\r\n </mat-select-trigger> -->\r\n @for (option of config.options; track option.value) {\r\n <mat-option [value]=\"option.value\">{{ option.label }}</mat-option>\r\n }\r\n </mat-select>\r\n } @if (config.prefix) {\r\n <span matPrefix>\r\n <ngf-prefix-suffix [config]=\"config.prefix\"></ngf-prefix-suffix>\r\n </span>\r\n } @if (config.suffix) {\r\n <span matSuffix>\r\n <ngf-prefix-suffix [config]=\"config.suffix\"></ngf-prefix-suffix>\r\n </span>\r\n } @if (config.hint) {\r\n <mat-hint>{{ config.hint }}</mat-hint>\r\n } @for (validationItem of config.validators; track validationItem.type) {\r\n <mat-error>\r\n @if (group.controls[config.name].hasError(validationItem.type) &&\r\n (group.controls[config.name].dirty ||\r\n group.controls[config.name].touched)) {\r\n {{ validationItem.message }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { BaseComponent } from '../../core/components/base/base.component';\r\nimport { Input } from './input.model';\r\n\r\n@Component({\r\n selector: 'ngf-input',\r\n templateUrl: './input.component.html',\r\n})\r\nexport class InputComponent extends BaseComponent<string> {\r\n override config: Input | null = null;\r\n}\r\n","@if (group && config) {\r\n<div [formGroup]=\"group\" class=\"ngf-wrapper ngf-input-wrapper\">\r\n <mat-form-field\r\n class=\"ngf-form-field\"\r\n [color]=\"parentConfig | setParentConfig : config : 'color'\"\r\n [appearance]=\"parentConfig | setParentConfig : config : 'appearance'\"\r\n >\r\n @if (config.label) {\r\n <mat-label [attr.for]=\"config.name\">{{ config.label }}</mat-label>\r\n }\r\n <input\r\n matInput\r\n [formControlName]=\"config.name\"\r\n [id]=\"config.name\"\r\n [type]=\"config.subType\"\r\n />\r\n @if (config.prefix) {\r\n <span matPrefix>\r\n <ngf-prefix-suffix [config]=\"config.prefix\"></ngf-prefix-suffix>\r\n </span>\r\n } @if (config.suffix) {\r\n <span matSuffix>\r\n <ngf-prefix-suffix [config]=\"config.suffix\"></ngf-prefix-suffix>\r\n </span>\r\n } @if (config.hint) {\r\n <mat-hint>{{ config.hint }}</mat-hint>\r\n } @for (validationItem of config.validators; track validationItem.type) {\r\n <mat-error class=\"ngf-field-error\">\r\n @if (group.controls[config.name].hasError(validationItem.type) &&\r\n (group.controls[config.name].dirty ||\r\n group.controls[config.name].touched)) {\r\n <span>{{ validationItem.message }}</span>\r\n @if (validationItem.showDynamicError &&\r\n this.group.controls[config.name].getError(validationItem.type)?.actualLength;\r\n as actualLength) {\r\n <span>\r\n {{ actualLength }}/\r\n {{\r\n this.group.controls[config.name].getError(validationItem.type)\r\n ?.requiredLength\r\n }}\r\n </span>\r\n } }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { BaseComponent } from '../../core/components/base/base.component';\r\nimport { Radio } from './radio.model';\r\n\r\n@Component({\r\n selector: 'ngf-radio',\r\n templateUrl: './radio.component.html',\r\n styleUrls: ['./radio.component.scss'],\r\n})\r\nexport class RadioComponent extends BaseComponent<string> {\r\n override config: Radio | null = null;\r\n}\r\n","@if (group && config) {\r\n<div [formGroup]=\"group\" class=\"ngf-wrapper ngf-radio-wrapper\">\r\n @if (config.label) {\r\n <label [attr.for]=\"config.name\">{{ config.label }}</label>\r\n }\r\n <mat-radio-group\r\n class=\"ngf-radio-group\"\r\n [ngClass]=\"{ 'ngf-inline': config.showInline }\"\r\n [formControlName]=\"config.name\"\r\n [color]=\"parentConfig | setParentConfig : config : 'color'\"\r\n >\r\n @for (option of config.options; track option.value) {\r\n <mat-radio-button class=\"ngf-radio-button\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-radio-button>\r\n }\r\n </mat-radio-group>\r\n</div>\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { BaseComponent } from '../../core/components/base/base.component';\r\nimport { Textarea } from './textarea.model';\r\n\r\n@Component({\r\n selector: 'ngf-textarea',\r\n templateUrl: './textarea.component.html',\r\n})\r\nexport class TextareaComponent extends BaseComponent<string> {\r\n override config: Textarea | null = null;\r\n}\r\n","@if (config && group) {\r\n<div [formGroup]=\"group\" class=\"ngf-wrapper ngf-textarea-wrapper\">\r\n <mat-form-field\r\n class=\"ngf-form-field\"\r\n [appearance]=\"parentConfig | setParentConfig : config : 'appearance'\"\r\n [color]=\"parentConfig | setParentConfig : config : 'color'\"\r\n >\r\n <mat-label [attr.for]=\"config.name\">{{ config.label }}</mat-label>\r\n <textarea\r\n matInput\r\n class=\"form-control\"\r\n [formControlName]=\"config.name\"\r\n [id]=\"config.name\"\r\n [placeholder]=\"config.placeholder\"\r\n [rows]=\"config.rows\"\r\n ></textarea>\r\n @if (config.hint) {\r\n <mat-hint>{{ config.hint }}</mat-hint>\r\n } @if (config.prefix) {\r\n <span matPrefix>\r\n <ngf-prefix-suffix [config]=\"config.prefix\"></ngf-prefix-suffix>\r\n </span>\r\n } @if (config.suffix) {\r\n <span matSuffix>\r\n <ngf-prefix-suffix [config]=\"config.suffix\"></ngf-prefix-suffix>\r\n </span>\r\n }\r\n <!-- TODO: Try moving mat-error to a component and implement dynamic error message -->\r\n @for (validationItem of config.validators; track validationItem.type) {\r\n <mat-error class=\"ngf-field-error\">\r\n @if (group.controls[config.name].hasError(validationItem.type) &&\r\n (group.controls[config.name].dirty ||\r\n group.controls[config.name].touched)) {\r\n <span>{{ validationItem.message }}</span>\r\n @if (validationItem.showDynamicError &&\r\n this.group.controls[config.name].getError(validationItem.type)?.actualLength;\r\n as actualLength) {\r\n <span>\r\n {{ actualLength }}/\r\n {{\r\n this.group.controls[config.name].getError(validationItem.type)\r\n ?.requiredLength\r\n }}\r\n </span>\r\n } }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n OnInit,\r\n Type,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\n\r\nimport { ButtonComponent } from '../../features/button/button.component';\r\nimport { CheckboxComponent } from '../../features/checkbox/checkbox.component';\r\nimport { DropdownComponent } from '../../features/dropdown/dropdown.component';\r\nimport { InputComponent } from '../../features/input/input.component';\r\nimport { RadioComponent } from '../../features/radio/radio.component';\r\nimport { TextareaComponent } from '../../features/textarea/textarea.component';\r\nimport { FieldTypeEnum } from '../../shared/enums/field-type.enum';\r\nimport { ParentConfig } from '../../shared/models/parent-config.model';\r\nimport { BaseComponent } from '../components/base/base.component';\r\nimport { Field } from '../../shared/models/field.model';\r\n\r\nconst componentMapping: {\r\n [key in FieldTypeEnum]: Type<BaseComponent<unknown>>;\r\n} = {\r\n button: ButtonComponent,\r\n checkbox: CheckboxComponent,\r\n dropdown: DropdownComponent,\r\n input: InputComponent,\r\n radio: RadioComponent,\r\n textarea: TextareaComponent,\r\n};\r\n\r\n@Component({\r\n selector: 'ngf-container',\r\n template: `<ng-template #dynamicComponent></ng-template>`,\r\n})\r\nexport class ContainerComponent implements OnInit {\r\n @Input() config: Field<unknown> = {} as Field<unknown>;\r\n @Input() group: UntypedFormGroup | null = null;\r\n @Input() parentConfig: ParentConfig | null = null;\r\n @ViewChild('dynamicComponent', { static: true, read: ViewContainerRef })\r\n dynamicComponent!: ViewContainerRef;\r\n\r\n ngOnInit(): void {\r\n this.loadDynamicFields();\r\n }\r\n\r\n private loadDynamicFields(): void {\r\n if (this.dynamicComponent && this.config?.type) {\r\n const componentRef = this.dynamicComponent.createComponent(\r\n componentMapping[this.config.type]\r\n );\r\n\r\n componentRef.instance.config = this.config;\r\n componentRef.instance.group = this.group;\r\n componentRef.instance.parentConfig = this.parentConfig;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\nimport { Field } from '../../models/field.model';\r\n\r\n@Pipe({\r\n name: 'sortByOrder',\r\n})\r\nexport class SortByOrderPipe implements PipeTransform {\r\n transform(fields: Field<unknown>[], ...args: unknown[]): Field<unknown>[] {\r\n return fields.sort((a, b) => a.order - b.order);\r\n }\r\n}\r\n","import {\r\n ChangeDetectorRef,\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n ViewEncapsulation,\r\n} from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\nimport { Observable, Subject, takeUntil } from 'rxjs';\r\n\r\nimport { Config } from '../../../shared/models/config.model';\r\nimport { FormsService } from '../../services/forms.service';\r\nimport { DependenciesService } from '../../../core/services/dependencies.service';\r\nimport { AutoUnsubscribe } from '../../../shared/decorators/auto-unsubscribe.decorator';\r\n\r\n@Component({\r\n selector: 'ngx-form-lib',\r\n templateUrl: './form.component.html',\r\n styleUrls: ['./form.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\n@AutoUnsubscribe()\r\nexport class FormComponent implements OnInit {\r\n private _config: Config = {} as Config;\r\n\r\n @Input() set config(configObj: Config | object) {\r\n this._config = configObj as Config;\r\n }\r\n\r\n get config(): Config {\r\n return this._config;\r\n }\r\n\r\n @Output() valueChanges = new EventEmitter<any>();\r\n @Output() formSubmit = new EventEmitter<void>();\r\n\r\n form: UntypedFormGroup = {} as UntypedFormGroup;\r\n hiddenFields$: Observable<any> = this.dependenciesService.getHiddenFields();\r\n private readonly destroy$ = new Subject<void>();\r\n\r\n constructor(\r\n private readonly formService: FormsService,\r\n private readonly dependenciesService: DependenciesService,\r\n private readonly cdr: ChangeDetectorRef\r\n ) {\r\n this.hiddenFields$ = this.dependenciesService.getHiddenFields();\r\n }\r\n\r\n ngAfterContentChecked() {\r\n this.cdr.detectChanges();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.form.valueChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\r\n this.valueChanges.emit(this.form.value);\r\n });\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['config'].currentValue) {\r\n this.form = this.formService.initForm(\r\n changes['config'].currentValue.sections\r\n );\r\n }\r\n }\r\n\r\n getFormControl(formGroupName: string, index: number): UntypedFormGroup {\r\n return this.form.get(`${formGroupName}.${index}`) as UntypedFormGroup;\r\n }\r\n\r\n onSubmit(): void {\r\n this.formSubmit.emit();\r\n }\r\n}\r\n","<div class=\"ngf-form-container\">\r\n <h3 class=\"ngf-h3 ngf-form-header\">{{ config.header }}</h3>\r\n @if (form) {\r\n <form class=\"ngf-form\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <ng-container formArrayName=\"sections\">\r\n @for (sectionItem of config.sections; track sectionItem; let i = $index) {\r\n <section class=\"ngf-section-wrapper\" [formGroupName]=\"i\">\r\n @if (sectionItem.sectionHeader) {\r\n <h4 class=\"ngf-h4\">{{ sectionItem.sectionHeader }}</h4>\r\n }\r\n <div class=\"ngf-section\">\r\n @for (configItem of sectionItem.fields | sortByOrder; track\r\n configItem.name) {\r\n <div\r\n [hidden]=\"(hiddenFields$ | async)[configItem.name] || false\"\r\n class=\"ngf-field-container\"\r\n [ngClass]=\"configItem.classes\"\r\n >\r\n <ngf-container\r\n [parentConfig]=\"config.parentConfig\"\r\n [config]=\"configItem\"\r\n [group]=\"getFormControl('sections', i)\"\r\n >\r\n </ngf-container>\r\n </div>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </ng-container>\r\n </form>\r\n }\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ContainerComponent } from './container.component';\r\n\r\n@NgModule({\r\n declarations: [ContainerComponent],\r\n imports: [CommonModule],\r\n exports: [ContainerComponent],\r\n})\r\nexport class ContainerModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { SortByOrderPipe } from './sort-by-order.pipe';\r\n\r\n@NgModule({\r\n declarations: [SortByOrderPipe],\r\n imports: [CommonModule],\r\n exports: [SortByOrderPipe],\r\n})\r\nexport class SortByOrderModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatSelectModule } from '@angular/material/select';\r\n\r\nimport { FormComponent } from './form.component';\r\nimport { ContainerModule } from '../../containers/container.module';\r\nimport { SortByOrderModule } from '../../../shared/pipes/sort-by-order/sort-by-order.module';\r\n\r\n@NgModule({\r\n declarations: [FormComponent],\r\n imports: [\r\n CommonModule,\r\n ContainerModule,\r\n ReactiveFormsModule,\r\n SortByOrderModule,\r\n MatSelectModule,\r\n ],\r\n exports: [FormComponent],\r\n})\r\nexport class FormLibModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\nimport { PrefixSuffixComponent } from './prefix-suffix.component';\r\n\r\n@NgModule({\r\n declarations: [PrefixSuffixComponent],\r\n imports: [CommonModule, MatIconModule],\r\n exports: [PrefixSuffixComponent],\r\n})\r\nexport class PrefixSuffixModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { SetParentConfigPipe } from './set-parent-config.pipe';\r\n\r\n@NgModule({\r\n declarations: [SetParentConfigPipe],\r\n imports: [CommonModule],\r\n exports: [SetParentConfigPipe]\r\n})\r\nexport class SetParentConfigModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\n\r\nimport { BaseComponent } from './base.component';\r\nimport { PrefixSuffixModule } from '../../../shared/components/prefix-suffix/prefix-suffix.module';\r\nimport { SetParentConfigModule } from '../../../shared/pipes/set-parent-config/set-parent-config.module';\r\n\r\nconst MODULES = [\r\n MatFormFieldModule,\r\n PrefixSuffixModule,\r\n ReactiveFormsModule,\r\n SetParentConfigModule,\r\n];\r\n\r\n@NgModule({\r\n declarations: [BaseComponent],\r\n imports: [CommonModule, ...MODULES],\r\n exports: [BaseComponent, ...MODULES],\r\n})\r\nexport class BaseModule {}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\nimport { BaseModule } from '../../core/components/base/base.module';\r\nimport { ButtonComponent } from './button.component';\r\n\r\n@NgModule({\r\n declarations: [ButtonComponent],\r\n imports: [BaseModule, CommonModule, MatButtonModule, MatIconModule],\r\n exports: [ButtonComponent],\r\n})\r\nexport class ButtonModule {}\r\n","export enum FieldTypeEnum {\r\n Button = 'button',\r\n Checkbox = 'checkbox',\r\n Dropdown = 'dropdown',\r\n Input = 'input',\r\n Radio = 'radio',\r\n Textarea = 'textarea',\r\n}","import { FieldTypeEnum } from \"../enums/field-type.enum\";\r\nimport { Appearance } from \"./appearance.model\";\r\nimport { Color } from \"./color.model\";\r\nimport { Facets } from \"./facets.model\";\r\nimport { Validation } from \"./validation.model\";\r\n\r\nexport class Field<T> {\r\n appearance?: Appearance;\r\n classes: string[];\r\n color?: Color;\r\n facets: Facets;\r\n hint: string;\r\n label: string;\r\n method: (param?: any) => any;\r\n name: string;\r\n order: number;\r\n placeholder: string;\r\n type: FieldTypeEnum;\r\n value?: T;\r\n validators: Validation[];\r\n\r\n constructor(\r\n params: {\r\n appearance?: Appearance;\r\n classes?: string[];\r\n color?: Color;\r\n facets?: Facets;\r\n hint?: string;\r\n label?: string;\r\n method?: (param?: any) => any;\r\n name: string;\r\n order?: number;\r\n placeholder?: string;\r\n type?: FieldTypeEnum;\r\n value?: T;\r\n validators?: Validation[];\r\n } = { name: '' }\r\n ) {\r\n this.appearance = params.appearance;\r\n this.classes = params.classes ?? [];\r\n this.color = params.color;\r\n this.facets = params.facets ?? { disabled: false, hidden: false };\r\n this.hint = params.hint ?? '';\r\n this.label = params.label ?? '';\r\n this.method = params.method ?? function(){};\r\n this.name = params.name ?? '';\r\n this.order = params.order ?? 1;\r\n this.placeholder = params.placeholder ?? '';\r\n this.type = params.type ?? FieldTypeEnum.Input;\r\n this.value = params.value;\r\n this.validators = params.validators ?? [];\r\n }\r\n}\r\n","import { FieldTypeEnum } from '../../shared/enums/field-type.enum';\r\nimport { Field } from '../../shared/models/field.model';\r\nimport { FieldSubType } from '../input/field-sub-type.model';\r\nimport { ButtonAttribute } from './button-attribute.model';\r\n\r\nexport class Button extends Field<string> {\r\n override type = FieldTypeEnum.Button;\r\n subType: FieldSubType;\r\n attribute: ButtonAttribute;\r\n\r\n constructor(params: {\r\n field?: Field<string>;\r\n subType?: FieldSubType;\r\n attribute: ButtonAttribute;\r\n }) {\r\n super(params.field);\r\n this.subType = params.subType ?? 'button';\r\n this.attribute = params.attribute ?? 'mat-button';\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\n\r\nimport { BaseModule } from '../../core/components/base/base.module';\r\nimport { CheckboxComponent } from './checkbox.component';\r\n\r\n@NgModule({\r\n declarations: [CheckboxComponent],\r\n imports: [BaseModule, CommonModule, MatCheckboxModule],\r\n exports: [CheckboxComponent],\r\n})\r\nexport class CheckboxModule {}\r\n","import { CheckboxLabelPosition } from \"./checkbox-label-position.model\";\r\nimport { Field } from \"../../shared/models/field.model\";\r\nimport { FieldTypeEnum } from \"../../shared/enums/field-type.enum\";\r\n\r\nexport class Checkbox extends Field<string> {\r\n override type = FieldTypeEnum.Checkbox;\r\n labelPosition: CheckboxLabelPosition;\r\n showInline: boolean;\r\n indeterminate: boolean;\r\n\r\n constructor(params: {\r\n field?: Field<string>;\r\n indeterminate?: boolean;\r\n labelPosition?: CheckboxLabelPosition;\r\n showInline?: boolean;\r\n }) {\r\n super(params.field);\r\n this.indeterminate = params.indeterminate ?? false;\r\n this.labelPosition = params.labelPosition ?? 'after';\r\n this.showInline = params.showInline ?? false;\r\n }\r\n}","export enum CheckboxLabelPositionEnum {\r\n Before = 'before',\r\n After = 'after',\r\n}\r\n\r\nexport type CheckboxLabelPosition = 'before' | 'after';","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\n\r\nimport { BaseModule } from '../../core/components/base/base.module';\r\nimport { DropdownComponent } from './dropdown.component';\r\n\r\n@NgModule({\r\n declarations: [DropdownComponent],\r\n imports: [BaseModule, CommonModule, MatSelectModule, MatAutocompleteModule],\r\n exports: [DropdownComponent],\r\n})\r\nexport class DropdownModule {}\r\n","import { FieldTypeEnum } from '../../shared/enums/field-type.enum';\r\nimport { Field } from '../../shared/models/field.model';\r\nimport { Option } from '../../shared/models/option.model';\r\nimport { PrefixSuffix } from '../../shared/models/prefix-suffix.model';\r\n\r\nexport class Dropdown extends Field<string> {\r\n override type = FieldTypeEnum.Dropdown;\r\n options: Option[];\r\n prefix?: PrefixSuffix;\r\n suffix?: PrefixSuffix;\r\n multiple: boolean;\r\n constructor(params: {\r\n field?: Field<string>;\r\n options?: Option[];\r\n prefix?: PrefixSuffix;\r\n suffix?: PrefixSuffix;\r\n multiple?: boolean;\r\n }) {\r\n super(params.field);\r\n this.options = params.options ?? [];\r\n this.prefix = params.prefix;\r\n this.suffix = params.suffix;\r\n this.multiple = params.multiple ?? false;\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { MatInputModule } from '@angular/material/input';\r\n\r\nimport { BaseModule } from '../../core/components/base/base.module';\r\nimport { InputComponent } from './input.component';\r\n\r\n@NgModule({\r\n declarations: [InputComponent],\r\n imports: [BaseModule, CommonModule, MatInputModule],\r\n exports: [InputComponent],\r\n})\r\nexport class InputModule {}\r\n","export enum FieldSubTypeEnum {\r\n Button = 'button',\r\n Email = 'email',\r\n Number = 'number',\r\n Password = 'password',\r\n Reset = 'reset',\r\n Submit = 'submit',\r\n Text = 'text',\r\n}\r\n\r\nexport type FieldSubType =\r\n | 'button'\r\n | 'email'\r\n | 'number'\r\n | 'password'\r\n | 'reset'\r\n | 'submit'\r\n | 'text';\r\n","import { FieldSubType } from './field-sub-type.model';\r\nimport { PrefixSuffix } from '../../shared/models/prefix-suffix.model';\r\nimport { FieldTypeEnum } from '../../shared/enums/field-type.enum';\r\nimport { Field } from '../../shared/models/field.model';\r\n\r\nexport class Input extends Field<string> {\r\n override type = FieldTypeEnum.Input;\r\n prefix?: PrefixSuffix;\r\n subType: FieldSubType;\r\n suffix?: PrefixSuffix;\r\n\r\n constructor(params: {\r\n field?: Field<string>;\r\n prefix?: PrefixSuffix;\r\n subType?: FieldSubType;\r\n suffix?: PrefixSuffix;\r\n }) {\r\n super(params.field);\r\n this.subType = params.subType ?? 'text';\r\n this.prefix = params.prefix;\r\n this.suffix = params.suffix;\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { MatRadioModule } from '@angular/material/radio';\r\n\r\nimport { BaseModule } from '../../core/components/base/base.module';\r\nimport { RadioComponent } from './radio.component';\r\n\r\n@NgModule({\r\n declarations: [RadioComponent],\r\n imports: [BaseModule, CommonModule, MatRadioModule],\r\n exports: [RadioComponent],\r\n})\r\nexport class RadioModule {}\r\n","import { FieldTypeEnum } from \"../../shared/enums/field-type.enum\";\r\nimport { Field } from \"../../shared/models/field.model\";\r\nimport { Option } from \"../../shared/models/option.model\";\r\n\r\nexport class Radio extends Field<string> {\r\n override type = FieldTypeEnum.Radio;\r\n showInline: boolean;\r\n options: Option[];\r\n\r\n constructor(params: {\r\n field?: Field<string>;\r\n options?: Option[];\r\n showInline?: boolean;\r\n }) {\r\n super(params.field);\r\n this.showInline = params.showInline ?? false;\r\n this.options = params.options ?? [];\r\n }\r\n}","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { MatInputModule } from '@angular/material/input';\r\n\r\nimport { BaseModule } from '../../core/components/base/base.module';\r\nimport { TextareaComponent } from './textarea.component';\r\n\r\n@NgModule({\r\n declarations: [TextareaComponent],\r\n imports: [BaseModule, CommonModule, MatInputModule],\r\n exports: [TextareaComponent],\r\n})\r\nexport class TextareaModule {}\r\n","import { FieldTypeEnum } from '../../shared/enums/field-type.enum';\r\nimport { Field } from '../../shared/models/field.model';\r\nimport { PrefixSuffix } from '../../shared/models/prefix-suffix.model';\r\n\r\nexport class Textarea extends Field<string> {\r\n override type = FieldTypeEnum.Textarea;\r\n prefix?: PrefixSuffix;\r\n suffix?: PrefixSuffix;\r\n rows: number;\r\n\r\n constructor(params: {\r\n field?: Field<string>;\r\n prefix?: PrefixSuffix;\r\n suffix?: PrefixSuffix;\r\n rows?: number;\r\n }) {\r\n super(params.field);\r\n this.prefix = params.prefix;\r\n this.suffix = params.suffix;\r\n this.rows = params.rows ?? 5;\r\n }\r\n}\r\n","export enum AppearanceEnum {\r\n Standard = 'standard',\r\n Fill = 'fill',\r\n Outline = 'outline',\r\n Lagancy = 'legacy'\r\n}\r\n\r\nexport type Appearance = 'standard' | 'fill' | 'outline' | 'legacy';","export enum ColorEnum {\r\n Accent = 'accent',\r\n Basic = '',\r\n Primary = 'primary',\r\n Warning = 'warn',\r\n}\r\n\r\nexport type Color = 'accent' | '' | 'primary' | 'warn';","import { Appearance } from \"./appearance.model\";\r\nimport { Color } from \"./color.model\";\r\n\r\nexport class ParentConfig {\r\n appearance: Appearance;\r\n color: Color;\r\n constructor(param: {\r\n appearance: Appearance,\r\n color: Color\r\n }) {\r\n this.appearance = param.appearance|| 'standard'\r\n this.color = param.color || 'primary'\r\n }\r\n}","/*\r\n * Public API Surface of ngx-form-lib\r\n */\r\nexport * from './lib/index'\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DependenciesService","Input","i1","i3","i4.SetParentConfigPipe","i2","i2.PrefixSuffixComponent","i6.SetParentConfigPipe","i4","i5.SetParentConfigPipe","i1.FormsService","i2.DependenciesService","i4.ContainerComponent","i5","i6.SortByOrderPipe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;SAAgB,eAAe,GAAA;AAC7B,IAAA,OAAO,UAAU,WAAgB,EAAA;AAC/B,QAAA,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC;AACpD,QAAA,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,YAAA;AAClC,YAAA,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;AACvB,gBAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,gBAAA,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,UAAU,EAAE;oBAC5C,QAAQ,CAAC,WAAW,EAAE,CAAC;iBACxB;aACF;YACD,SAAS,CAAC,KAAK,EAAE,CAAC;AACpB,SAAC,CAAC;AACJ,KAAC,CAAC;AACJ;;ICbY,mBAOX;AAPD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;A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