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,20 +1,17 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3
- import _Array$from from 'babel-runtime/core-js/array/from';
4
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
5
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
6
- 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 _Array$from from "@babel/runtime-corejs2/core-js/array/from";
4
+ import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
5
+ import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
7
6
  import classNames from 'classnames';
8
7
  import keycode from 'keycode';
9
8
  import React from 'react';
10
9
  import PropTypes from 'prop-types';
11
10
  import ReactDOM from 'react-dom';
12
11
  import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper';
13
-
14
12
  import { bsClass, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils';
15
13
  import createChainedFunction from './utils/createChainedFunction';
16
14
  import ValidComponentChildren from './utils/ValidComponentChildren';
17
-
18
15
  var propTypes = {
19
16
  open: PropTypes.bool,
20
17
  pullRight: PropTypes.bool,
@@ -23,27 +20,30 @@ var propTypes = {
23
20
  onSelect: PropTypes.func,
24
21
  rootCloseEvent: PropTypes.oneOf(['click', 'mousedown'])
25
22
  };
26
-
27
23
  var defaultProps = {
28
24
  bsRole: 'menu',
29
25
  pullRight: false
30
26
  };
31
27
 
32
- var DropdownMenu = function (_React$Component) {
33
- _inherits(DropdownMenu, _React$Component);
28
+ var DropdownMenu =
29
+ /*#__PURE__*/
30
+ function (_React$Component) {
31
+ _inheritsLoose(DropdownMenu, _React$Component);
34
32
 
35
33
  function DropdownMenu(props) {
36
- _classCallCheck(this, DropdownMenu);
34
+ var _this;
37
35
 
38
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
39
-
40
- _this.handleRootClose = _this.handleRootClose.bind(_this);
41
- _this.handleKeyDown = _this.handleKeyDown.bind(_this);
36
+ _this = _React$Component.call(this, props) || this;
37
+ _this.handleRootClose = _this.handleRootClose.bind(_assertThisInitialized(_assertThisInitialized(_this)));
38
+ _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
42
39
  return _this;
43
40
  }
44
41
 
45
- DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
42
+ var _proto = DropdownMenu.prototype;
43
+
44
+ _proto.getFocusableMenuItems = function getFocusableMenuItems() {
46
45
  var node = ReactDOM.findDOMNode(this);
46
+
47
47
  if (!node) {
48
48
  return [];
49
49
  }
@@ -51,17 +51,19 @@ var DropdownMenu = function (_React$Component) {
51
51
  return _Array$from(node.querySelectorAll('[tabIndex="-1"]'));
52
52
  };
53
53
 
54
- DropdownMenu.prototype.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
54
+ _proto.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
55
55
  var items = this.getFocusableMenuItems();
56
56
  var activeIndex = items.indexOf(document.activeElement);
57
-
58
- return { items: items, activeIndex: activeIndex };
57
+ return {
58
+ items: items,
59
+ activeIndex: activeIndex
60
+ };
59
61
  };
60
62
 
61
- DropdownMenu.prototype.focusNext = function focusNext() {
62
- var _getItemsAndActiveInd = this.getItemsAndActiveIndex(),
63
- items = _getItemsAndActiveInd.items,
64
- activeIndex = _getItemsAndActiveInd.activeIndex;
63
+ _proto.focusNext = function focusNext() {
64
+ var _this$getItemsAndActi = this.getItemsAndActiveIndex(),
65
+ items = _this$getItemsAndActi.items,
66
+ activeIndex = _this$getItemsAndActi.activeIndex;
65
67
 
66
68
  if (items.length === 0) {
67
69
  return;
@@ -71,10 +73,10 @@ var DropdownMenu = function (_React$Component) {
71
73
  items[nextIndex].focus();
72
74
  };
73
75
 
74
- DropdownMenu.prototype.focusPrevious = function focusPrevious() {
75
- var _getItemsAndActiveInd2 = this.getItemsAndActiveIndex(),
76
- items = _getItemsAndActiveInd2.items,
77
- activeIndex = _getItemsAndActiveInd2.activeIndex;
76
+ _proto.focusPrevious = function focusPrevious() {
77
+ var _this$getItemsAndActi2 = this.getItemsAndActiveIndex(),
78
+ items = _this$getItemsAndActi2.items,
79
+ activeIndex = _this$getItemsAndActi2.activeIndex;
78
80
 
79
81
  if (items.length === 0) {
80
82
  return;
@@ -84,41 +86,48 @@ var DropdownMenu = function (_React$Component) {
84
86
  items[prevIndex].focus();
85
87
  };
86
88
 
87
- DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
89
+ _proto.handleKeyDown = function handleKeyDown(event) {
88
90
  switch (event.keyCode) {
89
91
  case keycode.codes.down:
90
92
  this.focusNext();
91
93
  event.preventDefault();
92
94
  break;
95
+
93
96
  case keycode.codes.up:
94
97
  this.focusPrevious();
95
98
  event.preventDefault();
96
99
  break;
100
+
97
101
  case keycode.codes.esc:
98
102
  case keycode.codes.tab:
99
- this.props.onClose(event, { source: 'keydown' });
103
+ this.props.onClose(event, {
104
+ source: 'keydown'
105
+ });
100
106
  break;
107
+
101
108
  default:
102
109
  }
103
110
  };
104
111
 
105
- DropdownMenu.prototype.handleRootClose = function handleRootClose(event) {
106
- this.props.onClose(event, { source: 'rootClose' });
112
+ _proto.handleRootClose = function handleRootClose(event) {
113
+ this.props.onClose(event, {
114
+ source: 'rootClose'
115
+ });
107
116
  };
108
117
 
109
- DropdownMenu.prototype.render = function render() {
118
+ _proto.render = function render() {
110
119
  var _extends2,
111
120
  _this2 = this;
112
121
 
113
- var _props = this.props,
114
- open = _props.open,
115
- pullRight = _props.pullRight,
116
- labelledBy = _props.labelledBy,
117
- onSelect = _props.onSelect,
118
- className = _props.className,
119
- rootCloseEvent = _props.rootCloseEvent,
120
- children = _props.children,
121
- props = _objectWithoutProperties(_props, ['open', 'pullRight', 'labelledBy', 'onSelect', 'className', 'rootCloseEvent', 'children']);
122
+ var _this$props = this.props,
123
+ open = _this$props.open,
124
+ pullRight = _this$props.pullRight,
125
+ labelledBy = _this$props.labelledBy,
126
+ onSelect = _this$props.onSelect,
127
+ className = _this$props.className,
128
+ rootCloseEvent = _this$props.rootCloseEvent,
129
+ children = _this$props.children,
130
+ props = _objectWithoutPropertiesLoose(_this$props, ["open", "pullRight", "labelledBy", "onSelect", "className", "rootCloseEvent", "children"]);
122
131
 
123
132
  var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['onClose']),
124
133
  bsProps = _splitBsPropsAndOmit[0],
@@ -126,28 +135,20 @@ var DropdownMenu = function (_React$Component) {
126
135
 
127
136
  var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'right')] = pullRight, _extends2));
128
137
 
129
- return React.createElement(
130
- RootCloseWrapper,
131
- {
132
- disabled: !open,
133
- onRootClose: this.handleRootClose,
134
- event: rootCloseEvent
135
- },
136
- React.createElement(
137
- 'ul',
138
- _extends({}, elementProps, {
139
- role: 'menu',
140
- className: classNames(className, classes),
141
- 'aria-labelledby': labelledBy
142
- }),
143
- ValidComponentChildren.map(children, function (child) {
144
- return React.cloneElement(child, {
145
- onKeyDown: createChainedFunction(child.props.onKeyDown, _this2.handleKeyDown),
146
- onSelect: createChainedFunction(child.props.onSelect, onSelect)
147
- });
148
- })
149
- )
150
- );
138
+ return React.createElement(RootCloseWrapper, {
139
+ disabled: !open,
140
+ onRootClose: this.handleRootClose,
141
+ event: rootCloseEvent
142
+ }, React.createElement("ul", _extends({}, elementProps, {
143
+ role: "menu",
144
+ className: classNames(className, classes),
145
+ "aria-labelledby": labelledBy
146
+ }), ValidComponentChildren.map(children, function (child) {
147
+ return React.cloneElement(child, {
148
+ onKeyDown: createChainedFunction(child.props.onKeyDown, _this2.handleKeyDown),
149
+ onSelect: createChainedFunction(child.props.onSelect, onSelect)
150
+ });
151
+ })));
151
152
  };
152
153
 
153
154
  return DropdownMenu;
@@ -155,5 +156,4 @@ var DropdownMenu = function (_React$Component) {
155
156
 
156
157
  DropdownMenu.propTypes = propTypes;
157
158
  DropdownMenu.defaultProps = defaultProps;
158
-
159
159
  export default bsClass('dropdown-menu', DropdownMenu);
@@ -1,70 +1,59 @@
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 classNames from 'classnames';
9
7
  import Button from './Button';
10
8
  import SafeAnchor from './SafeAnchor';
11
-
12
9
  import { bsClass as setBsClass } from './utils/bootstrapUtils';
13
-
14
10
  var propTypes = {
15
11
  noCaret: PropTypes.bool,
16
12
  open: PropTypes.bool,
17
13
  title: PropTypes.string,
18
14
  useAnchor: PropTypes.bool
19
15
  };
20
-
21
16
  var defaultProps = {
22
17
  open: false,
23
18
  useAnchor: false,
24
19
  bsRole: 'toggle'
25
20
  };
26
21
 
27
- var DropdownToggle = function (_React$Component) {
28
- _inherits(DropdownToggle, _React$Component);
22
+ var DropdownToggle =
23
+ /*#__PURE__*/
24
+ function (_React$Component) {
25
+ _inheritsLoose(DropdownToggle, _React$Component);
29
26
 
30
27
  function DropdownToggle() {
31
- _classCallCheck(this, DropdownToggle);
32
-
33
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
28
+ return _React$Component.apply(this, arguments) || this;
34
29
  }
35
30
 
36
- DropdownToggle.prototype.render = function render() {
37
- var _props = this.props,
38
- noCaret = _props.noCaret,
39
- open = _props.open,
40
- useAnchor = _props.useAnchor,
41
- bsClass = _props.bsClass,
42
- className = _props.className,
43
- children = _props.children,
44
- props = _objectWithoutProperties(_props, ['noCaret', 'open', 'useAnchor', 'bsClass', 'className', 'children']);
31
+ var _proto = DropdownToggle.prototype;
45
32
 
46
- delete props.bsRole;
33
+ _proto.render = function render() {
34
+ var _this$props = this.props,
35
+ noCaret = _this$props.noCaret,
36
+ open = _this$props.open,
37
+ useAnchor = _this$props.useAnchor,
38
+ bsClass = _this$props.bsClass,
39
+ className = _this$props.className,
40
+ children = _this$props.children,
41
+ props = _objectWithoutPropertiesLoose(_this$props, ["noCaret", "open", "useAnchor", "bsClass", "className", "children"]);
47
42
 
43
+ delete props.bsRole;
48
44
  var Component = useAnchor ? SafeAnchor : Button;
49
- var useCaret = !noCaret;
50
-
51
- // This intentionally forwards bsSize and bsStyle (if set) to the
45
+ var useCaret = !noCaret; // This intentionally forwards bsSize and bsStyle (if set) to the
52
46
  // underlying component, to allow it to render size and style variants.
53
-
54
47
  // FIXME: Should this really fall back to `title` as children?
55
48
 
56
- return React.createElement(
57
- Component,
58
- _extends({}, props, {
59
- role: 'button',
60
- className: classNames(className, bsClass),
61
- 'aria-haspopup': true,
62
- 'aria-expanded': open
63
- }),
64
- children || props.title,
65
- useCaret && ' ',
66
- useCaret && React.createElement('span', { className: 'caret' })
67
- );
49
+ return React.createElement(Component, _extends({}, props, {
50
+ role: "button",
51
+ className: classNames(className, bsClass),
52
+ "aria-haspopup": true,
53
+ "aria-expanded": open
54
+ }), children || props.title, useCaret && ' ', useCaret && React.createElement("span", {
55
+ className: "caret"
56
+ }));
68
57
  };
69
58
 
70
59
  return DropdownToggle;
@@ -72,5 +61,4 @@ var DropdownToggle = function (_React$Component) {
72
61
 
73
62
  DropdownToggle.propTypes = propTypes;
74
63
  DropdownToggle.defaultProps = defaultProps;
75
-
76
64
  export default setBsClass('dropdown-toggle', DropdownToggle);
package/es/Fade.js CHANGED
@@ -1,8 +1,6 @@
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
 
7
5
  var _fadeStyles;
8
6
 
@@ -10,7 +8,6 @@ import classNames from 'classnames';
10
8
  import React from 'react';
11
9
  import PropTypes from 'prop-types';
12
10
  import Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition';
13
-
14
11
  var propTypes = {
15
12
  /**
16
13
  * Show the component; triggers the fade in or fade out animation
@@ -44,28 +41,32 @@ var propTypes = {
44
41
  * Callback fired before the component fades in
45
42
  */
46
43
  onEnter: PropTypes.func,
44
+
47
45
  /**
48
46
  * Callback fired after the component starts to fade in
49
47
  */
50
48
  onEntering: PropTypes.func,
49
+
51
50
  /**
52
51
  * Callback fired after the has component faded in
53
52
  */
54
53
  onEntered: PropTypes.func,
54
+
55
55
  /**
56
56
  * Callback fired before the component fades out
57
57
  */
58
58
  onExit: PropTypes.func,
59
+
59
60
  /**
60
61
  * Callback fired after the component starts to fade out
61
62
  */
62
63
  onExiting: PropTypes.func,
64
+
63
65
  /**
64
66
  * Callback fired after the component has faded out
65
67
  */
66
68
  onExited: PropTypes.func
67
69
  };
68
-
69
70
  var defaultProps = {
70
71
  in: false,
71
72
  timeout: 300,
@@ -73,33 +74,30 @@ var defaultProps = {
73
74
  unmountOnExit: false,
74
75
  appear: false
75
76
  };
76
-
77
77
  var fadeStyles = (_fadeStyles = {}, _fadeStyles[ENTERING] = 'in', _fadeStyles[ENTERED] = 'in', _fadeStyles);
78
78
 
79
- var Fade = function (_React$Component) {
80
- _inherits(Fade, _React$Component);
79
+ var Fade =
80
+ /*#__PURE__*/
81
+ function (_React$Component) {
82
+ _inheritsLoose(Fade, _React$Component);
81
83
 
82
84
  function Fade() {
83
- _classCallCheck(this, Fade);
84
-
85
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
85
+ return _React$Component.apply(this, arguments) || this;
86
86
  }
87
87
 
88
- Fade.prototype.render = function render() {
89
- var _props = this.props,
90
- className = _props.className,
91
- children = _props.children,
92
- props = _objectWithoutProperties(_props, ['className', 'children']);
93
-
94
- return React.createElement(
95
- Transition,
96
- props,
97
- function (status, innerProps) {
98
- return React.cloneElement(children, _extends({}, innerProps, {
99
- className: classNames('fade', className, children.props.className, fadeStyles[status])
100
- }));
101
- }
102
- );
88
+ var _proto = Fade.prototype;
89
+
90
+ _proto.render = function render() {
91
+ var _this$props = this.props,
92
+ className = _this$props.className,
93
+ children = _this$props.children,
94
+ props = _objectWithoutPropertiesLoose(_this$props, ["className", "children"]);
95
+
96
+ return React.createElement(Transition, props, function (status, innerProps) {
97
+ return React.cloneElement(children, _extends({}, innerProps, {
98
+ className: classNames('fade', className, children.props.className, fadeStyles[status])
99
+ }));
100
+ });
103
101
  };
104
102
 
105
103
  return Fade;
@@ -107,5 +105,4 @@ var Fade = function (_React$Component) {
107
105
 
108
106
  Fade.propTypes = propTypes;
109
107
  Fade.defaultProps = defaultProps;
110
-
111
108
  export default Fade;
package/es/Form.js CHANGED
@@ -1,57 +1,58 @@
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
7
  import elementType from 'prop-types-extra/lib/elementType';
10
-
11
8
  import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils';
12
-
13
9
  var propTypes = {
14
10
  horizontal: PropTypes.bool,
15
11
  inline: PropTypes.bool,
16
12
  componentClass: elementType
17
13
  };
18
-
19
14
  var defaultProps = {
20
15
  horizontal: false,
21
16
  inline: false,
22
17
  componentClass: 'form'
23
18
  };
24
19
 
25
- var Form = function (_React$Component) {
26
- _inherits(Form, _React$Component);
20
+ var Form =
21
+ /*#__PURE__*/
22
+ function (_React$Component) {
23
+ _inheritsLoose(Form, _React$Component);
27
24
 
28
25
  function Form() {
29
- _classCallCheck(this, Form);
30
-
31
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
26
+ return _React$Component.apply(this, arguments) || this;
32
27
  }
33
28
 
34
- Form.prototype.render = function render() {
35
- var _props = this.props,
36
- horizontal = _props.horizontal,
37
- inline = _props.inline,
38
- Component = _props.componentClass,
39
- className = _props.className,
40
- props = _objectWithoutProperties(_props, ['horizontal', 'inline', 'componentClass', 'className']);
29
+ var _proto = Form.prototype;
30
+
31
+ _proto.render = function render() {
32
+ var _this$props = this.props,
33
+ horizontal = _this$props.horizontal,
34
+ inline = _this$props.inline,
35
+ Component = _this$props.componentClass,
36
+ className = _this$props.className,
37
+ props = _objectWithoutPropertiesLoose(_this$props, ["horizontal", "inline", "componentClass", "className"]);
41
38
 
42
39
  var _splitBsProps = splitBsProps(props),
43
40
  bsProps = _splitBsProps[0],
44
41
  elementProps = _splitBsProps[1];
45
42
 
46
43
  var classes = [];
44
+
47
45
  if (horizontal) {
48
46
  classes.push(prefix(bsProps, 'horizontal'));
49
47
  }
48
+
50
49
  if (inline) {
51
50
  classes.push(prefix(bsProps, 'inline'));
52
51
  }
53
52
 
54
- return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
53
+ return React.createElement(Component, _extends({}, elementProps, {
54
+ className: classNames(className, classes)
55
+ }));
55
56
  };
56
57
 
57
58
  return Form;
@@ -59,5 +60,4 @@ var Form = function (_React$Component) {
59
60
 
60
61
  Form.propTypes = propTypes;
61
62
  Form.defaultProps = defaultProps;
62
-
63
63
  export default bsClass('form', Form);
package/es/FormControl.js CHANGED
@@ -1,29 +1,28 @@
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
7
  import elementType from 'prop-types-extra/lib/elementType';
10
8
  import warning from 'warning';
11
-
12
9
  import FormControlFeedback from './FormControlFeedback';
13
10
  import FormControlStatic from './FormControlStatic';
14
11
  import { prefix, bsClass, getClassSet, splitBsProps, bsSizes } from './utils/bootstrapUtils';
15
12
  import { SIZE_MAP, Size } from './utils/StyleConfig';
16
-
17
13
  var propTypes = {
18
14
  componentClass: elementType,
15
+
19
16
  /**
20
17
  * Only relevant if `componentClass` is `'input'`.
21
18
  */
22
19
  type: PropTypes.string,
20
+
23
21
  /**
24
22
  * Uses `controlId` from `<FormGroup>` if not explicitly specified.
25
23
  */
26
24
  id: PropTypes.string,
25
+
27
26
  /**
28
27
  * Attaches a ref to the `<input>` element. Only functions can be used here.
29
28
  *
@@ -33,55 +32,57 @@ var propTypes = {
33
32
  */
34
33
  inputRef: PropTypes.func
35
34
  };
36
-
37
35
  var defaultProps = {
38
36
  componentClass: 'input'
39
37
  };
40
-
41
38
  var contextTypes = {
42
39
  $bs_formGroup: PropTypes.object
43
40
  };
44
41
 
45
- var FormControl = function (_React$Component) {
46
- _inherits(FormControl, _React$Component);
42
+ var FormControl =
43
+ /*#__PURE__*/
44
+ function (_React$Component) {
45
+ _inheritsLoose(FormControl, _React$Component);
47
46
 
48
47
  function FormControl() {
49
- _classCallCheck(this, FormControl);
50
-
51
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
48
+ return _React$Component.apply(this, arguments) || this;
52
49
  }
53
50
 
54
- FormControl.prototype.render = function render() {
51
+ var _proto = FormControl.prototype;
52
+
53
+ _proto.render = function render() {
55
54
  var formGroup = this.context.$bs_formGroup;
56
55
  var controlId = formGroup && formGroup.controlId;
57
56
 
58
- var _props = this.props,
59
- Component = _props.componentClass,
60
- type = _props.type,
61
- _props$id = _props.id,
62
- id = _props$id === undefined ? controlId : _props$id,
63
- inputRef = _props.inputRef,
64
- className = _props.className,
65
- bsSize = _props.bsSize,
66
- props = _objectWithoutProperties(_props, ['componentClass', 'type', 'id', 'inputRef', 'className', 'bsSize']);
57
+ var _this$props = this.props,
58
+ Component = _this$props.componentClass,
59
+ type = _this$props.type,
60
+ _this$props$id = _this$props.id,
61
+ id = _this$props$id === void 0 ? controlId : _this$props$id,
62
+ inputRef = _this$props.inputRef,
63
+ className = _this$props.className,
64
+ bsSize = _this$props.bsSize,
65
+ props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "type", "id", "inputRef", "className", "bsSize"]);
67
66
 
68
67
  var _splitBsProps = splitBsProps(props),
69
68
  bsProps = _splitBsProps[0],
70
69
  elementProps = _splitBsProps[1];
71
70
 
72
- process.env.NODE_ENV !== 'production' ? warning(controlId == null || id === controlId, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : void 0;
71
+ process.env.NODE_ENV !== "production" ? warning(controlId == null || id === controlId, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : void 0; // input[type="file"] should not have .form-control.
72
+
73
+ var classes;
73
74
 
74
- // input[type="file"] should not have .form-control.
75
- var classes = void 0;
76
75
  if (type !== 'file') {
77
76
  classes = getClassSet(bsProps);
78
- }
79
-
80
- // If user provides a size, make sure to append it to classes as input-
77
+ } // If user provides a size, make sure to append it to classes as input-
81
78
  // e.g. if bsSize is small, it will append input-sm
79
+
80
+
82
81
  if (bsSize) {
83
82
  var size = SIZE_MAP[bsSize] || bsSize;
84
- classes[prefix({ bsClass: 'input' }, size)] = true;
83
+ classes[prefix({
84
+ bsClass: 'input'
85
+ }, size)] = true;
85
86
  }
86
87
 
87
88
  return React.createElement(Component, _extends({}, elementProps, {
@@ -98,8 +99,6 @@ var FormControl = function (_React$Component) {
98
99
  FormControl.propTypes = propTypes;
99
100
  FormControl.defaultProps = defaultProps;
100
101
  FormControl.contextTypes = contextTypes;
101
-
102
102
  FormControl.Feedback = FormControlFeedback;
103
103
  FormControl.Static = FormControlStatic;
104
-
105
104
  export default bsClass('form-control', bsSizes([Size.SMALL, Size.LARGE], FormControl));