@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.
Files changed (56) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/es/Aside.js +29 -37
  3. package/es/AsideToggler.js +36 -44
  4. package/es/Breadcrumb.js +51 -58
  5. package/es/Breadcrumb2.js +52 -60
  6. package/es/Footer.js +24 -32
  7. package/es/Header.js +23 -35
  8. package/es/HeaderDropdown.js +23 -27
  9. package/es/NavbarBrand.js +32 -39
  10. package/es/Shared/classes.js +0 -3
  11. package/es/Shared/element-closest.js +2 -0
  12. package/es/Shared/index.js +0 -1
  13. package/es/Shared/layout/layout.js +24 -16
  14. package/es/Shared/toggle-classes.js +2 -0
  15. package/es/Sidebar.js +43 -53
  16. package/es/SidebarFooter.js +19 -29
  17. package/es/SidebarForm.js +19 -29
  18. package/es/SidebarHeader.js +19 -29
  19. package/es/SidebarMinimizer.js +30 -35
  20. package/es/SidebarNav.js +128 -162
  21. package/es/SidebarNav2.js +178 -202
  22. package/es/SidebarToggler.js +35 -36
  23. package/es/Switch.js +59 -62
  24. package/lib/Aside.js +51 -60
  25. package/lib/AsideToggler.js +58 -67
  26. package/lib/Breadcrumb.js +71 -77
  27. package/lib/Breadcrumb2.js +72 -79
  28. package/lib/Footer.js +40 -47
  29. package/lib/Header.js +39 -50
  30. package/lib/HeaderDropdown.js +36 -37
  31. package/lib/NavbarBrand.js +50 -56
  32. package/lib/Shared/classes.js +8 -6
  33. package/lib/Shared/element-closest.js +3 -1
  34. package/lib/Shared/index.js +2 -3
  35. package/lib/Shared/layout/layout.js +31 -19
  36. package/lib/Shared/toggle-classes.js +6 -2
  37. package/lib/Sidebar.js +69 -81
  38. package/lib/SidebarFooter.js +33 -42
  39. package/lib/SidebarForm.js +33 -42
  40. package/lib/SidebarHeader.js +33 -42
  41. package/lib/SidebarMinimizer.js +51 -55
  42. package/lib/SidebarNav.js +154 -187
  43. package/lib/SidebarNav2.js +211 -236
  44. package/lib/SidebarToggler.js +56 -58
  45. package/lib/Switch.js +90 -92
  46. package/lib/index.js +36 -55
  47. package/package.json +14 -14
  48. package/umd/main.d0f057e5.css +5 -0
  49. package/umd/main.d0f057e5.css.map +1 -0
  50. package/umd/{@coreui/react.js → react.js} +918 -1076
  51. package/umd/react.min.js +38 -0
  52. package/umd/react.min.js.map +1 -0
  53. package/umd/@coreui/react.min.js +0 -44
  54. package/umd/@coreui/react.min.js.map +0 -1
  55. package/umd/main.a93373b7.css +0 -148
  56. package/umd/main.a93373b7.css.map +0 -1
package/es/SidebarNav2.js CHANGED
@@ -1,14 +1,12 @@
1
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
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
- 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; };
3
+ 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); }
4
4
 
5
- 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; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
8
8
 
9
- 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; }
10
-
11
- 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; }
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
10
 
13
11
  import React, { Component } from 'react';
14
12
  import { Badge, Nav, NavItem, NavLink as RsNavLink } from 'reactstrap';
@@ -17,10 +15,8 @@ import PropTypes from 'prop-types';
17
15
  import PerfectScrollbar from 'react-perfect-scrollbar';
18
16
  import 'react-perfect-scrollbar/dist/css/styles.css';
19
17
  import '../css/scrollbar.css';
20
-
21
18
  import LayoutHelper from './Shared/layout/layout';
22
-
23
- var propTypes = {
19
+ var propTypes = process.env.NODE_ENV !== "production" ? {
24
20
  children: PropTypes.node,
25
21
  className: PropTypes.string,
26
22
  navConfig: PropTypes.any,
@@ -30,8 +26,7 @@ var propTypes = {
30
26
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
31
27
  router: PropTypes.any,
32
28
  props: PropTypes.any
33
- };
34
-
29
+ } : {};
35
30
  var defaultProps = {
36
31
  tag: 'nav',
37
32
  navConfig: {
@@ -39,174 +34,165 @@ var defaultProps = {
39
34
  name: 'Dashboard',
40
35
  url: '/dashboard',
41
36
  icon: 'icon-speedometer',
42
- badge: { variant: 'info', text: 'NEW' }
37
+ badge: {
38
+ variant: 'info',
39
+ text: 'NEW'
40
+ }
43
41
  }]
44
42
  },
45
43
  isOpen: false,
46
- router: { RsNavLink: RsNavLink }
44
+ router: {
45
+ RsNavLink: RsNavLink
46
+ }
47
47
  };
