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
@@ -1,40 +1,40 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4
- import _inherits from 'babel-runtime/helpers/inherits';
1
+ import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
2
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
5
3
  import PropTypes from 'prop-types';
6
4
  import React from 'react';
7
-
8
5
  import { prefix, splitBsProps, bsClass } from './utils/bootstrapUtils';
9
6
  import Collapse from './Collapse';
10
-
11
7
  var propTypes = {
12
8
  /**
13
9
  * Callback fired before the component expands
14
10
  */
15
11
  onEnter: PropTypes.func,
12
+
16
13
  /**
17
14
  * Callback fired after the component starts to expand
18
15
  */
19
16
  onEntering: PropTypes.func,
17
+
20
18
  /**
21
19
  * Callback fired after the component has expanded
22
20
  */
23
21
  onEntered: PropTypes.func,
22
+
24
23
  /**
25
24
  * Callback fired before the component collapses
26
25
  */
27
26
  onExit: PropTypes.func,
27
+
28
28
  /**
29
29
  * Callback fired after the component starts to collapse
30
30
  */
31
31
  onExiting: PropTypes.func,
32
+
32
33
  /**
33
34
  * Callback fired after the component has collapsed
34
35
  */
35
36
  onExited: PropTypes.func
36
37
  };
37
-
38
38
  var contextTypes = {
39
39
  $bs_panel: PropTypes.shape({
40
40
  headingId: PropTypes.string,
@@ -44,16 +44,18 @@ var contextTypes = {
44
44
  })
45
45
  };
46
46
 
47
- var PanelCollapse = function (_React$Component) {
48
- _inherits(PanelCollapse, _React$Component);
47
+ var PanelCollapse =
48
+ /*#__PURE__*/
49
+ function (_React$Component) {
50
+ _inheritsLoose(PanelCollapse, _React$Component);
49
51
 
50
52
  function PanelCollapse() {
51
- _classCallCheck(this, PanelCollapse);
52
-
53
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
53
+ return _React$Component.apply(this, arguments) || this;
54
54
  }
55
55
 
56
- PanelCollapse.prototype.render = function render() {
56
+ var _proto = PanelCollapse.prototype;
57
+
58
+ _proto.render = function render() {
57
59
  var children = this.props.children;
58
60
 
59
61
  var _ref = this.context.$bs_panel || {},
@@ -74,15 +76,11 @@ var PanelCollapse = function (_React$Component) {
74
76
  props['aria-labelledby'] = headingId;
75
77
  }
76
78
 
77
- return React.createElement(
78
- Collapse,
79
- _extends({ 'in': expanded }, props),
80
- React.createElement(
81
- 'div',
82
- { className: prefix(bsProps, 'collapse') },
83
- children
84
- )
85
- );
79
+ return React.createElement(Collapse, _extends({
80
+ in: expanded
81
+ }, props), React.createElement("div", {
82
+ className: prefix(bsProps, 'collapse')
83
+ }, children));
86
84
  };
87
85
 
88
86
  return PanelCollapse;
@@ -90,5 +88,4 @@ var PanelCollapse = function (_React$Component) {
90
88
 
91
89
  PanelCollapse.propTypes = propTypes;
92
90
  PanelCollapse.contextTypes = contextTypes;
93
-
94
91
  export default bsClass('panel', PanelCollapse);
package/es/PanelFooter.js CHANGED
@@ -1,31 +1,30 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4
- import _inherits from 'babel-runtime/helpers/inherits';
1
+ import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
2
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
5
3
  import PropTypes from 'prop-types';
6
4
  import React from 'react';
7
5
  import cn from 'classnames';
8
6
  import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
9
-
10
7
  var contextTypes = {
11
8
  $bs_panel: PropTypes.shape({
12
9
  bsClass: PropTypes.string
13
10
  })
14
11
  };
15
12
 
16
- var PanelFooter = function (_React$Component) {
17
- _inherits(PanelFooter, _React$Component);
13
+ var PanelFooter =
14
+ /*#__PURE__*/
15
+ function (_React$Component) {
16
+ _inheritsLoose(PanelFooter, _React$Component);
18
17
 
19
18
  function PanelFooter() {
20
- _classCallCheck(this, PanelFooter);
21
-
22
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
19
+ return _React$Component.apply(this, arguments) || this;
23
20
  }
24
21
 
25
- PanelFooter.prototype.render = function render() {
26
- var _props = this.props,
27
- children = _props.children,
28
- className = _props.className;
22
+ var _proto = PanelFooter.prototype;
23
+
24
+ _proto.render = function render() {
25
+ var _this$props = this.props,
26
+ children = _this$props.children,
27
+ className = _this$props.className;
29
28
 
30
29
  var _ref = this.context.$bs_panel || {},
31
30
  _bsClass = _ref.bsClass;
@@ -35,19 +34,13 @@ var PanelFooter = function (_React$Component) {
35
34
  elementProps = _splitBsProps[1];
36
35
 
37
36
  bsProps.bsClass = _bsClass || bsProps.bsClass;
38
-
39
- return React.createElement(
40
- 'div',
41
- _extends({}, elementProps, {
42
- className: cn(className, prefix(bsProps, 'footer'))
43
- }),
44
- children
45
- );
37
+ return React.createElement("div", _extends({}, elementProps, {
38
+ className: cn(className, prefix(bsProps, 'footer'))
39
+ }), children);
46
40
  };
47
41
 
48
42
  return PanelFooter;
49
43
  }(React.Component);
50
44
 
51
45
  PanelFooter.contextTypes = contextTypes;
52
-
53
46
  export default bsClass('panel', PanelFooter);
package/es/PanelGroup.js CHANGED
@@ -1,19 +1,16 @@
1
- import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
2
- import _extends from 'babel-runtime/helpers/extends';
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 _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
3
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
6
4
  import classNames from 'classnames';
7
5
  import PropTypes from 'prop-types';
8
6
  import React, { cloneElement } from 'react';
9
7
  import uncontrollable from 'uncontrollable';
10
-
11
8
  import { bsClass, getClassSet, splitBsPropsAndOmit } from './utils/bootstrapUtils';
12
9
  import ValidComponentChildren from './utils/ValidComponentChildren';
13
10
  import { generatedId } from './utils/PropTypes';
14
-
15
11
  var propTypes = {
16
12
  accordion: PropTypes.bool,
13
+
17
14
  /**
18
15
  * When `accordion` is enabled, `activeKey` controls the which child `Panel` is expanded. `activeKey` should
19
16
  * match a child Panel `eventKey` prop exactly.
@@ -52,11 +49,9 @@ var propTypes = {
52
49
  */
53
50
  id: generatedId('PanelGroup')
54
51
  };
55
-
56
52
  var defaultProps = {
57
53
  accordion: false
58
54
  };
59
-
60
55
  var childContextTypes = {
61
56
  $bs_panelGroup: PropTypes.shape({
62
57
  getId: PropTypes.func,
@@ -67,30 +62,44 @@ var childContextTypes = {
67
62
  })
68
63
  };
69
64
 
70
- var PanelGroup = function (_React$Component) {
71
- _inherits(PanelGroup, _React$Component);
65
+ var PanelGroup =
66
+ /*#__PURE__*/
67
+ function (_React$Component) {
68
+ _inheritsLoose(PanelGroup, _React$Component);
69
+
70
+ function PanelGroup() {
71
+ var _this;
72
72
 
73
- function PanelGroup(props, context) {
74
- _classCallCheck(this, PanelGroup);
73
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
74
+ args[_key] = arguments[_key];
75
+ }
75
76
 
76
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
77
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
78
+
79
+ _this.handleSelect = function (key, expanded, e) {
80
+ if (expanded) {
81
+ _this.props.onSelect(key, e);
82
+ } else if (_this.props.activeKey === key) {
83
+ _this.props.onSelect(null, e);
84
+ }
85
+ };
77
86
 
78
- _this.handleSelect = _this.handleSelect.bind(_this);
79
87
  return _this;
80
88
  }
81
89
 
82
- PanelGroup.prototype.getChildContext = function getChildContext() {
83
- var _props = this.props,
84
- activeKey = _props.activeKey,
85
- accordion = _props.accordion,
86
- generateChildId = _props.generateChildId,
87
- id = _props.id;
90
+ var _proto = PanelGroup.prototype;
88
91
 
92
+ _proto.getChildContext = function getChildContext() {
93
+ var _this$props = this.props,
94
+ activeKey = _this$props.activeKey,
95
+ accordion = _this$props.accordion,
96
+ generateChildId = _this$props.generateChildId,
97
+ id = _this$props.id;
89
98
  var getId = null;
90
99
 
91
100
  if (accordion) {
92
101
  getId = generateChildId || function (key, type) {
93
- return id ? id + '-' + type + '-' + key : null;
102
+ return id ? id + "-" + type + "-" + key : null;
94
103
  };
95
104
  }
96
105
 
@@ -106,18 +115,12 @@ var PanelGroup = function (_React$Component) {
106
115
  };
107
116
  };
108
117
 
109
- PanelGroup.prototype.handleSelect = function handleSelect(key, expanded, e) {
110
- if (expanded) {
111
- this.props.onSelect(key, e);
112
- }
113
- };
114
-
115
- PanelGroup.prototype.render = function render() {
116
- var _props2 = this.props,
117
- accordion = _props2.accordion,
118
- className = _props2.className,
119
- children = _props2.children,
120
- props = _objectWithoutProperties(_props2, ['accordion', 'className', 'children']);
118
+ _proto.render = function render() {
119
+ var _this$props2 = this.props,
120
+ accordion = _this$props2.accordion,
121
+ className = _this$props2.className,
122
+ children = _this$props2.children,
123
+ props = _objectWithoutPropertiesLoose(_this$props2, ["accordion", "className", "children"]);
121
124
 
122
125
  var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['onSelect', 'activeKey']),
123
126
  bsProps = _splitBsPropsAndOmit[0],
@@ -128,16 +131,13 @@ var PanelGroup = function (_React$Component) {
128
131
  }
129
132
 
130
133
  var classes = getClassSet(bsProps);
131
-
132
- return React.createElement(
133
- 'div',
134
- _extends({}, elementProps, { className: classNames(className, classes) }),
135
- ValidComponentChildren.map(children, function (child) {
136
- return cloneElement(child, {
137
- bsStyle: child.props.bsStyle || bsProps.bsStyle
138
- });
139
- })
140
- );
134
+ return React.createElement("div", _extends({}, elementProps, {
135
+ className: classNames(className, classes)
136
+ }), ValidComponentChildren.map(children, function (child) {
137
+ return cloneElement(child, {
138
+ bsStyle: child.props.bsStyle || bsProps.bsStyle
139
+ });
140
+ }));
141
141
  };
142
142
 
143
143
  return PanelGroup;
@@ -146,7 +146,6 @@ var PanelGroup = function (_React$Component) {
146
146
  PanelGroup.propTypes = propTypes;
147
147
  PanelGroup.defaultProps = defaultProps;
148
148
  PanelGroup.childContextTypes = childContextTypes;
149
-
150
149
  export default uncontrollable(bsClass('panel-group', PanelGroup), {
151
150
  activeKey: 'onSelect'
152
151
  });
@@ -1,23 +1,17 @@
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 PropTypes from 'prop-types';
7
5
  import React from 'react';
8
6
  import cn from 'classnames';
9
7
  import elementType from 'react-prop-types/lib/elementType';
10
-
11
8
  import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
12
-
13
9
  var propTypes = {
14
10
  componentClass: elementType
15
11
  };
16
-
17
12
  var defaultProps = {
18
13
  componentClass: 'div'
19
14
  };
20
-
21
15
  var contextTypes = {
22
16
  $bs_panel: PropTypes.shape({
23
17
  headingId: PropTypes.string,
@@ -25,21 +19,23 @@ var contextTypes = {
25
19
  })
26
20
  };
27
21
 
28
- var PanelHeading = function (_React$Component) {
29
- _inherits(PanelHeading, _React$Component);
22
+ var PanelHeading =
23
+ /*#__PURE__*/
24
+ function (_React$Component) {
25
+ _inheritsLoose(PanelHeading, _React$Component);
30
26
 
31
27
  function PanelHeading() {
32
- _classCallCheck(this, PanelHeading);
33
-
34
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
28
+ return _React$Component.apply(this, arguments) || this;
35
29
  }
36
30
 
37
- PanelHeading.prototype.render = function render() {
38
- var _props = this.props,
39
- children = _props.children,
40
- className = _props.className,
41
- Component = _props.componentClass,
42
- props = _objectWithoutProperties(_props, ['children', 'className', 'componentClass']);
31
+ var _proto = PanelHeading.prototype;
32
+
33
+ _proto.render = function render() {
34
+ var _this$props = this.props,
35
+ children = _this$props.children,
36
+ className = _this$props.className,
37
+ Component = _this$props.componentClass,
38
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "className", "componentClass"]);
43
39
 
44
40
  var _ref = this.context.$bs_panel || {},
45
41
  headingId = _ref.headingId,
@@ -56,13 +52,9 @@ var PanelHeading = function (_React$Component) {
56
52
  elementProps.id = headingId;
57
53
  }
58
54
 
59
- return React.createElement(
60
- Component,
61
- _extends({}, elementProps, {
62
- className: cn(className, prefix(bsProps, 'heading'))
63
- }),
64
- children
65
- );
55
+ return React.createElement(Component, _extends({}, elementProps, {
56
+ className: cn(className, prefix(bsProps, 'heading'))
57
+ }), children);
66
58
  };
67
59
 
68
60
  return PanelHeading;
@@ -71,5 +63,4 @@ var PanelHeading = function (_React$Component) {
71
63
  PanelHeading.propTypes = propTypes;
72
64
  PanelHeading.defaultProps = defaultProps;
73
65
  PanelHeading.contextTypes = contextTypes;
74
-
75
66
  export default bsClass('panel', PanelHeading);
package/es/PanelTitle.js CHANGED
@@ -1,51 +1,48 @@
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 cn from 'classnames';
7
5
  import PropTypes from 'prop-types';
8
6
  import React from 'react';
9
7
  import elementType from 'react-prop-types/lib/elementType';
10
-
11
8
  import { prefix, splitBsProps, bsClass } from './utils/bootstrapUtils';
12
9
  import PanelToggle from './PanelToggle';
13
-
14
10
  var propTypes = {
15
11
  componentClass: elementType,
12
+
16
13
  /**
17
14
  * A convenience prop that renders the Panel.Title as a panel collapse toggle component
18
15
  * for the common use-case.
19
16
  */
20
17
  toggle: PropTypes.bool
21
18
  };
22
-
23
19
  var contextTypes = {
24
20
  $bs_panel: PropTypes.shape({
25
21
  bsClass: PropTypes.string
26
22
  })
27
23
  };
28
-
29
24
  var defaultProps = {
30
25
  componentClass: 'div'
31
26
  };
32
27
 
33
- var PanelTitle = function (_React$Component) {
34
- _inherits(PanelTitle, _React$Component);
28
+ var PanelTitle =
29
+ /*#__PURE__*/
30
+ function (_React$Component) {
31
+ _inheritsLoose(PanelTitle, _React$Component);
35
32
 
36
33
  function PanelTitle() {
37
- _classCallCheck(this, PanelTitle);
38
-
39
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
34
+ return _React$Component.apply(this, arguments) || this;
40
35
  }
41
36
 
42
- PanelTitle.prototype.render = function render() {
43
- var _props = this.props,
44
- children = _props.children,
45
- className = _props.className,
46
- toggle = _props.toggle,
47
- Component = _props.componentClass,
48
- props = _objectWithoutProperties(_props, ['children', 'className', 'toggle', 'componentClass']);
37
+ var _proto = PanelTitle.prototype;
38
+
39
+ _proto.render = function render() {
40
+ var _this$props = this.props,
41
+ children = _this$props.children,
42
+ className = _this$props.className,
43
+ toggle = _this$props.toggle,
44
+ Component = _this$props.componentClass,
45
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "className", "toggle", "componentClass"]);
49
46
 
50
47
  var _ref = this.context.$bs_panel || {},
51
48
  _bsClass = _ref.bsClass;
@@ -57,20 +54,12 @@ var PanelTitle = function (_React$Component) {
57
54
  bsProps.bsClass = _bsClass || bsProps.bsClass;
58
55
 
59
56
  if (toggle) {
60
- children = React.createElement(
61
- PanelToggle,
62
- null,
63
- children
64
- );
57
+ children = React.createElement(PanelToggle, null, children);
65
58
  }
66
59
 
67
- return React.createElement(
68
- Component,
69
- _extends({}, elementProps, {
70
- className: cn(className, prefix(bsProps, 'title'))
71
- }),
72
- children
73
- );
60
+ return React.createElement(Component, _extends({}, elementProps, {
61
+ className: cn(className, prefix(bsProps, 'title'))
62
+ }), children);
74
63
  };
75
64
 
76
65
  return PanelTitle;
@@ -79,5 +68,4 @@ var PanelTitle = function (_React$Component) {
79
68
  PanelTitle.propTypes = propTypes;
80
69
  PanelTitle.defaultProps = defaultProps;
81
70
  PanelTitle.contextTypes = contextTypes;
82
-
83
71
  export default bsClass('panel', PanelTitle);
package/es/PanelToggle.js CHANGED
@@ -1,14 +1,12 @@
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';
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
3
+ import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
5
4
  import PropTypes from 'prop-types';
6
5
  import React from 'react';
7
6
  import classNames from 'classnames';
8
7
  import elementType from 'react-prop-types/lib/elementType';
9
8
  import SafeAnchor from './SafeAnchor';
10
9
  import createChainedFunction from './utils/createChainedFunction';
11
-
12
10
  var propTypes = {
13
11
  /**
14
12
  * only here to satisfy linting, just the html onClick handler.
@@ -16,16 +14,15 @@ var propTypes = {
16
14
  * @private
17
15
  */
18
16
  onClick: PropTypes.func,
17
+
19
18
  /**
20
19
  * You can use a custom element for this component
21
20
  */
22
21
  componentClass: elementType
23
22
  };
24
-
25
23
  var defaultProps = {
26
24
  componentClass: SafeAnchor
27
25
  };
28
-
29
26
  var contextTypes = {
30
27
  $bs_panel: PropTypes.shape({
31
28
  bodyId: PropTypes.string,
@@ -34,23 +31,26 @@ var contextTypes = {
34
31
  })
35
32
  };
36
33
 
37
- var PanelToggle = function (_React$Component) {
38
- _inherits(PanelToggle, _React$Component);
34
+ var PanelToggle =
35
+ /*#__PURE__*/
36
+ function (_React$Component) {
37
+ _inheritsLoose(PanelToggle, _React$Component);
39
38
 
40
39
  function PanelToggle() {
41
- _classCallCheck(this, PanelToggle);
40
+ var _this;
42
41
 
43
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
42
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
44
43
  args[_key] = arguments[_key];
45
44
  }
46
45
 
47
- var _this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args)));
48
-
49
- _this.handleToggle = _this.handleToggle.bind(_this);
46
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
47
+ _this.handleToggle = _this.handleToggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
50
48
  return _this;
51
49
  }
52
50
 
53
- PanelToggle.prototype.handleToggle = function handleToggle(event) {
51
+ var _proto = PanelToggle.prototype;
52
+
53
+ _proto.handleToggle = function handleToggle(event) {
54
54
  var _ref = this.context.$bs_panel || {},
55
55
  onToggle = _ref.onToggle;
56
56
 
@@ -59,21 +59,19 @@ var PanelToggle = function (_React$Component) {
59
59
  }
60
60
  };
61
61
 
62
- PanelToggle.prototype.render = function render() {
63
- var _props = this.props,
64
- onClick = _props.onClick,
65
- className = _props.className,
66
- componentClass = _props.componentClass,
67
- props = _objectWithoutProperties(_props, ['onClick', 'className', 'componentClass']);
62
+ _proto.render = function render() {
63
+ var _this$props = this.props,
64
+ onClick = _this$props.onClick,
65
+ className = _this$props.className,
66
+ componentClass = _this$props.componentClass,
67
+ props = _objectWithoutPropertiesLoose(_this$props, ["onClick", "className", "componentClass"]);
68
68
 
69
69
  var _ref2 = this.context.$bs_panel || {},
70
70
  expanded = _ref2.expanded,
71
71
  bodyId = _ref2.bodyId;
72
72
 
73
73
  var Component = componentClass;
74
-
75
74
  props.onClick = createChainedFunction(onClick, this.handleToggle);
76
-
77
75
  props['aria-expanded'] = expanded;
78
76
  props.className = classNames(className, !expanded && 'collapsed');
79
77
 
@@ -90,5 +88,4 @@ var PanelToggle = function (_React$Component) {
90
88
  PanelToggle.propTypes = propTypes;
91
89
  PanelToggle.defaultProps = defaultProps;
92
90
  PanelToggle.contextTypes = contextTypes;
93
-
94
91
  export default PanelToggle;