@v-c/menu 1.0.0 → 1.0.2
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/Divider.cjs +7 -4
- package/dist/Divider.js +1 -1
- package/dist/Icon.cjs +9 -6
- package/dist/Icon.js +3 -3
- package/dist/Menu.cjs +27 -24
- package/dist/Menu.js +10 -10
- package/dist/MenuItem.cjs +35 -31
- package/dist/MenuItem.js +14 -13
- package/dist/MenuItemGroup.cjs +20 -15
- package/dist/MenuItemGroup.js +7 -5
- package/dist/SubMenu/InlineSubMenuList.cjs +6 -3
- package/dist/SubMenu/PopupTrigger.cjs +16 -12
- package/dist/SubMenu/PopupTrigger.js +3 -2
- package/dist/SubMenu/SubMenuList.cjs +6 -3
- package/dist/SubMenu/index.cjs +34 -29
- package/dist/SubMenu/index.js +22 -20
- package/dist/context/IdContext.cjs +1 -0
- package/dist/context/MenuContext.cjs +13 -10
- package/dist/context/MenuContext.js +6 -6
- package/dist/context/PathContext.cjs +1 -0
- package/dist/context/PrivateContext.cjs +1 -0
- package/dist/hooks/useAccessibility.cjs +7 -4
- package/dist/hooks/useActive.cjs +4 -1
- package/dist/hooks/useDirectionStyle.cjs +4 -1
- package/dist/hooks/useKeyRecords.cjs +4 -1
- package/dist/hooks/useMemoCallback.cjs +4 -1
- package/dist/index.cjs +4 -1
- package/dist/interface.cjs +1 -0
- package/dist/placements.cjs +4 -1
- package/dist/utils/commonUtil.cjs +3 -2
- package/dist/utils/motionUtil.cjs +1 -0
- package/dist/utils/nodeUtil.cjs +5 -4
- package/dist/utils/nodeUtil.js +1 -1
- package/dist/utils/timeUtil.cjs +1 -0
- package/dist/utils/warnUtil.cjs +4 -3
- package/dist/utils/warnUtil.js +1 -1
- package/package.json +4 -4
package/dist/MenuItemGroup.cjs
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("./context/MenuContext.cjs");
|
|
4
7
|
const require_PathContext = require("./context/PathContext.cjs");
|
|
5
8
|
const require_commonUtil = require("./utils/commonUtil.cjs");
|
|
6
9
|
let vue = require("vue");
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let
|
|
10
|
+
let _v_c_util = require("@v-c/util");
|
|
11
|
+
let _v_c_util_dist_omit = require("@v-c/util/dist/omit");
|
|
12
|
+
_v_c_util_dist_omit = require_rolldown_runtime.__toESM(_v_c_util_dist_omit);
|
|
13
|
+
let _v_c_util_dist_props_util = require("@v-c/util/dist/props-util");
|
|
11
14
|
function _isSlot(s) {
|
|
12
15
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
13
16
|
}
|
|
14
17
|
var InternalMenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
15
18
|
const context = require_MenuContext.useMenuContext();
|
|
16
19
|
return () => {
|
|
17
|
-
const { class: className, title, eventKey
|
|
20
|
+
const { class: className, title, eventKey, ...restProps } = props;
|
|
18
21
|
const { prefixCls, classes: menuClassNames, styles } = context?.value ?? {};
|
|
19
22
|
const groupPrefixCls = `${prefixCls}-item-group`;
|
|
20
23
|
return (0, vue.createVNode)("li", (0, vue.mergeProps)({ "role": "presentation" }, restProps, {
|
|
21
24
|
"onClick": (e) => e.stopPropagation(),
|
|
22
|
-
"class": (0,
|
|
25
|
+
"class": (0, _v_c_util.clsx)(groupPrefixCls, className)
|
|
23
26
|
}), [(0, vue.createVNode)("div", {
|
|
24
27
|
"role": "presentation",
|
|
25
|
-
"class": (0,
|
|
28
|
+
"class": (0, _v_c_util.clsx)(`${groupPrefixCls}-title`, menuClassNames?.listTitle),
|
|
26
29
|
"style": styles?.listTitle,
|
|
27
30
|
"title": typeof title === "string" ? title : void 0
|
|
28
31
|
}, [title]), (0, vue.createVNode)("ul", {
|
|
29
32
|
"role": "group",
|
|
30
|
-
"class": (0,
|
|
33
|
+
"class": (0, _v_c_util.clsx)(`${groupPrefixCls}-list`, menuClassNames?.list),
|
|
31
34
|
"style": styles?.list
|
|
32
35
|
}, [slots?.default ? slots.default() : null])]);
|
|
33
36
|
};
|
|
@@ -35,6 +38,8 @@ var InternalMenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, { s
|
|
|
35
38
|
props: {
|
|
36
39
|
title: {
|
|
37
40
|
type: [
|
|
41
|
+
Object,
|
|
42
|
+
Function,
|
|
38
43
|
String,
|
|
39
44
|
Number,
|
|
40
45
|
null,
|
|
@@ -42,7 +47,6 @@ var InternalMenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, { s
|
|
|
42
47
|
Array
|
|
43
48
|
],
|
|
44
49
|
required: false,
|
|
45
|
-
skipCheck: true,
|
|
46
50
|
default: void 0
|
|
47
51
|
},
|
|
48
52
|
eventKey: {
|
|
@@ -56,7 +60,7 @@ var InternalMenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, { s
|
|
|
56
60
|
default: void 0
|
|
57
61
|
},
|
|
58
62
|
style: {
|
|
59
|
-
type:
|
|
63
|
+
type: Object,
|
|
60
64
|
required: false,
|
|
61
65
|
default: void 0
|
|
62
66
|
},
|
|
@@ -73,14 +77,16 @@ var MenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, ctx) => {
|
|
|
73
77
|
const measure = require_PathContext.useMeasure();
|
|
74
78
|
return () => {
|
|
75
79
|
const slots = ctx.slots;
|
|
76
|
-
const childList = require_commonUtil.parseChildren((0,
|
|
80
|
+
const childList = require_commonUtil.parseChildren((0, _v_c_util_dist_props_util.filterEmpty)(slots.default ? slots.default() : []), connectedKeyPath.value);
|
|
77
81
|
if (measure) return childList;
|
|
78
|
-
return (0, vue.createVNode)(InternalMenuItemGroup, (0,
|
|
82
|
+
return (0, vue.createVNode)(InternalMenuItemGroup, (0, _v_c_util_dist_omit.default)(props, ["warnKey"]), _isSlot(childList) ? childList : { default: () => [childList] });
|
|
79
83
|
};
|
|
80
84
|
}, {
|
|
81
85
|
props: {
|
|
82
86
|
title: {
|
|
83
87
|
type: [
|
|
88
|
+
Object,
|
|
89
|
+
Function,
|
|
84
90
|
String,
|
|
85
91
|
Number,
|
|
86
92
|
null,
|
|
@@ -88,7 +94,6 @@ var MenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, ctx) => {
|
|
|
88
94
|
Array
|
|
89
95
|
],
|
|
90
96
|
required: false,
|
|
91
|
-
skipCheck: true,
|
|
92
97
|
default: void 0
|
|
93
98
|
},
|
|
94
99
|
eventKey: {
|
|
@@ -102,7 +107,7 @@ var MenuItemGroup = /* @__PURE__ */ (0, vue.defineComponent)((props, ctx) => {
|
|
|
102
107
|
default: void 0
|
|
103
108
|
},
|
|
104
109
|
style: {
|
|
105
|
-
type:
|
|
110
|
+
type: Object,
|
|
106
111
|
required: false,
|
|
107
112
|
default: void 0
|
|
108
113
|
},
|
package/dist/MenuItemGroup.js
CHANGED
|
@@ -11,7 +11,7 @@ function _isSlot(s) {
|
|
|
11
11
|
var InternalMenuItemGroup = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
12
12
|
const context = useMenuContext();
|
|
13
13
|
return () => {
|
|
14
|
-
const { class: className, title, eventKey
|
|
14
|
+
const { class: className, title, eventKey, ...restProps } = props;
|
|
15
15
|
const { prefixCls, classes: menuClassNames, styles } = context?.value ?? {};
|
|
16
16
|
const groupPrefixCls = `${prefixCls}-item-group`;
|
|
17
17
|
return createVNode("li", mergeProps({ "role": "presentation" }, restProps, {
|
|
@@ -32,6 +32,8 @@ var InternalMenuItemGroup = /* @__PURE__ */ defineComponent((props, { slots }) =
|
|
|
32
32
|
props: {
|
|
33
33
|
title: {
|
|
34
34
|
type: [
|
|
35
|
+
Object,
|
|
36
|
+
Function,
|
|
35
37
|
String,
|
|
36
38
|
Number,
|
|
37
39
|
null,
|
|
@@ -39,7 +41,6 @@ var InternalMenuItemGroup = /* @__PURE__ */ defineComponent((props, { slots }) =
|
|
|
39
41
|
Array
|
|
40
42
|
],
|
|
41
43
|
required: false,
|
|
42
|
-
skipCheck: true,
|
|
43
44
|
default: void 0
|
|
44
45
|
},
|
|
45
46
|
eventKey: {
|
|
@@ -53,7 +54,7 @@ var InternalMenuItemGroup = /* @__PURE__ */ defineComponent((props, { slots }) =
|
|
|
53
54
|
default: void 0
|
|
54
55
|
},
|
|
55
56
|
style: {
|
|
56
|
-
type:
|
|
57
|
+
type: Object,
|
|
57
58
|
required: false,
|
|
58
59
|
default: void 0
|
|
59
60
|
},
|
|
@@ -78,6 +79,8 @@ var MenuItemGroup_default = /* @__PURE__ */ defineComponent((props, ctx) => {
|
|
|
78
79
|
props: {
|
|
79
80
|
title: {
|
|
80
81
|
type: [
|
|
82
|
+
Object,
|
|
83
|
+
Function,
|
|
81
84
|
String,
|
|
82
85
|
Number,
|
|
83
86
|
null,
|
|
@@ -85,7 +88,6 @@ var MenuItemGroup_default = /* @__PURE__ */ defineComponent((props, ctx) => {
|
|
|
85
88
|
Array
|
|
86
89
|
],
|
|
87
90
|
required: false,
|
|
88
|
-
skipCheck: true,
|
|
89
91
|
default: void 0
|
|
90
92
|
},
|
|
91
93
|
eventKey: {
|
|
@@ -99,7 +101,7 @@ var MenuItemGroup_default = /* @__PURE__ */ defineComponent((props, ctx) => {
|
|
|
99
101
|
default: void 0
|
|
100
102
|
},
|
|
101
103
|
style: {
|
|
102
|
-
type:
|
|
104
|
+
type: Object,
|
|
103
105
|
required: false,
|
|
104
106
|
default: void 0
|
|
105
107
|
},
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("../context/MenuContext.cjs");
|
|
4
7
|
const require_motionUtil = require("../utils/motionUtil.cjs");
|
|
5
8
|
const require_SubMenuList = require("./SubMenuList.cjs");
|
|
6
9
|
let vue = require("vue");
|
|
7
|
-
let
|
|
10
|
+
let _v_c_util_dist_utils_transition = require("@v-c/util/dist/utils/transition");
|
|
8
11
|
var InlineSubMenuList = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
9
12
|
const fixedMode = "inline";
|
|
10
13
|
const menuContext = require_MenuContext.useMenuContext();
|
|
@@ -33,7 +36,7 @@ var InlineSubMenuList = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots
|
|
|
33
36
|
return (0, vue.createVNode)(require_MenuContext.default, {
|
|
34
37
|
"mode": fixedMode,
|
|
35
38
|
"locked": !sameModeRef.value
|
|
36
|
-
}, { default: () => [(0, vue.createVNode)(vue.Transition, (0,
|
|
39
|
+
}, { default: () => [(0, vue.createVNode)(vue.Transition, (0, _v_c_util_dist_utils_transition.getTransitionProps)(mergedMotion.value?.name, mergedMotion.value), { default: () => [mergedOpen.value && (0, vue.createVNode)(require_SubMenuList.default, { "id": props.id }, { default: () => [slots?.default?.()] })] })] });
|
|
37
40
|
};
|
|
38
41
|
}, {
|
|
39
42
|
props: {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("../context/MenuContext.cjs");
|
|
4
7
|
const require_motionUtil = require("../utils/motionUtil.cjs");
|
|
5
8
|
const require_placements = require("../placements.cjs");
|
|
6
9
|
let vue = require("vue");
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
10
|
+
let _v_c_util = require("@v-c/util");
|
|
11
|
+
let _v_c_trigger = require("@v-c/trigger");
|
|
12
|
+
_v_c_trigger = require_rolldown_runtime.__toESM(_v_c_trigger);
|
|
13
|
+
let _v_c_util_dist_raf = require("@v-c/util/dist/raf");
|
|
14
|
+
_v_c_util_dist_raf = require_rolldown_runtime.__toESM(_v_c_util_dist_raf);
|
|
12
15
|
var popupPlacementMap = {
|
|
13
16
|
"horizontal": "bottomLeft",
|
|
14
17
|
"vertical": "rightTop",
|
|
@@ -53,19 +56,19 @@ var PopupTrigger = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) =
|
|
|
53
56
|
});
|
|
54
57
|
const visibleRef = (0, vue.shallowRef)();
|
|
55
58
|
(0, vue.watch)(() => props.visible, (visible, _, onCleanup) => {
|
|
56
|
-
visibleRef.value = (0,
|
|
59
|
+
visibleRef.value = (0, _v_c_util_dist_raf.default)(() => {
|
|
57
60
|
innerVisible.value = visible;
|
|
58
61
|
});
|
|
59
62
|
onCleanup(() => {
|
|
60
|
-
if (visibleRef.value !== void 0)
|
|
63
|
+
if (visibleRef.value !== void 0) _v_c_util_dist_raf.default.cancel(visibleRef.value);
|
|
61
64
|
});
|
|
62
65
|
});
|
|
63
66
|
return () => {
|
|
64
67
|
const { popupClassName, popup, popupStyle, popupOffset, disabled, onVisibleChange, prefixCls } = props;
|
|
65
68
|
const { rtl, rootClass, mode, getPopupContainer, triggerSubMenuAction, subMenuCloseDelay, subMenuOpenDelay, forceSubMenuRender } = menuContext?.value ?? {};
|
|
66
|
-
return (0, vue.createVNode)(
|
|
69
|
+
return (0, vue.createVNode)(_v_c_trigger.default, {
|
|
67
70
|
"prefixCls": prefixCls,
|
|
68
|
-
"popupClassName": (0,
|
|
71
|
+
"popupClassName": (0, _v_c_util.clsx)(`${prefixCls}-popup`, { [`${prefixCls}-rtl`]: rtl }, popupClassName, rootClass),
|
|
69
72
|
"stretch": mode === "horizontal" ? "minWidth" : void 0,
|
|
70
73
|
"getPopupContainer": getPopupContainer,
|
|
71
74
|
"builtinPlacements": placement.value,
|
|
@@ -101,6 +104,8 @@ var PopupTrigger = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) =
|
|
|
101
104
|
},
|
|
102
105
|
popup: {
|
|
103
106
|
type: [
|
|
107
|
+
Object,
|
|
108
|
+
Function,
|
|
104
109
|
String,
|
|
105
110
|
Number,
|
|
106
111
|
null,
|
|
@@ -108,11 +113,10 @@ var PopupTrigger = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) =
|
|
|
108
113
|
Array
|
|
109
114
|
],
|
|
110
115
|
required: true,
|
|
111
|
-
skipCheck: true,
|
|
112
116
|
default: void 0
|
|
113
117
|
},
|
|
114
118
|
popupStyle: {
|
|
115
|
-
type:
|
|
119
|
+
type: Object,
|
|
116
120
|
required: false,
|
|
117
121
|
default: void 0
|
|
118
122
|
},
|
|
@@ -97,6 +97,8 @@ var PopupTrigger_default = /* @__PURE__ */ defineComponent((props, { slots }) =>
|
|
|
97
97
|
},
|
|
98
98
|
popup: {
|
|
99
99
|
type: [
|
|
100
|
+
Object,
|
|
101
|
+
Function,
|
|
100
102
|
String,
|
|
101
103
|
Number,
|
|
102
104
|
null,
|
|
@@ -104,11 +106,10 @@ var PopupTrigger_default = /* @__PURE__ */ defineComponent((props, { slots }) =>
|
|
|
104
106
|
Array
|
|
105
107
|
],
|
|
106
108
|
required: true,
|
|
107
|
-
skipCheck: true,
|
|
108
109
|
default: void 0
|
|
109
110
|
},
|
|
110
111
|
popupStyle: {
|
|
111
|
-
type:
|
|
112
|
+
type: Object,
|
|
112
113
|
required: false,
|
|
113
114
|
default: void 0
|
|
114
115
|
},
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("../context/MenuContext.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
5
|
-
let
|
|
8
|
+
let _v_c_util = require("@v-c/util");
|
|
6
9
|
var InternalSubMenuList = /* @__PURE__ */ (0, vue.defineComponent)((_, { attrs, slots }) => {
|
|
7
10
|
const menuContext = require_MenuContext.useMenuContext();
|
|
8
11
|
return () => {
|
|
9
12
|
const { prefixCls, mode, rtl } = menuContext?.value ?? {};
|
|
10
13
|
return (0, vue.createVNode)("ul", (0, vue.mergeProps)({
|
|
11
|
-
"class": (0,
|
|
14
|
+
"class": (0, _v_c_util.clsx)(prefixCls, !!rtl && `${prefixCls}-rtl`, `${prefixCls}-sub`, `${prefixCls}-${mode === "inline" ? "inline" : "vertical"}`),
|
|
12
15
|
"role": "menu"
|
|
13
16
|
}, attrs, { "data-menu-list": true }), [slots?.default?.()]);
|
|
14
17
|
};
|
package/dist/SubMenu/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("../context/MenuContext.cjs");
|
|
4
7
|
const require_PathContext = require("../context/PathContext.cjs");
|
|
@@ -12,11 +15,11 @@ const require_SubMenuList = require("./SubMenuList.cjs");
|
|
|
12
15
|
const require_InlineSubMenuList = require("./InlineSubMenuList.cjs");
|
|
13
16
|
const require_PopupTrigger = require("./PopupTrigger.cjs");
|
|
14
17
|
let vue = require("vue");
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
let
|
|
19
|
-
|
|
18
|
+
let _v_c_util = require("@v-c/util");
|
|
19
|
+
let _v_c_overflow = require("@v-c/overflow");
|
|
20
|
+
_v_c_overflow = require_rolldown_runtime.__toESM(_v_c_overflow);
|
|
21
|
+
let _v_c_util_dist_warning = require("@v-c/util/dist/warning");
|
|
22
|
+
_v_c_util_dist_warning = require_rolldown_runtime.__toESM(_v_c_util_dist_warning);
|
|
20
23
|
function _isSlot(s) {
|
|
21
24
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
22
25
|
}
|
|
@@ -44,7 +47,7 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
44
47
|
};
|
|
45
48
|
const subMenuPrefixCls = (0, vue.computed)(() => `${prefixCls.value}-submenu`);
|
|
46
49
|
const mergedDisabled = (0, vue.computed)(() => !!(contextDisabled.value || props?.disabled));
|
|
47
|
-
if (process.env.NODE_ENV !== "production" && props?.warnKey) (0,
|
|
50
|
+
if (process.env.NODE_ENV !== "production" && props?.warnKey) (0, _v_c_util_dist_warning.default)(false, "SubMenu should not leave undefined `key`.");
|
|
48
51
|
const mergedExpandIcon = (0, vue.computed)(() => props?.expandIcon ?? contextExpandIcon.value);
|
|
49
52
|
const originOpen = (0, vue.computed)(() => {
|
|
50
53
|
const key = props?.eventKey;
|
|
@@ -55,7 +58,7 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
55
58
|
const key = props?.eventKey;
|
|
56
59
|
return key ? pathUserContext.isSubPathKey(selectedKeys.value, key) : false;
|
|
57
60
|
});
|
|
58
|
-
const { active
|
|
61
|
+
const { active, ...activeProps } = require_useActive.default((0, vue.computed)(() => props?.eventKey || ""), mergedDisabled, (e) => props?.onTitleMouseEnter?.(e), (e) => props?.onTitleMouseLeave?.(e));
|
|
59
62
|
const childrenActive = (0, vue.ref)(false);
|
|
60
63
|
const triggerChildrenActive = (newActive) => {
|
|
61
64
|
if (!mergedDisabled.value) childrenActive.value = newActive;
|
|
@@ -107,7 +110,7 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
107
110
|
else triggerModeRef.value = mode.value;
|
|
108
111
|
}, { immediate: true });
|
|
109
112
|
return () => {
|
|
110
|
-
const { style, title, class: className, popupClassName, popupOffset, popupStyle, classes, styles
|
|
113
|
+
const { style, title, class: className, popupClassName, popupOffset, popupStyle, classes, styles, ...restProps } = props;
|
|
111
114
|
const children = slots.default?.();
|
|
112
115
|
const popupId = domDataId.value && `${domDataId.value}-popup`;
|
|
113
116
|
const expandIconProps = {
|
|
@@ -168,10 +171,10 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
168
171
|
"onVisibleChange": onPopupVisibleChange
|
|
169
172
|
}, _isSlot(titleNode) ? titleNode : { default: () => [_titleNode] });
|
|
170
173
|
}
|
|
171
|
-
let listNode = (0, vue.createVNode)(
|
|
174
|
+
let listNode = (0, vue.createVNode)(_v_c_overflow.default.Item, (0, vue.mergeProps)({ "role": "none" }, attrs, restProps, {
|
|
172
175
|
"component": "li",
|
|
173
176
|
"style": style,
|
|
174
|
-
"class": (0,
|
|
177
|
+
"class": (0, _v_c_util.classNames)(subMenuPrefixCls.value, `${subMenuPrefixCls.value}-${mode.value}`, className, {
|
|
175
178
|
[`${subMenuPrefixCls.value}-open`]: open.value,
|
|
176
179
|
[`${subMenuPrefixCls.value}-active`]: mergedActive.value,
|
|
177
180
|
[`${subMenuPrefixCls.value}-selected`]: childrenSelected.value,
|
|
@@ -206,6 +209,8 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
206
209
|
},
|
|
207
210
|
title: {
|
|
208
211
|
type: [
|
|
212
|
+
Object,
|
|
213
|
+
Function,
|
|
209
214
|
String,
|
|
210
215
|
Number,
|
|
211
216
|
null,
|
|
@@ -213,7 +218,6 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
213
218
|
Array
|
|
214
219
|
],
|
|
215
220
|
required: false,
|
|
216
|
-
skipCheck: true,
|
|
217
221
|
default: void 0
|
|
218
222
|
},
|
|
219
223
|
internalPopupClose: {
|
|
@@ -253,28 +257,28 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
253
257
|
},
|
|
254
258
|
itemIcon: {
|
|
255
259
|
type: [
|
|
260
|
+
Object,
|
|
261
|
+
Function,
|
|
256
262
|
String,
|
|
257
263
|
Number,
|
|
258
264
|
null,
|
|
259
265
|
Boolean,
|
|
260
|
-
Array
|
|
261
|
-
Function
|
|
266
|
+
Array
|
|
262
267
|
],
|
|
263
268
|
required: false,
|
|
264
|
-
skipCheck: true,
|
|
265
269
|
default: void 0
|
|
266
270
|
},
|
|
267
271
|
expandIcon: {
|
|
268
272
|
type: [
|
|
273
|
+
Object,
|
|
274
|
+
Function,
|
|
269
275
|
String,
|
|
270
276
|
Number,
|
|
271
277
|
null,
|
|
272
278
|
Boolean,
|
|
273
|
-
Array
|
|
274
|
-
Function
|
|
279
|
+
Array
|
|
275
280
|
],
|
|
276
281
|
required: false,
|
|
277
|
-
skipCheck: true,
|
|
278
282
|
default: void 0
|
|
279
283
|
},
|
|
280
284
|
onMouseEnter: {
|
|
@@ -298,7 +302,7 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
298
302
|
default: void 0
|
|
299
303
|
},
|
|
300
304
|
popupStyle: {
|
|
301
|
-
type:
|
|
305
|
+
type: Object,
|
|
302
306
|
required: false,
|
|
303
307
|
default: void 0
|
|
304
308
|
},
|
|
@@ -323,7 +327,7 @@ var InternalSubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots,
|
|
|
323
327
|
default: void 0
|
|
324
328
|
},
|
|
325
329
|
style: {
|
|
326
|
-
type:
|
|
330
|
+
type: Object,
|
|
327
331
|
required: false,
|
|
328
332
|
default: void 0
|
|
329
333
|
},
|
|
@@ -369,6 +373,8 @@ var SubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
|
369
373
|
},
|
|
370
374
|
title: {
|
|
371
375
|
type: [
|
|
376
|
+
Object,
|
|
377
|
+
Function,
|
|
372
378
|
String,
|
|
373
379
|
Number,
|
|
374
380
|
null,
|
|
@@ -376,7 +382,6 @@ var SubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
|
376
382
|
Array
|
|
377
383
|
],
|
|
378
384
|
required: false,
|
|
379
|
-
skipCheck: true,
|
|
380
385
|
default: void 0
|
|
381
386
|
},
|
|
382
387
|
internalPopupClose: {
|
|
@@ -416,28 +421,28 @@ var SubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
|
416
421
|
},
|
|
417
422
|
itemIcon: {
|
|
418
423
|
type: [
|
|
424
|
+
Object,
|
|
425
|
+
Function,
|
|
419
426
|
String,
|
|
420
427
|
Number,
|
|
421
428
|
null,
|
|
422
429
|
Boolean,
|
|
423
|
-
Array
|
|
424
|
-
Function
|
|
430
|
+
Array
|
|
425
431
|
],
|
|
426
432
|
required: false,
|
|
427
|
-
skipCheck: true,
|
|
428
433
|
default: void 0
|
|
429
434
|
},
|
|
430
435
|
expandIcon: {
|
|
431
436
|
type: [
|
|
437
|
+
Object,
|
|
438
|
+
Function,
|
|
432
439
|
String,
|
|
433
440
|
Number,
|
|
434
441
|
null,
|
|
435
442
|
Boolean,
|
|
436
|
-
Array
|
|
437
|
-
Function
|
|
443
|
+
Array
|
|
438
444
|
],
|
|
439
445
|
required: false,
|
|
440
|
-
skipCheck: true,
|
|
441
446
|
default: void 0
|
|
442
447
|
},
|
|
443
448
|
onMouseEnter: {
|
|
@@ -461,7 +466,7 @@ var SubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
|
461
466
|
default: void 0
|
|
462
467
|
},
|
|
463
468
|
popupStyle: {
|
|
464
|
-
type:
|
|
469
|
+
type: Object,
|
|
465
470
|
required: false,
|
|
466
471
|
default: void 0
|
|
467
472
|
},
|
|
@@ -486,7 +491,7 @@ var SubMenu = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
|
486
491
|
default: void 0
|
|
487
492
|
},
|
|
488
493
|
style: {
|
|
489
|
-
type:
|
|
494
|
+
type: Object,
|
|
490
495
|
required: false,
|
|
491
496
|
default: void 0
|
|
492
497
|
},
|
package/dist/SubMenu/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
51
51
|
const key = props?.eventKey;
|
|
52
52
|
return key ? pathUserContext.isSubPathKey(selectedKeys.value, key) : false;
|
|
53
53
|
});
|
|
54
|
-
const { active
|
|
54
|
+
const { active, ...activeProps } = useActive(computed(() => props?.eventKey || ""), mergedDisabled, (e) => props?.onTitleMouseEnter?.(e), (e) => props?.onTitleMouseLeave?.(e));
|
|
55
55
|
const childrenActive = ref(false);
|
|
56
56
|
const triggerChildrenActive = (newActive) => {
|
|
57
57
|
if (!mergedDisabled.value) childrenActive.value = newActive;
|
|
@@ -103,7 +103,7 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
103
103
|
else triggerModeRef.value = mode.value;
|
|
104
104
|
}, { immediate: true });
|
|
105
105
|
return () => {
|
|
106
|
-
const { style, title, class: className, popupClassName, popupOffset, popupStyle, classes, styles
|
|
106
|
+
const { style, title, class: className, popupClassName, popupOffset, popupStyle, classes, styles, ...restProps } = props;
|
|
107
107
|
const children = slots.default?.();
|
|
108
108
|
const popupId = domDataId.value && `${domDataId.value}-popup`;
|
|
109
109
|
const expandIconProps = {
|
|
@@ -202,6 +202,8 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
202
202
|
},
|
|
203
203
|
title: {
|
|
204
204
|
type: [
|
|
205
|
+
Object,
|
|
206
|
+
Function,
|
|
205
207
|
String,
|
|
206
208
|
Number,
|
|
207
209
|
null,
|
|
@@ -209,7 +211,6 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
209
211
|
Array
|
|
210
212
|
],
|
|
211
213
|
required: false,
|
|
212
|
-
skipCheck: true,
|
|
213
214
|
default: void 0
|
|
214
215
|
},
|
|
215
216
|
internalPopupClose: {
|
|
@@ -249,28 +250,28 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
249
250
|
},
|
|
250
251
|
itemIcon: {
|
|
251
252
|
type: [
|
|
253
|
+
Object,
|
|
254
|
+
Function,
|
|
252
255
|
String,
|
|
253
256
|
Number,
|
|
254
257
|
null,
|
|
255
258
|
Boolean,
|
|
256
|
-
Array
|
|
257
|
-
Function
|
|
259
|
+
Array
|
|
258
260
|
],
|
|
259
261
|
required: false,
|
|
260
|
-
skipCheck: true,
|
|
261
262
|
default: void 0
|
|
262
263
|
},
|
|
263
264
|
expandIcon: {
|
|
264
265
|
type: [
|
|
266
|
+
Object,
|
|
267
|
+
Function,
|
|
265
268
|
String,
|
|
266
269
|
Number,
|
|
267
270
|
null,
|
|
268
271
|
Boolean,
|
|
269
|
-
Array
|
|
270
|
-
Function
|
|
272
|
+
Array
|
|
271
273
|
],
|
|
272
274
|
required: false,
|
|
273
|
-
skipCheck: true,
|
|
274
275
|
default: void 0
|
|
275
276
|
},
|
|
276
277
|
onMouseEnter: {
|
|
@@ -294,7 +295,7 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
294
295
|
default: void 0
|
|
295
296
|
},
|
|
296
297
|
popupStyle: {
|
|
297
|
-
type:
|
|
298
|
+
type: Object,
|
|
298
299
|
required: false,
|
|
299
300
|
default: void 0
|
|
300
301
|
},
|
|
@@ -319,7 +320,7 @@ var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
319
320
|
default: void 0
|
|
320
321
|
},
|
|
321
322
|
style: {
|
|
322
|
-
type:
|
|
323
|
+
type: Object,
|
|
323
324
|
required: false,
|
|
324
325
|
default: void 0
|
|
325
326
|
},
|
|
@@ -365,6 +366,8 @@ var SubMenu_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
365
366
|
},
|
|
366
367
|
title: {
|
|
367
368
|
type: [
|
|
369
|
+
Object,
|
|
370
|
+
Function,
|
|
368
371
|
String,
|
|
369
372
|
Number,
|
|
370
373
|
null,
|
|
@@ -372,7 +375,6 @@ var SubMenu_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
372
375
|
Array
|
|
373
376
|
],
|
|
374
377
|
required: false,
|
|
375
|
-
skipCheck: true,
|
|
376
378
|
default: void 0
|
|
377
379
|
},
|
|
378
380
|
internalPopupClose: {
|
|
@@ -412,28 +414,28 @@ var SubMenu_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
412
414
|
},
|
|
413
415
|
itemIcon: {
|
|
414
416
|
type: [
|
|
417
|
+
Object,
|
|
418
|
+
Function,
|
|
415
419
|
String,
|
|
416
420
|
Number,
|
|
417
421
|
null,
|
|
418
422
|
Boolean,
|
|
419
|
-
Array
|
|
420
|
-
Function
|
|
423
|
+
Array
|
|
421
424
|
],
|
|
422
425
|
required: false,
|
|
423
|
-
skipCheck: true,
|
|
424
426
|
default: void 0
|
|
425
427
|
},
|
|
426
428
|
expandIcon: {
|
|
427
429
|
type: [
|
|
430
|
+
Object,
|
|
431
|
+
Function,
|
|
428
432
|
String,
|
|
429
433
|
Number,
|
|
430
434
|
null,
|
|
431
435
|
Boolean,
|
|
432
|
-
Array
|
|
433
|
-
Function
|
|
436
|
+
Array
|
|
434
437
|
],
|
|
435
438
|
required: false,
|
|
436
|
-
skipCheck: true,
|
|
437
439
|
default: void 0
|
|
438
440
|
},
|
|
439
441
|
onMouseEnter: {
|
|
@@ -457,7 +459,7 @@ var SubMenu_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
457
459
|
default: void 0
|
|
458
460
|
},
|
|
459
461
|
popupStyle: {
|
|
460
|
-
type:
|
|
462
|
+
type: Object,
|
|
461
463
|
required: false,
|
|
462
464
|
default: void 0
|
|
463
465
|
},
|
|
@@ -482,7 +484,7 @@ var SubMenu_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
482
484
|
default: void 0
|
|
483
485
|
},
|
|
484
486
|
style: {
|
|
485
|
-
type:
|
|
487
|
+
type: Object,
|
|
486
488
|
required: false,
|
|
487
489
|
default: void 0
|
|
488
490
|
},
|