@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/es/Breadcrumb2.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
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 { Breadcrumb, BreadcrumbItem } from 'reactstrap';
|
|
13
9
|
import PropTypes from 'prop-types';
|
|
14
10
|
import classNames from 'classnames';
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
var router = void 0;
|
|
11
|
+
var routes;
|
|
12
|
+
var router;
|
|
18
13
|
|
|
19
14
|
var getPaths = function getPaths(pathname) {
|
|
20
15
|
var paths = ['/'];
|
|
21
|
-
|
|
22
16
|
if (pathname === '/') return paths;
|
|
23
|
-
|
|
24
17
|
pathname.split('/').reduce(function (prev, curr) {
|
|
25
|
-
var currPath = prev +
|
|
18
|
+
var currPath = prev + "/" + curr;
|
|
26
19
|
paths.push(currPath);
|
|
27
20
|
return currPath;
|
|
28
21
|
});
|
|
@@ -32,34 +25,29 @@ var getPaths = function getPaths(pathname) {
|
|
|
32
25
|
var findRouteName2 = function findRouteName2(url) {
|
|
33
26
|
var matchPath = router.matchPath;
|
|
34
27
|
var aroute = routes.find(function (route) {
|
|
35
|
-
return matchPath(url, {
|
|
28
|
+
return matchPath(url, {
|
|
29
|
+
path: route.path,
|
|
30
|
+
exact: route.exact
|
|
31
|
+
});
|
|
36
32
|
});
|
|
37
33
|
return aroute && aroute.name ? aroute.name : null;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
var BreadcrumbsItem2 = function BreadcrumbsItem2(_ref) {
|
|
41
37
|
var match = _ref.match;
|
|
42
|
-
|
|
43
38
|
var routeName = findRouteName2(match.url);
|
|
44
39
|
var Link = router.Link;
|
|
40
|
+
|
|
45
41
|
if (routeName) {
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
) : React.createElement(
|
|
53
|
-
BreadcrumbItem,
|
|
54
|
-
null,
|
|
55
|
-
React.createElement(
|
|
56
|
-
Link,
|
|
57
|
-
{ to: match.url || '' },
|
|
58
|
-
routeName
|
|
59
|
-
)
|
|
60
|
-
)
|
|
42
|
+
return (// eslint-disable-next-line react/prop-types
|
|
43
|
+
match.isExact ? /*#__PURE__*/React.createElement(BreadcrumbItem, {
|
|
44
|
+
active: true
|
|
45
|
+
}, routeName) : /*#__PURE__*/React.createElement(BreadcrumbItem, null, /*#__PURE__*/React.createElement(Link, {
|
|
46
|
+
to: match.url || ''
|
|
47
|
+
}, routeName))
|
|
61
48
|
);
|
|
62
49
|
}
|
|
50
|
+
|
|
63
51
|
return null;
|
|
64
52
|
};
|
|
65
53
|
|
|
@@ -73,62 +61,67 @@ var Breadcrumbs2 = function Breadcrumbs2(args) {
|
|
|
73
61
|
var Route = router.Route;
|
|
74
62
|
var paths = getPaths(args.location.pathname);
|
|
75
63
|
var items = paths.map(function (path, i) {
|
|
76
|
-
return React.createElement(Route, {
|
|
64
|
+
return /*#__PURE__*/React.createElement(Route, {
|
|
65
|
+
key: i.toString(),
|
|
66
|
+
path: path,
|
|
67
|
+
component: BreadcrumbsItem2
|
|
68
|
+
});
|
|
77
69
|
});
|
|
78
|
-
return React.createElement(
|
|
79
|
-
Breadcrumb,
|
|
80
|
-
null,
|
|
81
|
-
items
|
|
82
|
-
);
|
|
70
|
+
return /*#__PURE__*/React.createElement(Breadcrumb, null, items);
|
|
83
71
|
};
|
|
84
72
|
|
|
85
|
-
var propTypes = {
|
|
73
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
86
74
|
children: PropTypes.node,
|
|
87
75
|
className: PropTypes.string,
|
|
88
76
|
appRoutes: PropTypes.any,
|
|
89
77
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
90
78
|
router: PropTypes.any
|
|
91
|
-
};
|
|
92
|
-
|
|
79
|
+
} : {};
|
|
93
80
|
var defaultProps = {
|
|
94
81
|
tag: 'div',
|
|
95
82
|
className: '',
|
|
96
|
-
appRoutes: [{
|
|
83
|
+
appRoutes: [{
|
|
84
|
+
path: '/',
|
|
85
|
+
exact: true,
|
|
86
|
+
name: 'Home',
|
|
87
|
+
component: null
|
|
88
|
+
}]
|
|
97
89
|
};
|
|
98
90
|
|
|
99
|
-
var AppBreadcrumb2 = function (_Component) {
|
|
100
|
-
|
|
91
|
+
var AppBreadcrumb2 = /*#__PURE__*/function (_Component) {
|
|
92
|
+
_inheritsLoose(AppBreadcrumb2, _Component);
|
|
101
93
|
|
|
102
94
|
function AppBreadcrumb2(props) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
|
95
|
+
var _this;
|
|
106
96
|
|
|
107
|
-
_this
|
|
97
|
+
_this = _Component.call(this, props) || this;
|
|
98
|
+
_this.state = {
|
|
99
|
+
routes: props.appRoutes
|
|
100
|
+
};
|
|
108
101
|
routes = _this.state.routes;
|
|
109
102
|
router = props.router;
|
|
110
103
|
return _this;
|
|
111
104
|
}
|
|
112
105
|
|
|
113
|
-
AppBreadcrumb2.prototype
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
var _proto = AppBreadcrumb2.prototype;
|
|
107
|
+
|
|
108
|
+
_proto.render = function render() {
|
|
109
|
+
var _this$props = this.props,
|
|
110
|
+
className = _this$props.className,
|
|
111
|
+
Tag = _this$props.tag,
|
|
112
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "tag"]);
|
|
118
113
|
|
|
119
114
|
delete attributes.children;
|
|
120
115
|
delete attributes.appRoutes;
|
|
121
116
|
delete attributes.router;
|
|
122
|
-
|
|
123
117
|
var classes = classNames(className);
|
|
124
|
-
|
|
125
118
|
var Route = router.Route;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
);
|
|
119
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
120
|
+
className: classes
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Route, _extends({
|
|
122
|
+
path: "/:path",
|
|
123
|
+
component: Breadcrumbs2
|
|
124
|
+
}, attributes)));
|
|
132
125
|
};
|
|
133
126
|
|
|
134
127
|
return AppBreadcrumb2;
|
|
@@ -136,5 +129,4 @@ var AppBreadcrumb2 = function (_Component) {
|
|
|
136
129
|
|
|
137
130
|
AppBreadcrumb2.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
138
131
|
AppBreadcrumb2.defaultProps = defaultProps;
|
|
139
|
-
|
|
140
132
|
export default AppBreadcrumb2;
|
package/es/Footer.js
CHANGED
|
@@ -1,67 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
10
8
|
|
|
11
9
|
import React, { Component } from 'react';
|
|
12
10
|
import PropTypes from 'prop-types';
|
|
13
11
|
import classNames from 'classnames';
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
12
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
16
13
|
children: PropTypes.node,
|
|
17
14
|
className: PropTypes.string,
|
|
18
15
|
fixed: PropTypes.bool,
|
|
19
16
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
20
|
-
};
|
|
21
|
-
|
|
17
|
+
} : {};
|
|
22
18
|
var defaultProps = {
|
|
23
19
|
tag: 'footer',
|
|
24
20
|
fixed: false
|
|
25
21
|
};
|
|
26
22
|
|
|
27
|
-
var AppFooter = function (_Component) {
|
|
28
|
-
|
|
23
|
+
var AppFooter = /*#__PURE__*/function (_Component) {
|
|
24
|
+
_inheritsLoose(AppFooter, _Component);
|
|
29
25
|
|
|
30
26
|
function AppFooter(props) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
|
27
|
+
var _this;
|
|
34
28
|
|
|
35
|
-
_this
|
|
29
|
+
_this = _Component.call(this, props) || this;
|
|
30
|
+
_this.isFixed = _this.isFixed.bind(_assertThisInitialized(_this));
|
|
36
31
|
return _this;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
AppFooter.prototype
|
|
34
|
+
var _proto = AppFooter.prototype;
|
|
35
|
+
|
|
36
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
40
37
|
this.isFixed(this.props.fixed);
|
|
41
38
|
};
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
44
41
|
if (fixed) {
|
|
45
42
|
document.body.classList.add('footer-fixed');
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
className =
|
|
52
|
-
children =
|
|
53
|
-
Tag =
|
|
54
|
-
attributes =
|
|
46
|
+
_proto.render = function render() {
|
|
47
|
+
var _this$props = this.props,
|
|
48
|
+
className = _this$props.className,
|
|
49
|
+
children = _this$props.children,
|
|
50
|
+
Tag = _this$props.tag,
|
|
51
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
55
52
|
|
|
56
53
|
delete attributes.fixed;
|
|
57
|
-
|
|
58
54
|
var classes = classNames(className, 'app-footer');
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
_extends({ className: classes }, attributes),
|
|
63
|
-
children
|
|
64
|
-
);
|
|
55
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
56
|
+
className: classes
|
|
57
|
+
}, attributes), children);
|
|
65
58
|
};
|
|
66
59
|
|
|
67
60
|
return AppFooter;
|
|
@@ -69,5 +62,4 @@ var AppFooter = function (_Component) {
|
|
|
69
62
|
|
|
70
63
|
AppFooter.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
71
64
|
AppFooter.defaultProps = defaultProps;
|
|
72
|
-
|
|
73
65
|
export default AppFooter;
|
package/es/Header.js
CHANGED
|
@@ -1,68 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
10
6
|
|
|
11
7
|
import React, { Component } from 'react';
|
|
12
8
|
import PropTypes from 'prop-types';
|
|
13
9
|
import classNames from 'classnames';
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
10
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
16
11
|
children: PropTypes.node,
|
|
17
12
|
className: PropTypes.string,
|
|
18
13
|
fixed: PropTypes.bool,
|
|
19
14
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
20
|
-
};
|
|
21
|
-
|
|
15
|
+
} : {};
|
|
22
16
|
var defaultProps = {
|
|
23
17
|
tag: 'header',
|
|
24
18
|
fixed: false
|
|
25
19
|
};
|
|
26
20
|
|
|
27
|
-
var AppHeader = function (_Component) {
|
|
28
|
-
|
|
21
|
+
var AppHeader = /*#__PURE__*/function (_Component) {
|
|
22
|
+
_inheritsLoose(AppHeader, _Component);
|
|
29
23
|
|
|
30
24
|
function AppHeader() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
25
|
+
return _Component.apply(this, arguments) || this;
|
|
34
26
|
}
|
|
35
27
|
|
|
36
|
-
AppHeader.prototype
|
|
28
|
+
var _proto = AppHeader.prototype;
|
|
29
|
+
|
|
30
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
37
31
|
this.isFixed(this.props.fixed);
|
|
38
32
|
};
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
_proto.isFixed = function isFixed(fixed) {
|
|
41
35
|
if (fixed) {
|
|
42
36
|
document.body.classList.add('header-fixed');
|
|
43
37
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// breakpoint(breakpoint) {
|
|
38
|
+
} // breakpoint(breakpoint) {
|
|
47
39
|
// return breakpoint || '';
|
|
48
40
|
// }
|
|
41
|
+
;
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
className =
|
|
53
|
-
children =
|
|
54
|
-
Tag =
|
|
55
|
-
attributes =
|
|
43
|
+
_proto.render = function render() {
|
|
44
|
+
var _this$props = this.props,
|
|
45
|
+
className = _this$props.className,
|
|
46
|
+
children = _this$props.children,
|
|
47
|
+
Tag = _this$props.tag,
|
|
48
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
56
49
|
|
|
57
50
|
delete attributes.fixed;
|
|
58
|
-
|
|
59
51
|
var classes = classNames(className, 'app-header', 'navbar');
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_extends({ className: classes }, attributes),
|
|
64
|
-
children
|
|
65
|
-
);
|
|
52
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
53
|
+
className: classes
|
|
54
|
+
}, attributes), children);
|
|
66
55
|
};
|
|
67
56
|
|
|
68
57
|
return AppHeader;
|
|
@@ -70,5 +59,4 @@ var AppHeader = function (_Component) {
|
|
|
70
59
|
|
|
71
60
|
AppHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
72
61
|
AppHeader.defaultProps = defaultProps;
|
|
73
|
-
|
|
74
62
|
export default AppHeader;
|
package/es/HeaderDropdown.js
CHANGED
|
@@ -1,57 +1,54 @@
|
|
|
1
|
-
var
|
|
1
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
7
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
8
|
|
|
11
9
|
import React, { Component } from 'react';
|
|
12
10
|
import { Dropdown } from 'reactstrap';
|
|
13
11
|
import PropTypes from 'prop-types';
|
|
14
|
-
|
|
15
|
-
var propTypes = _extends({
|
|
12
|
+
var propTypes = process.env.NODE_ENV !== "production" ? _extends({
|
|
16
13
|
children: PropTypes.node,
|
|
17
14
|
direction: PropTypes.string
|
|
18
|
-
}, Dropdown.propTypes);
|
|
19
|
-
|
|
15
|
+
}, Dropdown.propTypes) : {};
|
|
20
16
|
var defaultProps = {
|
|
21
17
|
direction: 'down'
|
|
22
18
|
};
|
|
23
19
|
|
|
24
|
-
var AppHeaderDropdown = function (_Component) {
|
|
25
|
-
|
|
20
|
+
var AppHeaderDropdown = /*#__PURE__*/function (_Component) {
|
|
21
|
+
_inheritsLoose(AppHeaderDropdown, _Component);
|
|
26
22
|
|
|
27
23
|
function AppHeaderDropdown(props) {
|
|
28
|
-
|
|
24
|
+
var _this;
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_this.toggle = _this.toggle.bind(_this);
|
|
26
|
+
_this = _Component.call(this, props) || this;
|
|
27
|
+
_this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
|
33
28
|
_this.state = {
|
|
34
29
|
dropdownOpen: false
|
|
35
30
|
};
|
|
36
31
|
return _this;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
AppHeaderDropdown.prototype
|
|
34
|
+
var _proto = AppHeaderDropdown.prototype;
|
|
35
|
+
|
|
36
|
+
_proto.toggle = function toggle() {
|
|
40
37
|
this.setState({
|
|
41
38
|
dropdownOpen: !this.state.dropdownOpen
|
|
42
39
|
});
|
|
43
40
|
};
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
children =
|
|
48
|
-
attributes =
|
|
42
|
+
_proto.render = function render() {
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
children = _this$props.children,
|
|
45
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["children"]);
|
|
49
46
|
|
|
50
|
-
return React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
47
|
+
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
48
|
+
nav: true,
|
|
49
|
+
isOpen: this.state.dropdownOpen,
|
|
50
|
+
toggle: this.toggle
|
|
51
|
+
}, attributes), children);
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
return AppHeaderDropdown;
|
|
@@ -59,5 +56,4 @@ var AppHeaderDropdown = function (_Component) {
|
|
|
59
56
|
|
|
60
57
|
AppHeaderDropdown.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
61
58
|
AppHeaderDropdown.defaultProps = defaultProps;
|
|
62
|
-
|
|
63
59
|
export default AppHeaderDropdown;
|
package/es/NavbarBrand.js
CHANGED
|
@@ -1,57 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
5
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
10
6
|
|
|
11
7
|
import React, { Component } from 'react';
|
|
12
8
|
import PropTypes from 'prop-types';
|
|
13
9
|
import classNames from 'classnames';
|
|
14
|
-
|
|
15
|
-
var propTypes = {
|
|
10
|
+
var propTypes = process.env.NODE_ENV !== "production" ? {
|
|
16
11
|
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
17
12
|
children: PropTypes.node,
|
|
18
13
|
className: PropTypes.string,
|
|
19
14
|
brand: PropTypes.any,
|
|
20
15
|
full: PropTypes.any,
|
|
21
16
|
minimized: PropTypes.any
|
|
22
|
-
};
|
|
23
|
-
|
|
17
|
+
} : {};
|
|
24
18
|
var defaultProps = {
|
|
25
19
|
tag: 'a'
|
|
26
20
|
};
|
|
27
21
|
|
|
28
|
-
var AppNavbarBrand = function (_Component) {
|
|
29
|
-
|
|
22
|
+
var AppNavbarBrand = /*#__PURE__*/function (_Component) {
|
|
23
|
+
_inheritsLoose(AppNavbarBrand, _Component);
|
|
30
24
|
|
|
31
25
|
function AppNavbarBrand() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
|
26
|
+
return _Component.apply(this, arguments) || this;
|
|
35
27
|
}
|
|
36
28
|
|
|
37
|
-
AppNavbarBrand.prototype
|
|
29
|
+
var _proto = AppNavbarBrand.prototype;
|
|
30
|
+
|
|
31
|
+
_proto.imgSrc = function imgSrc(brand) {
|
|
38
32
|
return brand.src ? brand.src : '';
|
|
39
33
|
};
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
_proto.imgWidth = function imgWidth(brand) {
|
|
42
36
|
return brand.width ? brand.width : 'auto';
|
|
43
37
|
};
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
_proto.imgHeight = function imgHeight(brand) {
|
|
46
40
|
return brand.height ? brand.height : 'auto';
|
|
47
41
|
};
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
_proto.imgAlt = function imgAlt(brand) {
|
|
50
44
|
return brand.alt ? brand.alt : '';
|
|
51
45
|
};
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
return React.createElement(
|
|
47
|
+
_proto.navbarBrandImg = function navbarBrandImg(props, classBrand, key) {
|
|
48
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
55
49
|
src: this.imgSrc(props),
|
|
56
50
|
width: this.imgWidth(props),
|
|
57
51
|
height: this.imgHeight(props),
|
|
@@ -61,37 +55,37 @@ var AppNavbarBrand = function (_Component) {
|
|
|
61
55
|
});
|
|
62
56
|
};
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
className =
|
|
67
|
-
children =
|
|
68
|
-
Tag =
|
|
69
|
-
attributes =
|
|
58
|
+
_proto.render = function render() {
|
|
59
|
+
var _this$props = this.props,
|
|
60
|
+
className = _this$props.className,
|
|
61
|
+
children = _this$props.children,
|
|
62
|
+
Tag = _this$props.tag,
|
|
63
|
+
attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
|
|
70
64
|
|
|
71
65
|
var classes = classNames(className, 'navbar-brand');
|
|
72
|
-
|
|
73
66
|
var img = [];
|
|
67
|
+
|
|
74
68
|
if (this.props.brand) {
|
|
75
69
|
var props = this.props.brand;
|
|
76
70
|
var classBrand = 'navbar-brand';
|
|
77
71
|
img.push(this.navbarBrandImg(props, classBrand, img.length + 1));
|
|
78
72
|
}
|
|
73
|
+
|
|
79
74
|
if (this.props.full) {
|
|
80
|
-
var
|
|
75
|
+
var _props = this.props.full;
|
|
81
76
|
var _classBrand = 'navbar-brand-full';
|
|
82
|
-
img.push(this.navbarBrandImg(
|
|
77
|
+
img.push(this.navbarBrandImg(_props, _classBrand, img.length + 1));
|
|
83
78
|
}
|
|
79
|
+
|
|
84
80
|
if (this.props.minimized) {
|
|
85
|
-
var
|
|
81
|
+
var _props2 = this.props.minimized;
|
|
86
82
|
var _classBrand2 = 'navbar-brand-minimized';
|
|
87
|
-
img.push(this.navbarBrandImg(
|
|
83
|
+
img.push(this.navbarBrandImg(_props2, _classBrand2, img.length + 1));
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
return React.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
children || img
|
|
94
|
-
);
|
|
86
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({}, attributes, {
|
|
87
|
+
className: classes
|
|
88
|
+
}), children || img);
|
|
95
89
|
};
|
|
96
90
|
|
|
97
91
|
return AppNavbarBrand;
|
|
@@ -99,5 +93,4 @@ var AppNavbarBrand = function (_Component) {
|
|
|
99
93
|
|
|
100
94
|
AppNavbarBrand.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
101
95
|
AppNavbarBrand.defaultProps = defaultProps;
|
|
102
|
-
|
|
103
96
|
export default AppNavbarBrand;
|
package/es/Shared/classes.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export var sidebarCssClasses = ['sidebar-show', 'sidebar-sm-show', 'sidebar-md-show', 'sidebar-lg-show', 'sidebar-xl-show'];
|
|
2
|
-
|
|
3
2
|
export var asideMenuCssClasses = ['aside-menu-show', 'aside-menu-sm-show', 'aside-menu-md-show', 'aside-menu-lg-show', 'aside-menu-xl-show'];
|
|
4
|
-
|
|
5
3
|
export var validBreakpoints = ['sm', 'md', 'lg', 'xl'];
|
|
6
|
-
|
|
7
4
|
export function checkBreakpoint(breakpoint, list) {
|
|
8
5
|
return list.indexOf(breakpoint) > -1;
|
|
9
6
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
if (!ElementProto) {
|
|
3
3
|
return;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
if (typeof ElementProto.matches !== 'function') {
|
|
6
7
|
ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
|
|
7
8
|
var element = this;
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
if (element.matches(selector)) {
|
|
25
26
|
return element;
|
|
26
27
|
}
|
|
28
|
+
|
|
27
29
|
element = element.parentNode;
|
|
28
30
|
}
|
|
29
31
|
|
package/es/Shared/index.js
CHANGED