react-bootstrap 0.32.0 → 0.32.4

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.
Files changed (213) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +11 -7
  3. package/dist/react-bootstrap.js +13464 -13723
  4. package/dist/react-bootstrap.min.js +10 -18464
  5. package/es/Accordion.js +13 -16
  6. package/es/Alert.js +26 -31
  7. package/es/Badge.js +21 -31
  8. package/es/Breadcrumb.js +17 -20
  9. package/es/BreadcrumbItem.js +30 -30
  10. package/es/Button.js +23 -27
  11. package/es/ButtonGroup.js +20 -22
  12. package/es/ButtonToolbar.js +16 -18
  13. package/es/Carousel.js +120 -157
  14. package/es/CarouselCaption.js +18 -21
  15. package/es/CarouselItem.js +34 -33
  16. package/es/Checkbox.js +43 -54
  17. package/es/Clearfix.js +24 -24
  18. package/es/CloseButton.js +21 -30
  19. package/es/Col.js +42 -26
  20. package/es/Collapse.js +68 -68
  21. package/es/ControlLabel.js +19 -24
  22. package/es/Dropdown.js +93 -91
  23. package/es/DropdownButton.js +25 -35
  24. package/es/DropdownMenu.js +65 -65
  25. package/es/DropdownToggle.js +28 -40
  26. package/es/Fade.js +26 -29
  27. package/es/Form.js +22 -22
  28. package/es/FormControl.js +32 -33
  29. package/es/FormControlFeedback.js +21 -21
  30. package/es/FormControlStatic.js +18 -21
  31. package/es/FormGroup.js +27 -34
  32. package/es/Glyphicon.js +18 -19
  33. package/es/Grid.js +20 -22
  34. package/es/HelpBlock.js +17 -17
  35. package/es/Image.js +19 -24
  36. package/es/InputGroup.js +17 -18
  37. package/es/InputGroupAddon.js +17 -17
  38. package/es/InputGroupButton.js +17 -17
  39. package/es/Jumbotron.js +18 -21
  40. package/es/Label.js +21 -27
  41. package/es/ListGroup.js +24 -29
  42. package/es/ListGroupItem.js +30 -48
  43. package/es/Media.js +18 -22
  44. package/es/MediaBody.js +19 -22
  45. package/es/MediaHeading.js +18 -21
  46. package/es/MediaLeft.js +18 -19
  47. package/es/MediaList.js +17 -17
  48. package/es/MediaListItem.js +17 -17
  49. package/es/MediaRight.js +18 -19
  50. package/es/MenuItem.js +44 -49
  51. package/es/Modal.js +63 -74
  52. package/es/ModalBody.js +18 -21
  53. package/es/ModalDialog.js +31 -39
  54. package/es/ModalFooter.js +18 -21
  55. package/es/ModalHeader.js +25 -35
  56. package/es/ModalTitle.js +18 -21
  57. package/es/Nav.js +73 -92
  58. package/es/NavDropdown.js +40 -52
  59. package/es/NavItem.js +34 -38
  60. package/es/Navbar.js +62 -73
  61. package/es/NavbarBrand.js +20 -24
  62. package/es/NavbarCollapse.js +21 -28
  63. package/es/NavbarHeader.js +19 -20
  64. package/es/NavbarToggle.js +30 -38
  65. package/es/Overlay.js +21 -25
  66. package/es/OverlayTrigger.js +71 -68
  67. package/es/PageHeader.js +18 -26
  68. package/es/PageItem.js +0 -1
  69. package/es/Pager.js +23 -30
  70. package/es/PagerItem.js +36 -40
  71. package/es/Pagination.js +18 -24
  72. package/es/PaginationItem.js +47 -57
  73. package/es/Panel.js +51 -54
  74. package/es/PanelBody.js +18 -29
  75. package/es/PanelCollapse.js +20 -23
  76. package/es/PanelFooter.js +16 -23
  77. package/es/PanelGroup.js +44 -45
  78. package/es/PanelHeading.js +19 -28
  79. package/es/PanelTitle.js +22 -34
  80. package/es/PanelToggle.js +21 -24
  81. package/es/Popover.js +36 -46
  82. package/es/ProgressBar.js +59 -62
  83. package/es/Radio.js +43 -54
  84. package/es/ResponsiveEmbed.js +27 -32
  85. package/es/Row.js +18 -21
  86. package/es/SafeAnchor.js +32 -32
  87. package/es/SplitButton.js +33 -46
  88. package/es/SplitToggle.js +14 -13
  89. package/es/Tab.js +12 -18
  90. package/es/TabContainer.js +24 -30
  91. package/es/TabContent.js +36 -43
  92. package/es/TabPane.js +58 -68
  93. package/es/Table.js +25 -29
  94. package/es/Tabs.js +56 -71
  95. package/es/Thumbnail.js +34 -34
  96. package/es/ToggleButton.js +32 -37
  97. package/es/ToggleButtonGroup.js +45 -57
  98. package/es/Tooltip.js +33 -40
  99. package/es/Well.js +17 -17
  100. package/es/index.js +2 -0
  101. package/es/utils/PropTypes.js +13 -19
  102. package/es/utils/StyleConfig.js +0 -4
  103. package/es/utils/ValidComponentChildren.js +11 -20
  104. package/es/utils/bootstrapUtils.js +17 -31
  105. package/es/utils/createChainedFunction.js +2 -2
  106. package/es/utils/deprecationWarning.js +28 -30
  107. package/es/utils/splitComponentProps.js +1 -2
  108. package/lib/Accordion.js +23 -36
  109. package/lib/Alert.js +43 -65
  110. package/lib/Badge.js +36 -56
  111. package/lib/Breadcrumb.js +32 -47
  112. package/lib/BreadcrumbItem.js +48 -63
  113. package/lib/Button.js +49 -71
  114. package/lib/ButtonGroup.js +39 -57
  115. package/lib/ButtonToolbar.js +29 -42
  116. package/lib/Carousel.js +161 -214
  117. package/lib/CarouselCaption.js +32 -46
  118. package/lib/CarouselItem.js +54 -73
  119. package/lib/Checkbox.js +64 -87
  120. package/lib/Clearfix.js +45 -58
  121. package/lib/CloseButton.js +33 -50
  122. package/lib/Col.js +78 -73
  123. package/lib/Collapse.js +104 -125
  124. package/lib/ControlLabel.js +38 -59
  125. package/lib/Dropdown.js +153 -192
  126. package/lib/DropdownButton.js +44 -70
  127. package/lib/DropdownMenu.js +96 -120
  128. package/lib/DropdownToggle.js +48 -77
  129. package/lib/Fade.js +49 -68
  130. package/lib/Form.js +39 -52
  131. package/lib/FormControl.js +58 -79
  132. package/lib/FormControlFeedback.js +42 -54
  133. package/lib/FormControlStatic.js +32 -46
  134. package/lib/FormGroup.js +47 -67
  135. package/lib/Glyphicon.js +33 -46
  136. package/lib/Grid.js +36 -51
  137. package/lib/HelpBlock.js +29 -40
  138. package/lib/Image.js +37 -53
  139. package/lib/InputGroup.js +34 -49
  140. package/lib/InputGroupAddon.js +29 -40
  141. package/lib/InputGroupButton.js +29 -40
  142. package/lib/Jumbotron.js +32 -46
  143. package/lib/Label.js +35 -53
  144. package/lib/ListGroup.js +45 -61
  145. package/lib/ListGroupItem.js +55 -85
  146. package/lib/Media.js +43 -70
  147. package/lib/MediaBody.js +37 -55
  148. package/lib/MediaHeading.js +32 -46
  149. package/lib/MediaLeft.js +34 -48
  150. package/lib/MediaList.js +29 -40
  151. package/lib/MediaListItem.js +29 -40
  152. package/lib/MediaRight.js +34 -48
  153. package/lib/MenuItem.js +70 -92
  154. package/lib/Modal.js +130 -186
  155. package/lib/ModalBody.js +32 -46
  156. package/lib/ModalDialog.js +47 -69
  157. package/lib/ModalFooter.js +32 -46
  158. package/lib/ModalHeader.js +43 -70
  159. package/lib/ModalTitle.js +32 -46
  160. package/lib/Nav.js +122 -160
  161. package/lib/NavDropdown.js +63 -97
  162. package/lib/NavItem.js +54 -77
  163. package/lib/Navbar.js +115 -152
  164. package/lib/NavbarBrand.js +37 -55
  165. package/lib/NavbarCollapse.js +36 -57
  166. package/lib/NavbarHeader.js +33 -48
  167. package/lib/NavbarToggle.js +52 -77
  168. package/lib/Overlay.js +50 -75
  169. package/lib/OverlayTrigger.js +114 -129
  170. package/lib/PageHeader.js +30 -49
  171. package/lib/PageItem.js +9 -10
  172. package/lib/Pager.js +41 -63
  173. package/lib/PagerItem.js +55 -78
  174. package/lib/Pagination.js +32 -50
  175. package/lib/PaginationItem.js +67 -91
  176. package/lib/Panel.js +93 -127
  177. package/lib/PanelBody.js +35 -57
  178. package/lib/PanelCollapse.js +44 -56
  179. package/lib/PanelFooter.js +31 -48
  180. package/lib/PanelGroup.js +73 -88
  181. package/lib/PanelHeading.js +37 -59
  182. package/lib/PanelTitle.js +41 -68
  183. package/lib/PanelToggle.js +45 -66
  184. package/lib/Popover.js +59 -84
  185. package/lib/ProgressBar.js +86 -103
  186. package/lib/Radio.js +64 -87
  187. package/lib/ResponsiveEmbed.js +45 -63
  188. package/lib/Row.js +32 -46
  189. package/lib/SafeAnchor.js +53 -69
  190. package/lib/SplitButton.js +57 -90
  191. package/lib/SplitToggle.js +25 -34
  192. package/lib/Tab.js +32 -55
  193. package/lib/TabContainer.js +45 -61
  194. package/lib/TabContent.js +67 -87
  195. package/lib/TabPane.js +103 -131
  196. package/lib/Table.js +44 -59
  197. package/lib/Tabs.js +82 -119
  198. package/lib/Thumbnail.js +55 -67
  199. package/lib/ToggleButton.js +49 -68
  200. package/lib/ToggleButtonGroup.js +67 -104
  201. package/lib/Tooltip.js +55 -77
  202. package/lib/Well.js +30 -41
  203. package/lib/index.js +147 -214
  204. package/lib/utils/PropTypes.js +24 -31
  205. package/lib/utils/StyleConfig.js +13 -11
  206. package/lib/utils/ValidComponentChildren.js +34 -29
  207. package/lib/utils/bootstrapUtils.js +41 -52
  208. package/lib/utils/capitalize.js +2 -0
  209. package/lib/utils/createChainedFunction.js +8 -5
  210. package/lib/utils/deprecationWarning.js +37 -47
  211. package/lib/utils/index.js +11 -15
  212. package/lib/utils/splitComponentProps.js +5 -10
  213. package/package.json +58 -50
