UNPKG

1.65 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5import _inherits from 'babel-runtime/helpers/inherits';
6import classNames from 'classnames';
7import React from 'react';
8
9import PaginationItem, { First, Prev, Ellipsis, Next, Last } from './PaginationItem';
10import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
11
12var Pagination = function (_React$Component) {
13 _inherits(Pagination, _React$Component);
14
15 function Pagination() {
16 _classCallCheck(this, Pagination);
17
18 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
19 }
20
21 Pagination.prototype.render = function render() {
22 var _props = this.props,
23 className = _props.className,
24 children = _props.children,
25 props = _objectWithoutProperties(_props, ['className', 'children']);
26
27 var _splitBsProps = splitBsProps(props),
28 bsProps = _splitBsProps[0],
29 elementProps = _splitBsProps[1];
30
31 var classes = getClassSet(bsProps);
32
33 return React.createElement(
34 'ul',
35 _extends({}, elementProps, { className: classNames(className, classes) }),
36 children
37 );
38 };
39
40 return Pagination;
41}(React.Component);
42
43bsClass('pagination', Pagination);
44
45Pagination.First = First;
46Pagination.Prev = Prev;
47Pagination.Ellipsis = Ellipsis;
48Pagination.Item = PaginationItem;
49Pagination.Next = Next;
50Pagination.Last = Last;
51
52export default Pagination;
\No newline at end of file