@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/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  ### [@coreui/react](https://coreui.io/) changelog
2
2
 
3
+ ##### `v2.5.8`
4
+ - chore(demo/polyfill): update to core-js v3
5
+
6
+ ###### dependencies update
7
+ - update: `core-js` to `^3.6.5`
8
+ - update: `react` to `^16.13.1`
9
+ - update: `react-dom` to `^16.13.1`
10
+ - update: `react-router-dom` to `^5.2.0`
11
+ - update: `mutationobserver-shim` to `^0.3.5`
12
+ - update: `eslint` to `^7.0.0`
13
+ - update: `eslint-plugin-import` to `^2.20.2`
14
+ - update: `eslint-plugin-react` to `^7.20.0`
15
+ - update: `nwb` to `^0.24.7`
16
+ - update: `react` to `^16.13.1`
17
+ - update: `react-dom` to `^16.13.1`
18
+ - update: `react-router-dom` to `^5.2.0`
19
+ - update: `sinon` to `^9.0.2`
20
+
21
+ ##### `v2.5.7`
22
+ - fix(SidebarNav): add missing alternative icon config object
23
+
24
+ ##### `v2.5.6`
25
+ - fix(SidebarNav): navigate to route on AppSideBarNav parent menu click - thanx @regimani #98
26
+
27
+ ###### dependencies update
28
+ - update `react` to `^16.13.0`
29
+ - update `react-dom` to `^16.13.0`
30
+
31
+ ##### `v2.5.5`
32
+ - fix(SidebarNav): perfect scrollbar issue on sidebar minimized / rtl
33
+ - chore: dependencies update and config refactor
34
+
3
35
  ##### `v2.5.4`
4
36
  - fix(SidebarNav): allow location object as navConfig item url parameter
5
37
 
