@pnkx-lib/ui 1.9.301 → 1.9.302
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/es/ui/Sidebar.js +7 -7
- package/package.json +1 -1
package/es/ui/Sidebar.js
CHANGED
|
@@ -155,7 +155,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
155
155
|
};
|
|
156
156
|
acc.push(group);
|
|
157
157
|
}
|
|
158
|
-
const path =
|
|
158
|
+
const path = `${itemChildren.path}/${itemSub.path}`;
|
|
159
159
|
group.options.push(renderItem(itemSub.name, path));
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -259,7 +259,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
259
259
|
openSubCollapse && "absolute"
|
|
260
260
|
),
|
|
261
261
|
children: /* @__PURE__ */ jsx("nav", { className: twMerge("flex mt-2 flex-1 flex-col px-2"), children: /* @__PURE__ */ jsx("ul", { role: "list", className: twMerge("-mx-2 space-y-1 relative"), children: newMenu.flatMap((item) => {
|
|
262
|
-
const isActiveMainMenu = activeMainMenu === item.
|
|
262
|
+
const isActiveMainMenu = activeMainMenu === item.path;
|
|
263
263
|
const isActivePathUrl = pathUrl === item.path;
|
|
264
264
|
const isActive = isActiveMainMenu || isActivePathUrl;
|
|
265
265
|
return /* @__PURE__ */ jsx(
|
|
@@ -281,7 +281,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
281
281
|
{
|
|
282
282
|
onClick: () => {
|
|
283
283
|
setCollapse(false);
|
|
284
|
-
setActiveMainMenu(item?.
|
|
284
|
+
setActiveMainMenu(item?.path);
|
|
285
285
|
setOpenSubCollapse(true);
|
|
286
286
|
},
|
|
287
287
|
className: twMerge(
|
|
@@ -319,7 +319,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
319
319
|
"flex flex-1 transition-all duration-300 flex-col"
|
|
320
320
|
),
|
|
321
321
|
children: /* @__PURE__ */ jsx("ul", { role: "list", className: twMerge("cursor-pointer ml-[10px]"), children: newMenu?.map((sub) => {
|
|
322
|
-
const isActiveMainMenu = activeMainMenu === sub.
|
|
322
|
+
const isActiveMainMenu = activeMainMenu === sub.path;
|
|
323
323
|
if (!isActiveMainMenu) return null;
|
|
324
324
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
325
325
|
/* @__PURE__ */ jsx(
|
|
@@ -347,7 +347,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
347
347
|
),
|
|
348
348
|
className: twMerge(
|
|
349
349
|
isActiveSubMenu && !itemSubMenu.isShow ? "bg-[#E7F0FF] !text-[#007BE5]" : isActiveSubMenu && itemSubMenu.isShow ? "!text-[#007BE5]" : "",
|
|
350
|
-
"group flex gap-x-3 select-none p-
|
|
350
|
+
"group flex gap-x-3 select-none p-3 text-gray-700 hover:bg-[#E7F0FF] hover:text-[#007BE5] text-sm leading-6 transition-all duration-300 font-semibold items-center"
|
|
351
351
|
),
|
|
352
352
|
children: [
|
|
353
353
|
itemSubMenu.icon,
|
|
@@ -371,7 +371,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
371
371
|
onClick: () => handleClick(itemFullPath),
|
|
372
372
|
className: twMerge(
|
|
373
373
|
pathUrl.startsWith(itemFullPath) ? "bg-[#E7F0FF] !text-[#007BE5]" : "",
|
|
374
|
-
"text-
|
|
374
|
+
"text-sm hover:bg-[#E7F0FF] hover:text-[#007BE5] transition-all duration-300 py-2 flex items-center"
|
|
375
375
|
),
|
|
376
376
|
children: /* @__PURE__ */ jsxs("div", { className: "ml-4 flex items-center gap-4", children: [
|
|
377
377
|
itemChildrenSubMenu.icon,
|
|
@@ -384,7 +384,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
384
384
|
) })
|
|
385
385
|
] }, itemSubMenu.path);
|
|
386
386
|
}) })
|
|
387
|
-
] }, sub?.
|
|
387
|
+
] }, sub?.path);
|
|
388
388
|
}) })
|
|
389
389
|
}
|
|
390
390
|
)
|