package/lib/Carousel.js CHANGED
@@ -1,78 +1,53 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- exports.__esModule = true;
4
-
5
- var _extends2 = require('babel-runtime/helpers/extends');
6
-
7
- var _extends3 = _interopRequireDefault(_extends2);
8
-
9
- var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
10
-
11
- var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
12
-
13
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
14
-
15
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
16
-
17
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
18
-
19
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
20
-
21
- var _inherits2 = require('babel-runtime/helpers/inherits');
22
-
23
- var _inherits3 = _interopRequireDefault(_inherits2);
24
-
25
- var _classnames = require('classnames');
26
-
27
- var _classnames2 = _interopRequireDefault(_classnames);
3
+ var _interopRequireWildcard = require("@babel/runtime-corejs2/helpers/interopRequireWildcard");
28
4
 
29
- var _react = require('react');
5
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
30
6
 
31
- var _react2 = _interopRequireDefault(_react);
32
-
33
- var _propTypes = require('prop-types');
7
+ exports.__esModule = true;
8
+ exports.default = void 0;
34
9
 
35
- var _propTypes2 = _interopRequireDefault(_propTypes);
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));
36
11
 
37
- var _CarouselCaption = require('./CarouselCaption');
12
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutPropertiesLoose"));
38
13
 
39
- var _CarouselCaption2 = _interopRequireDefault(_CarouselCaption);
14
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inheritsLoose"));
40
15
 
