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.
Files changed (189) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -0
  3. package/dist/react-bootstrap.js +14493 -17076
  4. package/dist/react-bootstrap.min.js +18479 -16
  5. package/es/Alert.js +1 -4
  6. package/es/Badge.js +1 -3
  7. package/es/ButtonGroup.js +1 -3
  8. package/es/Carousel.js +79 -79
  9. package/es/CarouselCaption.js +1 -3
  10. package/es/CarouselItem.js +3 -9
  11. package/es/Checkbox.js +7 -1
  12. package/es/Clearfix.js +1 -3
  13. package/es/CloseButton.js +1 -5
  14. package/es/Col.js +1 -3
  15. package/es/Collapse.js +58 -65
  16. package/es/Dropdown.js +66 -55
  17. package/es/DropdownButton.js +2 -8
  18. package/es/DropdownMenu.js +28 -28
  19. package/es/Fade.js +25 -10
  20. package/es/Form.js +1 -3
  21. package/es/FormControl.js +1 -2
  22. package/es/FormControlStatic.js +1 -3
  23. package/es/FormGroup.js +1 -3
  24. package/es/Glyphicon.js +1 -3
  25. package/es/Grid.js +1 -3
  26. package/es/HelpBlock.js +1 -3
  27. package/es/InputGroup.js +1 -3
  28. package/es/InputGroupAddon.js +1 -3
  29. package/es/InputGroupButton.js +1 -3
  30. package/es/Jumbotron.js +1 -3
  31. package/es/Label.js +1 -3
  32. package/es/ListGroup.js +1 -3
  33. package/es/Media.js +1 -3
  34. package/es/MediaBody.js +16 -5
  35. package/es/MediaHeading.js +1 -3
  36. package/es/MediaLeft.js +1 -3
  37. package/es/MediaList.js +1 -3
  38. package/es/MediaListItem.js +1 -3
  39. package/es/MediaRight.js +1 -3
  40. package/es/Modal.js +30 -19
  41. package/es/ModalBody.js +1 -3
  42. package/es/ModalFooter.js +1 -3
  43. package/es/ModalHeader.js +2 -4
  44. package/es/ModalTitle.js +1 -3
  45. package/es/Nav.js +44 -44
  46. package/es/NavDropdown.js +2 -0
  47. package/es/NavItem.js +5 -4
  48. package/es/Navbar.js +5 -7
  49. package/es/Overlay.js +1 -3
  50. package/es/OverlayTrigger.js +43 -43
  51. package/es/PageHeader.js +1 -3
  52. package/es/Pager.js +1 -3
  53. package/es/PagerItem.js +1 -4
  54. package/es/Pagination.js +15 -224
  55. package/es/PaginationItem.js +102 -0
  56. package/es/Panel.js +114 -173
  57. package/es/PanelBody.js +84 -0
  58. package/es/PanelCollapse.js +94 -0
  59. package/es/PanelFooter.js +53 -0
  60. package/es/PanelGroup.js +95 -52
  61. package/es/PanelHeading.js +75 -0
  62. package/es/PanelTitle.js +83 -0
  63. package/es/PanelToggle.js +94 -0
  64. package/es/ProgressBar.js +12 -8
  65. package/es/Radio.js +7 -1
  66. package/es/Row.js +1 -3
  67. package/es/SplitButton.js +1 -4
  68. package/es/SplitToggle.js +1 -4
  69. package/es/TabContent.js +7 -7
  70. package/es/TabPane.js +18 -18
  71. package/es/Table.js +1 -3
  72. package/es/Tabs.js +4 -10
  73. package/es/Thumbnail.js +3 -3
  74. package/es/ToggleButton.js +1 -4
  75. package/es/Well.js +1 -3
  76. package/es/index.js +0 -2
  77. package/es/utils/PropTypes.js +26 -4
  78. package/es/utils/ValidComponentChildren.js +1 -1
  79. package/es/utils/bootstrapUtils.js +5 -3
  80. package/lib/Accordion.js +9 -9
  81. package/lib/Alert.js +14 -17
  82. package/lib/Badge.js +12 -14
  83. package/lib/Breadcrumb.js +10 -10
  84. package/lib/BreadcrumbItem.js +14 -14
  85. package/lib/Button.js +20 -20
  86. package/lib/ButtonGroup.js +12 -14
  87. package/lib/ButtonToolbar.js +9 -9
  88. package/lib/Carousel.js +121 -121
  89. package/lib/CarouselCaption.js +9 -11
  90. package/lib/CarouselItem.js +17 -22
  91. package/lib/Checkbox.js +25 -21
  92. package/lib/Clearfix.js +14 -16
  93. package/lib/CloseButton.js +12 -16
  94. package/lib/Col.js +29 -31
  95. package/lib/Collapse.js +84 -92
  96. package/lib/ControlLabel.js +14 -14
  97. package/lib/Dropdown.js +106 -95
  98. package/lib/DropdownButton.js +22 -28
  99. package/lib/DropdownMenu.js +51 -51
  100. package/lib/DropdownToggle.js +16 -16
  101. package/lib/Fade.js +43 -25
  102. package/lib/Form.js +11 -13
  103. package/lib/FormControl.js +17 -17
  104. package/lib/FormControlFeedback.js +13 -13
  105. package/lib/FormControlStatic.js +9 -11
  106. package/lib/FormGroup.js +14 -16
  107. package/lib/Glyphicon.js +10 -12
  108. package/lib/Grid.js +10 -12
  109. package/lib/HelpBlock.js +8 -10
  110. package/lib/Image.js +13 -13
  111. package/lib/InputGroup.js +10 -12
  112. package/lib/InputGroupAddon.js +8 -10
  113. package/lib/InputGroupButton.js +8 -10
  114. package/lib/Jumbotron.js +9 -11
  115. package/lib/Label.js +11 -13
  116. package/lib/ListGroup.js +15 -17
  117. package/lib/ListGroupItem.js +22 -22
  118. package/lib/Media.js +15 -17
  119. package/lib/MediaBody.js +28 -11
  120. package/lib/MediaHeading.js +9 -11
  121. package/lib/MediaLeft.js +10 -12
  122. package/lib/MediaList.js +8 -10
  123. package/lib/MediaListItem.js +8 -10
  124. package/lib/MediaRight.js +10 -12
  125. package/lib/MenuItem.js +23 -23
  126. package/lib/Modal.js +80 -69
  127. package/lib/ModalBody.js +9 -11
  128. package/lib/ModalDialog.js +16 -16
  129. package/lib/ModalFooter.js +9 -11
  130. package/lib/ModalHeader.js +20 -22
  131. package/lib/ModalTitle.js +9 -11
  132. package/lib/Nav.js +81 -81
  133. package/lib/NavDropdown.js +27 -25
  134. package/lib/NavItem.js +23 -22
  135. package/lib/Navbar.js +46 -48
  136. package/lib/NavbarBrand.js +14 -14
  137. package/lib/NavbarCollapse.js +14 -14
  138. package/lib/NavbarHeader.js +10 -10
  139. package/lib/NavbarToggle.js +22 -22
  140. package/lib/Overlay.js +25 -27
  141. package/lib/OverlayTrigger.js +79 -79
  142. package/lib/PageHeader.js +10 -12
  143. package/lib/PageItem.js +2 -2
  144. package/lib/Pager.js +13 -15
  145. package/lib/PagerItem.js +18 -21
  146. package/lib/Pagination.js +25 -240
  147. package/lib/PaginationItem.js +135 -0
  148. package/lib/Panel.js +142 -180
  149. package/lib/PanelBody.js +114 -0
  150. package/lib/PanelCollapse.js +120 -0
  151. package/lib/PanelFooter.js +80 -0
  152. package/lib/PanelGroup.js +111 -70
  153. package/lib/PanelHeading.js +107 -0
  154. package/lib/PanelTitle.js +118 -0
  155. package/lib/PanelToggle.js +130 -0
  156. package/lib/Popover.js +22 -22
  157. package/lib/ProgressBar.js +39 -35
  158. package/lib/Radio.js +25 -21
  159. package/lib/ResponsiveEmbed.js +17 -17
  160. package/lib/Row.js +9 -11
  161. package/lib/SafeAnchor.js +17 -17
  162. package/lib/SplitButton.js +26 -29
  163. package/lib/SplitToggle.js +8 -11
  164. package/lib/Tab.js +15 -15
  165. package/lib/TabContainer.js +17 -17
  166. package/lib/TabContent.js +31 -31
  167. package/lib/TabPane.js +59 -59
  168. package/lib/Table.js +15 -17
  169. package/lib/Tabs.js +29 -35
  170. package/lib/Thumbnail.js +18 -20
  171. package/lib/ToggleButton.js +17 -20
  172. package/lib/ToggleButtonGroup.js +20 -20
  173. package/lib/Tooltip.js +20 -20
  174. package/lib/Well.js +8 -10
  175. package/lib/index.js +74 -79
  176. package/lib/utils/PropTypes.js +35 -9
  177. package/lib/utils/ValidComponentChildren.js +19 -19
  178. package/lib/utils/bootstrapUtils.js +13 -11
  179. package/lib/utils/capitalize.js +1 -1
  180. package/lib/utils/createChainedFunction.js +1 -1
  181. package/lib/utils/deprecationWarning.js +7 -7
  182. package/lib/utils/index.js +4 -4
  183. package/lib/utils/splitComponentProps.js +3 -3
  184. package/package.json +54 -64
  185. package/dist/react-bootstrap.min.js.map +0 -1
  186. package/es/PaginationButton.js +0 -98
  187. package/es/utils/TransitionEvents.js +0 -109
  188. package/lib/PaginationButton.js +0 -137
  189. package/lib/utils/TransitionEvents.js +0 -113
