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/es/PanelGroup.js CHANGED
@@ -1,78 +1,132 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _Object$assign from 'babel-runtime/core-js/object/assign';
3
1
  import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
2
+ import _extends from 'babel-runtime/helpers/extends';
4
3
  import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
5
4
  import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
6
5
  import _inherits from 'babel-runtime/helpers/inherits';
7
6
  import classNames from 'classnames';
8
- import React, { cloneElement } from 'react';
9
7
  import PropTypes from 'prop-types';
8
+ import React, { cloneElement } from 'react';
9
+ import uncontrollable from 'uncontrollable';
10
10
 
11
11
  import { bsClass, getClassSet, splitBsPropsAndOmit } from './utils/bootstrapUtils';
12
- import createChainedFunction from './utils/createChainedFunction';
13
12
  import ValidComponentChildren from './utils/ValidComponentChildren';
13
+ import { generatedId } from './utils/PropTypes';
14
14
 
15
15
  var propTypes = {
16
16
  accordion: PropTypes.bool,
17
+ /**
18
+ * When `accordion` is enabled, `activeKey` controls the which child `Panel` is expanded. `activeKey` should
19
+ * match a child Panel `eventKey` prop exactly.
20
+ *
21
+ * @controllable onSelect
22
+ */
17
23
  activeKey: PropTypes.any,
18
- defaultActiveKey: PropTypes.any,
24
+
25
+ /**
26
+ * A callback fired when a child Panel collapse state changes. It's called with the next expanded `activeKey`
27
+ *
28
+ * @controllable activeKey
29
+ */
19
30
  onSelect: PropTypes.func,
20
- role: PropTypes.string
31
+
32
+ /**
33
+ * An HTML role attribute
34
+ */
35
+ role: PropTypes.string,
36
+
37
+ /**
38
+ * A function that takes an eventKey and type and returns a
39
+ * unique id for each Panel heading and Panel Collapse. The function _must_ be a pure function,
40
+ * meaning it should always return the _same_ id for the same set of inputs. The default
41
+ * value requires that an `id` to be set for the PanelGroup.
42
+ *
43
+ * The `type` argument will either be `"body"` or `"heading"`.
44
+ *
45
+ * @defaultValue (eventKey, type) => `${this.props.id}-${type}-${key}`
46
+ */
47
+ generateChildId: PropTypes.func,
48
+
49
+ /**
50
+ * HTML id attribute, required if no `generateChildId` prop
51
+ * is specified.
52
+ */
53
+ id: generatedId('PanelGroup')
21
54
  };
22
55
 
23
56
  var defaultProps = {
24
57
  accordion: false
25
58
  };
26
59
 
27
- // TODO: Use uncontrollable.
60
+ var childContextTypes = {
61
+ $bs_panelGroup: PropTypes.shape({
62
+ getId: PropTypes.func,
63
+ headerRole: PropTypes.string,
64
+ panelRole: PropTypes.string,
65
+ activeKey: PropTypes.any,
66
+ onToggle: PropTypes.func
67
+ })
68
+ };
28
69
 
29
70
  var PanelGroup = function (_React$Component) {
30
71
  _inherits(PanelGroup, _React$Component);
31
72
 
32
- function PanelGroup(props, context) {
33
- _classCallCheck(this, PanelGroup);
73
+ function PanelGroup() {
74
+ var _temp, _this, _ret;
34
75
 
35
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
76
+ _classCallCheck(this, PanelGroup);
36
77
 
37
- _this.handleSelect = _this.handleSelect.bind(_this);
78
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
79
+ args[_key] = arguments[_key];
80
+ }
38
81
 
39
- _this.state = {
40
- activeKey: props.defaultActiveKey
41
- };
42
- return _this;
82
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleSelect = function (key, expanded, e) {
83
+ if (expanded) {
84
+ _this.props.onSelect(key, e);
85
+ } else if (_this.props.activeKey === key) {
86
+ _this.props.onSelect(null, e);
87
+ }
88
+ }, _temp), _possibleConstructorReturn(_this, _ret);
43
89
  }
44
90
 
