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 React from 'react';
|
5 | import PropTypes from 'prop-types';
|
6 | import Collapse from './Collapse';
|
7 | import { prefix } from './utils/bootstrapUtils';
|
8 | var contextTypes = {
|
9 | $bs_navbar: PropTypes.shape({
|
10 | bsClass: PropTypes.string,
|
11 | expanded: PropTypes.bool
|
12 | })
|
13 | };
|
14 |
|
15 | var NavbarCollapse =
|
16 |
|
17 | function (_React$Component) {
|
18 | _inheritsLoose(NavbarCollapse, _React$Component);
|
19 |
|
20 | function NavbarCollapse() {
|
21 | return _React$Component.apply(this, arguments) || this;
|
22 | }
|
23 |
|
24 | var _proto = NavbarCollapse.prototype;
|
25 |
|
26 | _proto.render = function render() {
|
27 | var _this$props = this.props,
|
28 | children = _this$props.children,
|
29 | props = _objectWithoutPropertiesLoose(_this$props, ["children"]);
|
30 |
|
31 | var navbarProps = this.context.$bs_navbar || {
|
32 | bsClass: 'navbar'
|
33 | };
|
34 | var bsClassName = prefix(navbarProps, 'collapse');
|
35 | return React.createElement(Collapse, _extends({
|
36 | in: navbarProps.expanded
|
37 | }, props), React.createElement("div", {
|
38 | className: bsClassName
|
39 | }, children));
|
40 | };
|
41 |
|
42 | return NavbarCollapse;
|
43 | }(React.Component);
|
44 |
|
45 | NavbarCollapse.contextTypes = contextTypes;
|
46 | export default NavbarCollapse; |
\ | No newline at end of file |