UNPKG

1.38 kBTypeScriptView Raw
1import * as React from 'react';
2import { FormInstance } from 'rc-field-form';
3import { FieldProps } from 'rc-field-form/lib/Field';
4import { FormItemLabelProps, LabelTooltipType } from './FormItemLabel';
5import { FormItemInputProps } from './FormItemInput';
6declare const ValidateStatuses: ["success", "warning", "error", "validating", ""];
7export declare type ValidateStatus = typeof ValidateStatuses[number];
8declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
9declare type RcFieldProps<Values = any> = Omit<FieldProps<Values>, 'children'>;
10declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
11export interface FormItemProps<Values = any> extends FormItemLabelProps, FormItemInputProps, RcFieldProps<Values> {
12 prefixCls?: string;
13 noStyle?: boolean;
14 style?: React.CSSProperties;
15 className?: string;
16 children?: ChildrenType<Values>;
17 id?: string;
18 hasFeedback?: boolean;
19 validateStatus?: ValidateStatus;
20 required?: boolean;
21 hidden?: boolean;
22 initialValue?: any;
23 messageVariables?: Record<string, string>;
24 tooltip?: LabelTooltipType;
25 /** Auto passed by List render props. User should not use this. */
26 fieldKey?: React.Key | React.Key[];
27}
28declare function FormItem<Values = any>(props: FormItemProps<Values>): React.ReactElement;
29export default FormItem;