UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

32 lines (31 loc) 1.28 kB
import * as React from 'react'; import { List } from 'rc-field-form'; import { FormProps as RcFormProps } from 'rc-field-form/lib/Form'; import { ColProps } from '../grid/col'; import { FormLabelAlign } from './interface'; import useForm, { FormInstance } from './hooks/useForm'; import { SizeType } from '../config-provider/SizeContext'; export declare type RequiredMark = boolean | 'optional'; export declare type FormLayout = 'horizontal' | 'inline' | 'vertical'; export interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form'> { prefixCls?: string; colon?: boolean; name?: string; layout?: FormLayout; labelAlign?: FormLabelAlign; labelCol?: ColProps; wrapperCol?: ColProps; form?: FormInstance<Values>; size?: SizeType; scrollToFirstError?: boolean; requiredMark?: RequiredMark; /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */ hideRequiredMark?: boolean; } declare const Form: <Values = any>(props: FormProps<Values> & { children?: React.ReactNode; } & { ref?: ((instance: FormInstance<Values> | null) => void) | React.RefObject<FormInstance<Values>> | null | undefined; }) => React.ReactElement; export { useForm, List, FormInstance }; export default Form;