You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
674 B
TypeScript
24 lines
674 B
TypeScript
10 years ago
|
import React from 'react';
|
||
9 years ago
|
import classNames from 'classnames';
|
||
9 years ago
|
import RcInputNumber from 'rc-input-number';
|
||
9 years ago
|
import splitObject from '../_util/splitObject';
|
||
10 years ago
|
|
||
9 years ago
|
export default class InputNumber extends React.Component {
|
||
9 years ago
|
static defaultProps = {
|
||
|
prefixCls: 'ant-input-number',
|
||
|
step: 1,
|
||
|
}
|
||
|
|
||
10 years ago
|
render() {
|
||
9 years ago
|
const [{className, size}, others] = splitObject(this.props,
|
||
|
['size','className']);
|
||
9 years ago
|
const inputNumberClass = classNames({
|
||
9 years ago
|
[`${this.props.prefixCls}-lg`]: size === 'large',
|
||
|
[`${this.props.prefixCls}-sm`]: size === 'small',
|
||
9 years ago
|
[className]: !!className,
|
||
|
});
|
||
|
|
||
9 years ago
|
return <RcInputNumber className={inputNumberClass} {...others} />;
|
||
10 years ago
|
}
|
||
9 years ago
|
}
|