-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
168 additions
and
6,283 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 0 additions & 53 deletions
53
packages/core-vue/src/components/menus/theme/theme-mac.less
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
export type HrType = { | ||
type: 'hr'; | ||
}; | ||
|
||
export type LiType = { | ||
type: 'li'; | ||
text: string; | ||
disabled?: boolean; | ||
// eslint-disable-next-line no-undef | ||
callback: EventListener; | ||
close?: boolean; | ||
}; | ||
|
||
export interface AttrsType { | ||
class?: string; | ||
style?: string | { [key: string]: string }; | ||
} | ||
|
||
// eslint-disable-next-line no-use-before-define | ||
export type ItemType = AttrsType & ElementType; | ||
|
||
export type UlType = { | ||
type: 'ul'; | ||
text: string; | ||
disabled?: boolean; | ||
children: ItemType[]; | ||
}; | ||
export type ElementType = HrType | LiType | UlType; | ||
|
||
type GetKeysType<T> = T extends ElementType ? keyof T : never; | ||
|
||
type ElementKeysType = GetKeysType<ElementType>; | ||
|
||
export type ConfigType = { | ||
el: string | HTMLElement; | ||
mode?: 'context-menu' | 'nav-menu' | 'click'; // 模式, 默认为context-menu | ||
theme?: string; // 主题样式, 默认为auto | ||
minWidth?: string | number; // 最小宽度 | ||
maxWidth?: string | number; // 最大宽度 | ||
include?: string[] | RegExp; // 包含的元素 | ||
exclude?: string[] | RegExp; // 排除的元素 | ||
defaultProps?: { | ||
// 默认参数配置项 | ||
[key in ElementKeysType]?: string; | ||
}; | ||
beforeInit?: Function; // 初始化前 | ||
afterInit?: Function; // 初始化后 | ||
beforeShow?: Function; // 显示菜单前 | ||
afterShow?: Function; // 显示菜单后 | ||
beforeHide?: Function; // 隐藏菜单前 | ||
afterHide?: Function; // 隐藏菜单后 | ||
}; | ||
|
||
export type OptionsType = | ||
| ItemType[] | ||
| ((e: Event, config: ConfigType) => ItemType[] | Promise<ItemType[]>); | ||
|
||
export interface MenuElement extends HTMLElement { | ||
direction?: LayoutMenuDirection; | ||
} | ||
|
||
// type RequireKeys = 'el' | ||
export const ConnectOffset = 5; | ||
|
||
export const ATTR_LIST = ['class', 'style']; | ||
|
||
export const SPLIT_SYMBOL = { | ||
class: ' ', | ||
style: ';', | ||
}; | ||
|
||
export const enum LayoutMenuDirection { | ||
Left = -1, | ||
Right = 1, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.