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/Overlay.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
5
|
-
import _extends from 'babel-runtime/helpers/extends';
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
3
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React, { cloneElement } from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import BaseOverlay from 'react-overlays/lib/Overlay';
|
|
10
8
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
11
|
-
|
|
12
9
|
import Fade from './Fade';
|
|
13
10
|
|
|
14
11
|
var propTypes = _extends({}, BaseOverlay.propTypes, {
|
|
15
|
-
|
|
16
12
|
/**
|
|
17
13
|
* Set the visibility of the Overlay
|
|
18
14
|
*/
|
|
19
15
|
show: PropTypes.bool,
|
|
16
|
+
|
|
20
17
|
/**
|
|
21
18
|
* Specify whether the overlay should trigger onHide when the user clicks outside the overlay
|
|
22
19
|
*/
|
|
23
20
|
rootClose: PropTypes.bool,
|
|
21
|
+
|
|
24
22
|
/**
|
|
25
23
|
* A callback invoked by the overlay when it wishes to be hidden. Required if
|
|
26
24
|
* `rootClose` is specified.
|
|
@@ -75,24 +73,25 @@ var defaultProps = {
|
|
|
75
73
|
placement: 'right'
|
|
76
74
|
};
|
|
77
75
|
|
|
78
|
-
var Overlay =
|
|
79
|
-
|
|
76
|
+
var Overlay =
|
|
77
|
+
/*#__PURE__*/
|
|
78
|
+
function (_React$Component) {
|
|
79
|
+
_inheritsLoose(Overlay, _React$Component);
|
|
80
80
|
|
|
81
81
|
function Overlay() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
82
|
+
return _React$Component.apply(this, arguments) || this;
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
Overlay.prototype
|
|
88
|
-
var _props = this.props,
|
|
89
|
-
animation = _props.animation,
|
|
90
|
-
children = _props.children,
|
|
91
|
-
props = _objectWithoutProperties(_props, ['animation', 'children']);
|
|
85
|
+
var _proto = Overlay.prototype;
|
|
92
86
|
|
|
93
|
-
|
|
87
|
+
_proto.render = function render() {
|
|
88
|
+
var _this$props = this.props,
|
|
89
|
+
animation = _this$props.animation,
|
|
90
|
+
children = _this$props.children,
|
|
91
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["animation", "children"]);
|
|
94
92
|
|
|
95
|
-
var
|
|
93
|
+
var transition = animation === true ? Fade : animation || null;
|
|
94
|
+
var child;
|
|
96
95
|
|
|
97
96
|
if (!transition) {
|
|
98
97
|
child = cloneElement(children, {
|
|
@@ -102,11 +101,9 @@ var Overlay = function (_React$Component) {
|
|
|
102
101
|
child = children;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
return React.createElement(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
child
|
|
109
|
-
);
|
|
104
|
+
return React.createElement(BaseOverlay, _extends({}, props, {
|
|
105
|
+
transition: transition
|
|
106
|
+
}), child);
|
|
110
107
|
};
|
|
111
108
|
|
|
112
109
|
return Overlay;
|
|
@@ -114,5 +111,4 @@ var Overlay = function (_React$Component) {
|
|
|
114
111
|
|
|
115
112
|
Overlay.propTypes = propTypes;
|
|
116
113
|
Overlay.defaultProps = defaultProps;
|
|
117
|
-
|
|
118
114
|
export default Overlay;
|
package/es/OverlayTrigger.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
|
|
4
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
5
|
+
import _Array$isArray from "@babel/runtime-corejs2/core-js/array/is-array";
|
|
6
6
|
import contains from 'dom-helpers/query/contains';
|
|
7
7
|
import React, { cloneElement } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
10
|
import warning from 'warning';
|
|
11
|
-
|
|
12
11
|
import Overlay from './Overlay';
|
|
13
|
-
|
|
14
12
|
import createChainedFunction from './utils/createChainedFunction';
|
|
15
|
-
|
|
16
13
|
/**
|
|
17
14
|
* Check if value one is inside or equal to the of value
|
|
18
15
|
*
|
|
@@ -20,17 +17,18 @@ import createChainedFunction from './utils/createChainedFunction';
|
|
|
20
17
|
* @param {string|array} of
|
|
21
18
|
* @returns {boolean}
|
|
22
19
|
*/
|
|
20
|
+
|
|
23
21
|
function isOneOf(one, of) {
|
|
24
|
-
if (
|
|
22
|
+
if (_Array$isArray(of)) {
|
|
25
23
|
return of.indexOf(one) >= 0;
|
|
26
24
|
}
|
|
25
|
+
|
|
27
26
|
return one === of;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
var triggerType = PropTypes.oneOf(['click', 'hover', 'focus']);
|
|
31
30
|
|
|
32
31
|
var propTypes = _extends({}, Overlay.propTypes, {
|
|
33
|
-
|
|
34
32
|
/**
|
|
35
33
|
* Specify which action or actions trigger Overlay visibility
|
|
36
34
|
*/
|
|
@@ -40,16 +38,18 @@ var propTypes = _extends({}, Overlay.propTypes, {
|
|
|
40
38
|
* A millisecond delay amount to show and hide the Overlay once triggered
|
|
41
39
|
*/
|
|
42
40
|
delay: PropTypes.number,
|
|
41
|
+
|
|
43
42
|
/**
|
|
44
43
|
* A millisecond delay amount before showing the Overlay once triggered.
|
|
45
44
|
*/
|
|
46
45
|
delayShow: PropTypes.number,
|
|
46
|
+
|
|
47
47
|
/**
|
|
48
48
|
* A millisecond delay amount before hiding the Overlay once triggered.
|
|
49
49
|
*/
|
|
50
50
|
delayHide: PropTypes.number,
|
|
51
|
-
|
|
52
51
|
// FIXME: This should be `defaultShow`.
|
|
52
|
+
|
|
53
53
|
/**
|
|
54
54
|
* The initial visibility state of the Overlay. For more nuanced visibility
|
|
55
55
|
* control, consider using the Overlay component directly.
|
|
@@ -65,32 +65,38 @@ var propTypes = _extends({}, Overlay.propTypes, {
|
|
|
65
65
|
* @private
|
|
66
66
|
*/
|
|
67
67
|
onBlur: PropTypes.func,
|
|
68
|
+
|
|
68
69
|
/**
|
|
69
70
|
* @private
|
|
70
71
|
*/
|
|
71
72
|
onClick: PropTypes.func,
|
|
73
|
+
|
|
72
74
|
/**
|
|
73
75
|
* @private
|
|
74
76
|
*/
|
|
75
77
|
onFocus: PropTypes.func,
|
|
78
|
+
|
|
76
79
|
/**
|
|
77
80
|
* @private
|
|
78
81
|
*/
|
|
79
82
|
onMouseOut: PropTypes.func,
|
|
83
|
+
|
|
80
84
|
/**
|
|
81
85
|
* @private
|
|
82
86
|
*/
|
|
83
87
|
onMouseOver: PropTypes.func,
|
|
84
|
-
|
|
85
88
|
// Overridden props from `<Overlay>`.
|
|
89
|
+
|
|
86
90
|
/**
|
|
87
91
|
* @private
|
|
88
92
|
*/
|
|
89
93
|
target: PropTypes.oneOf([null]),
|
|
94
|
+
|
|
90
95
|
/**
|
|
91
96
|
* @private
|
|
92
97
|
*/
|
|
93
98
|
onHide: PropTypes.oneOf([null]),
|
|
99
|
+
|
|
94
100
|
/**
|
|
95
101
|
* @private
|
|
96
102
|
*/
|
|
@@ -102,52 +108,54 @@ var defaultProps = {
|
|
|
102
108
|
trigger: ['hover', 'focus']
|
|
103
109
|
};
|
|
104
110
|
|
|
105
|
-
var OverlayTrigger =
|
|
106
|
-
|
|
111
|
+
var OverlayTrigger =
|
|
112
|
+
/*#__PURE__*/
|
|
113
|
+
function (_React$Component) {
|
|
114
|
+
_inheritsLoose(OverlayTrigger, _React$Component);
|
|
107
115
|
|
|
108
116
|
function OverlayTrigger(props, context) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
|
117
|
+
var _this;
|
|
112
118
|
|
|
113
|
-
_this
|
|
114
|
-
_this.
|
|
115
|
-
_this.
|
|
116
|
-
_this.
|
|
119
|
+
_this = _React$Component.call(this, props, context) || this;
|
|
120
|
+
_this.handleToggle = _this.handleToggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
121
|
+
_this.handleDelayedShow = _this.handleDelayedShow.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
122
|
+
_this.handleDelayedHide = _this.handleDelayedHide.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
123
|
+
_this.handleHide = _this.handleHide.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
117
124
|
|
|
118
125
|
_this.handleMouseOver = function (e) {
|
|
119
126
|
return _this.handleMouseOverOut(_this.handleDelayedShow, e, 'fromElement');
|
|
120
127
|
};
|
|
128
|
+
|
|
121
129
|
_this.handleMouseOut = function (e) {
|
|
122
130
|
return _this.handleMouseOverOut(_this.handleDelayedHide, e, 'toElement');
|
|
123
131
|
};
|
|
124
132
|
|
|
125
133
|
_this._mountNode = null;
|
|
126
|
-
|
|
127
134
|
_this.state = {
|
|
128
135
|
show: props.defaultOverlayShown
|
|
129
136
|
};
|
|
130
137
|
return _this;
|
|
131
138
|
}
|
|
132
139
|
|
|
133
|
-
OverlayTrigger.prototype
|
|
140
|
+
var _proto = OverlayTrigger.prototype;
|
|
141
|
+
|
|
142
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
134
143
|
this._mountNode = document.createElement('div');
|
|
135
144
|
this.renderOverlay();
|
|
136
145
|
};
|
|
137
146
|
|
|
138
|
-
|
|
147
|
+
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
139
148
|
this.renderOverlay();
|
|
140
149
|
};
|
|
141
150
|
|
|
142
|
-
|
|
151
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
143
152
|
ReactDOM.unmountComponentAtNode(this._mountNode);
|
|
144
153
|
this._mountNode = null;
|
|
145
|
-
|
|
146
154
|
clearTimeout(this._hoverShowDelay);
|
|
147
155
|
clearTimeout(this._hoverHideDelay);
|
|
148
156
|
};
|
|
149
157
|
|
|
150
|
-
|
|
158
|
+
_proto.handleDelayedHide = function handleDelayedHide() {
|
|
151
159
|
var _this2 = this;
|
|
152
160
|
|
|
153
161
|
if (this._hoverShowDelay != null) {
|
|
@@ -169,11 +177,12 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
169
177
|
|
|
170
178
|
this._hoverHideDelay = setTimeout(function () {
|
|
171
179
|
_this2._hoverHideDelay = null;
|
|
180
|
+
|
|
172
181
|
_this2.hide();
|
|
173
182
|
}, delay);
|
|
174
183
|
};
|
|
175
184
|
|
|
176
|
-
|
|
185
|
+
_proto.handleDelayedShow = function handleDelayedShow() {
|
|
177
186
|
var _this3 = this;
|
|
178
187
|
|
|
179
188
|
if (this._hoverHideDelay != null) {
|
|
@@ -195,21 +204,20 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
195
204
|
|
|
196
205
|
this._hoverShowDelay = setTimeout(function () {
|
|
197
206
|
_this3._hoverShowDelay = null;
|
|
207
|
+
|
|
198
208
|
_this3.show();
|
|
199
209
|
}, delay);
|
|
200
210
|
};
|
|
201
211
|
|
|
202
|
-
|
|
212
|
+
_proto.handleHide = function handleHide() {
|
|
203
213
|
this.hide();
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
// Simple implementation of mouseEnter and mouseLeave.
|
|
214
|
+
}; // Simple implementation of mouseEnter and mouseLeave.
|
|
207
215
|
// React's built version is broken: https://github.com/facebook/react/issues/4251
|
|
208
216
|
// for cases when the trigger is disabled and mouseOut/Over can cause flicker
|
|
209
217
|
// moving from one child element to another.
|
|
210
218
|
|
|
211
219
|
|
|
212
|
-
|
|
220
|
+
_proto.handleMouseOverOut = function handleMouseOverOut(handler, e, relatedNative) {
|
|
213
221
|
var target = e.currentTarget;
|
|
214
222
|
var related = e.relatedTarget || e.nativeEvent[relatedNative];
|
|
215
223
|
|
|
@@ -218,7 +226,7 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
218
226
|
}
|
|
219
227
|
};
|
|
220
228
|
|
|
221
|
-
|
|
229
|
+
_proto.handleToggle = function handleToggle() {
|
|
222
230
|
if (this.state.show) {
|
|
223
231
|
this.hide();
|
|
224
232
|
} else {
|
|
@@ -226,58 +234,56 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
226
234
|
}
|
|
227
235
|
};
|
|
228
236
|
|
|
229
|
-
|
|
230
|
-
this.setState({
|
|
237
|
+
_proto.hide = function hide() {
|
|
238
|
+
this.setState({
|
|
239
|
+
show: false
|
|
240
|
+
});
|
|
231
241
|
};
|
|
232
242
|
|
|
233
|
-
|
|
234
|
-
return React.createElement(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
target: this
|
|
240
|
-
}),
|
|
241
|
-
overlay
|
|
242
|
-
);
|
|
243
|
+
_proto.makeOverlay = function makeOverlay(overlay, props) {
|
|
244
|
+
return React.createElement(Overlay, _extends({}, props, {
|
|
245
|
+
show: this.state.show,
|
|
246
|
+
onHide: this.handleHide,
|
|
247
|
+
target: this
|
|
248
|
+
}), overlay);
|
|
243
249
|
};
|
|
244
250
|
|
|
245
|
-
|
|
246
|
-
this.setState({
|
|
251
|
+
_proto.show = function show() {
|
|
252
|
+
this.setState({
|
|
253
|
+
show: true
|
|
254
|
+
});
|
|
247
255
|
};
|
|
248
256
|
|
|
249
|
-
|
|
257
|
+
_proto.renderOverlay = function renderOverlay() {
|
|
250
258
|
ReactDOM.unstable_renderSubtreeIntoContainer(this, this._overlay, this._mountNode);
|
|
251
259
|
};
|
|
252
260
|
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
trigger =
|
|
256
|
-
overlay =
|
|
257
|
-
children =
|
|
258
|
-
onBlur =
|
|
259
|
-
onClick =
|
|
260
|
-
onFocus =
|
|
261
|
-
onMouseOut =
|
|
262
|
-
onMouseOver =
|
|
263
|
-
props =
|
|
261
|
+
_proto.render = function render() {
|
|
262
|
+
var _this$props = this.props,
|
|
263
|
+
trigger = _this$props.trigger,
|
|
264
|
+
overlay = _this$props.overlay,
|
|
265
|
+
children = _this$props.children,
|
|
266
|
+
onBlur = _this$props.onBlur,
|
|
267
|
+
onClick = _this$props.onClick,
|
|
268
|
+
onFocus = _this$props.onFocus,
|
|
269
|
+
onMouseOut = _this$props.onMouseOut,
|
|
270
|
+
onMouseOver = _this$props.onMouseOver,
|
|
271
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["trigger", "overlay", "children", "onBlur", "onClick", "onFocus", "onMouseOut", "onMouseOver"]);
|
|
264
272
|
|
|
265
273
|
delete props.delay;
|
|
266
274
|
delete props.delayShow;
|
|
267
275
|
delete props.delayHide;
|
|
268
276
|
delete props.defaultOverlayShown;
|
|
269
|
-
|
|
270
277
|
var child = React.Children.only(children);
|
|
271
278
|
var childProps = child.props;
|
|
272
279
|
var triggerProps = {};
|
|
273
280
|
|
|
274
281
|
if (this.state.show) {
|
|
275
282
|
triggerProps['aria-describedby'] = overlay.props.id;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// FIXME: The logic here for passing through handlers on this component is
|
|
283
|
+
} // FIXME: The logic here for passing through handlers on this component is
|
|
279
284
|
// inconsistent. We shouldn't be passing any of these props through.
|
|
280
285
|
|
|
286
|
+
|
|
281
287
|
triggerProps.onClick = createChainedFunction(childProps.onClick, onClick);
|
|
282
288
|
|
|
283
289
|
if (isOneOf('click', trigger)) {
|
|
@@ -285,8 +291,7 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
285
291
|
}
|
|
286
292
|
|
|
287
293
|
if (isOneOf('hover', trigger)) {
|
|
288
|
-
process.env.NODE_ENV !==
|
|
289
|
-
|
|
294
|
+
process.env.NODE_ENV !== "production" ? warning(!(trigger === 'hover'), '[react-bootstrap] Specifying only the `"hover"` trigger limits the ' + 'visibility of the overlay to just mouse users. Consider also ' + 'including the `"focus"` trigger so that touch and keyboard only ' + 'users can see the overlay as well.') : void 0;
|
|
290
295
|
triggerProps.onMouseOver = createChainedFunction(childProps.onMouseOver, onMouseOver, this.handleMouseOver);
|
|
291
296
|
triggerProps.onMouseOut = createChainedFunction(childProps.onMouseOut, onMouseOut, this.handleMouseOut);
|
|
292
297
|
}
|
|
@@ -297,7 +302,6 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
297
302
|
}
|
|
298
303
|
|
|
299
304
|
this._overlay = this.makeOverlay(overlay, props);
|
|
300
|
-
|
|
301
305
|
return cloneElement(child, triggerProps);
|
|
302
306
|
};
|
|
303
307
|
|
|
@@ -306,5 +310,4 @@ var OverlayTrigger = function (_React$Component) {
|
|
|
306
310
|
|
|
307
311
|
OverlayTrigger.propTypes = propTypes;
|
|
308
312
|
OverlayTrigger.defaultProps = defaultProps;
|
|
309
|
-
|
|
310
313
|
export default OverlayTrigger;
|
package/es/PageHeader.js
CHANGED
|
@@ -1,43 +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, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
10
7
|
|
|
11
|
-
var PageHeader =
|
|
12
|
-
|
|
8
|
+
var PageHeader =
|
|
9
|
+
/*#__PURE__*/
|
|
10
|
+
function (_React$Component) {
|
|
11
|
+
_inheritsLoose(PageHeader, _React$Component);
|
|
13
12
|
|
|
14
13
|
function PageHeader() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
14
|
+
return _React$Component.apply(this, arguments) || this;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
PageHeader.prototype
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
var _proto = PageHeader.prototype;
|
|
18
|
+
|
|
19
|
+
_proto.render = function render() {
|
|
20
|
+
var _this$props = this.props,
|
|
21
|
+
className = _this$props.className,
|
|
22
|
+
children = _this$props.children,
|
|
23
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["className", "children"]);
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
35
|
-
React.createElement(
|
|
36
|
-
'h1',
|
|
37
|
-
null,
|
|
38
|
-
children
|
|
39
|
-
)
|
|
40
|
-
);
|
|
30
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
31
|
+
className: classNames(className, classes)
|
|
32
|
+
}), React.createElement("h1", null, children));
|
|
41
33
|
};
|
|
42
34
|
|
|
43
35
|
return PageHeader;
|
package/es/PageItem.js
CHANGED
package/es/Pager.js
CHANGED
|
@@ -1,59 +1,52 @@
|
|
|
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
|
-
|
|
10
7
|
import PagerItem from './PagerItem';
|
|
11
8
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
12
9
|
import createChainedFunction from './utils/createChainedFunction';
|
|
13
10
|
import ValidComponentChildren from './utils/ValidComponentChildren';
|
|
14
|
-
|
|
15
11
|
var propTypes = {
|
|
16
12
|
onSelect: PropTypes.func
|
|
17
13
|
};
|
|
18
14
|
|
|
19
|
-
var Pager =
|
|
20
|
-
|
|
15
|
+
var Pager =
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
function (_React$Component) {
|
|
18
|
+
_inheritsLoose(Pager, _React$Component);
|
|
21
19
|
|
|
22
20
|
function Pager() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
Pager.prototype
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var _proto = Pager.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
onSelect = _this$props.onSelect,
|
|
29
|
+
className = _this$props.className,
|
|
30
|
+
children = _this$props.children,
|
|
31
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["onSelect", "className", "children"]);
|
|
34
32
|
|
|
35
33
|
var _splitBsProps = splitBsProps(props),
|
|
36
34
|
bsProps = _splitBsProps[0],
|
|
37
35
|
elementProps = _splitBsProps[1];
|
|
38
36
|
|
|
39
37
|
var classes = getClassSet(bsProps);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
})
|
|
49
|
-
);
|
|
38
|
+
return React.createElement("ul", _extends({}, elementProps, {
|
|
39
|
+
className: classNames(className, classes)
|
|
40
|
+
}), ValidComponentChildren.map(children, function (child) {
|
|
41
|
+
return cloneElement(child, {
|
|
42
|
+
onSelect: createChainedFunction(child.props.onSelect, onSelect)
|
|
43
|
+
});
|
|
44
|
+
}));
|
|
50
45
|
};
|
|
51
46
|
|
|
52
47
|
return Pager;
|
|
53
48
|
}(React.Component);
|
|
54
49
|
|
|
55
50
|
Pager.propTypes = propTypes;
|
|
56
|
-
|
|
57
51
|
Pager.Item = PagerItem;
|
|
58
|
-
|
|
59
52
|
export default bsClass('pager', Pager);
|