luna-one 3.1.362 → 3.1.365
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.
|
@@ -32,7 +32,7 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
32
32
|
var _NavBar = require("../../other-organisms/NavBar/NavBar");
|
|
33
33
|
|
|
34
34
|
var MegaMenu = function MegaMenu(props) {
|
|
35
|
-
var _content$
|
|
35
|
+
var _content$links2, _content$links3, _content$featuredLink;
|
|
36
36
|
|
|
37
37
|
var _useContext = (0, _react.useContext)(_NavBar.NavBarContext),
|
|
38
38
|
mouse = _useContext.mouse,
|
|
@@ -65,7 +65,7 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
65
65
|
hoveredFeature = _useState6[0],
|
|
66
66
|
setHoveredFeature = _useState6[1];
|
|
67
67
|
|
|
68
|
-
var _useState7 = (0, _react.useState)(
|
|
68
|
+
var _useState7 = (0, _react.useState)(0),
|
|
69
69
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
70
70
|
maxActiveNavItems = _useState8[0],
|
|
71
71
|
setMaxActiveNavItems = _useState8[1];
|
|
@@ -102,7 +102,10 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
var handleClick = function handleClick(e) {
|
|
105
|
+
var _content$links;
|
|
106
|
+
|
|
105
107
|
currentOpenMenu !== content.text && hideSubsection();
|
|
108
|
+
setMaxActiveNavItems(content === null || content === void 0 ? void 0 : (_content$links = content.links) === null || _content$links === void 0 ? void 0 : _content$links.length);
|
|
106
109
|
deployDropDown(e, content.text);
|
|
107
110
|
updateMaxActiveNavItems(setMaxActiveNavItems, e);
|
|
108
111
|
returnDeployedChildClass();
|
|
@@ -186,7 +189,7 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
186
189
|
}
|
|
187
190
|
};
|
|
188
191
|
|
|
189
|
-
var megaMenuParentValue = content === null || content === void 0 ? void 0 : (_content$
|
|
192
|
+
var megaMenuParentValue = content === null || content === void 0 ? void 0 : (_content$links2 = content.links) === null || _content$links2 === void 0 ? void 0 : _content$links2.length;
|
|
190
193
|
|
|
191
194
|
var updateMaxActiveNavItems = function updateMaxActiveNavItems(setMaxActiveNavItems, e) {
|
|
192
195
|
e.stopPropagation(); // check and compare maxItems value against current nav links and update if necessary
|
|
@@ -207,7 +210,7 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
207
210
|
var hasFeatures = content.featuredLinks.length > 0 || collapsed; //check if we have tertiary content
|
|
208
211
|
|
|
209
212
|
var hasTertiary = null;
|
|
210
|
-
content === null || content === void 0 ? void 0 : (_content$
|
|
213
|
+
content === null || content === void 0 ? void 0 : (_content$links3 = content.links) === null || _content$links3 === void 0 ? void 0 : _content$links3.forEach(function (link) {
|
|
211
214
|
var _link$links;
|
|
212
215
|
|
|
213
216
|
return (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.forEach(function (link) {
|
|
@@ -269,6 +269,7 @@ var NavBar = function NavBar(props) {
|
|
|
269
269
|
|
|
270
270
|
var isCollapsed = (option === null || option === void 0 ? void 0 : (_option$links = option.links) === null || _option$links === void 0 ? void 0 : _option$links.length) > 4 ? true : false;
|
|
271
271
|
return /*#__PURE__*/_react.default.createElement(_NavOption.default, {
|
|
272
|
+
key: option.text,
|
|
272
273
|
displayIcons: displayIcons,
|
|
273
274
|
option: option,
|
|
274
275
|
menuBarTheme: menuBarTheme
|