41
- var _CarouselItem = require('./CarouselItem');
16
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
42
17
 
43
- var _CarouselItem2 = _interopRequireDefault(_CarouselItem);
18
+ var _classnames = _interopRequireDefault(require("classnames"));
44
19
 
45
- var _Glyphicon = require('./Glyphicon');
20
+ var _react = _interopRequireWildcard(require("react"));
46
21
 
47
- var _Glyphicon2 = _interopRequireDefault(_Glyphicon);
22
+ var _propTypes = _interopRequireDefault(require("prop-types"));
48
23
 
49
- var _SafeAnchor = require('./SafeAnchor');
24
+ var _CarouselCaption = _interopRequireDefault(require("./CarouselCaption"));
50
25
 
51
- var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
26
+ var _CarouselItem = _interopRequireDefault(require("./CarouselItem"));
52
27
 
53
- var _bootstrapUtils = require('./utils/bootstrapUtils');
28
+ var _Glyphicon = _interopRequireDefault(require("./Glyphicon"));
54
29
 
55
- var _ValidComponentChildren = require('./utils/ValidComponentChildren');
30
+ var _SafeAnchor = _interopRequireDefault(require("./SafeAnchor"));
56
31
 
57
- var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
32
+ var _bootstrapUtils = require("./utils/bootstrapUtils");
58
33
 
