2015-07-23 22:23:11 +08:00
|
|
|
import React from 'react';
|
2015-11-25 15:46:44 +08:00
|
|
|
import classNames from 'classnames';
|
2016-03-21 09:22:14 +08:00
|
|
|
import RcInputNumber from 'rc-input-number';
|
2015-07-01 14:48:47 +08:00
|
|
|
|
2016-03-21 09:22:14 +08:00
|
|
|
export default class InputNumber extends React.Component {
|
2015-07-01 14:48:47 +08:00
|
|
|
render() {
|
2016-01-05 14:42:06 +08:00
|
|
|
const { className, size, ...other } = this.props;
|
2015-11-25 15:46:44 +08:00
|
|
|
const inputNumberClass = classNames({
|
|
|
|
'ant-input-number-lg': size === 'large',
|
|
|
|
'ant-input-number-sm': size === 'small',
|
|
|
|
[className]: !!className,
|
|
|
|
});
|
|
|
|
|
2016-03-21 09:22:14 +08:00
|
|
|
return <RcInputNumber className={inputNumberClass} {...other} />;
|
2015-07-01 14:48:47 +08:00
|
|
|
}
|
2016-03-21 09:22:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
InputNumber.defaultProps = {
|
|
|
|
prefixCls: 'ant-input-number',
|
|
|
|
step: 1,
|
|
|
|
};
|