react-better-html 1.1.268 → 1.1.269
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.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7844,7 +7844,7 @@ var useSideMenuContext = () => {
|
|
|
7844
7844
|
}
|
|
7845
7845
|
return context;
|
|
7846
7846
|
};
|
|
7847
|
-
var
|
|
7847
|
+
var MenuItemTypeItem = memo27(function MenuItemTypeItem2({
|
|
7848
7848
|
item,
|
|
7849
7849
|
backgroundColor,
|
|
7850
7850
|
activeItemColor,
|
|
@@ -7872,8 +7872,8 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7872
7872
|
}
|
|
7873
7873
|
}, [onClick, item, isCollapsed]);
|
|
7874
7874
|
const childrenHaveDot = useMemo12(
|
|
7875
|
-
() => item.children?.some((child) => child.withDot) ?? false,
|
|
7876
|
-
[item
|
|
7875
|
+
() => item.children?.some((child) => child.type === "item" && child.withDot) ?? false,
|
|
7876
|
+
[item]
|
|
7877
7877
|
);
|
|
7878
7878
|
const isActive = activeItem && item.href && activeItem.href === item.href;
|
|
7879
7879
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
@@ -7978,7 +7978,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7978
7978
|
useEffect16(() => {
|
|
7979
7979
|
if (!item.children) return;
|
|
7980
7980
|
const toBeOpened = item.children.some(
|
|
7981
|
-
(child) => child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false
|
|
7981
|
+
(child) => child.type === "item" ? child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false : false
|
|
7982
7982
|
);
|
|
7983
7983
|
if (!isCollapsed) setIsOpened.setState(toBeOpened);
|
|
7984
7984
|
}, [item, isCollapsed]);
|
|
@@ -7987,7 +7987,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7987
7987
|
setIsOpened.setFalse();
|
|
7988
7988
|
}, [isCollapsed]);
|
|
7989
7989
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
7990
|
-
return /* @__PURE__ */ jsxs24(
|
|
7990
|
+
return /* @__PURE__ */ jsxs24(Fragment8, { children: [
|
|
7991
7991
|
item.href ? /* @__PURE__ */ jsx27(LinkComponentTag, { to: item.href, href: item.href, onClick: onClickElement, children: content }) : content,
|
|
7992
7992
|
item.children && /* @__PURE__ */ jsxs24(
|
|
7993
7993
|
Div_default.column,
|
|
@@ -8001,7 +8001,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
8001
8001
|
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
8002
8002
|
children: [
|
|
8003
8003
|
item.children.map((child) => /* @__PURE__ */ jsx27(
|
|
8004
|
-
|
|
8004
|
+
MenuItemComponent,
|
|
8005
8005
|
{
|
|
8006
8006
|
item: child,
|
|
8007
8007
|
backgroundColor: readyBackgroundColor,
|
|
@@ -8053,6 +8053,13 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
8053
8053
|
)
|
|
8054
8054
|
] });
|
|
8055
8055
|
});
|
|
8056
|
+
var MenuItemTypeDivider = memo27(function MenuItemTypeDivider2({ item }) {
|
|
8057
|
+
const theme2 = useTheme29();
|
|
8058
|
+
return /* @__PURE__ */ jsx27(Div_default.row, { paddingTop: theme2.styles.space, paddingInline: theme2.styles.gap, children: /* @__PURE__ */ jsx27(Text_default, { fontSize: 12, fontWeight: 700, textTransform: "uppercase", color: theme2.colors.textSecondary, children: item.text }) });
|
|
8059
|
+
});
|
|
8060
|
+
var MenuItemComponent = memo27(function MenuItemComponent2({ item, ...props }) {
|
|
8061
|
+
return /* @__PURE__ */ jsx27(Div_default, { width: "100%", children: item.type === "item" ? /* @__PURE__ */ jsx27(MenuItemTypeItem, { item, ...props }) : item.type === "divider" ? /* @__PURE__ */ jsx27(MenuItemTypeDivider, { item }) : void 0 });
|
|
8062
|
+
});
|
|
8056
8063
|
var SideMenuComponent = function SideMenu({
|
|
8057
8064
|
items,
|
|
8058
8065
|
bottomItems,
|