45
- PanelGroup.prototype.handleSelect = function handleSelect(key, e) {
46
- e.preventDefault();
91
+ PanelGroup.prototype.getChildContext = function getChildContext() {
92
+ var _props = this.props,
93
+ activeKey = _props.activeKey,
94
+ accordion = _props.accordion,
95
+ generateChildId = _props.generateChildId,
96
+ id = _props.id;
47
97
 
48
- if (this.props.onSelect) {
49
- this.props.onSelect(key, e);
50
- }
98
+ var getId = null;
51
99
 
52
- if (this.state.activeKey === key) {
53
- key = null;
100
+ if (accordion) {
101
+ getId = generateChildId || function (key, type) {
102
+ return id ? id + '-' + type + '-' + key : null;
103
+ };
54
104
  }
55
105
 
56
- this.setState({ activeKey: key });
106
+ return {
107
+ $bs_panelGroup: _extends({
108
+ getId: getId,
109
+ headerRole: 'tab',
110
+ panelRole: 'tabpanel'
111
+ }, accordion && {
112
+ activeKey: activeKey,
113
+ onToggle: this.handleSelect
114
+ })
115
+ };
57
116
  };
58
117
 
59
118
  PanelGroup.prototype.render = function render() {
60
- var _this2 = this;
61
-
62
- var _props = this.props,
63
- accordion = _props.accordion,
64
- propsActiveKey = _props.activeKey,
65
- className = _props.className,
66
- children = _props.children,
67
- props = _objectWithoutProperties(_props, ['accordion', 'activeKey', 'className', 'children']);
119
+ var _props2 = this.props,
120
+ accordion = _props2.accordion,
121
+ className = _props2.className,
122
+ children = _props2.children,
123
+ props = _objectWithoutProperties(_props2, ['accordion', 'className', 'children']);
68
124
 
69
- var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['defaultActiveKey', 'onSelect']),
125
+ var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['onSelect', 'activeKey']),
70
126
  bsProps = _splitBsPropsAndOmit[0],
71
127
  elementProps = _splitBsPropsAndOmit[1];
72
128
 
73
- var activeKey = void 0;
74
129
  if (accordion) {
75
- activeKey = propsActiveKey != null ? propsActiveKey : this.state.activeKey;
76
130
  elementProps.role = elementProps.role || 'tablist';
77
131
  }
78
132
 
@@ -80,25 +134,11 @@ var PanelGroup = function (_React$Component) {
80
134
 
81
135
  return React.createElement(
82
136
  'div',
83
- _extends({}, elementProps, {
84
- className: classNames(className, classes)
85
- }),
137
+ _extends({}, elementProps, { className: classNames(className, classes) }),
86
138
  ValidComponentChildren.map(children, function (child) {
87
- var childProps = {
139
+ return cloneElement(child, {
88
140
  bsStyle: child.props.bsStyle || bsProps.bsStyle
89
- };
90
-
91
- if (accordion) {
92
- _Object$assign(childProps, {
93
- headerRole: 'tab',
94
- panelRole: 'tabpanel',
95
- collapsible: true,
96
- expanded: child.props.eventKey === activeKey,
97
- onSelect: createChainedFunction(_this2.handleSelect, child.props.onSelect)
98
- });
99
- }
100
-
101
- return cloneElement(child, childProps);
141
+ });
102
142
  })
103
143
  );
104
144
  };
@@ -108,5 +148,8 @@ var PanelGroup = function (_React$Component) {
108
148
 
109
149
  PanelGroup.propTypes = propTypes;
110
150
  PanelGroup.defaultProps = defaultProps;
151
+ PanelGroup.childContextTypes = childContextTypes;
111
152
 
112
- export default bsClass('panel-group', PanelGroup);
153
+ export default uncontrollable(bsClass('panel-group', PanelGroup), {
154
+ activeKey: 'onSelect'
155
+ });
@@ -0,0 +1,75 @@
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
+ import PropTypes from 'prop-types';
7
+ import React from 'react';
8
+ import cn from 'classnames';
9
+ import elementType from 'react-prop-types/lib/elementType';
10
+
11
+ import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
12
+
13
+ var propTypes = {
14
+ componentClass: elementType
15
+ };
16
+
17
+ var defaultProps = {
18
+ componentClass: 'div'
19
+ };
20
+
21
+ var contextTypes = {
22
+ $bs_panel: PropTypes.shape({
23
+ headingId: PropTypes.string,
24
+ bsClass: PropTypes.string
25
+ })
26
+ };
27
+
28
+ var PanelHeading = function (_React$Component) {
29
+ _inherits(PanelHeading, _React$Component);
30
+
31
+ function PanelHeading() {
32
+ _classCallCheck(this, PanelHeading);
33
+
34
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
35
+ }
36
+
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']);
43
+
44
+ var _ref = this.context.$bs_panel || {},
45
+ headingId = _ref.headingId,
46
+ _bsClass = _ref.bsClass;
47
+
48
+ var _splitBsProps = splitBsProps(props),
49
+ bsProps = _splitBsProps[0],
50
+ elementProps = _splitBsProps[1];
51
+
52
+ bsProps.bsClass = _bsClass || bsProps.bsClass;
53
+
54
+ if (headingId) {
55
+ elementProps.role = elementProps.role || 'tab';
56
+ elementProps.id = headingId;
57
+ }
58
+
59
+ return React.createElement(
60
+ Component,
61
+ _extends({}, elementProps, {
62
+ className: cn(className, prefix(bsProps, 'heading'))
63
+ }),
64
+ children
65
+ );
66
+ };
67
+
68
+ return PanelHeading;
69
+ }(React.Component);
70
+
71
+ PanelHeading.propTypes = propTypes;
72
+ PanelHeading.defaultProps = defaultProps;
73
+ PanelHeading.contextTypes = contextTypes;
74
+
75
+ export default bsClass('panel', PanelHeading);
@@ -0,0 +1,83 @@
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
+ import cn from 'classnames';
7
+ import PropTypes from 'prop-types';
8
+ import React from 'react';
9
+ import elementType from 'react-prop-types/lib/elementType';
10
+
11
+ import { prefix, splitBsProps, bsClass } from './utils/bootstrapUtils';
12
+ import PanelToggle from './PanelToggle';
13
+
14
+ var propTypes = {
15
+ componentClass: elementType,
16
+ /**
17
+ * A convenience prop that renders the Panel.Title as a panel collapse toggle component
18
+ * for the common use-case.
19
+ */
20
+ toggle: PropTypes.bool
21
+ };
22
+
23
+ var contextTypes = {
24
+ $bs_panel: PropTypes.shape({
25
+ bsClass: PropTypes.string
26
+ })
27
+ };
28
+
29
+ var defaultProps = {
30
+ componentClass: 'div'
31
+ };
32
+
33
+ var PanelTitle = function (_React$Component) {
34
+ _inherits(PanelTitle, _React$Component);
35
+
36
+ function PanelTitle() {
37
+ _classCallCheck(this, PanelTitle);
38
+
39
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
40
+ }
41
+
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']);
49
+
50
+ var _ref = this.context.$bs_panel || {},
51
+ _bsClass = _ref.bsClass;
52
+
53
+ var _splitBsProps = splitBsProps(props),
54
+ bsProps = _splitBsProps[0],
55
+ elementProps = _splitBsProps[1];
56
+
57
+ bsProps.bsClass = _bsClass || bsProps.bsClass;
58
+
59
+ if (toggle) {
60
+ children = React.createElement(
61
+ PanelToggle,
62
+ null,
63
+ children
64
+ );
65
+ }
66
+
67
+ return React.createElement(
68
+ Component,
69
+ _extends({}, elementProps, {
70
+ className: cn(className, prefix(bsProps, 'title'))
71
+ }),
72
+ children
73
+ );
74
+ };
75
+
76
+ return PanelTitle;
77
+ }(React.Component);
78
+
79
+ PanelTitle.propTypes = propTypes;
80
+ PanelTitle.defaultProps = defaultProps;
81
+ PanelTitle.contextTypes = contextTypes;
82
+
83
+ export default bsClass('panel', PanelTitle);
@@ -0,0 +1,94 @@
1
+ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
2
+ import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3
+ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4
+ import _inherits from 'babel-runtime/helpers/inherits';
5
+ import PropTypes from 'prop-types';
6
+ import React from 'react';
7
+ import classNames from 'classnames';
8
+ import elementType from 'react-prop-types/lib/elementType';
9
+ import SafeAnchor from './SafeAnchor';
10
+ import createChainedFunction from './utils/createChainedFunction';
11
+
12
+ var propTypes = {
13
+ /**
14
+ * only here to satisfy linting, just the html onClick handler.
15
+ *
16
+ * @private
17
+ */
18
+ onClick: PropTypes.func,
19
+ /**
20
+ * You can use a custom element for this component
21
+ */
22
+ componentClass: elementType
23
+ };
24
+
25
+ var defaultProps = {
26
+ componentClass: SafeAnchor
27
+ };
28
+
29
+ var contextTypes = {
30
+ $bs_panel: PropTypes.shape({
31
+ bodyId: PropTypes.string,
32
+ onToggle: PropTypes.func,
33
+ expanded: PropTypes.bool
34
+ })
35
+ };
36
+
37
+ var PanelToggle = function (_React$Component) {
38
+ _inherits(PanelToggle, _React$Component);
39
+
40
+ function PanelToggle() {
41
+ _classCallCheck(this, PanelToggle);
42
+
43
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
44
+ args[_key] = arguments[_key];
45
+ }
46
+
47
+ var _this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args)));
48
+
49
+ _this.handleToggle = _this.handleToggle.bind(_this);
50
+ return _this;
51
+ }
52
+
53
+ PanelToggle.prototype.handleToggle = function handleToggle(event) {
54
+ var _ref = this.context.$bs_panel || {},
55
+ onToggle = _ref.onToggle;
56
+
57
+ if (onToggle) {
58
+ onToggle(event);
59
+ }
60
+ };
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']);
68
+
69
+ var _ref2 = this.context.$bs_panel || {},
70
+ expanded = _ref2.expanded,
71
+ bodyId = _ref2.bodyId;
72
+
73
+ var Component = componentClass;
74
+
75
+ props.onClick = createChainedFunction(onClick, this.handleToggle);
76
+
77
+ props['aria-expanded'] = expanded;
78
+ props.className = classNames(className, !expanded && 'collapsed');
79
+
80
+ if (bodyId) {
81
+ props['aria-controls'] = bodyId;
82
+ }
83
+
84
+ return React.createElement(Component, props);
85
+ };
86
+
87
+ return PanelToggle;
88
+ }(React.Component);
89
+
90
+ PanelToggle.propTypes = propTypes;
91
+ PanelToggle.defaultProps = defaultProps;
92
+ PanelToggle.contextTypes = contextTypes;
93
+
94
+ export default PanelToggle;
package/es/ProgressBar.js CHANGED
@@ -30,10 +30,8 @@ function onlyProgressBar(props, propName, componentName) {
30
30
  return;
31
31
  }
