@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/SidebarToggler.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
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
12
|
import { sidebarCssClasses, validBreakpoints, checkBreakpoint } from './Shared/index';
|
|
15
13
|
import toggleClasses from './Shared/toggle-classes';
|
|
16
|
-
|
|
17
|
-
var propTypes = {
|
|
14
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
18
15
|
children: PropTypes.node,
|
|
19
16
|
className: PropTypes.string,
|
|
20
17
|
display: PropTypes.any,
|
|
21
18
|
mobile: PropTypes.bool,
|
|
22
19
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
23
20
|
type: PropTypes.string
|
|
24
|
-
};
|
|
25
|
-
|
|
21
|
+
} : {};
|
|
26
22
|
var defaultProps = {
|
|
27
23
|
display: 'lg',
|
|
28
24
|
mobile: false,
|
|
@@ -30,56 +26,60 @@ var defaultProps = {
|
|
|
30
26
|
type: 'button'
|
|
31
27
|
};
|
|
32
28
|
|
|
33
|
-
var AppSidebarToggler = function (_Component) {
|
|
34
|
-
|
|
29
|
+
var AppSidebarToggler = /*#__PURE__*/function (_Component) {
|
|
30
|
+
_inheritsLoose(AppSidebarToggler, _Component);
|
|
35
31
|
|
|
36
32
|
function AppSidebarToggler(props) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
|
33
|
+
var _this;
|
|
40
34
|
|
|
41
|
-
_this
|
|
35
|
+
_this = _Component.call(this, props) || this;
|
|
36
|
+
_this.sidebarToggle = _this.sidebarToggle.bind(_assertThisInitialized(_this));
|
|
42
37
|
return _this;
|
|
43
38
|
}
|
|
44
39
|
|
|
45
|
-
AppSidebarToggler.prototype
|
|
40
|
+
var _proto = AppSidebarToggler.prototype;
|
|
41
|
+
|
|
42
|
+
_proto.sidebarToggle = function sidebarToggle(e) {
|
|
46
43
|
e.preventDefault();
|
|
47
44
|
this.toggle();
|
|
48
45
|
};
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
_proto.toggle = function toggle(force) {
|
|
51
48
|
var _ref = [this.props.display, this.props.mobile],
|
|
52
49
|
display = _ref[0],
|
|
53
50
|
mobile = _ref[1];
|
|
54
|
-
|
|
55
51
|
var cssClass = sidebarCssClasses[0];
|
|
52
|
+
|
|
56
53
|
if (!mobile && display && checkBreakpoint(display, validBreakpoints)) {
|
|
57
|
-
cssClass =
|
|
54
|
+
cssClass = "sidebar-" + display + "-show";
|
|
58
55
|
}
|
|
56
|
+
|
|
59
57
|
toggleClasses(cssClass, sidebarCssClasses, force);
|
|
60
58
|
};
|
|
61
59
|
|
|
62
|
-
|
|
60
|
+
_proto.render = function render() {
|
|
63
61
|
var _this2 = this;
|
|
64
62
|
|
|
65
|
-
var
|
|
66
|
-
className =
|
|
67
|
-
children =
|
|
68
|
-
Tag =
|
|
69
|
-
attributes =
|
|
63
|
+
var _this$props = this.props,
|
|
64
|
+
className = _this$props.className,
|
|
65
|
+
children = _this$props.children,
|
|
66
|
+
Tag = _this$props.tag,
|
|
67
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
70
68
|
|
|
71
69
|
delete attributes.mobile;
|
|
72
70
|
delete attributes.display;
|
|
73
|
-
|
|
74
71
|
var classes = classNames(className, 'navbar-toggler');
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
73
|
+
type: "button",
|
|
74
|
+
className: classes
|
|
75
|
+
}, attributes, {
|
|
76
|
+
onClick: function onClick(event) {
|
|
77
|
+
return _this2.sidebarToggle(event);
|
|
78
|
+
},
|
|
79
|
+
"data-sidebar-toggler": true
|
|
80
|
+
}), children || /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
className: "navbar-toggler-icon"
|
|
82
|
+
}));
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
return AppSidebarToggler;
|
|
@@ -87,5 +87,4 @@ var AppSidebarToggler = function (_Component) {
|
|
|
87
87
|
|
|
88
88
|
AppSidebarToggler.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
89
89
|
AppSidebarToggler.defaultProps = defaultProps;
|
|
90
|
-
|
|
91
90
|
export default AppSidebarToggler;
|
package/es/Switch.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
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
|
color: PropTypes.string,
|
|
17
14
|
label: PropTypes.bool,
|
|
18
15
|
outline: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.oneOf(['', 'alt'])]),
|
|
@@ -31,8 +28,7 @@ var propTypes = {
|
|
|
31
28
|
className: PropTypes.string,
|
|
32
29
|
dataOn: PropTypes.string,
|
|
33
30
|
dataOff: PropTypes.string
|
|
34
|
-
};
|
|
35
|
-
|
|
31
|
+
} : {};
|
|
36
32
|
var defaultProps = {
|
|
37
33
|
color: 'secondary',
|
|
38
34
|
label: false,
|
|
@@ -48,17 +44,16 @@ var defaultProps = {
|
|
|
48
44
|
dataOff: 'Off'
|
|
49
45
|
};
|
|
50
46
|
|
|
51
|
-
var AppSwitch = function (_Component) {
|
|
52
|
-
|
|
47
|
+
var AppSwitch = /*#__PURE__*/function (_Component) {
|
|
48
|
+
_inheritsLoose(AppSwitch, _Component);
|
|
53
49
|
|
|
54
50
|
function AppSwitch(props) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
|
51
|
+
var _this;
|
|
58
52
|
|
|
59
|
-
_this
|
|
60
|
-
_this.
|
|
61
|
-
_this.
|
|
53
|
+
_this = _Component.call(this, props) || this;
|
|
54
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
55
|
+
_this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
|
|
56
|
+
_this.handleKeyUp = _this.handleKeyUp.bind(_assertThisInitialized(_this));
|
|
62
57
|
_this.state = {
|
|
63
58
|
uncontrolled: !!_this.props.defaultChecked,
|
|
64
59
|
checked: _this.props.defaultChecked || _this.props.checked,
|
|
@@ -67,13 +62,15 @@ var AppSwitch = function (_Component) {
|
|
|
67
62
|
return _this;
|
|
68
63
|
}
|
|
69
64
|
|
|
70
|
-
AppSwitch.prototype
|
|
65
|
+
var _proto = AppSwitch.prototype;
|
|
66
|
+
|
|
67
|
+
_proto.toggleState = function toggleState(check) {
|
|
71
68
|
this.setState({
|
|
72
69
|
checked: check
|
|
73
70
|
});
|
|
74
71
|
};
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
_proto.handleChange = function handleChange(event) {
|
|
77
74
|
var target = event.target;
|
|
78
75
|
this.toggleState(target.checked);
|
|
79
76
|
|
|
@@ -82,70 +79,71 @@ var AppSwitch = function (_Component) {
|
|
|
82
79
|
}
|
|
83
80
|
};
|
|
84
81
|
|
|
85
|
-
|
|
82
|
+
_proto.handleKeyDown = function handleKeyDown(event) {
|
|
86
83
|
if (event.key === ' ') {
|
|
87
84
|
event.preventDefault();
|
|
88
85
|
}
|
|
89
86
|
};
|
|
90
87
|
|
|
91
|
-
|
|
88
|
+
_proto.handleKeyUp = function handleKeyUp(event) {
|
|
92
89
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
93
90
|
this.toggleState(!this.state.checked);
|
|
94
91
|
}
|
|
95
92
|
};
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
|
98
95
|
if (!this.state.uncontrolled && this.props.checked !== prevState.checked) {
|
|
99
96
|
this.toggleState(this.props.checked);
|
|
100
97
|
}
|
|
101
98
|
};
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
var
|
|
105
|
-
className =
|
|
106
|
-
disabled =
|
|
107
|
-
color =
|
|
108
|
-
name =
|
|
109
|
-
label =
|
|
110
|
-
outline =
|
|
111
|
-
size =
|
|
112
|
-
required =
|
|
113
|
-
type =
|
|
114
|
-
value =
|
|
115
|
-
dataOn =
|
|
116
|
-
dataOff =
|
|
117
|
-
variant =
|
|
118
|
-
attributes =
|
|
100
|
+
_proto.render = function render() {
|
|
101
|
+
var _this$props = this.props,
|
|
102
|
+
className = _this$props.className,
|
|
103
|
+
disabled = _this$props.disabled,
|
|
104
|
+
color = _this$props.color,
|
|
105
|
+
name = _this$props.name,
|
|
106
|
+
label = _this$props.label,
|
|
107
|
+
outline = _this$props.outline,
|
|
108
|
+
size = _this$props.size,
|
|
109
|
+
required = _this$props.required,
|
|
110
|
+
type = _this$props.type,
|
|
111
|
+
value = _this$props.value,
|
|
112
|
+
dataOn = _this$props.dataOn,
|
|
113
|
+
dataOff = _this$props.dataOff,
|
|
114
|
+
variant = _this$props.variant,
|
|
115
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "disabled", "color", "name", "label", "outline", "size", "required", "type", "value", "dataOn", "dataOff", "variant"]);
|
|
119
116
|
|
|
120
117
|
var tabindex = attributes.tabIndex;
|
|
121
118
|
delete attributes.tabIndex;
|
|
122
119
|
delete attributes.checked;
|
|
123
120
|
delete attributes.defaultChecked;
|
|
124
121
|
delete attributes.onChange;
|
|
125
|
-
|
|
126
|
-
var classes = classNames(className, 'switch', label ? 'switch-label' : false, size ? 'switch-' + size : false, variant ? 'switch-' + variant : false, 'switch' + (outline ? '-outline' : '') + '-' + color + (outline === 'alt' ? '-alt' : ''), 'form-check-label');
|
|
127
|
-
|
|
122
|
+
var classes = classNames(className, 'switch', label ? 'switch-label' : false, size ? "switch-" + size : false, variant ? "switch-" + variant : false, "switch" + (outline ? '-outline' : '') + "-" + color + (outline === 'alt' ? '-alt' : ''), 'form-check-label');
|
|
128
123
|
var inputClasses = classNames('switch-input', 'form-check-input');
|
|
129
|
-
|
|
130
124
|
var sliderClasses = classNames('switch-slider');
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)
|
|
125
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
126
|
+
className: classes,
|
|
127
|
+
tabIndex: tabindex,
|
|
128
|
+
onKeyUp: this.handleKeyUp,
|
|
129
|
+
onKeyDown: this.handleKeyDown
|
|
130
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
131
|
+
type: type,
|
|
132
|
+
className: inputClasses,
|
|
133
|
+
onChange: this.handleChange,
|
|
134
|
+
checked: this.state.checked,
|
|
135
|
+
name: name,
|
|
136
|
+
required: required,
|
|
137
|
+
disabled: disabled,
|
|
138
|
+
value: value,
|
|
139
|
+
"aria-checked": this.state.checked,
|
|
140
|
+
"aria-disabled": disabled,
|
|
141
|
+
"aria-readonly": disabled
|
|
142
|
+
}, attributes)), /*#__PURE__*/React.createElement("span", {
|
|
143
|
+
className: sliderClasses,
|
|
144
|
+
"data-checked": dataOn,
|
|
145
|
+
"data-unchecked": dataOff
|
|
146
|
+
}));
|
|
149
147
|
};
|
|
150
148
|
|
|
151
149
|
return AppSwitch;
|
|
@@ -153,5 +151,4 @@ var AppSwitch = function (_Component) {
|
|
|
153
151
|
|
|
154
152
|
AppSwitch.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
155
153
|
AppSwitch.defaultProps = defaultProps;
|
|
156
|
-
|
|
157
154
|
export default AppSwitch;
|
package/lib/Aside.js
CHANGED
|
@@ -1,47 +1,41 @@
|
|
|
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 _Shared = require("./Shared");
|
|
12
13
|
|
|
13
|
-
var
|
|
14
|
+
var _toggleClasses = _interopRequireDefault(require("./Shared/toggle-classes"));
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
18
19
|
|
|
19
|
-
var
|
|
20
|
+
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; }
|
|
20
21
|
|
|
21
|
-
var
|
|
22
|
+
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); }
|
|
22
23
|
|
|
23
|
-
var
|
|
24
|
+
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; }
|
|
24
25
|
|
|
25
|
-
function
|
|
26
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
27
|
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
-
|
|
31
|
-
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; }
|
|
32
|
-
|
|
33
|
-
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; }
|
|
34
|
-
|
|
35
|
-
var propTypes = {
|
|
36
|
-
children: _propTypes2.default.node,
|
|
37
|
-
className: _propTypes2.default.string,
|
|
38
|
-
display: _propTypes2.default.string,
|
|
39
|
-
fixed: _propTypes2.default.bool,
|
|
40
|
-
isOpen: _propTypes2.default.bool,
|
|
41
|
-
offCanvas: _propTypes2.default.bool,
|
|
42
|
-
tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string])
|
|
43
|
-
};
|
|
28
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
44
29
|
|
|
30
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
31
|
+
children: _propTypes["default"].node,
|
|
32
|
+
className: _propTypes["default"].string,
|
|
33
|
+
display: _propTypes["default"].string,
|
|
34
|
+
fixed: _propTypes["default"].bool,
|
|
35
|
+
isOpen: _propTypes["default"].bool,
|
|
36
|
+
offCanvas: _propTypes["default"].bool,
|
|
37
|
+
tag: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].string])
|
|
38
|
+
} : {};
|
|
45
39
|
var defaultProps = {
|
|
46
40
|
tag: 'aside',
|
|
47
41
|
display: '',
|
|
@@ -50,64 +44,61 @@ var defaultProps = {
|
|
|
50
44
|
offCanvas: true
|
|
51
45
|
};
|
|
52
46
|
|
|
53
|
-
var AppAside = function (_Component) {
|
|
54
|
-
|
|
47
|
+
var AppAside = /*#__PURE__*/function (_Component) {
|
|
48
|
+
_inheritsLoose(AppAside, _Component);
|
|
55
49
|
|
|
56
50
|
function AppAside(props) {
|
|
57
|
-
|
|
51
|
+
var _this;
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
_this.
|
|
62
|
-
_this.
|
|
63
|
-
_this.displayBreakpoint = _this.displayBreakpoint.bind(_this);
|
|
53
|
+
_this = _Component.call(this, props) || this;
|
|
54
|
+
_this.isFixed = _this.isFixed.bind(_assertThisInitialized(_this));
|
|
55
|
+
_this.isOffCanvas = _this.isOffCanvas.bind(_assertThisInitialized(_this));
|
|
56
|
+
_this.displayBreakpoint = _this.displayBreakpoint.bind(_assertThisInitialized(_this));
|
|
64
57
|
return _this;
|
|
65
58
|
}
|
|
66
59
|
|
|
67
|
-
AppAside.prototype
|
|
60
|
+
var _proto = AppAside.prototype;
|
|
61
|
+
|
|
62
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
68
63
|
this.isFixed(this.props.fixed);
|
|
69
64
|
this.isOffCanvas(this.props.offCanvas);
|
|
70
65
|
this.displayBreakpoint(this.props.display);
|
|
71
66
|
};
|
|
72
67
|
|
|
73
|
-
|
|
68
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
74
69
|
if (fixed) {
|
|
75
70
|
document.body.classList.add('aside-menu-fixed');
|
|
76
71
|
}
|
|
77
72
|
};
|
|
78
73
|
|
|
79
|
-
|
|
74
|
+
_proto.isOffCanvas = function isOffCanvas(offCanvas) {
|
|
80
75
|
if (offCanvas) {
|
|
81
76
|
document.body.classList.add('aside-menu-off-canvas');
|
|
82
77
|
}
|
|
83
78
|
};
|
|
84
79
|
|
|
85
|
-
|
|
80
|
+
_proto.displayBreakpoint = function displayBreakpoint(display) {
|
|
86
81
|
if (display && (0, _Shared.checkBreakpoint)(display, _Shared.validBreakpoints)) {
|
|
87
|
-
var cssClass =
|
|
88
|
-
(0,
|
|
82
|
+
var cssClass = "aside-menu-" + display + "-show";
|
|
83
|
+
(0, _toggleClasses["default"])(cssClass, _Shared.asideMenuCssClasses, true);
|
|
89
84
|
}
|
|
90
85
|
};
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
className =
|
|
95
|
-
children =
|
|
96
|
-
Tag =
|
|
97
|
-
attributes =
|
|
87
|
+
_proto.render = function render() {
|
|
88
|
+
var _this$props = this.props,
|
|
89
|
+
className = _this$props.className,
|
|
90
|
+
children = _this$props.children,
|
|
91
|
+
Tag = _this$props.tag,
|
|
92
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
98
93
|
|
|
99
94
|
delete attributes.display;
|
|
100
95
|
delete attributes.fixed;
|
|
101
96
|
delete attributes.offCanvas;
|
|
102
97
|
delete attributes.isOpen;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Tag,
|
|
108
|
-
_extends({}, attributes, { className: classes }),
|
|
109
|
-
children
|
|
110
|
-
);
|
|
98
|
+
var classes = (0, _classnames["default"])(className, 'aside-menu');
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement(Tag, _extends({}, attributes, {
|
|
100
|
+
className: classes
|
|
101
|
+
}), children);
|
|
111
102
|
};
|
|
112
103
|
|
|
113
104
|
return AppAside;
|
|
@@ -115,6 +106,6 @@ var AppAside = function (_Component) {
|
|
|
115
106
|
|
|
116
107
|
AppAside.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
117
108
|
AppAside.defaultProps = defaultProps;
|
|
118
|
-
|
|
119
|
-
exports
|
|
120
|
-
module.exports = exports
|
|
109
|
+
var _default = AppAside;
|
|
110
|
+
exports["default"] = _default;
|
|
111
|
+
module.exports = exports.default;
|