package/lib/Dropdown.js CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
 
5
- var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
6
-
7
- var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
8
-
9
5
  var _extends2 = require('babel-runtime/helpers/extends');
10
6
 
11
7
  var _extends3 = _interopRequireDefault(_extends2);
12
8
 
9
+ var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
10
+
11
+ var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
12
+
13
13
  var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
14
14
 
15
15
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
@@ -94,50 +94,50 @@ var _ValidComponentChildren = require('./utils/ValidComponentChildren');
94
94
 
95
95
  var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
96
96
 
97
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
97
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
98
98
 
99
- var TOGGLE_ROLE = _DropdownToggle2['default'].defaultProps.bsRole;
100
- var MENU_ROLE = _DropdownMenu2['default'].defaultProps.bsRole;
99
+ var TOGGLE_ROLE = _DropdownToggle2.default.defaultProps.bsRole;
100
+ var MENU_ROLE = _DropdownMenu2.default.defaultProps.bsRole;
101
101
 
102
102
  var propTypes = {
103
103
  /**
104
104
  * The menu will open above the dropdown button, instead of below it.
105
105
  */
106
- dropup: _propTypes2['default'].bool,
106
+ dropup: _propTypes2.default.bool,
107
107
 
108
108
  /**
109
109
  * An html id attribute, necessary for assistive technologies, such as screen readers.
110
110
  * @type {string|number}
111
111
  * @required
112
112
  */
113
- id: (0, _isRequiredForA11y2['default'])(_propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].number])),
113
+ id: (0, _isRequiredForA11y2.default)(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number])),
114
114
 
