@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/lib/SidebarHeader.js
CHANGED
|
@@ -1,64 +1,55 @@
|
|
|
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
|
-
tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string])
|
|
33
|
-
};
|
|
22
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
34
23
|
|
|
24
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
25
|
+
children: _propTypes["default"].node,
|
|
26
|
+
className: _propTypes["default"].string,
|
|
27
|
+
tag: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].string])
|
|
28
|
+
} : {};
|
|
35
29
|
var defaultProps = {
|
|
36
30
|
tag: 'div'
|
|
37
31
|
};
|
|
38
32
|
|
|
39
|
-
var AppSidebarHeader = function (_Component) {
|
|
40
|
-
|
|
33
|
+
var AppSidebarHeader = /*#__PURE__*/function (_Component) {
|
|
34
|
+
_inheritsLoose(AppSidebarHeader, _Component);
|
|
41
35
|
|
|
42
36
|
function AppSidebarHeader() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
37
|
+
return _Component.apply(this, arguments) || this;
|
|
46
38
|
}
|
|
47
39
|
|
|
48
|
-
AppSidebarHeader.prototype
|
|
49
|
-
var _props = this.props,
|
|
50
|
-
className = _props.className,
|
|
51
|
-
children = _props.children,
|
|
52
|
-
Tag = _props.tag,
|
|
53
|
-
attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
|
|
40
|
+
var _proto = AppSidebarHeader.prototype;
|
|
54
41
|
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
_proto.render = function render() {
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
className = _this$props.className,
|
|
45
|
+
children = _this$props.children,
|
|
46
|
+
Tag = _this$props.tag,
|
|
47
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
61
48
|
|
|
49
|
+
var classes = (0, _classnames["default"])(className, 'sidebar-header');
|
|
50
|
+
var header = children ? /*#__PURE__*/_react["default"].createElement(Tag, _extends({
|
|
51
|
+
className: classes
|
|
52
|
+
}, attributes), children) : null;
|
|
62
53
|
return header;
|
|
63
54
|
};
|
|
64
55
|
|
|
@@ -67,6 +58,6 @@ var AppSidebarHeader = function (_Component) {
|
|
|
67
58
|
|
|
68
59
|
AppSidebarHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
69
60
|
AppSidebarHeader.defaultProps = defaultProps;
|
|
70
|
-
|
|
71
|
-
exports
|
|
72
|
-
module.exports = exports
|
|
61
|
+
var _default = AppSidebarHeader;
|
|
62
|
+
exports["default"] = _default;
|
|
63
|
+
module.exports = exports.default;
|
package/lib/SidebarMinimizer.js
CHANGED
|
@@ -1,87 +1,83 @@
|
|
|
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
|
-
var
|
|
12
|
+
var _layout = _interopRequireDefault(require("./Shared/layout/layout"));
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
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; }
|
|
18
19
|
|
|
19
|
-
var
|
|
20
|
+
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); }
|
|
20
21
|
|
|
21
|
-
var
|
|
22
|
+
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; }
|
|
22
23
|
|
|
23
|
-
function
|
|
24
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
25
|
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
-
|
|
29
|
-
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; }
|
|
30
|
-
|
|
31
|
-
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; }
|
|
32
|
-
|
|
33
|
-
var propTypes = {
|
|
34
|
-
children: _propTypes2.default.node,
|
|
35
|
-
className: _propTypes2.default.string,
|
|
36
|
-
tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]),
|
|
37
|
-
type: _propTypes2.default.string
|
|
38
|
-
};
|
|
26
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
39
27
|
|
|
28
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
29
|
+
children: _propTypes["default"].node,
|
|
30
|
+
className: _propTypes["default"].string,
|
|
31
|
+
tag: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].string]),
|
|
32
|
+
type: _propTypes["default"].string
|
|
33
|
+
} : {};
|
|
40
34
|
var defaultProps = {
|
|
41
35
|
tag: 'button',
|
|
42
36
|
type: 'button'
|
|
43
37
|
};
|
|
44
38
|
|
|
45
|
-
var AppSidebarMinimizer = function (_Component) {
|
|
46
|
-
|
|
39
|
+
var AppSidebarMinimizer = /*#__PURE__*/function (_Component) {
|
|
40
|
+
_inheritsLoose(AppSidebarMinimizer, _Component);
|
|
47
41
|
|
|
48
42
|
function AppSidebarMinimizer(props) {
|
|
49
|
-
|
|
43
|
+
var _this;
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_this.handleClick = _this.handleClick.bind(_this);
|
|
45
|
+
_this = _Component.call(this, props) || this;
|
|
46
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
54
47
|
return _this;
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
AppSidebarMinimizer.prototype
|
|
50
|
+
var _proto = AppSidebarMinimizer.prototype;
|
|
51
|
+
|
|
52
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
58
53
|
var isMinimized = document.body.classList.contains('sidebar-minimized');
|
|
59
|
-
|
|
54
|
+
|
|
55
|
+
_layout["default"].sidebarPSToggle(!isMinimized);
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
_proto.handleClick = function handleClick() {
|
|
59
|
+
_layout["default"].sidebarToggle();
|
|
64
60
|
};
|
|
65
61
|
|
|
66
|
-
|
|
62
|
+
_proto.render = function render() {
|
|
67
63
|
var _this2 = this;
|
|
68
64
|
|
|
69
|
-
var
|
|
70
|
-
className =
|
|
71
|
-
children =
|
|
72
|
-
Tag =
|
|
73
|
-
type =
|
|
74
|
-
attributes =
|
|
75
|
-
|
|
76
|
-
var classes = (0,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
);
|
|
65
|
+
var _this$props = this.props,
|
|
66
|
+
className = _this$props.className,
|
|
67
|
+
children = _this$props.children,
|
|
68
|
+
Tag = _this$props.tag,
|
|
69
|
+
type = _this$props.type,
|
|
70
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag", "type"]);
|
|
71
|
+
|
|
72
|
+
var classes = (0, _classnames["default"])(className, 'sidebar-minimizer', 'mt-auto');
|
|
73
|
+
return /*#__PURE__*/_react["default"].createElement(Tag, _extends({
|
|
74
|
+
className: classes,
|
|
75
|
+
type: type
|
|
76
|
+
}, attributes, {
|
|
77
|
+
onClick: function onClick(event) {
|
|
78
|
+
return _this2.handleClick(event);
|
|
79
|
+
}
|
|
80
|
+
}), children);
|
|
85
81
|
};
|
|
86
82
|
|
|
87
83
|
return AppSidebarMinimizer;
|
|
@@ -89,6 +85,6 @@ var AppSidebarMinimizer = function (_Component) {
|
|
|
89
85
|
|
|
90
86
|
AppSidebarMinimizer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
91
87
|
AppSidebarMinimizer.defaultProps = defaultProps;
|
|
92
|
-
|
|
93
|
-
exports
|
|
94
|
-
module.exports = exports
|
|
88
|
+
var _default = AppSidebarMinimizer;
|
|
89
|
+
exports["default"] = _default;
|
|
90
|
+
module.exports = exports.default;
|