48
48
 
49
- var AppSidebarNav2 = function (_Component) {
50
- _inherits(AppSidebarNav2, _Component);
49
+ var AppSidebarNav2 = /*#__PURE__*/function (_Component) {
50
+ _inheritsLoose(AppSidebarNav2, _Component);
51
51
 
52
52
  function AppSidebarNav2(props) {
53
- _classCallCheck(this, AppSidebarNav2);
54
-
55
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
56
-
57
- _this._scrollBarRef = null;
53
+ var _this;
58
54
 
55
+ _this = _Component.call(this, props) || this;
59
56
 
60
- _this.handleClick = _this.handleClick.bind(_this);
61
- _this.activeRoute = _this.activeRoute.bind(_this);
62
- _this.hideMobile = _this.hideMobile.bind(_this);
57
+ _defineProperty(_assertThisInitialized(_this), "_scrollBarRef", null);
63
58
 
59
+ _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
60
+ _this.activeRoute = _this.activeRoute.bind(_assertThisInitialized(_this));
61
+ _this.hideMobile = _this.hideMobile.bind(_assertThisInitialized(_this));
64
62
  _this.changes = null;
65
- _this.state = { sidebarMinimized: false };
63
+ _this.state = {
64
+ sidebarMinimized: false
65
+ };
66
66
  return _this;
67
67
  }
68
68
 
69
- AppSidebarNav2.prototype.handleClick = function handleClick(e, item) {
69
+ var _proto = AppSidebarNav2.prototype;
70
+
71
+ _proto.handleClick = function handleClick(e, item) {
70
72
  if (item.attributes && typeof item.attributes.onClick === 'function' && !this.isActiveRoute(item.url, this.props)) {
71
73
  item.attributes.onClick(e, item);
72
74
  } else {
73
75
  e.preventDefault();
74
76
  }
77
+
75
78
  e.currentTarget.parentElement.classList.toggle('open');
76
79
  };
77
80
 
78
- AppSidebarNav2.prototype.isActiveRoute = function isActiveRoute(routeName, props) {
81
+ _proto.isActiveRoute = function isActiveRoute(routeName, props) {
79
82
  return props.location.pathname.indexOf(routeName) > -1;
80
83
  };
81
84
 
82
- AppSidebarNav2.prototype.activeRoute = function activeRoute(routeName, props) {
85
+ _proto.activeRoute = function activeRoute(routeName, props) {
83
86
  return this.isActiveRoute(routeName, props) ? 'nav-item nav-dropdown open' : 'nav-item nav-dropdown';
84
87
  };
85
88
 
86
- AppSidebarNav2.prototype.hideMobile = function hideMobile() {
89
+ _proto.hideMobile = function hideMobile() {
87
90
  if (document.body.classList.contains('sidebar-show')) {
88
91
  document.body.classList.toggle('sidebar-show');
89
92
  }
90
93
  };
91
94
 
92
- AppSidebarNav2.prototype.getAttribs = function getAttribs(attributes) {
95
+ _proto.getAttribs = function getAttribs(attributes) {
93
96
  return _extends({}, attributes);
94
- };
97
+ } // nav list
98
+ ;
95
99
 
96
- // nav list
97
-
98
-
99
- AppSidebarNav2.prototype.navList = function navList(items) {
100
+ _proto.navList = function navList(items) {
100
101
  var _this2 = this;
101
102
 
102
103
  return items.map(function (item, index) {
103
104
  return _this2.navType(item, index);
104
105
  });
105
- };
106
+ } // nav type
107
+ ;
106
108
 
107
- // nav type
108
-
109
-
110
- AppSidebarNav2.prototype.navType = function navType(item, idx) {
109
+ _proto.navType = function navType(item, idx) {
111
110
  return item.title ? this.navTitle(item, idx) : item.divider ? this.navDivider(item, idx) : item.label ? this.navLabel(item, idx) : item.children ? this.navDropdown(item, idx) : this.navItem(item, idx);
112
- };
113
-
114
- // nav list section title
115
-
116
-
117
- AppSidebarNav2.prototype.navTitle = function navTitle(title, key) {
118
- var classes = classNames('nav-title', title.class, title.className);
119
- return React.createElement(
120
- 'li',
121
- { key: key, className: classes },
122
- this.navWrapper(title),
123
- ' '
124
- );
125
- };
126
-
127
- // simple wrapper for nav-title item
128
-
129
-
130
- AppSidebarNav2.prototype.navWrapper = function navWrapper(item) {
111
+ } // nav list section title
112
+ ;
113
+
114
+ _proto.navTitle = function navTitle(title, key) {
115
+ var classes = classNames('nav-title', title["class"], title.className);
116
+ return /*#__PURE__*/React.createElement("li", {
117
+ key: key,
118
+ className: classes
119
+ }, this.navWrapper(title), " ");
120
+ } // simple wrapper for nav-title item
121
+ ;
122
+
123
+ _proto.navWrapper = function navWrapper(item) {
131
124
  return item.wrapper && item.wrapper.element ? React.createElement(item.wrapper.element, item.wrapper.attributes, item.name) : item.name;
132
- };
133
-
134
- // nav list divider
135
-
136
-
137
- AppSidebarNav2.prototype.navDivider = function navDivider(divider, key) {
138
- var classes = classNames('divider', divider.class, divider.className);
139
- return React.createElement('li', { key: key, className: classes });
140
- };
141
-
142
- // nav label with nav link
143
-
125
+ } // nav list divider
126
+ ;
127
+
128
+ _proto.navDivider = function navDivider(divider, key) {
129
+ var classes = classNames('divider', divider["class"], divider.className);
130
+ return /*#__PURE__*/React.createElement("li", {
131
+ key: key,
132
+ className: classes
133
+ });
134
+ } // nav label with nav link
135
+ ;
144
136
 
145
- AppSidebarNav2.prototype.navLabel = function navLabel(item, key) {
137
+ _proto.navLabel = function navLabel(item, key) {
146
138
  var classes = {
147
- item: classNames('hidden-cn', item.class),
148
- link: classNames('nav-label', item.class ? item.class : ''),
149
- icon: classNames('nav-icon', !item.icon ? 'fa fa-circle' : item.icon, item.label.variant ? 'text-' + item.label.variant : '', item.label.class ? item.label.class : '')
139
+ item: classNames('hidden-cn', item["class"]),
140
+ link: classNames('nav-label', item["class"] ? item["class"] : ''),
141
+ icon: classNames('nav-icon', !item.icon ? 'fa fa-circle' : item.icon, item.label.variant ? "text-" + item.label.variant : '', item.label["class"] ? item.label["class"] : '')
150
142
  };
151
143
  return this.navLink(item, key, classes);
152
- };
153
-
154
- // nav dropdown
144
+ } // nav dropdown
145
+ ;
155
146
 
156
-
157
- AppSidebarNav2.prototype.navDropdown = function navDropdown(item, key) {
147
+ _proto.navDropdown = function navDropdown(item, key) {
158
148
  var _this3 = this;
159
149
 
160
150
  var itemIcon = this.navIcon(item);
161
151
  var attributes = this.getAttribs(item.attributes);
162
- var classes = classNames('nav-link', 'nav-dropdown-toggle', item.class, attributes.class, attributes.className);
163
- delete attributes.class;
152
+ var classes = classNames('nav-link', 'nav-dropdown-toggle', item["class"], attributes["class"], attributes.className);
153
+ delete attributes["class"];
164
154
  delete attributes.className;
165
155
  var itemAttr = this.getAttribs(item.itemAttr);
166
- var liClasses = classNames('nav-item', 'nav-dropdown', itemAttr.class, itemAttr.className);
167
- delete itemAttr.class;
156
+ var liClasses = classNames('nav-item', 'nav-dropdown', itemAttr["class"], itemAttr.className);
157
+ delete itemAttr["class"];
168
158
  delete itemAttr.className;
169
159
  var NavLink = this.props.router.NavLink || RsNavLink;
170
-
171
- return React.createElement(
172
- 'li',
173
- _extends({ key: key, className: classNames(liClasses, { 'open': this.isActiveRoute(item.url, this.props) }) }, itemAttr),
174
- React.createElement(
175
- NavLink,
176
- _extends({ activeClassName: 'open',
177
- className: classes,
178
- to: item.url || ''
179
- }, attributes, {
180
- onClick: function onClick(e) {
181
- return _this3.handleClick(e, item);
182
- } }),
183
- itemIcon,
184
- item.name,
185
- this.navBadge(item.badge)
186
- ),
187
- React.createElement(
188
- 'ul',
189
- { className: 'nav-dropdown-items' },
190
- this.navList(item.children)
191
- )
192
- );
193
- };
194
-
195
- // nav item with nav link
196
-
197
-
198
- AppSidebarNav2.prototype.navItem = function navItem(item, key) {
160
+ return /*#__PURE__*/React.createElement("li", _extends({
161
+ key: key,
162
+ className: classNames(liClasses, {
163
+ 'open': this.isActiveRoute(item.url, this.props)
164
+ })
165
+ }, itemAttr), /*#__PURE__*/React.createElement(NavLink, _extends({
166
+ activeClassName: "open",
167
+ className: classes,
168
+ to: item.url || ''
169
+ }, attributes, {
170
+ onClick: function onClick(e) {
171
+ return _this3.handleClick(e, item);
172
+ }
173
+ }), itemIcon, item.name, this.navBadge(item.badge)), /*#__PURE__*/React.createElement("ul", {
174
+ className: "nav-dropdown-items"
175
+ }, this.navList(item.children)));
176
+ } // nav item with nav link
177
+ ;
178
+
179
+ _proto.navItem = function navItem(item, key) {
199
180
  var classes = {
200
- item: classNames(item.class),
201
- link: classNames('nav-link', item.variant ? 'nav-link-' + item.variant : ''),
181
+ item: classNames(item["class"]),
182
+ link: classNames('nav-link', item.variant ? "nav-link-" + item.variant : ''),
202
183
  icon: classNames('nav-icon', item.icon)
203
184
  };
204
185
  return this.navLink(item, key, classes);
205
186
  };
206
187
 
207
- AppSidebarNav2.prototype.navIcon = function navIcon(item) {
188
+ _proto.navIcon = function navIcon(item) {
208
189
  var icon = item.icon;
209
- var iconObject = (typeof icon === 'undefined' ? 'undefined' : _typeof(icon)) === 'object' && icon !== null ? _extends({ iconClass: icon.class, iconClassName: icon.className }, icon) : { iconClass: icon };
190
+ var iconObject = typeof icon === 'object' && icon !== null ? _extends({
191
+ iconClass: icon["class"],
192
+ iconClassName: icon.className
193
+ }, icon) : {
194
+ iconClass: icon
195
+ };
210
196
  var iconClass = iconObject.iconClass,
211
197
  iconClassName = iconObject.iconClassName,
212
198
  innerText = iconObject.innerText,
@@ -214,24 +200,24 @@ var AppSidebarNav2 = function (_Component) {
214
200
  attributes = iconObject.attributes;
215
201
 
216
202
  var iconAttr = _extends({}, attributes);
217
- delete iconAttr.class;
203
+
204
+ delete iconAttr["class"];
218
205
  delete iconAttr.className;
219
206
  delete iconAttr.img;
220
207
  var iconImg = img && img.src ? img : null;
221
208
  var iconInner = innerText || null;
222
209
  var classIcon = classNames('nav-icon', iconClass, iconClassName);
223
- var iconComponent = iconImg ? React.createElement('img', _extends({}, iconAttr, { className: classIcon, src: iconImg.src })) : React.createElement(
224
- 'i',
225
- _extends({}, iconAttr, { className: classIcon }),
226
- iconInner
227
- );
210
+ var iconComponent = iconImg ? /*#__PURE__*/React.createElement("img", _extends({}, iconAttr, {
211
+ className: classIcon,
212
+ src: iconImg.src
213
+ })) : /*#__PURE__*/React.createElement("i", _extends({}, iconAttr, {
214
+ className: classIcon
215
+ }), iconInner);
228
216
  return iconComponent;
229
- };
217
+ } // nav link
218
+ ;
230
219
 
231
- // nav link
232
-
233
-
234
- AppSidebarNav2.prototype.navLink = function navLink(item, key, classes) {
220
+ _proto.navLink = function navLink(item, key, classes) {
235
221
  var _this4 = this;
236
222
 
237
223
  var ref = React.createRef();
@@ -239,72 +225,65 @@ var AppSidebarNav2 = function (_Component) {
239
225
  var itemIcon = this.navIcon(item);
240
226
  var itemBadge = this.navBadge(item.badge);
241
227
  var attributes = this.getAttribs(item.attributes);
242
- classes.link = classNames(classes.link, attributes.class, attributes.className);
243
- delete attributes.class;
228
+ classes.link = classNames(classes.link, attributes["class"], attributes.className);
229
+ delete attributes["class"];
244
230
  delete attributes.className;
245
231
  var itemAttr = this.getAttribs(item.itemAttr);
246
- classes.item = classNames(classes.item, itemAttr.class, itemAttr.className);
247
- delete itemAttr.class;
232
+ classes.item = classNames(classes.item, itemAttr["class"], itemAttr.className);
233
+ delete itemAttr["class"];
248
234
  delete itemAttr.className;
249
235
  var NavLink = this.props.router.NavLink || RsNavLink;
250
- return React.createElement(
251
- NavItem,
252
- _extends({ key: key, className: classes.item }, itemAttr),
253
- attributes.disabled ? React.createElement(
254
- RsNavLink,
255
- _extends({ href: '', className: classes.link }, attributes),
256
- itemIcon,
257
- item.name,
258
- itemBadge
259
- ) : this.isExternal(url, this.props) || NavLink === RsNavLink ? React.createElement(
260
- RsNavLink,
261
- _extends({ href: url, className: classes.link, active: true }, attributes),
262
- itemIcon,
263
- item.name,
264
- itemBadge
265
- ) : React.createElement(
266
- NavLink,
267
- _extends({ to: url, className: classes.link, activeClassName: 'active', onClick: function onClick() {
268
- return _this4.hideMobile(ref);
269
- }, ref: ref }, attributes),
270
- itemIcon,
271
- item.name,
272
- itemBadge
273
- )
274
- );
275
- };
276
-
277
- // badge addon to NavItem
278
-
279
-
280
- AppSidebarNav2.prototype.navBadge = function navBadge(badge) {
236
+ return /*#__PURE__*/React.createElement(NavItem, _extends({
237
+ key: key,
238
+ className: classes.item
239
+ }, itemAttr), attributes.disabled ? /*#__PURE__*/React.createElement(RsNavLink, _extends({
240
+ href: '',
241
+ className: classes.link
242
+ }, attributes), itemIcon, item.name, itemBadge) : this.isExternal(url, this.props) || NavLink === RsNavLink ? /*#__PURE__*/React.createElement(RsNavLink, _extends({
243
+ href: url,
244
+ className: classes.link,
245
+ active: true
246
+ }, attributes), itemIcon, item.name, itemBadge) : /*#__PURE__*/React.createElement(NavLink, _extends({
247
+ to: url,
248
+ className: classes.link,
249
+ activeClassName: "active",
250
+ onClick: function onClick() {
251
+ return _this4.hideMobile(ref);
252
+ },
253
+ ref: ref
254
+ }, attributes), itemIcon, item.name, itemBadge));
255
+ } // badge addon to NavItem
256
+ ;
257
+
258
+ _proto.navBadge = function navBadge(badge) {
281
259
  if (badge) {
282
- var classes = classNames(badge.class, badge.className);
283
- return React.createElement(
284
- Badge,
285
- { className: classes, color: badge.variant },
286
- badge.text
287
- );
260
+ var classes = classNames(badge["class"], badge.className);
261
+ return /*#__PURE__*/React.createElement(Badge, {
262
+ className: classes,
263
+ color: badge.variant
264
+ }, badge.text);
288
265
  }
266
+
289
267
  return null;
290
268
  };
291
269
 
292
- AppSidebarNav2.prototype.isExternal = function isExternal(url, props) {
293
- var linkType = typeof url === 'undefined' ? 'undefined' : _typeof(url);
294
- var link = linkType === 'string' ? url : linkType === 'object' && url.pathname ? url.pathname : linkType === 'function' && typeof url(props.location) === 'string' ? url(props.location) : linkType === 'function' && _typeof(url(props.location)) === 'object' ? url(props.location).pathname : '';
270
+ _proto.isExternal = function isExternal(url, props) {
271
+ var linkType = typeof url;
272
+ var link = linkType === 'string' ? url : linkType === 'object' && url.pathname ? url.pathname : linkType === 'function' && typeof url(props.location) === 'string' ? url(props.location) : linkType === 'function' && typeof url(props.location) === 'object' ? url(props.location).pathname : '';
295
273
  return link.substring(0, 4) === 'http';
296
274
  };
297
275
 
298
- AppSidebarNav2.prototype.observeDomMutations = function observeDomMutations() {
276
+ _proto.observeDomMutations = function observeDomMutations() {
299
277
  var _this5 = this;
300
278
 
301
279
  if (window.MutationObserver) {
302
-
303
280
  // eslint-disable-next-line
304
281
  this.changes = new MutationObserver(function (mutations) {
305
-
306
282
  var isSidebarMinimized = document.body.classList.contains('sidebar-minimized') || false;
307
- _this5.setState({ sidebarMinimized: isSidebarMinimized });
283
+
284
+ _this5.setState({
285
+ sidebarMinimized: isSidebarMinimized
286
+ });
308
287
 
309
288
  LayoutHelper.sidebarPSToggle(!isSidebarMinimized);
310
289
  });
@@ -314,18 +293,19 @@ var AppSidebarNav2 = function (_Component) {
314
293
  attributeFilter: ['class']
315
294
  });
316
295
  }
296
+
317
297
  window.addEventListener('resize', this.onResize);
318
298
  };
319
299
 
320
- AppSidebarNav2.prototype.onResize = function onResize() {
300
+ _proto.onResize = function onResize() {
321
301
  LayoutHelper.sidebarPSToggle(true);
322
302
  };
323
303
 
324
- AppSidebarNav2.prototype.componentDidMount = function componentDidMount() {
304
+ _proto.componentDidMount = function componentDidMount() {
325
305
  this.observeDomMutations();
326
306
  };
327
307
 
328
- AppSidebarNav2.prototype.componentWillUnmount = function componentWillUnmount() {
308
+ _proto.componentWillUnmount = function componentWillUnmount() {
329
309
  try {
330
310
  this.changes.disconnect();
331
311
  window.removeEventListener('resize', this.onResize);
@@ -335,36 +315,33 @@ var AppSidebarNav2 = function (_Component) {
335
315
  }
336
316
  };
337
317
 
338
- AppSidebarNav2.prototype.render = function render() {
318
+ _proto.render = function render() {
339
319
  var _this6 = this;
340
320
 
341
- var _props = this.props,
342
- className = _props.className,
343
- children = _props.children,
344
- navConfig = _props.navConfig,
345
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'navConfig']);
321
+ var _this$props = this.props,
322
+ className = _this$props.className,
323
+ children = _this$props.children,
324
+ navConfig = _this$props.navConfig,
325
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "navConfig"]);
346
326
 
347
327
  delete attributes.isOpen;
348
328
  delete attributes.staticContext;
349
329
  delete attributes.Tag;
350
330
  delete attributes.router;
351
-
352
331
  var navClasses = classNames(className, 'sidebar-nav');
353
-
354
- var options = Object.assign({}, { suppressScrollX: true, suppressScrollY: this.state.sidebarMinimized });
355
-
356
- // sidebar-nav root
357
- return React.createElement(
358
- PerfectScrollbar,
359
- _extends({ className: navClasses }, attributes, { options: options, ref: function ref(_ref) {
360
- _this6._scrollBarRef = _ref;
361
- } }),
362
- React.createElement(
363
- Nav,
364
- null,
365
- children || this.navList(navConfig.items)
366
- )
367
- );
332
+ var options = Object.assign({}, {
333
+ suppressScrollX: true,
334
+ suppressScrollY: this.state.sidebarMinimized
335
+ }); // sidebar-nav root
336
+
337
+ return /*#__PURE__*/React.createElement(PerfectScrollbar, _extends({
338
+ className: navClasses
339
+ }, attributes, {
340
+ options: options,
341
+ ref: function ref(_ref) {
342
+ _this6._scrollBarRef = _ref;
343
+ }
344
+ }), /*#__PURE__*/React.createElement(Nav, null, children || this.navList(navConfig.items)));
368
345
  };
369
346
 
370
347
  return AppSidebarNav2;
@@ -372,5 +349,4 @@ var AppSidebarNav2 = function (_Component) {
372
349
 
373
350
  AppSidebarNav2.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
374
351
  AppSidebarNav2.defaultProps = defaultProps;
375
-
376
352
  export default AppSidebarNav2;