59
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
34
+ var _ValidComponentChildren = _interopRequireDefault(require("./utils/ValidComponentChildren"));
60
35
 
61
36
  // TODO: `slide` should be `animate`.
62
-
63
37
  // TODO: Use uncontrollable.
64
-
65
38
  var propTypes = {
66
- slide: _propTypes2.default.bool,
67
- indicators: _propTypes2.default.bool,
39
+ slide: _propTypes.default.bool,
40
+ indicators: _propTypes.default.bool,
41
+
68
42
  /**
69
43
  * The amount of time to delay between automatically cycling an item.
70
44
  * If `null`, carousel will not automatically cycle.
71
45
  */
72
- interval: _propTypes2.default.number,
73
- controls: _propTypes2.default.bool,
74
- pauseOnHover: _propTypes2.default.bool,
75
- wrap: _propTypes2.default.bool,
46
+ interval: _propTypes.default.number,
47
+ controls: _propTypes.default.bool,
48
+ pauseOnHover: _propTypes.default.bool,
49
+ wrap: _propTypes.default.bool,
50
+
76
51
  /**
77
52
  * Callback fired when the active item changes.
78
53
  *
@@ -84,27 +59,28 @@ var propTypes = {
84
59
  * be a persisted event object with `direction` set to the direction of the
85
60
  * transition.
86
61
  */
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,
62
+ onSelect: _propTypes.default.func,
63
+ onSlideEnd: _propTypes.default.func,
64
+ activeIndex: _propTypes.default.number,
65
+ defaultActiveIndex: _propTypes.default.number,
66
+ direction: _propTypes.default.oneOf(['prev', 'next']),
67
+ prevIcon: _propTypes.default.node,
68
+
93
69
  /**
94
70
  * Label shown to screen readers only, can be used to show the previous element
95
71
  * in the carousel.
96
72
  * Set to null to deactivate.
97
73
  */
98
- prevLabel: _propTypes2.default.string,
99
- nextIcon: _propTypes2.default.node,
74
+ prevLabel: _propTypes.default.string,
75
+ nextIcon: _propTypes.default.node,
76
+
100
77
  /**
101
78
  * Label shown to screen readers only, can be used to show the next element
102
79
  * in the carousel.
103
80
  * Set to null to deactivate.
104
81
  */
105
- nextLabel: _propTypes2.default.string
82
+ nextLabel: _propTypes.default.string
106
83
  };
