/** * @author linhd * @date 2021/8/10 14:24 * @description 菜单参数 */ import React, { ReactNode } from 'react'; /** 菜单类型 */ export type MenuListTypeType = 'redirect' | 'router' | 'iframe' | 'snack' | 'snackPage'; /** color类型 */ export type ColorType = 'deep' | 'light'; /** logo参数 */ export interface LogoProps { /** 展开 / 收起 */ expansion?: boolean; /** 自定义内容 */ render?: ReactNode; /** 样式class */ className?: string; } /** 菜单列表项参数 */ export interface MenuChildrenProps { /** 样式class */ className?: string; /** 菜单分享icon */ jumpIcon?: ReactNode; onClickJump?: (item: MenuChildrenProps) => void; /** 菜单名 */ label?: ReactNode; /** 菜单类型 */ type?: MenuListTypeType; /** 菜单路径 */ path?: string; /** href a标签地址 */ href?: string; /** 菜单图标 */ icon?: ReactNode; /** 标记 */ badge?: ReactNode; /** 菜单组件 */ component?: any; /** 子菜单 */ children?: MenuChildrenProps[]; /** 菜单最后一层所有上下级 一条线 */ idMenuLast?: any; /** 当前选中菜单 */ selectMenu?: string; /** 点击菜单 */ onClickMenu?: (item: MenuChildrenProps | false) => void; /** 选中菜单,是否收起其他展开项 */ shrinkOthers?: boolean; /** 唯一值,内部属性,自动生成 */ _paraui_menu_id?: string; /** 是否第一级 */ _paraui_menu_first?: boolean; [name: string]: any; } /** 菜单列表参数 */ export interface MenuListProps { /** 尺寸 */ size?: 'small' | 'large'; /** 颜色 */ color?: ColorType; /** 展开 / 收起 */ expansion?: boolean; /** 菜单列表参数 */ list?: MenuChildrenProps[]; /** 菜单分享icon */ jumpIcon?: ReactNode; onClickJump?: (item: MenuChildrenProps) => void; /** 当前选中菜单 */ selectMenu?: string; /** 点击菜单 */ onClickMenu?: (item: MenuChildrenProps | false) => void; /** 样式class */ className?: string; /** 选中菜单,是否收起其他展开项 */ shrinkOthers?: boolean; [name: string]: any; } /** 弹出菜单 */ export interface MenuItemPopoverProps { /** 尺寸 */ size?: 'small' | 'large'; /** 打开 */ open?: boolean; /** 定位元素, 自定义属性 paraui-menu-id */ anchorEl?: string; /** 菜单列表 */ list?: MenuChildrenProps[]; /** 菜单最后一层所有上下级 一条线 */ idMenuLast?: any; /** 当前选中菜单 */ selectMenu?: string; /** 点击菜单 */ onClickMenu?: (item: MenuChildrenProps | false) => void; /** 层级 */ level?: number; /** 鼠标移入 */ onMouseEnter?: Function; /** 鼠标移出 */ onMouseLeave: Function; onMouseEnterBus?: Function; onMouseLeaveBus?: Function; /** 主题色 */ color?: ColorType; className?: string; /** 菜单分享icon */ jumpIcon?: ReactNode; onClickJump?: (item: MenuChildrenProps) => void; [name: string]: any; } /** 尾部展开 */ export interface FooterExpansionProps { /** 是否展开 */ expansion?: boolean; /** 展开图标 */ expandIcon?: ReactNode; /** 收起图标 */ shrinkIcon?: ReactNode; /** 自定义尾部 */ render?: ReactNode; /** 样式class */ className?: string; /** 展开事件 */ clickExpansion?: (bol: boolean) => void; /** 版本号 */ version?: ReactNode; [name: string]: any; } /** 菜单参数 */ export interface MenuProps { /** 样式class */ className?: string; /** style */ style?: React.CSSProperties; /** 尺寸 */ size?: 'small' | 'large'; /** 颜色 */ color?: ColorType; /** 展开 / 收起 */ expansion?: boolean; /** 当前选中菜单 */ selectMenu?: string; /** 选中菜单,是否收起其他展开项 */ shrinkOthers?: boolean; /** 显示收缩按钮 */ showExpansion?: boolean; /** logo配置 */ logoProps?: LogoProps; /** 菜单配置 */ menuListProps?: MenuListProps; /** 尾部展开参数 */ footerExpansionProps?: FooterExpansionProps; /** 展开事件 */ onClickExpansion?: (bol: boolean) => void; /** 点击菜单 */ onClickMenu?: (item: MenuChildrenProps | false) => void; }