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/es/Carousel.js CHANGED
@@ -1,26 +1,22 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5
- import _inherits from 'babel-runtime/helpers/inherits';
1
+ import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
3
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
4
+ import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
6
5
  import classNames from 'classnames';
7
6
  import React, { cloneElement } from 'react';
8
7
  import PropTypes from 'prop-types';
9
-
10
8
  import CarouselCaption from './CarouselCaption';
11
9
  import CarouselItem from './CarouselItem';
12
10
  import Glyphicon from './Glyphicon';
13
11
  import SafeAnchor from './SafeAnchor';
14
12
  import { bsClass, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils';
15
- import ValidComponentChildren from './utils/ValidComponentChildren';
16
-
17
- // TODO: `slide` should be `animate`.
18
-
13
+ import ValidComponentChildren from './utils/ValidComponentChildren'; // TODO: `slide` should be `animate`.
19
14
  // TODO: Use uncontrollable.
20
15
 
21
16
  var propTypes = {
22
17
  slide: PropTypes.bool,
23
18
  indicators: PropTypes.bool,
19
+
24
20
  /**
25
21
  * The amount of time to delay between automatically cycling an item.
26
22
  * If `null`, carousel will not automatically cycle.
@@ -29,6 +25,7 @@ var propTypes = {
29
25
  controls: PropTypes.bool,
30
26
  pauseOnHover: PropTypes.bool,
31
27
  wrap: PropTypes.bool,
28
+
32
29
  /**
33
30
  * Callback fired when the active item changes.
34
31
  *
@@ -46,6 +43,7 @@ var propTypes = {
46
43
  defaultActiveIndex: PropTypes.number,
47
44
  direction: PropTypes.oneOf(['prev', 'next']),
48
45
  prevIcon: PropTypes.node,
46
+
49
47
  /**
50
48
  * Label shown to screen readers only, can be used to show the previous element
51
49
  * in the carousel.
@@ -53,6 +51,7 @@ var propTypes = {
53
51
  */
54
52
  prevLabel: PropTypes.string,
55
53
  nextIcon: PropTypes.node,
54
+
56
55
  /**
57
56
  * Label shown to screen readers only, can be used to show the next element
58
57
  * in the carousel.
@@ -60,7 +59,6 @@ var propTypes = {
60
59
  */
61
60
  nextLabel: PropTypes.string
62
61
  };
63
-
64
62
  var defaultProps = {
65
63
  slide: true,
66
64
  interval: 5000,
@@ -68,49 +66,51 @@ var defaultProps = {
68
66
  wrap: true,
69
67
  indicators: true,
70
68
  controls: true,
71
- prevIcon: React.createElement(Glyphicon, { glyph: 'chevron-left' }),
69
+ prevIcon: React.createElement(Glyphicon, {
70
+ glyph: "chevron-left"
71
+ }),
72
72
  prevLabel: 'Previous',
73
- nextIcon: React.createElement(Glyphicon, { glyph: 'chevron-right' }),
73
+ nextIcon: React.createElement(Glyphicon, {
74
+ glyph: "chevron-right"
75
+ }),
74
76
  nextLabel: 'Next'
75
77
  };
76
78
 
77
- var Carousel = function (_React$Component) {
78
- _inherits(Carousel, _React$Component);
79
+ var Carousel =
80
+ /*#__PURE__*/
81
+ function (_React$Component) {
82
+ _inheritsLoose(Carousel, _React$Component);
79
83
 
80
84
  function Carousel(props, context) {
81
- _classCallCheck(this, Carousel);
82
-
83
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
84
-
85
- _this.handleMouseOver = _this.handleMouseOver.bind(_this);
86
- _this.handleMouseOut = _this.handleMouseOut.bind(_this);
87
- _this.handlePrev = _this.handlePrev.bind(_this);
88
- _this.handleNext = _this.handleNext.bind(_this);
89
- _this.handleItemAnimateOutEnd = _this.handleItemAnimateOutEnd.bind(_this);
90
-
85
+ var _this;
86
+
87
+ _this = _React$Component.call(this, props, context) || this;
88
+ _this.handleMouseOver = _this.handleMouseOver.bind(_assertThisInitialized(_assertThisInitialized(_this)));
89
+ _this.handleMouseOut = _this.handleMouseOut.bind(_assertThisInitialized(_assertThisInitialized(_this)));
90
+ _this.handlePrev = _this.handlePrev.bind(_assertThisInitialized(_assertThisInitialized(_this)));
91
+ _this.handleNext = _this.handleNext.bind(_assertThisInitialized(_assertThisInitialized(_this)));
92
+ _this.handleItemAnimateOutEnd = _this.handleItemAnimateOutEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));
91
93
  var defaultActiveIndex = props.defaultActiveIndex;
92
-
93
-
94
94
  _this.state = {
95
95
  activeIndex: defaultActiveIndex != null ? defaultActiveIndex : 0,
96
96
  previousActiveIndex: null,
97
97
  direction: null
98
98
  };
99
-
100
99
  _this.isUnmounted = false;
101
100
  return _this;
102
101
  }
103
102
 
104
- Carousel.prototype.componentDidMount = function componentDidMount() {
103
+ var _proto = Carousel.prototype;
104
+
105
+ _proto.componentDidMount = function componentDidMount() {
105
106
  this.waitForNext();
106
107
  };
107
108
 
108
- Carousel.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
109
+ _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
109
110
  var activeIndex = this.getActiveIndex();
110
111
 
111
112
  if (nextProps.activeIndex != null && nextProps.activeIndex !== activeIndex) {
112
113
  clearTimeout(this.timeout);
113
-
114
114
  this.setState({
115
115
  previousActiveIndex: activeIndex,
116
116
  direction: nextProps.direction != null ? nextProps.direction : this.getDirection(activeIndex, nextProps.activeIndex)
@@ -126,17 +126,17 @@ var Carousel = function (_React$Component) {
126
126
  }
127
127
  };
128
128
 
129
- Carousel.prototype.componentWillUnmount = function componentWillUnmount() {
129
+ _proto.componentWillUnmount = function componentWillUnmount() {
130
130
  clearTimeout(this.timeout);
131
131
  this.isUnmounted = true;
132
132
  };
133
133
 
134
- Carousel.prototype.getActiveIndex = function getActiveIndex() {
134
+ _proto.getActiveIndex = function getActiveIndex() {
135
135
  var activeIndexProp = this.props.activeIndex;
136
136
  return activeIndexProp != null ? activeIndexProp : this.state.activeIndex;
137
137
  };
138
138
 
139
- Carousel.prototype.getDirection = function getDirection(prevIndex, index) {
139
+ _proto.getDirection = function getDirection(prevIndex, index) {
140
140
  if (prevIndex === index) {
141
141
  return null;
142
142
  }
@@ -144,7 +144,7 @@ var Carousel = function (_React$Component) {
144
144
  return prevIndex > index ? 'prev' : 'next';
145
145
  };
146
146
 
147
- Carousel.prototype.handleItemAnimateOutEnd = function handleItemAnimateOutEnd() {
147
+ _proto.handleItemAnimateOutEnd = function handleItemAnimateOutEnd() {
148
148
  var _this2 = this;
149
149
 
150
150
  this.setState({
@@ -159,19 +159,19 @@ var Carousel = function (_React$Component) {
159
159
  });
160
160
  };
161
161
 
162
- Carousel.prototype.handleMouseOut = function handleMouseOut() {
162
+ _proto.handleMouseOut = function handleMouseOut() {
163
163
  if (this.isPaused) {
164
164
  this.play();
165
165
  }
166
166
  };
167
167
 
168
- Carousel.prototype.handleMouseOver = function handleMouseOver() {
168
+ _proto.handleMouseOver = function handleMouseOver() {
169
169
  if (this.props.pauseOnHover) {
170
170
  this.pause();
171
171
  }
172
172
  };
173
173
 
174
- Carousel.prototype.handleNext = function handleNext(e) {
174
+ _proto.handleNext = function handleNext(e) {
175
175
  var index = this.getActiveIndex() + 1;
176
176
  var count = ValidComponentChildren.count(this.props.children);
177
177
 
@@ -179,56 +179,51 @@ var Carousel = function (_React$Component) {
179
179
  if (!this.props.wrap) {
180
180
  return;
181
181
  }
182
+
182
183
  index = 0;
183
184
  }
184
185
 
185
186
  this.select(index, e, 'next');
186
187
  };
187
188
 
188
- Carousel.prototype.handlePrev = function handlePrev(e) {
189
+ _proto.handlePrev = function handlePrev(e) {
189
190
  var index = this.getActiveIndex() - 1;
190
191
 
191
192
  if (index < 0) {
192
193
  if (!this.props.wrap) {
193
194
  return;
194
195
  }
196
+
195
197
  index = ValidComponentChildren.count(this.props.children) - 1;
196
198
  }
197
199
 
198
200
  this.select(index, e, 'prev');
199
- };
200
-
201
- // This might be a public API.
201
+ }; // This might be a public API.
202
202
 
203
203
 
204
- Carousel.prototype.pause = function pause() {
204
+ _proto.pause = function pause() {
205
205
  this.isPaused = true;
206
206
  clearTimeout(this.timeout);
207
- };
207
+ }; // This might be a public API.
208
208
 
209
- // This might be a public API.
210
209
 
211
-
212
- Carousel.prototype.play = function play() {
210
+ _proto.play = function play() {
213
211
  this.isPaused = false;
214
212
  this.waitForNext();
215
213
  };
216
214
 
217
- Carousel.prototype.select = function select(index, e, direction) {
218
- clearTimeout(this.timeout);
219
-
220
- // TODO: Is this necessary? Seems like the only risk is if the component
215
+ _proto.select = function select(index, e, direction) {
216
+ clearTimeout(this.timeout); // TODO: Is this necessary? Seems like the only risk is if the component
221
217
  // unmounts while handleItemAnimateOutEnd fires.
218
+
222
219
  if (this.isUnmounted) {
223
220
  return;
224
221
  }
225
222
 
226
223
  var previousActiveIndex = this.props.slide ? this.getActiveIndex() : null;
227
224
  direction = direction || this.getDirection(previousActiveIndex, index);
228
-
229
225
  var onSelect = this.props.onSelect;
230
226
 
231
-
232
227
  if (onSelect) {
233
228
  if (onSelect.length > 1) {
234
229
  // React SyntheticEvents are pooled, so we need to remove this event
@@ -239,7 +234,9 @@ var Carousel = function (_React$Component) {
239
234
  e.persist();
240
235
  e.direction = direction;
241
236
  } else {
242
- e = { direction: direction };
237
+ e = {
238
+ direction: direction
239
+ };
243
240
  }
244
241
 
245
242
  onSelect(index, e);
@@ -264,19 +261,18 @@ var Carousel = function (_React$Component) {
264
261
  }
265
262
  };
266
263
 
267
- Carousel.prototype.waitForNext = function waitForNext() {
268
- var _props = this.props,
269
- slide = _props.slide,
270
- interval = _props.interval,
271
- activeIndexProp = _props.activeIndex;
272
-
264
+ _proto.waitForNext = function waitForNext() {
265
+ var _this$props = this.props,
266
+ slide = _this$props.slide,
267
+ interval = _this$props.interval,
268
+ activeIndexProp = _this$props.activeIndex;
273
269
 
274
270
  if (!this.isPaused && slide && interval && activeIndexProp == null) {
275
271
  this.timeout = setTimeout(this.handleNext, interval);
276
272
  }
277
273
  };
278
274
 
279
- Carousel.prototype.renderControls = function renderControls(properties) {
275
+ _proto.renderControls = function renderControls(properties) {
280
276
  var wrap = properties.wrap,
281
277
  children = properties.children,
282
278
  activeIndex = properties.activeIndex,
@@ -285,84 +281,62 @@ var Carousel = function (_React$Component) {
285
281
  bsProps = properties.bsProps,
286
282
  prevLabel = properties.prevLabel,
287
283
  nextLabel = properties.nextLabel;
288
-
289
284
  var controlClassName = prefix(bsProps, 'control');
290
285
  var count = ValidComponentChildren.count(children);
291
-
292
- return [(wrap || activeIndex !== 0) && React.createElement(
293
- SafeAnchor,
294
- {
295
- key: 'prev',
296
- className: classNames(controlClassName, 'left'),
297
- onClick: this.handlePrev
298
- },
299
- prevIcon,
300
- prevLabel && React.createElement(
301
- 'span',
302
- { className: 'sr-only' },
303
- prevLabel
304
- )
305
- ), (wrap || activeIndex !== count - 1) && React.createElement(
306
- SafeAnchor,
307
- {
308
- key: 'next',
309
- className: classNames(controlClassName, 'right'),
310
- onClick: this.handleNext
311
- },
312
- nextIcon,
313
- nextLabel && React.createElement(
314
- 'span',
315
- { className: 'sr-only' },
316
- nextLabel
317
- )
318
- )];
286
+ return [(wrap || activeIndex !== 0) && React.createElement(SafeAnchor, {
287
+ key: "prev",
288
+ className: classNames(controlClassName, 'left'),
289
+ onClick: this.handlePrev
290
+ }, prevIcon, prevLabel && React.createElement("span", {
291
+ className: "sr-only"
292
+ }, prevLabel)), (wrap || activeIndex !== count - 1) && React.createElement(SafeAnchor, {
293
+ key: "next",
294
+ className: classNames(controlClassName, 'right'),
295
+ onClick: this.handleNext
296
+ }, nextIcon, nextLabel && React.createElement("span", {
297
+ className: "sr-only"
298
+ }, nextLabel))];
319
299
  };
320
300
 
321
- Carousel.prototype.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
301
+ _proto.renderIndicators = function renderIndicators(children, activeIndex, bsProps) {
322
302
  var _this3 = this;
323
303
 
324
304
  var indicators = [];
325
-
326
305
  ValidComponentChildren.forEach(children, function (child, index) {
327
- indicators.push(React.createElement('li', {
306
+ indicators.push(React.createElement("li", {
328
307
  key: index,
329
308
  className: index === activeIndex ? 'active' : null,
330
309
  onClick: function onClick(e) {
331
310
  return _this3.select(index, e);
332
311
  }
333
- }),
334
-
335
- // Force whitespace between indicator elements. Bootstrap requires
312
+ }), // Force whitespace between indicator elements. Bootstrap requires
336
313
  // this for correct spacing of elements.
337
314
  ' ');
338
315
  });
339
-
340
- return React.createElement(
341
- 'ol',
342
- { className: prefix(bsProps, 'indicators') },
343
- indicators
344
- );
316
+ return React.createElement("ol", {
317
+ className: prefix(bsProps, 'indicators')
318
+ }, indicators);
345
319
  };
346
320
 
347
- Carousel.prototype.render = function render() {
321
+ _proto.render = function render() {
348
322
  var _this4 = this;
349
323
 
350
- var _props2 = this.props,
351
- slide = _props2.slide,
352
- indicators = _props2.indicators,
353
- controls = _props2.controls,
354
- wrap = _props2.wrap,
355
- prevIcon = _props2.prevIcon,
356
- prevLabel = _props2.prevLabel,
357
- nextIcon = _props2.nextIcon,
358
- nextLabel = _props2.nextLabel,
359
- className = _props2.className,
360
- children = _props2.children,
361
- props = _objectWithoutProperties(_props2, ['slide', 'indicators', 'controls', 'wrap', 'prevIcon', 'prevLabel', 'nextIcon', 'nextLabel', 'className', 'children']);
362
-
363
- var _state = this.state,
364
- previousActiveIndex = _state.previousActiveIndex,
365
- direction = _state.direction;
324
+ var _this$props2 = this.props,
325
+ slide = _this$props2.slide,
326
+ indicators = _this$props2.indicators,
327
+ controls = _this$props2.controls,
328
+ wrap = _this$props2.wrap,
329
+ prevIcon = _this$props2.prevIcon,
330
+ prevLabel = _this$props2.prevLabel,
331
+ nextIcon = _this$props2.nextIcon,
332
+ nextLabel = _this$props2.nextLabel,
333
+ className = _this$props2.className,
334
+ children = _this$props2.children,
335
+ props = _objectWithoutPropertiesLoose(_this$props2, ["slide", "indicators", "controls", "wrap", "prevIcon", "prevLabel", "nextIcon", "nextLabel", "className", "children"]);
336
+
337
+ var _this$state = this.state,
338
+ previousActiveIndex = _this$state.previousActiveIndex,
339
+ direction = _this$state.direction;
366
340
 
367
341
  var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['interval', 'pauseOnHover', 'onSelect', 'onSlideEnd', 'activeIndex', // Accessed via this.getActiveIndex().
368
342
  'defaultActiveIndex', 'direction']),
@@ -375,42 +349,33 @@ var Carousel = function (_React$Component) {
375
349
  slide: slide
376
350
  });
377
351
 
378
- return React.createElement(
379
- 'div',
380
- _extends({}, elementProps, {
381
- className: classNames(className, classes),
382
- onMouseOver: this.handleMouseOver,
383
- onMouseOut: this.handleMouseOut
384
- }),
385
- indicators && this.renderIndicators(children, activeIndex, bsProps),
386
- React.createElement(
387
- 'div',
388
- { className: prefix(bsProps, 'inner') },
389
- ValidComponentChildren.map(children, function (child, index) {
390
- var active = index === activeIndex;
391
- var previousActive = slide && index === previousActiveIndex;
392
-
393
- return cloneElement(child, {
394
- active: active,
395
- index: index,
396
- animateOut: previousActive,
397
- animateIn: active && previousActiveIndex != null && slide,
398
- direction: direction,
399
- onAnimateOutEnd: previousActive ? _this4.handleItemAnimateOutEnd : null
400
- });
401
- })
402
- ),
403
- controls && this.renderControls({
404
- wrap: wrap,
405
- children: children,
406
- activeIndex: activeIndex,
407
- prevIcon: prevIcon,
408
- prevLabel: prevLabel,
409
- nextIcon: nextIcon,
410
- nextLabel: nextLabel,
411
- bsProps: bsProps
412
- })
413
- );
352
+ return React.createElement("div", _extends({}, elementProps, {
353
+ className: classNames(className, classes),
354
+ onMouseOver: this.handleMouseOver,
355
+ onMouseOut: this.handleMouseOut
356
+ }), indicators && this.renderIndicators(children, activeIndex, bsProps), React.createElement("div", {
357
+ className: prefix(bsProps, 'inner')
358
+ }, ValidComponentChildren.map(children, function (child, index) {
359
+ var active = index === activeIndex;
360
+ var previousActive = slide && index === previousActiveIndex;
361
+ return cloneElement(child, {
362
+ active: active,
363
+ index: index,
364
+ animateOut: previousActive,
365
+ animateIn: active && previousActiveIndex != null && slide,
366
+ direction: direction,
367
+ onAnimateOutEnd: previousActive ? _this4.handleItemAnimateOutEnd : null
368
+ });
369
+ })), controls && this.renderControls({
370
+ wrap: wrap,
371
+ children: children,
372
+ activeIndex: activeIndex,
373
+ prevIcon: prevIcon,
374
+ prevLabel: prevLabel,
375
+ nextIcon: nextIcon,
376
+ nextLabel: nextLabel,
377
+ bsProps: bsProps
378
+ }));
414
379
  };
415
380
 
416
381
  return Carousel;
@@ -418,8 +383,6 @@ var Carousel = function (_React$Component) {
418
383
 
419
384
  Carousel.propTypes = propTypes;
420
385
  Carousel.defaultProps = defaultProps;
421
-
422
386
  Carousel.Caption = CarouselCaption;
423
387
  Carousel.Item = CarouselItem;
424
-
425
388
  export default bsClass('carousel', Carousel);
@@ -1,44 +1,42 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5
- import _inherits from 'babel-runtime/helpers/inherits';
1
+ import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
3
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
6
4
  import classNames from 'classnames';
7
5
  import React from 'react';
8
6
  import elementType from 'prop-types-extra/lib/elementType';
9
-
10
7
  import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
11
-
12
8
  var propTypes = {
13
9
  componentClass: elementType
14
10
  };
15
-
16
11
  var defaultProps = {
17
12
  componentClass: 'div'
18
13
  };
19
14
 
20
- var CarouselCaption = function (_React$Component) {
21
- _inherits(CarouselCaption, _React$Component);
15
+ var CarouselCaption =
16
+ /*#__PURE__*/
17
+ function (_React$Component) {
18
+ _inheritsLoose(CarouselCaption, _React$Component);
22
19
 
23
20
  function CarouselCaption() {
24
- _classCallCheck(this, CarouselCaption);
25
-
26
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
21
+ return _React$Component.apply(this, arguments) || this;
27
22
  }
28
23
 
29
- CarouselCaption.prototype.render = function render() {
30
- var _props = this.props,
31
- Component = _props.componentClass,
32
- className = _props.className,
33
- props = _objectWithoutProperties(_props, ['componentClass', 'className']);
24
+ var _proto = CarouselCaption.prototype;
25
+
26
+ _proto.render = function render() {
27
+ var _this$props = this.props,
28
+ Component = _this$props.componentClass,
29
+ className = _this$props.className,
30
+ props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "className"]);
34
31
 
35
32
  var _splitBsProps = splitBsProps(props),
36
33
  bsProps = _splitBsProps[0],
37
34
  elementProps = _splitBsProps[1];
38
35
 
39
36
  var classes = getClassSet(bsProps);
40
-
41
- return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
37
+ return React.createElement(Component, _extends({}, elementProps, {
38
+ className: classNames(className, classes)
39
+ }));
42
40
  };
43
41
 
44
42
  return CarouselCaption;
@@ -46,5 +44,4 @@ var CarouselCaption = function (_React$Component) {
46
44
 
47
45
  CarouselCaption.propTypes = propTypes;
48
46
  CarouselCaption.defaultProps = defaultProps;
49
-
50
47
  export default bsClass('carousel-caption', CarouselCaption);