react-bootstrap 0.31.1 → 0.31.5
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 +53 -0
- package/dist/react-bootstrap.js +4811 -4179
- package/dist/react-bootstrap.min.js +9 -9
- package/dist/react-bootstrap.min.js.map +1 -1
- package/es/ButtonToolbar.js +2 -3
- package/es/Carousel.js +85 -77
- package/es/Checkbox.js +2 -0
- package/es/CloseButton.js +1 -1
- package/es/Collapse.js +18 -18
- package/es/Dropdown.js +50 -50
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +2 -2
- package/es/FormControl.js +1 -2
- package/es/MediaBody.js +15 -2
- package/es/Modal.js +23 -15
- package/es/Nav.js +44 -44
- package/es/Navbar.js +4 -4
- package/es/OverlayTrigger.js +39 -39
- package/es/Panel.js +44 -44
- package/es/Radio.js +2 -0
- package/es/SafeAnchor.js +15 -2
- package/es/TabContent.js +5 -5
- package/es/TabPane.js +16 -16
- package/es/Tabs.js +2 -2
- package/es/Thumbnail.js +2 -0
- package/es/ToggleButton.js +8 -0
- package/es/ToggleButtonGroup.js +11 -6
- package/es/index.js +4 -0
- package/es/utils/TransitionEvents.js +11 -10
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +2 -1
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -14
- package/lib/Badge.js +13 -13
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +13 -13
- package/lib/ButtonToolbar.js +9 -13
- package/lib/Carousel.js +127 -119
- package/lib/CarouselCaption.js +10 -10
- package/lib/CarouselItem.js +16 -16
- package/lib/Checkbox.js +21 -21
- package/lib/Clearfix.js +15 -15
- package/lib/CloseButton.js +12 -14
- package/lib/Col.js +30 -30
- package/lib/Collapse.js +47 -47
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +92 -92
- package/lib/DropdownButton.js +22 -22
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +20 -20
- package/lib/Form.js +12 -12
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +10 -10
- package/lib/FormGroup.js +15 -15
- package/lib/Glyphicon.js +11 -11
- package/lib/Grid.js +11 -11
- package/lib/HelpBlock.js +9 -9
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +11 -11
- package/lib/InputGroupAddon.js +9 -9
- package/lib/InputGroupButton.js +9 -9
- package/lib/Jumbotron.js +10 -10
- package/lib/Label.js +12 -12
- package/lib/ListGroup.js +16 -16
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +16 -16
- package/lib/MediaBody.js +29 -10
- package/lib/MediaHeading.js +10 -10
- package/lib/MediaLeft.js +11 -11
- package/lib/MediaList.js +9 -9
- package/lib/MediaListItem.js +9 -9
- package/lib/MediaRight.js +11 -11
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +73 -65
- package/lib/ModalBody.js +10 -10
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +10 -10
- package/lib/ModalHeader.js +17 -17
- package/lib/ModalTitle.js +10 -10
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +25 -25
- package/lib/NavItem.js +18 -18
- package/lib/Navbar.js +47 -47
- 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 -25
- package/lib/OverlayTrigger.js +75 -75
- package/lib/PageHeader.js +11 -11
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +14 -14
- package/lib/PagerItem.js +17 -17
- package/lib/Pagination.js +52 -52
- package/lib/PaginationButton.js +20 -20
- package/lib/Panel.js +76 -76
- package/lib/PanelGroup.js +18 -18
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +29 -29
- package/lib/Radio.js +21 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +10 -10
- package/lib/SafeAnchor.js +31 -16
- package/lib/SplitButton.js +26 -26
- package/lib/SplitToggle.js +8 -8
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +29 -29
- package/lib/TabPane.js +57 -57
- package/lib/Table.js +16 -16
- package/lib/Tabs.js +28 -28
- package/lib/Thumbnail.js +19 -19
- package/lib/ToggleButton.js +23 -16
- package/lib/ToggleButtonGroup.js +38 -26
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +9 -9
- package/lib/index.js +83 -73
- package/lib/utils/PropTypes.js +5 -5
- package/lib/utils/TransitionEvents.js +12 -11
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +11 -10
- 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 +20 -18
package/lib/ButtonToolbar.js
CHANGED
|
@@ -30,26 +30,22 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
-
var _Button = require('./Button');
|
|
34
|
-
|
|
35
|
-
var _Button2 = _interopRequireDefault(_Button);
|
|
36
|
-
|
|
37
33
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
34
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
36
|
|
|
41
37
|
var ButtonToolbar = function (_React$Component) {
|
|
42
|
-
(0, _inherits3
|
|
38
|
+
(0, _inherits3.default)(ButtonToolbar, _React$Component);
|
|
43
39
|
|
|
44
40
|
function ButtonToolbar() {
|
|
45
|
-
(0, _classCallCheck3
|
|
46
|
-
return (0, _possibleConstructorReturn3
|
|
41
|
+
(0, _classCallCheck3.default)(this, ButtonToolbar);
|
|
42
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
ButtonToolbar.prototype.render = function render() {
|
|
50
46
|
var _props = this.props,
|
|
51
47
|
className = _props.className,
|
|
52
|
-
props = (0, _objectWithoutProperties3
|
|
48
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['className']);
|
|
53
49
|
|
|
54
50
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
55
51
|
bsProps = _splitBsProps[0],
|
|
@@ -57,14 +53,14 @@ var ButtonToolbar = function (_React$Component) {
|
|
|
57
53
|
|
|
58
54
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
59
55
|
|
|
60
|
-
return _react2
|
|
56
|
+
return _react2.default.createElement('div', (0, _extends3.default)({}, elementProps, {
|
|
61
57
|
role: 'toolbar',
|
|
62
|
-
className: (0, _classnames2
|
|
58
|
+
className: (0, _classnames2.default)(className, classes)
|
|
63
59
|
}));
|
|
64
60
|
};
|
|
65
61
|
|
|
66
62
|
return ButtonToolbar;
|
|
67
|
-
}(_react2
|
|
63
|
+
}(_react2.default.Component);
|
|
68
64
|
|
|
69
|
-
exports
|
|
65
|
+
exports.default = (0, _bootstrapUtils.bsClass)('btn-toolbar', ButtonToolbar);
|
|
70
66
|
module.exports = exports['default'];
|
package/lib/Carousel.js
CHANGED
|
@@ -56,23 +56,23 @@ var _ValidComponentChildren = require('./utils/ValidComponentChildren');
|
|
|
56
56
|
|
|
57
57
|
var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
|
|
58
58
|
|
|
59
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
59
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
60
60
|
|
|
61
61
|
// TODO: `slide` should be `animate`.
|
|
62
62
|
|
|
63
63
|
// TODO: Use uncontrollable.
|
|
64
64
|
|
|
65
65
|
var propTypes = {
|
|
66
|
-
slide: _propTypes2
|
|
67
|
-
indicators: _propTypes2
|
|
66
|
+
slide: _propTypes2.default.bool,
|
|
67
|
+
indicators: _propTypes2.default.bool,
|
|
68
68
|
/**
|
|
69
69
|
* The amount of time to delay between automatically cycling an item.
|
|
70
70
|
* If `null`, carousel will not automatically cycle.
|
|
71
71
|
*/
|
|
72
|
-
interval: _propTypes2
|
|
73
|
-
controls: _propTypes2
|
|
74
|
-
pauseOnHover: _propTypes2
|
|
75
|
-
wrap: _propTypes2
|
|
72
|
+
interval: _propTypes2.default.number,
|
|
73
|
+
controls: _propTypes2.default.bool,
|
|
74
|
+
pauseOnHover: _propTypes2.default.bool,
|
|
75
|
+
wrap: _propTypes2.default.bool,
|
|
76
76
|
/**
|
|
77
77
|
* Callback fired when the active item changes.
|
|
78
78
|
*
|
|
@@ -84,25 +84,25 @@ var propTypes = {
|
|
|
84
84
|
* be a persisted event object with `direction` set to the direction of the
|
|
85
85
|
* transition.
|
|
86
86
|
*/
|
|
87
|
-
onSelect: _propTypes2
|
|
88
|
-
onSlideEnd: _propTypes2
|
|
89
|
-
activeIndex: _propTypes2
|
|
90
|
-
defaultActiveIndex: _propTypes2
|
|
91
|
-
direction: _propTypes2
|
|
92
|
-
prevIcon: _propTypes2
|
|
87
|
+
onSelect: _propTypes2.default.func,
|
|
88
|
+
onSlideEnd: _propTypes2.default.func,
|
|
89
|
+
activeIndex: _propTypes2.default.number,
|
|
90
|
+
defaultActiveIndex: _propTypes2.default.number,
|
|
91
|
+
direction: _propTypes2.default.oneOf(['prev', 'next']),
|
|
92
|
+
prevIcon: _propTypes2.default.node,
|
|
93
93
|
/**
|
|
94
94
|
* Label shown to screen readers only, can be used to show the previous element
|
|
95
95
|
* in the carousel.
|
|
96
96
|
* Set to null to deactivate.
|
|
97
97
|
*/
|
|
98
|
-
prevLabel: _propTypes2
|
|
99
|
-
nextIcon: _propTypes2
|
|
98
|
+
prevLabel: _propTypes2.default.string,
|
|
99
|
+
nextIcon: _propTypes2.default.node,
|
|
100
100
|
/**
|
|
101
101
|
* Label shown to screen readers only, can be used to show the next element
|
|
102
102
|
* in the carousel.
|
|
103
103
|
* Set to null to deactivate.
|
|
104
104
|
*/
|
|
105
|
-
nextLabel: _propTypes2
|
|
105
|
+
nextLabel: _propTypes2.default.string
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
var defaultProps = {
|
|
@@ -112,19 +112,19 @@ var defaultProps = {
|
|
|
112
112
|
wrap: true,
|
|
113
113
|
indicators: true,
|
|
114
114
|
controls: true,
|
|
115
|
-
prevIcon: _react2
|
|
115
|
+
prevIcon: _react2.default.createElement(_Glyphicon2.default, { glyph: 'chevron-left' }),
|
|
116
116
|
prevLabel: 'Previous',
|
|
117
|
-
nextIcon: _react2
|
|
117
|
+
nextIcon: _react2.default.createElement(_Glyphicon2.default, { glyph: 'chevron-right' }),
|
|
118
118
|
nextLabel: 'Next'
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
var Carousel = function (_React$Component) {
|
|
122
|
-
(0, _inherits3
|
|
122
|
+
(0, _inherits3.default)(Carousel, _React$Component);
|
|
123
123
|
|
|
124
124
|
function Carousel(props, context) {
|
|
125
|
-
(0, _classCallCheck3
|
|
125
|
+
(0, _classCallCheck3.default)(this, Carousel);
|
|
126
126
|
|
|
127
|
-
var _this = (0, _possibleConstructorReturn3
|
|
127
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
128
128
|
|
|
129
129
|
_this.handleMouseOver = _this.handleMouseOver.bind(_this);
|
|
130
130
|
_this.handleMouseOut = _this.handleMouseOut.bind(_this);
|
|
@@ -145,6 +145,10 @@ var Carousel = function (_React$Component) {
|
|
|
145
145
|
return _this;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
Carousel.prototype.componentDidMount = function componentDidMount() {
|
|
149
|
+
this.waitForNext();
|
|
150
|
+
};
|
|
151
|
+
|
|
148
152
|
Carousel.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
149
153
|
var activeIndex = this.getActiveIndex();
|
|
150
154
|
|
|
@@ -156,10 +160,14 @@ var Carousel = function (_React$Component) {
|
|
|
156
160
|
direction: nextProps.direction != null ? nextProps.direction : this.getDirection(activeIndex, nextProps.activeIndex)
|
|
157
161
|
});
|
|
158
162
|
}
|
|
159
|
-
};
|
|
160
163
|
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
if (nextProps.activeIndex == null && this.state.activeIndex >= nextProps.children.length) {
|
|
165
|
+
this.setState({
|
|
166
|
+
activeIndex: 0,
|
|
167
|
+
previousActiveIndex: null,
|
|
168
|
+
direction: null
|
|
169
|
+
});
|
|
170
|
+
}
|
|
163
171
|
};
|
|
164
172
|
|
|
165
173
|
Carousel.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
@@ -167,10 +175,32 @@ var Carousel = function (_React$Component) {
|
|
|
167
175
|
this.isUnmounted = true;
|
|
168
176
|
};
|
|
169
177
|
|
|
170
|
-
Carousel.prototype.
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
Carousel.prototype.getActiveIndex = function getActiveIndex() {
|
|
179
|
+
var activeIndexProp = this.props.activeIndex;
|
|
180
|
+
return activeIndexProp != null ? activeIndexProp : this.state.activeIndex;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
Carousel.prototype.getDirection = function getDirection(prevIndex, index) {
|
|
184
|
+
if (prevIndex === index) {
|
|
185
|
+
return null;
|
|
173
186
|
}
|
|
187
|
+
|
|
188
|
+
return prevIndex > index ? 'prev' : 'next';
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
Carousel.prototype.handleItemAnimateOutEnd = function handleItemAnimateOutEnd() {
|
|
192
|
+
var _this2 = this;
|
|
193
|
+
|
|
194
|
+
this.setState({
|
|
195
|
+
previousActiveIndex: null,
|
|
196
|
+
direction: null
|
|
197
|
+
}, function () {
|
|
198
|
+
_this2.waitForNext();
|
|
199
|
+
|
|
200
|
+
if (_this2.props.onSlideEnd) {
|
|
201
|
+
_this2.props.onSlideEnd();
|
|
202
|
+
}
|
|
203
|
+
});
|
|
174
204
|
};
|
|
175
205
|
|
|
176
206
|
Carousel.prototype.handleMouseOut = function handleMouseOut() {
|
|
@@ -179,22 +209,15 @@ var Carousel = function (_React$Component) {
|
|
|
179
209
|
}
|
|
180
210
|
};
|
|
181
211
|
|
|
182
|
-
Carousel.prototype.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (index < 0) {
|
|
186
|
-
if (!this.props.wrap) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
index = _ValidComponentChildren2['default'].count(this.props.children) - 1;
|
|
212
|
+
Carousel.prototype.handleMouseOver = function handleMouseOver() {
|
|
213
|
+
if (this.props.pauseOnHover) {
|
|
214
|
+
this.pause();
|
|
190
215
|
}
|
|
191
|
-
|
|
192
|
-
this.select(index, e, 'prev');
|
|
193
216
|
};
|
|
194
217
|
|
|
195
218
|
Carousel.prototype.handleNext = function handleNext(e) {
|
|
196
219
|
var index = this.getActiveIndex() + 1;
|
|
197
|
-
var count = _ValidComponentChildren2
|
|
220
|
+
var count = _ValidComponentChildren2.default.count(this.props.children);
|
|
198
221
|
|
|
199
222
|
if (index > count - 1) {
|
|
200
223
|
if (!this.props.wrap) {
|
|
@@ -206,32 +229,33 @@ var Carousel = function (_React$Component) {
|
|
|
206
229
|
this.select(index, e, 'next');
|
|
207
230
|
};
|
|
208
231
|
|
|
209
|
-
Carousel.prototype.
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
this.setState({
|
|
213
|
-
previousActiveIndex: null,
|
|
214
|
-
direction: null
|
|
215
|
-
}, function () {
|
|
216
|
-
_this2.waitForNext();
|
|
232
|
+
Carousel.prototype.handlePrev = function handlePrev(e) {
|
|
233
|
+
var index = this.getActiveIndex() - 1;
|
|
217
234
|
|
|
218
|
-
|
|
219
|
-
|
|
235
|
+
if (index < 0) {
|
|
236
|
+
if (!this.props.wrap) {
|
|
237
|
+
return;
|
|
220
238
|
}
|
|
221
|
-
|
|
239
|
+
index = _ValidComponentChildren2.default.count(this.props.children) - 1;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
this.select(index, e, 'prev');
|
|
222
243
|
};
|
|
223
244
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
245
|
+
// This might be a public API.
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
Carousel.prototype.pause = function pause() {
|
|
249
|
+
this.isPaused = true;
|
|
250
|
+
clearTimeout(this.timeout);
|
|
227
251
|
};
|
|
228
252
|
|
|
229
|
-
|
|
230
|
-
if (prevIndex === index) {
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
253
|
+
// This might be a public API.
|
|
233
254
|
|
|
234
|
-
|
|
255
|
+
|
|
256
|
+
Carousel.prototype.play = function play() {
|
|
257
|
+
this.isPaused = false;
|
|
258
|
+
this.waitForNext();
|
|
235
259
|
};
|
|
236
260
|
|
|
237
261
|
Carousel.prototype.select = function select(index, e, direction) {
|
|
@@ -296,48 +320,6 @@ var Carousel = function (_React$Component) {
|
|
|
296
320
|
}
|
|
297
321
|
};
|
|
298
322
|
|
|
299
|
-
// This might be a public API.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
Carousel.prototype.pause = function pause() {
|
|
303
|
-
this.isPaused = true;
|
|
304
|
-
clearTimeout(this.timeout);
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
// This might be a public API.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
Carousel.prototype.play = function play() {
|
|
311
|
-
this.isPaused = false;
|
|
312
|
-
this.waitForNext();
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
Carousel.prototype.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
|
|
316
|
-
var _this3 = this;
|
|
317
|
-
|
|
318
|
-
var indicators = [];
|
|
319
|
-
|
|
320
|
-
_ValidComponentChildren2['default'].forEach(children, function (child, index) {
|
|
321
|
-
indicators.push(_react2['default'].createElement('li', {
|
|
322
|
-
key: index,
|
|
323
|
-
className: index === activeIndex ? 'active' : null,
|
|
324
|
-
onClick: function onClick(e) {
|
|
325
|
-
return _this3.select(index, e);
|
|
326
|
-
}
|
|
327
|
-
}),
|
|
328
|
-
|
|
329
|
-
// Force whitespace between indicator elements. Bootstrap requires
|
|
330
|
-
// this for correct spacing of elements.
|
|
331
|
-
' ');
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
return _react2['default'].createElement(
|
|
335
|
-
'ol',
|
|
336
|
-
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'indicators') },
|
|
337
|
-
indicators
|
|
338
|
-
);
|
|
339
|
-
};
|
|
340
|
-
|
|
341
323
|
Carousel.prototype.renderControls = function renderControls(properties) {
|
|
342
324
|
var wrap = properties.wrap,
|
|
343
325
|
children = properties.children,
|
|
@@ -349,30 +331,30 @@ var Carousel = function (_React$Component) {
|
|
|
349
331
|
nextLabel = properties.nextLabel;
|
|
350
332
|
|
|
351
333
|
var controlClassName = (0, _bootstrapUtils.prefix)(bsProps, 'control');
|
|
352
|
-
var count = _ValidComponentChildren2
|
|
334
|
+
var count = _ValidComponentChildren2.default.count(children);
|
|
353
335
|
|
|
354
|
-
return [(wrap || activeIndex !== 0) && _react2
|
|
355
|
-
_SafeAnchor2
|
|
336
|
+
return [(wrap || activeIndex !== 0) && _react2.default.createElement(
|
|
337
|
+
_SafeAnchor2.default,
|
|
356
338
|
{
|
|
357
339
|
key: 'prev',
|
|
358
|
-
className: (0, _classnames2
|
|
340
|
+
className: (0, _classnames2.default)(controlClassName, 'left'),
|
|
359
341
|
onClick: this.handlePrev
|
|
360
342
|
},
|
|
361
343
|
prevIcon,
|
|
362
|
-
prevLabel && _react2
|
|
344
|
+
prevLabel && _react2.default.createElement(
|
|
363
345
|
'span',
|
|
364
346
|
{ className: 'sr-only' },
|
|
365
347
|
prevLabel
|
|
366
348
|
)
|
|
367
|
-
), (wrap || activeIndex !== count - 1) && _react2
|
|
368
|
-
_SafeAnchor2
|
|
349
|
+
), (wrap || activeIndex !== count - 1) && _react2.default.createElement(
|
|
350
|
+
_SafeAnchor2.default,
|
|
369
351
|
{
|
|
370
352
|
key: 'next',
|
|
371
|
-
className: (0, _classnames2
|
|
353
|
+
className: (0, _classnames2.default)(controlClassName, 'right'),
|
|
372
354
|
onClick: this.handleNext
|
|
373
355
|
},
|
|
374
356
|
nextIcon,
|
|
375
|
-
nextLabel && _react2
|
|
357
|
+
nextLabel && _react2.default.createElement(
|
|
376
358
|
'span',
|
|
377
359
|
{ className: 'sr-only' },
|
|
378
360
|
nextLabel
|
|
@@ -380,6 +362,32 @@ var Carousel = function (_React$Component) {
|
|
|
380
362
|
)];
|
|
381
363
|
};
|
|
382
364
|
|
|
365
|
+
Carousel.prototype.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
|
|
366
|
+
var _this3 = this;
|
|
367
|
+
|
|
368
|
+
var indicators = [];
|
|
369
|
+
|
|
370
|
+
_ValidComponentChildren2.default.forEach(children, function (child, index) {
|
|
371
|
+
indicators.push(_react2.default.createElement('li', {
|
|
372
|
+
key: index,
|
|
373
|
+
className: index === activeIndex ? 'active' : null,
|
|
374
|
+
onClick: function onClick(e) {
|
|
375
|
+
return _this3.select(index, e);
|
|
376
|
+
}
|
|
377
|
+
}),
|
|
378
|
+
|
|
379
|
+
// Force whitespace between indicator elements. Bootstrap requires
|
|
380
|
+
// this for correct spacing of elements.
|
|
381
|
+
' ');
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
return _react2.default.createElement(
|
|
385
|
+
'ol',
|
|
386
|
+
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'indicators') },
|
|
387
|
+
indicators
|
|
388
|
+
);
|
|
389
|
+
};
|
|
390
|
+
|
|
383
391
|
Carousel.prototype.render = function render() {
|
|
384
392
|
var _this4 = this;
|
|
385
393
|
|
|
@@ -394,7 +402,7 @@ var Carousel = function (_React$Component) {
|
|
|
394
402
|
nextLabel = _props2.nextLabel,
|
|
395
403
|
className = _props2.className,
|
|
396
404
|
children = _props2.children,
|
|
397
|
-
props = (0, _objectWithoutProperties3
|
|
405
|
+
props = (0, _objectWithoutProperties3.default)(_props2, ['slide', 'indicators', 'controls', 'wrap', 'prevIcon', 'prevLabel', 'nextIcon', 'nextLabel', 'className', 'children']);
|
|
398
406
|
var _state = this.state,
|
|
399
407
|
previousActiveIndex = _state.previousActiveIndex,
|
|
400
408
|
direction = _state.direction;
|
|
@@ -406,22 +414,22 @@ var Carousel = function (_React$Component) {
|
|
|
406
414
|
|
|
407
415
|
var activeIndex = this.getActiveIndex();
|
|
408
416
|
|
|
409
|
-
var classes = (0, _extends3
|
|
417
|
+
var classes = (0, _extends3.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), {
|
|
410
418
|
slide: slide
|
|
411
419
|
});
|
|
412
420
|
|
|
413
|
-
return _react2
|
|
421
|
+
return _react2.default.createElement(
|
|
414
422
|
'div',
|
|
415
|
-
(0, _extends3
|
|
416
|
-
className: (0, _classnames2
|
|
423
|
+
(0, _extends3.default)({}, elementProps, {
|
|
424
|
+
className: (0, _classnames2.default)(className, classes),
|
|
417
425
|
onMouseOver: this.handleMouseOver,
|
|
418
426
|
onMouseOut: this.handleMouseOut
|
|
419
427
|
}),
|
|
420
428
|
indicators && this.renderIndicators(children, activeIndex, bsProps),
|
|
421
|
-
_react2
|
|
429
|
+
_react2.default.createElement(
|
|
422
430
|
'div',
|
|
423
431
|
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'inner') },
|
|
424
|
-
_ValidComponentChildren2
|
|
432
|
+
_ValidComponentChildren2.default.map(children, function (child, index) {
|
|
425
433
|
var active = index === activeIndex;
|
|
426
434
|
var previousActive = slide && index === previousActiveIndex;
|
|
427
435
|
|
|
@@ -449,13 +457,13 @@ var Carousel = function (_React$Component) {
|
|
|
449
457
|
};
|
|
450
458
|
|
|
451
459
|
return Carousel;
|
|
452
|
-
}(_react2
|
|
460
|
+
}(_react2.default.Component);
|
|
453
461
|
|
|
454
462
|
Carousel.propTypes = propTypes;
|
|
455
463
|
Carousel.defaultProps = defaultProps;
|
|
456
464
|
|
|
457
|
-
Carousel.Caption = _CarouselCaption2
|
|
458
|
-
Carousel.Item = _CarouselItem2
|
|
465
|
+
Carousel.Caption = _CarouselCaption2.default;
|
|
466
|
+
Carousel.Item = _CarouselItem2.default;
|
|
459
467
|
|
|
460
|
-
exports
|
|
468
|
+
exports.default = (0, _bootstrapUtils.bsClass)('carousel', Carousel);
|
|
461
469
|
module.exports = exports['default'];
|
package/lib/CarouselCaption.js
CHANGED
|
@@ -36,10 +36,10 @@ var _elementType2 = _interopRequireDefault(_elementType);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var propTypes = {
|
|
42
|
-
componentClass: _elementType2
|
|
42
|
+
componentClass: _elementType2.default
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
var defaultProps = {
|
|
@@ -47,18 +47,18 @@ var defaultProps = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
var CarouselCaption = function (_React$Component) {
|
|
50
|
-
(0, _inherits3
|
|
50
|
+
(0, _inherits3.default)(CarouselCaption, _React$Component);
|
|
51
51
|
|
|
52
52
|
function CarouselCaption() {
|
|
53
|
-
(0, _classCallCheck3
|
|
54
|
-
return (0, _possibleConstructorReturn3
|
|
53
|
+
(0, _classCallCheck3.default)(this, CarouselCaption);
|
|
54
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
CarouselCaption.prototype.render = function render() {
|
|
58
58
|
var _props = this.props,
|
|
59
59
|
Component = _props.componentClass,
|
|
60
60
|
className = _props.className,
|
|
61
|
-
props = (0, _objectWithoutProperties3
|
|
61
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'className']);
|
|
62
62
|
|
|
63
63
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
64
64
|
bsProps = _splitBsProps[0],
|
|
@@ -66,16 +66,16 @@ var CarouselCaption = function (_React$Component) {
|
|
|
66
66
|
|
|
67
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
68
68
|
|
|
69
|
-
return _react2
|
|
70
|
-
className: (0, _classnames2
|
|
69
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, {
|
|
70
|
+
className: (0, _classnames2.default)(className, classes)
|
|
71
71
|
}));
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
return CarouselCaption;
|
|
75
|
-
}(_react2
|
|
75
|
+
}(_react2.default.Component);
|
|
76
76
|
|
|
77
77
|
CarouselCaption.propTypes = propTypes;
|
|
78
78
|
CarouselCaption.defaultProps = defaultProps;
|
|
79
79
|
|
|
80
|
-
exports
|
|
80
|
+
exports.default = (0, _bootstrapUtils.bsClass)('carousel-caption', CarouselCaption);
|
|
81
81
|
module.exports = exports['default'];
|
package/lib/CarouselItem.js
CHANGED
|
@@ -42,18 +42,18 @@ var _TransitionEvents = require('./utils/TransitionEvents');
|
|
|
42
42
|
|
|
43
43
|
var _TransitionEvents2 = _interopRequireDefault(_TransitionEvents);
|
|
44
44
|
|
|
45
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
46
|
|
|
47
47
|
// TODO: This should use a timeout instead of TransitionEvents, or else just
|
|
48
48
|
// not wait until transition end to trigger continuing animations.
|
|
49
49
|
|
|
50
50
|
var propTypes = {
|
|
51
|
-
direction: _propTypes2
|
|
52
|
-
onAnimateOutEnd: _propTypes2
|
|
53
|
-
active: _propTypes2
|
|
54
|
-
animateIn: _propTypes2
|
|
55
|
-
animateOut: _propTypes2
|
|
56
|
-
index: _propTypes2
|
|
51
|
+
direction: _propTypes2.default.oneOf(['prev', 'next']),
|
|
52
|
+
onAnimateOutEnd: _propTypes2.default.func,
|
|
53
|
+
active: _propTypes2.default.bool,
|
|
54
|
+
animateIn: _propTypes2.default.bool,
|
|
55
|
+
animateOut: _propTypes2.default.bool,
|
|
56
|
+
index: _propTypes2.default.number
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
var defaultProps = {
|
|
@@ -63,12 +63,12 @@ var defaultProps = {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
var CarouselItem = function (_React$Component) {
|
|
66
|
-
(0, _inherits3
|
|
66
|
+
(0, _inherits3.default)(CarouselItem, _React$Component);
|
|
67
67
|
|
|
68
68
|
function CarouselItem(props, context) {
|
|
69
|
-
(0, _classCallCheck3
|
|
69
|
+
(0, _classCallCheck3.default)(this, CarouselItem);
|
|
70
70
|
|
|
71
|
-
var _this = (0, _possibleConstructorReturn3
|
|
71
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
72
72
|
|
|
73
73
|
_this.handleAnimateOutEnd = _this.handleAnimateOutEnd.bind(_this);
|
|
74
74
|
|
|
@@ -94,7 +94,7 @@ var CarouselItem = function (_React$Component) {
|
|
|
94
94
|
var prevActive = prevProps.active;
|
|
95
95
|
|
|
96
96
|
if (!active && prevActive) {
|
|
97
|
-
_TransitionEvents2
|
|
97
|
+
_TransitionEvents2.default.addEndEventListener(_reactDom2.default.findDOMNode(this), this.handleAnimateOutEnd);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
if (active !== prevActive) {
|
|
@@ -135,7 +135,7 @@ var CarouselItem = function (_React$Component) {
|
|
|
135
135
|
animateIn = _props.animateIn,
|
|
136
136
|
animateOut = _props.animateOut,
|
|
137
137
|
className = _props.className,
|
|
138
|
-
props = (0, _objectWithoutProperties3
|
|
138
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['direction', 'active', 'animateIn', 'animateOut', 'className']);
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
delete props.onAnimateOutEnd;
|
|
@@ -152,16 +152,16 @@ var CarouselItem = function (_React$Component) {
|
|
|
152
152
|
classes[this.state.direction] = true;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
return _react2
|
|
156
|
-
className: (0, _classnames2
|
|
155
|
+
return _react2.default.createElement('div', (0, _extends3.default)({}, props, {
|
|
156
|
+
className: (0, _classnames2.default)(className, classes)
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
return CarouselItem;
|
|
161
|
-
}(_react2
|
|
161
|
+
}(_react2.default.Component);
|
|
162
162
|
|
|
163
163
|
CarouselItem.propTypes = propTypes;
|
|
164
164
|
CarouselItem.defaultProps = defaultProps;
|
|
165
165
|
|
|
166
|
-
exports
|
|
166
|
+
exports.default = CarouselItem;
|
|
167
167
|
module.exports = exports['default'];
|