listpage-next 0.0.252 → 0.0.253

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.
@@ -7,5 +7,6 @@ export interface AppProps {
7
7
  icon?: ReactNode;
8
8
  hasAuth?: () => boolean;
9
9
  loginElement?: JSX.Element;
10
+ menuRender?: (menus: MenuItem[], defaultActiveKey?: string, onSelect?: (key: string) => void) => ReactNode;
10
11
  }
11
12
  export declare const App: (props: AppProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import { createRoutes } from "./utils.js";
5
5
  import { Auth } from "./Auth.js";
6
6
  import { Layout } from "./Layout.js";
7
7
  const App = (props)=>{
8
- const { menus, basename = '', title, icon, loginElement, hasAuth } = props;
8
+ const { menus, basename = '', title, icon, loginElement, hasAuth, menuRender } = props;
9
9
  const router = useMemo(()=>{
10
10
  const routes = createRoutes(menus);
11
11
  return createBrowserRouter([
@@ -18,6 +18,7 @@ const App = (props)=>{
18
18
  element: /*#__PURE__*/ jsx(Auth, {
19
19
  hasAuth: hasAuth,
20
20
  children: /*#__PURE__*/ jsx(Layout, {
21
+ menuRender: menuRender,
21
22
  menus: menus,
22
23
  title: title,
23
24
  icon: icon,
@@ -5,5 +5,6 @@ export interface LayoutProps {
5
5
  basename?: string;
6
6
  title?: string;
7
7
  icon?: ReactNode;
8
+ menuRender?: (menus: MenuItem[], defaultActiveKey?: string, onSelect?: (key: string) => void) => ReactNode;
8
9
  }
9
10
  export declare const Layout: (props: LayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { Outlet, useNavigate } from "react-router-dom";
4
4
  import { Menu, PageLayout } from "../../components/index.js";
5
5
  import { getDefaultActiveKey } from "./utils.js";
6
6
  const Layout = (props)=>{
7
- const { menus, basename = '', title, icon } = props;
7
+ const { menus, basename = '', title, icon, menuRender } = props;
8
8
  const navigate = useNavigate();
9
9
  const defaultActiveKey = useMemo(()=>getDefaultActiveKey(basename, menus), [
10
10
  basename,
@@ -15,7 +15,7 @@ const Layout = (props)=>{
15
15
  icon,
16
16
  title
17
17
  },
18
- sider: /*#__PURE__*/ jsx(Menu, {
18
+ sider: menuRender?.(menus, defaultActiveKey, navigate) || /*#__PURE__*/ jsx(Menu, {
19
19
  items: menus,
20
20
  defaultActiveKey: defaultActiveKey,
21
21
  onSelect: navigate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.252",
3
+ "version": "0.0.253",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",