@coreui/react 2.5.7 → 2.5.8
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 +18 -0
- package/es/Aside.js +29 -37
- package/es/AsideToggler.js +36 -44
- package/es/Breadcrumb.js +51 -58
- package/es/Breadcrumb2.js +52 -60
- package/es/Footer.js +24 -32
- package/es/Header.js +23 -35
- package/es/HeaderDropdown.js +23 -27
- package/es/NavbarBrand.js +32 -39
- package/es/Shared/classes.js +0 -3
- package/es/Shared/element-closest.js +2 -0
- package/es/Shared/index.js +0 -1
- package/es/Shared/layout/layout.js +24 -16
- package/es/Shared/toggle-classes.js +2 -0
- package/es/Sidebar.js +43 -53
- package/es/SidebarFooter.js +19 -29
- package/es/SidebarForm.js +19 -29
- package/es/SidebarHeader.js +19 -29
- package/es/SidebarMinimizer.js +30 -35
- package/es/SidebarNav.js +128 -162
- package/es/SidebarNav2.js +178 -202
- package/es/SidebarToggler.js +35 -36
- package/es/Switch.js +59 -62
- package/lib/Aside.js +51 -60
- package/lib/AsideToggler.js +58 -67
- package/lib/Breadcrumb.js +71 -77
- package/lib/Breadcrumb2.js +72 -79
- package/lib/Footer.js +40 -47
- package/lib/Header.js +39 -50
- package/lib/HeaderDropdown.js +36 -37
- package/lib/NavbarBrand.js +50 -56
- package/lib/Shared/classes.js +8 -6
- package/lib/Shared/element-closest.js +3 -1
- package/lib/Shared/index.js +2 -3
- package/lib/Shared/layout/layout.js +31 -19
- package/lib/Shared/toggle-classes.js +6 -2
- package/lib/Sidebar.js +69 -81
- package/lib/SidebarFooter.js +33 -42
- package/lib/SidebarForm.js +33 -42
- package/lib/SidebarHeader.js +33 -42
- package/lib/SidebarMinimizer.js +51 -55
- package/lib/SidebarNav.js +154 -187
- package/lib/SidebarNav2.js +211 -236
- package/lib/SidebarToggler.js +56 -58
- package/lib/Switch.js +90 -92
- package/lib/index.js +36 -55
- package/package.json +14 -14
- package/umd/main.d0f057e5.css +5 -0
- package/umd/main.d0f057e5.css.map +1 -0
- package/umd/{@coreui/react.js → react.js} +918 -1076
- package/umd/react.min.js +38 -0
- package/umd/react.min.js.map +1 -0
- package/umd/@coreui/react.min.js +0 -44
- package/umd/@coreui/react.min.js.map +0 -1
- package/umd/main.a93373b7.css +0 -148
- package/umd/main.a93373b7.css.map +0 -1
package/es/Footer.js
CHANGED
|
@@ -1,67 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
10
8
|
|
|
11
9
|
import React, { Component } from 'react';
|
|
12
10
|
import PropTypes from 'prop-types';
|
|
13
11
|
import classNames from 'classnames';
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
12
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
16
13
|
children: PropTypes.node,
|
|
17
14
|
className: PropTypes.string,
|
|
18
15
|
fixed: PropTypes.bool,
|
|
19
16
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
20
|
-
};
|
|
21
|
-
|
|
17
|
+
} : {};
|
|
22
18
|
var defaultProps = {
|
|
23
19
|
tag: 'footer',
|
|
24
20
|
fixed: false
|
|
25
21
|
};
|
|
26
22
|
|
|
27
|
-
var AppFooter = function (_Component) {
|
|
28
|
-
|
|
23
|
+
var AppFooter = /*#__PURE__*/function (_Component) {
|
|
24
|
+
_inheritsLoose(AppFooter, _Component);
|
|
29
25
|
|
|
30
26
|
function AppFooter(props) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
|
27
|
+
var _this;
|
|
34
28
|
|
|
35
|
-
_this
|
|
29
|
+
_this = _Component.call(this, props) || this;
|
|
30
|
+
_this.isFixed = _this.isFixed.bind(_assertThisInitialized(_this));
|
|
36
31
|
return _this;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
AppFooter.prototype
|
|
34
|
+
var _proto = AppFooter.prototype;
|
|
35
|
+
|
|
36
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
40
37
|
this.isFixed(this.props.fixed);
|
|
41
38
|
};
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
44
41
|
if (fixed) {
|
|
45
42
|
document.body.classList.add('footer-fixed');
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
className =
|
|
52
|
-
children =
|
|
53
|
-
Tag =
|
|
54
|
-
attributes =
|
|
46
|
+
_proto.render = function render() {
|
|
47
|
+
var _this$props = this.props,
|
|
48
|
+
className = _this$props.className,
|
|
49
|
+
children = _this$props.children,
|
|
50
|
+
Tag = _this$props.tag,
|
|
51
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
55
52
|
|
|
56
53
|
delete attributes.fixed;
|
|
57
|
-
|
|
58
54
|
var classes = classNames(className, 'app-footer');
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
_extends({ className: classes }, attributes),
|
|
63
|
-
children
|
|
64
|
-
);
|
|
55
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
56
|
+
className: classes
|
|
57
|
+
}, attributes), children);
|
|
65
58
|
};
|
|
66
59
|
|
|
67
60
|
return AppFooter;
|
|
@@ -69,5 +62,4 @@ var AppFooter = function (_Component) {
|
|
|
69
62
|
|
|
70
63
|
AppFooter.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
71
64
|
AppFooter.defaultProps = defaultProps;
|
|
72
|
-
|
|
73
65
|
export default AppFooter;
|
package/es/Header.js
CHANGED
|
@@ -1,68 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
10
6
|
|
|
11
7
|
import React, { Component } from 'react';
|
|
12
8
|
import PropTypes from 'prop-types';
|
|
13
9
|
import classNames from 'classnames';
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
10
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
16
11
|
children: PropTypes.node,
|
|
17
12
|
className: PropTypes.string,
|
|
18
13
|
fixed: PropTypes.bool,
|
|
19
14
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
20
|
-
};
|
|
21
|
-
|
|
15
|
+
} : {};
|
|
22
16
|
var defaultProps = {
|
|
23
17
|
tag: 'header',
|
|
24
18
|
fixed: false
|
|
25
19
|
};
|
|
26
20
|
|
|
27
|
-
var AppHeader = function (_Component) {
|
|
28
|
-
|
|
21
|
+
var AppHeader = /*#__PURE__*/function (_Component) {
|
|
22
|
+
_inheritsLoose(AppHeader, _Component);
|
|
29
23
|
|
|
30
24
|
function AppHeader() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
25
|
+
return _Component.apply(this, arguments) || this;
|
|
34
26
|
}
|
|
35
27
|
|
|
36
|
-
AppHeader.prototype
|
|
28
|
+
var _proto = AppHeader.prototype;
|
|
29
|
+
|
|
30
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
37
31
|
this.isFixed(this.props.fixed);
|
|
38
32
|
};
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
41
35
|
if (fixed) {
|
|
42
36
|
document.body.classList.add('header-fixed');
|
|
43
37
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// breakpoint(breakpoint) {
|
|
38
|
+
} // breakpoint(breakpoint) {
|
|
47
39
|
// return breakpoint || '';
|
|
48
40
|
// }
|
|
41
|
+
;
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
className =
|
|
53
|
-
children =
|
|
54
|
-
Tag =
|
|
55
|
-
attributes =
|
|
43
|
+
_proto.render = function render() {
|
|
44
|
+
var _this$props = this.props,
|
|
45
|
+
className = _this$props.className,
|
|
46
|
+
children = _this$props.children,
|
|
47
|
+
Tag = _this$props.tag,
|
|
48
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
56
49
|
|
|
57
50
|
delete attributes.fixed;
|
|
58
|
-
|
|
59
51
|
var classes = classNames(className, 'app-header', 'navbar');
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_extends({ className: classes }, attributes),
|
|
64
|
-
children
|
|
65
|
-
);
|
|
52
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
53
|
+
className: classes
|
|
54
|
+
}, attributes), children);
|
|
66
55
|
};
|
|
67
56
|
|
|
68
57
|
return AppHeader;
|
|
@@ -70,5 +59,4 @@ var AppHeader = function (_Component) {
|
|
|
70
59
|
|
|
71
60
|
AppHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
72
61
|
AppHeader.defaultProps = defaultProps;
|
|
73
|
-
|
|
74
62
|
export default AppHeader;
|
package/es/HeaderDropdown.js
CHANGED
|
@@ -1,57 +1,54 @@
|
|
|
1
|
-
var
|
|
1
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
7
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
8
|
|
|
11
9
|
import React, { Component } from 'react';
|
|
12
10
|
import { Dropdown } from 'reactstrap';
|
|
13
11
|
import PropTypes from 'prop-types';
|
|
14
|
-
|
|
15
|
-
var propTypes = _extends({
|
|
12
|
+
var propTypes = process.env.NODE_ENV !== "production" ? _extends({
|
|
16
13
|
children: PropTypes.node,
|
|
17
14
|
direction: PropTypes.string
|
|
18
|
-
}, Dropdown.propTypes);
|
|
19
|
-
|
|
15
|
+
}, Dropdown.propTypes) : {};
|
|
20
16
|
var defaultProps = {
|
|
21
17
|
direction: 'down'
|
|
22
18
|
};
|
|
23
19
|
|
|
24
|
-
var AppHeaderDropdown = function (_Component) {
|
|
25
|
-
|
|
20
|
+
var AppHeaderDropdown = /*#__PURE__*/function (_Component) {
|
|
21
|
+
_inheritsLoose(AppHeaderDropdown, _Component);
|
|
26
22
|
|
|
27
23
|
function AppHeaderDropdown(props) {
|
|
28
|
-
|
|
24
|
+
var _this;
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_this.toggle = _this.toggle.bind(_this);
|
|
26
|
+
_this = _Component.call(this, props) || this;
|
|
27
|
+
_this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
|
33
28
|
_this.state = {
|
|
34
29
|
dropdownOpen: false
|
|
35
30
|
};
|
|
36
31
|
return _this;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
AppHeaderDropdown.prototype
|
|
34
|
+
var _proto = AppHeaderDropdown.prototype;
|
|
35
|
+
|
|
36
|
+
_proto.toggle = function toggle() {
|
|
40
37
|
this.setState({
|
|
41
38
|
dropdownOpen: !this.state.dropdownOpen
|
|
42
39
|
});
|
|
43
40
|
};
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
children =
|
|
48
|
-
attributes =
|
|
42
|
+
_proto.render = function render() {
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
children = _this$props.children,
|
|
45
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["children"]);
|
|
49
46
|
|
|
50
|
-
return React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
47
|
+
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
48
|
+
nav: true,
|
|
49
|
+
isOpen: this.state.dropdownOpen,
|
|
50
|
+
toggle: this.toggle
|
|
51
|
+
}, attributes), children);
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
return AppHeaderDropdown;
|
|
@@ -59,5 +56,4 @@ var AppHeaderDropdown = function (_Component) {
|
|
|
59
56
|
|
|
60
57
|
AppHeaderDropdown.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
61
58
|
AppHeaderDropdown.defaultProps = defaultProps;
|
|
62
|
-
|
|
63
59
|
export default AppHeaderDropdown;
|
package/es/NavbarBrand.js
CHANGED
|
@@ -1,57 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
10
6
|
|
|
11
7
|
import React, { Component } from 'react';
|
|
12
8
|
import PropTypes from 'prop-types';
|
|
13
9
|
import classNames from 'classnames';
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
10
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
16
11
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
17
12
|
children: PropTypes.node,
|
|
18
13
|
className: PropTypes.string,
|
|
19
14
|
brand: PropTypes.any,
|
|
20
15
|
full: PropTypes.any,
|
|
21
16
|
minimized: PropTypes.any
|
|
22
|
-
};
|
|
23
|
-
|
|
17
|
+
} : {};
|
|
24
18
|
var defaultProps = {
|
|
25
19
|
tag: 'a'
|
|
26
20
|
};
|
|
27
21
|
|
|
28
|
-
var AppNavbarBrand = function (_Component) {
|
|
29
|
-
|
|
22
|
+
var AppNavbarBrand = /*#__PURE__*/function (_Component) {
|
|
23
|
+
_inheritsLoose(AppNavbarBrand, _Component);
|
|
30
24
|
|
|
31
25
|
function AppNavbarBrand() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
26
|
+
return _Component.apply(this, arguments) || this;
|
|
35
27
|
}
|
|
36
28
|
|
|
37
|
-
AppNavbarBrand.prototype
|
|
29
|
+
var _proto = AppNavbarBrand.prototype;
|
|
30
|
+
|
|
31
|
+
_proto.imgSrc = function imgSrc(brand) {
|
|
38
32
|
return brand.src ? brand.src : '';
|
|
39
33
|
};
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
_proto.imgWidth = function imgWidth(brand) {
|
|
42
36
|
return brand.width ? brand.width : 'auto';
|
|
43
37
|
};
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
_proto.imgHeight = function imgHeight(brand) {
|
|
46
40
|
return brand.height ? brand.height : 'auto';
|
|
47
41
|
};
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
_proto.imgAlt = function imgAlt(brand) {
|
|
50
44
|
return brand.alt ? brand.alt : '';
|
|
51
45
|
};
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
return React.createElement(
|
|
47
|
+
_proto.navbarBrandImg = function navbarBrandImg(props, classBrand, key) {
|
|
48
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
55
49
|
src: this.imgSrc(props),
|
|
56
50
|
width: this.imgWidth(props),
|
|
57
51
|
height: this.imgHeight(props),
|
|
@@ -61,37 +55,37 @@ var AppNavbarBrand = function (_Component) {
|
|
|
61
55
|
});
|
|
62
56
|
};
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
className =
|
|
67
|
-
children =
|
|
68
|
-
Tag =
|
|
69
|
-
attributes =
|
|
58
|
+
_proto.render = function render() {
|
|
59
|
+
var _this$props = this.props,
|
|
60
|
+
className = _this$props.className,
|
|
61
|
+
children = _this$props.children,
|
|
62
|
+
Tag = _this$props.tag,
|
|
63
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
70
64
|
|
|
71
65
|
var classes = classNames(className, 'navbar-brand');
|
|
72
|
-
|
|
73
66
|
var img = [];
|
|
67
|
+
|
|
74
68
|
if (this.props.brand) {
|
|
75
69
|
var props = this.props.brand;
|
|
76
70
|
var classBrand = 'navbar-brand';
|
|
77
71
|
img.push(this.navbarBrandImg(props, classBrand, img.length + 1));
|
|
78
72
|
}
|
|
73
|
+
|
|
79
74
|
if (this.props.full) {
|
|
80
|
-
var
|
|
75
|
+
var _props = this.props.full;
|
|
81
76
|
var _classBrand = 'navbar-brand-full';
|
|
82
|
-
img.push(this.navbarBrandImg(
|
|
77
|
+
img.push(this.navbarBrandImg(_props, _classBrand, img.length + 1));
|
|
83
78
|
}
|
|
79
|
+
|
|
84
80
|
if (this.props.minimized) {
|
|
85
|
-
var
|
|
81
|
+
var _props2 = this.props.minimized;
|
|
86
82
|
var _classBrand2 = 'navbar-brand-minimized';
|
|
87
|
-
img.push(this.navbarBrandImg(
|
|
83
|
+
img.push(this.navbarBrandImg(_props2, _classBrand2, img.length + 1));
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
return React.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
children || img
|
|
94
|
-
);
|
|
86
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({}, attributes, {
|
|
87
|
+
className: classes
|
|
88
|
+
}), children || img);
|
|
95
89
|
};
|
|
96
90
|
|
|
97
91
|
return AppNavbarBrand;
|
|
@@ -99,5 +93,4 @@ var AppNavbarBrand = function (_Component) {
|
|
|
99
93
|
|
|
100
94
|
AppNavbarBrand.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
101
95
|
AppNavbarBrand.defaultProps = defaultProps;
|
|
102
|
-
|
|
103
96
|
export default AppNavbarBrand;
|
package/es/Shared/classes.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export var sidebarCssClasses = ['sidebar-show', 'sidebar-sm-show', 'sidebar-md-show', 'sidebar-lg-show', 'sidebar-xl-show'];
|
|
2
|
-
|
|
3
2
|
export var asideMenuCssClasses = ['aside-menu-show', 'aside-menu-sm-show', 'aside-menu-md-show', 'aside-menu-lg-show', 'aside-menu-xl-show'];
|
|
4
|
-
|
|
5
3
|
export var validBreakpoints = ['sm', 'md', 'lg', 'xl'];
|
|
6
|
-
|
|
7
4
|
export function checkBreakpoint(breakpoint, list) {
|
|
8
5
|
return list.indexOf(breakpoint) > -1;
|
|
9
6
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
if (!ElementProto) {
|
|
3
3
|
return;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
if (typeof ElementProto.matches !== 'function') {
|
|
6
7
|
ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
|
|
7
8
|
var element = this;
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
if (element.matches(selector)) {
|
|
25
26
|
return element;
|
|
26
27
|
}
|
|
28
|
+
|
|
27
29
|
element = element.parentNode;
|
|
28
30
|
}
|
|
29
31
|
|
package/es/Shared/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var LayoutHelper = (_temp = _class = function () {
|
|
6
|
-
function LayoutHelper() {
|
|
7
|
-
_classCallCheck(this, LayoutHelper);
|
|
8
|
-
}
|
|
3
|
+
var LayoutHelper = /*#__PURE__*/function () {
|
|
4
|
+
function LayoutHelper() {}
|
|
9
5
|
|
|
10
6
|
LayoutHelper.sidebarToggle = function sidebarToggle(toggle) {
|
|
11
7
|
var minimize = arguments.length ? toggle : !this.elClassList.contains('sidebar-minimized');
|
|
12
8
|
this.sidebarMinimize(minimize);
|
|
13
9
|
this.brandMinimize(minimize);
|
|
14
|
-
this.sidebarPSToggle(!minimize);
|
|
10
|
+
this.sidebarPSToggle(!minimize);
|
|
11
|
+
/*remove PS on sidebar minimized*/
|
|
15
12
|
};
|
|
16
13
|
|
|
17
14
|
LayoutHelper.sidebarMinimize = function sidebarMinimize(force) {
|
|
@@ -20,13 +17,10 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
20
17
|
|
|
21
18
|
LayoutHelper.brandMinimize = function brandMinimize(force) {
|
|
22
19
|
this.toggleClass('brand-minimized', force);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// sidebar perfect scrollbar ugly hack
|
|
26
|
-
|
|
20
|
+
} // sidebar perfect scrollbar ugly hack
|
|
21
|
+
;
|
|
27
22
|
|
|
28
23
|
LayoutHelper.sidebarPSToggle = function sidebarPSToggle(toggle) {
|
|
29
|
-
|
|
30
24
|
if (this.isOnMobile()) {
|
|
31
25
|
toggle = true;
|
|
32
26
|
} else {
|
|
@@ -34,18 +28,25 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
34
28
|
toggle = !isSidebarMinimized;
|
|
35
29
|
}
|
|
36
30
|
|
|
37
|
-
var ps = {
|
|
31
|
+
var ps = {
|
|
32
|
+
y: {
|
|
33
|
+
rail: {},
|
|
34
|
+
thumb: {}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
38
37
|
var isRtl = getComputedStyle(document.documentElement).direction === 'rtl';
|
|
39
38
|
var sidebar = document.querySelector('.sidebar-nav');
|
|
40
39
|
ps.y.rail.on = document.querySelector('.sidebar-nav .ps__rail-y');
|
|
41
40
|
ps.y.rail.off = document.querySelector('.sidebar-nav .ps__rail-y-off');
|
|
42
41
|
ps.y.thumb.on = document.querySelector('.sidebar-nav .ps__thumb-y');
|
|
43
42
|
ps.y.thumb.off = document.querySelector('.sidebar-nav .ps__thumb-y-off');
|
|
43
|
+
|
|
44
44
|
if (sidebar) {
|
|
45
45
|
if (toggle) {
|
|
46
46
|
sidebar.classList.add('ps');
|
|
47
47
|
sidebar.classList.add('ps-container');
|
|
48
48
|
sidebar.classList.add('ps--active-y');
|
|
49
|
+
|
|
49
50
|
if (ps.y.rail.off) {
|
|
50
51
|
ps.y.rail.off.classList.add('ps__rail-y');
|
|
51
52
|
ps.y.rail.off.removeAttribute('style');
|
|
@@ -53,6 +54,7 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
53
54
|
ps.y.rail.off.style.right = isRtl ? 'unset' : '0px';
|
|
54
55
|
ps.y.rail.off.classList.remove('ps__rail-y-off');
|
|
55
56
|
}
|
|
57
|
+
|
|
56
58
|
if (ps.y.thumb.off) {
|
|
57
59
|
ps.y.thumb.off.removeAttribute('style');
|
|
58
60
|
ps.y.thumb.off.classList.add('ps__thumb-y');
|
|
@@ -64,11 +66,13 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
64
66
|
ps.y.rail.on.removeAttribute('style');
|
|
65
67
|
ps.y.rail.on.classList.remove('ps__rail-y');
|
|
66
68
|
}
|
|
69
|
+
|
|
67
70
|
if (ps.y.thumb.on) {
|
|
68
71
|
ps.y.thumb.on.classList.add('ps__thumb-y-off');
|
|
69
72
|
ps.y.thumb.on.removeAttribute('style');
|
|
70
73
|
ps.y.thumb.on.classList.remove('ps__thumb-y');
|
|
71
74
|
}
|
|
75
|
+
|
|
72
76
|
sidebar.classList.remove('ps');
|
|
73
77
|
sidebar.classList.remove('ps-container');
|
|
74
78
|
sidebar.classList.remove('ps--active-y');
|
|
@@ -77,7 +81,6 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
LayoutHelper.toggleClass = function toggleClass(className, force) {
|
|
80
|
-
|
|
81
84
|
if (force === true) {
|
|
82
85
|
this.elClassList.add(className);
|
|
83
86
|
} else if (force === false) {
|
|
@@ -85,13 +88,16 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
85
88
|
} else {
|
|
86
89
|
this.elClassList.toggle(className);
|
|
87
90
|
}
|
|
91
|
+
|
|
88
92
|
return this.elClassList.contains(className);
|
|
89
93
|
};
|
|
90
94
|
|
|
91
95
|
LayoutHelper.isOnMobile = function isOnMobile() {
|
|
92
96
|
var onMobile = false;
|
|
97
|
+
|
|
93
98
|
try {
|
|
94
99
|
var minimizerElement = document.querySelector('.sidebar-minimizer');
|
|
100
|
+
|
|
95
101
|
if (minimizerElement) {
|
|
96
102
|
onMobile = getComputedStyle(minimizerElement).getPropertyValue('display') === 'none';
|
|
97
103
|
} else {
|
|
@@ -102,11 +108,13 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
102
108
|
// eslint-disable-next-line
|
|
103
109
|
console.warn('CoreUI isOnMobile failed to getComputedStyle', ignore);
|
|
104
110
|
}
|
|
111
|
+
|
|
105
112
|
return onMobile;
|
|
106
113
|
};
|
|
107
114
|
|
|
108
115
|
return LayoutHelper;
|
|
109
|
-
}()
|
|
116
|
+
}();
|
|
110
117
|
|
|
118
|
+
_defineProperty(LayoutHelper, "elClassList", document.body.classList);
|
|
111
119
|
|
|
112
120
|
export default LayoutHelper;
|
|
@@ -4,6 +4,7 @@ export default function toggleClasses(toggleClass, classList, force) {
|
|
|
4
4
|
removeClassList.map(function (className) {
|
|
5
5
|
return document.body.classList.remove(className);
|
|
6
6
|
});
|
|
7
|
+
|
|
7
8
|
if (force === true) {
|
|
8
9
|
document.body.classList.add(toggleClass);
|
|
9
10
|
} else if (force === false) {
|
|
@@ -11,5 +12,6 @@ export default function toggleClasses(toggleClass, classList, force) {
|
|
|
11
12
|
} else {
|
|
12
13
|
document.body.classList.toggle(toggleClass);
|
|
13
14
|
}
|
|
15
|
+
|
|
14
16
|
return document.body.classList.contains(toggleClass);
|
|
15
17
|
}
|