You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

import React from 'react';
import Pagination from 'rc-pagination';
import Select from '../select';
9 years ago
import zhCN from './locale/zh_CN';
const prefixCls = 'ant-pagination';
const MiniSelect = React.createClass({
render() {
return <Select size="small" {...this.props} />;
}
});
MiniSelect.Option = Select.Option;
9 years ago
class AntPagination extends React.Component {
render() {
let className = this.props.className;
if (this.props.simple) {
// hijiking simple pagination
let newProps = {};
for (let key in this.props) {
if (this.props.hasOwnProperty(key)) {
newProps[key] = this.props[key];
}
}
delete newProps.simple;
className += ' mini';
return <Pagination selectComponentClass={MiniSelect}
selectPrefixCls="ant-select"
prefixCls={prefixCls}
showSizeChanger
showQuickJumper
{...newProps} className={className}/>;
}
if (this.props.size === 'small') {
className += ' mini';
}
10 years ago
return <Pagination selectComponentClass={Select}
9 years ago
selectPrefixCls="ant-select"
prefixCls={prefixCls}
{...this.props} className={className}/>;
}
}
9 years ago
AntPagination.defaultProps = {
locale: zhCN,
className: '',
9 years ago
};
export default AntPagination;