@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.
Files changed (58) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/css/scrollbar.css +18 -0
  3. package/es/Aside.js +29 -37
  4. package/es/AsideToggler.js +36 -44
  5. package/es/Breadcrumb.js +51 -58
  6. package/es/Breadcrumb2.js +52 -60
  7. package/es/Footer.js +24 -32
  8. package/es/Header.js +23 -35
  9. package/es/HeaderDropdown.js +23 -27
  10. package/es/NavbarBrand.js +32 -39
  11. package/es/Shared/classes.js +0 -3
  12. package/es/Shared/element-closest.js +2 -0
  13. package/es/Shared/index.js +0 -1
  14. package/es/Shared/layout/layout.js +75 -16
  15. package/es/Shared/toggle-classes.js +2 -0
  16. package/es/Sidebar.js +43 -53
  17. package/es/SidebarFooter.js +19 -29
  18. package/es/SidebarForm.js +19 -29
  19. package/es/SidebarHeader.js +19 -29
  20. package/es/SidebarMinimizer.js +30 -35
  21. package/es/SidebarNav.js +128 -162
  22. package/es/SidebarNav2.js +249 -174
  23. package/es/SidebarToggler.js +35 -36
  24. package/es/Switch.js +59 -62
  25. package/lib/Aside.js +51 -60
  26. package/lib/AsideToggler.js +58 -67
  27. package/lib/Breadcrumb.js +71 -77
  28. package/lib/Breadcrumb2.js +72 -79
  29. package/lib/Footer.js +40 -47
  30. package/lib/Header.js +39 -50
  31. package/lib/HeaderDropdown.js +36 -37
  32. package/lib/NavbarBrand.js +50 -56
  33. package/lib/Shared/classes.js +8 -6
  34. package/lib/Shared/element-closest.js +3 -1
  35. package/lib/Shared/index.js +2 -3
  36. package/lib/Shared/layout/layout.js +82 -19
  37. package/lib/Shared/toggle-classes.js +6 -2
  38. package/lib/Sidebar.js +69 -81
  39. package/lib/SidebarFooter.js +33 -42
  40. package/lib/SidebarForm.js +33 -42
  41. package/lib/SidebarHeader.js +33 -42
  42. package/lib/SidebarMinimizer.js +51 -55
  43. package/lib/SidebarNav.js +154 -187
  44. package/lib/SidebarNav2.js +275 -198
  45. package/lib/SidebarToggler.js +56 -58
  46. package/lib/Switch.js +90 -92
  47. package/lib/index.js +36 -55
  48. package/package.json +21 -20
  49. package/umd/main.d0f057e5.css +5 -0
  50. package/umd/main.d0f057e5.css.map +1 -0
  51. package/umd/react.js +6069 -0
  52. package/umd/react.min.js +38 -0
  53. package/umd/react.min.js.map +1 -0
  54. package/umd/@coreui/react.js +0 -11849
  55. package/umd/@coreui/react.min.js +0 -77
  56. package/umd/@coreui/react.min.js.map +0 -1
  57. package/umd/main.a25994ba.css +0 -129
  58. package/umd/main.a25994ba.css.map +0 -1
package/es/Breadcrumb2.js CHANGED
@@ -1,28 +1,21 @@
1
- var _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; };
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 _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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 routes = void 0;
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 + '/' + curr;
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, { path: route.path, exact: route.exact });
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
- // eslint-disable-next-line react/prop-types
48
- match.isExact ? React.createElement(
49
- BreadcrumbItem,
50
- { active: true },
51
- routeName
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, { key: i.toString(), path: path, component: BreadcrumbsItem2 });
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: [{ path: '/', exact: true, name: 'Home', component: null }]
83
+ appRoutes: [{
84
+ path: '/',
85
+ exact: true,
86
+ name: 'Home',
87
+ component: null
88
+ }]
97
89
  };
98
90
 
