UNPKG

@igo2/common

Version:
1 lines 64.3 kB
{"version":3,"file":"igo2-common-form.mjs","sources":["../../../packages/common/form/src/shared/form.utils.ts","../../../packages/common/form/src/form/form.component.ts","../../../packages/common/form/src/form/form.component.html","../../../packages/common/form/src/form/form.module.ts","../../../packages/common/form/src/shared/form-field.service.ts","../../../packages/common/form/src/shared/form-field-component.ts","../../../packages/common/form/src/form-field/form-field-select.component.ts","../../../packages/common/form/src/form-field/form-field-select.component.html","../../../packages/common/form/src/form-field/form-field-text.component.ts","../../../packages/common/form/src/form-field/form-field-text.component.html","../../../packages/common/form/src/form-field/form-field-textarea.component.ts","../../../packages/common/form/src/form-field/form-field-textarea.component.html","../../../packages/common/form/src/shared/form.service.ts","../../../packages/common/form/src/form-field/form-field.component.ts","../../../packages/common/form/src/form-field/form-field.component.html","../../../packages/common/form/src/form-field/form-field.directive.ts","../../../packages/common/form/src/form-field/form-field.module.ts","../../../packages/common/form/src/form-group/form-group.component.ts","../../../packages/common/form/src/form-group/form-group.component.html","../../../packages/common/form/src/form-group/form-group.module.ts","../../../packages/common/form/src/form.module.ts","../../../packages/common/form/src/form-dialog/form-dialog.component.ts","../../../packages/common/form/src/form-dialog/form-dialog.component.html","../../../packages/common/form/src/form-dialog/form-dialog.service.ts","../../../packages/common/form/src/form-dialog/form-dialog.module.ts","../../../packages/common/form/src/igo2-common-form.ts"],"sourcesContent":["import { AbstractControl } from '@angular/forms';\n\nimport { Form, FormField, FormFieldGroup } from './form.interfaces';\n\nexport function formControlIsRequired(control: AbstractControl): boolean {\n if (control.validator) {\n const validator = control.validator({} as AbstractControl);\n if (validator && validator.required) {\n return true;\n }\n }\n\n if ((control as any).controls) {\n const requiredControl = Object.keys((control as any).controls).find(\n (key: string) => {\n return formControlIsRequired((control as any).controls[key]);\n }\n );\n return requiredControl !== undefined;\n }\n\n return false;\n}\n\nexport function getDefaultErrorMessages(): Record<string, string> {\n return {\n required: 'igo.common.form.errors.required',\n email: 'igo.common.form.errors.email'\n };\n}\n\nexport function getControlErrorMessage(\n control: AbstractControl,\n messages: Record<string, string>\n): string {\n const errors = control.errors || {};\n const errorKeys = Object.keys(errors);\n const errorMessages = errorKeys\n .map((key: string) => messages[key])\n .filter((message: string) => message !== undefined);\n return errorMessages.length > 0 ? errorMessages[0] : '';\n}\n\nexport function getAllFormFields(form: Form): FormField[] {\n return form.groups.reduce((acc: FormField[], group: FormFieldGroup) => {\n return acc.concat(group.fields);\n }, [].concat(form.fields));\n}\n\nexport function getFormFieldByName(form: Form, name: string): FormField {\n const fields = getAllFormFields(form);\n return fields.find((field: FormField) => {\n return field.name === name;\n });\n}\n","import { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { t } from 'typy';\n\nimport { Form, FormField, FormFieldGroup } from '../shared/form.interfaces';\nimport { getAllFormFields } from '../shared/form.utils';\n\n/**\n * A configurable form\n */\n@Component({\n selector: 'igo-form',\n templateUrl: './form.component.html',\n styleUrls: ['./form.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, ReactiveFormsModule, NgClass]\n})\nexport class FormComponent implements OnChanges {\n /**\n * Form\n */\n @Input() form: Form;\n\n /**\n * Input data\n */\n @Input() formData: Record<string, any>;\n\n /**\n * Form autocomplete\n */\n @Input() autocomplete = 'off';\n\n /**\n * Event emitted when the form is submitted\n */\n @Output() submitForm = new EventEmitter<Record<string, any>>();\n\n @ViewChild('buttons', { static: true }) buttons: ElementRef;\n\n get hasButtons(): boolean {\n return this.buttons.nativeElement.children.length !== 0;\n }\n\n /**\n * Is the entity or the template change, recreate the form or repopulate it.\n * @internal\n */\n ngOnChanges(changes: SimpleChanges) {\n const formData = changes.formData;\n if (formData.firstChange && formData.currentValue == null) {\n return;\n }\n\n if (formData && formData.currentValue !== formData.previousValue) {\n if (formData.currentValue === undefined) {\n this.clear();\n } else {\n this.setData(formData.currentValue);\n }\n }\n }\n\n /**\n * Transform the form data to a feature and emit an event\n * @param event Form submit event\n * @internal\n */\n onSubmit() {\n this.submitForm.emit(this.getData());\n }\n\n getData(): Record<string, any> {\n const data = {};\n getAllFormFields(this.form).forEach((field: FormField) => {\n this.updateDataWithFormField(data, field);\n });\n return data;\n }\n\n private setData(data: Record<string, any>) {\n this.form.fields.forEach((field: FormField) => {\n field.control.setValue(t(data, field.name).safeObject);\n });\n\n this.form.groups.forEach((group: FormFieldGroup) => {\n group.fields.forEach((field: FormField) => {\n field.control.setValue(t(data, field.name).safeObject);\n });\n });\n }\n\n private updateDataWithFormField(data: Record<string, any>, field: FormField) {\n const control = field.control;\n if (!control.disabled) {\n data[field.name] = control.value;\n }\n }\n\n /**\n * Clear form\n */\n private clear() {\n this.form.control.reset();\n }\n}\n","<form\n [autocomplete]=\"autocomplete\"\n [formGroup]=\"form.control\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div\n class=\"igo-form-body\"\n [ngClass]=\"{ 'igo-form-body-with-buttons': hasButtons }\"\n >\n <div class=\"igo-form-content\">\n <ng-content></ng-content>\n </div>\n <div #buttons class=\"igo-form-buttons\">\n <ng-content select=\"[formButtons]\"></ng-content>\n </div>\n </div>\n</form>\n","import { NgModule } from '@angular/core';\n\nimport { FormComponent } from './form.component';\n\n/**\n * @deprecated import the FormComponent directly\n */\n@NgModule({\n imports: [FormComponent],\n exports: [FormComponent]\n})\nexport class IgoFormFormModule {}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service where all available form fields are registered.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class FormFieldService {\n static fields: Record<string, any> = {};\n\n static register(type: string, component: any) {\n FormFieldService.fields[type] = component;\n }\n\n /**\n * Return field component by type\n * @param type Field type\n * @returns Field component\n */\n getFieldByType(type: string): any {\n return FormFieldService.fields[type];\n }\n}\n","import { FormFieldService } from './form-field.service';\n\nexport function IgoFormFieldComponent(type: string): (cls: any) => any {\n return (compType: any) => {\n FormFieldService.register(type, compType);\n };\n}\n","import { AsyncPipe, NgFor, NgIf } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport type { UntypedFormControl } from '@angular/forms';\nimport { MatOptionModule } from '@angular/material/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSelectModule } from '@angular/material/select';\n\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { BehaviorSubject } from 'rxjs';\n\nimport { IgoFormFieldComponent } from '../shared/form-field-component';\nimport { FormFieldSelectChoice } from '../shared/form.interfaces';\nimport {\n formControlIsRequired,\n getControlErrorMessage\n} from '../shared/form.utils';\n\n/**\n * This component renders a select field\n */\n@IgoFormFieldComponent('select')\n@Component({\n selector: 'igo-form-field-select',\n templateUrl: './form-field-select.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n MatFormFieldModule,\n MatSelectModule,\n FormsModule,\n ReactiveFormsModule,\n NgFor,\n MatOptionModule,\n NgIf,\n MatIconModule,\n AsyncPipe,\n IgoLanguageModule\n ]\n})\nexport class FormFieldSelectComponent implements OnInit {\n readonly disabled$ = new BehaviorSubject<boolean>(false);\n\n /**\n * Select input choices\n */\n @Input()\n set choices(value: FormFieldSelectChoice[]) {\n this.choices$.next(value);\n }\n get choices(): FormFieldSelectChoice[] {\n return this.choices$.value;\n }\n readonly choices$ = new BehaviorSubject<FormFieldSelectChoice[]>([]);\n\n /**\n * If the select allow multiple selections\n */\n @Input() multiple = false;\n\n /**\n * The field's form control\n */\n @Input() formControl: UntypedFormControl;\n\n /**\n * Field placeholder\n */\n @Input() placeholder: string;\n\n /**\n * Field placeholder\n */\n @Input() errors: Record<string, string>;\n\n /**\n * Wheter a disable switch should be available\n */\n @Input() disableSwitch = false;\n\n /**\n * Whether the field is required\n */\n get required(): boolean {\n return formControlIsRequired(this.formControl);\n }\n\n ngOnInit() {\n this.disabled$.next(this.formControl.disabled);\n }\n\n /**\n * Get error message\n */\n getErrorMessage(): string {\n return getControlErrorMessage(this.formControl, this.errors);\n }\n\n onDisableSwitchClick() {\n this.toggleDisabled();\n }\n\n private toggleDisabled() {\n const disabled = !this.disabled$.value;\n if (disabled === true) {\n this.formControl.disable();\n } else {\n this.formControl.enable();\n }\n this.disabled$.next(disabled);\n }\n}\n","<mat-form-field>\n <mat-select\n [multiple]=\"multiple\"\n [required]=\"required\"\n [placeholder]=\"placeholder | translate\"\n [formControl]=\"formControl\"\n >\n <mat-option *ngFor=\"let choice of choices$ | async\" [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n </mat-select>\n <mat-icon\n *ngIf=\"disableSwitch === true\"\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n <mat-error *ngIf=\"formControl.errors\">{{\n getErrorMessage() | translate\n }}</mat-error>\n</mat-form-field>\n","import { AsyncPipe, NgIf } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport type { UntypedFormControl } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { BehaviorSubject } from 'rxjs';\n\nimport { IgoFormFieldComponent } from '../shared/form-field-component';\nimport {\n formControlIsRequired,\n getControlErrorMessage\n} from '../shared/form.utils';\n\n/**\n * This component renders a text field\n */\n@IgoFormFieldComponent('text')\n@Component({\n selector: 'igo-form-field-text',\n templateUrl: './form-field-text.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n MatFormFieldModule,\n MatInputModule,\n FormsModule,\n ReactiveFormsModule,\n NgIf,\n MatIconModule,\n MatButtonModule,\n AsyncPipe,\n IgoLanguageModule\n ]\n})\nexport class FormFieldTextComponent implements OnInit {\n disabled$ = new BehaviorSubject<boolean>(false);\n hide = true;\n private lastTimeoutRequest;\n\n /**\n * The field's form control\n */\n @Input() formControl: UntypedFormControl;\n\n /**\n * Field placeholder\n */\n @Input() placeholder: string;\n\n /**\n * if the input is a password\n */\n @Input() isPassword: boolean;\n\n /**\n * Field placeholder\n */\n @Input() errors: Record<string, string>;\n\n /**\n * Wheter a disable switch should be available\n */\n @Input() disableSwitch = false;\n\n /**\n * Whether the field is required\n */\n get required(): boolean {\n return formControlIsRequired(this.formControl);\n }\n\n constructor(private cdRef: ChangeDetectorRef) {}\n\n ngOnInit() {\n this.disabled$.next(this.formControl.disabled);\n }\n\n /**\n * Get error message\n */\n getErrorMessage(): string {\n return getControlErrorMessage(this.formControl, this.errors);\n }\n\n onDisableSwitchClick() {\n this.toggleDisabled();\n }\n\n private toggleDisabled() {\n const disabled = !this.disabled$.value;\n if (disabled === true) {\n this.formControl.disable();\n } else {\n this.formControl.enable();\n }\n this.disabled$.next(disabled);\n }\n\n togglePassword() {\n this.hide = !this.hide;\n this.delayedHide();\n }\n delayedHide(delayMS = 10000) {\n if (this.isPassword && !this.hide) {\n if (this.lastTimeoutRequest) {\n clearTimeout(this.lastTimeoutRequest);\n }\n this.lastTimeoutRequest = setTimeout(() => {\n this.hide = true;\n this.cdRef.detectChanges();\n }, delayMS);\n }\n }\n}\n","<mat-form-field>\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword ? 'true' : required\"\n [placeholder]=\"placeholder | translate\"\n [formControl]=\"formControl\"\n (change)=\"delayedHide()\"\n />\n <mat-icon\n *ngIf=\"disableSwitch === true\"\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n\n <button\n type=\"button\"\n *ngIf=\"isPassword\"\n matSuffix\n mat-icon-button\n (click)=\"togglePassword()\"\n >\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n\n <mat-error *ngIf=\"formControl.errors\">{{\n getErrorMessage() | translate\n }}</mat-error>\n</mat-form-field>\n","import { AsyncPipe, NgIf } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport type { UntypedFormControl } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { BehaviorSubject } from 'rxjs';\n\nimport { IgoFormFieldComponent } from '../shared/form-field-component';\nimport {\n formControlIsRequired,\n getControlErrorMessage\n} from '../shared/form.utils';\n\n/**\n * This component renders a textarea field\n */\n@IgoFormFieldComponent('textarea')\n@Component({\n selector: 'igo-form-field-textarea',\n templateUrl: './form-field-textarea.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n MatFormFieldModule,\n MatInputModule,\n FormsModule,\n ReactiveFormsModule,\n NgIf,\n MatIconModule,\n AsyncPipe,\n IgoLanguageModule\n ]\n})\nexport class FormFieldTextareaComponent implements OnInit {\n disabled$ = new BehaviorSubject<boolean>(false);\n\n /**\n * The field's form control\n */\n @Input() formControl: UntypedFormControl;\n\n /**\n * Field placeholder\n */\n @Input() placeholder: string;\n\n /**\n * Field placeholder\n */\n @Input() errors: Record<string, string>;\n\n /**\n * Wheter a disable switch should be available\n */\n @Input() disableSwitch = false;\n\n /**\n * Whether the field is required\n */\n get required(): boolean {\n return formControlIsRequired(this.formControl);\n }\n\n ngOnInit() {\n this.disabled$.next(this.formControl.disabled);\n }\n\n /**\n * Get error message\n */\n getErrorMessage(): string {\n return getControlErrorMessage(this.formControl, this.errors);\n }\n\n onDisableSwitchClick() {\n this.toggleDisabled();\n }\n\n private toggleDisabled() {\n const disabled = !this.disabled$.value;\n if (disabled === true) {\n this.formControl.disable();\n } else {\n this.formControl.enable();\n }\n this.disabled$.next(disabled);\n }\n}\n","<mat-form-field>\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder | translate\"\n [formControl]=\"formControl\"\n >\n </textarea>\n <mat-icon\n *ngIf=\"disableSwitch === true\"\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n <mat-error *ngIf=\"formControl.errors\">{{\n getErrorMessage() | translate\n }}</mat-error>\n</mat-form-field>\n","import { Injectable } from '@angular/core';\nimport {\n FormControlState,\n UntypedFormBuilder,\n ValidatorFn,\n Validators\n} from '@angular/forms';\n\nimport {\n Form,\n FormField,\n FormFieldConfig,\n FormFieldGroup,\n FormFieldGroupConfig\n} from './form.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class FormService {\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n form(fields: FormField[], groups: FormFieldGroup[]): Form {\n const control = this.formBuilder.group({});\n fields.forEach((field: FormField) => {\n control.addControl(field.name, field.control);\n });\n groups.forEach((group: FormFieldGroup) => {\n control.addControl(group.name, group.control);\n });\n\n return { fields, groups, control };\n }\n\n group(config: FormFieldGroupConfig, fields: FormField[]): FormFieldGroup {\n const options = config.options || {};\n const control = this.formBuilder.group({});\n fields.forEach((field: FormField) => {\n control.addControl(field.name, field.control);\n });\n\n if (options.validator) {\n const validators = this.getValidators(options.validator); // convert string to actual validator\n control.setValidators(validators);\n }\n\n return Object.assign({}, config, { fields, control }) as FormFieldGroup;\n }\n\n field(config: FormFieldConfig): FormField {\n const options = config.options || {};\n const state: FormControlState<unknown> = {\n value: options.initialValue ?? '',\n disabled: options.disabled\n };\n const control = this.formBuilder.control(state);\n\n if (options.validator) {\n const validators = this.getValidators(options.validator); // convert string to actual validator\n control.setValidators(validators);\n }\n\n return Object.assign({ type: 'text' }, config, { control }) as FormField;\n }\n\n extendFieldConfig(\n config: FormFieldConfig,\n partial: Partial<FormFieldConfig>\n ): FormFieldConfig {\n const options = Object.assign(\n {},\n config.options || {},\n partial.options || {}\n );\n const inputs = Object.assign({}, config.inputs || {}, partial.inputs || {});\n const subscribers = Object.assign(\n {},\n config.subscribers || {},\n partial.subscribers || {}\n );\n return Object.assign({}, config, { options, inputs, subscribers });\n }\n\n private getValidators(\n validatorOption: string | string[] | ValidatorFn\n ): ValidatorFn | ValidatorFn[] {\n if (Array.isArray(validatorOption)) {\n return validatorOption.map((validatorStr) => {\n return this.getValidator(validatorStr);\n });\n }\n\n return this.getValidator(validatorOption);\n }\n\n private getValidator(validatorStr: string | ValidatorFn): ValidatorFn {\n if (typeof validatorStr !== 'string') {\n return validatorStr;\n }\n\n // regex pattern to extract arguments from string for e.g applying on \"minLength(8)\" would extract 8\n const re = /^([a-zA-Z]{3,15})\\((.{0,20})\\)$/;\n const match = validatorStr.match(re);\n\n if (!match) {\n return Validators[validatorStr];\n }\n\n const name = match[1];\n const args = match[2];\n return Validators[name](args);\n }\n}\n","import { NgIf } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nimport { DynamicOutletComponent } from '@igo2/common/dynamic-component';\n\nimport { getDefaultErrorMessages } from '../shared';\nimport { FormFieldService } from '../shared/form-field.service';\nimport {\n FormField,\n FormFieldInputs,\n FormFieldOptions,\n FormFieldSubscribers\n} from '../shared/form.interfaces';\n\n/**\n * This component renders the proper form input based on\n * the field configuration it receives.\n */\n@Component({\n selector: 'igo-form-field',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgIf, DynamicOutletComponent]\n})\nexport class FormFieldComponent {\n /**\n * Field configuration\n */\n @Input() field: FormField;\n\n /**\n * Field inputs cache\n */\n private fieldInputs: FormFieldInputs = undefined;\n\n /**\n * Field subscribers cache\n */\n private fieldSubscribers: FormFieldSubscribers = undefined;\n\n get fieldOptions(): FormFieldOptions {\n return this.field.options || {};\n }\n\n constructor(private formFieldService: FormFieldService) {}\n\n getFieldComponent(): any {\n return this.formFieldService.getFieldByType(this.field.type || 'text');\n }\n\n getFieldInputs(): FormFieldInputs {\n if (this.fieldInputs !== undefined) {\n return this.fieldInputs;\n }\n\n const errors = this.fieldOptions.errors || {};\n this.fieldInputs = Object.assign(\n {\n placeholder: this.field.title,\n disableSwitch: this.fieldOptions.disableSwitch || false\n },\n Object.assign({}, this.field.inputs || {}),\n {\n formControl: this.field.control,\n errors: Object.assign({}, getDefaultErrorMessages(), errors)\n }\n );\n return this.fieldInputs;\n }\n\n getFieldSubscribers(): FormFieldSubscribers {\n if (this.fieldSubscribers !== undefined) {\n return this.fieldSubscribers;\n }\n\n this.fieldSubscribers = Object.assign({}, this.field.subscribers || {});\n return this.fieldSubscribers;\n }\n}\n","<ng-container *ngIf=\"field !== undefined\">\n <igo-dynamic-outlet\n [component]=\"getFieldComponent()\"\n [inputs]=\"getFieldInputs()\"\n [subscribers]=\"getFieldSubscribers()\"\n >\n </igo-dynamic-outlet>\n</ng-container>\n","import { FormFieldSelectComponent } from './form-field-select.component';\nimport { FormFieldTextComponent } from './form-field-text.component';\nimport { FormFieldTextareaComponent } from './form-field-textarea.component';\nimport { FormFieldComponent } from './form-field.component';\n\nexport const FORM_FIELD_DIRECTIVES = [\n FormFieldComponent,\n FormFieldSelectComponent,\n FormFieldTextComponent,\n FormFieldTextareaComponent\n] as const;\n","import { NgModule } from '@angular/core';\n\nimport { FORM_FIELD_DIRECTIVES } from './form-field.directive';\n\n/**\n * @deprecated import the components directly or FORM_FIELD_DIRECTIVES for every components/directives\n */\n@NgModule({\n imports: [...FORM_FIELD_DIRECTIVES],\n exports: [...FORM_FIELD_DIRECTIVES]\n})\nexport class IgoFormFieldModule {}\n","import { NgClass, NgFor, NgIf } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { UntypedFormGroup } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\n\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { FormFieldComponent } from '../form-field/form-field.component';\nimport { FormField, FormFieldGroup } from '../shared/form.interfaces';\nimport { getControlErrorMessage } from '../shared/form.utils';\n\n/**\n * A configurable form, optionnally bound to an entity\n * (for example in case of un update). Submitting that form\n * emits an event with the form data but no other operation is performed.\n */\n@Component({\n selector: 'igo-form-group',\n templateUrl: './form-group.component.html',\n styleUrls: ['./form-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgIf,\n NgFor,\n NgClass,\n FormFieldComponent,\n MatFormFieldModule,\n IgoLanguageModule\n ]\n})\nexport class FormGroupComponent {\n /**\n * Form field group\n */\n @Input() group: FormFieldGroup;\n\n /**\n * Field placeholder\n */\n @Input() errors: Record<string, string>;\n\n /**\n * Form group control\n */\n get formControl(): UntypedFormGroup {\n return this.group.control;\n }\n\n /**\n * Return the number of columns a field should occupy.\n * The maximum allowed is 2, even if the field config says more.\n * @param field Field\n * @returns Number of columns\n * @internal\n */\n getFieldColSpan(field: FormField): number {\n let colSpan = 2;\n const options = field.options || {};\n if (options.cols && options.cols > 0) {\n colSpan = Math.min(options.cols, 2);\n }\n\n return colSpan;\n }\n\n /**\n * Return the number of columns a field should occupy.\n * The maximum allowed is 2, even if the field config says more.\n * @param field Field\n * @returns Number of columns\n * @internal\n */\n getFieldNgClass(field: FormField): Record<string, boolean> {\n const colspan = this.getFieldColSpan(field);\n return { [`igo-form-field-colspan-${colspan}`]: true };\n }\n\n /**\n * Get error message\n */\n getErrorMessage(): string {\n const options = this.group.options || {};\n return getControlErrorMessage(this.formControl, options.errors || {});\n }\n}\n","<div *ngIf=\"group && group.fields.length > 0\" class=\"igo-form-group-fields\">\n <div\n *ngFor=\"let field of group.fields\"\n class=\"igo-form-field-wrapper\"\n [ngClass]=\"getFieldNgClass(field)\"\n >\n <igo-form-field [field]=\"field\"></igo-form-field>\n </div>\n</div>\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content></ng-content>\n</div>\n\n<mat-error *ngIf=\"formControl.errors\">{{\n getErrorMessage() | translate\n}}</mat-error>\n","import { NgModule } from '@angular/core';\n\nimport { FormGroupComponent } from './form-group.component';\n\n/**\n * @deprecated import the FormGroupComponent directly\n */\n@NgModule({\n imports: [FormGroupComponent],\n exports: [FormGroupComponent]\n})\nexport class IgoFormGroupModule {}\n","import { NgModule } from '@angular/core';\n\nimport { FormComponent } from './form';\nimport { FORM_FIELD_DIRECTIVES } from './form-field';\nimport { FormGroupComponent } from './form-group';\n\nexport const FORM_DIRECTIVES = [\n ...FORM_FIELD_DIRECTIVES,\n FormGroupComponent,\n FormComponent\n] as const;\n\n/**\n * @deprecated import the components directly or FORM_DIRECTIVES for every components/directives\n */\n@NgModule({\n imports: [...FORM_DIRECTIVES],\n exports: [...FORM_DIRECTIVES]\n})\nexport class IgoFormModule {}\n","import { AsyncPipe, NgFor, NgIf } from '@angular/common';\nimport { Component, Inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport {\n MAT_DIALOG_DATA,\n MatDialogActions,\n MatDialogRef,\n MatDialogTitle\n} from '@angular/material/dialog';\n\nimport { CustomHtmlComponent } from '@igo2/common/custom-html';\nimport { LanguageService } from '@igo2/core/language';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { BehaviorSubject } from 'rxjs';\n\nimport { FormComponent } from '../form';\nimport { FormFieldComponent } from '../form-field';\nimport { FormGroupComponent } from '../form-group';\nimport {\n Form,\n FormField,\n FormFieldGroup,\n FormFieldInputs,\n FormService\n} from '../shared';\nimport { FormDialogData } from './form-dialog.interface';\n\n@Component({\n selector: 'igo-form-dialog',\n templateUrl: './form-dialog.component.html',\n styleUrls: ['./form-dialog.component.scss'],\n imports: [\n MatDialogTitle,\n NgIf,\n FormComponent,\n NgFor,\n FormFieldComponent,\n FormGroupComponent,\n MatDialogActions,\n MatButtonModule,\n CustomHtmlComponent,\n AsyncPipe,\n IgoLanguageModule\n ]\n})\nexport class FormDialogComponent {\n form$ = new BehaviorSubject<Form>(undefined);\n data$ = new BehaviorSubject<Record<string, any>>(undefined);\n constructor(\n public languageService: LanguageService,\n public dialogRef: MatDialogRef<FormDialogComponent>,\n private formService: FormService,\n @Inject(MAT_DIALOG_DATA)\n public data: FormDialogData\n ) {\n this.data.processButtonText =\n this.data.processButtonText ?? 'igo.common.formDialog.processButtonText';\n this.data.cancelButtonText =\n this.data.cancelButtonText ?? 'igo.common.formDialog.cancelButtonText';\n this.data.title = this.data.title ?? 'igo.common.formDialog.title';\n this.data$ = this.data.data$;\n\n const fields: FormField<FormFieldInputs>[] = [];\n const groups: FormFieldGroup[] = [];\n this.data.formFieldConfigs?.map((config) =>\n fields.push(this.formService.field(config))\n );\n\n this.data.formGroupsConfigs?.map((formGroupsConfig) => {\n const fields = formGroupsConfig.formFieldConfigs?.map((config) =>\n this.formService.field(config)\n );\n groups.push(\n this.formService.group({ name: formGroupsConfig.name }, fields)\n );\n });\n const form = this.formService.form(fields, groups);\n\n this.form$.next(form);\n }\n\n onSubmit(data: Record<string, any>) {\n const form = this.form$.getValue();\n if (form.control.valid) {\n this.dialogRef.close(data);\n } else {\n if (form.groups?.length) {\n form.groups.map((group) => {\n Object.keys(group.control.controls).map((k) => {\n group.control.controls[k].markAsTouched();\n group.control.controls[k].updateValueAndValidity();\n });\n });\n } else {\n form.fields.map((f) => {\n f.control.markAsTouched();\n f.control.updateValueAndValidity();\n });\n }\n }\n }\n cancel() {\n this.dialogRef.close();\n }\n}\n","<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n<igo-form\n *ngIf=\"form$ | async as form\"\n [form]=\"form\"\n [formData]=\"data$ | async\"\n (submitForm)=\"onSubmit($event)\"\n>\n <div *ngIf=\"form.fields.length\" class=\"form-dialog-container\">\n <igo-form-field\n *ngFor=\"let field of form.fields\"\n [field]=\"field\"\n ></igo-form-field>\n <igo-form-group\n *ngFor=\"let group of form.groups\"\n [group]=\"group\"\n ></igo-form-group>\n </div>\n\n <div formButtons mat-dialog-actions>\n <button mat-stroked-button type=\"button\" color=\"primary\" (click)=\"cancel()\">\n {{ data.cancelButtonText | translate }}\n </button>\n <button mat-flat-button type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n</igo-form>\n<div>\n <igo-custom-html\n *ngIf=\"data.notice && data.notice !== ''\"\n [html]=\"data.notice\"\n >\n </igo-custom-html>\n</div>\n","import { Injectable } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\n\nimport { Observable } from 'rxjs';\n\nimport { FormDialogComponent } from './form-dialog.component';\nimport {\n FormDialogData,\n FormDialogFormConfig,\n FormDialogOptions\n} from './form-dialog.interface';\n\n@Injectable()\nexport class FormDialogService {\n constructor(private dialog: MatDialog) {}\n\n public open(\n formDialogConfig?: FormDialogFormConfig,\n options?: FormDialogOptions\n ): Observable<Record<string, any>> {\n const data: FormDialogData = {\n formFieldConfigs: formDialogConfig.formFieldConfigs,\n formGroupsConfigs: formDialogConfig.formGroupsConfigs,\n ...options\n };\n const dialogRef = this.dialog.open(FormDialogComponent, {\n disableClose: false,\n data,\n ...options\n });\n return dialogRef.afterClosed();\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { MatDialogModule } from '@angular/material/dialog';\n\nimport { FormDialogComponent } from './form-dialog.component';\nimport { FormDialogService } from './form-dialog.service';\n\n/**\n * @deprecated import the FlexibleComponent directly\n */\n@NgModule({\n imports: [MatDialogModule, FormDialogComponent],\n exports: [FormDialogComponent],\n providers: [FormDialogService]\n})\nexport class IgoFormDialogModule {\n /**\n * @deprecated it has no effect\n */\n static forRoot(): ModuleWithProviders<IgoFormDialogModule> {\n return {\n ngModule: IgoFormDialogModule,\n providers: []\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i5","i6","i2","i1.FormFieldService","i1.FormFieldComponent","i2.FormFieldSelectComponent","i3.FormFieldTextComponent","i4.FormFieldTextareaComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIM,SAAU,qBAAqB,CAAC,OAAwB,EAAA;AAC5D,IAAA,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,EAAqB,CAAC;AAC1D,QAAA,IAAI,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE;AACnC,YAAA,OAAO,IAAI;;;AAIf,IAAA,IAAK,OAAe,CAAC,QAAQ,EAAE;AAC7B,QAAA,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAE,OAAe,CAAC,QAAQ,CAAC,CAAC,IAAI,CACjE,CAAC,GAAW,KAAI;YACd,OAAO,qBAAqB,CAAE,OAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9D,SAAC,CACF;QACD,OAAO,eAAe,KAAK,SAAS;;AAGtC,IAAA,OAAO,KAAK;AACd;SAEgB,uBAAuB,GAAA;IACrC,OAAO;AACL,QAAA,QAAQ,EAAE,iCAAiC;AAC3C,QAAA,KAAK,EAAE;KACR;AACH;AAEgB,SAAA,sBAAsB,CACpC,OAAwB,EACxB,QAAgC,EAAA;AAEhC,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE;IACnC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACrC,MAAM,aAAa,GAAG;SACnB,GAAG,CAAC,CAAC,GAAW,KAAK,QAAQ,CAAC,GAAG,CAAC;SAClC,MAAM,CAAC,CAAC,OAAe,KAAK,OAAO,KAAK,SAAS,CAAC;AACrD,IAA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