2015-07-23 22:23:11 +08:00
|
|
|
import React from 'react';
|
2015-11-25 15:46:44 +08:00
|
|
|
import classNames from 'classnames';
|
|
|
|
import InputNumber from 'rc-input-number';
|
2015-07-01 14:48:47 +08:00
|
|
|
|
2015-07-23 22:23:11 +08:00
|
|
|
export default React.createClass({
|
2015-07-01 14:48:47 +08:00
|
|
|
getDefaultProps() {
|
|
|
|
return {
|
2015-11-17 14:35:43 +08:00
|
|
|
prefixCls: 'ant-input-number',
|
|
|
|
step: 1,
|
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({
|
2016-03-30 10:58:37 +08:00
|
|
|
[`${this.props.prefixCls}-lg`]: size === 'large',
|
|
|
|
[`${this.props.prefixCls}-sm`]: size === 'small',
|
2015-11-25 15:46:44 +08:00
|
|
|
[className]: !!className,
|
|
|
|
});
|
|
|
|
|
|
|
|
return <InputNumber className={inputNumberClass} {...other} />;
|
2015-07-01 14:48:47 +08:00
|
|
|
}
|
|
|
|
});
|