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/Navbar.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
|
|
6
5
|
// TODO: Remove this pragma once we upgrade eslint-config-airbnb.
|
|
7
|
-
/* eslint-disable react/no-multi-comp */
|
|
8
6
|
|
|
7
|
+
/* eslint-disable react/no-multi-comp */
|
|
9
8
|
import classNames from 'classnames';
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import PropTypes from 'prop-types';
|
|
12
11
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
13
12
|
import uncontrollable from 'uncontrollable';
|
|
14
|
-
|
|
15
13
|
import Grid from './Grid';
|
|
16
14
|
import NavbarBrand from './NavbarBrand';
|
|
17
15
|
import NavbarCollapse from './NavbarCollapse';
|
|
@@ -20,26 +18,29 @@ import NavbarToggle from './NavbarToggle';
|
|
|
20
18
|
import { bsClass as setBsClass, bsStyles, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils';
|
|
21
19
|
import { Style } from './utils/StyleConfig';
|
|
22
20
|
import createChainedFunction from './utils/createChainedFunction';
|
|
23
|
-
|
|
24
21
|
var propTypes = {
|
|
25
22
|
/**
|
|
26
23
|
* Create a fixed navbar along the top of the screen, that scrolls with the
|
|
27
24
|
* page
|
|
28
25
|
*/
|
|
29
26
|
fixedTop: PropTypes.bool,
|
|
27
|
+
|
|
30
28
|
/**
|
|
31
29
|
* Create a fixed navbar along the bottom of the screen, that scrolls with
|
|
32
30
|
* the page
|
|
33
31
|
*/
|
|
34
32
|
fixedBottom: PropTypes.bool,
|
|
33
|
+
|
|
35
34
|
/**
|
|
36
35
|
* Create a full-width navbar that scrolls away with the page
|
|
37
36
|
*/
|
|
38
37
|
staticTop: PropTypes.bool,
|
|
38
|
+
|
|
39
39
|
/**
|
|
40
40
|
* An alternative dark visual style for the Navbar
|
|
41
41
|
*/
|
|
42
42
|
inverse: PropTypes.bool,
|
|
43
|
+
|
|
43
44
|
/**
|
|
44
45
|
* Allow the Navbar to fluidly adjust to the page or container width, instead
|
|
45
46
|
* of at the predefined screen breakpoints
|
|
@@ -50,6 +51,7 @@ var propTypes = {
|
|
|
50
51
|
* Set a custom element for this component.
|
|
51
52
|
*/
|
|
52
53
|
componentClass: elementType,
|
|
54
|
+
|
|
53
55
|
/**
|
|
54
56
|
* A callback fired when the `<Navbar>` body collapses or expands. Fired when
|
|
55
57
|
* a `<Navbar.Toggle>` is clicked and called with the new `expanded`
|
|
@@ -58,6 +60,7 @@ var propTypes = {
|
|
|
58
60
|
* @controllable expanded
|
|
59
61
|
*/
|
|
60
62
|
onToggle: PropTypes.func,
|
|
63
|
+
|
|
61
64
|
/**
|
|
62
65
|
* A callback fired when a descendant of a child `<Nav>` is selected. Should
|
|
63
66
|
* be used to execute complex closing or other miscellaneous actions desired
|
|
@@ -80,6 +83,7 @@ var propTypes = {
|
|
|
80
83
|
* true and false.
|
|
81
84
|
*/
|
|
82
85
|
onSelect: PropTypes.func,
|
|
86
|
+
|
|
83
87
|
/**
|
|
84
88
|
* Sets `expanded` to `false` after the onSelect event of a descendant of a
|
|
85
89
|
* child `<Nav>`. Does nothing if no `<Nav>` or `<Nav>` descendants exist.
|
|
@@ -88,16 +92,15 @@ var propTypes = {
|
|
|
88
92
|
* that need to be executed after the `select` event of `<Nav>` descendants.
|
|
89
93
|
*/
|
|
90
94
|
collapseOnSelect: PropTypes.bool,
|
|
95
|
+
|
|
91
96
|
/**
|
|
92
97
|
* Explicitly set the visiblity of the navbar body
|
|
93
98
|
*
|
|
94
99
|
* @controllable onToggle
|
|
95
100
|
*/
|
|
96
101
|
expanded: PropTypes.bool,
|
|
97
|
-
|
|
98
102
|
role: PropTypes.string
|
|
99
103
|
};
|
|
100
|
-
|
|
101
104
|
var defaultProps = {
|
|
102
105
|
componentClass: 'nav',
|
|
103
106
|
fixedTop: false,
|
|
@@ -107,7 +110,6 @@ var defaultProps = {
|
|
|
107
110
|
fluid: false,
|
|
108
111
|
collapseOnSelect: false
|
|
109
112
|
};
|
|
110
|
-
|
|
111
113
|
var childContextTypes = {
|
|
112
114
|
$bs_navbar: PropTypes.shape({
|
|
113
115
|
bsClass: PropTypes.string,
|
|
@@ -117,27 +119,28 @@ var childContextTypes = {
|
|
|
117
119
|
})
|
|
118
120
|
};
|
|
119
121
|
|
|
120
|
-
var Navbar =
|
|
121
|
-
|
|
122
|
+
var Navbar =
|
|
123
|
+
/*#__PURE__*/
|
|
124
|
+
function (_React$Component) {
|
|
125
|
+
_inheritsLoose(Navbar, _React$Component);
|
|
122
126
|
|
|
123
127
|
function Navbar(props, context) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
|
128
|
+
var _this;
|
|
127
129
|
|
|
128
|
-
_this
|
|
129
|
-
_this.
|
|
130
|
+
_this = _React$Component.call(this, props, context) || this;
|
|
131
|
+
_this.handleToggle = _this.handleToggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
132
|
+
_this.handleCollapse = _this.handleCollapse.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
130
133
|
return _this;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
Navbar.prototype
|
|
134
|
-
var _props = this.props,
|
|
135
|
-
bsClass = _props.bsClass,
|
|
136
|
-
expanded = _props.expanded,
|
|
137
|
-
onSelect = _props.onSelect,
|
|
138
|
-
collapseOnSelect = _props.collapseOnSelect;
|
|
139
|
-
|
|
136
|
+
var _proto = Navbar.prototype;
|
|
140
137
|
|
|
138
|
+
_proto.getChildContext = function getChildContext() {
|
|
139
|
+
var _this$props = this.props,
|
|
140
|
+
bsClass = _this$props.bsClass,
|
|
141
|
+
expanded = _this$props.expanded,
|
|
142
|
+
onSelect = _this$props.onSelect,
|
|
143
|
+
collapseOnSelect = _this$props.collapseOnSelect;
|
|
141
144
|
return {
|
|
142
145
|
$bs_navbar: {
|
|
143
146
|
bsClass: bsClass,
|
|
@@ -148,45 +151,40 @@ var Navbar = function (_React$Component) {
|
|
|
148
151
|
};
|
|
149
152
|
};
|
|
150
153
|
|
|
151
|
-
|
|
152
|
-
var
|
|
153
|
-
onToggle =
|
|
154
|
-
expanded =
|
|
155
|
-
|
|
154
|
+
_proto.handleCollapse = function handleCollapse() {
|
|
155
|
+
var _this$props2 = this.props,
|
|
156
|
+
onToggle = _this$props2.onToggle,
|
|
157
|
+
expanded = _this$props2.expanded;
|
|
156
158
|
|
|
157
159
|
if (expanded) {
|
|
158
160
|
onToggle(false);
|
|
159
161
|
}
|
|
160
162
|
};
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
var
|
|
164
|
-
onToggle =
|
|
165
|
-
expanded =
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
_proto.handleToggle = function handleToggle() {
|
|
165
|
+
var _this$props3 = this.props,
|
|
166
|
+
onToggle = _this$props3.onToggle,
|
|
167
|
+
expanded = _this$props3.expanded;
|
|
168
168
|
onToggle(!expanded);
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
_proto.render = function render() {
|
|
172
172
|
var _extends2;
|
|
173
173
|
|
|
174
|
-
var
|
|
175
|
-
Component =
|
|
176
|
-
fixedTop =
|
|
177
|
-
fixedBottom =
|
|
178
|
-
staticTop =
|
|
179
|
-
inverse =
|
|
180
|
-
fluid =
|
|
181
|
-
className =
|
|
182
|
-
children =
|
|
183
|
-
props =
|
|
174
|
+
var _this$props4 = this.props,
|
|
175
|
+
Component = _this$props4.componentClass,
|
|
176
|
+
fixedTop = _this$props4.fixedTop,
|
|
177
|
+
fixedBottom = _this$props4.fixedBottom,
|
|
178
|
+
staticTop = _this$props4.staticTop,
|
|
179
|
+
inverse = _this$props4.inverse,
|
|
180
|
+
fluid = _this$props4.fluid,
|
|
181
|
+
className = _this$props4.className,
|
|
182
|
+
children = _this$props4.children,
|
|
183
|
+
props = _objectWithoutPropertiesLoose(_this$props4, ["componentClass", "fixedTop", "fixedBottom", "staticTop", "inverse", "fluid", "className", "children"]);
|
|
184
184
|
|
|
185
185
|
var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['expanded', 'onToggle', 'onSelect', 'collapseOnSelect']),
|
|
186
186
|
bsProps = _splitBsPropsAndOmit[0],
|
|
187
|
-
elementProps = _splitBsPropsAndOmit[1];
|
|
188
|
-
|
|
189
|
-
// will result in some false positives but that seems better
|
|
187
|
+
elementProps = _splitBsPropsAndOmit[1]; // will result in some false positives but that seems better
|
|
190
188
|
// than false negatives. strict `undefined` check allows explicit
|
|
191
189
|
// "nulling" of the role if the user really doesn't want one
|
|
192
190
|
|
|
@@ -201,15 +199,11 @@ var Navbar = function (_React$Component) {
|
|
|
201
199
|
|
|
202
200
|
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'fixed-top')] = fixedTop, _extends2[prefix(bsProps, 'fixed-bottom')] = fixedBottom, _extends2[prefix(bsProps, 'static-top')] = staticTop, _extends2));
|
|
203
201
|
|
|
204
|
-
return React.createElement(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
{ fluid: fluid },
|
|
210
|
-
children
|
|
211
|
-
)
|
|
212
|
-
);
|
|
202
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
203
|
+
className: classNames(className, classes)
|
|
204
|
+
}), React.createElement(Grid, {
|
|
205
|
+
fluid: fluid
|
|
206
|
+
}, children));
|
|
213
207
|
};
|
|
214
208
|
|
|
215
209
|
return Navbar;
|
|
@@ -218,47 +212,44 @@ var Navbar = function (_React$Component) {
|
|
|
218
212
|
Navbar.propTypes = propTypes;
|
|
219
213
|
Navbar.defaultProps = defaultProps;
|
|
220
214
|
Navbar.childContextTypes = childContextTypes;
|
|
221
|
-
|
|
222
215
|
setBsClass('navbar', Navbar);
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
var UncontrollableNavbar = uncontrollable(Navbar, {
|
|
217
|
+
expanded: 'onToggle'
|
|
218
|
+
});
|
|
225
219
|
|
|
226
220
|
function createSimpleWrapper(tag, suffix, displayName) {
|
|
227
221
|
var Wrapper = function Wrapper(_ref, _ref2) {
|
|
228
|
-
var _ref2$$bs_navbar = _ref2.$bs_navbar,
|
|
229
|
-
navbarProps = _ref2$$bs_navbar === undefined ? { bsClass: 'navbar' } : _ref2$$bs_navbar;
|
|
230
|
-
|
|
231
222
|
var Component = _ref.componentClass,
|
|
232
223
|
className = _ref.className,
|
|
233
224
|
pullRight = _ref.pullRight,
|
|
234
225
|
pullLeft = _ref.pullLeft,
|
|
235
|
-
props =
|
|
226
|
+
props = _objectWithoutPropertiesLoose(_ref, ["componentClass", "className", "pullRight", "pullLeft"]);
|
|
236
227
|
|
|
228
|
+
var _ref2$$bs_navbar = _ref2.$bs_navbar,
|
|
229
|
+
navbarProps = _ref2$$bs_navbar === void 0 ? {
|
|
230
|
+
bsClass: 'navbar'
|
|
231
|
+
} : _ref2$$bs_navbar;
|
|
237
232
|
return React.createElement(Component, _extends({}, props, {
|
|
238
233
|
className: classNames(className, prefix(navbarProps, suffix), pullRight && prefix(navbarProps, 'right'), pullLeft && prefix(navbarProps, 'left'))
|
|
239
234
|
}));
|
|
240
235
|
};
|
|
241
236
|
|
|
242
237
|
Wrapper.displayName = displayName;
|
|
243
|
-
|
|
244
238
|
Wrapper.propTypes = {
|
|
245
239
|
componentClass: elementType,
|
|
246
240
|
pullRight: PropTypes.bool,
|
|
247
241
|
pullLeft: PropTypes.bool
|
|
248
242
|
};
|
|
249
|
-
|
|
250
243
|
Wrapper.defaultProps = {
|
|
251
244
|
componentClass: tag,
|
|
252
245
|
pullRight: false,
|
|
253
246
|
pullLeft: false
|
|
254
247
|
};
|
|
255
|
-
|
|
256
248
|
Wrapper.contextTypes = {
|
|
257
249
|
$bs_navbar: PropTypes.shape({
|
|
258
250
|
bsClass: PropTypes.string
|
|
259
251
|
})
|
|
260
252
|
};
|
|
261
|
-
|
|
262
253
|
return Wrapper;
|
|
263
254
|
}
|
|
264
255
|
|
|
@@ -266,10 +257,8 @@ UncontrollableNavbar.Brand = NavbarBrand;
|
|
|
266
257
|
UncontrollableNavbar.Header = NavbarHeader;
|
|
267
258
|
UncontrollableNavbar.Toggle = NavbarToggle;
|
|
268
259
|
UncontrollableNavbar.Collapse = NavbarCollapse;
|
|
269
|
-
|
|
270
260
|
UncontrollableNavbar.Form = createSimpleWrapper('div', 'form', 'NavbarForm');
|
|
271
261
|
UncontrollableNavbar.Text = createSimpleWrapper('p', 'text', 'NavbarText');
|
|
272
|
-
UncontrollableNavbar.Link = createSimpleWrapper('a', 'link', 'NavbarLink');
|
|
262
|
+
UncontrollableNavbar.Link = createSimpleWrapper('a', 'link', 'NavbarLink'); // Set bsStyles here so they can be overridden.
|
|
273
263
|
|
|
274
|
-
// Set bsStyles here so they can be overridden.
|
|
275
264
|
export default bsStyles([Style.DEFAULT, Style.INVERSE], Style.DEFAULT, UncontrollableNavbar);
|
package/es/NavbarBrand.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
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
|
-
|
|
10
7
|
import { prefix } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var contextTypes = {
|
|
13
9
|
$bs_navbar: PropTypes.shape({
|
|
14
10
|
bsClass: PropTypes.string
|
|
15
11
|
})
|
|
16
12
|
};
|
|
17
13
|
|
|
18
|
-
var NavbarBrand =
|
|
19
|
-
|
|
14
|
+
var NavbarBrand =
|
|
15
|
+
/*#__PURE__*/
|
|
16
|
+
function (_React$Component) {
|
|
17
|
+
_inheritsLoose(NavbarBrand, _React$Component);
|
|
20
18
|
|
|
21
19
|
function NavbarBrand() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
20
|
+
return _React$Component.apply(this, arguments) || this;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
NavbarBrand.prototype
|
|
28
|
-
var _props = this.props,
|
|
29
|
-
className = _props.className,
|
|
30
|
-
children = _props.children,
|
|
31
|
-
props = _objectWithoutProperties(_props, ['className', 'children']);
|
|
23
|
+
var _proto = NavbarBrand.prototype;
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
_proto.render = function render() {
|
|
26
|
+
var _this$props = this.props,
|
|
27
|
+
className = _this$props.className,
|
|
28
|
+
children = _this$props.children,
|
|
29
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["className", "children"]);
|
|
34
30
|
|
|
31
|
+
var navbarProps = this.context.$bs_navbar || {
|
|
32
|
+
bsClass: 'navbar'
|
|
33
|
+
};
|
|
35
34
|
var bsClassName = prefix(navbarProps, 'brand');
|
|
36
35
|
|
|
37
36
|
if (React.isValidElement(children)) {
|
|
@@ -40,16 +39,13 @@ var NavbarBrand = function (_React$Component) {
|
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
return React.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
children
|
|
47
|
-
);
|
|
42
|
+
return React.createElement("span", _extends({}, props, {
|
|
43
|
+
className: classNames(className, bsClassName)
|
|
44
|
+
}), children);
|
|
48
45
|
};
|
|
49
46
|
|
|
50
47
|
return NavbarBrand;
|
|
51
48
|
}(React.Component);
|
|
52
49
|
|
|
53
50
|
NavbarBrand.contextTypes = contextTypes;
|
|
54
|
-
|
|
55
51
|
export default NavbarBrand;
|
package/es/NavbarCollapse.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
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
|
-
|
|
9
6
|
import Collapse from './Collapse';
|
|
10
7
|
import { prefix } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var contextTypes = {
|
|
13
9
|
$bs_navbar: PropTypes.shape({
|
|
14
10
|
bsClass: PropTypes.string,
|
|
@@ -16,38 +12,35 @@ var contextTypes = {
|
|
|
16
12
|
})
|
|
17
13
|
};
|
|
18
14
|
|
|
19
|
-
var NavbarCollapse =
|
|
20
|
-
|
|
15
|
+
var NavbarCollapse =
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
function (_React$Component) {
|
|
18
|
+
_inheritsLoose(NavbarCollapse, _React$Component);
|
|
21
19
|
|
|
22
20
|
function NavbarCollapse() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
NavbarCollapse.prototype
|
|
29
|
-
var _props = this.props,
|
|
30
|
-
children = _props.children,
|
|
31
|
-
props = _objectWithoutProperties(_props, ['children']);
|
|
24
|
+
var _proto = NavbarCollapse.prototype;
|
|
32
25
|
|
|
33
|
-
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
children = _this$props.children,
|
|
29
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["children"]);
|
|
34
30
|
|
|
31
|
+
var navbarProps = this.context.$bs_navbar || {
|
|
32
|
+
bsClass: 'navbar'
|
|
33
|
+
};
|
|
35
34
|
var bsClassName = prefix(navbarProps, 'collapse');
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
'div',
|
|
42
|
-
{ className: bsClassName },
|
|
43
|
-
children
|
|
44
|
-
)
|
|
45
|
-
);
|
|
35
|
+
return React.createElement(Collapse, _extends({
|
|
36
|
+
in: navbarProps.expanded
|
|
37
|
+
}, props), React.createElement("div", {
|
|
38
|
+
className: bsClassName
|
|
39
|
+
}, children));
|
|
46
40
|
};
|
|
47
41
|
|
|
48
42
|
return NavbarCollapse;
|
|
49
43
|
}(React.Component);
|
|
50
44
|
|
|
51
45
|
NavbarCollapse.contextTypes = contextTypes;
|
|
52
|
-
|
|
53
46
|
export default NavbarCollapse;
|
package/es/NavbarHeader.js
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
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
|
-
|
|
10
7
|
import { prefix } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var contextTypes = {
|
|
13
9
|
$bs_navbar: PropTypes.shape({
|
|
14
10
|
bsClass: PropTypes.string
|
|
15
11
|
})
|
|
16
12
|
};
|
|
17
13
|
|
|
18
|
-
var NavbarHeader =
|
|
19
|
-
|
|
14
|
+
var NavbarHeader =
|
|
15
|
+
/*#__PURE__*/
|
|
16
|
+
function (_React$Component) {
|
|
17
|
+
_inheritsLoose(NavbarHeader, _React$Component);
|
|
20
18
|
|
|
21
19
|
function NavbarHeader() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
20
|
+
return _React$Component.apply(this, arguments) || this;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
NavbarHeader.prototype
|
|
28
|
-
var _props = this.props,
|
|
29
|
-
className = _props.className,
|
|
30
|
-
props = _objectWithoutProperties(_props, ['className']);
|
|
23
|
+
var _proto = NavbarHeader.prototype;
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
_proto.render = function render() {
|
|
26
|
+
var _this$props = this.props,
|
|
27
|
+
className = _this$props.className,
|
|
28
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["className"]);
|
|
33
29
|
|
|
30
|
+
var navbarProps = this.context.$bs_navbar || {
|
|
31
|
+
bsClass: 'navbar'
|
|
32
|
+
};
|
|
34
33
|
var bsClassName = prefix(navbarProps, 'header');
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
return React.createElement("div", _extends({}, props, {
|
|
35
|
+
className: classNames(className, bsClassName)
|
|
36
|
+
}));
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
return NavbarHeader;
|
|
40
40
|
}(React.Component);
|
|
41
41
|
|
|
42
42
|
NavbarHeader.contextTypes = contextTypes;
|
|
43
|
-
|
|
44
43
|
export default NavbarHeader;
|
package/es/NavbarToggle.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
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
|
-
|
|
10
7
|
import { prefix } from './utils/bootstrapUtils';
|
|
11
8
|
import createChainedFunction from './utils/createChainedFunction';
|
|
12
|
-
|
|
13
9
|
var propTypes = {
|
|
14
10
|
onClick: PropTypes.func,
|
|
11
|
+
|
|
15
12
|
/**
|
|
16
13
|
* The toggle content, if left empty it will render the default toggle (seen above).
|
|
17
14
|
*/
|
|
18
15
|
children: PropTypes.node
|
|
19
16
|
};
|
|
20
|
-
|
|
21
17
|
var contextTypes = {
|
|
22
18
|
$bs_navbar: PropTypes.shape({
|
|
23
19
|
bsClass: PropTypes.string,
|
|
@@ -26,23 +22,27 @@ var contextTypes = {
|
|
|
26
22
|
})
|
|
27
23
|
};
|
|
28
24
|
|
|
29
|
-
var NavbarToggle =
|
|
30
|
-
|
|
25
|
+
var NavbarToggle =
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
function (_React$Component) {
|
|
28
|
+
_inheritsLoose(NavbarToggle, _React$Component);
|
|
31
29
|
|
|
32
30
|
function NavbarToggle() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
31
|
+
return _React$Component.apply(this, arguments) || this;
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
NavbarToggle.prototype
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
var _proto = NavbarToggle.prototype;
|
|
35
|
+
|
|
36
|
+
_proto.render = function render() {
|
|
37
|
+
var _this$props = this.props,
|
|
38
|
+
onClick = _this$props.onClick,
|
|
39
|
+
className = _this$props.className,
|
|
40
|
+
children = _this$props.children,
|
|
41
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["onClick", "className", "children"]);
|
|
44
42
|
|
|
45
|
-
var navbarProps = this.context.$bs_navbar || {
|
|
43
|
+
var navbarProps = this.context.$bs_navbar || {
|
|
44
|
+
bsClass: 'navbar'
|
|
45
|
+
};
|
|
46
46
|
|
|
47
47
|
var buttonProps = _extends({
|
|
48
48
|
type: 'button'
|
|
@@ -52,25 +52,18 @@ var NavbarToggle = function (_React$Component) {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
if (children) {
|
|
55
|
-
return React.createElement(
|
|
56
|
-
'button',
|
|
57
|
-
buttonProps,
|
|
58
|
-
children
|
|
59
|
-
);
|
|
55
|
+
return React.createElement("button", buttonProps, children);
|
|
60
56
|
}
|
|
61
57
|
|
|
62
|
-
return React.createElement(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
React.createElement('span', { className: 'icon-bar' }),
|
|
72
|
-
React.createElement('span', { className: 'icon-bar' })
|
|
73
|
-
);
|
|
58
|
+
return React.createElement("button", buttonProps, React.createElement("span", {
|
|
59
|
+
className: "sr-only"
|
|
60
|
+
}, "Toggle navigation"), React.createElement("span", {
|
|
61
|
+
className: "icon-bar"
|
|
62
|
+
}), React.createElement("span", {
|
|
63
|
+
className: "icon-bar"
|
|
64
|
+
}), React.createElement("span", {
|
|
65
|
+
className: "icon-bar"
|
|
66
|
+
}));
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
return NavbarToggle;
|
|
@@ -78,5 +71,4 @@ var NavbarToggle = function (_React$Component) {
|
|
|
78
71
|
|
|
79
72
|
NavbarToggle.propTypes = propTypes;
|
|
80
73
|
NavbarToggle.contextTypes = contextTypes;
|
|
81
|
-
|
|
82
74
|
export default NavbarToggle;
|