UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

85 lines (84 loc) 4.54 kB
import React from 'react'; import { ScopedContext } from 'jamis-core'; import type { ActionObject, IScopedContext, RendererComponent, Schema, ScopedComponentType } from 'jamis-core'; import type { FormProps, FormSchemaBase } from '../types'; export * from './FormPresenter'; export declare class FormCmpt extends React.Component<FormProps, object> { static defaultProps: Partial<FormProps>; static propsList: Array<string>; static hookBeforeRenderSchema: RendererComponent['hookBeforeRenderSchema']; hooks: { [propName: string]: Array<() => Promise<any>>; }; asyncCancel: () => void; disposeOnValidate: () => void; disposeRulesValidate: () => void; shouldLoadInitApi: boolean; timer: ReturnType<typeof setTimeout>; mounted: boolean; lazyEmitChange: import("lodash").DebouncedFunc<any>; unBlockRouting?: () => void; formRef: React.RefObject<HTMLDivElement | HTMLFormElement>; constructor(props: FormProps); componentDidMount(): void; componentDidUpdate(prevProps: FormProps): void; componentWillUnmount(): void; blockRouting(): any; beforePageUnload(e: any): any; onInit(): Promise<void>; reload(subPath?: string, query?: any, ctx?: any, silent?: boolean): void; receive(values: object): void; silentReload(target?: string, query?: any): void; initInterval(value: any): any; isValidated(): boolean; validate(forceValidate?: boolean, throwErrors?: boolean, toastErrors?: boolean, skipFlush?: boolean): Promise<boolean>; handleValidateError: () => Promise<import("jamis-core").RendererEvent<any, any>>; clearErrors(): void; getValues(): any; setValues(value: any): void; submit(fn?: (values: object) => Promise<any>): Promise<any>; flush(): void; reset(): void; addHook(fn: () => any, type: 'validate' | 'init' | 'flush'): () => void; removeHook(fn: () => any, type: 'validate' | 'init' | 'flush'): void; handleChange(value: any, name: string, submit: boolean, changePristine?: boolean): void; formItemDispatchEvent(dispatchEvent: any): (type: string, data: any) => void; emitChange(submit: boolean): Promise<void>; handleBulkChange(values: Object, submit: boolean): void; handleFormSubmit(e: React.UIEvent<any>): any; handleReset(action: any): (data: any) => void; handleAction(e: React.UIEvent<any> | void, action: ActionObject, data: object, throwErrors?: boolean, delegate?: IScopedContext): Promise<any>; handleQuery(query: any): void; handleDialogConfirm(values: object[], action: ActionObject, ctx: any, targets: Array<any>): void; handleDialogClose(confirmed?: boolean): void; handleDrawerConfirm(values: object[], action: ActionObject, ctx: any, targets: Array<any>): void; handleDrawerClose(): void; submitToTarget(target: string, values: object): void; reloadTarget(target: string, data?: any): void; closeTarget(target: string, data?: any): void; openFeedback(dialog: any, ctx: any): Promise<unknown>; buildActions(): any[] | undefined; renderFormItems(schema: Partial<FormSchemaBase> & { controls?: Array<any>; }, region?: string, otherProps?: Partial<FormProps>): React.ReactNode; renderChildren(children: Array<Schema>, region: string, otherProps?: Partial<FormProps>): React.ReactNode; renderChild(_control: Schema | string, index: number, otherProps: Partial<FormProps> | undefined, region: string | undefined, itemsCount: number): React.ReactNode; renderBody(): JSX.Element; render(): JSX.Element; } export declare class FormRenderer extends FormCmpt { static contextType: React.Context<IScopedContext<ScopedComponentType>>; context: React.ContextType<typeof ScopedContext>; constructor(props: FormProps, context: IScopedContext); componentDidMount(): void; componentWillUnmount(): void; doAction(action: ActionObject, data?: object, throwErrors?: boolean): Promise<any>; handleAction(e: React.UIEvent<any> | undefined, action: ActionObject, ctx: object, throwErrors?: boolean, delegate?: IScopedContext): Promise<any>; handleDialogConfirm(values: object[], action: ActionObject, ctx: any, targets: Array<any>): void; submitToTarget(target: string, values: object): void; reloadTarget(target: string, data: any): void; closeTarget(target: string, data: any): void; reload(target?: string, query?: any, ctx?: any, silent?: boolean): void; receive(values: object, name?: string): void; setData(values: object): void; }