UNPKG

1.39 kBTypeScriptView Raw
1import { FormInstance } from 'rc-field-form';
2import type { FieldProps } from 'rc-field-form/lib/Field';
3import type { FC, MutableRefObject, ReactNode } from 'react';
4import React from 'react';
5import { NativeProps } from '../../utils/native-props';
6import { ListItemProps } from '../list';
7import type { FormLayout } from './index';
8declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => ReactNode;
9declare type ChildrenType<Values = any> = RenderChildren<Values> | ReactNode;
10declare type RcFieldProps = Omit<FieldProps, 'children'>;
11export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue' | 'getValueFromEvent' | 'getValueProps' | 'normalize' | 'preserve' | 'validateFirst'> & Pick<ListItemProps, 'style' | 'extra' | 'clickable' | 'arrow' | 'arrowIcon' | 'description'> & {
12 label?: ReactNode;
13 help?: ReactNode;
14 helpIcon?: ReactNode;
15 hasFeedback?: boolean;
16 required?: boolean;
17 noStyle?: boolean;
18 disabled?: boolean;
19 hidden?: boolean;
20 layout?: FormLayout;
21 childElementPosition?: 'normal' | 'right';
22 children?: ChildrenType;
23 onClick?: (e: React.MouseEvent, widgetRef: MutableRefObject<any>) => void;
24} & NativeProps;
25export declare const FormItem: FC<FormItemProps>;
26export {};