@gravity-ui/navigation 0.21.0 → 0.21.1
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.
- package/build/cjs/index.js +24 -23
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +24 -23
- package/build/esm/index.js.map +1 -1
- package/package.json +1 -1
package/build/esm/index.js
CHANGED
|
@@ -1177,29 +1177,30 @@ const Item$1 = (props) => {
|
|
|
1177
1177
|
React__default.createElement("div", { onMouseEnter: () => onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(), onMouseLeave: () => onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(), className: b$n('btn-icon') }, iconEl))) : (iconEl);
|
|
1178
1178
|
};
|
|
1179
1179
|
const makeNode = ({ icon: iconEl, title: titleEl }) => {
|
|
1180
|
-
const createdNode = (React__default.createElement(
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1180
|
+
const createdNode = (React__default.createElement(React__default.Fragment, null,
|
|
1181
|
+
React__default.createElement("div", { className: b$n({ type, current, compact }, className), ref: ref, onClick: (event) => {
|
|
1182
|
+
if (collapsedItem) {
|
|
1183
|
+
/**
|
|
1184
|
+
* If we call onItemClick for collapsedItem then:
|
|
1185
|
+
* - User get unexpected item in onItemClick callback
|
|
1186
|
+
* - onClosePanel calls twice for each popuped item, as result it will prevent opening of panelItems
|
|
1187
|
+
*/
|
|
1188
|
+
toggleOpen(!open);
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, false, event);
|
|
1192
|
+
}
|
|
1193
|
+
}, onClickCapture: onItemClickCapture, onMouseEnter: () => {
|
|
1194
|
+
if (!compact) {
|
|
1195
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
|
|
1196
|
+
}
|
|
1197
|
+
}, onMouseLeave: () => {
|
|
1198
|
+
if (!compact) {
|
|
1199
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
1200
|
+
}
|
|
1201
|
+
} },
|
|
1202
|
+
React__default.createElement("div", { className: b$n('icon-place'), ref: highlightedRef }, makeIconNode(iconEl)),
|
|
1203
|
+
React__default.createElement("div", { className: b$n('title'), title: typeof item.title === 'string' ? item.title : undefined }, titleEl)),
|
|
1203
1204
|
renderPopupContent && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default.createElement(Popup, { contentClassName: b$n('popup'), open: popupVisible, keepMounted: popupKeepMounted, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: onClose }, renderPopupContent()))));
|
|
1204
1205
|
return item.link ? (React__default.createElement("a", { href: item.link, className: b$n('link') }, createdNode)) : (createdNode);
|
|
1205
1206
|
};
|