UNPKG

ngx-schema-forms

Version:

New features: - Ajv schema validator. - Angular forms compatible: Property tree is created using FormGroup, FormArray and FormControl classes. - Array now properly loads initial data from model. - WidgetTyep: WidgetRegistry now supports WidgetType, now wo

33 lines (32 loc) 1.44 kB
import { OnChanges, SimpleChanges, ChangeDetectorRef, OnInit } from '@angular/core'; import { ControlValueAccessor, ValidatorFn } from '@angular/forms'; import { Action } from '../model/action'; import { ActionRegistry } from '../model/actionregistry'; import { ValidatorRegistry } from '../model/validatorregistry'; import { FormPropertyFactory } from '../model/form-property-factory'; import { FormProperty } from '../model/form-property'; export declare function useFactory(schemaValidatorFactory: any, validatorRegistry: any): FormPropertyFactory; export declare class FormComponent implements OnInit, OnChanges, ControlValueAccessor { private changeDetectorRef; private formPropertyFactory; private actionRegistry; private validatorRegistry; schema: any; actions: { [actionId: string]: Action; }; validators: { [path: string]: ValidatorFn | ValidatorFn[]; }; rootFormProperty: FormProperty; private onChangeCallback; constructor(changeDetectorRef: ChangeDetectorRef, formPropertyFactory: FormPropertyFactory, actionRegistry: ActionRegistry, validatorRegistry: ValidatorRegistry); writeValue(value: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; private registerValidators(); private registerActions(); }