99
- var AppBreadcrumb2 = function (_Component) {
100
- _inherits(AppBreadcrumb2, _Component);
91
+ var AppBreadcrumb2 = /*#__PURE__*/function (_Component) {
92
+ _inheritsLoose(AppBreadcrumb2, _Component);
101
93
 
102
94
  function AppBreadcrumb2(props) {
103
- _classCallCheck(this, AppBreadcrumb2);
104
-
105
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
95
+ var _this;
106
96
 
107
- _this.state = { routes: props.appRoutes };
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.render = function render() {
114
- var _props = this.props,
115
- className = _props.className,
116
- Tag = _props.tag,
117
- attributes = _objectWithoutProperties(_props, ['className', 'tag']);
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
- return React.createElement(
128
- Tag,
129
- { className: classes },
130
- React.createElement(Route, _extends({ path: '/:path', component: Breadcrumbs2 }, attributes))
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
- var _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; };
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 _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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 _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; }
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
- _inherits(AppFooter, _Component);
23
+ var AppFooter = /*#__PURE__*/function (_Component) {
24
+ _inheritsLoose(AppFooter, _Component);
29
25
 
30
26
  function AppFooter(props) {
31
- _classCallCheck(this, AppFooter);
32
-
33
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
27
+ var _this;
34
28
 
35
- _this.isFixed = _this.isFixed.bind(_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.componentDidMount = function componentDidMount() {
34
+ var _proto = AppFooter.prototype;
35
+
36
+ _proto.componentDidMount = function componentDidMount() {
40
37
  this.isFixed(this.props.fixed);
41
38
  };
42
39
 
43
- AppFooter.prototype.isFixed = function isFixed(fixed) {
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
- AppFooter.prototype.render = function render() {
50
- var _props = this.props,
51
- className = _props.className,
52
- children = _props.children,
53
- Tag = _props.tag,
54
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
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
- return React.createElement(
61
- Tag,
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
- var _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; };
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 _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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
- _inherits(AppHeader, _Component);
21
+ var AppHeader = /*#__PURE__*/function (_Component) {
22
+ _inheritsLoose(AppHeader, _Component);
29
23
 
30
24
  function AppHeader() {
31
- _classCallCheck(this, AppHeader);
32
-
33
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
25
+ return _Component.apply(this, arguments) || this;
34
26
  }
35
27
 
36
- AppHeader.prototype.componentDidMount = function componentDidMount() {
28
+ var _proto = AppHeader.prototype;
29
+
30
+ _proto.componentDidMount = function componentDidMount() {
37
31
  this.isFixed(this.props.fixed);
38
32
  };
39
33
 
40
- AppHeader.prototype.isFixed = function isFixed(fixed) {
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
- AppHeader.prototype.render = function render() {
51
- var _props = this.props,
52
- className = _props.className,
53
- children = _props.children,
54
- Tag = _props.tag,
55
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
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
- return React.createElement(
62
- Tag,
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;
@@ -1,57 +1,54 @@
1
- var _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; };
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 _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
6
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; }
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
- _inherits(AppHeaderDropdown, _Component);
20
+ var AppHeaderDropdown = /*#__PURE__*/function (_Component) {
21
+ _inheritsLoose(AppHeaderDropdown, _Component);
26
22
 
27
23
  function AppHeaderDropdown(props) {
28
- _classCallCheck(this, AppHeaderDropdown);
24
+ var _this;
29
25
 
30
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
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.toggle = function toggle() {
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
- AppHeaderDropdown.prototype.render = function render() {
46
- var _props = this.props,
47
- children = _props.children,
48
- attributes = _objectWithoutProperties(_props, ['children']);
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
- Dropdown,
52
- _extends({ nav: true, isOpen: this.state.dropdownOpen, toggle: this.toggle }, attributes),
53
- children
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
- var _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; };
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 _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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
- _inherits(AppNavbarBrand, _Component);
22
+ var AppNavbarBrand = /*#__PURE__*/function (_Component) {
23
+ _inheritsLoose(AppNavbarBrand, _Component);
30
24
 
31
25
  function AppNavbarBrand() {
32
- _classCallCheck(this, AppNavbarBrand);
33
-
34
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
26
+ return _Component.apply(this, arguments) || this;
35
27
  }
36
28
 
37
- AppNavbarBrand.prototype.imgSrc = function imgSrc(brand) {
29
+ var _proto = AppNavbarBrand.prototype;
30
+
31
+ _proto.imgSrc = function imgSrc(brand) {
38
32
  return brand.src ? brand.src : '';
39
33
  };
40
34
 
41
- AppNavbarBrand.prototype.imgWidth = function imgWidth(brand) {
35
+ _proto.imgWidth = function imgWidth(brand) {
42
36
  return brand.width ? brand.width : 'auto';
43
37
  };
44
38
 
45
- AppNavbarBrand.prototype.imgHeight = function imgHeight(brand) {
39
+ _proto.imgHeight = function imgHeight(brand) {
46
40
  return brand.height ? brand.height : 'auto';
47
41
  };
48
42
 
49
- AppNavbarBrand.prototype.imgAlt = function imgAlt(brand) {
43
+ _proto.imgAlt = function imgAlt(brand) {
50
44
  return brand.alt ? brand.alt : '';
51
45
  };
52
46
 
53
- AppNavbarBrand.prototype.navbarBrandImg = function navbarBrandImg(props, classBrand, key) {
54
- return React.createElement('img', {
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
- AppNavbarBrand.prototype.render = function render() {
65
- var _props = this.props,
66
- className = _props.className,
67
- children = _props.children,
68
- Tag = _props.tag,
69
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
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 _props2 = this.props.full;
75
+ var _props = this.props.full;
81
76
  var _classBrand = 'navbar-brand-full';
82
- img.push(this.navbarBrandImg(_props2, _classBrand, img.length + 1));
77
+ img.push(this.navbarBrandImg(_props, _classBrand, img.length + 1));
83
78
  }
79
+
84
80
  if (this.props.minimized) {
85
- var _props3 = this.props.minimized;
81
+ var _props2 = this.props.minimized;
86
82
  var _classBrand2 = 'navbar-brand-minimized';
87
- img.push(this.navbarBrandImg(_props3, _classBrand2, img.length + 1));
83
+ img.push(this.navbarBrandImg(_props2, _classBrand2, img.length + 1));
88
84
  }
89
85
 
90
- return React.createElement(
91
- Tag,
92
- _extends({}, attributes, { className: classes }),
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;
@@ -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
 
@@ -1,3 +1,2 @@
1
1
  import { sidebarCssClasses, asideMenuCssClasses, validBreakpoints, checkBreakpoint } from './classes';
2
-
3
2
  export { sidebarCssClasses, asideMenuCssClasses, validBreakpoints, checkBreakpoint };