UNPKG

amis

Version:

一种MIS页面生成工具

75 lines (74 loc) 2.69 kB
/// <reference types="lodash" /> import React from 'react'; import { IFormStore, IFormItemStore } from '../../store/form'; import { RendererProps } from '../../factory'; import { Schema } from '../../types'; import { IIRendererStore, IRendererStore } from '../../store'; import { IScopedContext } from '../../Scoped'; export interface ControlProps extends RendererProps { control: { id?: string; name?: string; value?: any; required?: boolean; validations: string | { [propsName: string]: any; }; validationErrors: { [propsName: string]: any; }; validateOnChange: boolean; multiple?: boolean; delimiter?: string; joinValues?: boolean; extractValue?: boolean; valueField?: string; labelField?: string; unique?: boolean; selectFirst?: boolean; autoFill?: any; clearValueOnHidden?: boolean; pipeIn?: (value: any, data: any) => any; pipeOut?: (value: any, originValue: any, data: any) => any; validate?: (value: any, values: any, name: string) => any; } & Schema; rootStore: IRendererStore; formStore: IFormStore; onChange?: (value: any, name: string, submit: boolean) => void; store: IIRendererStore; addHook: (fn: () => any, type?: 'validate' | 'init' | 'flush') => void; removeHook: (fn: () => any, type?: 'validate' | 'init' | 'flush') => void; } export default class FormControl extends React.PureComponent<ControlProps> { static propsList: any; model: IFormItemStore | undefined; control: any; value?: any; hook?: () => any; hook2?: () => any; hook3?: () => any; reaction?: () => void; static defaultProps: {}; lazyValidate: import("lodash").DebouncedFunc<any>; lazyEmitChange: import("lodash").DebouncedFunc<any>; componentWillMount(): void; componentDidMount(): void; componentWillReceiveProps(nextProps: ControlProps): void; componentWillUnmount(): void; disposeModel(): void; controlRef(control: any): void; validate(): void; handleChange(value: any, submitOnChange?: boolean, changeImmediately?: boolean): void; emitChange(submitOnChange?: boolean): void; handleBlur(e: any): void; handleBulkChange(values: any, submitOnChange?: boolean): void; setPrinstineValue(value: any): void; getValue(): any; setValue(value: any, key?: string): void; render(): JSX.Element; } export declare class FormControlRenderer extends FormControl { static displayName: string; static contextType: React.Context<IScopedContext>; controlRef(ref: any): void; }