ecomlab-components-next 0.1.41 → 0.1.42

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.
@@ -12,7 +12,6 @@ var _fetchUrls = require("../../../common/fetchUrls");
12
12
  var _ButtonBasic = _interopRequireDefault(require("../../Buttons/ButtonBasic/ButtonBasic"));
13
13
  var _drop_icon = _interopRequireDefault(require("./img/drop_icon.svg"));
14
14
  var _ButtonActionDrop = require("../../Buttons/ButtonActionDrop/ButtonActionDrop");
15
- var _router = require("next/router");
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
17
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -277,6 +276,7 @@ var _MenuItem = function MenuItem(_ref) {
277
276
  }))));
278
277
  };
279
278
  var ModalMiltilevelSidebarSettings = function ModalMiltilevelSidebarSettings(_ref2) {
279
+ var _window3;
280
280
  var setTitle = _ref2.setTitle,
281
281
  setPathsWebName = _ref2.setPathsWebName,
282
282
  onPortalClick = _ref2.onPortalClick,
@@ -300,7 +300,6 @@ var ModalMiltilevelSidebarSettings = function ModalMiltilevelSidebarSettings(_re
300
300
  };
301
301
 
302
302
  // console.log(expandedItemsStorage)
303
- var location = (0, _router.useRouter)();
304
303
  // const selectedSpace = useGeneralStore((state) => state.selectedSpace);
305
304
  // const headers = { ...customHeaders, ...getSpace(selectedSpace) };
306
305
 
@@ -535,7 +534,8 @@ var ModalMiltilevelSidebarSettings = function ModalMiltilevelSidebarSettings(_re
535
534
  fetchArticlesByLevel();
536
535
  }, []);
537
536
  var getLabelFromUrl = function getLabelFromUrl() {
538
- var label = window.location.pathname.split('/').at(-2);
537
+ var _window;
538
+ var label = (_window = window) === null || _window === void 0 ? void 0 : _window.location.pathname.split('/').at(-2);
539
539
  return label;
540
540
  };
541
541
  var actualPath = getLabelFromUrl();
@@ -562,7 +562,8 @@ var ModalMiltilevelSidebarSettings = function ModalMiltilevelSidebarSettings(_re
562
562
 
563
563
  // Обновляем крошки при первой загрузке
564
564
  (0, _react.useEffect)(function () {
565
- var currentURL = window.location.href;
565
+ var _window2;
566
+ var currentURL = (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.href;
566
567
  var id = currentURL.split('/').at(-2);
567
568
  fetchGetBreadcrumbs(id);
568
569
  onPortalClick(id);
@@ -581,7 +582,8 @@ var ModalMiltilevelSidebarSettings = function ModalMiltilevelSidebarSettings(_re
581
582
  label = _ref6.label;
582
583
  fetchChildren(value);
583
584
  if (ind == breadcrumbs.length - 1) {
584
- if (!location.pathname.includes('/article/')) {
585
+ var _location;
586
+ if (!((_location = location) !== null && _location !== void 0 && _location.pathname.includes('/article/'))) {
585
587
  setSelectedItemId(value);
586
588
  }
587
589
  } else {
@@ -592,7 +594,7 @@ var ModalMiltilevelSidebarSettings = function ModalMiltilevelSidebarSettings(_re
592
594
  setExpandedItemsStorage(obj_expanded);
593
595
  setInitial(false);
594
596
  }
595
- }, [breadcrumbs, window.location.href]);
597
+ }, [breadcrumbs, (_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.location.href]);
596
598
  console.log(expandedItemsStorage);
597
599
  var toggleExpand = function toggleExpand(id, expanded) {
598
600
  var newMenu = _toConsumableArray(menu);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecomlab-components-next",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "A set of common and reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "files": [