choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
58 lines (57 loc) • 2.27 kB
TypeScript
import React, { Component, CSSProperties, ReactNode } from 'react';
import { ColProps } from '../grid/col';
import { FormItemValidateStatus } from './enum';
import FormContext, { FormContextValue } from './FormContext';
export interface FormItemProps {
prefixCls?: string;
rowPrefixCls?: string;
colPrefixCls?: string;
className?: string;
id?: string;
label?: ReactNode;
labelCol?: ColProps;
wrapperCol?: ColProps;
help?: ReactNode;
extra?: ReactNode;
validateStatus?: FormItemValidateStatus;
hasFeedback?: boolean;
required?: boolean;
style?: CSSProperties;
colon?: boolean;
labelLayout?: 'float' | 'none' | 'horizontal';
helpTransitionName?: string;
}
export default class FormItem extends Component<FormItemProps, any> {
static displayName: string;
static defaultProps: {
hasFeedback: boolean;
colon: boolean;
labelLayout: string;
};
static __FORM_ITEM: boolean;
static get contextType(): typeof FormContext;
context: FormContextValue;
helpShow: boolean;
componentDidMount(): void;
shouldComponentUpdate(...args: any[]): any;
getHelpMsg(): {} | null | undefined;
getControls(children: ReactNode, recursively: boolean): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[];
getOnlyControl(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
getChildProp(prop: string): any;
getId(): any;
getMeta(): any;
getField(): any;
getPrefixCls(): string;
onHelpAnimEnd: (_key: string, helpShow: boolean) => void;
renderHelp(): JSX.Element;
renderExtra(): JSX.Element | null;
getValidateStatus(): FormItemValidateStatus | undefined;
renderValidateWrapper(c1: ReactNode, c2: ReactNode, c3: ReactNode): JSX.Element;
renderWrapper(children: ReactNode): JSX.Element;
isRequired(): any;
onLabelClick: (e: any) => void;
renderLabel(): JSX.Element | null;
renderChildren(): (false | JSX.Element | null)[];
renderFormItem(children: ReactNode): JSX.Element;
render(): JSX.Element;
}