@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.
@@ -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("div", { className: b$n({ type, current, compact }, className), ref: ref, onClick: (event) => {
1181
- if (collapsedItem) {
1182
- /**
1183
- * If we call onItemClick for collapsedItem then:
1184
- * - User get unexpected item in onItemClick callback
1185
- * - onClosePanel calls twice for each popuped item, as result it will prevent opening of panelItems
1186
- */
1187
- toggleOpen(!open);
1188
- }
1189
- else {
1190
- onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, false, event);
1191
- }
1192
- }, onClickCapture: onItemClickCapture, onMouseEnter: () => {
1193
- if (!compact) {
1194
- onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
1195
- }
1196
- }, onMouseLeave: () => {
1197
- if (!compact) {
1198
- onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
1199
- }
1200
- } },
1201
- React__default.createElement("div", { className: b$n('icon-place'), ref: highlightedRef }, makeIconNode(iconEl)),
1202
- React__default.createElement("div", { className: b$n('title'), title: typeof item.title === 'string' ? item.title : undefined }, titleEl),
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
  };