2015-07-23 22:23:11 +08:00
|
|
|
import React from 'react';
|
|
|
|
import Pagination from 'rc-pagination';
|
|
|
|
import Select from 'rc-select';
|
2015-11-16 14:10:42 +08:00
|
|
|
import zhCN from './locale/zh_CN';
|
|
|
|
import enUS from './locale/en_US';
|
2015-07-13 01:04:05 +08:00
|
|
|
|
2015-07-23 22:23:11 +08:00
|
|
|
const prefixCls = 'ant-pagination';
|
2015-07-13 01:04:05 +08:00
|
|
|
|
2015-11-16 14:10:42 +08:00
|
|
|
class AntPagination extends React.Component {
|
2015-07-13 01:04:05 +08:00
|
|
|
render() {
|
2015-10-22 21:01:52 +08:00
|
|
|
let className = this.props.className;
|
|
|
|
if (this.props.size === 'small') {
|
|
|
|
className += ' mini';
|
|
|
|
}
|
2015-07-15 17:32:32 +08:00
|
|
|
return <Pagination selectComponentClass={Select}
|
2015-11-16 14:10:42 +08:00
|
|
|
selectPrefixCls="ant-select"
|
|
|
|
prefixCls={prefixCls}
|
|
|
|
{...this.props} className={className}/>;
|
2015-07-13 01:04:05 +08:00
|
|
|
}
|
|
|
|
}
|
2015-11-16 14:10:42 +08:00
|
|
|
|
|
|
|
AntPagination.defaultProps = {
|
|
|
|
locale: zhCN,
|
|
|
|
};
|
|
|
|
|
2015-11-16 14:13:58 +08:00
|
|
|
// TODO. remove after https://github.com/ant-design/ant-design/issues/487
|
2015-11-16 14:10:42 +08:00
|
|
|
AntPagination.locale = {
|
|
|
|
en_US: enUS,
|
|
|
|
zh_CN: zhCN,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AntPagination;
|