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/DropdownMenu.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import _Array$from from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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 =
|
|
33
|
-
|
|
28
|
+
var DropdownMenu =
|
|
29
|
+
/*#__PURE__*/
|
|
30
|
+
function (_React$Component) {
|
|
31
|
+
_inheritsLoose(DropdownMenu, _React$Component);
|
|
34
32
|
|
|
35
33
|
function DropdownMenu(props) {
|
|
36
|
-
|
|
34
|
+
var _this;
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_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
|
|
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
|
-
|
|
54
|
+
_proto.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
|
|
55
55
|
var items = this.getFocusableMenuItems();
|
|
56
56
|
var activeIndex = items.indexOf(document.activeElement);
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
return {
|
|
58
|
+
items: items,
|
|
59
|
+
activeIndex: activeIndex
|
|
60
|
+
};
|
|
59
61
|
};
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
items =
|
|
64
|
-
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
|
-
|
|
75
|
-
var
|
|
76
|
-
items =
|
|
77
|
-
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
|
-
|
|
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, {
|
|
103
|
+
this.props.onClose(event, {
|
|
104
|
+
source: 'keydown'
|
|
105
|
+
});
|
|
100
106
|
break;
|
|
107
|
+
|
|
101
108
|
default:
|
|
102
109
|
}
|
|
103
110
|
};
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
this.props.onClose(event, {
|
|
112
|
+
_proto.handleRootClose = function handleRootClose(event) {
|
|
113
|
+
this.props.onClose(event, {
|
|
114
|
+
source: 'rootClose'
|
|
115
|
+
});
|
|
107
116
|
};
|
|
108
117
|
|
|
109
|
-
|
|
118
|
+
_proto.render = function render() {
|
|
110
119
|
var _extends2,
|
|
111
120
|
_this2 = this;
|
|
112
121
|
|
|
113
|
-
var
|
|
114
|
-
open =
|
|
115
|
-
pullRight =
|
|
116
|
-
labelledBy =
|
|
117
|
-
onSelect =
|
|
118
|
-
className =
|
|
119
|
-
rootCloseEvent =
|
|
120
|
-
children =
|
|
121
|
-
props =
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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);
|
package/es/DropdownToggle.js
CHANGED
|
@@ -1,70 +1,59 @@
|
|
|
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 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 =
|
|
28
|
-
|
|
22
|
+
var DropdownToggle =
|
|
23
|
+
/*#__PURE__*/
|
|
24
|
+
function (_React$Component) {
|
|
25
|
+
_inheritsLoose(DropdownToggle, _React$Component);
|
|
29
26
|
|
|
30
27
|
function DropdownToggle() {
|
|
31
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
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
|
|
|
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 =
|
|
80
|
-
|
|
79
|
+
var Fade =
|
|
80
|
+
/*#__PURE__*/
|
|
81
|
+
function (_React$Component) {
|
|
82
|
+
_inheritsLoose(Fade, _React$Component);
|
|
81
83
|
|
|
82
84
|
function Fade() {
|
|
83
|
-
|
|
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
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
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 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 =
|
|
26
|
-
|
|
20
|
+
var Form =
|
|
21
|
+
/*#__PURE__*/
|
|
22
|
+
function (_React$Component) {
|
|
23
|
+
_inheritsLoose(Form, _React$Component);
|
|
27
24
|
|
|
28
25
|
function Form() {
|
|
29
|
-
|
|
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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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, {
|
|
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
|
|
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 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 =
|
|
46
|
-
|
|
42
|
+
var FormControl =
|
|
43
|
+
/*#__PURE__*/
|
|
44
|
+
function (_React$Component) {
|
|
45
|
+
_inheritsLoose(FormControl, _React$Component);
|
|
47
46
|
|
|
48
47
|
function FormControl() {
|
|
49
|
-
|
|
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
|
|
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
|
|
59
|
-
Component =
|
|
60
|
-
type =
|
|
61
|
-
|
|
62
|
-
id =
|
|
63
|
-
inputRef =
|
|
64
|
-
className =
|
|
65
|
-
bsSize =
|
|
66
|
-
props =
|
|
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 !==
|
|
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({
|
|
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));
|