115
- componentClass: _elementType2['default'],
115
+ componentClass: _elementType2.default,
116
116
 
117
117
  /**
118
118
  * The children of a Dropdown may be a `<Dropdown.Toggle>` or a `<Dropdown.Menu>`.
119
119
  * @type {node}
120
120
  */
121
- children: (0, _all2['default'])((0, _PropTypes.requiredRoles)(TOGGLE_ROLE, MENU_ROLE), (0, _PropTypes.exclusiveRoles)(MENU_ROLE)),
121
+ children: (0, _all2.default)((0, _PropTypes.requiredRoles)(TOGGLE_ROLE, MENU_ROLE), (0, _PropTypes.exclusiveRoles)(MENU_ROLE)),
122
122
 
123
123
  /**
124
124
  * Whether or not component is disabled.
125
125
  */
126
- disabled: _propTypes2['default'].bool,
126
+ disabled: _propTypes2.default.bool,
127
127
 
128
128
  /**
129
129
  * Align the menu to the right side of the Dropdown toggle
130
130
  */
131
- pullRight: _propTypes2['default'].bool,
131
+ pullRight: _propTypes2.default.bool,
132
132
 
133
133
  /**
134
134
  * Whether or not the Dropdown is visible.
135
135
  *
136
136
  * @controllable onToggle
137
137
  */
138
- open: _propTypes2['default'].bool,
138
+ open: _propTypes2.default.bool,
139
139
 
140
- defaultOpen: _propTypes2['default'].bool,
140
+ defaultOpen: _propTypes2.default.bool,
141
141
 
142
142
  /**
143
143
  * A callback fired when the Dropdown wishes to change visibility. Called with the requested
@@ -148,7 +148,7 @@ var propTypes = {
148
148
  * ```
149
149
  * @controllable open
150
150
  */
151
- onToggle: _propTypes2['default'].func,
151
+ onToggle: _propTypes2.default.func,
152
152
 
153
153
  /**
154
154
  * A callback fired when a menu item is selected.
@@ -157,40 +157,44 @@ var propTypes = {
157
157
  * (eventKey: any, event: Object) => any
158
158
  * ```
159
159
  */
160
- onSelect: _propTypes2['default'].func,
160
+ onSelect: _propTypes2.default.func,
161
161
 
162
162
  /**
163
163
  * If `'menuitem'`, causes the dropdown to behave like a menu item rather than
164
164
  * a menu button.
165
165
  */
166
- role: _propTypes2['default'].string,
166
+ role: _propTypes2.default.string,
167
167
 
168
168
  /**
169
169
  * Which event when fired outside the component will cause it to be closed
170
+ *
171
+ * *Note: For custom dropdown components, you will have to pass the
172
+ * `rootCloseEvent` to `<RootCloseWrapper>` in your custom dropdown menu
173
+ * component ([similarly to how it is implemented in `<Dropdown.Menu>`](https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.5/src/DropdownMenu.js#L115-L119)).*
170
174
  */
171
- rootCloseEvent: _propTypes2['default'].oneOf(['click', 'mousedown']),
175
+ rootCloseEvent: _propTypes2.default.oneOf(['click', 'mousedown']),
172
176
 
173
177
  /**
174
178
  * @private
175
179
  */
