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/lib/ButtonToolbar.js
CHANGED
|
@@ -32,20 +32,20 @@ var _react2 = _interopRequireDefault(_react);
|
|
|
32
32
|
|
|
33
33
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
34
34
|
|
|
35
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
36
|
|
|
37
37
|
var ButtonToolbar = function (_React$Component) {
|
|
38
|
-
(0, _inherits3
|
|
38
|
+
(0, _inherits3.default)(ButtonToolbar, _React$Component);
|
|
39
39
|
|
|
40
40
|
function ButtonToolbar() {
|
|
41
|
-
(0, _classCallCheck3
|
|
42
|
-
return (0, _possibleConstructorReturn3
|
|
41
|
+
(0, _classCallCheck3.default)(this, ButtonToolbar);
|
|
42
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
ButtonToolbar.prototype.render = function render() {
|
|
46
46
|
var _props = this.props,
|
|
47
47
|
className = _props.className,
|
|
48
|
-
props = (0, _objectWithoutProperties3
|
|
48
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['className']);
|
|
49
49
|
|
|
50
50
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
51
51
|
bsProps = _splitBsProps[0],
|
|
@@ -53,14 +53,14 @@ var ButtonToolbar = function (_React$Component) {
|
|
|
53
53
|
|
|
54
54
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
55
55
|
|
|
56
|
-
return _react2
|
|
56
|
+
return _react2.default.createElement('div', (0, _extends3.default)({}, elementProps, {
|
|
57
57
|
role: 'toolbar',
|
|
58
|
-
className: (0, _classnames2
|
|
58
|
+
className: (0, _classnames2.default)(className, classes)
|
|
59
59
|
}));
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
return ButtonToolbar;
|
|
63
|
-
}(_react2
|
|
63
|
+
}(_react2.default.Component);
|
|
64
64
|
|
|
65
|
-
exports
|
|
65
|
+
exports.default = (0, _bootstrapUtils.bsClass)('btn-toolbar', ButtonToolbar);
|
|
66
66
|
module.exports = exports['default'];
|
package/lib/Carousel.js
CHANGED
|
@@ -56,53 +56,53 @@ 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
|
*
|
|
79
79
|
* ```js
|
|
80
|
-
* (eventKey: any
|
|
80
|
+
* (eventKey: any, ?event: Object) => any
|
|
81
81
|
* ```
|
|
82
82
|
*
|
|
83
83
|
* If this callback takes two or more arguments, the second argument will
|
|
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
|
|
|
@@ -166,19 +170,37 @@ var Carousel = function (_React$Component) {
|
|
|
166
170
|
}
|
|
167
171
|
};
|
|
168
172
|
|
|
169
|
-
Carousel.prototype.componentDidMount = function componentDidMount() {
|
|
170
|
-
this.waitForNext();
|
|
171
|
-
};
|
|
172
|
-
|
|
173
173
|
Carousel.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
174
174
|
clearTimeout(this.timeout);
|
|
175
175
|
this.isUnmounted = true;
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
-
Carousel.prototype.
|
|
179
|
-
|
|
180
|
-
|
|
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;
|
|
181
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
|
+
});
|
|
182
204
|
};
|
|
183
205
|
|
|
184
206
|
Carousel.prototype.handleMouseOut = function handleMouseOut() {
|
|
@@ -187,22 +209,15 @@ var Carousel = function (_React$Component) {
|
|
|
187
209
|
}
|
|
188
210
|
};
|
|
189
211
|
|
|
190
|
-
Carousel.prototype.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (index < 0) {
|
|
194
|
-
if (!this.props.wrap) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
index = _ValidComponentChildren2['default'].count(this.props.children) - 1;
|
|
212
|
+
Carousel.prototype.handleMouseOver = function handleMouseOver() {
|
|
213
|
+
if (this.props.pauseOnHover) {
|
|
214
|
+
this.pause();
|
|
198
215
|
}
|
|
199
|
-
|
|
200
|
-
this.select(index, e, 'prev');
|
|
201
216
|
};
|
|
202
217
|
|
|
203
218
|
Carousel.prototype.handleNext = function handleNext(e) {
|
|
204
219
|
var index = this.getActiveIndex() + 1;
|
|
205
|
-
var count = _ValidComponentChildren2
|
|
220
|
+
var count = _ValidComponentChildren2.default.count(this.props.children);
|
|
206
221
|
|
|
207
222
|
if (index > count - 1) {
|
|
208
223
|
if (!this.props.wrap) {
|
|
@@ -214,32 +229,33 @@ var Carousel = function (_React$Component) {
|
|
|
214
229
|
this.select(index, e, 'next');
|
|
215
230
|
};
|
|
216
231
|
|
|
217
|
-
Carousel.prototype.
|
|
218
|
-
var
|
|
219
|
-
|
|
220
|
-
this.setState({
|
|
221
|
-
previousActiveIndex: null,
|
|
222
|
-
direction: null
|
|
223
|
-
}, function () {
|
|
224
|
-
_this2.waitForNext();
|
|
232
|
+
Carousel.prototype.handlePrev = function handlePrev(e) {
|
|
233
|
+
var index = this.getActiveIndex() - 1;
|
|
225
234
|
|
|
226
|
-
|
|
227
|
-
|
|
235
|
+
if (index < 0) {
|
|
236
|
+
if (!this.props.wrap) {
|
|
237
|
+
return;
|
|
228
238
|
}
|
|
229
|
-
|
|
239
|
+
index = _ValidComponentChildren2.default.count(this.props.children) - 1;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
this.select(index, e, 'prev');
|
|
230
243
|
};
|
|
231
244
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
245
|
+
// This might be a public API.
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
Carousel.prototype.pause = function pause() {
|
|
249
|
+
this.isPaused = true;
|
|
250
|
+
clearTimeout(this.timeout);
|
|
235
251
|
};
|
|
236
252
|
|
|
237
|
-
|
|
238
|
-
if (prevIndex === index) {
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
253
|
+
// This might be a public API.
|
|
241
254
|
|
|
242
|
-
|
|
255
|
+
|
|
256
|
+
Carousel.prototype.play = function play() {
|
|
257
|
+
this.isPaused = false;
|
|
258
|
+
this.waitForNext();
|
|
243
259
|
};
|
|
244
260
|
|
|
245
261
|
Carousel.prototype.select = function select(index, e, direction) {
|
|
@@ -304,48 +320,6 @@ var Carousel = function (_React$Component) {
|
|
|
304
320
|
}
|
|
305
321
|
};
|
|
306
322
|
|
|
307
|
-
// This might be a public API.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
Carousel.prototype.pause = function pause() {
|
|
311
|
-
this.isPaused = true;
|
|
312
|
-
clearTimeout(this.timeout);
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
// This might be a public API.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
Carousel.prototype.play = function play() {
|
|
319
|
-
this.isPaused = false;
|
|
320
|
-
this.waitForNext();
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
Carousel.prototype.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
|
|
324
|
-
var _this3 = this;
|
|
325
|
-
|
|
326
|
-
var indicators = [];
|
|
327
|
-
|
|
328
|
-
_ValidComponentChildren2['default'].forEach(children, function (child, index) {
|
|
329
|
-
indicators.push(_react2['default'].createElement('li', {
|
|
330
|
-
key: index,
|
|
331
|
-
className: index === activeIndex ? 'active' : null,
|
|
332
|
-
onClick: function onClick(e) {
|
|
333
|
-
return _this3.select(index, e);
|
|
334
|
-
}
|
|
335
|
-
}),
|
|
336
|
-
|
|
337
|
-
// Force whitespace between indicator elements. Bootstrap requires
|
|
338
|
-
// this for correct spacing of elements.
|
|
339
|
-
' ');
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
return _react2['default'].createElement(
|
|
343
|
-
'ol',
|
|
344
|
-
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'indicators') },
|
|
345
|
-
indicators
|
|
346
|
-
);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
323
|
Carousel.prototype.renderControls = function renderControls(properties) {
|
|
350
324
|
var wrap = properties.wrap,
|
|
351
325
|
children = properties.children,
|
|
@@ -357,30 +331,30 @@ var Carousel = function (_React$Component) {
|
|
|
357
331
|
nextLabel = properties.nextLabel;
|
|
358
332
|
|
|
359
333
|
var controlClassName = (0, _bootstrapUtils.prefix)(bsProps, 'control');
|
|
360
|
-
var count = _ValidComponentChildren2
|
|
334
|
+
var count = _ValidComponentChildren2.default.count(children);
|
|
361
335
|
|
|
362
|
-
return [(wrap || activeIndex !== 0) && _react2
|
|
363
|
-
_SafeAnchor2
|
|
336
|
+
return [(wrap || activeIndex !== 0) && _react2.default.createElement(
|
|
337
|
+
_SafeAnchor2.default,
|
|
364
338
|
{
|
|
365
339
|
key: 'prev',
|
|
366
|
-
className: (0, _classnames2
|
|
340
|
+
className: (0, _classnames2.default)(controlClassName, 'left'),
|
|
367
341
|
onClick: this.handlePrev
|
|
368
342
|
},
|
|
369
343
|
prevIcon,
|
|
370
|
-
prevLabel && _react2
|
|
344
|
+
prevLabel && _react2.default.createElement(
|
|
371
345
|
'span',
|
|
372
346
|
{ className: 'sr-only' },
|
|
373
347
|
prevLabel
|
|
374
348
|
)
|
|
375
|
-
), (wrap || activeIndex !== count - 1) && _react2
|
|
376
|
-
_SafeAnchor2
|
|
349
|
+
), (wrap || activeIndex !== count - 1) && _react2.default.createElement(
|
|
350
|
+
_SafeAnchor2.default,
|
|
377
351
|
{
|
|
378
352
|
key: 'next',
|
|
379
|
-
className: (0, _classnames2
|
|
353
|
+
className: (0, _classnames2.default)(controlClassName, 'right'),
|
|
380
354
|
onClick: this.handleNext
|
|
381
355
|
},
|
|
382
356
|
nextIcon,
|
|
383
|
-
nextLabel && _react2
|
|
357
|
+
nextLabel && _react2.default.createElement(
|
|
384
358
|
'span',
|
|
385
359
|
{ className: 'sr-only' },
|
|
386
360
|
nextLabel
|
|
@@ -388,6 +362,32 @@ var Carousel = function (_React$Component) {
|
|
|
388
362
|
)];
|
|
389
363
|
};
|
|
390
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
|
+
|
|
391
391
|
Carousel.prototype.render = function render() {
|
|
392
392
|
var _this4 = this;
|
|
393
393
|
|
|
@@ -402,7 +402,7 @@ var Carousel = function (_React$Component) {
|
|
|
402
402
|
nextLabel = _props2.nextLabel,
|
|
403
403
|
className = _props2.className,
|
|
404
404
|
children = _props2.children,
|
|
405
|
-
props = (0, _objectWithoutProperties3
|
|
405
|
+
props = (0, _objectWithoutProperties3.default)(_props2, ['slide', 'indicators', 'controls', 'wrap', 'prevIcon', 'prevLabel', 'nextIcon', 'nextLabel', 'className', 'children']);
|
|
406
406
|
var _state = this.state,
|
|
407
407
|
previousActiveIndex = _state.previousActiveIndex,
|
|
408
408
|
direction = _state.direction;
|
|
@@ -414,22 +414,22 @@ var Carousel = function (_React$Component) {
|
|
|
414
414
|
|
|
415
415
|
var activeIndex = this.getActiveIndex();
|
|
416
416
|
|
|
417
|
-
var classes = (0, _extends3
|
|
417
|
+
var classes = (0, _extends3.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), {
|
|
418
418
|
slide: slide
|
|
419
419
|
});
|
|
420
420
|
|
|
421
|
-
return _react2
|
|
421
|
+
return _react2.default.createElement(
|
|
422
422
|
'div',
|
|
423
|
-
(0, _extends3
|
|
424
|
-
className: (0, _classnames2
|
|
423
|
+
(0, _extends3.default)({}, elementProps, {
|
|
424
|
+
className: (0, _classnames2.default)(className, classes),
|
|
425
425
|
onMouseOver: this.handleMouseOver,
|
|
426
426
|
onMouseOut: this.handleMouseOut
|
|
427
427
|
}),
|
|
428
428
|
indicators && this.renderIndicators(children, activeIndex, bsProps),
|
|
429
|
-
_react2
|
|
429
|
+
_react2.default.createElement(
|
|
430
430
|
'div',
|
|
431
431
|
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'inner') },
|
|
432
|
-
_ValidComponentChildren2
|
|
432
|
+
_ValidComponentChildren2.default.map(children, function (child, index) {
|
|
433
433
|
var active = index === activeIndex;
|
|
434
434
|
var previousActive = slide && index === previousActiveIndex;
|
|
435
435
|
|
|
@@ -457,13 +457,13 @@ var Carousel = function (_React$Component) {
|
|
|
457
457
|
};
|
|
458
458
|
|
|
459
459
|
return Carousel;
|
|
460
|
-
}(_react2
|
|
460
|
+
}(_react2.default.Component);
|
|
461
461
|
|
|
462
462
|
Carousel.propTypes = propTypes;
|
|
463
463
|
Carousel.defaultProps = defaultProps;
|
|
464
464
|
|
|
465
|
-
Carousel.Caption = _CarouselCaption2
|
|
466
|
-
Carousel.Item = _CarouselItem2
|
|
465
|
+
Carousel.Caption = _CarouselCaption2.default;
|
|
466
|
+
Carousel.Item = _CarouselItem2.default;
|
|
467
467
|
|
|
468
|
-
exports
|
|
468
|
+
exports.default = (0, _bootstrapUtils.bsClass)('carousel', Carousel);
|
|
469
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,14 @@ var CarouselCaption = function (_React$Component) {
|
|
|
66
66
|
|
|
67
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
68
68
|
|
|
69
|
-
return _react2
|
|
70
|
-
className: (0, _classnames2['default'])(className, classes)
|
|
71
|
-
}));
|
|
69
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, { className: (0, _classnames2.default)(className, classes) }));
|
|
72
70
|
};
|
|
73
71
|
|
|
74
72
|
return CarouselCaption;
|
|
75
|
-
}(_react2
|
|
73
|
+
}(_react2.default.Component);
|
|
76
74
|
|
|
77
75
|
CarouselCaption.propTypes = propTypes;
|
|
78
76
|
CarouselCaption.defaultProps = defaultProps;
|
|
79
77
|
|
|
80
|
-
exports
|
|
78
|
+
exports.default = (0, _bootstrapUtils.bsClass)('carousel-caption', CarouselCaption);
|
|
81
79
|
module.exports = exports['default'];
|
package/lib/CarouselItem.js
CHANGED
|
@@ -38,22 +38,19 @@ var _reactDom = require('react-dom');
|
|
|
38
38
|
|
|
39
39
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _transition = require('dom-helpers/transition');
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _transition2 = _interopRequireDefault(_transition);
|
|
44
44
|
|
|
45
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
46
|
-
|
|
47
|
-
// TODO: This should use a timeout instead of TransitionEvents, or else just
|
|
48
|
-
// not wait until transition end to trigger continuing animations.
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
46
|
|
|
50
47
|
var propTypes = {
|
|
51
|
-
direction: _propTypes2
|
|
52
|
-
onAnimateOutEnd: _propTypes2
|
|
53
|
-
active: _propTypes2
|
|
54
|
-
animateIn: _propTypes2
|
|
55
|
-
animateOut: _propTypes2
|
|
56
|
-
index: _propTypes2
|
|
48
|
+
direction: _propTypes2.default.oneOf(['prev', 'next']),
|
|
49
|
+
onAnimateOutEnd: _propTypes2.default.func,
|
|
50
|
+
active: _propTypes2.default.bool,
|
|
51
|
+
animateIn: _propTypes2.default.bool,
|
|
52
|
+
animateOut: _propTypes2.default.bool,
|
|
53
|
+
index: _propTypes2.default.number
|
|
57
54
|
};
|
|
58
55
|
|
|
59
56
|
var defaultProps = {
|
|
@@ -63,12 +60,12 @@ var defaultProps = {
|
|
|
63
60
|
};
|
|
64
61
|
|
|
65
62
|
var CarouselItem = function (_React$Component) {
|
|
66
|
-
(0, _inherits3
|
|
63
|
+
(0, _inherits3.default)(CarouselItem, _React$Component);
|
|
67
64
|
|
|
68
65
|
function CarouselItem(props, context) {
|
|
69
|
-
(0, _classCallCheck3
|
|
66
|
+
(0, _classCallCheck3.default)(this, CarouselItem);
|
|
70
67
|
|
|
71
|
-
var _this = (0, _possibleConstructorReturn3
|
|
68
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
72
69
|
|
|
73
70
|
_this.handleAnimateOutEnd = _this.handleAnimateOutEnd.bind(_this);
|
|
74
71
|
|
|
@@ -94,7 +91,7 @@ var CarouselItem = function (_React$Component) {
|
|
|
94
91
|
var prevActive = prevProps.active;
|
|
95
92
|
|
|
96
93
|
if (!active && prevActive) {
|
|
97
|
-
|
|
94
|
+
_transition2.default.end(_reactDom2.default.findDOMNode(this), this.handleAnimateOutEnd);
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
if (active !== prevActive) {
|
|
@@ -135,7 +132,7 @@ var CarouselItem = function (_React$Component) {
|
|
|
135
132
|
animateIn = _props.animateIn,
|
|
136
133
|
animateOut = _props.animateOut,
|
|
137
134
|
className = _props.className,
|
|
138
|
-
props = (0, _objectWithoutProperties3
|
|
135
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['direction', 'active', 'animateIn', 'animateOut', 'className']);
|
|
139
136
|
|
|
140
137
|
|
|
141
138
|
delete props.onAnimateOutEnd;
|
|
@@ -152,16 +149,14 @@ var CarouselItem = function (_React$Component) {
|
|
|
152
149
|
classes[this.state.direction] = true;
|
|
153
150
|
}
|
|
154
151
|
|
|
155
|
-
return _react2
|
|
156
|
-
className: (0, _classnames2['default'])(className, classes)
|
|
157
|
-
}));
|
|
152
|
+
return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: (0, _classnames2.default)(className, classes) }));
|
|
158
153
|
};
|
|
159
154
|
|
|
160
155
|
return CarouselItem;
|
|
161
|
-
}(_react2
|
|
156
|
+
}(_react2.default.Component);
|
|
162
157
|
|
|
163
158
|
CarouselItem.propTypes = propTypes;
|
|
164
159
|
CarouselItem.defaultProps = defaultProps;
|
|
165
160
|
|
|
166
|
-
exports
|
|
161
|
+
exports.default = CarouselItem;
|
|
167
162
|
module.exports = exports['default'];
|