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.
- package/CHANGELOG.md +38 -0
- package/README.md +11 -7
- package/dist/react-bootstrap.js +13464 -13723
- package/dist/react-bootstrap.min.js +10 -18464
- package/es/Accordion.js +13 -16
- package/es/Alert.js +26 -31
- package/es/Badge.js +21 -31
- package/es/Breadcrumb.js +17 -20
- package/es/BreadcrumbItem.js +30 -30
- package/es/Button.js +23 -27
- package/es/ButtonGroup.js +20 -22
- package/es/ButtonToolbar.js +16 -18
- package/es/Carousel.js +120 -157
- package/es/CarouselCaption.js +18 -21
- package/es/CarouselItem.js +34 -33
- package/es/Checkbox.js +43 -54
- package/es/Clearfix.js +24 -24
- package/es/CloseButton.js +21 -30
- package/es/Col.js +42 -26
- package/es/Collapse.js +68 -68
- package/es/ControlLabel.js +19 -24
- package/es/Dropdown.js +93 -91
- package/es/DropdownButton.js +25 -35
- package/es/DropdownMenu.js +65 -65
- package/es/DropdownToggle.js +28 -40
- package/es/Fade.js +26 -29
- package/es/Form.js +22 -22
- package/es/FormControl.js +32 -33
- package/es/FormControlFeedback.js +21 -21
- package/es/FormControlStatic.js +18 -21
- package/es/FormGroup.js +27 -34
- package/es/Glyphicon.js +18 -19
- package/es/Grid.js +20 -22
- package/es/HelpBlock.js +17 -17
- package/es/Image.js +19 -24
- package/es/InputGroup.js +17 -18
- package/es/InputGroupAddon.js +17 -17
- package/es/InputGroupButton.js +17 -17
- package/es/Jumbotron.js +18 -21
- package/es/Label.js +21 -27
- package/es/ListGroup.js +24 -29
- package/es/ListGroupItem.js +30 -48
- package/es/Media.js +18 -22
- package/es/MediaBody.js +19 -22
- package/es/MediaHeading.js +18 -21
- package/es/MediaLeft.js +18 -19
- package/es/MediaList.js +17 -17
- package/es/MediaListItem.js +17 -17
- package/es/MediaRight.js +18 -19
- package/es/MenuItem.js +44 -49
- package/es/Modal.js +63 -74
- package/es/ModalBody.js +18 -21
- package/es/ModalDialog.js +31 -39
- package/es/ModalFooter.js +18 -21
- package/es/ModalHeader.js +25 -35
- package/es/ModalTitle.js +18 -21
- package/es/Nav.js +73 -92
- package/es/NavDropdown.js +40 -52
- package/es/NavItem.js +34 -38
- package/es/Navbar.js +62 -73
- package/es/NavbarBrand.js +20 -24
- package/es/NavbarCollapse.js +21 -28
- package/es/NavbarHeader.js +19 -20
- package/es/NavbarToggle.js +30 -38
- package/es/Overlay.js +21 -25
- package/es/OverlayTrigger.js +71 -68
- package/es/PageHeader.js +18 -26
- package/es/PageItem.js +0 -1
- package/es/Pager.js +23 -30
- package/es/PagerItem.js +36 -40
- package/es/Pagination.js +18 -24
- package/es/PaginationItem.js +47 -57
- package/es/Panel.js +51 -54
- package/es/PanelBody.js +18 -29
- package/es/PanelCollapse.js +20 -23
- package/es/PanelFooter.js +16 -23
- package/es/PanelGroup.js +44 -45
- package/es/PanelHeading.js +19 -28
- package/es/PanelTitle.js +22 -34
- package/es/PanelToggle.js +21 -24
- package/es/Popover.js +36 -46
- package/es/ProgressBar.js +59 -62
- package/es/Radio.js +43 -54
- package/es/ResponsiveEmbed.js +27 -32
- package/es/Row.js +18 -21
- package/es/SafeAnchor.js +32 -32
- package/es/SplitButton.js +33 -46
- package/es/SplitToggle.js +14 -13
- package/es/Tab.js +12 -18
- package/es/TabContainer.js +24 -30
- package/es/TabContent.js +36 -43
- package/es/TabPane.js +58 -68
- package/es/Table.js +25 -29
- package/es/Tabs.js +56 -71
- package/es/Thumbnail.js +34 -34
- package/es/ToggleButton.js +32 -37
- package/es/ToggleButtonGroup.js +45 -57
- package/es/Tooltip.js +33 -40
- package/es/Well.js +17 -17
- package/es/index.js +2 -0
- package/es/utils/PropTypes.js +13 -19
- package/es/utils/StyleConfig.js +0 -4
- package/es/utils/ValidComponentChildren.js +11 -20
- package/es/utils/bootstrapUtils.js +17 -31
- package/es/utils/createChainedFunction.js +2 -2
- package/es/utils/deprecationWarning.js +28 -30
- package/es/utils/splitComponentProps.js +1 -2
- package/lib/Accordion.js +23 -36
- package/lib/Alert.js +43 -65
- package/lib/Badge.js +36 -56
- package/lib/Breadcrumb.js +32 -47
- package/lib/BreadcrumbItem.js +48 -63
- package/lib/Button.js +49 -71
- package/lib/ButtonGroup.js +39 -57
- package/lib/ButtonToolbar.js +29 -42
- package/lib/Carousel.js +161 -214
- package/lib/CarouselCaption.js +32 -46
- package/lib/CarouselItem.js +54 -73
- package/lib/Checkbox.js +64 -87
- package/lib/Clearfix.js +45 -58
- package/lib/CloseButton.js +33 -50
- package/lib/Col.js +78 -73
- package/lib/Collapse.js +104 -125
- package/lib/ControlLabel.js +38 -59
- package/lib/Dropdown.js +153 -192
- package/lib/DropdownButton.js +44 -70
- package/lib/DropdownMenu.js +96 -120
- package/lib/DropdownToggle.js +48 -77
- package/lib/Fade.js +49 -68
- package/lib/Form.js +39 -52
- package/lib/FormControl.js +58 -79
- package/lib/FormControlFeedback.js +42 -54
- package/lib/FormControlStatic.js +32 -46
- package/lib/FormGroup.js +47 -67
- package/lib/Glyphicon.js +33 -46
- package/lib/Grid.js +36 -51
- package/lib/HelpBlock.js +29 -40
- package/lib/Image.js +37 -53
- package/lib/InputGroup.js +34 -49
- package/lib/InputGroupAddon.js +29 -40
- package/lib/InputGroupButton.js +29 -40
- package/lib/Jumbotron.js +32 -46
- package/lib/Label.js +35 -53
- package/lib/ListGroup.js +45 -61
- package/lib/ListGroupItem.js +55 -85
- package/lib/Media.js +43 -70
- package/lib/MediaBody.js +37 -55
- package/lib/MediaHeading.js +32 -46
- package/lib/MediaLeft.js +34 -48
- package/lib/MediaList.js +29 -40
- package/lib/MediaListItem.js +29 -40
- package/lib/MediaRight.js +34 -48
- package/lib/MenuItem.js +70 -92
- package/lib/Modal.js +130 -186
- package/lib/ModalBody.js +32 -46
- package/lib/ModalDialog.js +47 -69
- package/lib/ModalFooter.js +32 -46
- package/lib/ModalHeader.js +43 -70
- package/lib/ModalTitle.js +32 -46
- package/lib/Nav.js +122 -160
- package/lib/NavDropdown.js +63 -97
- package/lib/NavItem.js +54 -77
- package/lib/Navbar.js +115 -152
- package/lib/NavbarBrand.js +37 -55
- package/lib/NavbarCollapse.js +36 -57
- package/lib/NavbarHeader.js +33 -48
- package/lib/NavbarToggle.js +52 -77
- package/lib/Overlay.js +50 -75
- package/lib/OverlayTrigger.js +114 -129
- package/lib/PageHeader.js +30 -49
- package/lib/PageItem.js +9 -10
- package/lib/Pager.js +41 -63
- package/lib/PagerItem.js +55 -78
- package/lib/Pagination.js +32 -50
- package/lib/PaginationItem.js +67 -91
- package/lib/Panel.js +93 -127
- package/lib/PanelBody.js +35 -57
- package/lib/PanelCollapse.js +44 -56
- package/lib/PanelFooter.js +31 -48
- package/lib/PanelGroup.js +73 -88
- package/lib/PanelHeading.js +37 -59
- package/lib/PanelTitle.js +41 -68
- package/lib/PanelToggle.js +45 -66
- package/lib/Popover.js +59 -84
- package/lib/ProgressBar.js +86 -103
- package/lib/Radio.js +64 -87
- package/lib/ResponsiveEmbed.js +45 -63
- package/lib/Row.js +32 -46
- package/lib/SafeAnchor.js +53 -69
- package/lib/SplitButton.js +57 -90
- package/lib/SplitToggle.js +25 -34
- package/lib/Tab.js +32 -55
- package/lib/TabContainer.js +45 -61
- package/lib/TabContent.js +67 -87
- package/lib/TabPane.js +103 -131
- package/lib/Table.js +44 -59
- package/lib/Tabs.js +82 -119
- package/lib/Thumbnail.js +55 -67
- package/lib/ToggleButton.js +49 -68
- package/lib/ToggleButtonGroup.js +67 -104
- package/lib/Tooltip.js +55 -77
- package/lib/Well.js +30 -41
- package/lib/index.js +147 -214
- package/lib/utils/PropTypes.js +24 -31
- package/lib/utils/StyleConfig.js +13 -11
- package/lib/utils/ValidComponentChildren.js +34 -29
- package/lib/utils/bootstrapUtils.js +41 -52
- package/lib/utils/capitalize.js +2 -0
- package/lib/utils/createChainedFunction.js +8 -5
- package/lib/utils/deprecationWarning.js +37 -47
- package/lib/utils/index.js +11 -15
- package/lib/utils/splitComponentProps.js +5 -10
- package/package.json +58 -50
package/es/Popover.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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 isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
10
|
-
|
|
11
8
|
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
12
|
-
|
|
13
9
|
var propTypes = {
|
|
14
10
|
/**
|
|
15
11
|
* An html id attribute, necessary for accessibility
|
|
@@ -27,6 +23,7 @@ var propTypes = {
|
|
|
27
23
|
* The "top" position value for the Popover.
|
|
28
24
|
*/
|
|
29
25
|
positionTop: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
26
|
+
|
|
30
27
|
/**
|
|
31
28
|
* The "left" position value for the Popover.
|
|
32
29
|
*/
|
|
@@ -36,6 +33,7 @@ var propTypes = {
|
|
|
36
33
|
* The "top" position value for the Popover arrow.
|
|
37
34
|
*/
|
|
38
35
|
arrowOffsetTop: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
36
|
+
|
|
39
37
|
/**
|
|
40
38
|
* The "left" position value for the Popover arrow.
|
|
41
39
|
*/
|
|
@@ -46,34 +44,35 @@ var propTypes = {
|
|
|
46
44
|
*/
|
|
47
45
|
title: PropTypes.node
|
|
48
46
|
};
|
|
49
|
-
|
|
50
47
|
var defaultProps = {
|
|
51
48
|
placement: 'right'
|
|
52
49
|
};
|
|
53
50
|
|
|
54
|
-
var Popover =
|
|
55
|
-
|
|
51
|
+
var Popover =
|
|
52
|
+
/*#__PURE__*/
|
|
53
|
+
function (_React$Component) {
|
|
54
|
+
_inheritsLoose(Popover, _React$Component);
|
|
56
55
|
|
|
57
56
|
function Popover() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
57
|
+
return _React$Component.apply(this, arguments) || this;
|
|
61
58
|
}
|
|
62
59
|
|
|
63
|
-
Popover.prototype
|
|
60
|
+
var _proto = Popover.prototype;
|
|
61
|
+
|
|
62
|
+
_proto.render = function render() {
|
|
64
63
|
var _extends2;
|
|
65
64
|
|
|
66
|
-
var
|
|
67
|
-
placement =
|
|
68
|
-
positionTop =
|
|
69
|
-
positionLeft =
|
|
70
|
-
arrowOffsetTop =
|
|
71
|
-
arrowOffsetLeft =
|
|
72
|
-
title =
|
|
73
|
-
className =
|
|
74
|
-
style =
|
|
75
|
-
children =
|
|
76
|
-
props =
|
|
65
|
+
var _this$props = this.props,
|
|
66
|
+
placement = _this$props.placement,
|
|
67
|
+
positionTop = _this$props.positionTop,
|
|
68
|
+
positionLeft = _this$props.positionLeft,
|
|
69
|
+
arrowOffsetTop = _this$props.arrowOffsetTop,
|
|
70
|
+
arrowOffsetLeft = _this$props.arrowOffsetLeft,
|
|
71
|
+
title = _this$props.title,
|
|
72
|
+
className = _this$props.className,
|
|
73
|
+
style = _this$props.style,
|
|
74
|
+
children = _this$props.children,
|
|
75
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["placement", "positionTop", "positionLeft", "arrowOffsetTop", "arrowOffsetLeft", "title", "className", "style", "children"]);
|
|
77
76
|
|
|
78
77
|
var _splitBsProps = splitBsProps(props),
|
|
79
78
|
bsProps = _splitBsProps[0],
|
|
@@ -91,26 +90,18 @@ var Popover = function (_React$Component) {
|
|
|
91
90
|
top: arrowOffsetTop,
|
|
92
91
|
left: arrowOffsetLeft
|
|
93
92
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
title
|
|
107
|
-
),
|
|
108
|
-
React.createElement(
|
|
109
|
-
'div',
|
|
110
|
-
{ className: prefix(bsProps, 'content') },
|
|
111
|
-
children
|
|
112
|
-
)
|
|
113
|
-
);
|
|
93
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
94
|
+
role: "tooltip",
|
|
95
|
+
className: classNames(className, classes),
|
|
96
|
+
style: outerStyle
|
|
97
|
+
}), React.createElement("div", {
|
|
98
|
+
className: "arrow",
|
|
99
|
+
style: arrowStyle
|
|
100
|
+
}), title && React.createElement("h3", {
|
|
101
|
+
className: prefix(bsProps, 'title')
|
|
102
|
+
}, title), React.createElement("div", {
|
|
103
|
+
className: prefix(bsProps, 'content')
|
|
104
|
+
}, children));
|
|
114
105
|
};
|
|
115
106
|
|
|
116
107
|
return Popover;
|
|
@@ -118,5 +109,4 @@ var Popover = function (_React$Component) {
|
|
|
118
109
|
|
|
119
110
|
Popover.propTypes = propTypes;
|
|
120
111
|
Popover.defaultProps = defaultProps;
|
|
121
|
-
|
|
122
112
|
export default bsClass('popover', Popover);
|
package/es/ProgressBar.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import _Object$values from
|
|
2
|
-
import _extends from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
6
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _Object$values from "@babel/runtime-corejs2/core-js/object/values";
|
|
2
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
7
5
|
import classNames from 'classnames';
|
|
8
6
|
import React, { cloneElement } from 'react';
|
|
9
7
|
import PropTypes from 'prop-types';
|
|
10
|
-
|
|
11
8
|
import { bsClass as setBsClass, bsStyles, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
12
9
|
import { State } from './utils/StyleConfig';
|
|
13
10
|
import ValidComponentChildren from './utils/ValidComponentChildren';
|
|
14
|
-
|
|
15
11
|
var ROUND_PRECISION = 1000;
|
|
16
|
-
|
|
17
12
|
/**
|
|
18
13
|
* Validate that children, if any, are instances of `<ProgressBar>`.
|
|
19
14
|
*/
|
|
15
|
+
|
|
20
16
|
function onlyProgressBar(props, propName, componentName) {
|
|
21
17
|
var children = props[propName];
|
|
18
|
+
|
|
22
19
|
if (!children) {
|
|
23
20
|
return null;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
var error = null;
|
|
27
|
-
|
|
28
24
|
React.Children.forEach(children, function (child) {
|
|
29
25
|
if (error) {
|
|
30
26
|
return;
|
|
31
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Compare types in a way that works with libraries that patch and proxy
|
|
30
|
+
* components like react-hot-loader.
|
|
31
|
+
*
|
|
32
|
+
* see https://github.com/gaearon/react-hot-loader#checking-element-types
|
|
33
|
+
*/
|
|
32
34
|
|
|
33
|
-
// eslint-disable-next-line no-use-before-define
|
|
34
|
-
if (child.type === ProgressBar) return;
|
|
35
35
|
|
|
36
|
+
var element = React.createElement(ProgressBar, null);
|
|
37
|
+
if (child.type === element.type) return;
|
|
36
38
|
var childIdentifier = React.isValidElement(child) ? child.type.displayName || child.type.name || child.type : child;
|
|
37
|
-
error = new Error(
|
|
39
|
+
error = new Error("Children of " + componentName + " can contain only ProgressBar " + ("components. Found " + childIdentifier + "."));
|
|
38
40
|
});
|
|
39
|
-
|
|
40
41
|
return error;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -55,7 +56,6 @@ var propTypes = {
|
|
|
55
56
|
*/
|
|
56
57
|
isChild: PropTypes.bool
|
|
57
58
|
};
|
|
58
|
-
|
|
59
59
|
var defaultProps = {
|
|
60
60
|
min: 0,
|
|
61
61
|
max: 100,
|
|
@@ -70,16 +70,18 @@ function getPercentage(now, min, max) {
|
|
|
70
70
|
return Math.round(percentage * ROUND_PRECISION) / ROUND_PRECISION;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
var ProgressBar =
|
|
74
|
-
|
|
73
|
+
var ProgressBar =
|
|
74
|
+
/*#__PURE__*/
|
|
75
|
+
function (_React$Component) {
|
|
76
|
+
_inheritsLoose(ProgressBar, _React$Component);
|
|
75
77
|
|
|
76
78
|
function ProgressBar() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
79
|
+
return _React$Component.apply(this, arguments) || this;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
ProgressBar.prototype
|
|
82
|
+
var _proto = ProgressBar.prototype;
|
|
83
|
+
|
|
84
|
+
_proto.renderProgressBar = function renderProgressBar(_ref) {
|
|
83
85
|
var _extends2;
|
|
84
86
|
|
|
85
87
|
var min = _ref.min,
|
|
@@ -91,7 +93,7 @@ var ProgressBar = function (_React$Component) {
|
|
|
91
93
|
active = _ref.active,
|
|
92
94
|
className = _ref.className,
|
|
93
95
|
style = _ref.style,
|
|
94
|
-
props =
|
|
96
|
+
props = _objectWithoutPropertiesLoose(_ref, ["min", "now", "max", "label", "srOnly", "striped", "active", "className", "style"]);
|
|
95
97
|
|
|
96
98
|
var _splitBsProps = splitBsProps(props),
|
|
97
99
|
bsProps = _splitBsProps[0],
|
|
@@ -101,28 +103,24 @@ var ProgressBar = function (_React$Component) {
|
|
|
101
103
|
active: active
|
|
102
104
|
}, _extends2[prefix(bsProps, 'striped')] = active || striped, _extends2));
|
|
103
105
|
|
|
104
|
-
return React.createElement(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
{ className: 'sr-only' },
|
|
117
|
-
label
|
|
118
|
-
) : label
|
|
119
|
-
);
|
|
106
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
107
|
+
role: "progressbar",
|
|
108
|
+
className: classNames(className, classes),
|
|
109
|
+
style: _extends({
|
|
110
|
+
width: getPercentage(now, min, max) + "%"
|
|
111
|
+
}, style),
|
|
112
|
+
"aria-valuenow": now,
|
|
113
|
+
"aria-valuemin": min,
|
|
114
|
+
"aria-valuemax": max
|
|
115
|
+
}), srOnly ? React.createElement("span", {
|
|
116
|
+
className: "sr-only"
|
|
117
|
+
}, label) : label);
|
|
120
118
|
};
|
|
121
119
|
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
isChild =
|
|
125
|
-
props =
|
|
120
|
+
_proto.render = function render() {
|
|
121
|
+
var _this$props = this.props,
|
|
122
|
+
isChild = _this$props.isChild,
|
|
123
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["isChild"]);
|
|
126
124
|
|
|
127
125
|
if (isChild) {
|
|
128
126
|
return this.renderProgressBar(props);
|
|
@@ -139,25 +137,25 @@ var ProgressBar = function (_React$Component) {
|
|
|
139
137
|
bsStyle = props.bsStyle,
|
|
140
138
|
className = props.className,
|
|
141
139
|
children = props.children,
|
|
142
|
-
wrapperProps =
|
|
143
|
-
|
|
144
|
-
return React.createElement(
|
|
145
|
-
'
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
);
|
|
140
|
+
wrapperProps = _objectWithoutPropertiesLoose(props, ["min", "now", "max", "label", "srOnly", "striped", "active", "bsClass", "bsStyle", "className", "children"]);
|
|
141
|
+
|
|
142
|
+
return React.createElement("div", _extends({}, wrapperProps, {
|
|
143
|
+
className: classNames(className, 'progress')
|
|
144
|
+
}), children ? ValidComponentChildren.map(children, function (child) {
|
|
145
|
+
return cloneElement(child, {
|
|
146
|
+
isChild: true
|
|
147
|
+
});
|
|
148
|
+
}) : this.renderProgressBar({
|
|
149
|
+
min: min,
|
|
150
|
+
now: now,
|
|
151
|
+
max: max,
|
|
152
|
+
label: label,
|
|
153
|
+
srOnly: srOnly,
|
|
154
|
+
striped: striped,
|
|
155
|
+
active: active,
|
|
156
|
+
bsClass: bsClass,
|
|
157
|
+
bsStyle: bsStyle
|
|
158
|
+
}));
|
|
161
159
|
};
|
|
162
160
|
|
|
163
161
|
return ProgressBar;
|
|
@@ -165,5 +163,4 @@ var ProgressBar = function (_React$Component) {
|
|
|
165
163
|
|
|
166
164
|
ProgressBar.propTypes = propTypes;
|
|
167
165
|
ProgressBar.defaultProps = defaultProps;
|
|
168
|
-
|
|
169
166
|
export default setBsClass('progress-bar', bsStyles(_Object$values(State), ProgressBar));
|
package/es/Radio.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
-
/* eslint-disable jsx-a11y/label-has-for */
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
7
4
|
|
|
5
|
+
/* eslint-disable jsx-a11y/label-has-for */
|
|
8
6
|
import classNames from 'classnames';
|
|
9
7
|
import React from 'react';
|
|
10
8
|
import PropTypes from 'prop-types';
|
|
11
9
|
import warning from 'warning';
|
|
12
|
-
|
|
13
10
|
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
14
|
-
|
|
15
11
|
var propTypes = {
|
|
16
12
|
inline: PropTypes.bool,
|
|
17
13
|
disabled: PropTypes.bool,
|
|
18
14
|
title: PropTypes.string,
|
|
15
|
+
|
|
19
16
|
/**
|
|
20
17
|
* Only valid if `inline` is not set.
|
|
21
18
|
*/
|
|
22
19
|
validationState: PropTypes.oneOf(['success', 'warning', 'error', null]),
|
|
20
|
+
|
|
23
21
|
/**
|
|
24
22
|
* Attaches a ref to the `<input>` element. Only functions can be used here.
|
|
25
23
|
*
|
|
@@ -29,82 +27,74 @@ var propTypes = {
|
|
|
29
27
|
*/
|
|
30
28
|
inputRef: PropTypes.func
|
|
31
29
|
};
|
|
32
|
-
|
|
33
30
|
var defaultProps = {
|
|
34
31
|
inline: false,
|
|
35
32
|
disabled: false,
|
|
36
33
|
title: ''
|
|
37
34
|
};
|
|
38
35
|
|
|
39
|
-
var Radio =
|
|
40
|
-
|
|
36
|
+
var Radio =
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
function (_React$Component) {
|
|
39
|
+
_inheritsLoose(Radio, _React$Component);
|
|
41
40
|
|
|
42
41
|
function Radio() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
42
|
+
return _React$Component.apply(this, arguments) || this;
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
Radio.prototype
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
var _proto = Radio.prototype;
|
|
46
|
+
|
|
47
|
+
_proto.render = function render() {
|
|
48
|
+
var _this$props = this.props,
|
|
49
|
+
inline = _this$props.inline,
|
|
50
|
+
disabled = _this$props.disabled,
|
|
51
|
+
validationState = _this$props.validationState,
|
|
52
|
+
inputRef = _this$props.inputRef,
|
|
53
|
+
className = _this$props.className,
|
|
54
|
+
style = _this$props.style,
|
|
55
|
+
title = _this$props.title,
|
|
56
|
+
children = _this$props.children,
|
|
57
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["inline", "disabled", "validationState", "inputRef", "className", "style", "title", "children"]);
|
|
59
58
|
|
|
60
59
|
var _splitBsProps = splitBsProps(props),
|
|
61
60
|
bsProps = _splitBsProps[0],
|
|
62
61
|
elementProps = _splitBsProps[1];
|
|
63
62
|
|
|
64
|
-
var input = React.createElement(
|
|
63
|
+
var input = React.createElement("input", _extends({}, elementProps, {
|
|
65
64
|
ref: inputRef,
|
|
66
|
-
type:
|
|
65
|
+
type: "radio",
|
|
67
66
|
disabled: disabled
|
|
68
67
|
}));
|
|
69
68
|
|
|
70
69
|
if (inline) {
|
|
71
70
|
var _classes2;
|
|
72
71
|
|
|
73
|
-
var _classes = (_classes2 = {}, _classes2[prefix(bsProps, 'inline')] = true, _classes2.disabled = disabled, _classes2);
|
|
74
|
-
|
|
75
|
-
// Use a warning here instead of in propTypes to get better-looking
|
|
72
|
+
var _classes = (_classes2 = {}, _classes2[prefix(bsProps, 'inline')] = true, _classes2.disabled = disabled, _classes2); // Use a warning here instead of in propTypes to get better-looking
|
|
76
73
|
// generated documentation.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
input,
|
|
87
|
-
children
|
|
88
|
-
);
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
process.env.NODE_ENV !== "production" ? warning(!validationState, '`validationState` is ignored on `<Radio inline>`. To display ' + 'validation state on an inline radio, set `validationState` on a ' + 'parent `<FormGroup>` or other element instead.') : void 0;
|
|
77
|
+
return React.createElement("label", {
|
|
78
|
+
className: classNames(className, _classes),
|
|
79
|
+
style: style,
|
|
80
|
+
title: title
|
|
81
|
+
}, input, children);
|
|
89
82
|
}
|
|
90
83
|
|
|
91
84
|
var classes = _extends({}, getClassSet(bsProps), {
|
|
92
85
|
disabled: disabled
|
|
93
86
|
});
|
|
87
|
+
|
|
94
88
|
if (validationState) {
|
|
95
|
-
classes[
|
|
89
|
+
classes["has-" + validationState] = true;
|
|
96
90
|
}
|
|
97
91
|
|
|
98
|
-
return React.createElement(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
input,
|
|
105
|
-
children
|
|
106
|
-
)
|
|
107
|
-
);
|
|
92
|
+
return React.createElement("div", {
|
|
93
|
+
className: classNames(className, classes),
|
|
94
|
+
style: style
|
|
95
|
+
}, React.createElement("label", {
|
|
96
|
+
title: title
|
|
97
|
+
}, input, children));
|
|
108
98
|
};
|
|
109
99
|
|
|
110
100
|
return Radio;
|
|
@@ -112,5 +102,4 @@ var Radio = function (_React$Component) {
|
|
|
112
102
|
|
|
113
103
|
Radio.propTypes = propTypes;
|
|
114
104
|
Radio.defaultProps = defaultProps;
|
|
115
|
-
|
|
116
105
|
export default bsClass('radio', Radio);
|
package/es/ResponsiveEmbed.js
CHANGED
|
@@ -1,72 +1,68 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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, { cloneElement } from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import warning from 'warning';
|
|
10
|
-
|
|
11
|
-
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
12
|
-
|
|
13
|
-
// TODO: This should probably take a single `aspectRatio` prop.
|
|
8
|
+
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils'; // TODO: This should probably take a single `aspectRatio` prop.
|
|
14
9
|
|
|
15
10
|
var propTypes = {
|
|
16
11
|
/**
|
|
17
12
|
* This component requires a single child element
|
|
18
13
|
*/
|
|
19
14
|
children: PropTypes.element.isRequired,
|
|
15
|
+
|
|
20
16
|
/**
|
|
21
17
|
* 16by9 aspect ratio
|
|
22
18
|
*/
|
|
23
19
|
a16by9: PropTypes.bool,
|
|
20
|
+
|
|
24
21
|
/**
|
|
25
22
|
* 4by3 aspect ratio
|
|
26
23
|
*/
|
|
27
24
|
a4by3: PropTypes.bool
|
|
28
25
|
};
|
|
29
|
-
|
|
30
26
|
var defaultProps = {
|
|
31
27
|
a16by9: false,
|
|
32
28
|
a4by3: false
|
|
33
29
|
};
|
|
34
30
|
|
|
35
|
-
var ResponsiveEmbed =
|
|
36
|
-
|
|
31
|
+
var ResponsiveEmbed =
|
|
32
|
+
/*#__PURE__*/
|
|
33
|
+
function (_React$Component) {
|
|
34
|
+
_inheritsLoose(ResponsiveEmbed, _React$Component);
|
|
37
35
|
|
|
38
36
|
function ResponsiveEmbed() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
37
|
+
return _React$Component.apply(this, arguments) || this;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
|
-
ResponsiveEmbed.prototype
|
|
40
|
+
var _proto = ResponsiveEmbed.prototype;
|
|
41
|
+
|
|
42
|
+
_proto.render = function render() {
|
|
45
43
|
var _extends2;
|
|
46
44
|
|
|
47
|
-
var
|
|
48
|
-
a16by9 =
|
|
49
|
-
a4by3 =
|
|
50
|
-
className =
|
|
51
|
-
children =
|
|
52
|
-
props =
|
|
45
|
+
var _this$props = this.props,
|
|
46
|
+
a16by9 = _this$props.a16by9,
|
|
47
|
+
a4by3 = _this$props.a4by3,
|
|
48
|
+
className = _this$props.className,
|
|
49
|
+
children = _this$props.children,
|
|
50
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["a16by9", "a4by3", "className", "children"]);
|
|
53
51
|
|
|
54
52
|
var _splitBsProps = splitBsProps(props),
|
|
55
53
|
bsProps = _splitBsProps[0],
|
|
56
54
|
elementProps = _splitBsProps[1];
|
|
57
55
|
|
|
58
|
-
process.env.NODE_ENV !==
|
|
59
|
-
process.env.NODE_ENV !==
|
|
56
|
+
process.env.NODE_ENV !== "production" ? warning(a16by9 || a4by3, 'Either `a16by9` or `a4by3` must be set.') : void 0;
|
|
57
|
+
process.env.NODE_ENV !== "production" ? warning(!(a16by9 && a4by3), 'Only one of `a16by9` or `a4by3` can be set.') : void 0;
|
|
60
58
|
|
|
61
59
|
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, '16by9')] = a16by9, _extends2[prefix(bsProps, '4by3')] = a4by3, _extends2));
|
|
62
60
|
|
|
63
|
-
return React.createElement(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}))
|
|
69
|
-
);
|
|
61
|
+
return React.createElement("div", {
|
|
62
|
+
className: classNames(classes)
|
|
63
|
+
}, cloneElement(children, _extends({}, elementProps, {
|
|
64
|
+
className: classNames(className, prefix(bsProps, 'item'))
|
|
65
|
+
})));
|
|
70
66
|
};
|
|
71
67
|
|
|
72
68
|
return ResponsiveEmbed;
|
|
@@ -74,5 +70,4 @@ var ResponsiveEmbed = function (_React$Component) {
|
|
|
74
70
|
|
|
75
71
|
ResponsiveEmbed.propTypes = propTypes;
|
|
76
72
|
ResponsiveEmbed.defaultProps = defaultProps;
|
|
77
|
-
|
|
78
73
|
export default bsClass('embed-responsive', ResponsiveEmbed);
|
package/es/Row.js
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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 elementType from 'prop-types-extra/lib/elementType';
|
|
9
|
-
|
|
10
7
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var propTypes = {
|
|
13
9
|
componentClass: elementType
|
|
14
10
|
};
|
|
15
|
-
|
|
16
11
|
var defaultProps = {
|
|
17
12
|
componentClass: 'div'
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
var Row =
|
|
21
|
-
|
|
15
|
+
var Row =
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
function (_React$Component) {
|
|
18
|
+
_inheritsLoose(Row, _React$Component);
|
|
22
19
|
|
|
23
20
|
function Row() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
27
22
|
}
|
|
28
23
|
|
|
29
|
-
Row.prototype
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var _proto = Row.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
Component = _this$props.componentClass,
|
|
29
|
+
className = _this$props.className,
|
|
30
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "className"]);
|
|
34
31
|
|
|
35
32
|
var _splitBsProps = splitBsProps(props),
|
|
36
33
|
bsProps = _splitBsProps[0],
|
|
37
34
|
elementProps = _splitBsProps[1];
|
|
38
35
|
|
|
39
36
|
var classes = getClassSet(bsProps);
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
38
|
+
className: classNames(className, classes)
|
|
39
|
+
}));
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
return Row;
|
|
@@ -46,5 +44,4 @@ var Row = function (_React$Component) {
|
|
|
46
44
|
|
|
47
45
|
Row.propTypes = propTypes;
|
|
48
46
|
Row.defaultProps = defaultProps;
|
|
49
|
-
|
|
50
47
|
export default bsClass('row', Row);
|