32
32
 
33
- if (child.type === ProgressBar) {
34
- // eslint-disable-line no-use-before-define
35
- return;
36
- }
33
+ // eslint-disable-next-line no-use-before-define
34
+ if (child.type === ProgressBar) return;
37
35
 
38
36
  var childIdentifier = React.isValidElement(child) ? child.type.displayName || child.type.name || child.type : child;
39
37
  error = new Error('Children of ' + componentName + ' can contain only ProgressBar ' + ('components. Found ' + childIdentifier + '.'));
@@ -145,13 +143,19 @@ var ProgressBar = function (_React$Component) {
145
143
 
146
144
  return React.createElement(
147
145
  'div',
148
- _extends({}, wrapperProps, {
149
- className: classNames(className, 'progress')
150
- }),
146
+ _extends({}, wrapperProps, { className: classNames(className, 'progress') }),
151
147
  children ? ValidComponentChildren.map(children, function (child) {
152
148
  return cloneElement(child, { isChild: true });
153
149
  }) : this.renderProgressBar({
154
- min: min, now: now, max: max, label: label, srOnly: srOnly, striped: striped, active: active, bsClass: bsClass, bsStyle: bsStyle
150
+ min: min,
151
+ now: now,
152
+ max: max,
153
+ label: label,
154
+ srOnly: srOnly,
155
+ striped: striped,
156
+ active: active,
157
+ bsClass: bsClass,
158
+ bsStyle: bsStyle
155
159
  })
156
160
  );
157
161
  };
