react-bootstrap 0.31.3 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +1 -0
- package/dist/react-bootstrap.js +14493 -17076
- package/dist/react-bootstrap.min.js +18479 -16
- package/es/Alert.js +1 -4
- package/es/Badge.js +1 -3
- package/es/ButtonGroup.js +1 -3
- package/es/Carousel.js +79 -79
- package/es/CarouselCaption.js +1 -3
- package/es/CarouselItem.js +3 -9
- package/es/Checkbox.js +7 -1
- package/es/Clearfix.js +1 -3
- package/es/CloseButton.js +1 -5
- package/es/Col.js +1 -3
- package/es/Collapse.js +58 -65
- package/es/Dropdown.js +66 -55
- package/es/DropdownButton.js +2 -8
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +25 -10
- package/es/Form.js +1 -3
- package/es/FormControl.js +1 -2
- package/es/FormControlStatic.js +1 -3
- package/es/FormGroup.js +1 -3
- package/es/Glyphicon.js +1 -3
- package/es/Grid.js +1 -3
- package/es/HelpBlock.js +1 -3
- package/es/InputGroup.js +1 -3
- package/es/InputGroupAddon.js +1 -3
- package/es/InputGroupButton.js +1 -3
- package/es/Jumbotron.js +1 -3
- package/es/Label.js +1 -3
- package/es/ListGroup.js +1 -3
- package/es/Media.js +1 -3
- package/es/MediaBody.js +16 -5
- package/es/MediaHeading.js +1 -3
- package/es/MediaLeft.js +1 -3
- package/es/MediaList.js +1 -3
- package/es/MediaListItem.js +1 -3
- package/es/MediaRight.js +1 -3
- package/es/Modal.js +30 -19
- package/es/ModalBody.js +1 -3
- package/es/ModalFooter.js +1 -3
- package/es/ModalHeader.js +2 -4
- package/es/ModalTitle.js +1 -3
- package/es/Nav.js +44 -44
- package/es/NavDropdown.js +2 -0
- package/es/NavItem.js +5 -4
- package/es/Navbar.js +5 -7
- package/es/Overlay.js +1 -3
- package/es/OverlayTrigger.js +43 -43
- package/es/PageHeader.js +1 -3
- package/es/Pager.js +1 -3
- package/es/PagerItem.js +1 -4
- package/es/Pagination.js +15 -224
- package/es/PaginationItem.js +102 -0
- package/es/Panel.js +114 -173
- package/es/PanelBody.js +84 -0
- package/es/PanelCollapse.js +94 -0
- package/es/PanelFooter.js +53 -0
- package/es/PanelGroup.js +95 -52
- package/es/PanelHeading.js +75 -0
- package/es/PanelTitle.js +83 -0
- package/es/PanelToggle.js +94 -0
- package/es/ProgressBar.js +12 -8
- package/es/Radio.js +7 -1
- package/es/Row.js +1 -3
- package/es/SplitButton.js +1 -4
- package/es/SplitToggle.js +1 -4
- package/es/TabContent.js +7 -7
- package/es/TabPane.js +18 -18
- package/es/Table.js +1 -3
- package/es/Tabs.js +4 -10
- package/es/Thumbnail.js +3 -3
- package/es/ToggleButton.js +1 -4
- package/es/Well.js +1 -3
- package/es/index.js +0 -2
- package/es/utils/PropTypes.js +26 -4
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +5 -3
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -17
- package/lib/Badge.js +12 -14
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +12 -14
- package/lib/ButtonToolbar.js +9 -9
- package/lib/Carousel.js +121 -121
- package/lib/CarouselCaption.js +9 -11
- package/lib/CarouselItem.js +17 -22
- package/lib/Checkbox.js +25 -21
- package/lib/Clearfix.js +14 -16
- package/lib/CloseButton.js +12 -16
- package/lib/Col.js +29 -31
- package/lib/Collapse.js +84 -92
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +106 -95
- package/lib/DropdownButton.js +22 -28
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +43 -25
- package/lib/Form.js +11 -13
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +9 -11
- package/lib/FormGroup.js +14 -16
- package/lib/Glyphicon.js +10 -12
- package/lib/Grid.js +10 -12
- package/lib/HelpBlock.js +8 -10
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +10 -12
- package/lib/InputGroupAddon.js +8 -10
- package/lib/InputGroupButton.js +8 -10
- package/lib/Jumbotron.js +9 -11
- package/lib/Label.js +11 -13
- package/lib/ListGroup.js +15 -17
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +15 -17
- package/lib/MediaBody.js +28 -11
- package/lib/MediaHeading.js +9 -11
- package/lib/MediaLeft.js +10 -12
- package/lib/MediaList.js +8 -10
- package/lib/MediaListItem.js +8 -10
- package/lib/MediaRight.js +10 -12
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +80 -69
- package/lib/ModalBody.js +9 -11
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +9 -11
- package/lib/ModalHeader.js +20 -22
- package/lib/ModalTitle.js +9 -11
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +27 -25
- package/lib/NavItem.js +23 -22
- package/lib/Navbar.js +46 -48
- package/lib/NavbarBrand.js +14 -14
- package/lib/NavbarCollapse.js +14 -14
- package/lib/NavbarHeader.js +10 -10
- package/lib/NavbarToggle.js +22 -22
- package/lib/Overlay.js +25 -27
- package/lib/OverlayTrigger.js +79 -79
- package/lib/PageHeader.js +10 -12
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +13 -15
- package/lib/PagerItem.js +18 -21
- package/lib/Pagination.js +25 -240
- package/lib/PaginationItem.js +135 -0
- package/lib/Panel.js +142 -180
- package/lib/PanelBody.js +114 -0
- package/lib/PanelCollapse.js +120 -0
- package/lib/PanelFooter.js +80 -0
- package/lib/PanelGroup.js +111 -70
- package/lib/PanelHeading.js +107 -0
- package/lib/PanelTitle.js +118 -0
- package/lib/PanelToggle.js +130 -0
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +39 -35
- package/lib/Radio.js +25 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +9 -11
- package/lib/SafeAnchor.js +17 -17
- package/lib/SplitButton.js +26 -29
- package/lib/SplitToggle.js +8 -11
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +31 -31
- package/lib/TabPane.js +59 -59
- package/lib/Table.js +15 -17
- package/lib/Tabs.js +29 -35
- package/lib/Thumbnail.js +18 -20
- package/lib/ToggleButton.js +17 -20
- package/lib/ToggleButtonGroup.js +20 -20
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +8 -10
- package/lib/index.js +74 -79
- package/lib/utils/PropTypes.js +35 -9
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +13 -11
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/createChainedFunction.js +1 -1
- package/lib/utils/deprecationWarning.js +7 -7
- package/lib/utils/index.js +4 -4
- package/lib/utils/splitComponentProps.js +3 -3
- package/package.json +54 -64
- package/dist/react-bootstrap.min.js.map +0 -1
- package/es/PaginationButton.js +0 -98
- package/es/utils/TransitionEvents.js +0 -109
- package/lib/PaginationButton.js +0 -137
- package/lib/utils/TransitionEvents.js +0 -113
package/es/Pagination.js
CHANGED
|
@@ -1,77 +1,14 @@
|
|
|
1
|
-
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
2
1
|
import _extends from 'babel-runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
4
4
|
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import elementType from 'prop-types-extra/lib/elementType';
|
|
10
8
|
|
|
11
|
-
import
|
|
9
|
+
import PaginationItem, { First, Prev, Ellipsis, Next, Last } from './PaginationItem';
|
|
12
10
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
13
11
|
|
|
14
|
-
var propTypes = {
|
|
15
|
-
activePage: PropTypes.number,
|
|
16
|
-
items: PropTypes.number,
|
|
17
|
-
maxButtons: PropTypes.number,
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* When `true`, will display the first and the last button page when
|
|
21
|
-
* displaying ellipsis.
|
|
22
|
-
*/
|
|
23
|
-
boundaryLinks: PropTypes.bool,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* When `true`, will display the default node value ('…').
|
|
27
|
-
* Otherwise, will display provided node (when specified).
|
|
28
|
-
*/
|
|
29
|
-
ellipsis: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* When `true`, will display the default node value ('«').
|
|
33
|
-
* Otherwise, will display provided node (when specified).
|
|
34
|
-
*/
|
|
35
|
-
first: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* When `true`, will display the default node value ('»').
|
|
39
|
-
* Otherwise, will display provided node (when specified).
|
|
40
|
-
*/
|
|
41
|
-
last: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* When `true`, will display the default node value ('‹').
|
|
45
|
-
* Otherwise, will display provided node (when specified).
|
|
46
|
-
*/
|
|
47
|
-
prev: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* When `true`, will display the default node value ('›').
|
|
51
|
-
* Otherwise, will display provided node (when specified).
|
|
52
|
-
*/
|
|
53
|
-
next: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
54
|
-
|
|
55
|
-
onSelect: PropTypes.func,
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* You can use a custom element for the buttons
|
|
59
|
-
*/
|
|
60
|
-
buttonComponentClass: elementType
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
var defaultProps = {
|
|
64
|
-
activePage: 1,
|
|
65
|
-
items: 1,
|
|
66
|
-
maxButtons: 0,
|
|
67
|
-
first: false,
|
|
68
|
-
last: false,
|
|
69
|
-
prev: false,
|
|
70
|
-
next: false,
|
|
71
|
-
ellipsis: true,
|
|
72
|
-
boundaryLinks: false
|
|
73
|
-
};
|
|
74
|
-
|
|
75
12
|
var Pagination = function (_React$Component) {
|
|
76
13
|
_inherits(Pagination, _React$Component);
|
|
77
14
|
|
|
@@ -81,108 +18,11 @@ var Pagination = function (_React$Component) {
|
|
|
81
18
|
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
82
19
|
}
|
|
83
20
|
|
|
84
|
-
Pagination.prototype.renderPageButtons = function renderPageButtons(activePage, items, maxButtons, boundaryLinks, ellipsis, buttonProps) {
|
|
85
|
-
var pageButtons = [];
|
|
86
|
-
|
|
87
|
-
var startPage = void 0;
|
|
88
|
-
var endPage = void 0;
|
|
89
|
-
|
|
90
|
-
if (maxButtons && maxButtons < items) {
|
|
91
|
-
startPage = Math.max(Math.min(activePage - Math.floor(maxButtons / 2, 10), items - maxButtons + 1), 1);
|
|
92
|
-
endPage = startPage + maxButtons - 1;
|
|
93
|
-
} else {
|
|
94
|
-
startPage = 1;
|
|
95
|
-
endPage = items;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
for (var page = startPage; page <= endPage; ++page) {
|
|
99
|
-
pageButtons.push(React.createElement(
|
|
100
|
-
PaginationButton,
|
|
101
|
-
_extends({}, buttonProps, {
|
|
102
|
-
key: page,
|
|
103
|
-
eventKey: page,
|
|
104
|
-
active: page === activePage
|
|
105
|
-
}),
|
|
106
|
-
page
|
|
107
|
-
));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (ellipsis && boundaryLinks && startPage > 1) {
|
|
111
|
-
if (startPage > 2) {
|
|
112
|
-
pageButtons.unshift(React.createElement(
|
|
113
|
-
PaginationButton,
|
|
114
|
-
{
|
|
115
|
-
key: 'ellipsisFirst',
|
|
116
|
-
disabled: true,
|
|
117
|
-
componentClass: buttonProps.componentClass
|
|
118
|
-
},
|
|
119
|
-
React.createElement(
|
|
120
|
-
'span',
|
|
121
|
-
{ 'aria-label': 'More' },
|
|
122
|
-
ellipsis === true ? '\u2026' : ellipsis
|
|
123
|
-
)
|
|
124
|
-
));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
pageButtons.unshift(React.createElement(
|
|
128
|
-
PaginationButton,
|
|
129
|
-
_extends({}, buttonProps, {
|
|
130
|
-
key: 1,
|
|
131
|
-
eventKey: 1,
|
|
132
|
-
active: false
|
|
133
|
-
}),
|
|
134
|
-
'1'
|
|
135
|
-
));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (ellipsis && endPage < items) {
|
|
139
|
-
if (!boundaryLinks || endPage < items - 1) {
|
|
140
|
-
pageButtons.push(React.createElement(
|
|
141
|
-
PaginationButton,
|
|
142
|
-
{
|
|
143
|
-
key: 'ellipsis',
|
|
144
|
-
disabled: true,
|
|
145
|
-
componentClass: buttonProps.componentClass
|
|
146
|
-
},
|
|
147
|
-
React.createElement(
|
|
148
|
-
'span',
|
|
149
|
-
{ 'aria-label': 'More' },
|
|
150
|
-
ellipsis === true ? '\u2026' : ellipsis
|
|
151
|
-
)
|
|
152
|
-
));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (boundaryLinks) {
|
|
156
|
-
pageButtons.push(React.createElement(
|
|
157
|
-
PaginationButton,
|
|
158
|
-
_extends({}, buttonProps, {
|
|
159
|
-
key: items,
|
|
160
|
-
eventKey: items,
|
|
161
|
-
active: false
|
|
162
|
-
}),
|
|
163
|
-
items
|
|
164
|
-
));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return pageButtons;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
21
|
Pagination.prototype.render = function render() {
|
|
172
22
|
var _props = this.props,
|
|
173
|
-
activePage = _props.activePage,
|
|
174
|
-
items = _props.items,
|
|
175
|
-
maxButtons = _props.maxButtons,
|
|
176
|
-
boundaryLinks = _props.boundaryLinks,
|
|
177
|
-
ellipsis = _props.ellipsis,
|
|
178
|
-
first = _props.first,
|
|
179
|
-
last = _props.last,
|
|
180
|
-
prev = _props.prev,
|
|
181
|
-
next = _props.next,
|
|
182
|
-
onSelect = _props.onSelect,
|
|
183
|
-
buttonComponentClass = _props.buttonComponentClass,
|
|
184
23
|
className = _props.className,
|
|
185
|
-
|
|
24
|
+
children = _props.children,
|
|
25
|
+
props = _objectWithoutProperties(_props, ['className', 'children']);
|
|
186
26
|
|
|
187
27
|
var _splitBsProps = splitBsProps(props),
|
|
188
28
|
bsProps = _splitBsProps[0],
|
|
@@ -190,72 +30,23 @@ var Pagination = function (_React$Component) {
|
|
|
190
30
|
|
|
191
31
|
var classes = getClassSet(bsProps);
|
|
192
32
|
|
|
193
|
-
var buttonProps = {
|
|
194
|
-
onSelect: onSelect,
|
|
195
|
-
componentClass: buttonComponentClass
|
|
196
|
-
};
|
|
197
|
-
|
|
198
33
|
return React.createElement(
|
|
199
34
|
'ul',
|
|
200
|
-
_extends({}, elementProps, {
|
|
201
|
-
|
|
202
|
-
}),
|
|
203
|
-
first && React.createElement(
|
|
204
|
-
PaginationButton,
|
|
205
|
-
_extends({}, buttonProps, {
|
|
206
|
-
eventKey: 1,
|
|
207
|
-
disabled: activePage === 1
|
|
208
|
-
}),
|
|
209
|
-
React.createElement(
|
|
210
|
-
'span',
|
|
211
|
-
{ 'aria-label': 'First' },
|
|
212
|
-
first === true ? '\xAB' : first
|
|
213
|
-
)
|
|
214
|
-
),
|
|
215
|
-
prev && React.createElement(
|
|
216
|
-
PaginationButton,
|
|
217
|
-
_extends({}, buttonProps, {
|
|
218
|
-
eventKey: activePage - 1,
|
|
219
|
-
disabled: activePage === 1
|
|
220
|
-
}),
|
|
221
|
-
React.createElement(
|
|
222
|
-
'span',
|
|
223
|
-
{ 'aria-label': 'Previous' },
|
|
224
|
-
prev === true ? '\u2039' : prev
|
|
225
|
-
)
|
|
226
|
-
),
|
|
227
|
-
this.renderPageButtons(activePage, items, maxButtons, boundaryLinks, ellipsis, buttonProps),
|
|
228
|
-
next && React.createElement(
|
|
229
|
-
PaginationButton,
|
|
230
|
-
_extends({}, buttonProps, {
|
|
231
|
-
eventKey: activePage + 1,
|
|
232
|
-
disabled: activePage >= items
|
|
233
|
-
}),
|
|
234
|
-
React.createElement(
|
|
235
|
-
'span',
|
|
236
|
-
{ 'aria-label': 'Next' },
|
|
237
|
-
next === true ? '\u203A' : next
|
|
238
|
-
)
|
|
239
|
-
),
|
|
240
|
-
last && React.createElement(
|
|
241
|
-
PaginationButton,
|
|
242
|
-
_extends({}, buttonProps, {
|
|
243
|
-
eventKey: items,
|
|
244
|
-
disabled: activePage >= items
|
|
245
|
-
}),
|
|
246
|
-
React.createElement(
|
|
247
|
-
'span',
|
|
248
|
-
{ 'aria-label': 'Last' },
|
|
249
|
-
last === true ? '\xBB' : last
|
|
250
|
-
)
|
|
251
|
-
)
|
|
35
|
+
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
36
|
+
children
|
|
252
37
|
);
|
|
253
38
|
};
|
|
254
39
|
|
|
255
40
|
return Pagination;
|
|
256
41
|
}(React.Component);
|
|
257
42
|
|
|
258
|
-
Pagination
|
|
259
|
-
|
|
43
|
+
bsClass('pagination', Pagination);
|
|
44
|
+
|
|
45
|
+
Pagination.First = First;
|
|
46
|
+
Pagination.Prev = Prev;
|
|
47
|
+
Pagination.Ellipsis = Ellipsis;
|
|
48
|
+
Pagination.Item = PaginationItem;
|
|
49
|
+
Pagination.Next = Next;
|
|
50
|
+
Pagination.Last = Last;
|
|
260
51
|
|
|
261
|
-
export default
|
|
52
|
+
export default Pagination;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
2
|
+
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
3
|
+
import _inherits from 'babel-runtime/helpers/inherits';
|
|
4
|
+
import _extends from 'babel-runtime/helpers/extends';
|
|
5
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
6
|
+
/* eslint-disable react/no-multi-comp */
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
|
|
11
|
+
import SafeAnchor from './SafeAnchor';
|
|
12
|
+
|
|
13
|
+
var propTypes = {
|
|
14
|
+
eventKey: PropTypes.any,
|
|
15
|
+
className: PropTypes.string,
|
|
16
|
+
onSelect: PropTypes.func,
|
|
17
|
+
disabled: PropTypes.bool,
|
|
18
|
+
active: PropTypes.bool,
|
|
19
|
+
activeLabel: PropTypes.string.isRequired
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var defaultProps = {
|
|
23
|
+
active: false,
|
|
24
|
+
disabled: false,
|
|
25
|
+
activeLabel: '(current)'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function PaginationItem(_ref) {
|
|
29
|
+
var active = _ref.active,
|
|
30
|
+
disabled = _ref.disabled,
|
|
31
|
+
className = _ref.className,
|
|
32
|
+
style = _ref.style,
|
|
33
|
+
activeLabel = _ref.activeLabel,
|
|
34
|
+
children = _ref.children,
|
|
35
|
+
props = _objectWithoutProperties(_ref, ['active', 'disabled', 'className', 'style', 'activeLabel', 'children']);
|
|
36
|
+
|
|
37
|
+
var Component = active || disabled ? 'span' : SafeAnchor;
|
|
38
|
+
return React.createElement(
|
|
39
|
+
'li',
|
|
40
|
+
{ style: style, className: classNames(className, { active: active, disabled: disabled }) },
|
|
41
|
+
React.createElement(
|
|
42
|
+
Component,
|
|
43
|
+
_extends({ disabled: disabled }, props),
|
|
44
|
+
children,
|
|
45
|
+
active && React.createElement(
|
|
46
|
+
'span',
|
|
47
|
+
{ className: 'sr-only' },
|
|
48
|
+
activeLabel
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
PaginationItem.propTypes = propTypes;
|
|
55
|
+
PaginationItem.defaultProps = defaultProps;
|
|
56
|
+
|
|
57
|
+
function createButton(name, defaultValue) {
|
|
58
|
+
var _class, _temp;
|
|
59
|
+
|
|
60
|
+
var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : name;
|
|
61
|
+
|
|
62
|
+
return _temp = _class = function (_React$Component) {
|
|
63
|
+
_inherits(_class, _React$Component);
|
|
64
|
+
|
|
65
|
+
function _class() {
|
|
66
|
+
_classCallCheck(this, _class);
|
|
67
|
+
|
|
68
|
+
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_class.prototype.render = function render() {
|
|
72
|
+
var _props = this.props,
|
|
73
|
+
disabled = _props.disabled,
|
|
74
|
+
children = _props.children,
|
|
75
|
+
className = _props.className,
|
|
76
|
+
props = _objectWithoutProperties(_props, ['disabled', 'children', 'className']);
|
|
77
|
+
|
|
78
|
+
var Component = disabled ? 'span' : SafeAnchor;
|
|
79
|
+
|
|
80
|
+
return React.createElement(
|
|
81
|
+
'li',
|
|
82
|
+
_extends({
|
|
83
|
+
'aria-label': label,
|
|
84
|
+
className: classNames(className, { disabled: disabled })
|
|
85
|
+
}, props),
|
|
86
|
+
React.createElement(
|
|
87
|
+
Component,
|
|
88
|
+
null,
|
|
89
|
+
children || defaultValue
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return _class;
|
|
95
|
+
}(React.Component), _class.displayName = name, _class.propTypes = { disabled: PropTypes.bool }, _temp;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export var First = createButton('First', '\xAB');
|
|
99
|
+
export var Prev = createButton('Prev', '\u2039');
|
|
100
|
+
export var Ellipsis = createButton('Ellipsis', '\u2026', 'More');
|
|
101
|
+
export var Next = createButton('Next', '\u203A');
|
|
102
|
+
export var Last = createButton('Last', '\xBB');
|