107
-
108
84
  var defaultProps = {
109
85
  slide: true,
110
86
  interval: 5000,
@@ -112,49 +88,51 @@ var defaultProps = {
112
88
  wrap: true,
113
89
  indicators: true,
114
90
  controls: true,
115
- prevIcon: _react2.default.createElement(_Glyphicon2.default, { glyph: 'chevron-left' }),
91
+ prevIcon: _react.default.createElement(_Glyphicon.default, {
92
+ glyph: "chevron-left"
93
+ }),
116
94
  prevLabel: 'Previous',
117
- nextIcon: _react2.default.createElement(_Glyphicon2.default, { glyph: 'chevron-right' }),
95
+ nextIcon: _react.default.createElement(_Glyphicon.default, {
96
+ glyph: "chevron-right"
97
+ }),
118
98
  nextLabel: 'Next'
119
99
  };
120
100
 
121
- var Carousel = function (_React$Component) {
122
- (0, _inherits3.default)(Carousel, _React$Component);
101
+ var Carousel =
102
+ /*#__PURE__*/
103
+ function (_React$Component) {
104
+ (0, _inheritsLoose2.default)(Carousel, _React$Component);
123
105
 
124
106
  function Carousel(props, context) {
125
- (0, _classCallCheck3.default)(this, Carousel);
126
-
127
- var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
128
-
129
- _this.handleMouseOver = _this.handleMouseOver.bind(_this);
130
- _this.handleMouseOut = _this.handleMouseOut.bind(_this);
131
- _this.handlePrev = _this.handlePrev.bind(_this);
132
- _this.handleNext = _this.handleNext.bind(_this);
133
- _this.handleItemAnimateOutEnd = _this.handleItemAnimateOutEnd.bind(_this);
134
-
107
+ var _this;
108
+
109
+ _this = _React$Component.call(this, props, context) || this;
110
+ _this.handleMouseOver = _this.handleMouseOver.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
111
+ _this.handleMouseOut = _this.handleMouseOut.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
112
+ _this.handlePrev = _this.handlePrev.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
113
+ _this.handleNext = _this.handleNext.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
114
+ _this.handleItemAnimateOutEnd = _this.handleItemAnimateOutEnd.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
135
115
  var defaultActiveIndex = props.defaultActiveIndex;
136
-
137
-
138
116
  _this.state = {
139
117
  activeIndex: defaultActiveIndex != null ? defaultActiveIndex : 0,
140
118
  previousActiveIndex: null,
141
119
  direction: null
142
120
  };
143
-
144
121
  _this.isUnmounted = false;
145
122
  return _this;
146
123
  }
147
124
 
148
- Carousel.prototype.componentDidMount = function componentDidMount() {
125
+ var _proto = Carousel.prototype;
126
+
127
+ _proto.componentDidMount = function componentDidMount() {
149
128
  this.waitForNext();
150
129
  };
151
130
 
152
- Carousel.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
131
+ _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
153
132
  var activeIndex = this.getActiveIndex();
154
133
 
155
134
  if (nextProps.activeIndex != null && nextProps.activeIndex !== activeIndex) {
156
135
  clearTimeout(this.timeout);
157
-
158
136
  this.setState({
159
137
  previousActiveIndex: activeIndex,
160
138
  direction: nextProps.direction != null ? nextProps.direction : this.getDirection(activeIndex, nextProps.activeIndex)
@@ -170,17 +148,17 @@ var Carousel = function (_React$Component) {
170
148
  }
171
149
  };
172
150
 
173
- Carousel.prototype.componentWillUnmount = function componentWillUnmount() {
151
+ _proto.componentWillUnmount = function componentWillUnmount() {
174
152
  clearTimeout(this.timeout);
175
153
  this.isUnmounted = true;
176
154
  };
177
155
 
178
- Carousel.prototype.getActiveIndex = function getActiveIndex() {
156
+ _proto.getActiveIndex = function getActiveIndex() {
179
157
  var activeIndexProp = this.props.activeIndex;
180
158
  return activeIndexProp != null ? activeIndexProp : this.state.activeIndex;
181
159
  };
182
160
 
183
- Carousel.prototype.getDirection = function getDirection(prevIndex, index) {
161
+ _proto.getDirection = function getDirection(prevIndex, index) {
184
162
  if (prevIndex === index) {
185
163
  return null;
186
164
  }
@@ -188,7 +166,7 @@ var Carousel = function (_React$Component) {
188
166
  return prevIndex > index ? 'prev' : 'next';
189
167
  };
190
168
 
191
- Carousel.prototype.handleItemAnimateOutEnd = function handleItemAnimateOutEnd() {
169
+ _proto.handleItemAnimateOutEnd = function handleItemAnimateOutEnd() {
192
170
  var _this2 = this;
193
171
 
194
172
  this.setState({
@@ -203,76 +181,72 @@ var Carousel = function (_React$Component) {
203
181
  });
204
182
  };
205
183
 
206
- Carousel.prototype.handleMouseOut = function handleMouseOut() {
184
+ _proto.handleMouseOut = function handleMouseOut() {
207
185
  if (this.isPaused) {
208
186
  this.play();
209
187
  }
210
188
  };
211
189
 
212
- Carousel.prototype.handleMouseOver = function handleMouseOver() {
190
+ _proto.handleMouseOver = function handleMouseOver() {
213
191
  if (this.props.pauseOnHover) {
214
192
  this.pause();
215
193
  }
216
194
  };
217
195
 
218
- Carousel.prototype.handleNext = function handleNext(e) {
196
+ _proto.handleNext = function handleNext(e) {
219
197
  var index = this.getActiveIndex() + 1;
220
- var count = _ValidComponentChildren2.default.count(this.props.children);
198
+
199
+ var count = _ValidComponentChildren.default.count(this.props.children);
221
200
 
222
201
  if (index > count - 1) {
223
202
  if (!this.props.wrap) {
224
203
  return;
225
204
  }
205
+
226
206
  index = 0;
227
207
  }
228
208
 
229
209
  this.select(index, e, 'next');
230
210
  };
231
211
 
232
- Carousel.prototype.handlePrev = function handlePrev(e) {
212
+ _proto.handlePrev = function handlePrev(e) {
233
213
  var index = this.getActiveIndex() - 1;
234
214
 
235
215
  if (index < 0) {
236
216
  if (!this.props.wrap) {
237
217
  return;
238
218
  }
239
- index = _ValidComponentChildren2.default.count(this.props.children) - 1;
219
+
220
+ index = _ValidComponentChildren.default.count(this.props.children) - 1;
240
221
  }
241
222
 
242
223
  this.select(index, e, 'prev');
243
- };
224
+ }; // This might be a public API.
244
225
 
245
- // This might be a public API.
246
226
 
247
-
248
- Carousel.prototype.pause = function pause() {
227
+ _proto.pause = function pause() {
249
228
  this.isPaused = true;
250
229
  clearTimeout(this.timeout);
251
- };
252
-
253
- // This might be a public API.
230
+ }; // This might be a public API.
254
231
 
255
232
 
256
- Carousel.prototype.play = function play() {
233
+ _proto.play = function play() {
257
234
  this.isPaused = false;
258
235
  this.waitForNext();
259
236
  };
260
237
 
261
- Carousel.prototype.select = function select(index, e, direction) {
262
- clearTimeout(this.timeout);
263
-
264
- // TODO: Is this necessary? Seems like the only risk is if the component
238
+ _proto.select = function select(index, e, direction) {
239
+ clearTimeout(this.timeout); // TODO: Is this necessary? Seems like the only risk is if the component
265
240
  // unmounts while handleItemAnimateOutEnd fires.
241
+
266
242
  if (this.isUnmounted) {
267
243
  return;
268
244
  }
269
245
 
270
246
  var previousActiveIndex = this.props.slide ? this.getActiveIndex() : null;
271
247
  direction = direction || this.getDirection(previousActiveIndex, index);
272
-
273
248
  var onSelect = this.props.onSelect;
274
249
 
275
-
276
250
  if (onSelect) {
277
251
  if (onSelect.length > 1) {
278
252
  // React SyntheticEvents are pooled, so we need to remove this event
@@ -283,7 +257,9 @@ var Carousel = function (_React$Component) {
283
257
  e.persist();
284
258
  e.direction = direction;
285
259
  } else {
286
- e = { direction: direction };
260
+ e = {
261
+ direction: direction
262
+ };
287
263
  }
288
264
 
289
265
  onSelect(index, e);
@@ -308,19 +284,18 @@ var Carousel = function (_React$Component) {
308
284
  }
309
285
  };
310
286
 
311
- Carousel.prototype.waitForNext = function waitForNext() {
312
- var _props = this.props,
313
- slide = _props.slide,
314
- interval = _props.interval,
315
- activeIndexProp = _props.activeIndex;
316
-
287
+ _proto.waitForNext = function waitForNext() {
288
+ var _this$props = this.props,
289
+ slide = _this$props.slide,
290
+ interval = _this$props.interval,
291
+ activeIndexProp = _this$props.activeIndex;
317
292
 
318
293
  if (!this.isPaused && slide && interval && activeIndexProp == null) {
319
294
  this.timeout = setTimeout(this.handleNext, interval);
320
295
  }
321
296
  };
322
297
 
323
- Carousel.prototype.renderControls = function renderControls(properties) {
298
+ _proto.renderControls = function renderControls(properties) {
324
299
  var wrap = properties.wrap,
325
300
  children = properties.children,
326
301
  activeIndex = properties.activeIndex,
@@ -329,83 +304,65 @@ var Carousel = function (_React$Component) {
329
304
  bsProps = properties.bsProps,
330
305
  prevLabel = properties.prevLabel,
331
306
  nextLabel = properties.nextLabel;
332
-
333
307
  var controlClassName = (0, _bootstrapUtils.prefix)(bsProps, 'control');
334
- var count = _ValidComponentChildren2.default.count(children);
335
-
336
- return [(wrap || activeIndex !== 0) && _react2.default.createElement(
337
- _SafeAnchor2.default,
338
- {
339
- key: 'prev',
340
- className: (0, _classnames2.default)(controlClassName, 'left'),
341
- onClick: this.handlePrev
342
- },
343
- prevIcon,
344
- prevLabel && _react2.default.createElement(
345
- 'span',
346
- { className: 'sr-only' },
347
- prevLabel
348
- )
349
- ), (wrap || activeIndex !== count - 1) && _react2.default.createElement(
350
- _SafeAnchor2.default,
351
- {
352
- key: 'next',
353
- className: (0, _classnames2.default)(controlClassName, 'right'),
354
- onClick: this.handleNext
355
- },
356
- nextIcon,
357
- nextLabel && _react2.default.createElement(
358
- 'span',
359
- { className: 'sr-only' },
360
- nextLabel
361
- )
362
- )];
308
+
309
+ var count = _ValidComponentChildren.default.count(children);
310
+
311
+ return [(wrap || activeIndex !== 0) && _react.default.createElement(_SafeAnchor.default, {
312
+ key: "prev",
313
+ className: (0, _classnames.default)(controlClassName, 'left'),
314
+ onClick: this.handlePrev
315
+ }, prevIcon, prevLabel && _react.default.createElement("span", {
316
+ className: "sr-only"
317
+ }, prevLabel)), (wrap || activeIndex !== count - 1) && _react.default.createElement(_SafeAnchor.default, {
318
+ key: "next",
319
+ className: (0, _classnames.default)(controlClassName, 'right'),
320
+ onClick: this.handleNext
321
+ }, nextIcon, nextLabel && _react.default.createElement("span", {
322
+ className: "sr-only"
323
+ }, nextLabel))];
363
324
  };
364
325
 
365
- Carousel.prototype.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
326
+ _proto.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
366
327
  var _this3 = this;
367
328
 
368
329
  var indicators = [];
369
330
 
370
- _ValidComponentChildren2.default.forEach(children, function (child, index) {
371
- indicators.push(_react2.default.createElement('li', {
331
+ _ValidComponentChildren.default.forEach(children, function (child, index) {
332
+ indicators.push(_react.default.createElement("li", {
372
333
  key: index,
373
334
  className: index === activeIndex ? 'active' : null,
374
335
  onClick: function onClick(e) {
375
336
  return _this3.select(index, e);
376
337
  }
377
- }),
378
-
379
- // Force whitespace between indicator elements. Bootstrap requires
338
+ }), // Force whitespace between indicator elements. Bootstrap requires
380
339
  // this for correct spacing of elements.
381
340
  ' ');
382
341
  });
383
342
 
384
- return _react2.default.createElement(
385
- 'ol',
386
- { className: (0, _bootstrapUtils.prefix)(bsProps, 'indicators') },
387
- indicators
388
- );
343
+ return _react.default.createElement("ol", {
344
+ className: (0, _bootstrapUtils.prefix)(bsProps, 'indicators')
345
+ }, indicators);
389
346
  };
390
347
 
391
- Carousel.prototype.render = function render() {
348
+ _proto.render = function render() {
392
349
  var _this4 = this;
393
350
 
394
- var _props2 = this.props,
395
- slide = _props2.slide,
396
- indicators = _props2.indicators,
397
- controls = _props2.controls,
398
- wrap = _props2.wrap,
399
- prevIcon = _props2.prevIcon,
400
- prevLabel = _props2.prevLabel,
401
- nextIcon = _props2.nextIcon,
402
- nextLabel = _props2.nextLabel,
403
- className = _props2.className,
404
- children = _props2.children,
405
- props = (0, _objectWithoutProperties3.default)(_props2, ['slide', 'indicators', 'controls', 'wrap', 'prevIcon', 'prevLabel', 'nextIcon', 'nextLabel', 'className', 'children']);
406
- var _state = this.state,
407
- previousActiveIndex = _state.previousActiveIndex,
408
- direction = _state.direction;
351
+ var _this$props2 = this.props,
352
+ slide = _this$props2.slide,
353
+ indicators = _this$props2.indicators,
354
+ controls = _this$props2.controls,
355
+ wrap = _this$props2.wrap,
356
+ prevIcon = _this$props2.prevIcon,
357
+ prevLabel = _this$props2.prevLabel,
358
+ nextIcon = _this$props2.nextIcon,
359
+ nextLabel = _this$props2.nextLabel,
360
+ className = _this$props2.className,
361
+ children = _this$props2.children,
362
+ props = (0, _objectWithoutPropertiesLoose2.default)(_this$props2, ["slide", "indicators", "controls", "wrap", "prevIcon", "prevLabel", "nextIcon", "nextLabel", "className", "children"]);
363
+ var _this$state = this.state,
364
+ previousActiveIndex = _this$state.previousActiveIndex,
365
+ direction = _this$state.direction;
409
366
 
410
367
  var _splitBsPropsAndOmit = (0, _bootstrapUtils.splitBsPropsAndOmit)(props, ['interval', 'pauseOnHover', 'onSelect', 'onSlideEnd', 'activeIndex', // Accessed via this.getActiveIndex().
411
368
  'defaultActiveIndex', 'direction']),
@@ -413,57 +370,47 @@ var Carousel = function (_React$Component) {
413
370
  elementProps = _splitBsPropsAndOmit[1];
414
371
 
415
372
  var activeIndex = this.getActiveIndex();
416
-
417
- var classes = (0, _extends3.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), {
373
+ var classes = (0, _extends2.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), {
418
374
  slide: slide
419
375
  });
420
-
421
- return _react2.default.createElement(
422
- 'div',
423
- (0, _extends3.default)({}, elementProps, {
424
- className: (0, _classnames2.default)(className, classes),
425
- onMouseOver: this.handleMouseOver,
426
- onMouseOut: this.handleMouseOut
427
- }),
428
- indicators && this.renderIndicators(children, activeIndex, bsProps),
429
- _react2.default.createElement(
430
- 'div',
431
- { className: (0, _bootstrapUtils.prefix)(bsProps, 'inner') },
432
- _ValidComponentChildren2.default.map(children, function (child, index) {
433
- var active = index === activeIndex;
434
- var previousActive = slide && index === previousActiveIndex;
435
-
436
- return (0, _react.cloneElement)(child, {
437
- active: active,
438
- index: index,
439
- animateOut: previousActive,
440
- animateIn: active && previousActiveIndex != null && slide,
441
- direction: direction,
442
- onAnimateOutEnd: previousActive ? _this4.handleItemAnimateOutEnd : null
443
- });
444
- })
445
- ),
446
- controls && this.renderControls({
447
- wrap: wrap,
448
- children: children,
449
- activeIndex: activeIndex,
450
- prevIcon: prevIcon,
451
- prevLabel: prevLabel,
452
- nextIcon: nextIcon,
453
- nextLabel: nextLabel,
454
- bsProps: bsProps
455
- })
456
- );
376
+ return _react.default.createElement("div", (0, _extends2.default)({}, elementProps, {
377
+ className: (0, _classnames.default)(className, classes),
378
+ onMouseOver: this.handleMouseOver,
379
+ onMouseOut: this.handleMouseOut
380
+ }), indicators && this.renderIndicators(children, activeIndex, bsProps), _react.default.createElement("div", {
381
+ className: (0, _bootstrapUtils.prefix)(bsProps, 'inner')
382
+ }, _ValidComponentChildren.default.map(children, function (child, index) {
383
+ var active = index === activeIndex;
384
+ var previousActive = slide && index === previousActiveIndex;
385
+ return (0, _react.cloneElement)(child, {
386
+ active: active,
387
+ index: index,
388
+ animateOut: previousActive,
389
+ animateIn: active && previousActiveIndex != null && slide,
390
+ direction: direction,
391
+ onAnimateOutEnd: previousActive ? _this4.handleItemAnimateOutEnd : null
392
+ });
393
+ })), controls && this.renderControls({
394
+ wrap: wrap,
395
+ children: children,
396
+ activeIndex: activeIndex,
397
+ prevIcon: prevIcon,
398
+ prevLabel: prevLabel,
399
+ nextIcon: nextIcon,
400
+ nextLabel: nextLabel,
401
+ bsProps: bsProps
402
+ }));
457
403
  };
458
404
 
459
405
  return Carousel;
460
- }(_react2.default.Component);
406
+ }(_react.default.Component);
461
407
 
462
408
  Carousel.propTypes = propTypes;
463
409
  Carousel.defaultProps = defaultProps;
410
+ Carousel.Caption = _CarouselCaption.default;
411
+ Carousel.Item = _CarouselItem.default;
464
412
 
465
- Carousel.Caption = _CarouselCaption2.default;
466
- Carousel.Item = _CarouselItem2.default;
413
+ var _default = (0, _bootstrapUtils.bsClass)('carousel', Carousel);
467
414
 
468
- exports.default = (0, _bootstrapUtils.bsClass)('carousel', Carousel);
469
- module.exports = exports['default'];
415
+ exports.default = _default;
416
+ module.exports = exports["default"];