@pnkx-lib/ui 1.9.424 → 1.9.425
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/chunks/{useBreadcrumb-BFRlDjyO.js → useBreadcrumb-kD-i6Dch.js} +3 -3
- package/es/ui/BreadcrumbHeading.js +1 -1
- package/es/ui/SidebarV3/index.js +2 -2
- package/es/ui/WrapperBreadcrumb.js +1 -1
- package/package.json +1 -1
- package/types/components/hooks/useBreadcrumb.d.ts +2 -2
- package/types/components/ui/SidebarV3/types.d.ts +2 -4
|
@@ -23,7 +23,7 @@ const useBreadcrumb = (menuRouter, customBreadcrumb) => {
|
|
|
23
23
|
const pathUrl = location.pathname;
|
|
24
24
|
const matchedItems = findBreadcrumbTrail(menuRouter, pathUrl);
|
|
25
25
|
const visibleTrail = matchedItems.filter(
|
|
26
|
-
(item) => item.
|
|
26
|
+
(item) => item.isShowBreadcrumb !== false
|
|
27
27
|
);
|
|
28
28
|
const lastIndex = visibleTrail.length - 1;
|
|
29
29
|
const baseItems = visibleTrail.map((item, index) => {
|
|
@@ -33,12 +33,12 @@ const useBreadcrumb = (menuRouter, customBreadcrumb) => {
|
|
|
33
33
|
const lastItem = customBreadcrumb?.length - 1;
|
|
34
34
|
document.title = String(customBreadcrumb[lastItem]?.title);
|
|
35
35
|
return {
|
|
36
|
-
title: /* @__PURE__ */ jsx(Link, { to: item.path, children: item.name })
|
|
36
|
+
title: /* @__PURE__ */ jsx(Link, { to: item.path || "", children: item.name })
|
|
37
37
|
};
|
|
38
38
|
} else {
|
|
39
39
|
document.title = item.name;
|
|
40
40
|
return {
|
|
41
|
-
title: isLast ? /* @__PURE__ */ jsx("span", { children: item.name }) : /* @__PURE__ */ jsx(Link, { to: item.path, children: item.name })
|
|
41
|
+
title: isLast ? /* @__PURE__ */ jsx("span", { children: item.name }) : /* @__PURE__ */ jsx(Link, { to: item.path || "", children: item.name })
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { c as className } from '../chunks/index-D7kJLZIi.js';
|
|
3
3
|
import { Breadcrumb } from './Breadcrumb.js';
|
|
4
|
-
import { u as useBreadcrumb } from '../chunks/useBreadcrumb-
|
|
4
|
+
import { u as useBreadcrumb } from '../chunks/useBreadcrumb-kD-i6Dch.js';
|
|
5
5
|
|
|
6
6
|
const BreadcrumbHeading = (props) => {
|
|
7
7
|
const { menu, customBreadcum } = props;
|
package/es/ui/SidebarV3/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { R as RefIcon } from '../../chunks/DownOutlined-CkHKgaSi.js';
|
|
|
11
11
|
|
|
12
12
|
const useMenuFilter = (menu) => {
|
|
13
13
|
const sidebarMenu = useMemo(
|
|
14
|
-
() => menu?.filter((route) => route?.
|
|
14
|
+
() => menu?.filter((route) => route?.isShowChildren)?.flatMap((route) => route?.children)?.filter(Boolean),
|
|
15
15
|
[menu]
|
|
16
16
|
);
|
|
17
17
|
return { sidebarMenu };
|
|
@@ -240,7 +240,7 @@ const EachItem = ({
|
|
|
240
240
|
hasActiveChild,
|
|
241
241
|
level = 1
|
|
242
242
|
}) => {
|
|
243
|
-
const isDropdown = subMenu.
|
|
243
|
+
const isDropdown = subMenu.isShowChildren;
|
|
244
244
|
const isDirectActive = isDirectlyActive(subMenu);
|
|
245
245
|
const hasChildActive = hasActiveChild(subMenu);
|
|
246
246
|
const isParent = !!subMenu?.children && isDropdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { u as useBreadcrumb } from '../chunks/useBreadcrumb-
|
|
2
|
+
import { u as useBreadcrumb } from '../chunks/useBreadcrumb-kD-i6Dch.js';
|
|
3
3
|
import { Breadcrumb } from './Breadcrumb.js';
|
|
4
4
|
|
|
5
5
|
const WrapperBreadcrumb = ({ menu }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BreadcrumbItemType,
|
|
1
|
+
import { BreadcrumbItemType, MenuTypeV3 } from '../ui';
|
|
2
2
|
type CustomBreadcrumbItem = {
|
|
3
3
|
title: React.ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const useBreadcrumb: (menuRouter:
|
|
5
|
+
export declare const useBreadcrumb: (menuRouter: MenuTypeV3[], customBreadcrumb?: CustomBreadcrumbItem[]) => BreadcrumbItemType[];
|
|
6
6
|
export {};
|
|
@@ -3,12 +3,10 @@ export type MenuTypeV3 = {
|
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
path?: string;
|
|
6
|
-
|
|
6
|
+
isShowChildren?: boolean;
|
|
7
7
|
isPrivateRoute?: boolean;
|
|
8
8
|
icon?: ReactNode;
|
|
9
|
-
|
|
10
|
-
isShowLabel?: boolean;
|
|
11
|
-
isModule?: boolean;
|
|
9
|
+
isShowBreadcrumb?: boolean;
|
|
12
10
|
component?: React.LazyExoticComponent<React.MemoExoticComponent<any>> | React.ExoticComponent<any> | ReactNode | React.FC;
|
|
13
11
|
componentProps?: Record<string, any>;
|
|
14
12
|
children?: MenuTypeV3[];
|