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/Dropdown.js CHANGED
@@ -1,8 +1,7 @@
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 activeElement from 'dom-helpers/activeElement';
8
7
  import contains from 'dom-helpers/query/contains';
@@ -15,7 +14,6 @@ import elementType from 'prop-types-extra/lib/elementType';
15
14
  import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
16
15
  import uncontrollable from 'uncontrollable';
17
16
  import warning from 'warning';
18
-
19
17
  import ButtonGroup from './ButtonGroup';
20
18
  import DropdownMenu from './DropdownMenu';
21
19
  import DropdownToggle from './DropdownToggle';
@@ -23,10 +21,8 @@ import { bsClass as setBsClass, prefix } from './utils/bootstrapUtils';
23
21
  import createChainedFunction from './utils/createChainedFunction';
24
22
  import { exclusiveRoles, requiredRoles } from './utils/PropTypes';
25
23
  import ValidComponentChildren from './utils/ValidComponentChildren';
26
-
27
24
  var TOGGLE_ROLE = DropdownToggle.defaultProps.bsRole;
28
25
  var MENU_ROLE = DropdownMenu.defaultProps.bsRole;
29
-
30
26
  var propTypes = {
31
27
  /**
32
28
  * The menu will open above the dropdown button, instead of below it.
@@ -39,7 +35,6 @@ var propTypes = {
39
35
  * @required
40
36
  */
41
37
  id: isRequiredForA11y(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
42
-
43
38
  componentClass: elementType,
44
39
 
45
40
  /**
@@ -64,7 +59,6 @@ var propTypes = {
64
59
  * @controllable onToggle
65
60
  */
66
61
  open: PropTypes.bool,
67
-
68
62
  defaultOpen: PropTypes.bool,
69
63
 
70
64
  /**
@@ -106,46 +100,47 @@ var propTypes = {
106
100
  * @private
107
101
  */
108
102
  onMouseEnter: PropTypes.func,
103
+
109
104
  /**
110
105
  * @private
111
106
  */
112
107
  onMouseLeave: PropTypes.func
113
108
  };
114
-
115
109
  var defaultProps = {
116
110
  componentClass: ButtonGroup
117
111
  };
118
112
 
119
- var Dropdown = function (_React$Component) {
120
- _inherits(Dropdown, _React$Component);
113
+ var Dropdown =
114
+ /*#__PURE__*/
115
+ function (_React$Component) {
116
+ _inheritsLoose(Dropdown, _React$Component);
121
117
 
122
118
  function Dropdown(props, context) {
123
- _classCallCheck(this, Dropdown);
124
-
125
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
126
-
127
- _this.handleClick = _this.handleClick.bind(_this);
128
- _this.handleKeyDown = _this.handleKeyDown.bind(_this);
129
- _this.handleClose = _this.handleClose.bind(_this);
119
+ var _this;
130
120
 
121
+ _this = _React$Component.call(this, props, context) || this;
122
+ _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
123
+ _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
124
+ _this.handleClose = _this.handleClose.bind(_assertThisInitialized(_assertThisInitialized(_this)));
131
125
  _this._focusInDropdown = false;
132
126
  _this.lastOpenEventType = null;
133
127
  return _this;
134
128
  }
135
129
 
136
- Dropdown.prototype.componentDidMount = function componentDidMount() {
130
+ var _proto = Dropdown.prototype;
131
+
132
+ _proto.componentDidMount = function componentDidMount() {
137
133
  this.focusNextOnOpen();
138
134
  };
139
135
 
140
- Dropdown.prototype.componentWillUpdate = function componentWillUpdate(nextProps) {
136
+ _proto.componentWillUpdate = function componentWillUpdate(nextProps) {
141
137
  if (!nextProps.open && this.props.open) {
142
138
  this._focusInDropdown = contains(ReactDOM.findDOMNode(this.menu), activeElement(document));
143
139
  }
144
140
  };
145
141
 
146
- Dropdown.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
142
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
147
143
  var open = this.props.open;
148
-
149
144
  var prevOpen = prevProps.open;
150
145
 
151
146
  if (open && !prevOpen) {
@@ -162,7 +157,7 @@ var Dropdown = function (_React$Component) {
162
157
  }
163
158
  };
164
159
 
165
- Dropdown.prototype.focus = function focus() {
160
+ _proto.focus = function focus() {
166
161
  var toggle = ReactDOM.findDOMNode(this.toggle);
167
162
 
168
163
  if (toggle && toggle.focus) {
@@ -170,10 +165,10 @@ var Dropdown = function (_React$Component) {
170
165
  }
171
166
  };
172
167
 
173
- Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
168
+ _proto.focusNextOnOpen = function focusNextOnOpen() {
174
169
  var menu = this.menu;
175
170
 
176
- if (!menu.focusNext) {
171
+ if (!menu || !menu.focusNext) {
177
172
  return;
178
173
  }
179
174
 
@@ -182,15 +177,17 @@ var Dropdown = function (_React$Component) {
182
177
  }
183
178
  };
184
179
 
185
- Dropdown.prototype.handleClick = function handleClick(event) {
180
+ _proto.handleClick = function handleClick(event) {
186
181
  if (this.props.disabled) {
187
182
  return;
188
183
  }
189
184
 
190
- this.toggleOpen(event, { source: 'click' });
185
+ this.toggleOpen(event, {
186
+ source: 'click'
187
+ });
191
188
  };
192
189
 
193
- Dropdown.prototype.handleClose = function handleClose(event, eventDetails) {
190
+ _proto.handleClose = function handleClose(event, eventDetails) {
194
191
  if (!this.props.open) {
195
192
  return;
196
193
  }
@@ -198,7 +195,7 @@ var Dropdown = function (_React$Component) {
198
195
  this.toggleOpen(event, eventDetails);
199
196
  };
200
197
 
201
- Dropdown.prototype.handleKeyDown = function handleKeyDown(event) {
198
+ _proto.handleKeyDown = function handleKeyDown(event) {
202
199
  if (this.props.disabled) {
203
200
  return;
204
201
  }
@@ -206,21 +203,28 @@ var Dropdown = function (_React$Component) {
206
203
  switch (event.keyCode) {
207
204
  case keycode.codes.down:
208
205
  if (!this.props.open) {
209
- this.toggleOpen(event, { source: 'keydown' });
206
+ this.toggleOpen(event, {
207
+ source: 'keydown'
208
+ });
210
209
  } else if (this.menu.focusNext) {
211
210
  this.menu.focusNext();
212
211
  }
212
+
213
213
  event.preventDefault();
214
214
  break;
215
+
215
216
  case keycode.codes.esc:
216
217
  case keycode.codes.tab:
217
- this.handleClose(event, { source: 'keydown' });
218
+ this.handleClose(event, {
219
+ source: 'keydown'
220
+ });
218
221
  break;
222
+
219
223
  default:
220
224
  }
221
225
  };
222
226
 
223
- Dropdown.prototype.toggleOpen = function toggleOpen(event, eventDetails) {
227
+ _proto.toggleOpen = function toggleOpen(event, eventDetails) {
224
228
  var open = !this.props.open;
225
229
 
226
230
  if (open) {
@@ -232,20 +236,20 @@ var Dropdown = function (_React$Component) {
232
236
  }
233
237
  };
234
238
 
235
- Dropdown.prototype.renderMenu = function renderMenu(child, _ref) {
239
+ _proto.renderMenu = function renderMenu(child, _ref) {
236
240
  var _this2 = this;
237
241
 
238
242
  var id = _ref.id,
239
243
  onSelect = _ref.onSelect,
240
244
  rootCloseEvent = _ref.rootCloseEvent,
241
- props = _objectWithoutProperties(_ref, ['id', 'onSelect', 'rootCloseEvent']);
245
+ props = _objectWithoutPropertiesLoose(_ref, ["id", "onSelect", "rootCloseEvent"]);
242
246
 
243
247
  var ref = function ref(c) {
244
248
  _this2.menu = c;
245
249
  };
246
250
 
247
251
  if (typeof child.ref === 'string') {
248
- process.env.NODE_ENV !== 'production' ? warning(false, 'String refs are not supported on `<Dropdown.Menu>` components. ' + 'To apply a ref to the component use the callback signature:\n\n ' + 'https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute') : void 0;
252
+ process.env.NODE_ENV !== "production" ? warning(false, 'String refs are not supported on `<Dropdown.Menu>` components. ' + 'To apply a ref to the component use the callback signature:\n\n ' + 'https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute') : void 0;
249
253
  } else {
250
254
  ref = createChainedFunction(child.ref, ref);
251
255
  }
@@ -256,13 +260,15 @@ var Dropdown = function (_React$Component) {
256
260
  bsClass: prefix(props, 'menu'),
257
261
  onClose: createChainedFunction(child.props.onClose, this.handleClose),
258
262
  onSelect: createChainedFunction(child.props.onSelect, onSelect, function (key, event) {
259
- return _this2.handleClose(event, { source: 'select' });
263
+ return _this2.handleClose(event, {
264
+ source: 'select'
265
+ });
260
266
  }),
261
267
  rootCloseEvent: rootCloseEvent
262
268
  }));
263
269
  };
264
270
 
265
- Dropdown.prototype.renderToggle = function renderToggle(child, props) {
271
+ _proto.renderToggle = function renderToggle(child, props) {
266
272
  var _this3 = this;
267
273
 
268
274
  var ref = function ref(c) {
@@ -270,7 +276,7 @@ var Dropdown = function (_React$Component) {
270
276
  };
271
277
 
272
278
  if (typeof child.ref === 'string') {
273
- process.env.NODE_ENV !== 'production' ? warning(false, 'String refs are not supported on `<Dropdown.Toggle>` components. ' + 'To apply a ref to the component use the callback signature:\n\n ' + 'https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute') : void 0;
279
+ process.env.NODE_ENV !== "production" ? warning(false, 'String refs are not supported on `<Dropdown.Toggle>` components. ' + 'To apply a ref to the component use the callback signature:\n\n ' + 'https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute') : void 0;
274
280
  } else {
275
281
  ref = createChainedFunction(child.ref, ref);
276
282
  }
@@ -283,64 +289,62 @@ var Dropdown = function (_React$Component) {
283
289
  }));
284
290
  };
285
291
 
286
- Dropdown.prototype.render = function render() {
292
+ _proto.render = function render() {
287
293
  var _classes,
288
294
  _this4 = this;
289
295
 
290
- var _props = this.props,
291
- Component = _props.componentClass,
292
- id = _props.id,
293
- dropup = _props.dropup,
294
- disabled = _props.disabled,
295
- pullRight = _props.pullRight,
296
- open = _props.open,
297
- onSelect = _props.onSelect,
298
- role = _props.role,
299
- bsClass = _props.bsClass,
300
- className = _props.className,
301
- rootCloseEvent = _props.rootCloseEvent,
302
- children = _props.children,
303
- props = _objectWithoutProperties(_props, ['componentClass', 'id', 'dropup', 'disabled', 'pullRight', 'open', 'onSelect', 'role', 'bsClass', 'className', 'rootCloseEvent', 'children']);
296
+ var _this$props = this.props,
297
+ Component = _this$props.componentClass,
298
+ id = _this$props.id,
299
+ dropup = _this$props.dropup,
300
+ disabled = _this$props.disabled,
301
+ pullRight = _this$props.pullRight,
302
+ open = _this$props.open,
303
+ onSelect = _this$props.onSelect,
304
+ role = _this$props.role,
305
+ bsClass = _this$props.bsClass,
306
+ className = _this$props.className,
307
+ rootCloseEvent = _this$props.rootCloseEvent,
308
+ children = _this$props.children,
309
+ props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "id", "dropup", "disabled", "pullRight", "open", "onSelect", "role", "bsClass", "className", "rootCloseEvent", "children"]);
304
310
 
305
311
  delete props.onToggle;
306
-
307
312
  var classes = (_classes = {}, _classes[bsClass] = true, _classes.open = open, _classes.disabled = disabled, _classes);
308
313
 
309
314
  if (dropup) {
310
315
  classes[bsClass] = false;
311
316
  classes.dropup = true;
312
- }
313
-
314
- // This intentionally forwards bsSize and bsStyle (if set) to the
317
+ } // This intentionally forwards bsSize and bsStyle (if set) to the
315
318
  // underlying component, to allow it to render size and style variants.
316
319
 
317
- return React.createElement(
318
- Component,
319
- _extends({}, props, { className: classNames(className, classes) }),
320
- ValidComponentChildren.map(children, function (child) {
321
- switch (child.props.bsRole) {
322
- case TOGGLE_ROLE:
323
- return _this4.renderToggle(child, {
324
- id: id,
325
- disabled: disabled,
326
- open: open,
327
- role: role,
328
- bsClass: bsClass
329
- });
330
- case MENU_ROLE:
331
- return _this4.renderMenu(child, {
332
- id: id,
333
- open: open,
334
- pullRight: pullRight,
335
- bsClass: bsClass,
336
- onSelect: onSelect,
337
- rootCloseEvent: rootCloseEvent
338
- });
339
- default:
340
- return child;
341
- }
342
- })
343
- );
320
+
321
+ return React.createElement(Component, _extends({}, props, {
322
+ className: classNames(className, classes)
323
+ }), ValidComponentChildren.map(children, function (child) {
324
+ switch (child.props.bsRole) {
325
+ case TOGGLE_ROLE:
326
+ return _this4.renderToggle(child, {
327
+ id: id,
328
+ disabled: disabled,
329
+ open: open,
330
+ role: role,
331
+ bsClass: bsClass
332
+ });
333
+
334
+ case MENU_ROLE:
335
+ return _this4.renderMenu(child, {
336
+ id: id,
337
+ open: open,
338
+ pullRight: pullRight,
339
+ bsClass: bsClass,
340
+ onSelect: onSelect,
341
+ rootCloseEvent: rootCloseEvent
342
+ });
343
+
344
+ default:
345
+ return child;
346
+ }
347
+ }));
344
348
  };
345
349
 
346
350
  return Dropdown;
@@ -348,12 +352,10 @@ var Dropdown = function (_React$Component) {
348
352
 
349
353
  Dropdown.propTypes = propTypes;
350
354
  Dropdown.defaultProps = defaultProps;
351
-
352
355
  setBsClass('dropdown', Dropdown);
353
-
354
- var UncontrolledDropdown = uncontrollable(Dropdown, { open: 'onToggle' });
355
-
356
+ var UncontrolledDropdown = uncontrollable(Dropdown, {
357
+ open: 'onToggle'
358
+ });
356
359
  UncontrolledDropdown.Toggle = DropdownToggle;
357
360
  UncontrolledDropdown.Menu = DropdownMenu;
358
-
359
361
  export default UncontrolledDropdown;
@@ -1,69 +1,59 @@
1
- import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
2
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4
- import _inherits from 'babel-runtime/helpers/inherits';
5
- import _extends from 'babel-runtime/helpers/extends';
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
3
+ import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
6
4
  import React from 'react';
7
5
  import PropTypes from 'prop-types';
8
-
9
6
  import Dropdown from './Dropdown';
10
7
  import splitComponentProps from './utils/splitComponentProps';
11
8
 
12
9
  var propTypes = _extends({}, Dropdown.propTypes, {
13
-
14
10
  // Toggle props.
15
11
  bsStyle: PropTypes.string,
16
12
  bsSize: PropTypes.string,
17
13
  title: PropTypes.node.isRequired,
18
14
  noCaret: PropTypes.bool,
19
-
20
15
  // Override generated docs from <Dropdown>.
16
+
21
17
  /**
22
18
  * @private
23
19
  */
24
20
  children: PropTypes.node
25
21
  });
26
22
 
27
- var DropdownButton = function (_React$Component) {
28
- _inherits(DropdownButton, _React$Component);
23
+ var DropdownButton =
24
+ /*#__PURE__*/
25
+ function (_React$Component) {
26
+ _inheritsLoose(DropdownButton, _React$Component);
29
27
 
30
28
  function DropdownButton() {
31
- _classCallCheck(this, DropdownButton);
32
-
33
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
29
+ return _React$Component.apply(this, arguments) || this;
34
30
  }
35
31
 
36
- DropdownButton.prototype.render = function render() {
37
- var _props = this.props,
38
- bsSize = _props.bsSize,
39
- bsStyle = _props.bsStyle,
40
- title = _props.title,
41
- children = _props.children,
42
- props = _objectWithoutProperties(_props, ['bsSize', 'bsStyle', 'title', 'children']);
32
+ var _proto = DropdownButton.prototype;
33
+
34
+ _proto.render = function render() {
35
+ var _this$props = this.props,
36
+ bsSize = _this$props.bsSize,
37
+ bsStyle = _this$props.bsStyle,
38
+ title = _this$props.title,
39
+ children = _this$props.children,
40
+ props = _objectWithoutPropertiesLoose(_this$props, ["bsSize", "bsStyle", "title", "children"]);
43
41
 
44
42
  var _splitComponentProps = splitComponentProps(props, Dropdown.ControlledComponent),
45
43
  dropdownProps = _splitComponentProps[0],
46
44
  toggleProps = _splitComponentProps[1];
47
45
 
48
- return React.createElement(
49
- Dropdown,
50
- _extends({}, dropdownProps, { bsSize: bsSize, bsStyle: bsStyle }),
51
- React.createElement(
52
- Dropdown.Toggle,
53
- _extends({}, toggleProps, { bsSize: bsSize, bsStyle: bsStyle }),
54
- title
55
- ),
56
- React.createElement(
57
- Dropdown.Menu,
58
- null,
59
- children
60
- )
61
- );
46
+ return React.createElement(Dropdown, _extends({}, dropdownProps, {
47
+ bsSize: bsSize,
48
+ bsStyle: bsStyle
49
+ }), React.createElement(Dropdown.Toggle, _extends({}, toggleProps, {
50
+ bsSize: bsSize,
51
+ bsStyle: bsStyle
52
+ }), title), React.createElement(Dropdown.Menu, null, children));
62
53
  };
63
54
 
64
55
  return DropdownButton;
65
56
  }(React.Component);
66
57
 
67
58
  DropdownButton.propTypes = propTypes;
68
-
69
59
  export default DropdownButton;