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/ToggleButton.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
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 PropTypes from 'prop-types';
|
|
7
5
|
import React from 'react';
|
|
8
|
-
|
|
9
6
|
import Button from './Button';
|
|
10
|
-
|
|
11
7
|
var propTypes = {
|
|
12
8
|
/**
|
|
13
9
|
* The `<input>` `type`
|
|
@@ -35,52 +31,51 @@ var propTypes = {
|
|
|
35
31
|
* [onChange description]
|
|
36
32
|
*/
|
|
37
33
|
onChange: PropTypes.func,
|
|
34
|
+
|
|
38
35
|
/**
|
|
39
36
|
* The value of the input, and unique identifier in the ToggleButtonGroup
|
|
40
37
|
*/
|
|
41
38
|
value: PropTypes.any.isRequired
|
|
42
39
|
};
|
|
43
40
|
|
|
44
|
-
var ToggleButton =
|
|
45
|
-
|
|
41
|
+
var ToggleButton =
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
function (_React$Component) {
|
|
44
|
+
_inheritsLoose(ToggleButton, _React$Component);
|
|
46
45
|
|
|
47
46
|
function ToggleButton() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
47
|
+
return _React$Component.apply(this, arguments) || this;
|
|
51
48
|
}
|
|
52
49
|
|
|
53
|
-
ToggleButton.prototype
|
|
54
|
-
var _props = this.props,
|
|
55
|
-
children = _props.children,
|
|
56
|
-
name = _props.name,
|
|
57
|
-
checked = _props.checked,
|
|
58
|
-
type = _props.type,
|
|
59
|
-
onChange = _props.onChange,
|
|
60
|
-
value = _props.value,
|
|
61
|
-
props = _objectWithoutProperties(_props, ['children', 'name', 'checked', 'type', 'onChange', 'value']);
|
|
50
|
+
var _proto = ToggleButton.prototype;
|
|
62
51
|
|
|
63
|
-
|
|
52
|
+
_proto.render = function render() {
|
|
53
|
+
var _this$props = this.props,
|
|
54
|
+
children = _this$props.children,
|
|
55
|
+
name = _this$props.name,
|
|
56
|
+
checked = _this$props.checked,
|
|
57
|
+
type = _this$props.type,
|
|
58
|
+
onChange = _this$props.onChange,
|
|
59
|
+
value = _this$props.value,
|
|
60
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["children", "name", "checked", "type", "onChange", "value"]);
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
);
|
|
62
|
+
var disabled = props.disabled;
|
|
63
|
+
return React.createElement(Button, _extends({}, props, {
|
|
64
|
+
active: !!checked,
|
|
65
|
+
componentClass: "label"
|
|
66
|
+
}), React.createElement("input", {
|
|
67
|
+
name: name,
|
|
68
|
+
type: type,
|
|
69
|
+
autoComplete: "off",
|
|
70
|
+
value: value,
|
|
71
|
+
checked: !!checked,
|
|
72
|
+
disabled: !!disabled,
|
|
73
|
+
onChange: onChange
|
|
74
|
+
}), children);
|
|
79
75
|
};
|
|
80
76
|
|
|
81
77
|
return ToggleButton;
|
|
82
78
|
}(React.Component);
|
|
83
79
|
|
|
84
80
|
ToggleButton.propTypes = propTypes;
|
|
85
|
-
|
|
86
81
|
export default ToggleButton;
|
package/es/ToggleButtonGroup.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
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 PropTypes from 'prop-types';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import invariant from 'invariant';
|
|
9
7
|
import uncontrollable from 'uncontrollable';
|
|
10
|
-
|
|
11
8
|
import chainFunction from './utils/createChainedFunction';
|
|
12
9
|
import ValidChildren from './utils/ValidComponentChildren';
|
|
13
10
|
import ButtonGroup from './ButtonGroup';
|
|
14
11
|
import ToggleButton from './ToggleButton';
|
|
15
|
-
|
|
16
12
|
var propTypes = {
|
|
17
13
|
/**
|
|
18
14
|
* An HTML `<input>` name for each child button.
|
|
@@ -43,31 +39,30 @@ var propTypes = {
|
|
|
43
39
|
*/
|
|
44
40
|
type: PropTypes.oneOf(['checkbox', 'radio']).isRequired
|
|
45
41
|
};
|
|
46
|
-
|
|
47
42
|
var defaultProps = {
|
|
48
43
|
type: 'radio'
|
|
49
44
|
};
|
|
50
45
|
|
|
51
|
-
var ToggleButtonGroup =
|
|
52
|
-
|
|
46
|
+
var ToggleButtonGroup =
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
function (_React$Component) {
|
|
49
|
+
_inheritsLoose(ToggleButtonGroup, _React$Component);
|
|
53
50
|
|
|
54
51
|
function ToggleButtonGroup() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
52
|
+
return _React$Component.apply(this, arguments) || this;
|
|
58
53
|
}
|
|
59
54
|
|
|
60
|
-
ToggleButtonGroup.prototype
|
|
61
|
-
var value = this.props.value;
|
|
55
|
+
var _proto = ToggleButtonGroup.prototype;
|
|
62
56
|
|
|
57
|
+
_proto.getValues = function getValues() {
|
|
58
|
+
var value = this.props.value;
|
|
63
59
|
return value == null ? [] : [].concat(value);
|
|
64
60
|
};
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
type =
|
|
69
|
-
onChange =
|
|
70
|
-
|
|
62
|
+
_proto.handleToggle = function handleToggle(value) {
|
|
63
|
+
var _this$props = this.props,
|
|
64
|
+
type = _this$props.type,
|
|
65
|
+
onChange = _this$props.onChange;
|
|
71
66
|
var values = this.getValues();
|
|
72
67
|
var isActive = values.indexOf(value) !== -1;
|
|
73
68
|
|
|
@@ -75,6 +70,7 @@ var ToggleButtonGroup = function (_React$Component) {
|
|
|
75
70
|
if (!isActive) {
|
|
76
71
|
onChange(value);
|
|
77
72
|
}
|
|
73
|
+
|
|
78
74
|
return;
|
|
79
75
|
}
|
|
80
76
|
|
|
@@ -83,47 +79,42 @@ var ToggleButtonGroup = function (_React$Component) {
|
|
|
83
79
|
return n !== value;
|
|
84
80
|
}));
|
|
85
81
|
} else {
|
|
86
|
-
onChange(
|
|
82
|
+
onChange(values.concat([value]));
|
|
87
83
|
}
|
|
88
84
|
};
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
var
|
|
86
|
+
_proto.render = function render() {
|
|
87
|
+
var _this = this;
|
|
92
88
|
|
|
93
|
-
var
|
|
94
|
-
children =
|
|
95
|
-
type =
|
|
96
|
-
name =
|
|
97
|
-
props =
|
|
89
|
+
var _this$props2 = this.props,
|
|
90
|
+
children = _this$props2.children,
|
|
91
|
+
type = _this$props2.type,
|
|
92
|
+
name = _this$props2.name,
|
|
93
|
+
props = _objectWithoutPropertiesLoose(_this$props2, ["children", "type", "name"]);
|
|
98
94
|
|
|
99
95
|
var values = this.getValues();
|
|
100
|
-
|
|
101
|
-
!(type !== 'radio' || !!name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') : invariant(false) : void 0;
|
|
102
|
-
|
|
96
|
+
!(type !== 'radio' || !!name) ? process.env.NODE_ENV !== "production" ? invariant(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') : invariant(false) : void 0;
|
|
103
97
|
delete props.onChange;
|
|
104
|
-
delete props.value;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
})
|
|
126
|
-
);
|
|
98
|
+
delete props.value; // the data attribute is required b/c twbs css uses it in the selector
|
|
99
|
+
|
|
100
|
+
return React.createElement(ButtonGroup, _extends({}, props, {
|
|
101
|
+
"data-toggle": "buttons"
|
|
102
|
+
}), ValidChildren.map(children, function (child) {
|
|
103
|
+
var _child$props = child.props,
|
|
104
|
+
value = _child$props.value,
|
|
105
|
+
onChange = _child$props.onChange;
|
|
106
|
+
|
|
107
|
+
var handler = function handler() {
|
|
108
|
+
return _this.handleToggle(value);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return React.cloneElement(child, {
|
|
112
|
+
type: type,
|
|
113
|
+
name: child.name || name,
|
|
114
|
+
checked: values.indexOf(value) !== -1,
|
|
115
|
+
onChange: chainFunction(onChange, handler)
|
|
116
|
+
});
|
|
117
|
+
}));
|
|
127
118
|
};
|
|
128
119
|
|
|
129
120
|
return ToggleButtonGroup;
|
|
@@ -131,11 +122,8 @@ var ToggleButtonGroup = function (_React$Component) {
|
|
|
131
122
|
|
|
132
123
|
ToggleButtonGroup.propTypes = propTypes;
|
|
133
124
|
ToggleButtonGroup.defaultProps = defaultProps;
|
|
134
|
-
|
|
135
125
|
var UncontrolledToggleButtonGroup = uncontrollable(ToggleButtonGroup, {
|
|
136
126
|
value: 'onChange'
|
|
137
127
|
});
|
|
138
|
-
|
|
139
128
|
UncontrolledToggleButtonGroup.Button = ToggleButton;
|
|
140
|
-
|
|
141
129
|
export default UncontrolledToggleButtonGroup;
|
package/es/Tooltip.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 Tooltip.
|
|
28
24
|
*/
|
|
29
25
|
positionTop: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
26
|
+
|
|
30
27
|
/**
|
|
31
28
|
* The "left" position value for the Tooltip.
|
|
32
29
|
*/
|
|
@@ -36,38 +33,40 @@ var propTypes = {
|
|
|
36
33
|
* The "top" position value for the Tooltip arrow.
|
|
37
34
|
*/
|
|
38
35
|
arrowOffsetTop: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
36
|
+
|
|
39
37
|
/**
|
|
40
38
|
* The "left" position value for the Tooltip arrow.
|
|
41
39
|
*/
|
|
42
40
|
arrowOffsetLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
43
41
|
};
|
|
44
|
-
|
|
45
42
|
var defaultProps = {
|
|
46
43
|
placement: 'right'
|
|
47
44
|
};
|
|
48
45
|
|
|
49
|
-
var Tooltip =
|
|
50
|
-
|
|
46
|
+
var Tooltip =
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
function (_React$Component) {
|
|
49
|
+
_inheritsLoose(Tooltip, _React$Component);
|
|
51
50
|
|
|
52
51
|
function Tooltip() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
52
|
+
return _React$Component.apply(this, arguments) || this;
|
|
56
53
|
}
|
|
57
54
|
|
|
58
|
-
Tooltip.prototype
|
|
55
|
+
var _proto = Tooltip.prototype;
|
|
56
|
+
|
|
57
|
+
_proto.render = function render() {
|
|
59
58
|
var _extends2;
|
|
60
59
|
|
|
61
|
-
var
|
|
62
|
-
placement =
|
|
63
|
-
positionTop =
|
|
64
|
-
positionLeft =
|
|
65
|
-
arrowOffsetTop =
|
|
66
|
-
arrowOffsetLeft =
|
|
67
|
-
className =
|
|
68
|
-
style =
|
|
69
|
-
children =
|
|
70
|
-
props =
|
|
60
|
+
var _this$props = this.props,
|
|
61
|
+
placement = _this$props.placement,
|
|
62
|
+
positionTop = _this$props.positionTop,
|
|
63
|
+
positionLeft = _this$props.positionLeft,
|
|
64
|
+
arrowOffsetTop = _this$props.arrowOffsetTop,
|
|
65
|
+
arrowOffsetLeft = _this$props.arrowOffsetLeft,
|
|
66
|
+
className = _this$props.className,
|
|
67
|
+
style = _this$props.style,
|
|
68
|
+
children = _this$props.children,
|
|
69
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["placement", "positionTop", "positionLeft", "arrowOffsetTop", "arrowOffsetLeft", "className", "style", "children"]);
|
|
71
70
|
|
|
72
71
|
var _splitBsProps = splitBsProps(props),
|
|
73
72
|
bsProps = _splitBsProps[0],
|
|
@@ -84,21 +83,16 @@ var Tooltip = function (_React$Component) {
|
|
|
84
83
|
top: arrowOffsetTop,
|
|
85
84
|
left: arrowOffsetLeft
|
|
86
85
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
'div',
|
|
98
|
-
{ className: prefix(bsProps, 'inner') },
|
|
99
|
-
children
|
|
100
|
-
)
|
|
101
|
-
);
|
|
86
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
87
|
+
role: "tooltip",
|
|
88
|
+
className: classNames(className, classes),
|
|
89
|
+
style: outerStyle
|
|
90
|
+
}), React.createElement("div", {
|
|
91
|
+
className: prefix(bsProps, 'arrow'),
|
|
92
|
+
style: arrowStyle
|
|
93
|
+
}), React.createElement("div", {
|
|
94
|
+
className: prefix(bsProps, 'inner')
|
|
95
|
+
}, children));
|
|
102
96
|
};
|
|
103
97
|
|
|
104
98
|
return Tooltip;
|
|
@@ -106,5 +100,4 @@ var Tooltip = function (_React$Component) {
|
|
|
106
100
|
|
|
107
101
|
Tooltip.propTypes = propTypes;
|
|
108
102
|
Tooltip.defaultProps = defaultProps;
|
|
109
|
-
|
|
110
103
|
export default bsClass('tooltip', Tooltip);
|
package/es/Well.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
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
|
-
|
|
9
6
|
import { bsClass, bsSizes, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
10
7
|
import { Size } from './utils/StyleConfig';
|
|
11
8
|
|
|
12
|
-
var Well =
|
|
13
|
-
|
|
9
|
+
var Well =
|
|
10
|
+
/*#__PURE__*/
|
|
11
|
+
function (_React$Component) {
|
|
12
|
+
_inheritsLoose(Well, _React$Component);
|
|
14
13
|
|
|
15
14
|
function Well() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
15
|
+
return _React$Component.apply(this, arguments) || this;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
Well.prototype
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
var _proto = Well.prototype;
|
|
19
|
+
|
|
20
|
+
_proto.render = function render() {
|
|
21
|
+
var _this$props = this.props,
|
|
22
|
+
className = _this$props.className,
|
|
23
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["className"]);
|
|
25
24
|
|
|
26
25
|
var _splitBsProps = splitBsProps(props),
|
|
27
26
|
bsProps = _splitBsProps[0],
|
|
28
27
|
elementProps = _splitBsProps[1];
|
|
29
28
|
|
|
30
29
|
var classes = getClassSet(bsProps);
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
31
|
+
className: classNames(className, classes)
|
|
32
|
+
}));
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
return Well;
|
package/es/index.js
CHANGED
|
@@ -68,6 +68,8 @@ import _Modal from './Modal';
|
|
|
68
68
|
export { _Modal as Modal };
|
|
69
69
|
import _ModalBody from './ModalBody';
|
|
70
70
|
export { _ModalBody as ModalBody };
|
|
71
|
+
import _ModalDialog from './ModalDialog';
|
|
72
|
+
export { _ModalDialog as ModalDialog };
|
|
71
73
|
import _ModalFooter from './ModalFooter';
|
|
72
74
|
export { _ModalFooter as ModalFooter };
|
|
73
75
|
import _ModalHeader from './ModalHeader';
|
package/es/utils/PropTypes.js
CHANGED
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import createChainableTypeChecker from 'prop-types-extra/lib/utils/createChainableTypeChecker';
|
|
3
|
-
|
|
4
3
|
import ValidComponentChildren from './ValidComponentChildren';
|
|
5
|
-
|
|
6
4
|
var idPropType = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
|
7
|
-
|
|
8
5
|
export function generatedId(name) {
|
|
9
6
|
return function (props) {
|
|
10
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
11
|
-
args[_key - 1] = arguments[_key];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
7
|
var error = null;
|
|
15
8
|
|
|
16
9
|
if (!props.generateChildId) {
|
|
17
|
-
|
|
10
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
11
|
+
args[_key - 1] = arguments[_key];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
error = idPropType.apply(void 0, [props].concat(args));
|
|
18
15
|
|
|
19
16
|
if (!error && !props.id) {
|
|
20
|
-
error = new Error(
|
|
17
|
+
error = new Error("In order to properly initialize the " + name + " in a way that is accessible to assistive technologies " + ("(such as screen readers) an `id` or a `generateChildId` prop to " + name + " is required"));
|
|
21
18
|
}
|
|
22
19
|
}
|
|
20
|
+
|
|
23
21
|
return error;
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
|
-
|
|
27
24
|
export function requiredRoles() {
|
|
28
|
-
for (var _len2 = arguments.length, roles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
25
|
+
for (var _len2 = arguments.length, roles = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
29
26
|
roles[_key2] = arguments[_key2];
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
return createChainableTypeChecker(function (props, propName, component) {
|
|
33
|
-
var missing
|
|
34
|
-
|
|
30
|
+
var missing;
|
|
35
31
|
roles.every(function (role) {
|
|
36
32
|
if (!ValidComponentChildren.some(props.children, function (child) {
|
|
37
33
|
return child.props.bsRole === role;
|
|
@@ -44,21 +40,19 @@ export function requiredRoles() {
|
|
|
44
40
|
});
|
|
45
41
|
|
|
46
42
|
if (missing) {
|
|
47
|
-
return new Error(
|
|
43
|
+
return new Error("(children) " + component + " - Missing a required child with bsRole: " + (missing + ". " + component + " must have at least one child of each of ") + ("the following bsRoles: " + roles.join(', ')));
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
return null;
|
|
51
47
|
});
|
|
52
48
|
}
|
|
53
|
-
|
|
54
49
|
export function exclusiveRoles() {
|
|
55
|
-
for (var _len3 = arguments.length, roles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
50
|
+
for (var _len3 = arguments.length, roles = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
56
51
|
roles[_key3] = arguments[_key3];
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
return createChainableTypeChecker(function (props, propName, component) {
|
|
60
|
-
var duplicate
|
|
61
|
-
|
|
55
|
+
var duplicate;
|
|
62
56
|
roles.every(function (role) {
|
|
63
57
|
var childrenWithRole = ValidComponentChildren.filter(props.children, function (child) {
|
|
64
58
|
return child.props.bsRole === role;
|
|
@@ -73,7 +67,7 @@ export function exclusiveRoles() {
|
|
|
73
67
|
});
|
|
74
68
|
|
|
75
69
|
if (duplicate) {
|
|
76
|
-
return new Error(
|
|
70
|
+
return new Error("(children) " + component + " - Duplicate children detected of bsRole: " + (duplicate + ". Only one child each allowed with the following ") + ("bsRoles: " + roles.join(', ')));
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
return null;
|
package/es/utils/StyleConfig.js
CHANGED
|
@@ -3,7 +3,6 @@ export var Size = {
|
|
|
3
3
|
SMALL: 'small',
|
|
4
4
|
XSMALL: 'xsmall'
|
|
5
5
|
};
|
|
6
|
-
|
|
7
6
|
export var SIZE_MAP = {
|
|
8
7
|
large: 'lg',
|
|
9
8
|
medium: 'md',
|
|
@@ -14,16 +13,13 @@ export var SIZE_MAP = {
|
|
|
14
13
|
sm: 'sm',
|
|
15
14
|
xs: 'xs'
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
export var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
|
|
19
|
-
|
|
20
17
|
export var State = {
|
|
21
18
|
SUCCESS: 'success',
|
|
22
19
|
WARNING: 'warning',
|
|
23
20
|
DANGER: 'danger',
|
|
24
21
|
INFO: 'info'
|
|
25
22
|
};
|
|
26
|
-
|
|
27
23
|
export var Style = {
|
|
28
24
|
DEFAULT: 'default',
|
|
29
25
|
PRIMARY: 'primary',
|