@coreui/react 2.5.4 → 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 +32 -0
- package/css/scrollbar.css +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 +75 -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 +249 -174
- 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 +82 -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 +275 -198
- package/lib/SidebarToggler.js +56 -58
- package/lib/Switch.js +90 -92
- package/lib/index.js +36 -55
- package/package.json +21 -20
- package/umd/main.d0f057e5.css +5 -0
- package/umd/main.d0f057e5.css.map +1 -0
- package/umd/react.js +6069 -0
- package/umd/react.min.js +38 -0
- package/umd/react.min.js.map +1 -0
- package/umd/@coreui/react.js +0 -11849
- package/umd/@coreui/react.min.js +0 -77
- package/umd/@coreui/react.min.js.map +0 -1
- package/umd/main.a25994ba.css +0 -129
- package/umd/main.a25994ba.css.map +0 -1
package/lib/Header.js
CHANGED
|
@@ -1,82 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
4
5
|
|
|
5
|
-
var
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
13
|
|
|
13
|
-
var
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
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); }
|
|
18
19
|
|
|
19
|
-
function
|
|
20
|
+
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; }
|
|
20
21
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
-
|
|
25
|
-
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; }
|
|
26
|
-
|
|
27
|
-
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; }
|
|
28
|
-
|
|
29
|
-
var propTypes = {
|
|
30
|
-
children: _propTypes2.default.node,
|
|
31
|
-
className: _propTypes2.default.string,
|
|
32
|
-
fixed: _propTypes2.default.bool,
|
|
33
|
-
tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string])
|
|
34
|
-
};
|
|
22
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
35
23
|
|
|
24
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
25
|
+
children: _propTypes["default"].node,
|
|
26
|
+
className: _propTypes["default"].string,
|
|
27
|
+
fixed: _propTypes["default"].bool,
|
|
28
|
+
tag: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].string])
|
|
29
|
+
} : {};
|
|
36
30
|
var defaultProps = {
|
|
37
31
|
tag: 'header',
|
|
38
32
|
fixed: false
|
|
39
33
|
};
|
|
40
34
|
|
|
41
|
-
var AppHeader = function (_Component) {
|
|
42
|
-
|
|
35
|
+
var AppHeader = /*#__PURE__*/function (_Component) {
|
|
36
|
+
_inheritsLoose(AppHeader, _Component);
|
|
43
37
|
|
|
44
38
|
function AppHeader() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
39
|
+
return _Component.apply(this, arguments) || this;
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
AppHeader.prototype
|
|
42
|
+
var _proto = AppHeader.prototype;
|
|
43
|
+
|
|
44
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
51
45
|
this.isFixed(this.props.fixed);
|
|
52
46
|
};
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
55
49
|
if (fixed) {
|
|
56
50
|
document.body.classList.add('header-fixed');
|
|
57
51
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// breakpoint(breakpoint) {
|
|
52
|
+
} // breakpoint(breakpoint) {
|
|
61
53
|
// return breakpoint || '';
|
|
62
54
|
// }
|
|
55
|
+
;
|
|
63
56
|
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
className =
|
|
67
|
-
children =
|
|
68
|
-
Tag =
|
|
69
|
-
attributes =
|
|
57
|
+
_proto.render = function render() {
|
|
58
|
+
var _this$props = this.props,
|
|
59
|
+
className = _this$props.className,
|
|
60
|
+
children = _this$props.children,
|
|
61
|
+
Tag = _this$props.tag,
|
|
62
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
70
63
|
|
|
71
64
|
delete attributes.fixed;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Tag,
|
|
77
|
-
_extends({ className: classes }, attributes),
|
|
78
|
-
children
|
|
79
|
-
);
|
|
65
|
+
var classes = (0, _classnames["default"])(className, 'app-header', 'navbar');
|
|
66
|
+
return /*#__PURE__*/_react["default"].createElement(Tag, _extends({
|
|
67
|
+
className: classes
|
|
68
|
+
}, attributes), children);
|
|
80
69
|
};
|
|
81
70
|
|
|
82
71
|
return AppHeader;
|
|
@@ -84,6 +73,6 @@ var AppHeader = function (_Component) {
|
|
|
84
73
|
|
|
85
74
|
AppHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
86
75
|
AppHeader.defaultProps = defaultProps;
|
|
87
|
-
|
|
88
|
-
exports
|
|
89
|
-
module.exports = exports
|
|
76
|
+
var _default = AppHeader;
|
|
77
|
+
exports["default"] = _default;
|
|
78
|
+
module.exports = exports.default;
|
package/lib/HeaderDropdown.js
CHANGED
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
4
5
|
|
|
5
|
-
var
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var _reactstrap = require("reactstrap");
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
13
|
|
|
13
|
-
var
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
17
|
|
|
17
|
-
function
|
|
18
|
+
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; }
|
|
18
19
|
|
|
19
|
-
function
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
21
|
|
|
21
|
-
function
|
|
22
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
22
23
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
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; }
|
|
26
|
-
|
|
27
|
-
var propTypes = _extends({
|
|
28
|
-
children: _propTypes2.default.node,
|
|
29
|
-
direction: _propTypes2.default.string
|
|
30
|
-
}, _reactstrap.Dropdown.propTypes);
|
|
24
|
+
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); }
|
|
31
25
|
|
|
26
|
+
var propTypes = process.env.NODE_ENV !== "production" ? _extends({
|
|
27
|
+
children: _propTypes["default"].node,
|
|
28
|
+
direction: _propTypes["default"].string
|
|
29
|
+
}, _reactstrap.Dropdown.propTypes) : {};
|
|
32
30
|
var defaultProps = {
|
|
33
31
|
direction: 'down'
|
|
34
32
|
};
|
|
35
33
|
|
|
36
|
-
var AppHeaderDropdown = function (_Component) {
|
|
37
|
-
|
|
34
|
+
var AppHeaderDropdown = /*#__PURE__*/function (_Component) {
|
|
35
|
+
_inheritsLoose(AppHeaderDropdown, _Component);
|
|
38
36
|
|
|
39
37
|
function AppHeaderDropdown(props) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
|
38
|
+
var _this;
|
|
43
39
|
|
|
44
|
-
_this
|
|
40
|
+
_this = _Component.call(this, props) || this;
|
|
41
|
+
_this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
|
45
42
|
_this.state = {
|
|
46
43
|
dropdownOpen: false
|
|
47
44
|
};
|
|
48
45
|
return _this;
|
|
49
46
|
}
|
|
50
47
|
|
|
51
|
-
AppHeaderDropdown.prototype
|
|
48
|
+
var _proto = AppHeaderDropdown.prototype;
|
|
49
|
+
|
|
50
|
+
_proto.toggle = function toggle() {
|
|
52
51
|
this.setState({
|
|
53
52
|
dropdownOpen: !this.state.dropdownOpen
|
|
54
53
|
});
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
children =
|
|
60
|
-
attributes =
|
|
56
|
+
_proto.render = function render() {
|
|
57
|
+
var _this$props = this.props,
|
|
58
|
+
children = _this$props.children,
|
|
59
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["children"]);
|
|
61
60
|
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
61
|
+
return /*#__PURE__*/_react["default"].createElement(_reactstrap.Dropdown, _extends({
|
|
62
|
+
nav: true,
|
|
63
|
+
isOpen: this.state.dropdownOpen,
|
|
64
|
+
toggle: this.toggle
|
|
65
|
+
}, attributes), children);
|
|
67
66
|
};
|
|
68
67
|
|
|
69
68
|
return AppHeaderDropdown;
|
|
@@ -71,6 +70,6 @@ var AppHeaderDropdown = function (_Component) {
|
|
|
71
70
|
|
|
72
71
|
AppHeaderDropdown.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
73
72
|
AppHeaderDropdown.defaultProps = defaultProps;
|
|
74
|
-
|
|
75
|
-
exports
|
|
76
|
-
module.exports = exports
|
|
73
|
+
var _default = AppHeaderDropdown;
|
|
74
|
+
exports["default"] = _default;
|
|
75
|
+
module.exports = exports.default;
|
package/lib/NavbarBrand.js
CHANGED
|
@@ -1,71 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
4
5
|
|
|
5
|
-
var
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
13
|
|
|
13
|
-
var
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
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); }
|
|
18
19
|
|
|
19
|
-
function
|
|
20
|
+
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; }
|
|
20
21
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
-
|
|
25
|
-
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; }
|
|
26
|
-
|
|
27
|
-
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; }
|
|
28
|
-
|
|
29
|
-
var propTypes = {
|
|
30
|
-
tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]),
|
|
31
|
-
children: _propTypes2.default.node,
|
|
32
|
-
className: _propTypes2.default.string,
|
|
33
|
-
brand: _propTypes2.default.any,
|
|
34
|
-
full: _propTypes2.default.any,
|
|
35
|
-
minimized: _propTypes2.default.any
|
|
36
|
-
};
|
|
22
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
37
23
|
|
|
24
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
25
|
+
tag: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].string]),
|
|
26
|
+
children: _propTypes["default"].node,
|
|
27
|
+
className: _propTypes["default"].string,
|
|
28
|
+
brand: _propTypes["default"].any,
|
|
29
|
+
full: _propTypes["default"].any,
|
|
30
|
+
minimized: _propTypes["default"].any
|
|
31
|
+
} : {};
|
|
38
32
|
var defaultProps = {
|
|
39
33
|
tag: 'a'
|
|
40
34
|
};
|
|
41
35
|
|
|
42
|
-
var AppNavbarBrand = function (_Component) {
|
|
43
|
-
|
|
36
|
+
var AppNavbarBrand = /*#__PURE__*/function (_Component) {
|
|
37
|
+
_inheritsLoose(AppNavbarBrand, _Component);
|
|
44
38
|
|
|
45
39
|
function AppNavbarBrand() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
40
|
+
return _Component.apply(this, arguments) || this;
|
|
49
41
|
}
|
|
50
42
|
|
|
51
|
-
AppNavbarBrand.prototype
|
|
43
|
+
var _proto = AppNavbarBrand.prototype;
|
|
44
|
+
|
|
45
|
+
_proto.imgSrc = function imgSrc(brand) {
|
|
52
46
|
return brand.src ? brand.src : '';
|
|
53
47
|
};
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
_proto.imgWidth = function imgWidth(brand) {
|
|
56
50
|
return brand.width ? brand.width : 'auto';
|
|
57
51
|
};
|
|
58
52
|
|
|
59
|
-
|
|
53
|
+
_proto.imgHeight = function imgHeight(brand) {
|
|
60
54
|
return brand.height ? brand.height : 'auto';
|
|
61
55
|
};
|
|
62
56
|
|
|
63
|
-
|
|
57
|
+
_proto.imgAlt = function imgAlt(brand) {
|
|
64
58
|
return brand.alt ? brand.alt : '';
|
|
65
59
|
};
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
return
|
|
61
|
+
_proto.navbarBrandImg = function navbarBrandImg(props, classBrand, key) {
|
|
62
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
69
63
|
src: this.imgSrc(props),
|
|
70
64
|
width: this.imgWidth(props),
|
|
71
65
|
height: this.imgHeight(props),
|
|
@@ -75,37 +69,37 @@ var AppNavbarBrand = function (_Component) {
|
|
|
75
69
|
});
|
|
76
70
|
};
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
var
|
|
80
|
-
className =
|
|
81
|
-
children =
|
|
82
|
-
Tag =
|
|
83
|
-
attributes =
|
|
84
|
-
|
|
85
|
-
var classes = (0, _classnames2.default)(className, 'navbar-brand');
|
|
72
|
+
_proto.render = function render() {
|
|
73
|
+
var _this$props = this.props,
|
|
74
|
+
className = _this$props.className,
|
|
75
|
+
children = _this$props.children,
|
|
76
|
+
Tag = _this$props.tag,
|
|
77
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
86
78
|
|
|
79
|
+
var classes = (0, _classnames["default"])(className, 'navbar-brand');
|
|
87
80
|
var img = [];
|
|
81
|
+
|
|
88
82
|
if (this.props.brand) {
|
|
89
83
|
var props = this.props.brand;
|
|
90
84
|
var classBrand = 'navbar-brand';
|
|
91
85
|
img.push(this.navbarBrandImg(props, classBrand, img.length + 1));
|
|
92
86
|
}
|
|
87
|
+
|
|
93
88
|
if (this.props.full) {
|
|
94
|
-
var
|
|
89
|
+
var _props = this.props.full;
|
|
95
90
|
var _classBrand = 'navbar-brand-full';
|
|
96
|
-
img.push(this.navbarBrandImg(
|
|
91
|
+
img.push(this.navbarBrandImg(_props, _classBrand, img.length + 1));
|
|
97
92
|
}
|
|
93
|
+
|
|
98
94
|
if (this.props.minimized) {
|
|
99
|
-
var
|
|
95
|
+
var _props2 = this.props.minimized;
|
|
100
96
|
var _classBrand2 = 'navbar-brand-minimized';
|
|
101
|
-
img.push(this.navbarBrandImg(
|
|
97
|
+
img.push(this.navbarBrandImg(_props2, _classBrand2, img.length + 1));
|
|
102
98
|
}
|
|
103
99
|
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
children || img
|
|
108
|
-
);
|
|
100
|
+
return /*#__PURE__*/_react["default"].createElement(Tag, _extends({}, attributes, {
|
|
101
|
+
className: classes
|
|
102
|
+
}), children || img);
|
|
109
103
|
};
|
|
110
104
|
|
|
111
105
|
return AppNavbarBrand;
|
|
@@ -113,6 +107,6 @@ var AppNavbarBrand = function (_Component) {
|
|
|
113
107
|
|
|
114
108
|
AppNavbarBrand.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
115
109
|
AppNavbarBrand.defaultProps = defaultProps;
|
|
116
|
-
|
|
117
|
-
exports
|
|
118
|
-
module.exports = exports
|
|
110
|
+
var _default = AppNavbarBrand;
|
|
111
|
+
exports["default"] = _default;
|
|
112
|
+
module.exports = exports.default;
|
package/lib/Shared/classes.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.checkBreakpoint = checkBreakpoint;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
exports.validBreakpoints = exports.asideMenuCssClasses = exports.sidebarCssClasses = void 0;
|
|
6
|
+
var sidebarCssClasses = ['sidebar-show', 'sidebar-sm-show', 'sidebar-md-show', 'sidebar-lg-show', 'sidebar-xl-show'];
|
|
7
|
+
exports.sidebarCssClasses = sidebarCssClasses;
|
|
8
|
+
var asideMenuCssClasses = ['aside-menu-show', 'aside-menu-sm-show', 'aside-menu-md-show', 'aside-menu-lg-show', 'aside-menu-xl-show'];
|
|
9
|
+
exports.asideMenuCssClasses = asideMenuCssClasses;
|
|
10
|
+
var validBreakpoints = ['sm', 'md', 'lg', 'xl'];
|
|
11
|
+
exports.validBreakpoints = validBreakpoints;
|
|
10
12
|
|
|
11
13
|
function checkBreakpoint(breakpoint, list) {
|
|
12
14
|
return list.indexOf(breakpoint) > -1;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
(function (ElementProto) {
|
|
4
4
|
if (!ElementProto) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
if (typeof ElementProto.matches !== 'function') {
|
|
8
9
|
ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
|
|
9
10
|
var element = this;
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
if (element.matches(selector)) {
|
|
27
28
|
return element;
|
|
28
29
|
}
|
|
30
|
+
|
|
29
31
|
element = element.parentNode;
|
|
30
32
|
}
|
|
31
33
|
|
package/lib/Shared/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.checkBreakpoint = exports.validBreakpoints = exports.asideMenuCssClasses = exports.sidebarCssClasses = undefined;
|
|
5
4
|
|
|
6
|
-
var _classes = require(
|
|
5
|
+
var _classes = require("./classes");
|
|
7
6
|
|
|
8
7
|
exports.sidebarCssClasses = _classes.sidebarCssClasses;
|
|
9
8
|
exports.asideMenuCssClasses = _classes.asideMenuCssClasses;
|
|
@@ -1,44 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
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; }
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var LayoutHelper = (_temp = _class = function () {
|
|
10
|
-
function LayoutHelper() {
|
|
11
|
-
_classCallCheck(this, LayoutHelper);
|
|
12
|
-
}
|
|
8
|
+
var LayoutHelper = /*#__PURE__*/function () {
|
|
9
|
+
function LayoutHelper() {}
|
|
13
10
|
|
|
14
11
|
LayoutHelper.sidebarToggle = function sidebarToggle(toggle) {
|
|
15
12
|
var minimize = arguments.length ? toggle : !this.elClassList.contains('sidebar-minimized');
|
|
16
13
|
this.sidebarMinimize(minimize);
|
|
17
14
|
this.brandMinimize(minimize);
|
|
18
|
-
this.sidebarPSToggle(!minimize);
|
|
15
|
+
this.sidebarPSToggle(!minimize);
|
|
16
|
+
/*remove PS on sidebar minimized*/
|
|
19
17
|
};
|
|
20
18
|
|
|
21
19
|
LayoutHelper.sidebarMinimize = function sidebarMinimize(force) {
|
|
22
|
-
// return this.elClassList.toggle('sidebar-minimized', force);
|
|
23
20
|
return this.toggleClass('sidebar-minimized', force);
|
|
24
21
|
};
|
|
25
22
|
|
|
26
23
|
LayoutHelper.brandMinimize = function brandMinimize(force) {
|
|
27
|
-
// this.elClassList.toggle('brand-minimized', force);
|
|
28
24
|
this.toggleClass('brand-minimized', force);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// sidebar perfect scrollbar
|
|
32
|
-
|
|
25
|
+
} // sidebar perfect scrollbar ugly hack
|
|
26
|
+
;
|
|
33
27
|
|
|
34
28
|
LayoutHelper.sidebarPSToggle = function sidebarPSToggle(toggle) {
|
|
29
|
+
if (this.isOnMobile()) {
|
|
30
|
+
toggle = true;
|
|
31
|
+
} else {
|
|
32
|
+
var isSidebarMinimized = document.body.classList.contains('sidebar-minimized') || false;
|
|
33
|
+
toggle = !isSidebarMinimized;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var ps = {
|
|
37
|
+
y: {
|
|
38
|
+
rail: {},
|
|
39
|
+
thumb: {}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var isRtl = getComputedStyle(document.documentElement).direction === 'rtl';
|
|
35
43
|
var sidebar = document.querySelector('.sidebar-nav');
|
|
44
|
+
ps.y.rail.on = document.querySelector('.sidebar-nav .ps__rail-y');
|
|
45
|
+
ps.y.rail.off = document.querySelector('.sidebar-nav .ps__rail-y-off');
|
|
46
|
+
ps.y.thumb.on = document.querySelector('.sidebar-nav .ps__thumb-y');
|
|
47
|
+
ps.y.thumb.off = document.querySelector('.sidebar-nav .ps__thumb-y-off');
|
|
48
|
+
|
|
36
49
|
if (sidebar) {
|
|
37
50
|
if (toggle) {
|
|
38
51
|
sidebar.classList.add('ps');
|
|
39
52
|
sidebar.classList.add('ps-container');
|
|
40
53
|
sidebar.classList.add('ps--active-y');
|
|
54
|
+
|
|
55
|
+
if (ps.y.rail.off) {
|
|
56
|
+
ps.y.rail.off.classList.add('ps__rail-y');
|
|
57
|
+
ps.y.rail.off.removeAttribute('style');
|
|
58
|
+
ps.y.rail.off.style.left = isRtl ? '0px' : 'unset';
|
|
59
|
+
ps.y.rail.off.style.right = isRtl ? 'unset' : '0px';
|
|
60
|
+
ps.y.rail.off.classList.remove('ps__rail-y-off');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (ps.y.thumb.off) {
|
|
64
|
+
ps.y.thumb.off.removeAttribute('style');
|
|
65
|
+
ps.y.thumb.off.classList.add('ps__thumb-y');
|
|
66
|
+
ps.y.thumb.off.classList.remove('ps__thumb-y-off');
|
|
67
|
+
}
|
|
41
68
|
} else {
|
|
69
|
+
if (ps.y.rail.on) {
|
|
70
|
+
ps.y.rail.on.classList.add('ps__rail-y-off');
|
|
71
|
+
ps.y.rail.on.removeAttribute('style');
|
|
72
|
+
ps.y.rail.on.classList.remove('ps__rail-y');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (ps.y.thumb.on) {
|
|
76
|
+
ps.y.thumb.on.classList.add('ps__thumb-y-off');
|
|
77
|
+
ps.y.thumb.on.removeAttribute('style');
|
|
78
|
+
ps.y.thumb.on.classList.remove('ps__thumb-y');
|
|
79
|
+
}
|
|
80
|
+
|
|
42
81
|
sidebar.classList.remove('ps');
|
|
43
82
|
sidebar.classList.remove('ps-container');
|
|
44
83
|
sidebar.classList.remove('ps--active-y');
|
|
@@ -47,7 +86,6 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
47
86
|
};
|
|
48
87
|
|
|
49
88
|
LayoutHelper.toggleClass = function toggleClass(className, force) {
|
|
50
|
-
|
|
51
89
|
if (force === true) {
|
|
52
90
|
this.elClassList.add(className);
|
|
53
91
|
} else if (force === false) {
|
|
@@ -55,10 +93,35 @@ var LayoutHelper = (_temp = _class = function () {
|
|
|
55
93
|
} else {
|
|
56
94
|
this.elClassList.toggle(className);
|
|
57
95
|
}
|
|
96
|
+
|
|
58
97
|
return this.elClassList.contains(className);
|
|
59
98
|
};
|
|
60
99
|
|
|
100
|
+
LayoutHelper.isOnMobile = function isOnMobile() {
|
|
101
|
+
var onMobile = false;
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
var minimizerElement = document.querySelector('.sidebar-minimizer');
|
|
105
|
+
|
|
106
|
+
if (minimizerElement) {
|
|
107
|
+
onMobile = getComputedStyle(minimizerElement).getPropertyValue('display') === 'none';
|
|
108
|
+
} else {
|
|
109
|
+
var sidebarElement = document.querySelector('.sidebar .sidebar-nav');
|
|
110
|
+
sidebarElement && (onMobile = getComputedStyle(sidebarElement).getPropertyValue('overflow-y') === 'auto');
|
|
111
|
+
}
|
|
112
|
+
} catch (ignore) {
|
|
113
|
+
// eslint-disable-next-line
|
|
114
|
+
console.warn('CoreUI isOnMobile failed to getComputedStyle', ignore);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return onMobile;
|
|
118
|
+
};
|
|
119
|
+
|
|
61
120
|
return LayoutHelper;
|
|
62
|
-
}()
|
|
63
|
-
|
|
64
|
-
|
|
121
|
+
}();
|
|
122
|
+
|
|
123
|
+
_defineProperty(LayoutHelper, "elClassList", document.body.classList);
|
|
124
|
+
|
|
125
|
+
var _default = LayoutHelper;
|
|
126
|
+
exports["default"] = _default;
|
|
127
|
+
module.exports = exports.default;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports
|
|
4
|
+
exports["default"] = toggleClasses;
|
|
5
|
+
|
|
5
6
|
function toggleClasses(toggleClass, classList, force) {
|
|
6
7
|
var level = classList.indexOf(toggleClass);
|
|
7
8
|
var removeClassList = classList.slice(0, level);
|
|
8
9
|
removeClassList.map(function (className) {
|
|
9
10
|
return document.body.classList.remove(className);
|
|
10
11
|
});
|
|
12
|
+
|
|
11
13
|
if (force === true) {
|
|
12
14
|
document.body.classList.add(toggleClass);
|
|
13
15
|
} else if (force === false) {
|
|
@@ -15,6 +17,8 @@ function toggleClasses(toggleClass, classList, force) {
|
|
|
15
17
|
} else {
|
|
16
18
|
document.body.classList.toggle(toggleClass);
|
|
17
19
|
}
|
|
20
|
+
|
|
18
21
|
return document.body.classList.contains(toggleClass);
|
|
19
22
|
}
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
module.exports = exports.default;
|