import { OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { ControlValueAccessor, FormGroup } from '@angular/forms'; import { TerraFormScope } from './model/terra-form-scope.data'; import { TerraFormFieldInterface } from './model/terra-form-field.interface'; import { TerraFormFieldBase } from '../dynamic-form/data/terra-form-field-base'; import { FormTypeMapInterface } from './model/form-type-map.interface'; import { FormTypeMap } from './model/form-type-map'; import * as i0 from "@angular/core"; export declare class TerraFormComponent implements ControlValueAccessor, OnChanges, OnInit { /** * @description Set width of any form element that doesn't overwrite it. * @default col-12 */ set width(width: string); /** * @description Set accessor for the form fields. Creates a representative reactive FormGroup instance by parsing the given form fields. * @param fields */ set inputFormFields(fields: { [key: string]: TerraFormFieldInterface; } | Array>); /** * @description Get accessor for the form fields. Returns the previously set form fields. */ get inputFormFields(): { [key: string]: TerraFormFieldInterface; } | Array>; /** * @description A custom map of supported control types may be provided here. * Please note: All of the control types contained in this map have to implement the ControlValueAccessor interface. */ inputControlTypeMap: FormTypeMapInterface | FormTypeMap; /** * @description If true, disables the whole form - and all its containing controls/form fields. */ inputIsDisabled: boolean; /** * @description If true, sort the form fields by its position. */ sortByPosition: boolean; /** * @description Scope of the form. It is used to evaluate the visibility of the form fields. * @readonly */ readonly scope: TerraFormScope; _controlTypeMap: FormTypeMapInterface | FormTypeMap; _formFields: { [key: string]: TerraFormFieldInterface; }; /** * @description the default width applied to any form element * @internal */ _width: string; private _values; private _formGroup; private _valueChangesSubscription; private _onChangeCallback; private _onTouchedCallback; /** * Implementation of the OnInit life cycle hook. * @description Initializes the controlTypeMap with its default value if `inputControlTypeMap` is not given. */ ngOnInit(): void; /** * Implementation of the OnChanges life cycle hook. * @description Updates the local controlTypeMap if a custom one is passed through the input `inputControlTypeMap`. * @param changes */ ngOnChanges(changes: SimpleChanges): void; /** * Part of the implementation of the ControlValueAccessor interface. * @description Patches the passed value to the underlying FormGroup instance, which updates the values of each affected form field. * If null or undefined is passed, the form is reset to default values. * @param values */ writeValue(values: any): void; /** * Part of the implementation of the ControlValueAccessor interface. * @description Registers a given callback method, which will be called whenever a value of any form field/control changes. * @param callback */ registerOnChange(callback: (value: any) => void): void; /** * Part of the implementation of the ControlValueAccessor interface. * @description Registers a given callback method, which will be called whenever the form is marked as touched. * This typically happens whenever a form control/field was focused and blurred. * @param callback */ registerOnTouched(callback: () => void): void; /** * @description Get accessor for the reactive FormGroup instance that is created out of the given form fields. * Can be used for validation and value patching purposes. * @readonly */ get formGroup(): FormGroup; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }