@panneau/element-menu 1.0.3-alpha.2 → 1.0.3-alpha.7

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 (3) hide show
  1. package/es/index.js +39 -46
  2. package/lib/index.js +39 -46
  3. package/package.json +6 -6
package/es/index.js CHANGED
@@ -49,64 +49,58 @@ var defaultProps = {
49
49
  dropdownLinkClassName: null,
50
50
  dropdownAlign: null
51
51
  };
52
-
53
52
  var Menu = function Menu(_ref) {
54
53
  var items = _ref.items,
55
- tagName = _ref.tagName,
56
- itemTagName = _ref.itemTagName,
57
- children = _ref.children,
58
- linkAsItem = _ref.linkAsItem,
59
- className = _ref.className,
60
- itemClassName = _ref.itemClassName,
61
- linkClassName = _ref.linkClassName,
62
- hasSubMenuClassName = _ref.hasSubMenuClassName,
63
- subMenuClassName = _ref.subMenuClassName,
64
- subMenuItemClassName = _ref.subMenuItemClassName,
65
- subMenuLinkClassName = _ref.subMenuLinkClassName,
66
- hasDropdownClassName = _ref.hasDropdownClassName,
67
- dropdownClassName = _ref.dropdownClassName,
68
- dropdownItemClassName = _ref.dropdownItemClassName,
69
- dropdownLinkClassName = _ref.dropdownLinkClassName,
70
- dropdownAlign = _ref.dropdownAlign;
71
-
54
+ tagName = _ref.tagName,
55
+ itemTagName = _ref.itemTagName,
56
+ children = _ref.children,
57
+ linkAsItem = _ref.linkAsItem,
58
+ className = _ref.className,
59
+ itemClassName = _ref.itemClassName,
60
+ linkClassName = _ref.linkClassName,
61
+ hasSubMenuClassName = _ref.hasSubMenuClassName,
62
+ subMenuClassName = _ref.subMenuClassName,
63
+ subMenuItemClassName = _ref.subMenuItemClassName,
64
+ subMenuLinkClassName = _ref.subMenuLinkClassName,
65
+ hasDropdownClassName = _ref.hasDropdownClassName,
66
+ dropdownClassName = _ref.dropdownClassName,
67
+ dropdownItemClassName = _ref.dropdownItemClassName,
68
+ dropdownLinkClassName = _ref.dropdownLinkClassName,
69
+ dropdownAlign = _ref.dropdownAlign;
72
70
  var _useState = useState(items.map(function () {
73
- return false;
74
- })),
75
- _useState2 = _slicedToArray(_useState, 2),
76
- dropdownsVisible = _useState2[0],
77
- setDropdownsVisible = _useState2[1];
78
-
71
+ return false;
72
+ })),
73
+ _useState2 = _slicedToArray(_useState, 2),
74
+ dropdownsVisible = _useState2[0],
75
+ setDropdownsVisible = _useState2[1];
79
76
  var ListComponent = linkAsItem ? 'div' : tagName;
80
77
  return /*#__PURE__*/React.createElement(ListComponent, {
81
78
  className: className
82
79
  }, children !== null ? children : items.map(function (it, index) {
83
80
  var _classNames, _classNames2, _classNames3, _classNames4, _classNames5, _classNames6, _classNames7;
84
-
85
81
  var id = it.id,
86
- _it$className = it.className,
87
- customClassName = _it$className === void 0 ? null : _it$className,
88
- _it$linkClassName = it.linkClassName,
89
- customLinkClassName = _it$linkClassName === void 0 ? null : _it$linkClassName,
90
- _it$href = it.href,
91
- href = _it$href === void 0 ? null : _it$href,
92
- label = it.label,
93
- _it$external = it.external,
94
- external = _it$external === void 0 ? false : _it$external,
95
- _it$items = it.items,
96
- subItems = _it$items === void 0 ? null : _it$items,
97
- _it$dropdown = it.dropdown,
98
- dropdown = _it$dropdown === void 0 ? null : _it$dropdown,
99
- _it$active = it.active,
100
- active = _it$active === void 0 ? false : _it$active,
101
- _it$onClick = it.onClick,
102
- customOnClick = _it$onClick === void 0 ? null : _it$onClick,
103
- itemProps = _objectWithoutProperties(it, _excluded);
104
-
82
+ _it$className = it.className,
83
+ customClassName = _it$className === void 0 ? null : _it$className,
84
+ _it$linkClassName = it.linkClassName,
85
+ customLinkClassName = _it$linkClassName === void 0 ? null : _it$linkClassName,
86
+ _it$href = it.href,
87
+ href = _it$href === void 0 ? null : _it$href,
88
+ label = it.label,
89
+ _it$external = it.external,
90
+ external = _it$external === void 0 ? false : _it$external,
91
+ _it$items = it.items,
92
+ subItems = _it$items === void 0 ? null : _it$items,
93
+ _it$dropdown = it.dropdown,
94
+ dropdown = _it$dropdown === void 0 ? null : _it$dropdown,
95
+ _it$active = it.active,
96
+ active = _it$active === void 0 ? false : _it$active,
97
+ _it$onClick = it.onClick,
98
+ customOnClick = _it$onClick === void 0 ? null : _it$onClick,
99
+ itemProps = _objectWithoutProperties(it, _excluded);
105
100
  var onClickItem = dropdown !== null ? function (e) {
106
101
  e.preventDefault();
107
102
  e.stopPropagation();
108
103
  setDropdownsVisible([].concat(_toConsumableArray(dropdownsVisible.slice(0, index)), [!(dropdownsVisible[index] || false)], _toConsumableArray(dropdownsVisible.slice(index + 1))));
109
-
110
104
  if (customOnClick !== null) {
111
105
  customOnClick(e);
112
106
  }
@@ -152,7 +146,6 @@ var Menu = function Menu(_ref) {
152
146
  }) : null);
153
147
  }));
154
148
  };
155
-
156
149
  Menu.propTypes = propTypes;
157
150
  Menu.defaultProps = defaultProps;
158
151
 
package/lib/index.js CHANGED
@@ -66,64 +66,58 @@ var defaultProps = {
66
66
  dropdownLinkClassName: null,
67
67
  dropdownAlign: null
68
68
  };
69
-
70
69
  var Menu = function Menu(_ref) {
71
70
  var items = _ref.items,
72
- tagName = _ref.tagName,
73
- itemTagName = _ref.itemTagName,
74
- children = _ref.children,
75
- linkAsItem = _ref.linkAsItem,
76
- className = _ref.className,
77
- itemClassName = _ref.itemClassName,
78
- linkClassName = _ref.linkClassName,
79
- hasSubMenuClassName = _ref.hasSubMenuClassName,
80
- subMenuClassName = _ref.subMenuClassName,
81
- subMenuItemClassName = _ref.subMenuItemClassName,
82
- subMenuLinkClassName = _ref.subMenuLinkClassName,
83
- hasDropdownClassName = _ref.hasDropdownClassName,
84
- dropdownClassName = _ref.dropdownClassName,
85
- dropdownItemClassName = _ref.dropdownItemClassName,
86
- dropdownLinkClassName = _ref.dropdownLinkClassName,
87
- dropdownAlign = _ref.dropdownAlign;
88
-
71
+ tagName = _ref.tagName,
72
+ itemTagName = _ref.itemTagName,
73
+ children = _ref.children,
74
+ linkAsItem = _ref.linkAsItem,
75
+ className = _ref.className,
76
+ itemClassName = _ref.itemClassName,
77
+ linkClassName = _ref.linkClassName,
78
+ hasSubMenuClassName = _ref.hasSubMenuClassName,
79
+ subMenuClassName = _ref.subMenuClassName,
80
+ subMenuItemClassName = _ref.subMenuItemClassName,
81
+ subMenuLinkClassName = _ref.subMenuLinkClassName,
82
+ hasDropdownClassName = _ref.hasDropdownClassName,
83
+ dropdownClassName = _ref.dropdownClassName,
84
+ dropdownItemClassName = _ref.dropdownItemClassName,
85
+ dropdownLinkClassName = _ref.dropdownLinkClassName,
86
+ dropdownAlign = _ref.dropdownAlign;
89
87
  var _useState = React.useState(items.map(function () {
90
- return false;
91
- })),
92
- _useState2 = _slicedToArray__default["default"](_useState, 2),
93
- dropdownsVisible = _useState2[0],
94
- setDropdownsVisible = _useState2[1];
95
-
88
+ return false;
89
+ })),
90
+ _useState2 = _slicedToArray__default["default"](_useState, 2),
91
+ dropdownsVisible = _useState2[0],
92
+ setDropdownsVisible = _useState2[1];
96
93
  var ListComponent = linkAsItem ? 'div' : tagName;
97
94
  return /*#__PURE__*/React__default["default"].createElement(ListComponent, {
98
95
  className: className
99
96
  }, children !== null ? children : items.map(function (it, index) {
100
97
  var _classNames, _classNames2, _classNames3, _classNames4, _classNames5, _classNames6, _classNames7;
101
-
102
98
  var id = it.id,
103
- _it$className = it.className,
104
- customClassName = _it$className === void 0 ? null : _it$className,
105
- _it$linkClassName = it.linkClassName,
106
- customLinkClassName = _it$linkClassName === void 0 ? null : _it$linkClassName,
107
- _it$href = it.href,
108
- href = _it$href === void 0 ? null : _it$href,
109
- label = it.label,
110
- _it$external = it.external,
111
- external = _it$external === void 0 ? false : _it$external,
112
- _it$items = it.items,
113
- subItems = _it$items === void 0 ? null : _it$items,
114
- _it$dropdown = it.dropdown,
115
- dropdown = _it$dropdown === void 0 ? null : _it$dropdown,
116
- _it$active = it.active,
117
- active = _it$active === void 0 ? false : _it$active,
118
- _it$onClick = it.onClick,
119
- customOnClick = _it$onClick === void 0 ? null : _it$onClick,
120
- itemProps = _objectWithoutProperties__default["default"](it, _excluded);
121
-
99
+ _it$className = it.className,
100
+ customClassName = _it$className === void 0 ? null : _it$className,
101
+ _it$linkClassName = it.linkClassName,
102
+ customLinkClassName = _it$linkClassName === void 0 ? null : _it$linkClassName,
103
+ _it$href = it.href,
104
+ href = _it$href === void 0 ? null : _it$href,
105
+ label = it.label,
106
+ _it$external = it.external,
107
+ external = _it$external === void 0 ? false : _it$external,
108
+ _it$items = it.items,
109
+ subItems = _it$items === void 0 ? null : _it$items,
110
+ _it$dropdown = it.dropdown,
111
+ dropdown = _it$dropdown === void 0 ? null : _it$dropdown,
112
+ _it$active = it.active,
113
+ active = _it$active === void 0 ? false : _it$active,
114
+ _it$onClick = it.onClick,
115
+ customOnClick = _it$onClick === void 0 ? null : _it$onClick,
116
+ itemProps = _objectWithoutProperties__default["default"](it, _excluded);
122
117
  var onClickItem = dropdown !== null ? function (e) {
123
118
  e.preventDefault();
124
119
  e.stopPropagation();
125
120
  setDropdownsVisible([].concat(_toConsumableArray__default["default"](dropdownsVisible.slice(0, index)), [!(dropdownsVisible[index] || false)], _toConsumableArray__default["default"](dropdownsVisible.slice(index + 1))));
126
-
127
121
  if (customOnClick !== null) {
128
122
  customOnClick(e);
129
123
  }
@@ -169,7 +163,6 @@ var Menu = function Menu(_ref) {
169
163
  }) : null);
170
164
  }));
171
165
  };
172
-
173
166
  Menu.propTypes = propTypes;
174
167
  Menu.defaultProps = defaultProps;
175
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/element-menu",
3
- "version": "1.0.3-alpha.2",
3
+ "version": "1.0.3-alpha.7",
4
4
  "description": "Menu element",
5
5
  "keywords": [
6
6
  "javascript"
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@babel/runtime": "^7.12.5",
57
- "@panneau/core": "^1.0.3-alpha.1",
58
- "@panneau/element-dropdown": "^1.0.3-alpha.2",
59
- "@panneau/element-label": "^1.0.3-alpha.1",
60
- "@panneau/element-link": "^1.0.3-alpha.2",
57
+ "@panneau/core": "^1.0.3-alpha.7",
58
+ "@panneau/element-dropdown": "^1.0.3-alpha.7",
59
+ "@panneau/element-label": "^1.0.3-alpha.7",
60
+ "@panneau/element-link": "^1.0.3-alpha.7",
61
61
  "classnames": "^2.2.6",
62
62
  "prop-types": "^15.7.2",
63
63
  "react-intl": "^5.15.8||^6.0.0"
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "3fb9865bb17e8ddc0b2d372d38f39700c90e2605"
68
+ "gitHead": "a11f9633326e3c025b0abe892111017a0588730a"
69
69
  }