147 lines
2.6 KiB
TypeScript
147 lines
2.6 KiB
TypeScript
|
/**
|
|||
|
* 菜单配置项
|
|||
|
*/
|
|||
|
export interface MenuOptions {
|
|||
|
/**
|
|||
|
* 菜单名称,需唯一
|
|||
|
*/
|
|||
|
name: string;
|
|||
|
/**
|
|||
|
* 菜单标题
|
|||
|
*/
|
|||
|
title?: string;
|
|||
|
/**
|
|||
|
* 菜单分组
|
|||
|
*/
|
|||
|
groups: MenuGroupOptions[];
|
|||
|
/**
|
|||
|
* 菜单样式
|
|||
|
*/
|
|||
|
style?: MenuStyleOptions;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 菜单分组
|
|||
|
*/
|
|||
|
export interface MenuGroupOptions {
|
|||
|
/**
|
|||
|
* 分组命名
|
|||
|
*/
|
|||
|
name?: string;
|
|||
|
/**
|
|||
|
* 菜单项
|
|||
|
*/
|
|||
|
items: MenuItemOptions[];
|
|||
|
}
|
|||
|
export interface MenuCompletionOptions extends MenuOptions {
|
|||
|
style: MenuCompletionStyleOptions;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 菜单样式配置项
|
|||
|
*/
|
|||
|
export interface MenuStyleOptions {
|
|||
|
/**
|
|||
|
* 菜单标题样式
|
|||
|
*/
|
|||
|
titleStyle?: MenuItemStyle;
|
|||
|
/**
|
|||
|
* 菜单背景色
|
|||
|
*/
|
|||
|
backgroundColor?: string;
|
|||
|
/**
|
|||
|
* 菜单边框线宽度,默认1,0为无线框
|
|||
|
*/
|
|||
|
borderWidth?: number;
|
|||
|
/**
|
|||
|
* 菜单边框颜色
|
|||
|
*/
|
|||
|
borderColor?: string;
|
|||
|
/**
|
|||
|
* 包围框是否圆角,圆角的半径,0为直角
|
|||
|
*/
|
|||
|
borderRoundRadius?: number;
|
|||
|
/**
|
|||
|
* 菜单项样式
|
|||
|
*/
|
|||
|
itemStyle?: MenuItemStyle;
|
|||
|
}
|
|||
|
export interface MenuCompletionStyleOptions extends MenuStyleOptions {
|
|||
|
titleStyle: MenuItemStyle;
|
|||
|
backgroundColor: string;
|
|||
|
border: boolean;
|
|||
|
borderWidth: number;
|
|||
|
borderColor: string;
|
|||
|
borderRoundRadius: number;
|
|||
|
itemStyle: MenuCompletionItemStyle;
|
|||
|
}
|
|||
|
export interface MenuItemOptions {
|
|||
|
/**
|
|||
|
* 名称
|
|||
|
*/
|
|||
|
name: string;
|
|||
|
/**
|
|||
|
* 是否禁用,默认不禁用
|
|||
|
*/
|
|||
|
disabled?: boolean;
|
|||
|
/**
|
|||
|
* 是否显示,默认显示
|
|||
|
*/
|
|||
|
visible?: boolean;
|
|||
|
/**
|
|||
|
* 快捷键
|
|||
|
*/
|
|||
|
shortcutKeys?: string[];
|
|||
|
/**
|
|||
|
* 菜单逻辑处理
|
|||
|
*/
|
|||
|
handler?: () => void;
|
|||
|
fontColor?: string;
|
|||
|
/**
|
|||
|
* 子菜单
|
|||
|
*/
|
|||
|
subMenu?: MenuOptions;
|
|||
|
}
|
|||
|
export interface MenuItemStyle {
|
|||
|
/**
|
|||
|
* 字体大小
|
|||
|
*/
|
|||
|
fontSize: number;
|
|||
|
/**
|
|||
|
* 字体颜色
|
|||
|
*/
|
|||
|
fontColor?: string;
|
|||
|
/**
|
|||
|
* hover颜色
|
|||
|
*/
|
|||
|
hoverColor?: string;
|
|||
|
/**
|
|||
|
* 禁用下字体颜色
|
|||
|
*/
|
|||
|
disabledFontColor?: string;
|
|||
|
/**
|
|||
|
* 内边距
|
|||
|
*/
|
|||
|
padding: number[] | number;
|
|||
|
}
|
|||
|
export interface MenuCompletionItemStyle extends MenuItemStyle {
|
|||
|
/**
|
|||
|
* 文字颜色
|
|||
|
*/
|
|||
|
fontColor: string;
|
|||
|
/**
|
|||
|
* 激活颜色
|
|||
|
*/
|
|||
|
hoverColor: string;
|
|||
|
/**
|
|||
|
* 禁用下字体颜色
|
|||
|
*/
|
|||
|
disabledFontColor: string;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 默认的白色样式
|
|||
|
*/
|
|||
|
export declare const DefaultWhiteStyleOptions: MenuCompletionStyleOptions;
|
|||
|
/**
|
|||
|
* 默认的白色菜单配置
|
|||
|
*/
|
|||
|
export declare const DefaultWhiteMenuOptions: MenuCompletionOptions;
|