UNPKG

acud

Version:

acg react 组件库

36 lines (35 loc) • 1.47 kB
/** * @file form item element * @author chenqiang(chenqiang03) */ import * as React from 'react'; import { FormInstance } from 'rc-field-form'; import { FieldProps } from 'rc-field-form/lib/Field'; import { FormItemLabelProps, LabelTooltipType } from './FormItemLabel'; import { FormItemInputProps } from './FormItemInput'; declare const ValidateStatuses: ["success", "warning", "error", "validating", ""]; export type ValidateStatus = typeof ValidateStatuses[number]; type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode; type RcFieldProps<Values = any> = Omit<FieldProps<Values>, 'children'>; type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode; export interface FormItemProps<Values = any> extends FormItemLabelProps, FormItemInputProps, RcFieldProps<Values> { prefixCls?: string; cols?: number; noStyle?: boolean; style?: React.CSSProperties; className?: string; children?: ChildrenType<Values>; id?: string; hasFeedback?: boolean; validateStatus?: ValidateStatus; required?: boolean; hidden?: boolean; initialValue?: any; messageVariables?: Record<string, string>; tooltip?: LabelTooltipType; keepDisplayExtra?: boolean; /** Auto passed by List render props. User should not use this. */ fieldKey?: React.Key | React.Key[]; } declare function FormItem<Values = any>(props: FormItemProps<Values>): React.ReactElement; export default FormItem;