176
- onMouseEnter: _propTypes2['default'].func,
180
+ onMouseEnter: _propTypes2.default.func,
177
181
  /**
178
182
  * @private
179
183
  */
180
- onMouseLeave: _propTypes2['default'].func
184
+ onMouseLeave: _propTypes2.default.func
181
185
  };
182
186
 
183
187
  var defaultProps = {
184
- componentClass: _ButtonGroup2['default']
188
+ componentClass: _ButtonGroup2.default
185
189
  };
186
190
 
187
191
  var Dropdown = function (_React$Component) {
188
- (0, _inherits3['default'])(Dropdown, _React$Component);
192
+ (0, _inherits3.default)(Dropdown, _React$Component);
189
193
 
190
194
  function Dropdown(props, context) {
191
- (0, _classCallCheck3['default'])(this, Dropdown);
195
+ (0, _classCallCheck3.default)(this, Dropdown);
192
196
 
193
- var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context));
197
+ var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
194
198
 
195
199
  _this.handleClick = _this.handleClick.bind(_this);
196
200
  _this.handleKeyDown = _this.handleKeyDown.bind(_this);
@@ -207,7 +211,7 @@ var Dropdown = function (_React$Component) {
207
211
 
208
212
  Dropdown.prototype.componentWillUpdate = function componentWillUpdate(nextProps) {
209
213
  if (!nextProps.open && this.props.open) {
210
- this._focusInDropdown = (0, _contains2['default'])(_reactDom2['default'].findDOMNode(this.menu), (0, _activeElement2['default'])(document));
214
+ this._focusInDropdown = (0, _contains2.default)(_reactDom2.default.findDOMNode(this.menu), (0, _activeElement2.default)(document));
211
215
  }
212
216
  };
213
217
 
@@ -230,6 +234,26 @@ var Dropdown = function (_React$Component) {
230
234
  }
231
235
  };
232
236
 
