UNPKG

@vs-form/vs-form

Version:

A schema-based form generator component for React using material-ui

85 lines (84 loc) 4.5 kB
/// <reference types="node" /> import { EventEmitter } from 'events'; import * as types from './types'; import { IComponent, IComponentList, IChildrenMember, ISchema, ISchemaDesign, ISchemaList, ISchemaErrorList, IStylesObj, IValidationErrorList, IComponentEventParams, IProcessSchemaParams, IComponentExpansionPanel } from './types'; import * as errstrings from './str_err'; export default class SchemaManager extends EventEmitter { static getComponents(schema: ISchema | ISchemaDesign, withSubSchema?: boolean): IComponentList; static getDataComponents(schema: ISchema): IComponentList; static processSchema(params: IProcessSchemaParams): void; static hasSubschema(schema: ISchema | ISchemaDesign): boolean; schema: ISchema; origSchema: ISchemaDesign; schemaList: ISchemaList; validationErrors: IValidationErrorList; selection: IComponentList; private errors; private actionButtons; private inputRefs; private previousValues; private _dataStateChanged; dataStateChanged: boolean; constructor(schema: ISchema | ISchemaDesign | string, subSchemaList?: ISchemaList); render(callback?: () => void): void; renderComponent(component: IComponent, callback?: () => void): void; renderComponents(components: IComponentList, callback?: () => void): void; focusComponent(component: IComponent, makeComponentVisible?: boolean): void; makeComponentVisible(comp: IComponent): void; getParentComponent(comp: IComponent): IComponent | undefined; addInputRef(comp: IComponent, inputRef: any): void; getInputRef(comp: IComponent): any; clearInputRefList(): void; submit(): boolean; cancelValues(): void; componentIsInSubschema(comp: IComponent): boolean; getSchemaFromComponentId(id: string): ISchema | undefined; getOrigSchemaFromComponentId(id: string): ISchemaDesign | undefined; getComponentById(id: string): IComponent | undefined; getOrigComponentById(id: string): IComponent | undefined; getComponentByFieldPath(fieldPath: string): IComponent | null; getComponentEventParams(component: IComponent): IComponentEventParams; clearValueErrors(): never[]; changeSelection(components: IComponent | IComponentList, multiselect: boolean): void; readonly getErrors: ISchemaErrorList; readonly getWarnings: ISchemaErrorList; readonly getAllErrors: ISchemaErrorList; filterErrors(errcode: errstrings.ErrorCode): types.ISchemaError[]; printErrors(): string; printValueErrors(): string; printValues(): string; clearValueErrorsComp(comp: IComponent): void; getValueErrorsComps(...comp: IComponent[]): IValidationErrorList; getValueErrorsComp(comp: IComponent, arrayId?: any): IValidationErrorList; getValueErrorsForTest(): any[]; updateSchemaIds(): void; resetValidationErrors(): void; resetSchemaValues(omitComponents?: IComponentList): void; bindEventsThis(): void; validateValuesSchema(): boolean; validateValueComp(comp: IComponent, value: any, arrayId?: any): IValidationErrorList; getDefaultValue(comp: IComponent): any; getSchemaValue(comp: IComponent, arrayId?: any): any; updateValue(field: string, value: any): void; updateSchemaValue(comp: IComponent, value: any, arrayId?: any): never[] | undefined; getSubschemaKeyField(comp: IComponent, getDefaultField?: boolean): string; initSubschemaArrayRecords(comp: IComponent): any; insertSubschemaArrayRecord(comp: IComponent, dataComponents?: IComponentList): any; getValue(field: string): any; changeExpanded(comp: IComponentExpansionPanel, expanded: boolean, designMode: boolean): void; changeActiveTab(comp: types.IComponentTabs, activeTab: number, designMode: boolean): void; resolvePropertyFunctions(component: IComponent): void; getChildrenComponents(schema: ISchema, key: string): IComponentList; getSchemaFromList(schema: ISchema | ISchemaDesign | string): ISchema | ISchemaDesign | undefined; checkSchema(): void; getComponentsWithNoParent(): IChildrenMember; mergeStyles(comp: IComponent, defaultStyle: IStylesObj): IStylesObj | undefined; init(): void; callSchemaEvent(event: string): void; private initSchemaValue; private initSchemaValues; private replaceSubSchemaNames; private getSubschemaArrayRecord; private removeSubschemaArrayIds; private addRootKey; }