react-bootstrap 0.31.1 → 0.31.5
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 +53 -0
- package/dist/react-bootstrap.js +4811 -4179
- package/dist/react-bootstrap.min.js +9 -9
- package/dist/react-bootstrap.min.js.map +1 -1
- package/es/ButtonToolbar.js +2 -3
- package/es/Carousel.js +85 -77
- package/es/Checkbox.js +2 -0
- package/es/CloseButton.js +1 -1
- package/es/Collapse.js +18 -18
- package/es/Dropdown.js +50 -50
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +2 -2
- package/es/FormControl.js +1 -2
- package/es/MediaBody.js +15 -2
- package/es/Modal.js +23 -15
- package/es/Nav.js +44 -44
- package/es/Navbar.js +4 -4
- package/es/OverlayTrigger.js +39 -39
- package/es/Panel.js +44 -44
- package/es/Radio.js +2 -0
- package/es/SafeAnchor.js +15 -2
- package/es/TabContent.js +5 -5
- package/es/TabPane.js +16 -16
- package/es/Tabs.js +2 -2
- package/es/Thumbnail.js +2 -0
- package/es/ToggleButton.js +8 -0
- package/es/ToggleButtonGroup.js +11 -6
- package/es/index.js +4 -0
- package/es/utils/TransitionEvents.js +11 -10
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +2 -1
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -14
- package/lib/Badge.js +13 -13
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +13 -13
- package/lib/ButtonToolbar.js +9 -13
- package/lib/Carousel.js +127 -119
- package/lib/CarouselCaption.js +10 -10
- package/lib/CarouselItem.js +16 -16
- package/lib/Checkbox.js +21 -21
- package/lib/Clearfix.js +15 -15
- package/lib/CloseButton.js +12 -14
- package/lib/Col.js +30 -30
- package/lib/Collapse.js +47 -47
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +92 -92
- package/lib/DropdownButton.js +22 -22
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +20 -20
- package/lib/Form.js +12 -12
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +10 -10
- package/lib/FormGroup.js +15 -15
- package/lib/Glyphicon.js +11 -11
- package/lib/Grid.js +11 -11
- package/lib/HelpBlock.js +9 -9
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +11 -11
- package/lib/InputGroupAddon.js +9 -9
- package/lib/InputGroupButton.js +9 -9
- package/lib/Jumbotron.js +10 -10
- package/lib/Label.js +12 -12
- package/lib/ListGroup.js +16 -16
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +16 -16
- package/lib/MediaBody.js +29 -10
- package/lib/MediaHeading.js +10 -10
- package/lib/MediaLeft.js +11 -11
- package/lib/MediaList.js +9 -9
- package/lib/MediaListItem.js +9 -9
- package/lib/MediaRight.js +11 -11
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +73 -65
- package/lib/ModalBody.js +10 -10
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +10 -10
- package/lib/ModalHeader.js +17 -17
- package/lib/ModalTitle.js +10 -10
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +25 -25
- package/lib/NavItem.js +18 -18
- package/lib/Navbar.js +47 -47
- package/lib/NavbarBrand.js +14 -14
- package/lib/NavbarCollapse.js +14 -14
- package/lib/NavbarHeader.js +10 -10
- package/lib/NavbarToggle.js +22 -22
- package/lib/Overlay.js +25 -25
- package/lib/OverlayTrigger.js +75 -75
- package/lib/PageHeader.js +11 -11
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +14 -14
- package/lib/PagerItem.js +17 -17
- package/lib/Pagination.js +52 -52
- package/lib/PaginationButton.js +20 -20
- package/lib/Panel.js +76 -76
- package/lib/PanelGroup.js +18 -18
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +29 -29
- package/lib/Radio.js +21 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +10 -10
- package/lib/SafeAnchor.js +31 -16
- package/lib/SplitButton.js +26 -26
- package/lib/SplitToggle.js +8 -8
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +29 -29
- package/lib/TabPane.js +57 -57
- package/lib/Table.js +16 -16
- package/lib/Tabs.js +28 -28
- package/lib/Thumbnail.js +19 -19
- package/lib/ToggleButton.js +23 -16
- package/lib/ToggleButtonGroup.js +38 -26
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +9 -9
- package/lib/index.js +83 -73
- package/lib/utils/PropTypes.js +5 -5
- package/lib/utils/TransitionEvents.js +12 -11
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +11 -10
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/createChainedFunction.js +1 -1
- package/lib/utils/deprecationWarning.js +7 -7
- package/lib/utils/index.js +4 -4
- package/lib/utils/splitComponentProps.js +3 -3
- package/package.json +20 -18
package/lib/NavDropdown.js
CHANGED
|
@@ -46,28 +46,28 @@ var _ValidComponentChildren = require('./utils/ValidComponentChildren');
|
|
|
46
46
|
|
|
47
47
|
var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
|
|
48
48
|
|
|
49
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
49
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
50
|
|
|
51
|
-
var propTypes = (0, _extends3
|
|
51
|
+
var propTypes = (0, _extends3.default)({}, _Dropdown2.default.propTypes, {
|
|
52
52
|
|
|
53
53
|
// Toggle props.
|
|
54
|
-
title: _propTypes2
|
|
55
|
-
noCaret: _propTypes2
|
|
56
|
-
active: _propTypes2
|
|
54
|
+
title: _propTypes2.default.node.isRequired,
|
|
55
|
+
noCaret: _propTypes2.default.bool,
|
|
56
|
+
active: _propTypes2.default.bool,
|
|
57
57
|
|
|
58
58
|
// Override generated docs from <Dropdown>.
|
|
59
59
|
/**
|
|
60
60
|
* @private
|
|
61
61
|
*/
|
|
62
|
-
children: _propTypes2
|
|
62
|
+
children: _propTypes2.default.node
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
var NavDropdown = function (_React$Component) {
|
|
66
|
-
(0, _inherits3
|
|
66
|
+
(0, _inherits3.default)(NavDropdown, _React$Component);
|
|
67
67
|
|
|
68
68
|
function NavDropdown() {
|
|
69
|
-
(0, _classCallCheck3
|
|
70
|
-
return (0, _possibleConstructorReturn3
|
|
69
|
+
(0, _classCallCheck3.default)(this, NavDropdown);
|
|
70
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
NavDropdown.prototype.isActive = function isActive(_ref, activeKey, activeHref) {
|
|
@@ -79,7 +79,7 @@ var NavDropdown = function (_React$Component) {
|
|
|
79
79
|
return true;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
if (_ValidComponentChildren2
|
|
82
|
+
if (_ValidComponentChildren2.default.some(props.children, function (child) {
|
|
83
83
|
return _this2.isActive(child, activeKey, activeHref);
|
|
84
84
|
})) {
|
|
85
85
|
return true;
|
|
@@ -98,37 +98,37 @@ var NavDropdown = function (_React$Component) {
|
|
|
98
98
|
className = _props.className,
|
|
99
99
|
style = _props.style,
|
|
100
100
|
children = _props.children,
|
|
101
|
-
props = (0, _objectWithoutProperties3
|
|
101
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['title', 'activeKey', 'activeHref', 'className', 'style', 'children']);
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
var active = this.isActive(this, activeKey, activeHref);
|
|
105
105
|
delete props.active; // Accessed via this.isActive().
|
|
106
106
|
delete props.eventKey; // Accessed via this.isActive().
|
|
107
107
|
|
|
108
|
-
var _splitComponentProps = (0, _splitComponentProps3
|
|
108
|
+
var _splitComponentProps = (0, _splitComponentProps3.default)(props, _Dropdown2.default.ControlledComponent),
|
|
109
109
|
dropdownProps = _splitComponentProps[0],
|
|
110
110
|
toggleProps = _splitComponentProps[1];
|
|
111
111
|
|
|
112
112
|
// Unlike for the other dropdowns, styling needs to go to the `<Dropdown>`
|
|
113
113
|
// rather than the `<Dropdown.Toggle>`.
|
|
114
114
|
|
|
115
|
-
return _react2
|
|
116
|
-
_Dropdown2
|
|
117
|
-
(0, _extends3
|
|
115
|
+
return _react2.default.createElement(
|
|
116
|
+
_Dropdown2.default,
|
|
117
|
+
(0, _extends3.default)({}, dropdownProps, {
|
|
118
118
|
componentClass: 'li',
|
|
119
|
-
className: (0, _classnames2
|
|
119
|
+
className: (0, _classnames2.default)(className, { active: active }),
|
|
120
120
|
style: style
|
|
121
121
|
}),
|
|
122
|
-
_react2
|
|
123
|
-
_Dropdown2
|
|
124
|
-
(0, _extends3
|
|
122
|
+
_react2.default.createElement(
|
|
123
|
+
_Dropdown2.default.Toggle,
|
|
124
|
+
(0, _extends3.default)({}, toggleProps, { useAnchor: true }),
|
|
125
125
|
title
|
|
126
126
|
),
|
|
127
|
-
_react2
|
|
128
|
-
_Dropdown2
|
|
127
|
+
_react2.default.createElement(
|
|
128
|
+
_Dropdown2.default.Menu,
|
|
129
129
|
null,
|
|
130
|
-
_ValidComponentChildren2
|
|
131
|
-
return _react2
|
|
130
|
+
_ValidComponentChildren2.default.map(children, function (child) {
|
|
131
|
+
return _react2.default.cloneElement(child, {
|
|
132
132
|
active: _this3.isActive(child, activeKey, activeHref)
|
|
133
133
|
});
|
|
134
134
|
})
|
|
@@ -137,9 +137,9 @@ var NavDropdown = function (_React$Component) {
|
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
return NavDropdown;
|
|
140
|
-
}(_react2
|
|
140
|
+
}(_react2.default.Component);
|
|
141
141
|
|
|
142
142
|
NavDropdown.propTypes = propTypes;
|
|
143
143
|
|
|
144
|
-
exports
|
|
144
|
+
exports.default = NavDropdown;
|
|
145
145
|
module.exports = exports['default'];
|
package/lib/NavItem.js
CHANGED
|
@@ -42,16 +42,16 @@ var _createChainedFunction = require('./utils/createChainedFunction');
|
|
|
42
42
|
|
|
43
43
|
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
|
44
44
|
|
|
45
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
46
|
|
|
47
47
|
var propTypes = {
|
|
48
|
-
active: _propTypes2
|
|
49
|
-
disabled: _propTypes2
|
|
50
|
-
role: _propTypes2
|
|
51
|
-
href: _propTypes2
|
|
52
|
-
onClick: _propTypes2
|
|
53
|
-
onSelect: _propTypes2
|
|
54
|
-
eventKey: _propTypes2
|
|
48
|
+
active: _propTypes2.default.bool,
|
|
49
|
+
disabled: _propTypes2.default.bool,
|
|
50
|
+
role: _propTypes2.default.string,
|
|
51
|
+
href: _propTypes2.default.string,
|
|
52
|
+
onClick: _propTypes2.default.func,
|
|
53
|
+
onSelect: _propTypes2.default.func,
|
|
54
|
+
eventKey: _propTypes2.default.any
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
var defaultProps = {
|
|
@@ -60,12 +60,12 @@ var defaultProps = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
var NavItem = function (_React$Component) {
|
|
63
|
-
(0, _inherits3
|
|
63
|
+
(0, _inherits3.default)(NavItem, _React$Component);
|
|
64
64
|
|
|
65
65
|
function NavItem(props, context) {
|
|
66
|
-
(0, _classCallCheck3
|
|
66
|
+
(0, _classCallCheck3.default)(this, NavItem);
|
|
67
67
|
|
|
68
|
-
var _this = (0, _possibleConstructorReturn3
|
|
68
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
69
69
|
|
|
70
70
|
_this.handleClick = _this.handleClick.bind(_this);
|
|
71
71
|
return _this;
|
|
@@ -88,7 +88,7 @@ var NavItem = function (_React$Component) {
|
|
|
88
88
|
onClick = _props.onClick,
|
|
89
89
|
className = _props.className,
|
|
90
90
|
style = _props.style,
|
|
91
|
-
props = (0, _objectWithoutProperties3
|
|
91
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['active', 'disabled', 'onClick', 'className', 'style']);
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
delete props.onSelect;
|
|
@@ -106,25 +106,25 @@ var NavItem = function (_React$Component) {
|
|
|
106
106
|
props['aria-selected'] = active;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
return _react2
|
|
109
|
+
return _react2.default.createElement(
|
|
110
110
|
'li',
|
|
111
111
|
{
|
|
112
112
|
role: 'presentation',
|
|
113
|
-
className: (0, _classnames2
|
|
113
|
+
className: (0, _classnames2.default)(className, { active: active, disabled: disabled }),
|
|
114
114
|
style: style
|
|
115
115
|
},
|
|
116
|
-
_react2
|
|
116
|
+
_react2.default.createElement(_SafeAnchor2.default, (0, _extends3.default)({}, props, {
|
|
117
117
|
disabled: disabled,
|
|
118
|
-
onClick: (0, _createChainedFunction2
|
|
118
|
+
onClick: (0, _createChainedFunction2.default)(onClick, this.handleClick)
|
|
119
119
|
}))
|
|
120
120
|
);
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
return NavItem;
|
|
124
|
-
}(_react2
|
|
124
|
+
}(_react2.default.Component);
|
|
125
125
|
|
|
126
126
|
NavItem.propTypes = propTypes;
|
|
127
127
|
NavItem.defaultProps = defaultProps;
|
|
128
128
|
|
|
129
|
-
exports
|
|
129
|
+
exports.default = NavItem;
|
|
130
130
|
module.exports = exports['default'];
|
package/lib/Navbar.js
CHANGED
|
@@ -70,45 +70,45 @@ var _createChainedFunction = require('./utils/createChainedFunction');
|
|
|
70
70
|
|
|
71
71
|
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
|
72
72
|
|
|
73
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
73
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
74
74
|
|
|
75
75
|
var propTypes = {
|
|
76
76
|
/**
|
|
77
77
|
* Create a fixed navbar along the top of the screen, that scrolls with the
|
|
78
78
|
* page
|
|
79
79
|
*/
|
|
80
|
-
fixedTop: _propTypes2
|
|
80
|
+
fixedTop: _propTypes2.default.bool,
|
|
81
81
|
/**
|
|
82
82
|
* Create a fixed navbar along the bottom of the screen, that scrolls with
|
|
83
83
|
* the page
|
|
84
84
|
*/
|
|
85
|
-
fixedBottom: _propTypes2
|
|
85
|
+
fixedBottom: _propTypes2.default.bool,
|
|
86
86
|
/**
|
|
87
87
|
* Create a full-width navbar that scrolls away with the page
|
|
88
88
|
*/
|
|
89
|
-
staticTop: _propTypes2
|
|
89
|
+
staticTop: _propTypes2.default.bool,
|
|
90
90
|
/**
|
|
91
91
|
* An alternative dark visual style for the Navbar
|
|
92
92
|
*/
|
|
93
|
-
inverse: _propTypes2
|
|
93
|
+
inverse: _propTypes2.default.bool,
|
|
94
94
|
/**
|
|
95
95
|
* Allow the Navbar to fluidly adjust to the page or container width, instead
|
|
96
96
|
* of at the predefined screen breakpoints
|
|
97
97
|
*/
|
|
98
|
-
fluid: _propTypes2
|
|
98
|
+
fluid: _propTypes2.default.bool,
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Set a custom element for this component.
|
|
102
102
|
*/
|
|
103
|
-
componentClass: _elementType2
|
|
103
|
+
componentClass: _elementType2.default,
|
|
104
104
|
/**
|
|
105
105
|
* A callback fired when the `<Navbar>` body collapses or expands. Fired when
|
|
106
|
-
* a `<Navbar.Toggle>` is clicked and called with the new `
|
|
106
|
+
* a `<Navbar.Toggle>` is clicked and called with the new `expanded`
|
|
107
107
|
* boolean value.
|
|
108
108
|
*
|
|
109
|
-
* @controllable
|
|
109
|
+
* @controllable expanded
|
|
110
110
|
*/
|
|
111
|
-
onToggle: _propTypes2
|
|
111
|
+
onToggle: _propTypes2.default.func,
|
|
112
112
|
/**
|
|
113
113
|
* A callback fired when a descendant of a child `<Nav>` is selected. Should
|
|
114
114
|
* be used to execute complex closing or other miscellaneous actions desired
|
|
@@ -118,8 +118,8 @@ var propTypes = {
|
|
|
118
118
|
*
|
|
119
119
|
* ```js
|
|
120
120
|
* function (
|
|
121
|
-
*
|
|
122
|
-
*
|
|
121
|
+
* Any eventKey,
|
|
122
|
+
* SyntheticEvent event?
|
|
123
123
|
* )
|
|
124
124
|
* ```
|
|
125
125
|
*
|
|
@@ -130,7 +130,7 @@ var propTypes = {
|
|
|
130
130
|
* ensure that you are setting `expanded` to false and not *toggling* between
|
|
131
131
|
* true and false.
|
|
132
132
|
*/
|
|
133
|
-
onSelect: _propTypes2
|
|
133
|
+
onSelect: _propTypes2.default.func,
|
|
134
134
|
/**
|
|
135
135
|
* Sets `expanded` to `false` after the onSelect event of a descendant of a
|
|
136
136
|
* child `<Nav>`. Does nothing if no `<Nav>` or `<Nav>` descendants exist.
|
|
@@ -138,15 +138,15 @@ var propTypes = {
|
|
|
138
138
|
* The onSelect callback should be used instead for more complex operations
|
|
139
139
|
* that need to be executed after the `select` event of `<Nav>` descendants.
|
|
140
140
|
*/
|
|
141
|
-
collapseOnSelect: _propTypes2
|
|
141
|
+
collapseOnSelect: _propTypes2.default.bool,
|
|
142
142
|
/**
|
|
143
143
|
* Explicitly set the visiblity of the navbar body
|
|
144
144
|
*
|
|
145
145
|
* @controllable onToggle
|
|
146
146
|
*/
|
|
147
|
-
expanded: _propTypes2
|
|
147
|
+
expanded: _propTypes2.default.bool,
|
|
148
148
|
|
|
149
|
-
role: _propTypes2
|
|
149
|
+
role: _propTypes2.default.string
|
|
150
150
|
}; // TODO: Remove this pragma once we upgrade eslint-config-airbnb.
|
|
151
151
|
/* eslint-disable react/no-multi-comp */
|
|
152
152
|
|
|
@@ -161,21 +161,21 @@ var defaultProps = {
|
|
|
161
161
|
};
|
|
162
162
|
|
|
163
163
|
var childContextTypes = {
|
|
164
|
-
$bs_navbar: _propTypes2
|
|
165
|
-
bsClass: _propTypes2
|
|
166
|
-
expanded: _propTypes2
|
|
167
|
-
onToggle: _propTypes2
|
|
168
|
-
onSelect: _propTypes2
|
|
164
|
+
$bs_navbar: _propTypes2.default.shape({
|
|
165
|
+
bsClass: _propTypes2.default.string,
|
|
166
|
+
expanded: _propTypes2.default.bool,
|
|
167
|
+
onToggle: _propTypes2.default.func.isRequired,
|
|
168
|
+
onSelect: _propTypes2.default.func
|
|
169
169
|
})
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
var Navbar = function (_React$Component) {
|
|
173
|
-
(0, _inherits3
|
|
173
|
+
(0, _inherits3.default)(Navbar, _React$Component);
|
|
174
174
|
|
|
175
175
|
function Navbar(props, context) {
|
|
176
|
-
(0, _classCallCheck3
|
|
176
|
+
(0, _classCallCheck3.default)(this, Navbar);
|
|
177
177
|
|
|
178
|
-
var _this = (0, _possibleConstructorReturn3
|
|
178
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
179
179
|
|
|
180
180
|
_this.handleToggle = _this.handleToggle.bind(_this);
|
|
181
181
|
_this.handleCollapse = _this.handleCollapse.bind(_this);
|
|
@@ -195,7 +195,7 @@ var Navbar = function (_React$Component) {
|
|
|
195
195
|
bsClass: bsClass,
|
|
196
196
|
expanded: expanded,
|
|
197
197
|
onToggle: this.handleToggle,
|
|
198
|
-
onSelect: (0, _createChainedFunction2
|
|
198
|
+
onSelect: (0, _createChainedFunction2.default)(onSelect, collapseOnSelect ? this.handleCollapse : null)
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
};
|
|
@@ -232,7 +232,7 @@ var Navbar = function (_React$Component) {
|
|
|
232
232
|
fluid = _props4.fluid,
|
|
233
233
|
className = _props4.className,
|
|
234
234
|
children = _props4.children,
|
|
235
|
-
props = (0, _objectWithoutProperties3
|
|
235
|
+
props = (0, _objectWithoutProperties3.default)(_props4, ['componentClass', 'fixedTop', 'fixedBottom', 'staticTop', 'inverse', 'fluid', 'className', 'children']);
|
|
236
236
|
|
|
237
237
|
var _splitBsPropsAndOmit = (0, _bootstrapUtils.splitBsPropsAndOmit)(props, ['expanded', 'onToggle', 'onSelect', 'collapseOnSelect']),
|
|
238
238
|
bsProps = _splitBsPropsAndOmit[0],
|
|
@@ -251,15 +251,15 @@ var Navbar = function (_React$Component) {
|
|
|
251
251
|
bsProps.bsStyle = _StyleConfig.Style.INVERSE;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
var classes = (0, _extends4
|
|
254
|
+
var classes = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'fixed-top')] = fixedTop, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'fixed-bottom')] = fixedBottom, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'static-top')] = staticTop, _extends2));
|
|
255
255
|
|
|
256
|
-
return _react2
|
|
256
|
+
return _react2.default.createElement(
|
|
257
257
|
Component,
|
|
258
|
-
(0, _extends4
|
|
259
|
-
className: (0, _classnames2
|
|
258
|
+
(0, _extends4.default)({}, elementProps, {
|
|
259
|
+
className: (0, _classnames2.default)(className, classes)
|
|
260
260
|
}),
|
|
261
|
-
_react2
|
|
262
|
-
_Grid2
|
|
261
|
+
_react2.default.createElement(
|
|
262
|
+
_Grid2.default,
|
|
263
263
|
{ fluid: fluid },
|
|
264
264
|
children
|
|
265
265
|
)
|
|
@@ -267,7 +267,7 @@ var Navbar = function (_React$Component) {
|
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
return Navbar;
|
|
270
|
-
}(_react2
|
|
270
|
+
}(_react2.default.Component);
|
|
271
271
|
|
|
272
272
|
Navbar.propTypes = propTypes;
|
|
273
273
|
Navbar.defaultProps = defaultProps;
|
|
@@ -275,7 +275,7 @@ Navbar.childContextTypes = childContextTypes;
|
|
|
275
275
|
|
|
276
276
|
(0, _bootstrapUtils.bsClass)('navbar', Navbar);
|
|
277
277
|
|
|
278
|
-
var UncontrollableNavbar = (0, _uncontrollable2
|
|
278
|
+
var UncontrollableNavbar = (0, _uncontrollable2.default)(Navbar, { expanded: 'onToggle' });
|
|
279
279
|
|
|
280
280
|
function createSimpleWrapper(tag, suffix, displayName) {
|
|
281
281
|
var Wrapper = function Wrapper(_ref, _ref2) {
|
|
@@ -285,18 +285,18 @@ function createSimpleWrapper(tag, suffix, displayName) {
|
|
|
285
285
|
className = _ref.className,
|
|
286
286
|
pullRight = _ref.pullRight,
|
|
287
287
|
pullLeft = _ref.pullLeft,
|
|
288
|
-
props = (0, _objectWithoutProperties3
|
|
289
|
-
return _react2
|
|
290
|
-
className: (0, _classnames2
|
|
288
|
+
props = (0, _objectWithoutProperties3.default)(_ref, ['componentClass', 'className', 'pullRight', 'pullLeft']);
|
|
289
|
+
return _react2.default.createElement(Component, (0, _extends4.default)({}, props, {
|
|
290
|
+
className: (0, _classnames2.default)(className, (0, _bootstrapUtils.prefix)(navbarProps, suffix), pullRight && (0, _bootstrapUtils.prefix)(navbarProps, 'right'), pullLeft && (0, _bootstrapUtils.prefix)(navbarProps, 'left'))
|
|
291
291
|
}));
|
|
292
292
|
};
|
|
293
293
|
|
|
294
294
|
Wrapper.displayName = displayName;
|
|
295
295
|
|
|
296
296
|
Wrapper.propTypes = {
|
|
297
|
-
componentClass: _elementType2
|
|
298
|
-
pullRight: _propTypes2
|
|
299
|
-
pullLeft: _propTypes2
|
|
297
|
+
componentClass: _elementType2.default,
|
|
298
|
+
pullRight: _propTypes2.default.bool,
|
|
299
|
+
pullLeft: _propTypes2.default.bool
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
Wrapper.defaultProps = {
|
|
@@ -306,23 +306,23 @@ function createSimpleWrapper(tag, suffix, displayName) {
|
|
|
306
306
|
};
|
|
307
307
|
|
|
308
308
|
Wrapper.contextTypes = {
|
|
309
|
-
$bs_navbar: _propTypes2
|
|
310
|
-
bsClass: _propTypes2
|
|
309
|
+
$bs_navbar: _propTypes2.default.shape({
|
|
310
|
+
bsClass: _propTypes2.default.string
|
|
311
311
|
})
|
|
312
312
|
};
|
|
313
313
|
|
|
314
314
|
return Wrapper;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
UncontrollableNavbar.Brand = _NavbarBrand2
|
|
318
|
-
UncontrollableNavbar.Header = _NavbarHeader2
|
|
319
|
-
UncontrollableNavbar.Toggle = _NavbarToggle2
|
|
320
|
-
UncontrollableNavbar.Collapse = _NavbarCollapse2
|
|
317
|
+
UncontrollableNavbar.Brand = _NavbarBrand2.default;
|
|
318
|
+
UncontrollableNavbar.Header = _NavbarHeader2.default;
|
|
319
|
+
UncontrollableNavbar.Toggle = _NavbarToggle2.default;
|
|
320
|
+
UncontrollableNavbar.Collapse = _NavbarCollapse2.default;
|
|
321
321
|
|
|
322
322
|
UncontrollableNavbar.Form = createSimpleWrapper('div', 'form', 'NavbarForm');
|
|
323
323
|
UncontrollableNavbar.Text = createSimpleWrapper('p', 'text', 'NavbarText');
|
|
324
324
|
UncontrollableNavbar.Link = createSimpleWrapper('a', 'link', 'NavbarLink');
|
|
325
325
|
|
|
326
326
|
// Set bsStyles here so they can be overridden.
|
|
327
|
-
exports
|
|
327
|
+
exports.default = (0, _bootstrapUtils.bsStyles)([_StyleConfig.Style.DEFAULT, _StyleConfig.Style.INVERSE], _StyleConfig.Style.DEFAULT, UncontrollableNavbar);
|
|
328
328
|
module.exports = exports['default'];
|
package/lib/NavbarBrand.js
CHANGED
|
@@ -36,49 +36,49 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var contextTypes = {
|
|
42
|
-
$bs_navbar: _propTypes2
|
|
43
|
-
bsClass: _propTypes2
|
|
42
|
+
$bs_navbar: _propTypes2.default.shape({
|
|
43
|
+
bsClass: _propTypes2.default.string
|
|
44
44
|
})
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
var NavbarBrand = function (_React$Component) {
|
|
48
|
-
(0, _inherits3
|
|
48
|
+
(0, _inherits3.default)(NavbarBrand, _React$Component);
|
|
49
49
|
|
|
50
50
|
function NavbarBrand() {
|
|
51
|
-
(0, _classCallCheck3
|
|
52
|
-
return (0, _possibleConstructorReturn3
|
|
51
|
+
(0, _classCallCheck3.default)(this, NavbarBrand);
|
|
52
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
NavbarBrand.prototype.render = function render() {
|
|
56
56
|
var _props = this.props,
|
|
57
57
|
className = _props.className,
|
|
58
58
|
children = _props.children,
|
|
59
|
-
props = (0, _objectWithoutProperties3
|
|
59
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['className', 'children']);
|
|
60
60
|
|
|
61
61
|
var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
|
|
62
62
|
|
|
63
63
|
var bsClassName = (0, _bootstrapUtils.prefix)(navbarProps, 'brand');
|
|
64
64
|
|
|
65
|
-
if (_react2
|
|
66
|
-
return _react2
|
|
67
|
-
className: (0, _classnames2
|
|
65
|
+
if (_react2.default.isValidElement(children)) {
|
|
66
|
+
return _react2.default.cloneElement(children, {
|
|
67
|
+
className: (0, _classnames2.default)(children.props.className, className, bsClassName)
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
return _react2
|
|
71
|
+
return _react2.default.createElement(
|
|
72
72
|
'span',
|
|
73
|
-
(0, _extends3
|
|
73
|
+
(0, _extends3.default)({}, props, { className: (0, _classnames2.default)(className, bsClassName) }),
|
|
74
74
|
children
|
|
75
75
|
);
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
return NavbarBrand;
|
|
79
|
-
}(_react2
|
|
79
|
+
}(_react2.default.Component);
|
|
80
80
|
|
|
81
81
|
NavbarBrand.contextTypes = contextTypes;
|
|
82
82
|
|
|
83
|
-
exports
|
|
83
|
+
exports.default = NavbarBrand;
|
|
84
84
|
module.exports = exports['default'];
|
package/lib/NavbarCollapse.js
CHANGED
|
@@ -36,36 +36,36 @@ var _Collapse2 = _interopRequireDefault(_Collapse);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var contextTypes = {
|
|
42
|
-
$bs_navbar: _propTypes2
|
|
43
|
-
bsClass: _propTypes2
|
|
44
|
-
expanded: _propTypes2
|
|
42
|
+
$bs_navbar: _propTypes2.default.shape({
|
|
43
|
+
bsClass: _propTypes2.default.string,
|
|
44
|
+
expanded: _propTypes2.default.bool
|
|
45
45
|
})
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
var NavbarCollapse = function (_React$Component) {
|
|
49
|
-
(0, _inherits3
|
|
49
|
+
(0, _inherits3.default)(NavbarCollapse, _React$Component);
|
|
50
50
|
|
|
51
51
|
function NavbarCollapse() {
|
|
52
|
-
(0, _classCallCheck3
|
|
53
|
-
return (0, _possibleConstructorReturn3
|
|
52
|
+
(0, _classCallCheck3.default)(this, NavbarCollapse);
|
|
53
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
NavbarCollapse.prototype.render = function render() {
|
|
57
57
|
var _props = this.props,
|
|
58
58
|
children = _props.children,
|
|
59
|
-
props = (0, _objectWithoutProperties3
|
|
59
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['children']);
|
|
60
60
|
|
|
61
61
|
var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
|
|
62
62
|
|
|
63
63
|
var bsClassName = (0, _bootstrapUtils.prefix)(navbarProps, 'collapse');
|
|
64
64
|
|
|
65
|
-
return _react2
|
|
66
|
-
_Collapse2
|
|
67
|
-
(0, _extends3
|
|
68
|
-
_react2
|
|
65
|
+
return _react2.default.createElement(
|
|
66
|
+
_Collapse2.default,
|
|
67
|
+
(0, _extends3.default)({ 'in': navbarProps.expanded }, props),
|
|
68
|
+
_react2.default.createElement(
|
|
69
69
|
'div',
|
|
70
70
|
{ className: bsClassName },
|
|
71
71
|
children
|
|
@@ -74,9 +74,9 @@ var NavbarCollapse = function (_React$Component) {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
return NavbarCollapse;
|
|
77
|
-
}(_react2
|
|
77
|
+
}(_react2.default.Component);
|
|
78
78
|
|
|
79
79
|
NavbarCollapse.contextTypes = contextTypes;
|
|
80
80
|
|
|
81
|
-
exports
|
|
81
|
+
exports.default = NavbarCollapse;
|
|
82
82
|
module.exports = exports['default'];
|
package/lib/NavbarHeader.js
CHANGED
|
@@ -36,38 +36,38 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var contextTypes = {
|
|
42
|
-
$bs_navbar: _propTypes2
|
|
43
|
-
bsClass: _propTypes2
|
|
42
|
+
$bs_navbar: _propTypes2.default.shape({
|
|
43
|
+
bsClass: _propTypes2.default.string
|
|
44
44
|
})
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
var NavbarHeader = function (_React$Component) {
|
|
48
|
-
(0, _inherits3
|
|
48
|
+
(0, _inherits3.default)(NavbarHeader, _React$Component);
|
|
49
49
|
|
|
50
50
|
function NavbarHeader() {
|
|
51
|
-
(0, _classCallCheck3
|
|
52
|
-
return (0, _possibleConstructorReturn3
|
|
51
|
+
(0, _classCallCheck3.default)(this, NavbarHeader);
|
|
52
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
NavbarHeader.prototype.render = function render() {
|
|
56
56
|
var _props = this.props,
|
|
57
57
|
className = _props.className,
|
|
58
|
-
props = (0, _objectWithoutProperties3
|
|
58
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['className']);
|
|
59
59
|
|
|
60
60
|
var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
|
|
61
61
|
|
|
62
62
|
var bsClassName = (0, _bootstrapUtils.prefix)(navbarProps, 'header');
|
|
63
63
|
|
|
64
|
-
return _react2
|
|
64
|
+
return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: (0, _classnames2.default)(className, bsClassName) }));
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
return NavbarHeader;
|
|
68
|
-
}(_react2
|
|
68
|
+
}(_react2.default.Component);
|
|
69
69
|
|
|
70
70
|
NavbarHeader.contextTypes = contextTypes;
|
|
71
71
|
|
|
72
|
-
exports
|
|
72
|
+
exports.default = NavbarHeader;
|
|
73
73
|
module.exports = exports['default'];
|