237
+ Dropdown.prototype.focus = function focus() {
238
+ var toggle = _reactDom2.default.findDOMNode(this.toggle);
239
+
240
+ if (toggle && toggle.focus) {
241
+ toggle.focus();
242
+ }
243
+ };
244
+
245
+ Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
246
+ var menu = this.menu;
247
+
248
+ if (!menu.focusNext) {
249
+ return;
250
+ }
251
+
252
+ if (this.lastOpenEventType === 'keydown' || this.props.role === 'menuitem') {
253
+ menu.focusNext();
254
+ }
255
+ };
256
+
233
257
  Dropdown.prototype.handleClick = function handleClick(event) {
234
258
  if (this.props.disabled) {
235
259
  return;
@@ -238,13 +262,21 @@ var Dropdown = function (_React$Component) {
238
262
  this.toggleOpen(event, { source: 'click' });
239
263
  };
240
264
 
265
+ Dropdown.prototype.handleClose = function handleClose(event, eventDetails) {
266
+ if (!this.props.open) {
267
+ return;
268
+ }
269
+
270
+ this.toggleOpen(event, eventDetails);
271
+ };
272
+
241
273
  Dropdown.prototype.handleKeyDown = function handleKeyDown(event) {
242
274
  if (this.props.disabled) {
243
275
  return;
244
276
  }
245
277
 
246
278
  switch (event.keyCode) {
247
- case _keycode2['default'].codes.down:
279
+ case _keycode2.default.codes.down:
248
280
  if (!this.props.open) {
249
281
  this.toggleOpen(event, { source: 'keydown' });
250
282
  } else if (this.menu.focusNext) {
@@ -252,8 +284,8 @@ var Dropdown = function (_React$Component) {
252
284
  }
253
285
  event.preventDefault();
254
286
  break;
255
- case _keycode2['default'].codes.esc:
256
- case _keycode2['default'].codes.tab:
287
+ case _keycode2.default.codes.esc:
288
+ case _keycode2.default.codes.tab:
257
289
  this.handleClose(event, { source: 'keydown' });
258
290
  break;
259
291
  default:
@@ -272,82 +304,54 @@ var Dropdown = function (_React$Component) {
272
304
  }
273
305
  };
274
306
 
275
- Dropdown.prototype.handleClose = function handleClose(event, eventDetails) {
276
- if (!this.props.open) {
277
- return;
278
- }
279
-
280
- this.toggleOpen(event, eventDetails);
281
- };
282
-
283
- Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
284
- var menu = this.menu;
285
-
286
- if (!menu.focusNext) {
287
- return;
288
- }
289
-
290
- if (this.lastOpenEventType === 'keydown' || this.props.role === 'menuitem') {
291
- menu.focusNext();
292
- }
293
- };
294
-
295
- Dropdown.prototype.focus = function focus() {
296
- var toggle = _reactDom2['default'].findDOMNode(this.toggle);
297
-
298
- if (toggle && toggle.focus) {
299
- toggle.focus();
300
- }
301
- };
302
-
303
- Dropdown.prototype.renderToggle = function renderToggle(child, props) {
307
+ Dropdown.prototype.renderMenu = function renderMenu(child, _ref) {
304
308
  var _this2 = this;
305
309
 
310
+ var id = _ref.id,
311
+ onSelect = _ref.onSelect,
312
+ rootCloseEvent = _ref.rootCloseEvent,
313
+ props = (0, _objectWithoutProperties3.default)(_ref, ['id', 'onSelect', 'rootCloseEvent']);
314
+
306
315
  var ref = function ref(c) {
307
- _this2.toggle = c;
316
+ _this2.menu = c;
308
317
  };
309
318
 
310
319
  if (typeof child.ref === 'string') {
311
- process.env.NODE_ENV !== 'production' ? (0, _warning2['default'])(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;
320
+ process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(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;
312
321
  } else {
313
- ref = (0, _createChainedFunction2['default'])(child.ref, ref);
322
+ ref = (0, _createChainedFunction2.default)(child.ref, ref);
314
323
  }
315
324
 
316
- return (0, _react.cloneElement)(child, (0, _extends3['default'])({}, props, {
325
+ return (0, _react.cloneElement)(child, (0, _extends3.default)({}, props, {
317
326
  ref: ref,
318
- bsClass: (0, _bootstrapUtils.prefix)(props, 'toggle'),
319
- onClick: (0, _createChainedFunction2['default'])(child.props.onClick, this.handleClick),
320
- onKeyDown: (0, _createChainedFunction2['default'])(child.props.onKeyDown, this.handleKeyDown)
327
+ labelledBy: id,
328
+ bsClass: (0, _bootstrapUtils.prefix)(props, 'menu'),
329
+ onClose: (0, _createChainedFunction2.default)(child.props.onClose, this.handleClose),
330
+ onSelect: (0, _createChainedFunction2.default)(child.props.onSelect, onSelect, function (key, event) {
331
+ return _this2.handleClose(event, { source: 'select' });
332
+ }),
333
+ rootCloseEvent: rootCloseEvent
321
334
  }));
322
335
  };
323
336
 
324
- Dropdown.prototype.renderMenu = function renderMenu(child, _ref) {
337
+ Dropdown.prototype.renderToggle = function renderToggle(child, props) {
325
338
  var _this3 = this;
326
339
 
327
- var id = _ref.id,
328
- onSelect = _ref.onSelect,
329
- rootCloseEvent = _ref.rootCloseEvent,
330
- props = (0, _objectWithoutProperties3['default'])(_ref, ['id', 'onSelect', 'rootCloseEvent']);
331
-
332
340
  var ref = function ref(c) {
333
- _this3.menu = c;
341
+ _this3.toggle = c;
334
342
  };
335
343
 
336
344
  if (typeof child.ref === 'string') {
337
- process.env.NODE_ENV !== 'production' ? (0, _warning2['default'])(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;
345
+ process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(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;
338
346
  } else {
339
- ref = (0, _createChainedFunction2['default'])(child.ref, ref);
347
+ ref = (0, _createChainedFunction2.default)(child.ref, ref);
340
348
  }
341
349
 
342
- return (0, _react.cloneElement)(child, (0, _extends3['default'])({}, props, {
350
+ return (0, _react.cloneElement)(child, (0, _extends3.default)({}, props, {
343
351
  ref: ref,
344
- labelledBy: id,
345
- bsClass: (0, _bootstrapUtils.prefix)(props, 'menu'),
346
- onClose: (0, _createChainedFunction2['default'])(child.props.onClose, this.handleClose),
347
- onSelect: (0, _createChainedFunction2['default'])(child.props.onSelect, onSelect, function (key, event) {
348
- return _this3.handleClose(event, { source: 'select' });
349
- }),
350
- rootCloseEvent: rootCloseEvent
352
+ bsClass: (0, _bootstrapUtils.prefix)(props, 'toggle'),
353
+ onClick: (0, _createChainedFunction2.default)(child.props.onClick, this.handleClick),
354
+ onKeyDown: (0, _createChainedFunction2.default)(child.props.onKeyDown, this.handleKeyDown)
351
355
  }));
352
356
  };
353
357
 
@@ -368,7 +372,7 @@ var Dropdown = function (_React$Component) {
368
372
  className = _props.className,
369
373
  rootCloseEvent = _props.rootCloseEvent,
370
374
  children = _props.children,
371
- props = (0, _objectWithoutProperties3['default'])(_props, ['componentClass', 'id', 'dropup', 'disabled', 'pullRight', 'open', 'onSelect', 'role', 'bsClass', 'className', 'rootCloseEvent', 'children']);
375
+ props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'id', 'dropup', 'disabled', 'pullRight', 'open', 'onSelect', 'role', 'bsClass', 'className', 'rootCloseEvent', 'children']);
372
376
 
373
377
 
374
378
  delete props.onToggle;
@@ -383,20 +387,27 @@ var Dropdown = function (_React$Component) {
383
387
  // This intentionally forwards bsSize and bsStyle (if set) to the
384
388
  // underlying component, to allow it to render size and style variants.
385
389
 
386
- return _react2['default'].createElement(
390
+ return _react2.default.createElement(
387
391
  Component,
388
- (0, _extends3['default'])({}, props, {
389
- className: (0, _classnames2['default'])(className, classes)
390
- }),
391
- _ValidComponentChildren2['default'].map(children, function (child) {
392
+ (0, _extends3.default)({}, props, { className: (0, _classnames2.default)(className, classes) }),
393
+ _ValidComponentChildren2.default.map(children, function (child) {
392
394
  switch (child.props.bsRole) {
393
395
  case TOGGLE_ROLE:
394
396
  return _this4.renderToggle(child, {
395
- id: id, disabled: disabled, open: open, role: role, bsClass: bsClass
397
+ id: id,
398
+ disabled: disabled,
399
+ open: open,
400
+ role: role,
401
+ bsClass: bsClass
396
402
  });
397
403
  case MENU_ROLE:
398
404
  return _this4.renderMenu(child, {
399
- id: id, open: open, pullRight: pullRight, bsClass: bsClass, onSelect: onSelect, rootCloseEvent: rootCloseEvent
405
+ id: id,
406
+ open: open,
407
+ pullRight: pullRight,
408
+ bsClass: bsClass,
409
+ onSelect: onSelect,
410
+ rootCloseEvent: rootCloseEvent
400
411
  });
401
412
  default:
402
413
  return child;
@@ -406,17 +417,17 @@ var Dropdown = function (_React$Component) {
406
417
  };
407
418
 
408
419
  return Dropdown;
409
- }(_react2['default'].Component);
420
+ }(_react2.default.Component);
410
421
 
411
422
  Dropdown.propTypes = propTypes;
412
423
  Dropdown.defaultProps = defaultProps;
413
424
 
414
425
  (0, _bootstrapUtils.bsClass)('dropdown', Dropdown);
415
426
 
416
- var UncontrolledDropdown = (0, _uncontrollable2['default'])(Dropdown, { open: 'onToggle' });
427
+ var UncontrolledDropdown = (0, _uncontrollable2.default)(Dropdown, { open: 'onToggle' });
417
428
 
418
- UncontrolledDropdown.Toggle = _DropdownToggle2['default'];
419
- UncontrolledDropdown.Menu = _DropdownMenu2['default'];
429
+ UncontrolledDropdown.Toggle = _DropdownToggle2.default;
430
+ UncontrolledDropdown.Menu = _DropdownMenu2.default;
420
431
 
421
- exports['default'] = UncontrolledDropdown;
432
+ exports.default = UncontrolledDropdown;
422
433
  module.exports = exports['default'];
@@ -38,29 +38,29 @@ var _splitComponentProps2 = require('./utils/splitComponentProps');
38
38
 
39
39
  var _splitComponentProps3 = _interopRequireDefault(_splitComponentProps2);
40
40
 
41
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
41
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
42
 
43
- var propTypes = (0, _extends3['default'])({}, _Dropdown2['default'].propTypes, {
43
+ var propTypes = (0, _extends3.default)({}, _Dropdown2.default.propTypes, {
44
44
 
45
45
  // Toggle props.
46
- bsStyle: _propTypes2['default'].string,
47
- bsSize: _propTypes2['default'].string,
48
- title: _propTypes2['default'].node.isRequired,
49
- noCaret: _propTypes2['default'].bool,
46
+ bsStyle: _propTypes2.default.string,
47
+ bsSize: _propTypes2.default.string,
48
+ title: _propTypes2.default.node.isRequired,
49
+ noCaret: _propTypes2.default.bool,
50
50
 
51
51
  // Override generated docs from <Dropdown>.
52
52
  /**
53
53
  * @private
54
54
  */
55
- children: _propTypes2['default'].node
55
+ children: _propTypes2.default.node
56
56
  });
57
57
 
58
58
  var DropdownButton = function (_React$Component) {
59
- (0, _inherits3['default'])(DropdownButton, _React$Component);
59
+ (0, _inherits3.default)(DropdownButton, _React$Component);
60
60
 
61
61
  function DropdownButton() {
62
- (0, _classCallCheck3['default'])(this, DropdownButton);
63
- return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
62
+ (0, _classCallCheck3.default)(this, DropdownButton);
63
+ return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
64
64
  }
65
65
 
66
66
  DropdownButton.prototype.render = function render() {
@@ -69,28 +69,22 @@ var DropdownButton = function (_React$Component) {
69
69
  bsStyle = _props.bsStyle,
70
70
  title = _props.title,
71
71
  children = _props.children,
72
- props = (0, _objectWithoutProperties3['default'])(_props, ['bsSize', 'bsStyle', 'title', 'children']);
72
+ props = (0, _objectWithoutProperties3.default)(_props, ['bsSize', 'bsStyle', 'title', 'children']);
73
73
 
74
- var _splitComponentProps = (0, _splitComponentProps3['default'])(props, _Dropdown2['default'].ControlledComponent),
74
+ var _splitComponentProps = (0, _splitComponentProps3.default)(props, _Dropdown2.default.ControlledComponent),
75
75
  dropdownProps = _splitComponentProps[0],
76
76
  toggleProps = _splitComponentProps[1];
77
77
 
78
- return _react2['default'].createElement(
79
- _Dropdown2['default'],
80
- (0, _extends3['default'])({}, dropdownProps, {
81
- bsSize: bsSize,
82
- bsStyle: bsStyle
83
- }),
84
- _react2['default'].createElement(
85
- _Dropdown2['default'].Toggle,
86
- (0, _extends3['default'])({}, toggleProps, {
87
- bsSize: bsSize,
88
- bsStyle: bsStyle
89
- }),
78
+ return _react2.default.createElement(
79
+ _Dropdown2.default,
80
+ (0, _extends3.default)({}, dropdownProps, { bsSize: bsSize, bsStyle: bsStyle }),
81
+ _react2.default.createElement(
82
+ _Dropdown2.default.Toggle,
83
+ (0, _extends3.default)({}, toggleProps, { bsSize: bsSize, bsStyle: bsStyle }),
90
84
  title
91
85
  ),
92
- _react2['default'].createElement(
93
- _Dropdown2['default'].Menu,
86
+ _react2.default.createElement(
87
+ _Dropdown2.default.Menu,
94
88
  null,
95
89
  children
96
90
  )
@@ -98,9 +92,9 @@ var DropdownButton = function (_React$Component) {
98
92
  };
99
93
 
100
94
  return DropdownButton;
101
- }(_react2['default'].Component);
95
+ }(_react2.default.Component);
102
96
 
103
97
  DropdownButton.propTypes = propTypes;
104
98
 
105
- exports['default'] = DropdownButton;
99
+ exports.default = DropdownButton;
106
100
  module.exports = exports['default'];
@@ -60,15 +60,15 @@ var _ValidComponentChildren = require('./utils/ValidComponentChildren');
60
60
 
61
61
  var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
62
62
 
63
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
63
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
64
64
 
65
65
  var propTypes = {
66
- open: _propTypes2['default'].bool,
67
- pullRight: _propTypes2['default'].bool,
68
- onClose: _propTypes2['default'].func,
69
- labelledBy: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].number]),
70
- onSelect: _propTypes2['default'].func,
71
- rootCloseEvent: _propTypes2['default'].oneOf(['click', 'mousedown'])
66
+ open: _propTypes2.default.bool,
67
+ pullRight: _propTypes2.default.bool,
68
+ onClose: _propTypes2.default.func,
69
+ labelledBy: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
70
+ onSelect: _propTypes2.default.func,
71
+ rootCloseEvent: _propTypes2.default.oneOf(['click', 'mousedown'])
72
72
  };
73
73
 
74
74
  var defaultProps = {
@@ -77,38 +77,25 @@ var defaultProps = {
77
77
  };
78
78
 
79
79
  var DropdownMenu = function (_React$Component) {
80
- (0, _inherits3['default'])(DropdownMenu, _React$Component);
80
+ (0, _inherits3.default)(DropdownMenu, _React$Component);
81
81
 
82
82
  function DropdownMenu(props) {
83
- (0, _classCallCheck3['default'])(this, DropdownMenu);
83
+ (0, _classCallCheck3.default)(this, DropdownMenu);
84
84
 
85
- var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));
85
+ var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props));
86
86
 
87
87
  _this.handleRootClose = _this.handleRootClose.bind(_this);
88
88
  _this.handleKeyDown = _this.handleKeyDown.bind(_this);
89
89
  return _this;
90
90
  }
91
91
 
92
- DropdownMenu.prototype.handleRootClose = function handleRootClose(event) {
93
- this.props.onClose(event, { source: 'rootClose' });
94
- };
95
-
96
- DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
97
- switch (event.keyCode) {
98
- case _keycode2['default'].codes.down:
99
- this.focusNext();
100
- event.preventDefault();
101
- break;
102
- case _keycode2['default'].codes.up:
103
- this.focusPrevious();
104
- event.preventDefault();
105
- break;
106
- case _keycode2['default'].codes.esc:
107
- case _keycode2['default'].codes.tab:
108
- this.props.onClose(event, { source: 'keydown' });
109
- break;
110
- default:
92
+ DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
93
+ var node = _reactDom2.default.findDOMNode(this);
94
+ if (!node) {
95
+ return [];
111
96
  }
97
+
98
+ return (0, _from2.default)(node.querySelectorAll('[tabIndex="-1"]'));
112
99
  };
113
100
 
114
101
  DropdownMenu.prototype.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
@@ -118,15 +105,6 @@ var DropdownMenu = function (_React$Component) {
118
105
  return { items: items, activeIndex: activeIndex };
119
106
  };
120
107
 
121
- DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
122
- var node = _reactDom2['default'].findDOMNode(this);
123
- if (!node) {
124
- return [];
125
- }
126
-
127
- return (0, _from2['default'])(node.querySelectorAll('[tabIndex="-1"]'));
128
- };
129
-
130
108
  DropdownMenu.prototype.focusNext = function focusNext() {
131
109
  var _getItemsAndActiveInd = this.getItemsAndActiveIndex(),
132
110
  items = _getItemsAndActiveInd.items,
@@ -153,6 +131,28 @@ var DropdownMenu = function (_React$Component) {
153
131
  items[prevIndex].focus();
154
132
  };
155
133
 
134
+ DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
135
+ switch (event.keyCode) {
136
+ case _keycode2.default.codes.down:
137
+ this.focusNext();
138
+ event.preventDefault();
139
+ break;
140
+ case _keycode2.default.codes.up:
141
+ this.focusPrevious();
142
+ event.preventDefault();
143
+ break;
144
+ case _keycode2.default.codes.esc:
145
+ case _keycode2.default.codes.tab:
146
+ this.props.onClose(event, { source: 'keydown' });
147
+ break;
148
+ default:
149
+ }
150
+ };
151
+
152
+ DropdownMenu.prototype.handleRootClose = function handleRootClose(event) {
153
+ this.props.onClose(event, { source: 'rootClose' });
154
+ };
155
+
156
156
  DropdownMenu.prototype.render = function render() {
157
157
  var _extends2,
158
158
  _this2 = this;
@@ -165,32 +165,32 @@ var DropdownMenu = function (_React$Component) {
165
165
  className = _props.className,
166
166
  rootCloseEvent = _props.rootCloseEvent,
167
167
  children = _props.children,
168
- props = (0, _objectWithoutProperties3['default'])(_props, ['open', 'pullRight', 'labelledBy', 'onSelect', 'className', 'rootCloseEvent', 'children']);
168
+ props = (0, _objectWithoutProperties3.default)(_props, ['open', 'pullRight', 'labelledBy', 'onSelect', 'className', 'rootCloseEvent', 'children']);
169
169
 
170
170
  var _splitBsPropsAndOmit = (0, _bootstrapUtils.splitBsPropsAndOmit)(props, ['onClose']),
171
171
  bsProps = _splitBsPropsAndOmit[0],
172
172
  elementProps = _splitBsPropsAndOmit[1];
173
173
 
174
- var classes = (0, _extends4['default'])({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'right')] = pullRight, _extends2));
174
+ var classes = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'right')] = pullRight, _extends2));
175
175
 
176
- return _react2['default'].createElement(
177
- _RootCloseWrapper2['default'],
176
+ return _react2.default.createElement(
177
+ _RootCloseWrapper2.default,
178
178
  {
179
179
  disabled: !open,
180
180
  onRootClose: this.handleRootClose,
181
181
  event: rootCloseEvent
182
182
  },
183
- _react2['default'].createElement(
183
+ _react2.default.createElement(
184
184
  'ul',
185
- (0, _extends4['default'])({}, elementProps, {
185
+ (0, _extends4.default)({}, elementProps, {
186
186
  role: 'menu',
187
- className: (0, _classnames2['default'])(className, classes),
187
+ className: (0, _classnames2.default)(className, classes),
188
188
  'aria-labelledby': labelledBy
189
189
  }),
190
- _ValidComponentChildren2['default'].map(children, function (child) {
191
- return _react2['default'].cloneElement(child, {
192
- onKeyDown: (0, _createChainedFunction2['default'])(child.props.onKeyDown, _this2.handleKeyDown),
193
- onSelect: (0, _createChainedFunction2['default'])(child.props.onSelect, onSelect)
190
+ _ValidComponentChildren2.default.map(children, function (child) {
191
+ return _react2.default.cloneElement(child, {
192
+ onKeyDown: (0, _createChainedFunction2.default)(child.props.onKeyDown, _this2.handleKeyDown),
193
+ onSelect: (0, _createChainedFunction2.default)(child.props.onSelect, onSelect)
194
194
  });
195
195
  })
196
196
  )
@@ -198,10 +198,10 @@ var DropdownMenu = function (_React$Component) {
198
198
  };
199
199
 
200
200
  return DropdownMenu;
201
- }(_react2['default'].Component);
201
+ }(_react2.default.Component);
202
202
 
203
203
  DropdownMenu.propTypes = propTypes;
204
204
  DropdownMenu.defaultProps = defaultProps;
205
205
 
206
- exports['default'] = (0, _bootstrapUtils.bsClass)('dropdown-menu', DropdownMenu);
206
+ exports.default = (0, _bootstrapUtils.bsClass)('dropdown-menu', DropdownMenu);
207
207
  module.exports = exports['default'];