@mercurjs/admin 2.0.0-canary.52 → 2.0.0-canary.53
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/dist/index.js +10 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1620,12 +1620,6 @@ var NavItem = ({
|
|
|
1620
1620
|
useEffect7(() => {
|
|
1621
1621
|
setOpen(getIsOpen(to, items, pathname));
|
|
1622
1622
|
}, [pathname, to, items]);
|
|
1623
|
-
const isNestedActive = useCallback5(
|
|
1624
|
-
(nestedTo) => {
|
|
1625
|
-
return pathname === nestedTo || pathname.startsWith(nestedTo + "/");
|
|
1626
|
-
},
|
|
1627
|
-
[pathname]
|
|
1628
|
-
);
|
|
1629
1623
|
const navLinkClassNames = useCallback5(
|
|
1630
1624
|
({
|
|
1631
1625
|
to: to2,
|
|
@@ -1634,13 +1628,14 @@ var NavItem = ({
|
|
|
1634
1628
|
isSetting: isSetting2 = false
|
|
1635
1629
|
}) => {
|
|
1636
1630
|
if (["core", "setting"].includes(type)) {
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1631
|
+
isActive = pathname.startsWith(to2);
|
|
1632
|
+
if (isActive && !isNested && items?.length) {
|
|
1633
|
+
const nestedIsActive = items.some(
|
|
1634
|
+
(item) => pathname.startsWith(item.to)
|
|
1635
|
+
);
|
|
1636
|
+
if (nestedIsActive) {
|
|
1637
|
+
isActive = false;
|
|
1638
|
+
}
|
|
1644
1639
|
}
|
|
1645
1640
|
}
|
|
1646
1641
|
return clx2(BASE_NAV_LINK_CLASSES, {
|
|
@@ -1649,7 +1644,7 @@ var NavItem = ({
|
|
|
1649
1644
|
[SETTING_NAV_LINK_CLASSES]: isSetting2
|
|
1650
1645
|
});
|
|
1651
1646
|
},
|
|
1652
|
-
[type, pathname, items
|
|
1647
|
+
[type, pathname, items]
|
|
1653
1648
|
);
|
|
1654
1649
|
const isSetting = type === "setting";
|
|
1655
1650
|
return /* @__PURE__ */ jsxs3(
|
|
@@ -2730,7 +2725,7 @@ var MainSidebar = () => {
|
|
|
2730
2725
|
const customRoutesWithNested = customMenuItems.sort((a, b) => (a.rank ?? 0) - (b.rank ?? 0)).map((item) => ({
|
|
2731
2726
|
label: item.label,
|
|
2732
2727
|
to: item.path,
|
|
2733
|
-
icon: item.icon ?
|
|
2728
|
+
icon: item.icon ? /* @__PURE__ */ jsx12(item.icon, {}) : void 0,
|
|
2734
2729
|
translationNs: item.translationNs,
|
|
2735
2730
|
items: addNestedItems(item.path)
|
|
2736
2731
|
}));
|