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/TabPane.js CHANGED
@@ -1,19 +1,15 @@
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 from 'react';
8
7
  import PropTypes from 'prop-types';
9
8
  import elementType from 'prop-types-extra/lib/elementType';
10
9
  import warning from 'warning';
11
-
12
10
  import { bsClass, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils';
13
11
  import createChainedFunction from './utils/createChainedFunction';
14
-
15
12
  import Fade from './Fade';
16
-
17
13
  var propTypes = {
18
14
  /**
19
15
  * Uniquely identify the `<TabPane>` among its siblings.
@@ -80,7 +76,6 @@ var propTypes = {
80
76
  */
81
77
  unmountOnExit: PropTypes.bool
82
78
  };
83
-
84
79
  var contextTypes = {
85
80
  $bs_tabContainer: PropTypes.shape({
86
81
  getTabId: PropTypes.func,
@@ -97,44 +92,46 @@ var contextTypes = {
97
92
  exiting: PropTypes.bool.isRequired
98
93
  })
99
94
  };
100
-
101
95
  /**
102
96
  * We override the `<TabContainer>` context so `<Nav>`s in `<TabPane>`s don't
103
97
  * conflict with the top level one.
104
98
  */
99
+
105
100
  var childContextTypes = {
106
101
  $bs_tabContainer: PropTypes.oneOf([null])
107
102
  };
108
103
 
109
- var TabPane = function (_React$Component) {
110
- _inherits(TabPane, _React$Component);
104
+ var TabPane =
105
+ /*#__PURE__*/
106
+ function (_React$Component) {
107
+ _inheritsLoose(TabPane, _React$Component);
111
108
 
112
109
  function TabPane(props, context) {
113
- _classCallCheck(this, TabPane);
114
-
115
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
116
-
117
- _this.handleEnter = _this.handleEnter.bind(_this);
118
- _this.handleExited = _this.handleExited.bind(_this);
110
+ var _this;
119
111
 
112
+ _this = _React$Component.call(this, props, context) || this;
113
+ _this.handleEnter = _this.handleEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
114
+ _this.handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
120
115
  _this.in = false;
121
116
  return _this;
122
117
  }
123
118
 
124
- TabPane.prototype.getChildContext = function getChildContext() {
119
+ var _proto = TabPane.prototype;
120
+
121
+ _proto.getChildContext = function getChildContext() {
125
122
  return {
126
123
  $bs_tabContainer: null
127
124
  };
128
125
  };
129
126
 
130
- TabPane.prototype.componentDidMount = function componentDidMount() {
127
+ _proto.componentDidMount = function componentDidMount() {
131
128
  if (this.shouldBeIn()) {
132
129
  // In lieu of the action event firing.
133
130
  this.handleEnter();
134
131
  }
135
132
  };
136
133
 
137
- TabPane.prototype.componentDidUpdate = function componentDidUpdate() {
134
+ _proto.componentDidUpdate = function componentDidUpdate() {
138
135
  if (this.in) {
139
136
  if (!this.shouldBeIn()) {
140
137
  // We shouldn't be active any more. Notify the parent.
@@ -146,14 +143,14 @@ var TabPane = function (_React$Component) {
146
143
  }
147
144
  };
148
145
 
149
- TabPane.prototype.componentWillUnmount = function componentWillUnmount() {
146
+ _proto.componentWillUnmount = function componentWillUnmount() {
150
147
  if (this.in) {
151
148
  // In lieu of the action event firing.
152
149
  this.handleExited();
153
150
  }
154
151
  };
155
152
 
156
- TabPane.prototype.getAnimation = function getAnimation() {
153
+ _proto.getAnimation = function getAnimation() {
157
154
  if (this.props.animation != null) {
158
155
  return this.props.animation;
159
156
  }
@@ -162,8 +159,9 @@ var TabPane = function (_React$Component) {
162
159
  return tabContent && tabContent.animation;
163
160
  };
164
161
 
165
- TabPane.prototype.handleEnter = function handleEnter() {
162
+ _proto.handleEnter = function handleEnter() {
166
163
  var tabContent = this.context.$bs_tabContent;
164
+
167
165
  if (!tabContent) {
168
166
  return;
169
167
  }
@@ -171,8 +169,9 @@ var TabPane = function (_React$Component) {
171
169
  this.in = tabContent.onPaneEnter(this, this.props.eventKey);
172
170
  };
173
171
 
174
- TabPane.prototype.handleExited = function handleExited() {
172
+ _proto.handleExited = function handleExited() {
175
173
  var tabContent = this.context.$bs_tabContent;
174
+
176
175
  if (!tabContent) {
177
176
  return;
178
177
  }
@@ -181,34 +180,33 @@ var TabPane = function (_React$Component) {
181
180
  this.in = false;
182
181
  };
183
182
 
184
- TabPane.prototype.isActive = function isActive() {
183
+ _proto.isActive = function isActive() {
185
184
  var tabContent = this.context.$bs_tabContent;
186
185
  var activeKey = tabContent && tabContent.activeKey;
187
-
188
186
  return this.props.eventKey === activeKey;
189
187
  };
190
188
 
191
- TabPane.prototype.shouldBeIn = function shouldBeIn() {
189
+ _proto.shouldBeIn = function shouldBeIn() {
192
190
  return this.getAnimation() && this.isActive();
193
191
  };
194
192
 
195
- TabPane.prototype.render = function render() {
196
- var _props = this.props,
197
- eventKey = _props.eventKey,
198
- className = _props.className,
199
- onEnter = _props.onEnter,
200
- onEntering = _props.onEntering,
201
- onEntered = _props.onEntered,
202
- onExit = _props.onExit,
203
- onExiting = _props.onExiting,
204
- onExited = _props.onExited,
205
- propsMountOnEnter = _props.mountOnEnter,
206
- propsUnmountOnExit = _props.unmountOnExit,
207
- props = _objectWithoutProperties(_props, ['eventKey', 'className', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'mountOnEnter', 'unmountOnExit']);
208
-
209
- var _context = this.context,
210
- tabContent = _context.$bs_tabContent,
211
- tabContainer = _context.$bs_tabContainer;
193
+ _proto.render = function render() {
194
+ var _this$props = this.props,
195
+ eventKey = _this$props.eventKey,
196
+ className = _this$props.className,
197
+ onEnter = _this$props.onEnter,
198
+ onEntering = _this$props.onEntering,
199
+ onEntered = _this$props.onEntered,
200
+ onExit = _this$props.onExit,
201
+ onExiting = _this$props.onExiting,
202
+ onExited = _this$props.onExited,
203
+ propsMountOnEnter = _this$props.mountOnEnter,
204
+ propsUnmountOnExit = _this$props.unmountOnExit,
205
+ props = _objectWithoutPropertiesLoose(_this$props, ["eventKey", "className", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "mountOnEnter", "unmountOnExit"]);
206
+
207
+ var _this$context = this.context,
208
+ tabContent = _this$context.$bs_tabContent,
209
+ tabContainer = _this$context.$bs_tabContainer;
212
210
 
213
211
  var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['animation']),
214
212
  bsProps = _splitBsPropsAndOmit[0],
@@ -216,7 +214,6 @@ var TabPane = function (_React$Component) {
216
214
 
217
215
  var active = this.isActive();
218
216
  var animation = this.getAnimation();
219
-
220
217
  var mountOnEnter = propsMountOnEnter != null ? propsMountOnEnter : tabContent && tabContent.mountOnEnter;
221
218
  var unmountOnExit = propsUnmountOnExit != null ? propsUnmountOnExit : tabContent && tabContent.unmountOnExit;
222
219
 
@@ -235,36 +232,30 @@ var TabPane = function (_React$Component) {
235
232
  });
236
233
 
237
234
  if (tabContainer) {
238
- process.env.NODE_ENV !== 'production' ? warning(!elementProps.id && !elementProps['aria-labelledby'], 'In the context of a `<TabContainer>`, `<TabPanes>` are given ' + 'generated `id` and `aria-labelledby` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly provide a `generateChildId` ' + 'prop to the parent `<TabContainer>`.') : void 0;
239
-
235
+ process.env.NODE_ENV !== "production" ? warning(!elementProps.id && !elementProps['aria-labelledby'], 'In the context of a `<TabContainer>`, `<TabPanes>` are given ' + 'generated `id` and `aria-labelledby` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly provide a `generateChildId` ' + 'prop to the parent `<TabContainer>`.') : void 0;
240
236
  elementProps.id = tabContainer.getPaneId(eventKey);
241
237
  elementProps['aria-labelledby'] = tabContainer.getTabId(eventKey);
242
238
  }
243
239
 
244
- var pane = React.createElement('div', _extends({}, elementProps, {
245
- role: 'tabpanel',
246
- 'aria-hidden': !active,
240
+ var pane = React.createElement("div", _extends({}, elementProps, {
241
+ role: "tabpanel",
242
+ "aria-hidden": !active,
247
243
  className: classNames(className, classes)
248
244
  }));
249
245
 
250
246
  if (Transition) {
251
247
  var exiting = tabContent && tabContent.exiting;
252
-
253
- return React.createElement(
254
- Transition,
255
- {
256
- 'in': active && !exiting,
257
- onEnter: createChainedFunction(this.handleEnter, onEnter),
258
- onEntering: onEntering,
259
- onEntered: onEntered,
260
- onExit: onExit,
261
- onExiting: onExiting,
262
- onExited: createChainedFunction(this.handleExited, onExited),
263
- mountOnEnter: mountOnEnter,
264
- unmountOnExit: unmountOnExit
265
- },
266
- pane
267
- );
248
+ return React.createElement(Transition, {
249
+ in: active && !exiting,
250
+ onEnter: createChainedFunction(this.handleEnter, onEnter),
251
+ onEntering: onEntering,
252
+ onEntered: onEntered,
253
+ onExit: onExit,
254
+ onExiting: onExiting,
255
+ onExited: createChainedFunction(this.handleExited, onExited),
256
+ mountOnEnter: mountOnEnter,
257
+ unmountOnExit: unmountOnExit
258
+ }, pane);
268
259
  }
269
260
 
270
261
  return pane;
@@ -276,5 +267,4 @@ var TabPane = function (_React$Component) {
276
267
  TabPane.propTypes = propTypes;
277
268
  TabPane.contextTypes = contextTypes;
278
269
  TabPane.childContextTypes = childContextTypes;
279
-
280
270
  export default bsClass('tab-pane', TabPane);
package/es/Table.js CHANGED
@@ -1,14 +1,10 @@
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 PropTypes from 'prop-types';
9
-
10
7
  import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
11
-
12
8
  var propTypes = {
13
9
  striped: PropTypes.bool,
14
10
  bordered: PropTypes.bool,
@@ -16,7 +12,6 @@ var propTypes = {
16
12
  hover: PropTypes.bool,
17
13
  responsive: PropTypes.bool
18
14
  };
19
-
20
15
  var defaultProps = {
21
16
  bordered: false,
22
17
  condensed: false,
@@ -25,26 +20,28 @@ var defaultProps = {
25
20
  striped: false
26
21
  };
27
22
 
28
- var Table = function (_React$Component) {
29
- _inherits(Table, _React$Component);
23
+ var Table =
24
+ /*#__PURE__*/
25
+ function (_React$Component) {
26
+ _inheritsLoose(Table, _React$Component);
30
27
 
31
28
  function Table() {
32
- _classCallCheck(this, Table);
33
-
34
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
29
+ return _React$Component.apply(this, arguments) || this;
35
30
  }
36
31
 
37
- Table.prototype.render = function render() {
32
+ var _proto = Table.prototype;
33
+
34
+ _proto.render = function render() {
38
35
  var _extends2;
39
36
 
40
- var _props = this.props,
41
- striped = _props.striped,
42
- bordered = _props.bordered,
43
- condensed = _props.condensed,
44
- hover = _props.hover,
45
- responsive = _props.responsive,
46
- className = _props.className,
47
- props = _objectWithoutProperties(_props, ['striped', 'bordered', 'condensed', 'hover', 'responsive', 'className']);
37
+ var _this$props = this.props,
38
+ striped = _this$props.striped,
39
+ bordered = _this$props.bordered,
40
+ condensed = _this$props.condensed,
41
+ hover = _this$props.hover,
42
+ responsive = _this$props.responsive,
43
+ className = _this$props.className,
44
+ props = _objectWithoutPropertiesLoose(_this$props, ["striped", "bordered", "condensed", "hover", "responsive", "className"]);
48
45
 
49
46
  var _splitBsProps = splitBsProps(props),
50
47
  bsProps = _splitBsProps[0],
@@ -52,14 +49,14 @@ var Table = function (_React$Component) {
52
49
 
53
50
  var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'striped')] = striped, _extends2[prefix(bsProps, 'bordered')] = bordered, _extends2[prefix(bsProps, 'condensed')] = condensed, _extends2[prefix(bsProps, 'hover')] = hover, _extends2));
54
51
 
55
- var table = React.createElement('table', _extends({}, elementProps, { className: classNames(className, classes) }));
52
+ var table = React.createElement("table", _extends({}, elementProps, {
53
+ className: classNames(className, classes)
54
+ }));
56
55
 
57
56
  if (responsive) {
58
- return React.createElement(
59
- 'div',
60
- { className: prefix(bsProps, 'responsive') },
61
- table
62
- );
57
+ return React.createElement("div", {
58
+ className: prefix(bsProps, 'responsive')
59
+ }, table);
63
60
  }
64
61
 
65
62
  return table;
@@ -70,5 +67,4 @@ var Table = function (_React$Component) {
70
67
 
71
68
  Table.propTypes = propTypes;
72
69
  Table.defaultProps = defaultProps;
73
-
74
70
  export default bsClass('table', Table);
package/es/Tabs.js CHANGED
@@ -1,22 +1,18 @@
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 React from 'react';
7
5
  import PropTypes from 'prop-types';
8
6
  import requiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
9
7
  import uncontrollable from 'uncontrollable';
10
-
8
+ import elementType from 'prop-types-extra/lib/elementType';
11
9
  import Nav from './Nav';
12
10
  import NavItem from './NavItem';
13
11
  import UncontrolledTabContainer from './TabContainer';
14
12
  import TabContent from './TabContent';
15
13
  import { bsClass as setBsClass } from './utils/bootstrapUtils';
16
14
  import ValidComponentChildren from './utils/ValidComponentChildren';
17
-
18
15
  var TabContainer = UncontrolledTabContainer.ControlledComponent;
19
-
20
16
  var propTypes = {
21
17
  /**
22
18
  * Mark the Tab with a matching `eventKey` as active.
@@ -30,8 +26,12 @@ var propTypes = {
30
26
  */
31
27
  bsStyle: PropTypes.oneOf(['tabs', 'pills']),
32
28
 
33
- animation: PropTypes.bool,
34
-
29
+ /**
30
+ * Sets a default animation strategy. Use `false` to disable, `true`
31
+ * to enable the default `<Fade>` animation, or a react-transition-group
32
+ * v2 `<Transition/>` component.
33
+ */
34
+ animation: PropTypes.oneOfType([PropTypes.bool, elementType]),
35
35
  id: requiredForA11y(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
36
36
 
37
37
  /**
@@ -58,7 +58,6 @@ var propTypes = {
58
58
  */
59
59
  unmountOnExit: PropTypes.bool
60
60
  };
61
-
62
61
  var defaultProps = {
63
62
  bsStyle: 'tabs',
64
63
  animation: true,
@@ -67,26 +66,27 @@ var defaultProps = {
67
66
  };
68
67
 
69
68
  function getDefaultActiveKey(children) {
70
- var defaultActiveKey = void 0;
69
+ var defaultActiveKey;
71
70
  ValidComponentChildren.forEach(children, function (child) {
72
71
  if (defaultActiveKey == null) {
73
72
  defaultActiveKey = child.props.eventKey;
74
73
  }
75
74
  });
76
-
77
75
  return defaultActiveKey;
78
76
  }
79
77
 
80
- var Tabs = function (_React$Component) {
81
- _inherits(Tabs, _React$Component);
78
+ var Tabs =
79
+ /*#__PURE__*/
80
+ function (_React$Component) {
81
+ _inheritsLoose(Tabs, _React$Component);
82
82
 
83
83
  function Tabs() {
84
- _classCallCheck(this, Tabs);
85
-
86
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
84
+ return _React$Component.apply(this, arguments) || this;
87
85
  }
88
86
 
89
- Tabs.prototype.renderTab = function renderTab(child) {
87
+ var _proto = Tabs.prototype;
88
+
89
+ _proto.renderTab = function renderTab(child) {
90
90
  var _child$props = child.props,
91
91
  title = _child$props.title,
92
92
  eventKey = _child$props.eventKey,
@@ -97,57 +97,42 @@ var Tabs = function (_React$Component) {
97
97
  return null;
98
98
  }
99
99
 
100
- return React.createElement(
101
- NavItem,
102
- { eventKey: eventKey, disabled: disabled, className: tabClassName },
103
- title
104
- );
100
+ return React.createElement(NavItem, {
101
+ eventKey: eventKey,
102
+ disabled: disabled,
103
+ className: tabClassName
104
+ }, title);
105
105
  };
106
106
 
107
- Tabs.prototype.render = function render() {
108
- var _props = this.props,
109
- id = _props.id,
110
- onSelect = _props.onSelect,
111
- animation = _props.animation,
112
- mountOnEnter = _props.mountOnEnter,
113
- unmountOnExit = _props.unmountOnExit,
114
- bsClass = _props.bsClass,
115
- className = _props.className,
116
- style = _props.style,
117
- children = _props.children,
118
- _props$activeKey = _props.activeKey,
119
- activeKey = _props$activeKey === undefined ? getDefaultActiveKey(children) : _props$activeKey,
120
- props = _objectWithoutProperties(_props, ['id', 'onSelect', 'animation', 'mountOnEnter', 'unmountOnExit', 'bsClass', 'className', 'style', 'children', 'activeKey']);
121
-
122
- return React.createElement(
123
- TabContainer,
124
- {
125
- id: id,
126
- activeKey: activeKey,
127
- onSelect: onSelect,
128
- className: className,
129
- style: style
130
- },
131
- React.createElement(
132
- 'div',
133
- null,
134
- React.createElement(
135
- Nav,
136
- _extends({}, props, { role: 'tablist' }),
137
- ValidComponentChildren.map(children, this.renderTab)
138
- ),
139
- React.createElement(
140
- TabContent,
141
- {
142
- bsClass: bsClass,
143
- animation: animation,
144
- mountOnEnter: mountOnEnter,
145
- unmountOnExit: unmountOnExit
146
- },
147
- children
148
- )
149
- )
150
- );
107
+ _proto.render = function render() {
108
+ var _this$props = this.props,
109
+ id = _this$props.id,
110
+ onSelect = _this$props.onSelect,
111
+ animation = _this$props.animation,
112
+ mountOnEnter = _this$props.mountOnEnter,
113
+ unmountOnExit = _this$props.unmountOnExit,
114
+ bsClass = _this$props.bsClass,
115
+ className = _this$props.className,
116
+ style = _this$props.style,
117
+ children = _this$props.children,
118
+ _this$props$activeKey = _this$props.activeKey,
119
+ activeKey = _this$props$activeKey === void 0 ? getDefaultActiveKey(children) : _this$props$activeKey,
120
+ props = _objectWithoutPropertiesLoose(_this$props, ["id", "onSelect", "animation", "mountOnEnter", "unmountOnExit", "bsClass", "className", "style", "children", "activeKey"]);
121
+
122
+ return React.createElement(TabContainer, {
123
+ id: id,
124
+ activeKey: activeKey,
125
+ onSelect: onSelect,
126
+ className: className,
127
+ style: style
128
+ }, React.createElement("div", null, React.createElement(Nav, _extends({}, props, {
129
+ role: "tablist"
130
+ }), ValidComponentChildren.map(children, this.renderTab)), React.createElement(TabContent, {
131
+ bsClass: bsClass,
132
+ animation: animation,
133
+ mountOnEnter: mountOnEnter,
134
+ unmountOnExit: unmountOnExit
135
+ }, children)));
151
136
  };
152
137
 
153
138
  return Tabs;
@@ -155,7 +140,7 @@ var Tabs = function (_React$Component) {
155
140
 
156
141
  Tabs.propTypes = propTypes;
157
142
  Tabs.defaultProps = defaultProps;
158
-
159
143
  setBsClass('tab', Tabs);
160
-
161
- export default uncontrollable(Tabs, { activeKey: 'onSelect' });
144
+ export default uncontrollable(Tabs, {
145
+ activeKey: 'onSelect'
146
+ });
package/es/Thumbnail.js CHANGED
@@ -1,58 +1,60 @@
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';
6
- /* eslint-disable jsx-a11y/alt-text */
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";
7
4
 
5
+ /* eslint-disable jsx-a11y/alt-text */
8
6
  import classNames from 'classnames';
9
7
  import React from 'react';
10
8
  import PropTypes from 'prop-types';
11
-
12
9
  import SafeAnchor from './SafeAnchor';
13
10
  import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
14
-
15
11
  var propTypes = {
16
12
  /**
17
13
  * src property that is passed down to the image inside this component
18
14
  */
19
15
  src: PropTypes.string,
16
+
20
17
  /**
21
18
  * alt property that is passed down to the image inside this component
22
19
  */
23
20
  alt: PropTypes.string,
21
+
24
22
  /**
25
23
  * href property that is passed down to the image inside this component
26
24
  */
27
25
  href: PropTypes.string,
26
+
28
27
  /**
29
28
  * onError callback that is passed down to the image inside this component
30
29
  */
31
30
  onError: PropTypes.func,
31
+
32
32
  /**
33
33
  * onLoad callback that is passed down to the image inside this component
34
34
  */
35
35
  onLoad: PropTypes.func
36
36
  };
37
37
 
38
- var Thumbnail = function (_React$Component) {
39
- _inherits(Thumbnail, _React$Component);
38
+ var Thumbnail =
39
+ /*#__PURE__*/
40
+ function (_React$Component) {
41
+ _inheritsLoose(Thumbnail, _React$Component);
40
42
 
41
43
  function Thumbnail() {
42
- _classCallCheck(this, Thumbnail);
43
-
44
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
44
+ return _React$Component.apply(this, arguments) || this;
45
45
  }
46
46
 
47
- Thumbnail.prototype.render = function render() {
48
- var _props = this.props,
49
- src = _props.src,
50
- alt = _props.alt,
51
- onError = _props.onError,
52
- onLoad = _props.onLoad,
53
- className = _props.className,
54
- children = _props.children,
55
- props = _objectWithoutProperties(_props, ['src', 'alt', 'onError', 'onLoad', 'className', 'children']);
47
+ var _proto = Thumbnail.prototype;
48
+
49
+ _proto.render = function render() {
50
+ var _this$props = this.props,
51
+ src = _this$props.src,
52
+ alt = _this$props.alt,
53
+ onError = _this$props.onError,
54
+ onLoad = _this$props.onLoad,
55
+ className = _this$props.className,
56
+ children = _this$props.children,
57
+ props = _objectWithoutPropertiesLoose(_this$props, ["src", "alt", "onError", "onLoad", "className", "children"]);
56
58
 
57
59
  var _splitBsProps = splitBsProps(props),
58
60
  bsProps = _splitBsProps[0],
@@ -60,22 +62,20 @@ var Thumbnail = function (_React$Component) {
60
62
 
61
63
  var Component = elementProps.href ? SafeAnchor : 'div';
62
64
  var classes = getClassSet(bsProps);
63
-
64
- return React.createElement(
65
- Component,
66
- _extends({}, elementProps, { className: classNames(className, classes) }),
67
- React.createElement('img', { src: src, alt: alt, onError: onError, onLoad: onLoad }),
68
- children && React.createElement(
69
- 'div',
70
- { className: 'caption' },
71
- children
72
- )
73
- );
65
+ return React.createElement(Component, _extends({}, elementProps, {
66
+ className: classNames(className, classes)
67
+ }), React.createElement("img", {
68
+ src: src,
69
+ alt: alt,
70
+ onError: onError,
71
+ onLoad: onLoad
72
+ }), children && React.createElement("div", {
73
+ className: "caption"
74
+ }, children));
74
75
  };
75
76
 
76
77
  return Thumbnail;
77
78
  }(React.Component);
78
79
 
79
80
  Thumbnail.propTypes = propTypes;
80
-
81
81
  export default bsClass('thumbnail', Thumbnail);