labsense-ui-kit 1.2.77 → 1.2.79

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.
@@ -9,6 +9,7 @@ export interface SidebarItems {
9
9
  activeUrl?: string;
10
10
  notificationCount?: number;
11
11
  children?: SidebarItems[];
12
+ onClick?: () => void;
12
13
  }
13
14
  export interface ImageDetails {
14
15
  url: string;
package/dist/index.js CHANGED
@@ -9354,10 +9354,11 @@ var Sidebar = function Sidebar(_ref22) {
9354
9354
  };
9355
9355
  var isRouteActive = function isRouteActive(item) {
9356
9356
  var _item$children2;
9357
+ if (!item.url || item.url === '#') return false;
9357
9358
  var currentBase = getBasePath(location.pathname);
9358
9359
  var itemBase = item.activeUrl ? getBasePath(item.activeUrl) : getBasePath(item.url);
9359
9360
  return currentBase === itemBase || ((_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.some(function (child) {
9360
- return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
9361
+ return child.url && currentBase === getBasePath(child.activeUrl) || child.url && currentBase === getBasePath(child.url);
9361
9362
  }));
9362
9363
  };
9363
9364
  var ChildLink = React__default.memo(function (_ref23) {
@@ -9467,7 +9468,14 @@ var Sidebar = function Sidebar(_ref22) {
9467
9468
  }, [item.url, location.pathname]);
9468
9469
  return item.url ? React__default.createElement(SidebarLink, {
9469
9470
  to: item.url,
9470
- onClick: handleNavClick
9471
+ onClick: function onClick(e) {
9472
+ if (item.onClick) {
9473
+ e.preventDefault();
9474
+ item.onClick();
9475
+ } else {
9476
+ handleNavClick(e);
9477
+ }
9478
+ }
9471
9479
  }, ContentLayout) : React__default.createElement(Container, {
9472
9480
  "$flexDirection": 'column',
9473
9481
  "$alignItems": 'start',