@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
@@ -1,40 +1,78 @@
1
- var _class, _temp;
1
+ 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; }
2
2
 
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- var LayoutHelper = (_temp = _class = function () {
6
- function LayoutHelper() {
7
- _classCallCheck(this, LayoutHelper);
8
- }
3
+ var LayoutHelper = /*#__PURE__*/function () {
4
+ function LayoutHelper() {}
9
5
 
10
6
  LayoutHelper.sidebarToggle = function sidebarToggle(toggle) {
11
7
  var minimize = arguments.length ? toggle : !this.elClassList.contains('sidebar-minimized');
12
8
  this.sidebarMinimize(minimize);
13
9
  this.brandMinimize(minimize);
14
- this.sidebarPSToggle(!minimize); /*remove PS on sidebar minimized*/
10
+ this.sidebarPSToggle(!minimize);
11
+ /*remove PS on sidebar minimized*/
15
12
  };
16
13
 
17
14
  LayoutHelper.sidebarMinimize = function sidebarMinimize(force) {
18
- // return this.elClassList.toggle('sidebar-minimized', force);
19
15
  return this.toggleClass('sidebar-minimized', force);
20
16
  };
21
17
 
22
18
  LayoutHelper.brandMinimize = function brandMinimize(force) {
23
- // this.elClassList.toggle('brand-minimized', force);
24
19
  this.toggleClass('brand-minimized', force);
25
- };
26
-
27
- // sidebar perfect scrollbar
28
-
20
+ } // sidebar perfect scrollbar ugly hack
21
+ ;
29
22
 
30
23
  LayoutHelper.sidebarPSToggle = function sidebarPSToggle(toggle) {
24
+ if (this.isOnMobile()) {
25
+ toggle = true;
26
+ } else {
27
+ var isSidebarMinimized = document.body.classList.contains('sidebar-minimized') || false;
28
+ toggle = !isSidebarMinimized;
29
+ }
30
+
31
+ var ps = {
32
+ y: {
33
+ rail: {},
34
+ thumb: {}
35
+ }
36
+ };
37
+ var isRtl = getComputedStyle(document.documentElement).direction === 'rtl';
31
38
  var sidebar = document.querySelector('.sidebar-nav');
39
+ ps.y.rail.on = document.querySelector('.sidebar-nav .ps__rail-y');
40
+ ps.y.rail.off = document.querySelector('.sidebar-nav .ps__rail-y-off');
41
+ ps.y.thumb.on = document.querySelector('.sidebar-nav .ps__thumb-y');
42
+ ps.y.thumb.off = document.querySelector('.sidebar-nav .ps__thumb-y-off');
43
+
32
44
  if (sidebar) {
33
45
  if (toggle) {
34
46
  sidebar.classList.add('ps');
35
47
  sidebar.classList.add('ps-container');
36
48
  sidebar.classList.add('ps--active-y');
49
+
50
+ if (ps.y.rail.off) {
51
+ ps.y.rail.off.classList.add('ps__rail-y');
52
+ ps.y.rail.off.removeAttribute('style');
53
+ ps.y.rail.off.style.left = isRtl ? '0px' : 'unset';
54
+ ps.y.rail.off.style.right = isRtl ? 'unset' : '0px';
55
+ ps.y.rail.off.classList.remove('ps__rail-y-off');
56
+ }
57
+
58
+ if (ps.y.thumb.off) {
59
+ ps.y.thumb.off.removeAttribute('style');
60
+ ps.y.thumb.off.classList.add('ps__thumb-y');
61
+ ps.y.thumb.off.classList.remove('ps__thumb-y-off');
62
+ }
37
63
  } else {
64
+ if (ps.y.rail.on) {
65
+ ps.y.rail.on.classList.add('ps__rail-y-off');
66
+ ps.y.rail.on.removeAttribute('style');
67
+ ps.y.rail.on.classList.remove('ps__rail-y');
68
+ }
69
+
70
+ if (ps.y.thumb.on) {
71
+ ps.y.thumb.on.classList.add('ps__thumb-y-off');
72
+ ps.y.thumb.on.removeAttribute('style');
73
+ ps.y.thumb.on.classList.remove('ps__thumb-y');
74
+ }
75
+
38
76
  sidebar.classList.remove('ps');
39
77
  sidebar.classList.remove('ps-container');
40
78
  sidebar.classList.remove('ps--active-y');
@@ -43,7 +81,6 @@ var LayoutHelper = (_temp = _class = function () {
43
81
  };
44
82
 
45
83
  LayoutHelper.toggleClass = function toggleClass(className, force) {
46
-
47
84
  if (force === true) {
48
85
  this.elClassList.add(className);
49
86
  } else if (force === false) {
@@ -51,11 +88,33 @@ var LayoutHelper = (_temp = _class = function () {
51
88
  } else {
52
89
  this.elClassList.toggle(className);
53
90
  }
91
+
54
92
  return this.elClassList.contains(className);
55
93
  };
56
94
 
95
+ LayoutHelper.isOnMobile = function isOnMobile() {
96
+ var onMobile = false;
97
+
98
+ try {
99
+ var minimizerElement = document.querySelector('.sidebar-minimizer');
100
+
101
+ if (minimizerElement) {
102
+ onMobile = getComputedStyle(minimizerElement).getPropertyValue('display') === 'none';
103
+ } else {
104
+ var sidebarElement = document.querySelector('.sidebar .sidebar-nav');
105
+ sidebarElement && (onMobile = getComputedStyle(sidebarElement).getPropertyValue('overflow-y') === 'auto');
106
+ }
107
+ } catch (ignore) {
108
+ // eslint-disable-next-line
109
+ console.warn('CoreUI isOnMobile failed to getComputedStyle', ignore);
110
+ }
111
+
112
+ return onMobile;
113
+ };
114
+
57
115
  return LayoutHelper;
58
- }(), _class.elClassList = document.body.classList, _temp);
116
+ }();
59
117
 
118
+ _defineProperty(LayoutHelper, "elClassList", document.body.classList);
60
119
 
61
120
  export default LayoutHelper;
@@ -4,6 +4,7 @@ export default function toggleClasses(toggleClass, classList, force) {
4
4
  removeClassList.map(function (className) {
5
5
  return document.body.classList.remove(className);
6
6
  });
7
+
7
8
  if (force === true) {
8
9
  document.body.classList.add(toggleClass);
9
10
  } else if (force === false) {
@@ -11,5 +12,6 @@ export default function toggleClasses(toggleClass, classList, force) {
11
12
  } else {
12
13
  document.body.classList.toggle(toggleClass);
13
14
  }
15
+
14
16
  return document.body.classList.contains(toggleClass);
15
17
  }
package/es/Sidebar.js CHANGED
@@ -1,23 +1,19 @@
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 classNames from 'classnames';
13
11
  import PropTypes from 'prop-types';
14
12
  import { sidebarCssClasses } from './Shared';
15
13
  import ClickOutHandler from 'react-onclickout';
16
-
17
14
  import './Shared/element-closest';
18
15
  import LayoutHelper from './Shared/layout/layout';
19
-
20
- var propTypes = {
16
+ var propTypes = process.env.NODE_ENV !== "production" ? {
21
17
  children: PropTypes.node,
22
18
  className: PropTypes.string,
23
19
  compact: PropTypes.bool,
@@ -28,8 +24,7 @@ var propTypes = {
28
24
  offCanvas: PropTypes.bool,
29
25
  staticContext: PropTypes.any,
30
26
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
31
- };
32
-
27
+ } : {};
33
28
  var defaultProps = {
34
29
  tag: 'div',
35
30
  compact: false,
@@ -40,24 +35,25 @@ var defaultProps = {
40
35
  offCanvas: false
41
36
  };
42
37
 
43
- var AppSidebar = function (_Component) {
44
- _inherits(AppSidebar, _Component);
38
+ var AppSidebar = /*#__PURE__*/function (_Component) {
39
+ _inheritsLoose(AppSidebar, _Component);
45
40
 
46
41
  function AppSidebar(props) {
47
- _classCallCheck(this, AppSidebar);
48
-
49
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
50
-
51
- _this.isCompact = _this.isCompact.bind(_this);
52
- _this.isFixed = _this.isFixed.bind(_this);
53
- _this.isMinimized = _this.isMinimized.bind(_this);
54
- _this.isOffCanvas = _this.isOffCanvas.bind(_this);
55
- _this.displayBreakpoint = _this.displayBreakpoint.bind(_this);
56
- _this.hideMobile = _this.hideMobile.bind(_this);
42
+ var _this;
43
+
44
+ _this = _Component.call(this, props) || this;
45
+ _this.isCompact = _this.isCompact.bind(_assertThisInitialized(_this));
46
+ _this.isFixed = _this.isFixed.bind(_assertThisInitialized(_this));
47
+ _this.isMinimized = _this.isMinimized.bind(_assertThisInitialized(_this));
48
+ _this.isOffCanvas = _this.isOffCanvas.bind(_assertThisInitialized(_this));
49
+ _this.displayBreakpoint = _this.displayBreakpoint.bind(_assertThisInitialized(_this));
50
+ _this.hideMobile = _this.hideMobile.bind(_assertThisInitialized(_this));
57
51
  return _this;
58
52
  }
59
53
 
60
- AppSidebar.prototype.componentDidMount = function componentDidMount() {
54
+ var _proto = AppSidebar.prototype;
55
+
56
+ _proto.componentDidMount = function componentDidMount() {
61
57
  this.displayBreakpoint(this.props.display);
62
58
  this.isCompact(this.props.compact);
63
59
  this.isFixed(this.props.fixed);
@@ -65,46 +61,47 @@ var AppSidebar = function (_Component) {
65
61
  this.isOffCanvas(this.props.offCanvas);
66
62
  };
67
63
 
68
- AppSidebar.prototype.isCompact = function isCompact(compact) {
64
+ _proto.isCompact = function isCompact(compact) {
69
65
  if (compact) {
70
66
  document.body.classList.add('sidebar-compact');
71
67
  }
72
68
  };
73
69
 
74
- AppSidebar.prototype.isFixed = function isFixed(fixed) {
70
+ _proto.isFixed = function isFixed(fixed) {
75
71
  if (fixed) {
76
72
  document.body.classList.add('sidebar-fixed');
77
73
  }
78
74
  };
79
75
 
80
- AppSidebar.prototype.isMinimized = function isMinimized(minimized) {
76
+ _proto.isMinimized = function isMinimized(minimized) {
81
77
  LayoutHelper.sidebarToggle(minimized);
82
78
  };
83
79
 
84
- AppSidebar.prototype.isOffCanvas = function isOffCanvas(offCanvas) {
80
+ _proto.isOffCanvas = function isOffCanvas(offCanvas) {
85
81
  if (offCanvas) {
86
82
  document.body.classList.add('sidebar-off-canvas');
87
83
  }
88
84
  };
89
85
 
90
- AppSidebar.prototype.displayBreakpoint = function displayBreakpoint(display) {
91
- var cssTemplate = 'sidebar-' + display + '-show';
86
+ _proto.displayBreakpoint = function displayBreakpoint(display) {
87
+ var cssTemplate = "sidebar-" + display + "-show";
92
88
  var _sidebarCssClasses$ = sidebarCssClasses[0],
93
89
  cssClass = _sidebarCssClasses$[0];
94
90
 
95
91
  if (display && sidebarCssClasses.indexOf(cssTemplate) > -1) {
96
92
  cssClass = cssTemplate;
97
93
  }
94
+
98
95
  document.body.classList.add(cssClass);
99
96
  };
100
97
 
101
- AppSidebar.prototype.hideMobile = function hideMobile() {
98
+ _proto.hideMobile = function hideMobile() {
102
99
  if (document.body.classList.contains('sidebar-show')) {
103
100
  document.body.classList.remove('sidebar-show');
104
101
  }
105
102
  };
106
103
 
107
- AppSidebar.prototype.onClickOut = function onClickOut(e) {
104
+ _proto.onClickOut = function onClickOut(e) {
108
105
  if (typeof window !== 'undefined' && document.body.classList.contains('sidebar-show')) {
109
106
  if (!e.target.closest('[data-sidebar-toggler]')) {
110
107
  this.hideMobile();
@@ -112,14 +109,14 @@ var AppSidebar = function (_Component) {
112
109
  }
113
110
  };
114
111
 
115
- AppSidebar.prototype.render = function render() {
112
+ _proto.render = function render() {
116
113
  var _this2 = this;
117
114
 
118
- var _props = this.props,
119
- className = _props.className,
120
- children = _props.children,
121
- Tag = _props.tag,
122
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
115
+ var _this$props = this.props,
116
+ className = _this$props.className,
117
+ children = _this$props.children,
118
+ Tag = _this$props.tag,
119
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
123
120
 
124
121
  delete attributes.compact;
125
122
  delete attributes.display;
@@ -128,21 +125,15 @@ var AppSidebar = function (_Component) {
128
125
  delete attributes.offCanvas;
129
126
  delete attributes.isOpen;
130
127
  delete attributes.staticContext;
128
+ var classes = classNames(className, 'sidebar'); // sidebar-nav root
131
129
 
132
- var classes = classNames(className, 'sidebar');
133
-
134
- // sidebar-nav root
135
- return React.createElement(
136
- ClickOutHandler,
137
- { onClickOut: function onClickOut(e) {
138
- _this2.onClickOut(e);
139
- } },
140
- React.createElement(
141
- Tag,
142
- _extends({ className: classes }, attributes),
143
- children
144
- )
145
- );
130
+ return /*#__PURE__*/React.createElement(ClickOutHandler, {
131
+ onClickOut: function onClickOut(e) {
132
+ _this2.onClickOut(e);
133
+ }
134
+ }, /*#__PURE__*/React.createElement(Tag, _extends({
135
+ className: classes
136
+ }, attributes), children));
146
137
  };
147
138
 
148
139
  return AppSidebar;
@@ -150,5 +141,4 @@ var AppSidebar = function (_Component) {
150
141
 
151
142
  AppSidebar.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
152
143
  AppSidebar.defaultProps = defaultProps;
153
-
154
144
  export default AppSidebar;
@@ -1,50 +1,41 @@
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
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
19
- };
20
-
14
+ } : {};
21
15
  var defaultProps = {
22
16
  tag: 'div'
23
17
  };
24
18
 
25
- var AppSidebarFooter = function (_Component) {
26
- _inherits(AppSidebarFooter, _Component);
19
+ var AppSidebarFooter = /*#__PURE__*/function (_Component) {
20
+ _inheritsLoose(AppSidebarFooter, _Component);
27
21
 
28
22
  function AppSidebarFooter() {
29
- _classCallCheck(this, AppSidebarFooter);
30
-
31
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
23
+ return _Component.apply(this, arguments) || this;
32
24
  }
33
25
 
34
- AppSidebarFooter.prototype.render = function render() {
35
- var _props = this.props,
36
- className = _props.className,
37
- children = _props.children,
38
- Tag = _props.tag,
39
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
26
+ var _proto = AppSidebarFooter.prototype;
40
27
 
41
- var classes = classNames(className, 'sidebar-footer');
42
- var footer = children ? React.createElement(
43
- Tag,
44
- _extends({ className: classes }, attributes),
45
- children
46
- ) : null;
28
+ _proto.render = function render() {
29
+ var _this$props = this.props,
30
+ className = _this$props.className,
31
+ children = _this$props.children,
32
+ Tag = _this$props.tag,
33
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
47
34
 
35
+ var classes = classNames(className, 'sidebar-footer');
36
+ var footer = children ? /*#__PURE__*/React.createElement(Tag, _extends({
37
+ className: classes
38
+ }, attributes), children) : null;
48
39
  return footer;
49
40
  };
50
41
 
@@ -53,5 +44,4 @@ var AppSidebarFooter = function (_Component) {
53
44
 
54
45
  AppSidebarFooter.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
55
46
  AppSidebarFooter.defaultProps = defaultProps;
56
-
57
47
  export default AppSidebarFooter;
package/es/SidebarForm.js CHANGED
@@ -1,50 +1,41 @@
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
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
19
- };
20
-
14
+ } : {};
21
15
  var defaultProps = {
22
16
  tag: 'div'
23
17
  };
24
18
 
25
- var AppSidebarForm = function (_Component) {
26
- _inherits(AppSidebarForm, _Component);
19
+ var AppSidebarForm = /*#__PURE__*/function (_Component) {
20
+ _inheritsLoose(AppSidebarForm, _Component);
27
21
 
28
22
  function AppSidebarForm() {
29
- _classCallCheck(this, AppSidebarForm);
30
-
31
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
23
+ return _Component.apply(this, arguments) || this;
32
24
  }
33
25
 
34
- AppSidebarForm.prototype.render = function render() {
35
- var _props = this.props,
36
- className = _props.className,
37
- children = _props.children,
38
- Tag = _props.tag,
39
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
26
+ var _proto = AppSidebarForm.prototype;
40
27
 
41
- var classes = classNames(className, 'sidebar-form');
42
- var form = children ? React.createElement(
43
- Tag,
44
- _extends({ className: classes }, attributes),
45
- children
46
- ) : null;
28
+ _proto.render = function render() {
29
+ var _this$props = this.props,
30
+ className = _this$props.className,
31
+ children = _this$props.children,
32
+ Tag = _this$props.tag,
33
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
47
34
 
35
+ var classes = classNames(className, 'sidebar-form');
36
+ var form = children ? /*#__PURE__*/React.createElement(Tag, _extends({
37
+ className: classes
38
+ }, attributes), children) : null;
48
39
  return form;
49
40
  };
50
41
 
@@ -53,5 +44,4 @@ var AppSidebarForm = function (_Component) {
53
44
 
54
45
  AppSidebarForm.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
55
46
  AppSidebarForm.defaultProps = defaultProps;
56
-
57
47
  export default AppSidebarForm;
@@ -1,50 +1,41 @@
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
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
19
- };
20
-
14
+ } : {};
21
15
  var defaultProps = {
22
16
  tag: 'div'
23
17
  };
24
18
 
25
- var AppSidebarHeader = function (_Component) {
26
- _inherits(AppSidebarHeader, _Component);
19
+ var AppSidebarHeader = /*#__PURE__*/function (_Component) {
20
+ _inheritsLoose(AppSidebarHeader, _Component);
27
21
 
28
22
  function AppSidebarHeader() {
29
- _classCallCheck(this, AppSidebarHeader);
30
-
31
- return _possibleConstructorReturn(this, _Component.apply(this, arguments));
23
+ return _Component.apply(this, arguments) || this;
32
24
  }
33
25
 
34
- AppSidebarHeader.prototype.render = function render() {
35
- var _props = this.props,
36
- className = _props.className,
37
- children = _props.children,
38
- Tag = _props.tag,
39
- attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']);
26
+ var _proto = AppSidebarHeader.prototype;
40
27
 
41
- var classes = classNames(className, 'sidebar-header');
42
- var header = children ? React.createElement(
43
- Tag,
44
- _extends({ className: classes }, attributes),
45
- children
46
- ) : null;
28
+ _proto.render = function render() {
29
+ var _this$props = this.props,
30
+ className = _this$props.className,
31
+ children = _this$props.children,
32
+ Tag = _this$props.tag,
33
+ attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "children", "tag"]);
47
34
 
35
+ var classes = classNames(className, 'sidebar-header');
36
+ var header = children ? /*#__PURE__*/React.createElement(Tag, _extends({
37
+ className: classes
38
+ }, attributes), children) : null;
48
39
  return header;
49
40
  };
50
41
 
@@ -53,5 +44,4 @@ var AppSidebarHeader = function (_Component) {
53
44
 
54
45
  AppSidebarHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
55
46
  AppSidebarHeader.defaultProps = defaultProps;
56
-
57
47
  export default AppSidebarHeader;