@me-framework/me-ui-antdv-next 0.0.36 → 0.0.39
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/dist/data/server-menu.json +2742 -0
- package/dist/me-ui-antdv-next.js +508 -523
- package/dist/me-ui-antdv-next.umd.cjs +3 -3
- package/dist/menu/index.css +1 -1
- package/dist/menu/index.js +217 -232
- package/dist/menu/index.vue.d.ts +4 -2
- package/dist/menu/types.d.ts +9 -1
- package/dist/menu/useMenu.d.ts +56 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/menu/index.vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MeMenuItem, MeMenuProps } from './types';
|
|
2
|
-
declare var __VLS_1: {}, __VLS_13: {},
|
|
2
|
+
declare var __VLS_1: {}, __VLS_13: {}, __VLS_44: {
|
|
3
3
|
collapsed: boolean;
|
|
4
4
|
};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
@@ -7,7 +7,7 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
} & {
|
|
8
8
|
footer?: (props: typeof __VLS_13) => any;
|
|
9
9
|
} & {
|
|
10
|
-
'right-toggle'?: (props: typeof
|
|
10
|
+
'right-toggle'?: (props: typeof __VLS_44) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: import('vue').DefineComponent<MeMenuProps, {
|
|
13
13
|
setBadge: (key: string, badge: string | number | boolean, color?: string) => void;
|
|
@@ -41,6 +41,8 @@ declare const __VLS_base: import('vue').DefineComponent<MeMenuProps, {
|
|
|
41
41
|
rightWidth: string | number;
|
|
42
42
|
hideDisabled: boolean;
|
|
43
43
|
showHidden: boolean;
|
|
44
|
+
parentField: string;
|
|
45
|
+
childrenField: string;
|
|
44
46
|
showRightToggle: boolean;
|
|
45
47
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
46
48
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
package/dist/menu/types.d.ts
CHANGED
|
@@ -229,7 +229,15 @@ export interface MeMenuProps {
|
|
|
229
229
|
*/
|
|
230
230
|
keyField?: string;
|
|
231
231
|
/**
|
|
232
|
-
*
|
|
232
|
+
* 父级菜单 ID 的字段名,默认 'parentId'(一级菜单通过该字段值为 '0' 识别)
|
|
233
|
+
*/
|
|
234
|
+
parentField?: string;
|
|
235
|
+
/**
|
|
236
|
+
* 子菜单数组的字段名,默认 'children'
|
|
237
|
+
*/
|
|
238
|
+
childrenField?: string;
|
|
239
|
+
/**
|
|
240
|
+
* 是否折叠右侧子菜单(仅显示左侧一级菜单),支持 v-model
|
|
233
241
|
*/
|
|
234
242
|
rightCollapsed?: boolean;
|
|
235
243
|
/**
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MeMenuItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 徽标颜色映射:将预设颜色名转换为 antd Badge 可用的颜色值
|
|
4
|
+
*/
|
|
5
|
+
export declare const resolveBadgeColor: (color?: string) => string | undefined;
|
|
6
|
+
export interface UseMenuOptions {
|
|
7
|
+
keyField: string;
|
|
8
|
+
childrenField: string;
|
|
9
|
+
hideDisabled: boolean;
|
|
10
|
+
showHidden: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* provide 给子组件的菜单上下文
|
|
14
|
+
* 包含绑定好 options 的工具函数,子组件直接调用无需传参
|
|
15
|
+
*/
|
|
16
|
+
export interface MenuContext {
|
|
17
|
+
keyField: string;
|
|
18
|
+
childrenField: string;
|
|
19
|
+
hideDisabled: boolean;
|
|
20
|
+
showHidden: boolean;
|
|
21
|
+
selectedId: string;
|
|
22
|
+
expandedSections: Set<string>;
|
|
23
|
+
getItemKey: (item: MeMenuItem) => string;
|
|
24
|
+
getVisibleChildren: (item: MeMenuItem) => MeMenuItem[];
|
|
25
|
+
resolveBadgeColor: (color?: string) => string | undefined;
|
|
26
|
+
}
|
|
27
|
+
/** 注入 key */
|
|
28
|
+
export declare const menuContextKey: unique symbol;
|
|
29
|
+
/**
|
|
30
|
+
* 获取菜单项的唯一标识值
|
|
31
|
+
*/
|
|
32
|
+
export declare const getItemKey: (item: MeMenuItem, keyField: string) => string;
|
|
33
|
+
/**
|
|
34
|
+
* 获取菜单项的子菜单数组
|
|
35
|
+
*/
|
|
36
|
+
export declare const getChildren: (item: MeMenuItem | null | undefined, childrenField: string) => MeMenuItem[];
|
|
37
|
+
/**
|
|
38
|
+
* 判断菜单项是否可见
|
|
39
|
+
*/
|
|
40
|
+
export declare const isItemVisible: (item: MeMenuItem, options: UseMenuOptions) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 获取一个菜单项下的所有可见子菜单(过滤 + 排序)
|
|
43
|
+
*/
|
|
44
|
+
export declare const getVisibleChildren: (item: MeMenuItem, options: UseMenuOptions) => MeMenuItem[];
|
|
45
|
+
/**
|
|
46
|
+
* 递归查找菜单项
|
|
47
|
+
*/
|
|
48
|
+
export declare const findItemByKey: (items: MeMenuItem[], key: string, options: UseMenuOptions) => MeMenuItem | null;
|
|
49
|
+
/**
|
|
50
|
+
* 判断菜单项是否是可选中的叶子项(非分组、无可见子菜单)
|
|
51
|
+
*/
|
|
52
|
+
export declare const isLeafItem: (item: MeMenuItem, options: UseMenuOptions) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 获取指定项及其所有后代中的第一个叶子项
|
|
55
|
+
*/
|
|
56
|
+
export declare const findFirstLeafUnder: (item: MeMenuItem, options: UseMenuOptions) => MeMenuItem | null;
|