@v-c/menu 0.0.1 → 0.0.3
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 +33 -36
- package/dist/Divider.js +28 -34
- package/dist/Icon.cjs +39 -38
- package/dist/Icon.js +36 -38
- package/dist/Menu.cjs +506 -575
- package/dist/Menu.d.ts +2 -0
- package/dist/Menu.js +495 -570
- package/dist/MenuItem.cjs +314 -344
- package/dist/MenuItem.js +303 -339
- package/dist/MenuItemGroup.cjs +98 -116
- package/dist/MenuItemGroup.js +91 -113
- package/dist/SubMenu/InlineSubMenuList.cjs +58 -82
- package/dist/SubMenu/InlineSubMenuList.js +54 -81
- package/dist/SubMenu/PopupTrigger.cjs +133 -167
- package/dist/SubMenu/PopupTrigger.d.ts +2 -2
- package/dist/SubMenu/PopupTrigger.js +126 -165
- package/dist/SubMenu/SubMenuList.cjs +18 -26
- package/dist/SubMenu/SubMenuList.js +14 -25
- package/dist/SubMenu/index.cjs +479 -526
- package/dist/SubMenu/index.js +469 -521
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/context/IdContext.cjs +15 -23
- package/dist/context/IdContext.js +15 -27
- package/dist/context/MenuContext.cjs +183 -174
- package/dist/context/MenuContext.js +180 -177
- package/dist/context/PathContext.cjs +54 -79
- package/dist/context/PathContext.js +54 -90
- package/dist/context/PrivateContext.cjs +11 -17
- package/dist/context/PrivateContext.js +11 -20
- package/dist/hooks/useAccessibility.cjs +171 -191
- package/dist/hooks/useAccessibility.js +168 -193
- package/dist/hooks/useActive.cjs +25 -28
- package/dist/hooks/useActive.js +23 -28
- package/dist/hooks/useDirectionStyle.cjs +11 -17
- package/dist/hooks/useDirectionStyle.js +9 -17
- package/dist/hooks/useKeyRecords.cjs +70 -88
- package/dist/hooks/useKeyRecords.js +68 -89
- package/dist/hooks/useMemoCallback.cjs +9 -9
- package/dist/hooks/useMemoCallback.js +7 -9
- package/dist/index.cjs +21 -21
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -20
- package/dist/interface.cjs +0 -1
- package/dist/interface.js +0 -1
- package/dist/placements.cjs +70 -70
- package/dist/placements.js +69 -72
- package/dist/utils/commonUtil.cjs +24 -26
- package/dist/utils/commonUtil.js +23 -26
- package/dist/utils/motionUtil.cjs +2 -9
- package/dist/utils/motionUtil.js +3 -10
- package/dist/utils/nodeUtil.cjs +49 -77
- package/dist/utils/nodeUtil.d.ts +4 -1
- package/dist/utils/nodeUtil.js +48 -77
- package/dist/utils/timeUtil.cjs +2 -3
- package/dist/utils/timeUtil.js +3 -4
- package/dist/utils/warnUtil.cjs +8 -14
- package/dist/utils/warnUtil.js +7 -14
- package/package.json +2 -2
package/dist/SubMenu/index.js
CHANGED
|
@@ -1,532 +1,480 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import warning from "@v-c/util/dist/warning";
|
|
1
|
+
import MenuContext_default, { useMenuContext } from "../context/MenuContext.js";
|
|
2
|
+
import { PathTrackerContext, useFullPath, useMeasure, usePathUserContext } from "../context/PathContext.js";
|
|
3
|
+
import Icon_default from "../Icon.js";
|
|
5
4
|
import { useMenuId } from "../context/IdContext.js";
|
|
6
|
-
import InheritableContextProvider, { useMenuContext } from "../context/MenuContext.js";
|
|
7
|
-
import { useFullPath, useMeasure, PathTrackerContext, usePathUserContext } from "../context/PathContext.js";
|
|
8
5
|
import { usePrivateContext } from "../context/PrivateContext.js";
|
|
9
6
|
import useActive from "../hooks/useActive.js";
|
|
10
7
|
import useDirectionStyle from "../hooks/useDirectionStyle.js";
|
|
11
|
-
import Icon from "../Icon.js";
|
|
12
8
|
import { parseChildren } from "../utils/commonUtil.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
9
|
+
import SubMenuList_default from "./SubMenuList.js";
|
|
10
|
+
import InlineSubMenuList_default from "./InlineSubMenuList.js";
|
|
11
|
+
import PopupTrigger_default from "./PopupTrigger.js";
|
|
12
|
+
import { computed, createVNode, defineComponent, isVNode, mergeProps, ref, watch } from "vue";
|
|
13
|
+
import { classNames } from "@v-c/util";
|
|
14
|
+
import Overflow from "@v-c/overflow";
|
|
15
|
+
import warning$1 from "@v-c/util/dist/warning";
|
|
16
16
|
function _isSlot(s) {
|
|
17
|
-
|
|
17
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const mergedPopupRender = props?.popupRender || contextPopupRender.value;
|
|
192
|
-
if (mergedPopupRender) {
|
|
193
|
-
return mergedPopupRender(originNode, {
|
|
194
|
-
item: props,
|
|
195
|
-
keys: validConnectedPath.value
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
return originNode;
|
|
199
|
-
};
|
|
200
|
-
if (!overflowDisabled.value) {
|
|
201
|
-
const triggerMode = triggerModeRef.value;
|
|
202
|
-
const _titleNode = /* @__PURE__ */ (function() {
|
|
203
|
-
return titleNode;
|
|
204
|
-
})();
|
|
205
|
-
titleNode = createVNode(PopupTrigger, {
|
|
206
|
-
"mode": triggerMode,
|
|
207
|
-
"prefixCls": subMenuPrefixCls.value,
|
|
208
|
-
"visible": !props?.internalPopupClose && open.value && mode.value !== "inline",
|
|
209
|
-
"popupClassName": popupClassName,
|
|
210
|
-
"popupOffset": popupOffset,
|
|
211
|
-
"popupStyle": popupStyle,
|
|
212
|
-
"popup": renderPopupContent(),
|
|
213
|
-
"disabled": mergedDisabled.value,
|
|
214
|
-
"onVisibleChange": onPopupVisibleChange
|
|
215
|
-
}, _isSlot(titleNode) ? titleNode : {
|
|
216
|
-
default: () => [_titleNode]
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
let listNode = createVNode(Overflow.Item, mergeProps({
|
|
220
|
-
"role": "none"
|
|
221
|
-
}, attrs, restProps, {
|
|
222
|
-
"component": "li",
|
|
223
|
-
"style": style,
|
|
224
|
-
"class": classNames(subMenuPrefixCls.value, `${subMenuPrefixCls.value}-${mode.value}`, className, {
|
|
225
|
-
[`${subMenuPrefixCls.value}-open`]: open.value,
|
|
226
|
-
[`${subMenuPrefixCls.value}-active`]: mergedActive.value,
|
|
227
|
-
[`${subMenuPrefixCls.value}-selected`]: childrenSelected.value,
|
|
228
|
-
[`${subMenuPrefixCls.value}-disabled`]: mergedDisabled.value
|
|
229
|
-
}),
|
|
230
|
-
"onMouseenter": onInternalMouseEnter,
|
|
231
|
-
"onMouseleave": onInternalMouseLeave
|
|
232
|
-
}), {
|
|
233
|
-
default: () => [titleNode, !overflowDisabled.value && createVNode(InlineSubMenuList, {
|
|
234
|
-
"id": popupId,
|
|
235
|
-
"open": open.value,
|
|
236
|
-
"keyPath": validConnectedPath.value
|
|
237
|
-
}, _isSlot(children) ? children : {
|
|
238
|
-
default: () => [children]
|
|
239
|
-
})]
|
|
240
|
-
});
|
|
241
|
-
if (_internalRenderSubMenuItem) {
|
|
242
|
-
listNode = _internalRenderSubMenuItem(listNode, props, {
|
|
243
|
-
selected: childrenSelected.value,
|
|
244
|
-
active: mergedActive.value,
|
|
245
|
-
open: open.value,
|
|
246
|
-
disabled: mergedDisabled.value
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
return listNode;
|
|
250
|
-
};
|
|
19
|
+
var InternalSubMenu = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
20
|
+
const domDataId = useMenuId(computed(() => props?.eventKey || ""));
|
|
21
|
+
const menuContext = useMenuContext();
|
|
22
|
+
const { _internalRenderSubMenuItem } = usePrivateContext();
|
|
23
|
+
const pathUserContext = usePathUserContext();
|
|
24
|
+
const connectedPath = useFullPath();
|
|
25
|
+
const validConnectedPath = computed(() => connectedPath.value.filter((k) => k !== void 0));
|
|
26
|
+
const prefixCls = computed(() => menuContext?.value?.prefixCls || "vc-menu");
|
|
27
|
+
const mode = computed(() => menuContext?.value?.mode || "vertical");
|
|
28
|
+
const openKeys = computed(() => menuContext?.value?.openKeys || []);
|
|
29
|
+
const contextDisabled = computed(() => menuContext?.value?.disabled);
|
|
30
|
+
const overflowDisabled = computed(() => menuContext?.value?.overflowDisabled);
|
|
31
|
+
const activeKey = computed(() => menuContext?.value?.activeKey);
|
|
32
|
+
const selectedKeys = computed(() => menuContext?.value?.selectedKeys || []);
|
|
33
|
+
const contextExpandIcon = computed(() => menuContext?.value?.expandIcon);
|
|
34
|
+
const contextPopupRender = computed(() => menuContext?.value?.popupRender);
|
|
35
|
+
const onOpenChange = (key, open$1) => {
|
|
36
|
+
menuContext?.value?.onOpenChange?.(key, open$1);
|
|
37
|
+
};
|
|
38
|
+
const onActive = (key) => {
|
|
39
|
+
menuContext?.value?.onActive?.(key);
|
|
40
|
+
};
|
|
41
|
+
const subMenuPrefixCls = computed(() => `${prefixCls.value}-submenu`);
|
|
42
|
+
const mergedDisabled = computed(() => !!(contextDisabled.value || props?.disabled));
|
|
43
|
+
if (process.env.NODE_ENV !== "production" && props?.warnKey) warning$1(false, "SubMenu should not leave undefined `key`.");
|
|
44
|
+
const mergedExpandIcon = computed(() => props?.expandIcon ?? contextExpandIcon.value);
|
|
45
|
+
const originOpen = computed(() => {
|
|
46
|
+
const key = props?.eventKey;
|
|
47
|
+
return key ? openKeys.value.includes(key) : false;
|
|
48
|
+
});
|
|
49
|
+
const open = computed(() => !overflowDisabled.value && originOpen.value);
|
|
50
|
+
const childrenSelected = computed(() => {
|
|
51
|
+
const key = props?.eventKey;
|
|
52
|
+
return key ? pathUserContext.isSubPathKey(selectedKeys.value, key) : false;
|
|
53
|
+
});
|
|
54
|
+
const { active,...activeProps } = useActive(computed(() => props?.eventKey || ""), mergedDisabled, (e) => props?.onTitleMouseEnter?.(e), (e) => props?.onTitleMouseLeave?.(e));
|
|
55
|
+
const childrenActive = ref(false);
|
|
56
|
+
const triggerChildrenActive = (newActive) => {
|
|
57
|
+
if (!mergedDisabled.value) childrenActive.value = newActive;
|
|
58
|
+
};
|
|
59
|
+
const onInternalMouseEnter = (domEvent) => {
|
|
60
|
+
triggerChildrenActive(true);
|
|
61
|
+
props?.onMouseEnter?.({
|
|
62
|
+
key: props.eventKey,
|
|
63
|
+
domEvent
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const onInternalMouseLeave = (domEvent) => {
|
|
67
|
+
triggerChildrenActive(false);
|
|
68
|
+
props?.onMouseLeave?.({
|
|
69
|
+
key: props.eventKey,
|
|
70
|
+
domEvent
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const mergedActive = computed(() => {
|
|
74
|
+
if (active.value) return active.value;
|
|
75
|
+
if (mode.value !== "inline") {
|
|
76
|
+
const key = props?.eventKey;
|
|
77
|
+
const currentActiveKey = activeKey.value;
|
|
78
|
+
return childrenActive.value || (key && currentActiveKey ? pathUserContext.isSubPathKey([currentActiveKey], key) : false);
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
});
|
|
82
|
+
const directionStyle = useDirectionStyle(computed(() => connectedPath.value.length));
|
|
83
|
+
const onInternalTitleClick = (e) => {
|
|
84
|
+
if (mergedDisabled.value) return;
|
|
85
|
+
const key = props?.eventKey;
|
|
86
|
+
props?.onTitleClick?.({
|
|
87
|
+
key,
|
|
88
|
+
domEvent: e
|
|
89
|
+
});
|
|
90
|
+
if (mode.value === "inline" && key) onOpenChange(key, !originOpen.value);
|
|
91
|
+
};
|
|
92
|
+
const onPopupVisibleChange = (newVisible) => {
|
|
93
|
+
const key = props?.eventKey;
|
|
94
|
+
if (mode.value !== "inline" && key) onOpenChange(key, newVisible);
|
|
95
|
+
};
|
|
96
|
+
const onInternalFocus = () => {
|
|
97
|
+
const key = props?.eventKey;
|
|
98
|
+
if (key) onActive(key);
|
|
99
|
+
};
|
|
100
|
+
const triggerModeRef = ref(mode.value);
|
|
101
|
+
watch(mode, () => {
|
|
102
|
+
if (mode.value !== "inline" && validConnectedPath.value.length > 1) triggerModeRef.value = "vertical";
|
|
103
|
+
else triggerModeRef.value = mode.value;
|
|
104
|
+
}, { immediate: true });
|
|
105
|
+
return () => {
|
|
106
|
+
const { style, title, class: className, popupClassName, popupOffset, popupStyle,...restProps } = props;
|
|
107
|
+
const children = slots.default?.();
|
|
108
|
+
const popupId = domDataId.value && `${domDataId.value}-popup`;
|
|
109
|
+
const expandIconProps = {
|
|
110
|
+
isOpen: open.value,
|
|
111
|
+
isSelected: childrenSelected.value,
|
|
112
|
+
isSubMenu: true,
|
|
113
|
+
disabled: mergedDisabled.value
|
|
114
|
+
};
|
|
115
|
+
const expandIconNode = createVNode(Icon_default, {
|
|
116
|
+
"icon": mode.value !== "horizontal" ? mergedExpandIcon.value : void 0,
|
|
117
|
+
"props": {
|
|
118
|
+
...props,
|
|
119
|
+
...expandIconProps
|
|
120
|
+
}
|
|
121
|
+
}, { default: () => [createVNode("i", { "class": `${subMenuPrefixCls.value}-arrow` }, null)] });
|
|
122
|
+
let titleNode = createVNode("div", mergeProps({
|
|
123
|
+
"role": "menuitem",
|
|
124
|
+
"style": directionStyle.value,
|
|
125
|
+
"class": `${subMenuPrefixCls.value}-title`,
|
|
126
|
+
"tabindex": mergedDisabled.value ? void 0 : -1,
|
|
127
|
+
"title": typeof title === "string" ? title : void 0,
|
|
128
|
+
"data-menu-id": overflowDisabled.value && domDataId.value ? void 0 : domDataId.value,
|
|
129
|
+
"aria-expanded": open.value,
|
|
130
|
+
"aria-haspopup": true,
|
|
131
|
+
"aria-controls": popupId,
|
|
132
|
+
"aria-disabled": mergedDisabled.value,
|
|
133
|
+
"onClick": onInternalTitleClick,
|
|
134
|
+
"onFocus": onInternalFocus
|
|
135
|
+
}, activeProps), [title, expandIconNode]);
|
|
136
|
+
const popupContentTriggerMode = triggerModeRef.value;
|
|
137
|
+
const renderPopupContent = () => {
|
|
138
|
+
const originNode = createVNode(MenuContext_default, {
|
|
139
|
+
"classNames": props.classNames,
|
|
140
|
+
"styles": props.styles,
|
|
141
|
+
"mode": popupContentTriggerMode === "horizontal" ? "vertical" : popupContentTriggerMode
|
|
142
|
+
}, { default: () => [createVNode(SubMenuList_default, { "id": popupId }, _isSlot(children) ? children : { default: () => [children] })] });
|
|
143
|
+
const mergedPopupRender = props?.popupRender || contextPopupRender.value;
|
|
144
|
+
if (mergedPopupRender) return mergedPopupRender(originNode, {
|
|
145
|
+
item: props,
|
|
146
|
+
keys: validConnectedPath.value
|
|
147
|
+
});
|
|
148
|
+
return originNode;
|
|
149
|
+
};
|
|
150
|
+
if (!overflowDisabled.value) {
|
|
151
|
+
const triggerMode = triggerModeRef.value;
|
|
152
|
+
const _titleNode = function() {
|
|
153
|
+
return titleNode;
|
|
154
|
+
}();
|
|
155
|
+
titleNode = createVNode(PopupTrigger_default, {
|
|
156
|
+
"mode": triggerMode,
|
|
157
|
+
"prefixCls": subMenuPrefixCls.value,
|
|
158
|
+
"visible": !props?.internalPopupClose && open.value && mode.value !== "inline",
|
|
159
|
+
"popupClassName": popupClassName,
|
|
160
|
+
"popupOffset": popupOffset,
|
|
161
|
+
"popupStyle": popupStyle,
|
|
162
|
+
"popup": renderPopupContent(),
|
|
163
|
+
"disabled": mergedDisabled.value,
|
|
164
|
+
"onVisibleChange": onPopupVisibleChange
|
|
165
|
+
}, _isSlot(titleNode) ? titleNode : { default: () => [_titleNode] });
|
|
166
|
+
}
|
|
167
|
+
let listNode = createVNode(Overflow.Item, mergeProps({ "role": "none" }, attrs, restProps, {
|
|
168
|
+
"component": "li",
|
|
169
|
+
"style": style,
|
|
170
|
+
"class": classNames(subMenuPrefixCls.value, `${subMenuPrefixCls.value}-${mode.value}`, className, {
|
|
171
|
+
[`${subMenuPrefixCls.value}-open`]: open.value,
|
|
172
|
+
[`${subMenuPrefixCls.value}-active`]: mergedActive.value,
|
|
173
|
+
[`${subMenuPrefixCls.value}-selected`]: childrenSelected.value,
|
|
174
|
+
[`${subMenuPrefixCls.value}-disabled`]: mergedDisabled.value
|
|
175
|
+
}),
|
|
176
|
+
"onMouseenter": onInternalMouseEnter,
|
|
177
|
+
"onMouseleave": onInternalMouseLeave
|
|
178
|
+
}), { default: () => [titleNode, !overflowDisabled.value && createVNode(InlineSubMenuList_default, {
|
|
179
|
+
"id": popupId,
|
|
180
|
+
"open": open.value,
|
|
181
|
+
"keyPath": validConnectedPath.value
|
|
182
|
+
}, _isSlot(children) ? children : { default: () => [children] })] });
|
|
183
|
+
if (_internalRenderSubMenuItem) listNode = _internalRenderSubMenuItem(listNode, props, {
|
|
184
|
+
selected: childrenSelected.value,
|
|
185
|
+
active: mergedActive.value,
|
|
186
|
+
open: open.value,
|
|
187
|
+
disabled: mergedDisabled.value
|
|
188
|
+
});
|
|
189
|
+
return listNode;
|
|
190
|
+
};
|
|
251
191
|
}, {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
192
|
+
props: {
|
|
193
|
+
classNames: {
|
|
194
|
+
type: Object,
|
|
195
|
+
required: false,
|
|
196
|
+
default: void 0
|
|
197
|
+
},
|
|
198
|
+
styles: {
|
|
199
|
+
type: Object,
|
|
200
|
+
required: false,
|
|
201
|
+
default: void 0
|
|
202
|
+
},
|
|
203
|
+
title: {
|
|
204
|
+
type: null,
|
|
205
|
+
required: false,
|
|
206
|
+
default: void 0
|
|
207
|
+
},
|
|
208
|
+
internalPopupClose: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
required: false,
|
|
211
|
+
default: void 0
|
|
212
|
+
},
|
|
213
|
+
eventKey: {
|
|
214
|
+
type: String,
|
|
215
|
+
required: false,
|
|
216
|
+
default: void 0
|
|
217
|
+
},
|
|
218
|
+
warnKey: {
|
|
219
|
+
type: Boolean,
|
|
220
|
+
required: false,
|
|
221
|
+
default: void 0
|
|
222
|
+
},
|
|
223
|
+
popupRender: {
|
|
224
|
+
type: Function,
|
|
225
|
+
required: false,
|
|
226
|
+
default: void 0
|
|
227
|
+
},
|
|
228
|
+
type: {
|
|
229
|
+
type: String,
|
|
230
|
+
required: false,
|
|
231
|
+
default: void 0
|
|
232
|
+
},
|
|
233
|
+
disabled: {
|
|
234
|
+
type: Boolean,
|
|
235
|
+
required: false,
|
|
236
|
+
default: void 0
|
|
237
|
+
},
|
|
238
|
+
rootClassName: {
|
|
239
|
+
type: String,
|
|
240
|
+
required: false,
|
|
241
|
+
default: void 0
|
|
242
|
+
},
|
|
243
|
+
itemIcon: {
|
|
244
|
+
type: [
|
|
245
|
+
String,
|
|
246
|
+
Number,
|
|
247
|
+
null,
|
|
248
|
+
Array,
|
|
249
|
+
Function,
|
|
250
|
+
Boolean
|
|
251
|
+
],
|
|
252
|
+
required: false,
|
|
253
|
+
skipCheck: true,
|
|
254
|
+
default: void 0
|
|
255
|
+
},
|
|
256
|
+
expandIcon: {
|
|
257
|
+
type: [
|
|
258
|
+
String,
|
|
259
|
+
Number,
|
|
260
|
+
null,
|
|
261
|
+
Array,
|
|
262
|
+
Function,
|
|
263
|
+
Boolean
|
|
264
|
+
],
|
|
265
|
+
required: false,
|
|
266
|
+
skipCheck: true,
|
|
267
|
+
default: void 0
|
|
268
|
+
},
|
|
269
|
+
onMouseEnter: {
|
|
270
|
+
type: Function,
|
|
271
|
+
required: false,
|
|
272
|
+
default: void 0
|
|
273
|
+
},
|
|
274
|
+
onMouseLeave: {
|
|
275
|
+
type: Function,
|
|
276
|
+
required: false,
|
|
277
|
+
default: void 0
|
|
278
|
+
},
|
|
279
|
+
popupClassName: {
|
|
280
|
+
type: String,
|
|
281
|
+
required: false,
|
|
282
|
+
default: void 0
|
|
283
|
+
},
|
|
284
|
+
popupOffset: {
|
|
285
|
+
type: Array,
|
|
286
|
+
required: false,
|
|
287
|
+
default: void 0
|
|
288
|
+
},
|
|
289
|
+
popupStyle: {
|
|
290
|
+
type: null,
|
|
291
|
+
required: false,
|
|
292
|
+
default: void 0
|
|
293
|
+
},
|
|
294
|
+
onClick: {
|
|
295
|
+
type: Function,
|
|
296
|
+
required: false,
|
|
297
|
+
default: void 0
|
|
298
|
+
},
|
|
299
|
+
onTitleClick: {
|
|
300
|
+
type: Function,
|
|
301
|
+
required: false,
|
|
302
|
+
default: void 0
|
|
303
|
+
},
|
|
304
|
+
onTitleMouseEnter: {
|
|
305
|
+
type: Function,
|
|
306
|
+
required: false,
|
|
307
|
+
default: void 0
|
|
308
|
+
},
|
|
309
|
+
onTitleMouseLeave: {
|
|
310
|
+
type: Function,
|
|
311
|
+
required: false,
|
|
312
|
+
default: void 0
|
|
313
|
+
},
|
|
314
|
+
style: {
|
|
315
|
+
type: null,
|
|
316
|
+
required: false,
|
|
317
|
+
default: void 0
|
|
318
|
+
},
|
|
319
|
+
class: {
|
|
320
|
+
type: String,
|
|
321
|
+
required: false,
|
|
322
|
+
default: void 0
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
name: "InternalSubMenu",
|
|
326
|
+
inheritAttrs: false
|
|
373
327
|
});
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
);
|
|
390
|
-
return () => {
|
|
391
|
-
const children = slots.default?.();
|
|
392
|
-
const childList = parseChildren(children, validKeyPath.value);
|
|
393
|
-
let renderNode;
|
|
394
|
-
if (measure) {
|
|
395
|
-
renderNode = childList;
|
|
396
|
-
} else {
|
|
397
|
-
renderNode = createVNode(InternalSubMenu, props, _isSlot(childList) ? childList : {
|
|
398
|
-
default: () => [childList]
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
return createVNode(PathTrackerContext.Provider, {
|
|
402
|
-
"value": validKeyPath.value
|
|
403
|
-
}, _isSlot(renderNode) ? renderNode : {
|
|
404
|
-
default: () => [renderNode]
|
|
405
|
-
});
|
|
406
|
-
};
|
|
328
|
+
var SubMenu_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
329
|
+
const connectedKeyPath = useFullPath(computed(() => props?.eventKey));
|
|
330
|
+
const measure = useMeasure();
|
|
331
|
+
const validKeyPath = computed(() => connectedKeyPath.value.filter((k) => k !== void 0));
|
|
332
|
+
watch([validKeyPath, () => props.eventKey], () => {
|
|
333
|
+
if (measure && props.eventKey) measure.registerPath(props.eventKey, validKeyPath.value);
|
|
334
|
+
});
|
|
335
|
+
return () => {
|
|
336
|
+
const children = slots.default?.();
|
|
337
|
+
const childList = parseChildren(children, validKeyPath.value);
|
|
338
|
+
let renderNode;
|
|
339
|
+
if (measure) renderNode = childList;
|
|
340
|
+
else renderNode = createVNode(InternalSubMenu, props, _isSlot(childList) ? childList : { default: () => [childList] });
|
|
341
|
+
return createVNode(PathTrackerContext.Provider, { "value": validKeyPath.value }, _isSlot(renderNode) ? renderNode : { default: () => [renderNode] });
|
|
342
|
+
};
|
|
407
343
|
}, {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
344
|
+
props: {
|
|
345
|
+
classNames: {
|
|
346
|
+
type: Object,
|
|
347
|
+
required: false,
|
|
348
|
+
default: void 0
|
|
349
|
+
},
|
|
350
|
+
styles: {
|
|
351
|
+
type: Object,
|
|
352
|
+
required: false,
|
|
353
|
+
default: void 0
|
|
354
|
+
},
|
|
355
|
+
title: {
|
|
356
|
+
type: null,
|
|
357
|
+
required: false,
|
|
358
|
+
default: void 0
|
|
359
|
+
},
|
|
360
|
+
internalPopupClose: {
|
|
361
|
+
type: Boolean,
|
|
362
|
+
required: false,
|
|
363
|
+
default: void 0
|
|
364
|
+
},
|
|
365
|
+
eventKey: {
|
|
366
|
+
type: String,
|
|
367
|
+
required: false,
|
|
368
|
+
default: void 0
|
|
369
|
+
},
|
|
370
|
+
warnKey: {
|
|
371
|
+
type: Boolean,
|
|
372
|
+
required: false,
|
|
373
|
+
default: void 0
|
|
374
|
+
},
|
|
375
|
+
popupRender: {
|
|
376
|
+
type: Function,
|
|
377
|
+
required: false,
|
|
378
|
+
default: void 0
|
|
379
|
+
},
|
|
380
|
+
type: {
|
|
381
|
+
type: String,
|
|
382
|
+
required: false,
|
|
383
|
+
default: void 0
|
|
384
|
+
},
|
|
385
|
+
disabled: {
|
|
386
|
+
type: Boolean,
|
|
387
|
+
required: false,
|
|
388
|
+
default: void 0
|
|
389
|
+
},
|
|
390
|
+
rootClassName: {
|
|
391
|
+
type: String,
|
|
392
|
+
required: false,
|
|
393
|
+
default: void 0
|
|
394
|
+
},
|
|
395
|
+
itemIcon: {
|
|
396
|
+
type: [
|
|
397
|
+
String,
|
|
398
|
+
Number,
|
|
399
|
+
null,
|
|
400
|
+
Array,
|
|
401
|
+
Function,
|
|
402
|
+
Boolean
|
|
403
|
+
],
|
|
404
|
+
required: false,
|
|
405
|
+
skipCheck: true,
|
|
406
|
+
default: void 0
|
|
407
|
+
},
|
|
408
|
+
expandIcon: {
|
|
409
|
+
type: [
|
|
410
|
+
String,
|
|
411
|
+
Number,
|
|
412
|
+
null,
|
|
413
|
+
Array,
|
|
414
|
+
Function,
|
|
415
|
+
Boolean
|
|
416
|
+
],
|
|
417
|
+
required: false,
|
|
418
|
+
skipCheck: true,
|
|
419
|
+
default: void 0
|
|
420
|
+
},
|
|
421
|
+
onMouseEnter: {
|
|
422
|
+
type: Function,
|
|
423
|
+
required: false,
|
|
424
|
+
default: void 0
|
|
425
|
+
},
|
|
426
|
+
onMouseLeave: {
|
|
427
|
+
type: Function,
|
|
428
|
+
required: false,
|
|
429
|
+
default: void 0
|
|
430
|
+
},
|
|
431
|
+
popupClassName: {
|
|
432
|
+
type: String,
|
|
433
|
+
required: false,
|
|
434
|
+
default: void 0
|
|
435
|
+
},
|
|
436
|
+
popupOffset: {
|
|
437
|
+
type: Array,
|
|
438
|
+
required: false,
|
|
439
|
+
default: void 0
|
|
440
|
+
},
|
|
441
|
+
popupStyle: {
|
|
442
|
+
type: null,
|
|
443
|
+
required: false,
|
|
444
|
+
default: void 0
|
|
445
|
+
},
|
|
446
|
+
onClick: {
|
|
447
|
+
type: Function,
|
|
448
|
+
required: false,
|
|
449
|
+
default: void 0
|
|
450
|
+
},
|
|
451
|
+
onTitleClick: {
|
|
452
|
+
type: Function,
|
|
453
|
+
required: false,
|
|
454
|
+
default: void 0
|
|
455
|
+
},
|
|
456
|
+
onTitleMouseEnter: {
|
|
457
|
+
type: Function,
|
|
458
|
+
required: false,
|
|
459
|
+
default: void 0
|
|
460
|
+
},
|
|
461
|
+
onTitleMouseLeave: {
|
|
462
|
+
type: Function,
|
|
463
|
+
required: false,
|
|
464
|
+
default: void 0
|
|
465
|
+
},
|
|
466
|
+
style: {
|
|
467
|
+
type: null,
|
|
468
|
+
required: false,
|
|
469
|
+
default: void 0
|
|
470
|
+
},
|
|
471
|
+
class: {
|
|
472
|
+
type: String,
|
|
473
|
+
required: false,
|
|
474
|
+
default: void 0
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
name: "SubMenu",
|
|
478
|
+
inheritAttrs: false
|
|
529
479
|
});
|
|
530
|
-
export {
|
|
531
|
-
SubMenu as default
|
|
532
|
-
};
|
|
480
|
+
export { SubMenu_default as default };
|