|
|
@ -28,6 +28,8 @@ export default class InputNumber extends React.Component<InputNumberProps, any>
|
|
|
|
step: 1,
|
|
|
|
step: 1,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private inputNumberRef: any;
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { className, size, ...others } = this.props;
|
|
|
|
const { className, size, ...others } = this.props;
|
|
|
|
const inputNumberClass = classNames({
|
|
|
|
const inputNumberClass = classNames({
|
|
|
@ -35,6 +37,14 @@ export default class InputNumber extends React.Component<InputNumberProps, any>
|
|
|
|
[`${this.props.prefixCls}-sm`]: size === 'small',
|
|
|
|
[`${this.props.prefixCls}-sm`]: size === 'small',
|
|
|
|
}, className);
|
|
|
|
}, className);
|
|
|
|
|
|
|
|
|
|
|
|
return <RcInputNumber className={inputNumberClass} {...others} />;
|
|
|
|
return <RcInputNumber ref={c => this.inputNumberRef = c} className={inputNumberClass} {...others} />;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
focus() {
|
|
|
|
|
|
|
|
this.inputNumberRef.focus();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
blur() {
|
|
|
|
|
|
|
|
this.inputNumberRef.blur();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|