UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

34 lines (33 loc) 1.2 kB
import { Form as AntForm, FormProps as AntFormProps, type FormInstance } from 'antd'; import { CSSProperties, type ReactNode, RefAttributes } from 'react'; import FormGroup, { type FormVariant, type ItemGroup, type ItemsType } from './components/FormGroup'; import FormItem, { type FormItemProps } from './components/FormItem'; export interface FormProps extends Omit<AntFormProps, 'variant'> { activeKey?: (string | number)[]; children?: ReactNode; classNames?: { footer?: string; }; collapsible?: boolean; defaultActiveKey?: (string | number)[]; footer?: ReactNode; gap?: number | string; itemMinWidth?: FormItemProps['minWidth']; items?: ItemGroup[] | FormItemProps[]; itemsType?: ItemsType; onCollapse?: (key: (string | number)[]) => void; styles?: { footer?: CSSProperties; }; variant?: FormVariant; } export type { FormInstance } from 'antd'; export interface IForm { (props: FormProps & RefAttributes<FormInstance>): ReactNode; Group: typeof FormGroup; Item: typeof FormItem; Provider: typeof AntForm.Provider; useForm: typeof AntForm.useForm; } declare const Form: IForm; export default Form;