|
|
|
@ -55,7 +55,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
|
|
|
|
|
|
|
|
|
context: FormItemContext;
|
|
|
|
|
|
|
|
|
|
state = { helpShow: false };
|
|
|
|
|
helpShow = false;
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
warning(
|
|
|
|
@ -124,7 +124,10 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onHelpAnimEnd = (_key: string, helpShow: boolean) => {
|
|
|
|
|
this.setState({ helpShow });
|
|
|
|
|
this.helpShow = helpShow;
|
|
|
|
|
if (!helpShow) {
|
|
|
|
|
this.setState({});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderHelp() {
|
|
|
|
@ -135,6 +138,9 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
|
|
|
|
{help}
|
|
|
|
|
</div>
|
|
|
|
|
) : null;
|
|
|
|
|
if (children) {
|
|
|
|
|
this.helpShow = !!children;
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<Animate
|
|
|
|
|
transitionName="show-help"
|
|
|
|
@ -306,11 +312,10 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
|
|
|
|
const style = props.style;
|
|
|
|
|
const itemClassName = {
|
|
|
|
|
[`${prefixCls}-item`]: true,
|
|
|
|
|
[`${prefixCls}-item-with-help`]: !!this.getHelpMsg() || this.state.helpShow,
|
|
|
|
|
[`${prefixCls}-item-with-help`]: this.helpShow,
|
|
|
|
|
[`${prefixCls}-item-no-colon`]: !props.colon,
|
|
|
|
|
[`${props.className}`]: !!props.className,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Row className={classNames(itemClassName)} style={style}>
|
|
|
|
|
{children}
|
|
|
|
|