@@ -0,0 +1,18 @@
1
+ /* rtl fix */
2
+ .ps__rtl .ps__rail-y {
3
+ left: 0px !important;
4
+ right: unset;
5
+ }
6
+ *[dir="rtl"] .ps__rail-y {
7
+ left: 0px !important;
8
+ right: unset;
9
+ }
10
+
11
+ .ps__rtl .ps__thumb-y {
12
+ left: 2px;
13
+ right: unset;
14
+ }
15
+ *[dir="rtl"] .ps__thumb-y {
16
+ left: 2px;
17
+ right: unset;
18
+ }
package/es/Aside.js CHANGED
@@ -1,20 +1,17 @@
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
12
  import { asideMenuCssClasses, checkBreakpoint, validBreakpoints } from './Shared';
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.string,
@@ -22,8 +19,7 @@ var propTypes = {
22
19
  isOpen: PropTypes.bool,
23
20
  offCanvas: PropTypes.bool,
24
21
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
25
- };
26
-
22
+ } : {};
27
23
  var defaultProps = {
28
24
  tag: 'aside',
29
25
  display: '',
@@ -32,64 +28,61 @@ var defaultProps = {
32
28
  offCanvas: true
33
29
  };
34
30
 
35
- var AppAside = function (_Component) {
36
- _inherits(AppAside, _Component);
31
+ var AppAside = /*#__PURE__*/function (_Component) {
32
+ _inheritsLoose(AppAside, _Component);
37
33
 
38
34
  function AppAside(props) {
39
- _classCallCheck(this, AppAside);
40
-
41
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
35
+ var _this;
42
36
 
43
- _this.isFixed = _this.isFixed.bind(_this);
44
- _this.isOffCanvas = _this.isOffCanvas.bind(_this);
45
- _this.displayBreakpoint = _this.displayBreakpoint.bind(_this);
37
+ _this = _Component.call(this, props) || this;
38
+ _this.isFixed = _this.isFixed.bind(_assertThisInitialized(_this));
39
+ _this.isOffCanvas = _this.isOffCanvas.bind(_assertThisInitialized(_this));
40
+ _this.displayBreakpoint = _this.displayBreakpoint.bind(_assertThisInitialized(_this));
46
41
  return _this;
47
42
  }
48
43
 
49
- AppAside.prototype.componentDidMount = function componentDidMount() {
44
+ var _proto = AppAside.prototype;
45
+
46
+ _proto.componentDidMount = function componentDidMount() {
50
47
  this.isFixed(this.props.fixed);
51
48
  this.isOffCanvas(this.props.offCanvas);
52
49
  this.displayBreakpoint(this.props.display);
53
50
  };
54
51
 
55
- AppAside.prototype.isFixed = function isFixed(fixed) {
52
+ _proto.isFixed = function isFixed(fixed) {
56
53
  if (fixed) {
57
54
  document.body.classList.add('aside-menu-fixed');
58
55
  }
59
56
  };
60
57
 
61
- AppAside.prototype.isOffCanvas = function isOffCanvas(offCanvas) {
58
+ _proto.isOffCanvas = function isOffCanvas(offCanvas) {
62
59
  if (offCanvas) {
63
60
  document.body.classList.add('aside-menu-off-canvas');
64
61
  }
65
62
  };
66
63
 
67
- AppAside.prototype.displayBreakpoint = function displayBreakpoint(display) {
64
+ _proto.displayBreakpoint = function displayBreakpoint(display) {
68
65
  if (display && checkBreakpoint(display, validBreakpoints)) {
69
- var cssClass = 'aside-menu-' + display + '-show';
66
+ var cssClass = "aside-menu-" + display + "-show";
70
67
  toggleClasses(cssClass, asideMenuCssClasses, true);
71
68
  }
72
69
  };
73
70
 
74
- AppAside.prototype.render = function render() {
75
- var _props = this.props,
76
- className = _props.className,
77
- children = _props.children,
78
- Tag = _props.tag,
79
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
71
+ _proto.render = function render() {
72
+ var _this$props = this.props,
73
+ className = _this$props.className,
74
+ children = _this$props.children,
75
+ Tag = _this$props.tag,
76
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
80
77
 
81
78
  delete attributes.display;
82
79
  delete attributes.fixed;
83
80
  delete attributes.offCanvas;
84
81
  delete attributes.isOpen;
85
-
86
82
  var classes = classNames(className, 'aside-menu');
87
-
88
- return React.createElement(
89
- Tag,
90
- _extends({}, attributes, { className: classes }),
91
- children
92
- );
83
+ return /*#__PURE__*/React.createElement(Tag, _extends({}, attributes, {
84
+ className: classes
85
+ }), children);
93
86
  };
94
87
 
95
88
  return AppAside;
@@ -97,5 +90,4 @@ var AppAside = function (_Component) {
97
90
 
98
91
  AppAside.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
99
92
  AppAside.defaultProps = defaultProps;
100
-
101
93
  export default AppAside;
@@ -1,20 +1,17 @@
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
12
  import { asideMenuCssClasses, 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
  defaultOpen: PropTypes.bool,
@@ -22,8 +19,7 @@ var propTypes = {
22
19
  mobile: PropTypes.bool,
23
20
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
24
21
  type: PropTypes.string
25
- };
26
-
22
+ } : {};
27
23
  var defaultProps = {
28
24
  defaultOpen: false,
29
25
  display: 'lg',
@@ -32,69 +28,66 @@ var defaultProps = {
32
28
  type: 'button'
33
29
  };
34
30
 
35
- var AppAsideToggler = function (_Component) {
36
- _inherits(AppAsideToggler, _Component);
31
+ var AppAsideToggler = /*#__PURE__*/function (_Component) {
32
+ _inheritsLoose(AppAsideToggler, _Component);
37
33
 
38
34
  function AppAsideToggler(props) {
39
- _classCallCheck(this, AppAsideToggler);
40
-
41
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
42
-
43
- _this.asideToggle = _this.asideToggle.bind(_this);
35
+ var _this;
44
36
 
37
+ _this = _Component.call(this, props) || this;
38
+ _this.asideToggle = _this.asideToggle.bind(_assertThisInitialized(_this));
45
39
  _this.state = {};
46
40
  return _this;
47
41
  }
48
42
 
49
- AppAsideToggler.prototype.componentDidMount = function componentDidMount() {
43
+ var _proto = AppAsideToggler.prototype;
44
+
45
+ _proto.componentDidMount = function componentDidMount() {
50
46
  this.toggle(this.props.defaultOpen);
51
47
  };
52
48
 
53
- AppAsideToggler.prototype.toggle = function toggle(force) {
49
+ _proto.toggle = function toggle(force) {
54
50
  var _ref = [this.props.display, this.props.mobile],
55
51
  display = _ref[0],
56
52
  mobile = _ref[1];
57
-
58
53
  var cssClass = asideMenuCssClasses[0];
54
+
59
55
  if (!mobile && display && checkBreakpoint(display, validBreakpoints)) {
60
- cssClass = 'aside-menu-' + display + '-show';
56
+ cssClass = "aside-menu-" + display + "-show";
61
57
  }
58
+
62
59
  toggleClasses(cssClass, asideMenuCssClasses, force);
63
60
  };
64
61
 
65
- AppAsideToggler.prototype.asideToggle = function asideToggle(e) {
62
+ _proto.asideToggle = function asideToggle(e) {
66
63
  e.preventDefault();
67
64
  this.toggle();
68
65
  };
69
66
 
70
- AppAsideToggler.prototype.render = function render() {
67
+ _proto.render = function render() {
71
68
  var _this2 = this;
72
69
 
73
- var _props = this.props,
74
- className = _props.className,
75
- children = _props.children,
76
- type = _props.type,
77
- Tag = _props.tag,
78
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'type', 'tag']);
70
+ var _this$props = this.props,
71
+ className = _this$props.className,
72
+ children = _this$props.children,
73
+ type = _this$props.type,
74
+ Tag = _this$props.tag,
75
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "type", "tag"]);
79
76
 
80
77
  delete attributes.defaultOpen;
81
78
  delete attributes.display;
82
79
  delete attributes.mobile;
83
-
84
80
  var classes = classNames(className, 'navbar-toggler');
85
-
86
- return React.createElement(
87
- Tag,
88
- _extends({
89
- type: type,
90
- className: classes
91
- }, attributes, {
92
- onClick: function onClick(event) {
93
- return _this2.asideToggle(event);
94
- }
95
- }),
96
- children || React.createElement('span', { className: 'navbar-toggler-icon' })
97
- );
81
+ return /*#__PURE__*/React.createElement(Tag, _extends({
82
+ type: type,
83
+ className: classes
84
+ }, attributes, {
85
+ onClick: function onClick(event) {
86
+ return _this2.asideToggle(event);
87
+ }
88
+ }), children || /*#__PURE__*/React.createElement("span", {
89
+ className: "navbar-toggler-icon"
90
+ }));
98
91
  };
99
92
 
100
93
  return AppAsideToggler;
@@ -102,5 +95,4 @@ var AppAsideToggler = function (_Component) {
102
95
 
103
96
  AppAsideToggler.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
104
97
  AppAsideToggler.defaultProps = defaultProps;
105
-
106
98
  export default AppAsideToggler;
package/es/Breadcrumb.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 { Route, Link, matchPath } from 'react-router-dom';
13
9
  import { Breadcrumb, BreadcrumbItem } from 'reactstrap';
14
10
  import PropTypes from 'prop-types';
15
11
  import classNames from 'classnames';
16
-
17
- var routes = void 0;
12
+ var routes;
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
  });
@@ -31,33 +24,28 @@ var getPaths = function getPaths(pathname) {
31
24
 
32
25
  var findRouteName = function findRouteName(url) {
33
26
  var aroute = routes.find(function (route) {
34
- return matchPath(url, { path: route.path, exact: route.exact });
27
+ return matchPath(url, {
28
+ path: route.path,
29
+ exact: route.exact
30
+ });
35
31
  });
36
32
  return aroute && aroute.name ? aroute.name : null;
37
33
  };
38
34
 
39
35
  var BreadcrumbsItem = function BreadcrumbsItem(_ref) {
40
36
  var match = _ref.match;
41
-
42
37
  var routeName = findRouteName(match.url);
38
+
43
39
  if (routeName) {
44
- return (
45
- // eslint-disable-next-line react/prop-types
46
- match.isExact ? React.createElement(
47
- BreadcrumbItem,
48
- { active: true },
49
- routeName
50
- ) : React.createElement(
51
- BreadcrumbItem,
52
- null,
53
- React.createElement(
54
- Link,
55
- { to: match.url || '' },
56
- routeName
57
- )
58
- )
40
+ return (// eslint-disable-next-line react/prop-types
41
+ match.isExact ? /*#__PURE__*/React.createElement(BreadcrumbItem, {
42
+ active: true
43
+ }, routeName) : /*#__PURE__*/React.createElement(BreadcrumbItem, null, /*#__PURE__*/React.createElement(Link, {
44
+ to: match.url || ''
45
+ }, routeName))
59
46
  );
60
47
  }
48
+
61
49
  return null;
62
50
  };
63
51
 
@@ -70,57 +58,63 @@ BreadcrumbsItem.propTypes = process.env.NODE_ENV !== "production" ? {
70
58
  var Breadcrumbs = function Breadcrumbs(args) {
71
59
  var paths = getPaths(args.location.pathname);
72
60
  var items = paths.map(function (path, i) {
73
- return React.createElement(Route, { key: i.toString(), path: path, component: BreadcrumbsItem });
61
+ return /*#__PURE__*/React.createElement(Route, {
62
+ key: i.toString(),
63
+ path: path,
64
+ component: BreadcrumbsItem
65
+ });
74
66
  });
75
- return React.createElement(
76
- Breadcrumb,
77
- null,
78
- items
79
- );
67
+ return /*#__PURE__*/React.createElement(Breadcrumb, null, items);
80
68
  };
81
69
 
82
- var propTypes = {
70
+ var propTypes = process.env.NODE_ENV !== "production" ? {
83
71
  children: PropTypes.node,
84
72
  className: PropTypes.string,
85
73
  appRoutes: PropTypes.any,
86
74
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
87
- };
88
-
75
+ } : {};
89
76
  var defaultProps = {
90
77
  tag: 'div',
91
78
  className: '',
92
- appRoutes: [{ path: '/', exact: true, name: 'Home', component: null }]
79
+ appRoutes: [{
80
+ path: '/',
81
+ exact: true,
82
+ name: 'Home',
83
+ component: null
84
+ }]
93
85
  };
94
86
 
95
- var AppBreadcrumb = function (_Component) {
96
- _inherits(AppBreadcrumb, _Component);
87
+ var AppBreadcrumb = /*#__PURE__*/function (_Component) {
88
+ _inheritsLoose(AppBreadcrumb, _Component);
97
89
 
98
90
  function AppBreadcrumb(props) {
99
- _classCallCheck(this, AppBreadcrumb);
91
+ var _this;
100
92
 
101
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
102
-
103
- _this.state = { routes: props.appRoutes };
93
+ _this = _Component.call(this, props) || this;
94
+ _this.state = {
95
+ routes: props.appRoutes
96
+ };
104
97
  routes = _this.state.routes;
105
98
  return _this;
106
99
  }
107
100
 
108
- AppBreadcrumb.prototype.render = function render() {
109
- var _props = this.props,
110
- className = _props.className,
111
- Tag = _props.tag,
112
- attributes = _objectWithoutProperties(_props, ['className', 'tag']);
101
+ var _proto = AppBreadcrumb.prototype;
102
+
103
+ _proto.render = function render() {
104
+ var _this$props = this.props,
105
+ className = _this$props.className,
106
+ Tag = _this$props.tag,
107
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "tag"]);
113
108
 
114
109
  delete attributes.children;
115
110
  delete attributes.appRoutes;
116
-
117
111
  var classes = classNames(className);
118
-
119
- return React.createElement(
120
- Tag,
121
- { className: classes },
122
- React.createElement(Route, _extends({ path: '/:path', component: Breadcrumbs }, attributes))
123
- );
112
+ return /*#__PURE__*/React.createElement(Tag, {
113
+ className: classes
114
+ }, /*#__PURE__*/React.createElement(Route, _extends({
115
+ path: "/:path",
116
+ component: Breadcrumbs
117
+ }, attributes)));
124
118
  };
125
119
 
126
120
  return AppBreadcrumb;
@@ -128,5 +122,4 @@ var AppBreadcrumb = function (_Component) {
128
122
 
129
123
  AppBreadcrumb.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
130
124
  AppBreadcrumb.defaultProps = defaultProps;
131
-
132
125
  export default AppBreadcrumb;