@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/Sidebar.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
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 classNames from 'classnames';
|
|
13
11
|
import PropTypes from 'prop-types';
|
|
14
12
|
import { sidebarCssClasses } from './Shared';
|
|
15
13
|
import ClickOutHandler from 'react-onclickout';
|
|
16
|
-
|
|
17
14
|
import './Shared/element-closest';
|
|
18
15
|
import LayoutHelper from './Shared/layout/layout';
|
|
19
|
-
|
|
20
|
-
var propTypes = {
|
|
16
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
21
17
|
children: PropTypes.node,
|
|
22
18
|
className: PropTypes.string,
|
|
23
19
|
compact: PropTypes.bool,
|
|
@@ -28,8 +24,7 @@ var propTypes = {
|
|
|
28
24
|
offCanvas: PropTypes.bool,
|
|
29
25
|
staticContext: PropTypes.any,
|
|
30
26
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
31
|
-
};
|
|
32
|
-
|
|
27
|
+
} : {};
|
|
33
28
|
var defaultProps = {
|
|
34
29
|
tag: 'div',
|
|
35
30
|
compact: false,
|
|
@@ -40,24 +35,25 @@ var defaultProps = {
|
|
|
40
35
|
offCanvas: false
|
|
41
36
|
};
|
|
42
37
|
|
|
43
|
-
var AppSidebar = function (_Component) {
|
|
44
|
-
|
|
38
|
+
var AppSidebar = /*#__PURE__*/function (_Component) {
|
|
39
|
+
_inheritsLoose(AppSidebar, _Component);
|
|
45
40
|
|
|
46
41
|
function AppSidebar(props) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_this.
|
|
52
|
-
_this.
|
|
53
|
-
_this.
|
|
54
|
-
_this.
|
|
55
|
-
_this.
|
|
56
|
-
_this.hideMobile = _this.hideMobile.bind(_this);
|
|
42
|
+
var _this;
|
|
43
|
+
|
|
44
|
+
_this = _Component.call(this, props) || this;
|
|
45
|
+
_this.isCompact = _this.isCompact.bind(_assertThisInitialized(_this));
|
|
46
|
+
_this.isFixed = _this.isFixed.bind(_assertThisInitialized(_this));
|
|
47
|
+
_this.isMinimized = _this.isMinimized.bind(_assertThisInitialized(_this));
|
|
48
|
+
_this.isOffCanvas = _this.isOffCanvas.bind(_assertThisInitialized(_this));
|
|
49
|
+
_this.displayBreakpoint = _this.displayBreakpoint.bind(_assertThisInitialized(_this));
|
|
50
|
+
_this.hideMobile = _this.hideMobile.bind(_assertThisInitialized(_this));
|
|
57
51
|
return _this;
|
|
58
52
|
}
|
|
59
53
|
|
|
60
|
-
AppSidebar.prototype
|
|
54
|
+
var _proto = AppSidebar.prototype;
|
|
55
|
+
|
|
56
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
61
57
|
this.displayBreakpoint(this.props.display);
|
|
62
58
|
this.isCompact(this.props.compact);
|
|
63
59
|
this.isFixed(this.props.fixed);
|
|
@@ -65,46 +61,47 @@ var AppSidebar = function (_Component) {
|
|
|
65
61
|
this.isOffCanvas(this.props.offCanvas);
|
|
66
62
|
};
|
|
67
63
|
|
|
68
|
-
|
|
64
|
+
_proto.isCompact = function isCompact(compact) {
|
|
69
65
|
if (compact) {
|
|
70
66
|
document.body.classList.add('sidebar-compact');
|
|
71
67
|
}
|
|
72
68
|
};
|
|
73
69
|
|
|
74
|
-
|
|
70
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
75
71
|
if (fixed) {
|
|
76
72
|
document.body.classList.add('sidebar-fixed');
|
|
77
73
|
}
|
|
78
74
|
};
|
|
79
75
|
|
|
80
|
-
|
|
76
|
+
_proto.isMinimized = function isMinimized(minimized) {
|
|
81
77
|
LayoutHelper.sidebarToggle(minimized);
|
|
82
78
|
};
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
_proto.isOffCanvas = function isOffCanvas(offCanvas) {
|
|
85
81
|
if (offCanvas) {
|
|
86
82
|
document.body.classList.add('sidebar-off-canvas');
|
|
87
83
|
}
|
|
88
84
|
};
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
var cssTemplate =
|
|
86
|
+
_proto.displayBreakpoint = function displayBreakpoint(display) {
|
|
87
|
+
var cssTemplate = "sidebar-" + display + "-show";
|
|
92
88
|
var _sidebarCssClasses$ = sidebarCssClasses[0],
|
|
93
89
|
cssClass = _sidebarCssClasses$[0];
|
|
94
90
|
|
|
95
91
|
if (display && sidebarCssClasses.indexOf(cssTemplate) > -1) {
|
|
96
92
|
cssClass = cssTemplate;
|
|
97
93
|
}
|
|
94
|
+
|
|
98
95
|
document.body.classList.add(cssClass);
|
|
99
96
|
};
|
|
100
97
|
|
|
101
|
-
|
|
98
|
+
_proto.hideMobile = function hideMobile() {
|
|
102
99
|
if (document.body.classList.contains('sidebar-show')) {
|
|
103
100
|
document.body.classList.remove('sidebar-show');
|
|
104
101
|
}
|
|
105
102
|
};
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
_proto.onClickOut = function onClickOut(e) {
|
|
108
105
|
if (typeof window !== 'undefined' && document.body.classList.contains('sidebar-show')) {
|
|
109
106
|
if (!e.target.closest('[data-sidebar-toggler]')) {
|
|
110
107
|
this.hideMobile();
|
|
@@ -112,14 +109,14 @@ var AppSidebar = function (_Component) {
|
|
|
112
109
|
}
|
|
113
110
|
};
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
_proto.render = function render() {
|
|
116
113
|
var _this2 = this;
|
|
117
114
|
|
|
118
|
-
var
|
|
119
|
-
className =
|
|
120
|
-
children =
|
|
121
|
-
Tag =
|
|
122
|
-
attributes =
|
|
115
|
+
var _this$props = this.props,
|
|
116
|
+
className = _this$props.className,
|
|
117
|
+
children = _this$props.children,
|
|
118
|
+
Tag = _this$props.tag,
|
|
119
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
123
120
|
|
|
124
121
|
delete attributes.compact;
|
|
125
122
|
delete attributes.display;
|
|
@@ -128,21 +125,15 @@ var AppSidebar = function (_Component) {
|
|
|
128
125
|
delete attributes.offCanvas;
|
|
129
126
|
delete attributes.isOpen;
|
|
130
127
|
delete attributes.staticContext;
|
|
128
|
+
var classes = classNames(className, 'sidebar'); // sidebar-nav root
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
} },
|
|
140
|
-
React.createElement(
|
|
141
|
-
Tag,
|
|
142
|
-
_extends({ className: classes }, attributes),
|
|
143
|
-
children
|
|
144
|
-
)
|
|
145
|
-
);
|
|
130
|
+
return /*#__PURE__*/React.createElement(ClickOutHandler, {
|
|
131
|
+
onClickOut: function onClickOut(e) {
|
|
132
|
+
_this2.onClickOut(e);
|
|
133
|
+
}
|
|
134
|
+
}, /*#__PURE__*/React.createElement(Tag, _extends({
|
|
135
|
+
className: classes
|
|
136
|
+
}, attributes), children));
|
|
146
137
|
};
|
|
147
138
|
|
|
148
139
|
return AppSidebar;
|
|
@@ -150,5 +141,4 @@ var AppSidebar = function (_Component) {
|
|
|
150
141
|
|
|
151
142
|
AppSidebar.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
152
143
|
AppSidebar.defaultProps = defaultProps;
|
|
153
|
-
|
|
154
144
|
export default AppSidebar;
|
package/es/SidebarFooter.js
CHANGED
|
@@ -1,50 +1,41 @@
|
|
|
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
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
19
|
-
};
|
|
20
|
-
|
|
14
|
+
} : {};
|
|
21
15
|
var defaultProps = {
|
|
22
16
|
tag: 'div'
|
|
23
17
|
};
|
|
24
18
|
|
|
25
|
-
var AppSidebarFooter = function (_Component) {
|
|
26
|
-
|
|
19
|
+
var AppSidebarFooter = /*#__PURE__*/function (_Component) {
|
|
20
|
+
_inheritsLoose(AppSidebarFooter, _Component);
|
|
27
21
|
|
|
28
22
|
function AppSidebarFooter() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
23
|
+
return _Component.apply(this, arguments) || this;
|
|
32
24
|
}
|
|
33
25
|
|
|
34
|
-
AppSidebarFooter.prototype
|
|
35
|
-
var _props = this.props,
|
|
36
|
-
className = _props.className,
|
|
37
|
-
children = _props.children,
|
|
38
|
-
Tag = _props.tag,
|
|
39
|
-
attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
|
|
26
|
+
var _proto = AppSidebarFooter.prototype;
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
_proto.render = function render() {
|
|
29
|
+
var _this$props = this.props,
|
|
30
|
+
className = _this$props.className,
|
|
31
|
+
children = _this$props.children,
|
|
32
|
+
Tag = _this$props.tag,
|
|
33
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
47
34
|
|
|
35
|
+
var classes = classNames(className, 'sidebar-footer');
|
|
36
|
+
var footer = children ? /*#__PURE__*/React.createElement(Tag, _extends({
|
|
37
|
+
className: classes
|
|
38
|
+
}, attributes), children) : null;
|
|
48
39
|
return footer;
|
|
49
40
|
};
|
|
50
41
|
|
|
@@ -53,5 +44,4 @@ var AppSidebarFooter = function (_Component) {
|
|
|
53
44
|
|
|
54
45
|
AppSidebarFooter.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
55
46
|
AppSidebarFooter.defaultProps = defaultProps;
|
|
56
|
-
|
|
57
47
|
export default AppSidebarFooter;
|
package/es/SidebarForm.js
CHANGED
|
@@ -1,50 +1,41 @@
|
|
|
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
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
19
|
-
};
|
|
20
|
-
|
|
14
|
+
} : {};
|
|
21
15
|
var defaultProps = {
|
|
22
16
|
tag: 'div'
|
|
23
17
|
};
|
|
24
18
|
|
|
25
|
-
var AppSidebarForm = function (_Component) {
|
|
26
|
-
|
|
19
|
+
var AppSidebarForm = /*#__PURE__*/function (_Component) {
|
|
20
|
+
_inheritsLoose(AppSidebarForm, _Component);
|
|
27
21
|
|
|
28
22
|
function AppSidebarForm() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
23
|
+
return _Component.apply(this, arguments) || this;
|
|
32
24
|
}
|
|
33
25
|
|
|
34
|
-
AppSidebarForm.prototype
|
|
35
|
-
var _props = this.props,
|
|
36
|
-
className = _props.className,
|
|
37
|
-
children = _props.children,
|
|
38
|
-
Tag = _props.tag,
|
|
39
|
-
attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
|
|
26
|
+
var _proto = AppSidebarForm.prototype;
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
_proto.render = function render() {
|
|
29
|
+
var _this$props = this.props,
|
|
30
|
+
className = _this$props.className,
|
|
31
|
+
children = _this$props.children,
|
|
32
|
+
Tag = _this$props.tag,
|
|
33
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
47
34
|
|
|
35
|
+
var classes = classNames(className, 'sidebar-form');
|
|
36
|
+
var form = children ? /*#__PURE__*/React.createElement(Tag, _extends({
|
|
37
|
+
className: classes
|
|
38
|
+
}, attributes), children) : null;
|
|
48
39
|
return form;
|
|
49
40
|
};
|
|
50
41
|
|
|
@@ -53,5 +44,4 @@ var AppSidebarForm = function (_Component) {
|
|
|
53
44
|
|
|
54
45
|
AppSidebarForm.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
55
46
|
AppSidebarForm.defaultProps = defaultProps;
|
|
56
|
-
|
|
57
47
|
export default AppSidebarForm;
|
package/es/SidebarHeader.js
CHANGED
|
@@ -1,50 +1,41 @@
|
|
|
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
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
19
|
-
};
|
|
20
|
-
|
|
14
|
+
} : {};
|
|
21
15
|
var defaultProps = {
|
|
22
16
|
tag: 'div'
|
|
23
17
|
};
|
|
24
18
|
|
|
25
|
-
var AppSidebarHeader = function (_Component) {
|
|
26
|
-
|
|
19
|
+
var AppSidebarHeader = /*#__PURE__*/function (_Component) {
|
|
20
|
+
_inheritsLoose(AppSidebarHeader, _Component);
|
|
27
21
|
|
|
28
22
|
function AppSidebarHeader() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
23
|
+
return _Component.apply(this, arguments) || this;
|
|
32
24
|
}
|
|
33
25
|
|
|
34
|
-
AppSidebarHeader.prototype
|
|
35
|
-
var _props = this.props,
|
|
36
|
-
className = _props.className,
|
|
37
|
-
children = _props.children,
|
|
38
|
-
Tag = _props.tag,
|
|
39
|
-
attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
|
|
26
|
+
var _proto = AppSidebarHeader.prototype;
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
_proto.render = function render() {
|
|
29
|
+
var _this$props = this.props,
|
|
30
|
+
className = _this$props.className,
|
|
31
|
+
children = _this$props.children,
|
|
32
|
+
Tag = _this$props.tag,
|
|
33
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
47
34
|
|
|
35
|
+
var classes = classNames(className, 'sidebar-header');
|
|
36
|
+
var header = children ? /*#__PURE__*/React.createElement(Tag, _extends({
|
|
37
|
+
className: classes
|
|
38
|
+
}, attributes), children) : null;
|
|
48
39
|
return header;
|
|
49
40
|
};
|
|
50
41
|
|
|
@@ -53,5 +44,4 @@ var AppSidebarHeader = function (_Component) {
|
|
|
53
44
|
|
|
54
45
|
AppSidebarHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
55
46
|
AppSidebarHeader.defaultProps = defaultProps;
|
|
56
|
-
|
|
57
47
|
export default AppSidebarHeader;
|
package/es/SidebarMinimizer.js
CHANGED
|
@@ -1,71 +1,67 @@
|
|
|
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
12
|
import LayoutHelper from './Shared/layout/layout';
|
|
16
|
-
|
|
17
|
-
var propTypes = {
|
|
13
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
18
14
|
children: PropTypes.node,
|
|
19
15
|
className: PropTypes.string,
|
|
20
16
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
21
17
|
type: PropTypes.string
|
|
22
|
-
};
|
|
23
|
-
|
|
18
|
+
} : {};
|
|
24
19
|
var defaultProps = {
|
|
25
20
|
tag: 'button',
|
|
26
21
|
type: 'button'
|
|
27
22
|
};
|
|
28
23
|
|
|
29
|
-
var AppSidebarMinimizer = function (_Component) {
|
|
30
|
-
|
|
24
|
+
var AppSidebarMinimizer = /*#__PURE__*/function (_Component) {
|
|
25
|
+
_inheritsLoose(AppSidebarMinimizer, _Component);
|
|
31
26
|
|
|
32
27
|
function AppSidebarMinimizer(props) {
|
|
33
|
-
|
|
28
|
+
var _this;
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_this.handleClick = _this.handleClick.bind(_this);
|
|
30
|
+
_this = _Component.call(this, props) || this;
|
|
31
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
38
32
|
return _this;
|
|
39
33
|
}
|
|
40
34
|
|
|
41
|
-
AppSidebarMinimizer.prototype
|
|
35
|
+
var _proto = AppSidebarMinimizer.prototype;
|
|
36
|
+
|
|
37
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
42
38
|
var isMinimized = document.body.classList.contains('sidebar-minimized');
|
|
43
39
|
LayoutHelper.sidebarPSToggle(!isMinimized);
|
|
44
40
|
};
|
|
45
41
|
|
|
46
|
-
|
|
42
|
+
_proto.handleClick = function handleClick() {
|
|
47
43
|
LayoutHelper.sidebarToggle();
|
|
48
44
|
};
|
|
49
45
|
|
|
50
|
-
|
|
46
|
+
_proto.render = function render() {
|
|
51
47
|
var _this2 = this;
|
|
52
48
|
|
|
53
|
-
var
|
|
54
|
-
className =
|
|
55
|
-
children =
|
|
56
|
-
Tag =
|
|
57
|
-
type =
|
|
58
|
-
attributes =
|
|
49
|
+
var _this$props = this.props,
|
|
50
|
+
className = _this$props.className,
|
|
51
|
+
children = _this$props.children,
|
|
52
|
+
Tag = _this$props.tag,
|
|
53
|
+
type = _this$props.type,
|
|
54
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag", "type"]);
|
|
59
55
|
|
|
60
56
|
var classes = classNames(className, 'sidebar-minimizer', 'mt-auto');
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
);
|
|
57
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
58
|
+
className: classes,
|
|
59
|
+
type: type
|
|
60
|
+
}, attributes, {
|
|
61
|
+
onClick: function onClick(event) {
|
|
62
|
+
return _this2.handleClick(event);
|
|
63
|
+
}
|
|
64
|
+
}), children);
|
|
69
65
|
};
|
|
70
66
|
|
|
71
67
|
return AppSidebarMinimizer;
|
|
@@ -73,5 +69,4 @@ var AppSidebarMinimizer = function (_Component) {
|
|
|
73
69
|
|
|
74
70
|
AppSidebarMinimizer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
75
71
|
AppSidebarMinimizer.defaultProps = defaultProps;
|
|
76
|
-
|
|
77
72
|
export default AppSidebarMinimizer;
|