package/es/Radio.js CHANGED
@@ -3,6 +3,8 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutPropert
3
3
  import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4
4
  import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5
5
  import _inherits from 'babel-runtime/helpers/inherits';
6
+ /* eslint-disable jsx-a11y/label-has-for */
7
+
6
8
  import classNames from 'classnames';
7
9
  import React from 'react';
8
10
  import PropTypes from 'prop-types';
@@ -76,7 +78,11 @@ var Radio = function (_React$Component) {
76
78
 
77
79
  return React.createElement(
78
80
  'label',
79
- { className: classNames(className, _classes), style: style, title: title },
81
+ {
82
+ className: classNames(className, _classes),
83
+ style: style,
84
+ title: title
85
+ },
80
86
  input,
81
87
  children
82
88
  );
package/es/Row.js CHANGED
@@ -38,9 +38,7 @@ var Row = function (_React$Component) {
38
38
 
39
39
  var classes = getClassSet(bsProps);
40
40
 
41
- return React.createElement(Component, _extends({}, elementProps, {
42
- className: classNames(className, classes)
43
- }));
41
+ return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
44
42
  };
45
43
 
46
44
  return Row;
package/es/SplitButton.js CHANGED
@@ -58,10 +58,7 @@ var SplitButton = function (_React$Component) {
58
58
 
59
59
  return React.createElement(
60
60
  Dropdown,
61
- _extends({}, dropdownProps, {
62
- bsSize: bsSize,
63
- bsStyle: bsStyle
64
- }),
61
+ _extends({}, dropdownProps, { bsSize: bsSize, bsStyle: bsStyle }),
65
62
  React.createElement(
66
63
  Button,
67
64
  _extends({}, buttonProps, {
package/es/SplitToggle.js CHANGED
@@ -16,10 +16,7 @@ var SplitToggle = function (_React$Component) {
16
16
  }
17
17
 
18
18
  SplitToggle.prototype.render = function render() {
19
- return React.createElement(DropdownToggle, _extends({}, this.props, {
20
- useAnchor: false,
21
- noCaret: false
22
- }));
19
+ return React.createElement(DropdownToggle, _extends({}, this.props, { useAnchor: false, noCaret: false }));
23
20
  };
24
21
 
25
22
  return SplitToggle;
package/es/TabContent.js CHANGED
@@ -15,8 +15,8 @@ var propTypes = {
15
15
 
16
16
  /**
17
17
  * Sets a default animation strategy for all children `<TabPane>`s. Use
18
- * `false` to disable, `true` to enable the default `<Fade>` animation or any
19
- * `<Transition>` component.
18
+ * `false` to disable, `true` to enable the default `<Fade>` animation or
19
+ * a react-transition-group v2 `<Transition/>` component.
20
20
  */
21
21
  animation: PropTypes.oneOfType([PropTypes.bool, elementType]),
22
22
 
@@ -116,6 +116,11 @@ var TabContent = function (_React$Component) {
116
116
  this.isUnmounted = true;
117
117
  };
118
118
 
119
+ TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
120
+ var tabContainer = this.context.$bs_tabContainer;
121
+ return tabContainer && tabContainer.activeKey;
122
+ };
123
+
119
124
  TabContent.prototype.handlePaneEnter = function handlePaneEnter(child, childKey) {
120
125
  if (!this.props.animation) {
121
126
  return false;
@@ -154,11 +159,6 @@ var TabContent = function (_React$Component) {
154
159
  });
155
160
  };
156
161
 
157
- TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
158
- var tabContainer = this.context.$bs_tabContainer;
159
- return tabContainer && tabContainer.activeKey;
160
- };
161
-
162
162
  TabContent.prototype.render = function render() {
163
163
  var _props2 = this.props,
164
164
  Component = _props2.componentClass,
package/es/TabPane.js CHANGED
@@ -22,15 +22,15 @@ var propTypes = {
22
22
 
23
23
  /**
24
24
  * Use animation when showing or hiding `<TabPane>`s. Use `false` to disable,
25
- * `true` to enable the default `<Fade>` animation or any `<Transition>`
26
- * component.
25
+ * `true` to enable the default `<Fade>` animation or
26
+ * a react-transition-group v2 `<Transition/>` component.
27
27
  */
28
28
  animation: PropTypes.oneOfType([PropTypes.bool, elementType]),
29
29
 
30
- /** @private **/
30
+ /** @private * */
31
31
  id: PropTypes.string,
32
32
 
33
- /** @private **/
33
+ /** @private * */
34
34
  'aria-labelledby': PropTypes.string,
35
35
 
36
36
  /**
@@ -117,7 +117,7 @@ var TabPane = function (_React$Component) {
117
117
  _this.handleEnter = _this.handleEnter.bind(_this);
118
118
  _this.handleExited = _this.handleExited.bind(_this);
119
119
 
120
- _this['in'] = false;
120
+ _this.in = false;
121
121
  return _this;
122
122
  }
123
123
 
@@ -135,7 +135,7 @@ var TabPane = function (_React$Component) {
135
135
  };
136
136
 
137
137
  TabPane.prototype.componentDidUpdate = function componentDidUpdate() {
138
- if (this['in']) {
138
+ if (this.in) {
139
139
  if (!this.shouldBeIn()) {
140
140
  // We shouldn't be active any more. Notify the parent.
141
141
  this.handleExited();
@@ -147,19 +147,28 @@ var TabPane = function (_React$Component) {
147
147
  };
148
148
 
149
149
  TabPane.prototype.componentWillUnmount = function componentWillUnmount() {
150
- if (this['in']) {
150
+ if (this.in) {
151
151
  // In lieu of the action event firing.
152
152
  this.handleExited();
153
153
  }
154
154
  };
155
155
 
156
+ TabPane.prototype.getAnimation = function getAnimation() {
157
+ if (this.props.animation != null) {
158
+ return this.props.animation;
159
+ }
160
+
161
+ var tabContent = this.context.$bs_tabContent;
162
+ return tabContent && tabContent.animation;
163
+ };
164
+
156
165
  TabPane.prototype.handleEnter = function handleEnter() {
157
166
  var tabContent = this.context.$bs_tabContent;
158
167
  if (!tabContent) {
159
168
  return;
160
169
  }
161
170
 
162
- this['in'] = tabContent.onPaneEnter(this, this.props.eventKey);
171
+ this.in = tabContent.onPaneEnter(this, this.props.eventKey);
163
172
  };
164
173
 
165
174
  TabPane.prototype.handleExited = function handleExited() {
@@ -169,16 +178,7 @@ var TabPane = function (_React$Component) {
169
178
  }
170
179
 
171
180
  tabContent.onPaneExited(this);
172
- this['in'] = false;
173
- };
174
-
175
- TabPane.prototype.getAnimation = function getAnimation() {
176
- if (this.props.animation != null) {
177
- return this.props.animation;
178
- }
179
-
180
- var tabContent = this.context.$bs_tabContent;
181
- return tabContent && tabContent.animation;
181
+ this.in = false;
182
182
  };
183
183
 
184
184
  TabPane.prototype.isActive = function isActive() {
package/es/Table.js CHANGED
@@ -52,9 +52,7 @@ var Table = function (_React$Component) {
52
52
 
53
53
  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
54
 
55
- var table = React.createElement('table', _extends({}, elementProps, {
56
- className: classNames(className, classes)
57
- }));
55
+ var table = React.createElement('table', _extends({}, elementProps, { className: classNames(className, classes) }));
58
56
 
59
57
  if (responsive) {
60
58
  return React.createElement(