ep-craft 0.1.15 → 0.1.16
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/components/menu/index.d.ts +2 -2
- package/dist/components/menu/index.js +4 -5
- package/dist/components/menu/menu-collapse-transition.vue.js +33 -0
- package/dist/components/menu/menu-collapse-transition2.vue.js +4 -0
- package/dist/components/menu/menu.d.ts +4 -4
- package/dist/components/menu/menu.js +323 -0
- package/dist/components/menu/tokens.js +5 -0
- package/dist/components/menu/use-menu.js +22 -0
- package/dist/components/menu-item/EpMenuItem.vue.js +82 -0
- package/dist/components/menu-item/EpMenuItem2.vue.js +4 -0
- package/dist/components/menu-item/index.d.ts +2 -2
- package/dist/components/menu-item/index.js +6 -4
- package/dist/components/menu-item/menu-item.js +19 -0
- package/dist/components/menu-item-group/EpMenuItemGroup.vue.js +28 -0
- package/dist/components/menu-item-group/EpMenuItemGroup2.vue.js +4 -0
- package/dist/components/menu-item-group/index.d.ts +2 -2
- package/dist/components/menu-item-group/index.js +7 -5
- package/dist/components/menu-item-group/menu-item-group.js +7 -0
- package/dist/components/sub-menu/index.d.ts +2 -2
- package/dist/components/sub-menu/index.js +7 -5
- package/dist/components/sub-menu/sub-menu.js +307 -0
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const t = Object.assign({}, e, { name: "EpMenu" }), r = n(t, "ep-menu");
|
|
1
|
+
import { withInstall as o } from "../../utils/with-install.js";
|
|
2
|
+
import p from "./menu.js";
|
|
3
|
+
const m = o(p, "ep-menu");
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
m as EpMenu
|
|
7
6
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as i, createBlock as l, Transition as c, mergeProps as p, withCtx as d, renderSlot as m } from "vue";
|
|
2
|
+
import { useNamespace as f } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
3
|
+
import { addClass as e, hasClass as h, removeClass as a } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/style.js";
|
|
4
|
+
const _ = /* @__PURE__ */ r({
|
|
5
|
+
name: "EpMenuCollapseTransition",
|
|
6
|
+
__name: "menu-collapse-transition",
|
|
7
|
+
setup(u) {
|
|
8
|
+
const o = f("menu"), n = {
|
|
9
|
+
onBeforeEnter: (t) => t.style.opacity = "0.2",
|
|
10
|
+
onEnter(t, s) {
|
|
11
|
+
e(t, `${o.namespace.value}-opacity-transition`), t.style.opacity = "1", s();
|
|
12
|
+
},
|
|
13
|
+
onAfterEnter(t) {
|
|
14
|
+
a(t, `${o.namespace.value}-opacity-transition`), t.style.opacity = "";
|
|
15
|
+
},
|
|
16
|
+
onBeforeLeave(t) {
|
|
17
|
+
t.dataset || (t.dataset = {}), h(t, o.m("collapse")) ? (a(t, o.m("collapse")), t.dataset.oldOverflow = t.style.overflow, t.dataset.scrollWidth = t.clientWidth.toString(), e(t, o.m("collapse"))) : (e(t, o.m("collapse")), t.dataset.oldOverflow = t.style.overflow, t.dataset.scrollWidth = t.clientWidth.toString(), a(t, o.m("collapse"))), t.style.width = `${t.scrollWidth}px`, t.style.overflow = "hidden";
|
|
18
|
+
},
|
|
19
|
+
onLeave(t) {
|
|
20
|
+
e(t, "horizontal-collapse-transition"), t.style.width = `${t.dataset.scrollWidth}px`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (t, s) => (i(), l(c, p({ mode: "out-in" }, n), {
|
|
24
|
+
default: d(() => [
|
|
25
|
+
m(t.$slots, "default")
|
|
26
|
+
]),
|
|
27
|
+
_: 3
|
|
28
|
+
}, 16));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
_ as default
|
|
33
|
+
};
|
|
@@ -104,17 +104,17 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
104
104
|
readonly showTimeout: number;
|
|
105
105
|
readonly hideTimeout: number;
|
|
106
106
|
readonly mode: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
|
|
107
|
+
readonly collapse: boolean;
|
|
107
108
|
readonly defaultActive: string;
|
|
108
109
|
readonly defaultOpeneds: string[];
|
|
109
|
-
readonly uniqueOpened: boolean;
|
|
110
|
-
readonly router: boolean;
|
|
111
110
|
readonly menuTrigger: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "click" | "hover", unknown>;
|
|
112
|
-
readonly collapse: boolean;
|
|
113
|
-
readonly closeOnClickOutside: boolean;
|
|
114
111
|
readonly collapseTransition: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
115
112
|
readonly ellipsis: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
116
113
|
readonly popperOffset: number;
|
|
117
114
|
readonly ellipsisIcon: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown>;
|
|
118
115
|
readonly popperEffect: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => "light" | "dark") | (() => "light" | "dark") | (((new (...args: any[]) => "light" | "dark") | (() => "light" | "dark")) | null)[], unknown, unknown>;
|
|
116
|
+
readonly uniqueOpened: boolean;
|
|
117
|
+
readonly router: boolean;
|
|
118
|
+
readonly closeOnClickOutside: boolean;
|
|
119
119
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
120
120
|
export default _default;
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { defineComponent as Q, getCurrentInstance as X, ref as f, computed as Z, watch as x, watchEffect as ee, provide as U, reactive as te, onMounted as ne, h as I, withDirectives as le, nextTick as oe } from "vue";
|
|
2
|
+
import { ElIcon as ue } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index.js";
|
|
3
|
+
import { More as ae } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.40_typescript@5.9.3_/node_modules/@element-plus/icons-vue/dist/index.js";
|
|
4
|
+
import { isString as C, isObject as ie, isArray as ce } from "../../node_modules/.pnpm/@vue_shared@3.5.40/node_modules/@vue/shared/dist/shared.esm-bundler.js";
|
|
5
|
+
import { buildProps as se, definePropType as N } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/props/runtime.js";
|
|
6
|
+
import { iconPropType as re } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/icon.js";
|
|
7
|
+
import { flattedChildren as de } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/vnode.js";
|
|
8
|
+
import { mutable as fe } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/typescript.js";
|
|
9
|
+
import { useNamespace as j } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
10
|
+
import me from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/directives/click-outside/index.js";
|
|
11
|
+
import ve from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/menu/src/utils/menu-bar.js";
|
|
12
|
+
import { useMenuCssVar as pe } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/menu/src/use-menu-css-var.js";
|
|
13
|
+
import he from "./menu-collapse-transition.vue.js";
|
|
14
|
+
import { MENU_INJECTION_KEY as ge, SUB_MENU_INJECTION_KEY as Me } from "./tokens.js";
|
|
15
|
+
import be from "../sub-menu/sub-menu.js";
|
|
16
|
+
const ye = (e) => {
|
|
17
|
+
const o = (e == null ? void 0 : e.value) ?? e;
|
|
18
|
+
return o && typeof o == "object" && "$el" in o ? o.$el : o;
|
|
19
|
+
}, Ie = (e, o) => {
|
|
20
|
+
let a;
|
|
21
|
+
const h = x(
|
|
22
|
+
e,
|
|
23
|
+
(g) => {
|
|
24
|
+
a == null || a.disconnect(), a = void 0, g && typeof ResizeObserver < "u" && (a = new ResizeObserver(o), a.observe(g));
|
|
25
|
+
},
|
|
26
|
+
{ immediate: !0 }
|
|
27
|
+
);
|
|
28
|
+
return {
|
|
29
|
+
stop: () => {
|
|
30
|
+
a == null || a.disconnect(), h();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, Se = se({
|
|
34
|
+
/** menu display mode */
|
|
35
|
+
mode: {
|
|
36
|
+
type: String,
|
|
37
|
+
values: ["horizontal", "vertical"],
|
|
38
|
+
default: "vertical"
|
|
39
|
+
},
|
|
40
|
+
/** index of active menu on page load */
|
|
41
|
+
defaultActive: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
44
|
+
},
|
|
45
|
+
/** array that contains indexes of currently active sub-menus */
|
|
46
|
+
defaultOpeneds: {
|
|
47
|
+
type: N(Array),
|
|
48
|
+
default: () => fe([])
|
|
49
|
+
},
|
|
50
|
+
/** whether only one sub-menu can be active */
|
|
51
|
+
uniqueOpened: Boolean,
|
|
52
|
+
/** whether `vue-router` mode is activated */
|
|
53
|
+
router: Boolean,
|
|
54
|
+
/** how sub-menus are triggered, only works when `mode` is 'horizontal' */
|
|
55
|
+
menuTrigger: {
|
|
56
|
+
type: String,
|
|
57
|
+
values: ["hover", "click"],
|
|
58
|
+
default: "hover"
|
|
59
|
+
},
|
|
60
|
+
/** whether the menu is collapsed (available only in vertical mode) */
|
|
61
|
+
collapse: Boolean,
|
|
62
|
+
/** background color of Menu (hex format) */
|
|
63
|
+
backgroundColor: String,
|
|
64
|
+
/** text color of Menu (hex format) */
|
|
65
|
+
textColor: String,
|
|
66
|
+
/** text color of currently active menu item (hex format) */
|
|
67
|
+
activeTextColor: String,
|
|
68
|
+
/** whether menu is collapsed when clicking outside */
|
|
69
|
+
closeOnClickOutside: Boolean,
|
|
70
|
+
/** whether to enable the collapse transition */
|
|
71
|
+
collapseTransition: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !0
|
|
74
|
+
},
|
|
75
|
+
/** whether the menu is ellipsis (available only in horizontal mode) */
|
|
76
|
+
ellipsis: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: !0
|
|
79
|
+
},
|
|
80
|
+
/** offset of the popper (effective for all submenus) */
|
|
81
|
+
popperOffset: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 6
|
|
84
|
+
},
|
|
85
|
+
/** custom ellipsis icon (available only in horizontal mode and ellipsis is true) */
|
|
86
|
+
ellipsisIcon: {
|
|
87
|
+
type: re,
|
|
88
|
+
default: () => ae
|
|
89
|
+
},
|
|
90
|
+
/** Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed */
|
|
91
|
+
popperEffect: {
|
|
92
|
+
type: N(String),
|
|
93
|
+
default: "dark"
|
|
94
|
+
},
|
|
95
|
+
/** custom class name for all popup menus */
|
|
96
|
+
popperClass: String,
|
|
97
|
+
/** custom style for all popup menus */
|
|
98
|
+
popperStyle: {
|
|
99
|
+
type: N([String, Object])
|
|
100
|
+
},
|
|
101
|
+
/** control timeout for all menus before showing */
|
|
102
|
+
showTimeout: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: 300
|
|
105
|
+
},
|
|
106
|
+
/** control timeout for all menus before hiding */
|
|
107
|
+
hideTimeout: {
|
|
108
|
+
type: Number,
|
|
109
|
+
default: 300
|
|
110
|
+
},
|
|
111
|
+
/** when menu inactive and `persistent` is `false`, dropdown menu will be destroyed */
|
|
112
|
+
persistent: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: !0
|
|
115
|
+
}
|
|
116
|
+
}), T = (e) => ce(e) && e.every((o) => C(o)), Oe = {
|
|
117
|
+
close: (e, o) => C(e) && T(o),
|
|
118
|
+
open: (e, o) => C(e) && T(o),
|
|
119
|
+
select: (e, o, a, h) => C(e) && T(o) && ie(a) && (h === void 0 || h instanceof Promise)
|
|
120
|
+
}, F = 64, Le = Q({
|
|
121
|
+
name: "EpMenu",
|
|
122
|
+
props: Se,
|
|
123
|
+
emits: Oe,
|
|
124
|
+
setup(e, { emit: o, slots: a, expose: h }) {
|
|
125
|
+
const g = X(), P = g.appContext.config.globalProperties.$router, m = f(), _ = f(), S = j("menu"), k = j("sub-menu");
|
|
126
|
+
let z = F;
|
|
127
|
+
const v = f(-1), c = f(
|
|
128
|
+
e.defaultOpeneds && !e.collapse ? e.defaultOpeneds.slice(0) : []
|
|
129
|
+
), d = f(e.defaultActive), p = f({}), M = f({}), q = Z(
|
|
130
|
+
() => e.mode === "horizontal" || e.mode === "vertical" && e.collapse
|
|
131
|
+
), J = () => {
|
|
132
|
+
const t = d.value && p.value[d.value];
|
|
133
|
+
if (!t || e.mode === "horizontal" || e.collapse) return;
|
|
134
|
+
t.indexPath.forEach((l) => {
|
|
135
|
+
const i = M.value[l];
|
|
136
|
+
i && O(l, i.indexPath);
|
|
137
|
+
});
|
|
138
|
+
}, O = (t, n) => {
|
|
139
|
+
c.value.includes(t) || (e.uniqueOpened && (c.value = c.value.filter(
|
|
140
|
+
(l) => n.includes(l)
|
|
141
|
+
)), c.value.push(t), o("open", t, n));
|
|
142
|
+
}, R = (t) => {
|
|
143
|
+
const n = c.value.indexOf(t);
|
|
144
|
+
n !== -1 && c.value.splice(n, 1);
|
|
145
|
+
}, w = (t, n) => {
|
|
146
|
+
R(t), o("close", t, n);
|
|
147
|
+
}, K = ({
|
|
148
|
+
index: t,
|
|
149
|
+
indexPath: n
|
|
150
|
+
}) => {
|
|
151
|
+
c.value.includes(t) ? w(t, n) : O(t, n);
|
|
152
|
+
}, V = (t) => {
|
|
153
|
+
(e.mode === "horizontal" || e.collapse) && (c.value = []);
|
|
154
|
+
const { index: n, indexPath: l } = t;
|
|
155
|
+
if (!(n == null || l == null))
|
|
156
|
+
if (e.router && P) {
|
|
157
|
+
const i = t.route || n, u = P.push(i).then((s) => (s || (d.value = n), s));
|
|
158
|
+
o("select", n, l, { index: n, indexPath: l, route: i }, u);
|
|
159
|
+
} else
|
|
160
|
+
d.value = n, o("select", n, l, { index: n, indexPath: l });
|
|
161
|
+
}, A = (t) => {
|
|
162
|
+
const n = p.value, l = n[t] || d.value && n[d.value] || n[e.defaultActive];
|
|
163
|
+
d.value = (l == null ? void 0 : l.index) ?? t;
|
|
164
|
+
}, B = (t) => {
|
|
165
|
+
const n = getComputedStyle(t), l = Number.parseInt(n.marginLeft, 10), i = Number.parseInt(n.marginRight, 10);
|
|
166
|
+
return t.offsetWidth + l + i || 0;
|
|
167
|
+
}, W = () => {
|
|
168
|
+
if (!m.value) return -1;
|
|
169
|
+
const t = Array.from(m.value.childNodes).filter(
|
|
170
|
+
(r) => r.nodeName !== "#comment" && (r.nodeName !== "#text" || r.nodeValue)
|
|
171
|
+
), n = getComputedStyle(m.value), l = Number.parseInt(n.paddingLeft, 10), i = Number.parseInt(n.paddingRight, 10), u = m.value.clientWidth - l - i;
|
|
172
|
+
let s = 0, b = 0;
|
|
173
|
+
return t.forEach((r, y) => {
|
|
174
|
+
s += B(r), s <= u - z && (b = y + 1);
|
|
175
|
+
}), b === t.length ? -1 : b;
|
|
176
|
+
}, Y = (t) => M.value[t].indexPath, H = (t, n = 33.34) => {
|
|
177
|
+
let l;
|
|
178
|
+
return () => {
|
|
179
|
+
l && clearTimeout(l), l = setTimeout(() => {
|
|
180
|
+
t();
|
|
181
|
+
}, n);
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
let D = !0;
|
|
185
|
+
const L = () => {
|
|
186
|
+
const t = ye(_);
|
|
187
|
+
if (t && (z = B(t) || F), v.value === W()) return;
|
|
188
|
+
const n = () => {
|
|
189
|
+
v.value = -1, oe(() => {
|
|
190
|
+
v.value = W();
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
D ? n() : H(n)(), D = !1;
|
|
194
|
+
};
|
|
195
|
+
x(
|
|
196
|
+
() => e.defaultActive,
|
|
197
|
+
(t) => {
|
|
198
|
+
p.value[t] || (d.value = ""), A(t);
|
|
199
|
+
}
|
|
200
|
+
), x(
|
|
201
|
+
() => e.collapse,
|
|
202
|
+
(t) => {
|
|
203
|
+
t && (c.value = []);
|
|
204
|
+
}
|
|
205
|
+
), x(p.value, J);
|
|
206
|
+
let E;
|
|
207
|
+
ee(() => {
|
|
208
|
+
e.mode === "horizontal" && e.ellipsis ? E = Ie(m, L).stop : E == null || E();
|
|
209
|
+
});
|
|
210
|
+
const $ = f(!1);
|
|
211
|
+
{
|
|
212
|
+
const t = (u) => {
|
|
213
|
+
M.value[u.index] = u;
|
|
214
|
+
}, n = (u) => {
|
|
215
|
+
delete M.value[u.index];
|
|
216
|
+
};
|
|
217
|
+
U(
|
|
218
|
+
ge,
|
|
219
|
+
te({
|
|
220
|
+
props: e,
|
|
221
|
+
openedMenus: c,
|
|
222
|
+
items: p,
|
|
223
|
+
subMenus: M,
|
|
224
|
+
activeIndex: d,
|
|
225
|
+
isMenuPopup: q,
|
|
226
|
+
addMenuItem: (u) => {
|
|
227
|
+
p.value[u.index] = u;
|
|
228
|
+
},
|
|
229
|
+
removeMenuItem: (u) => {
|
|
230
|
+
delete p.value[u.index];
|
|
231
|
+
},
|
|
232
|
+
addSubMenu: t,
|
|
233
|
+
removeSubMenu: n,
|
|
234
|
+
openMenu: O,
|
|
235
|
+
closeMenu: w,
|
|
236
|
+
handleMenuItemClick: V,
|
|
237
|
+
handleSubMenuClick: K
|
|
238
|
+
})
|
|
239
|
+
), U(`${Me}${g.uid}`, {
|
|
240
|
+
addSubMenu: t,
|
|
241
|
+
removeSubMenu: n,
|
|
242
|
+
mouseInChild: $,
|
|
243
|
+
level: 0
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
ne(() => {
|
|
247
|
+
e.mode === "horizontal" && new ve(g.vnode.el, S.namespace.value);
|
|
248
|
+
}), h({
|
|
249
|
+
open: (n) => {
|
|
250
|
+
const { indexPath: l } = M.value[n];
|
|
251
|
+
l.forEach((i) => O(i, l));
|
|
252
|
+
},
|
|
253
|
+
close: R,
|
|
254
|
+
updateActiveIndex: A,
|
|
255
|
+
handleResize: L
|
|
256
|
+
});
|
|
257
|
+
const G = pe(e, 0);
|
|
258
|
+
return () => {
|
|
259
|
+
var u;
|
|
260
|
+
let t = ((u = a.default) == null ? void 0 : u.call(a)) ?? [];
|
|
261
|
+
const n = [];
|
|
262
|
+
if (e.mode === "horizontal" && m.value) {
|
|
263
|
+
const s = de(t).filter((y) => (y == null ? void 0 : y.shapeFlag) !== 8), b = v.value === -1 ? s : s.slice(0, v.value), r = v.value === -1 ? [] : s.slice(v.value);
|
|
264
|
+
r != null && r.length && e.ellipsis && (t = b, n.push(
|
|
265
|
+
I(
|
|
266
|
+
be,
|
|
267
|
+
{
|
|
268
|
+
ref: _,
|
|
269
|
+
index: "sub-menu-more",
|
|
270
|
+
class: k.e("hide-arrow"),
|
|
271
|
+
popperOffset: e.popperOffset
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
title: () => I(
|
|
275
|
+
ue,
|
|
276
|
+
{
|
|
277
|
+
class: k.e("icon-more")
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
default: () => I(e.ellipsisIcon)
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
default: () => r
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
));
|
|
287
|
+
}
|
|
288
|
+
const l = e.closeOnClickOutside ? [
|
|
289
|
+
[
|
|
290
|
+
me,
|
|
291
|
+
() => {
|
|
292
|
+
c.value.length && ($.value || (c.value.forEach(
|
|
293
|
+
(s) => o("close", s, Y(s))
|
|
294
|
+
), c.value = []));
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
] : [], i = le(
|
|
298
|
+
I(
|
|
299
|
+
"ul",
|
|
300
|
+
{
|
|
301
|
+
key: String(e.collapse),
|
|
302
|
+
role: "menubar",
|
|
303
|
+
ref: m,
|
|
304
|
+
style: G.value,
|
|
305
|
+
class: {
|
|
306
|
+
[S.b()]: !0,
|
|
307
|
+
[S.m(e.mode)]: !0,
|
|
308
|
+
[S.m("collapse")]: e.collapse
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
[...t, ...n]
|
|
312
|
+
),
|
|
313
|
+
l
|
|
314
|
+
);
|
|
315
|
+
return e.collapseTransition && e.mode === "vertical" ? I(he, () => i) : i;
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
export {
|
|
320
|
+
Le as default,
|
|
321
|
+
Oe as menuEmits,
|
|
322
|
+
Se as menuProps
|
|
323
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed as u } from "vue";
|
|
2
|
+
function i(n, p) {
|
|
3
|
+
const r = u(() => {
|
|
4
|
+
let e = n.parent;
|
|
5
|
+
const t = [p.value];
|
|
6
|
+
for (; !["ElMenu", "EpMenu"].includes(e.type.name); )
|
|
7
|
+
e.props.index && t.unshift(e.props.index), e = e.parent;
|
|
8
|
+
return t;
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
parentMenu: u(() => {
|
|
12
|
+
let e = n.parent;
|
|
13
|
+
for (; e && !["ElMenu", "EpMenu", "ElSubMenu", "EpSubMenu"].includes(e.type.name); )
|
|
14
|
+
e = e.parent;
|
|
15
|
+
return e;
|
|
16
|
+
}),
|
|
17
|
+
indexPath: r
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
i as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as _, getCurrentInstance as $, inject as M, toRef as g, computed as B, reactive as S, onMounted as O, onBeforeUnmount as P, openBlock as a, createElementBlock as E, normalizeClass as I, unref as e, createBlock as T, withCtx as b, createElementVNode as U, renderSlot as i, Fragment as j } from "vue";
|
|
2
|
+
import { ElTooltip as w } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tooltip/index.js";
|
|
3
|
+
import { throwError as C } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/error.js";
|
|
4
|
+
import { useNamespace as N } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
5
|
+
import J from "../menu/use-menu.js";
|
|
6
|
+
import { menuItemEmits as K, menuItemProps as Y } from "./menu-item.js";
|
|
7
|
+
import { MENU_INJECTION_KEY as z, SUB_MENU_INJECTION_KEY as A } from "../menu/tokens.js";
|
|
8
|
+
const c = "EpMenuItem", Q = /* @__PURE__ */ _({
|
|
9
|
+
name: c,
|
|
10
|
+
__name: "EpMenuItem",
|
|
11
|
+
props: Y,
|
|
12
|
+
emits: K,
|
|
13
|
+
setup(k, { expose: v, emit: h }) {
|
|
14
|
+
const n = k, x = h, y = $(), t = M(z), u = N("menu"), r = N("menu-item");
|
|
15
|
+
t || C(c, "can not inject root menu");
|
|
16
|
+
const { parentMenu: p, indexPath: d } = J(y, g(n, "index")), l = M(
|
|
17
|
+
`${A}${p.value.uid}`
|
|
18
|
+
);
|
|
19
|
+
l || C(c, "can not inject sub menu");
|
|
20
|
+
const m = B(() => n.index === t.activeIndex), s = S({
|
|
21
|
+
index: n.index,
|
|
22
|
+
indexPath: d,
|
|
23
|
+
active: m
|
|
24
|
+
}), f = () => {
|
|
25
|
+
n.disabled || (t.handleMenuItemClick({
|
|
26
|
+
index: n.index,
|
|
27
|
+
indexPath: d.value,
|
|
28
|
+
route: n.route
|
|
29
|
+
}), x("click", s));
|
|
30
|
+
};
|
|
31
|
+
return O(() => {
|
|
32
|
+
l.addSubMenu(s), t.addMenuItem(s);
|
|
33
|
+
}), P(() => {
|
|
34
|
+
l.removeSubMenu(s), t.removeMenuItem(s);
|
|
35
|
+
}), v({
|
|
36
|
+
parentMenu: p,
|
|
37
|
+
rootMenu: t,
|
|
38
|
+
active: m,
|
|
39
|
+
nsMenu: u,
|
|
40
|
+
nsMenuItem: r,
|
|
41
|
+
handleClick: f
|
|
42
|
+
}), (o, F) => (a(), E("li", {
|
|
43
|
+
class: I([
|
|
44
|
+
e(r).b(),
|
|
45
|
+
e(r).is("active", m.value),
|
|
46
|
+
e(r).is("disabled", o.disabled)
|
|
47
|
+
]),
|
|
48
|
+
role: "menuitem",
|
|
49
|
+
tabindex: "-1",
|
|
50
|
+
onClick: f
|
|
51
|
+
}, [
|
|
52
|
+
(e(p).type.name === "ElMenu" || e(p).type.name === "EpMenu") && e(t).props.collapse && o.$slots.title ? (a(), T(e(w), {
|
|
53
|
+
key: 0,
|
|
54
|
+
effect: e(t).props.popperEffect,
|
|
55
|
+
placement: "right",
|
|
56
|
+
"fallback-placements": ["left"],
|
|
57
|
+
"popper-class": e(t).props.popperClass,
|
|
58
|
+
"popper-style": e(t).props.popperStyle,
|
|
59
|
+
persistent: e(t).props.persistent,
|
|
60
|
+
"focus-on-target": ""
|
|
61
|
+
}, {
|
|
62
|
+
content: b(() => [
|
|
63
|
+
i(o.$slots, "title")
|
|
64
|
+
]),
|
|
65
|
+
default: b(() => [
|
|
66
|
+
U("div", {
|
|
67
|
+
class: I(e(u).be("tooltip", "trigger"))
|
|
68
|
+
}, [
|
|
69
|
+
i(o.$slots, "default")
|
|
70
|
+
], 2)
|
|
71
|
+
]),
|
|
72
|
+
_: 3
|
|
73
|
+
}, 8, ["effect", "popper-class", "popper-style", "persistent"])) : (a(), E(j, { key: 1 }, [
|
|
74
|
+
i(o.$slots, "default"),
|
|
75
|
+
i(o.$slots, "title")
|
|
76
|
+
], 64))
|
|
77
|
+
], 2));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
Q as default
|
|
82
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
export declare const EpMenuItem: typeof
|
|
2
|
+
import _EpMenuItem from './EpMenuItem.vue';
|
|
3
|
+
export declare const EpMenuItem: typeof _EpMenuItem & Plugin;
|
|
4
4
|
export default EpMenuItem;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { withInstall as m } from "../../utils/with-install.js";
|
|
2
|
+
import t from "./EpMenuItem.vue.js";
|
|
3
|
+
const i = m(
|
|
4
|
+
t,
|
|
5
|
+
"ep-menu-item"
|
|
6
|
+
);
|
|
5
7
|
export {
|
|
6
8
|
i as EpMenuItem
|
|
7
9
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
/** unique identification */
|
|
3
|
+
index: {
|
|
4
|
+
type: String,
|
|
5
|
+
required: !0
|
|
6
|
+
},
|
|
7
|
+
/** Vue Router object */
|
|
8
|
+
route: {
|
|
9
|
+
type: [String, Object]
|
|
10
|
+
},
|
|
11
|
+
/** whether disabled */
|
|
12
|
+
disabled: Boolean
|
|
13
|
+
}, r = {
|
|
14
|
+
click: (e) => typeof e.index == "string" && Array.isArray(e.indexPath)
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
r as menuItemEmits,
|
|
18
|
+
t as menuItemProps
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as p, openBlock as o, createElementBlock as r, normalizeClass as n, unref as s, createElementVNode as l, Fragment as a, createTextVNode as i, toDisplayString as u, renderSlot as m } from "vue";
|
|
2
|
+
import { useNamespace as c } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
3
|
+
import { menuItemGroupProps as d } from "./menu-item-group.js";
|
|
4
|
+
const v = /* @__PURE__ */ p({
|
|
5
|
+
name: "EpMenuItemGroup",
|
|
6
|
+
__name: "EpMenuItemGroup",
|
|
7
|
+
props: d,
|
|
8
|
+
setup(f) {
|
|
9
|
+
const t = c("menu-item-group");
|
|
10
|
+
return (e, E) => (o(), r("li", {
|
|
11
|
+
class: n(s(t).b())
|
|
12
|
+
}, [
|
|
13
|
+
l("div", {
|
|
14
|
+
class: n(s(t).e("title"))
|
|
15
|
+
}, [
|
|
16
|
+
e.$slots.title ? m(e.$slots, "title", {}, void 0, void 0, 1) : (o(), r(a, { key: 0 }, [
|
|
17
|
+
i(u(e.title), 1)
|
|
18
|
+
], 64))
|
|
19
|
+
], 2),
|
|
20
|
+
l("ul", null, [
|
|
21
|
+
m(e.$slots, "default")
|
|
22
|
+
])
|
|
23
|
+
], 2));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
v as default
|
|
28
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
export declare const EpMenuItemGroup: typeof
|
|
2
|
+
import _EpMenuItemGroup from './EpMenuItemGroup.vue';
|
|
3
|
+
export declare const EpMenuItemGroup: typeof _EpMenuItemGroup & Plugin;
|
|
4
4
|
export default EpMenuItemGroup;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { withInstall as m } from "../../utils/with-install.js";
|
|
2
|
+
import o from "./EpMenuItemGroup.vue.js";
|
|
3
|
+
const r = m(
|
|
4
|
+
o,
|
|
5
|
+
"ep-menu-item-group"
|
|
6
|
+
);
|
|
5
7
|
export {
|
|
6
|
-
|
|
8
|
+
r as EpMenuItemGroup
|
|
7
9
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { withInstall as o } from "../../utils/with-install.js";
|
|
2
|
+
import p from "./sub-menu.js";
|
|
3
|
+
const e = o(
|
|
4
|
+
p,
|
|
5
|
+
"ep-sub-menu"
|
|
6
|
+
);
|
|
5
7
|
export {
|
|
6
|
-
|
|
8
|
+
e as EpSubMenu
|
|
7
9
|
};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { defineComponent as X, getCurrentInstance as ee, computed as n, inject as A, ref as f, reactive as oe, watch as te, provide as ne, onMounted as le, onBeforeUnmount as ae, h as u, Fragment as ue, withDirectives as re, vShow as se, nextTick as ie } from "vue";
|
|
2
|
+
import { ElCollapseTransition as pe } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/collapse-transition/index.js";
|
|
3
|
+
import { ElTooltip as ce } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tooltip/index.js";
|
|
4
|
+
import { ElIcon as de } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index.js";
|
|
5
|
+
import { focusElement as me } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/aria.js";
|
|
6
|
+
import { isUndefined as ve } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/types.js";
|
|
7
|
+
import { throwError as F } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/error.js";
|
|
8
|
+
import { buildProps as fe, definePropType as he } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/props/runtime.js";
|
|
9
|
+
import { iconPropType as I } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/icon.js";
|
|
10
|
+
import { useNamespace as U } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
11
|
+
import { ArrowDown as be, ArrowRight as Me } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.40_typescript@5.9.3_/node_modules/@element-plus/icons-vue/dist/index.js";
|
|
12
|
+
import Ce from "../menu/use-menu.js";
|
|
13
|
+
import { useMenuCssVar as Ie } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/menu/src/use-menu-css-var.js";
|
|
14
|
+
import { MENU_INJECTION_KEY as Te, SUB_MENU_INJECTION_KEY as R } from "../menu/tokens.js";
|
|
15
|
+
import { isString as ge } from "../../node_modules/.pnpm/@vue_shared@3.5.40/node_modules/@vue/shared/dist/shared.esm-bundler.js";
|
|
16
|
+
const D = (o, r) => {
|
|
17
|
+
const T = setTimeout(o, r);
|
|
18
|
+
return { stop: () => clearTimeout(T) };
|
|
19
|
+
}, xe = fe({
|
|
20
|
+
/** unique identification */
|
|
21
|
+
index: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: !0
|
|
24
|
+
},
|
|
25
|
+
/** timeout before showing a sub-menu */
|
|
26
|
+
showTimeout: Number,
|
|
27
|
+
/** timeout before hiding a sub-menu */
|
|
28
|
+
hideTimeout: Number,
|
|
29
|
+
/** custom class name for the popup menu */
|
|
30
|
+
popperClass: String,
|
|
31
|
+
/** custom style for the popup menu */
|
|
32
|
+
popperStyle: {
|
|
33
|
+
type: he([String, Object])
|
|
34
|
+
},
|
|
35
|
+
/** whether the sub-menu is disabled */
|
|
36
|
+
disabled: Boolean,
|
|
37
|
+
/** whether popup menu is teleported to the body */
|
|
38
|
+
teleported: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
/** offset of the popper (overrides the `popper` of menu) */
|
|
43
|
+
popperOffset: Number,
|
|
44
|
+
/** Icon when menu are expanded and submenu are closed */
|
|
45
|
+
expandCloseIcon: {
|
|
46
|
+
type: I
|
|
47
|
+
},
|
|
48
|
+
/** Icon when menu are expanded and submenu are opened */
|
|
49
|
+
expandOpenIcon: {
|
|
50
|
+
type: I
|
|
51
|
+
},
|
|
52
|
+
/** Icon when menu are collapsed and submenu are closed */
|
|
53
|
+
collapseCloseIcon: {
|
|
54
|
+
type: I
|
|
55
|
+
},
|
|
56
|
+
/** Icon when menu are collapsed and submenu are opened */
|
|
57
|
+
collapseOpenIcon: {
|
|
58
|
+
type: I
|
|
59
|
+
}
|
|
60
|
+
}), P = "EpSubMenu", Ue = X({
|
|
61
|
+
name: P,
|
|
62
|
+
props: xe,
|
|
63
|
+
setup(o, { slots: r, expose: T }) {
|
|
64
|
+
const g = ee(), { indexPath: h, parentMenu: N } = Ce(
|
|
65
|
+
g,
|
|
66
|
+
n(() => o.index)
|
|
67
|
+
), i = U("menu"), d = U("sub-menu"), e = A(Te);
|
|
68
|
+
e || F(P, "can not inject root menu");
|
|
69
|
+
const l = A(
|
|
70
|
+
`${R}${N.value.uid}`
|
|
71
|
+
);
|
|
72
|
+
l || F(P, "can not inject sub menu");
|
|
73
|
+
const H = f({}), x = f({});
|
|
74
|
+
let p;
|
|
75
|
+
const _ = f(!1), J = f(), k = f(), b = n(() => l.level === 0), z = n(
|
|
76
|
+
() => m.value === "horizontal" && b.value ? "bottom-start" : "right-start"
|
|
77
|
+
), S = n(() => m.value === "horizontal" && b.value || m.value === "vertical" && !e.props.collapse ? o.expandCloseIcon && o.expandOpenIcon ? c.value ? o.expandOpenIcon : o.expandCloseIcon : be : o.collapseCloseIcon && o.collapseOpenIcon ? c.value ? o.collapseOpenIcon : o.collapseCloseIcon : Me), y = n(() => {
|
|
78
|
+
const t = o.teleported;
|
|
79
|
+
return ve(t) ? b.value : t;
|
|
80
|
+
}), K = n(
|
|
81
|
+
() => e.props.collapse ? `${i.namespace.value}-zoom-in-left` : `${i.namespace.value}-zoom-in-top`
|
|
82
|
+
), Y = n(
|
|
83
|
+
() => m.value === "horizontal" && b.value ? [
|
|
84
|
+
"bottom-start",
|
|
85
|
+
"bottom-end",
|
|
86
|
+
"top-start",
|
|
87
|
+
"top-end",
|
|
88
|
+
"right-start",
|
|
89
|
+
"left-start"
|
|
90
|
+
] : [
|
|
91
|
+
"right-start",
|
|
92
|
+
"right",
|
|
93
|
+
"right-end",
|
|
94
|
+
"left-start",
|
|
95
|
+
"bottom-start",
|
|
96
|
+
"bottom-end",
|
|
97
|
+
"top-start",
|
|
98
|
+
"top-end"
|
|
99
|
+
]
|
|
100
|
+
), c = n(() => e.openedMenus.includes(o.index)), E = n(
|
|
101
|
+
() => [...Object.values(H.value), ...Object.values(x.value)].some(
|
|
102
|
+
({ active: t }) => t
|
|
103
|
+
)
|
|
104
|
+
), m = n(() => e.props.mode), q = n(() => e.props.persistent), M = oe({
|
|
105
|
+
index: o.index,
|
|
106
|
+
indexPath: h,
|
|
107
|
+
active: E
|
|
108
|
+
}), $ = Ie(e.props, l.level + 1), L = n(
|
|
109
|
+
() => o.popperOffset ?? e.props.popperOffset
|
|
110
|
+
), j = n(
|
|
111
|
+
() => o.popperClass ?? e.props.popperClass
|
|
112
|
+
), V = n(
|
|
113
|
+
() => o.popperStyle ?? e.props.popperStyle
|
|
114
|
+
), Z = n(
|
|
115
|
+
() => o.showTimeout ?? e.props.showTimeout
|
|
116
|
+
), G = n(
|
|
117
|
+
() => o.hideTimeout ?? e.props.hideTimeout
|
|
118
|
+
), Q = () => {
|
|
119
|
+
var t, s, a;
|
|
120
|
+
return (a = (s = (t = k.value) == null ? void 0 : t.popperRef) == null ? void 0 : s.popperInstanceRef) == null ? void 0 : a.destroy();
|
|
121
|
+
}, W = (t) => {
|
|
122
|
+
t || Q();
|
|
123
|
+
}, B = () => {
|
|
124
|
+
e.props.menuTrigger === "hover" && e.props.mode === "horizontal" || e.props.collapse && e.props.mode === "vertical" || o.disabled || e.handleSubMenuClick({
|
|
125
|
+
index: o.index,
|
|
126
|
+
indexPath: h.value,
|
|
127
|
+
active: E.value
|
|
128
|
+
});
|
|
129
|
+
}, C = (t, s = Z.value) => {
|
|
130
|
+
var a;
|
|
131
|
+
if (t.type !== "focus") {
|
|
132
|
+
if (e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || o.disabled) {
|
|
133
|
+
l.mouseInChild.value = !0;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
l.mouseInChild.value = !0, p == null || p(), { stop: p } = D(() => {
|
|
137
|
+
e.openMenu(o.index, h.value);
|
|
138
|
+
}, s), y.value && ((a = N.value.vnode.el) == null || a.dispatchEvent(new MouseEvent("mouseenter"))), t.type === "mouseenter" && t.target && ie(() => {
|
|
139
|
+
me(t.target, { preventScroll: !0 });
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, O = (t = !1) => {
|
|
143
|
+
var s;
|
|
144
|
+
if (e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical") {
|
|
145
|
+
l.mouseInChild.value = !1;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
p == null || p(), l.mouseInChild.value = !1, { stop: p } = D(
|
|
149
|
+
() => !_.value && e.closeMenu(o.index, h.value),
|
|
150
|
+
G.value
|
|
151
|
+
), y.value && t && ((s = l.handleMouseleave) == null || s.call(l, !0));
|
|
152
|
+
};
|
|
153
|
+
te(
|
|
154
|
+
() => e.props.collapse,
|
|
155
|
+
(t) => W(!!t)
|
|
156
|
+
);
|
|
157
|
+
{
|
|
158
|
+
const t = (a) => {
|
|
159
|
+
x.value[a.index] = a;
|
|
160
|
+
}, s = (a) => {
|
|
161
|
+
delete x.value[a.index];
|
|
162
|
+
};
|
|
163
|
+
ne(`${R}${g.uid}`, {
|
|
164
|
+
addSubMenu: t,
|
|
165
|
+
removeSubMenu: s,
|
|
166
|
+
handleMouseleave: O,
|
|
167
|
+
mouseInChild: _,
|
|
168
|
+
level: l.level + 1
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return T({
|
|
172
|
+
opened: c
|
|
173
|
+
}), le(() => {
|
|
174
|
+
e.addSubMenu(M), l.addSubMenu(M);
|
|
175
|
+
}), ae(() => {
|
|
176
|
+
l.removeSubMenu(M), e.removeSubMenu(M);
|
|
177
|
+
}), () => {
|
|
178
|
+
var a;
|
|
179
|
+
const t = [
|
|
180
|
+
(a = r.title) == null ? void 0 : a.call(r),
|
|
181
|
+
u(
|
|
182
|
+
de,
|
|
183
|
+
{
|
|
184
|
+
class: d.e("icon-arrow"),
|
|
185
|
+
style: {
|
|
186
|
+
transform: c.value ? o.expandCloseIcon && o.expandOpenIcon || o.collapseCloseIcon && o.collapseOpenIcon && e.props.collapse ? "none" : "rotateZ(180deg)" : "none"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
default: () => ge(S.value) ? u(g.appContext.components[S.value]) : u(S.value)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
], s = e.isMenuPopup ? u(
|
|
194
|
+
ce,
|
|
195
|
+
{
|
|
196
|
+
ref: k,
|
|
197
|
+
visible: c.value,
|
|
198
|
+
effect: "light",
|
|
199
|
+
pure: !0,
|
|
200
|
+
offset: L.value,
|
|
201
|
+
showArrow: !1,
|
|
202
|
+
persistent: q.value,
|
|
203
|
+
popperClass: j.value,
|
|
204
|
+
popperStyle: V.value,
|
|
205
|
+
placement: z.value,
|
|
206
|
+
teleported: y.value,
|
|
207
|
+
fallbackPlacements: Y.value,
|
|
208
|
+
transition: K.value,
|
|
209
|
+
gpuAcceleration: !1
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
content: () => {
|
|
213
|
+
var v;
|
|
214
|
+
return u(
|
|
215
|
+
"div",
|
|
216
|
+
{
|
|
217
|
+
class: [
|
|
218
|
+
i.m(m.value),
|
|
219
|
+
i.m("popup-container"),
|
|
220
|
+
j.value
|
|
221
|
+
],
|
|
222
|
+
onMouseenter: (w) => C(w, 100),
|
|
223
|
+
onMouseleave: () => O(!0),
|
|
224
|
+
onFocus: (w) => C(w, 100)
|
|
225
|
+
},
|
|
226
|
+
[
|
|
227
|
+
u(
|
|
228
|
+
"ul",
|
|
229
|
+
{
|
|
230
|
+
class: [
|
|
231
|
+
i.b(),
|
|
232
|
+
i.m("popup"),
|
|
233
|
+
i.m(`popup-${z.value}`)
|
|
234
|
+
],
|
|
235
|
+
style: $.value
|
|
236
|
+
},
|
|
237
|
+
[(v = r.default) == null ? void 0 : v.call(r)]
|
|
238
|
+
)
|
|
239
|
+
]
|
|
240
|
+
);
|
|
241
|
+
},
|
|
242
|
+
default: () => u(
|
|
243
|
+
"div",
|
|
244
|
+
{
|
|
245
|
+
class: d.e("title"),
|
|
246
|
+
onClick: B
|
|
247
|
+
},
|
|
248
|
+
t
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
) : u(ue, {}, [
|
|
252
|
+
u(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
class: d.e("title"),
|
|
256
|
+
ref: J,
|
|
257
|
+
onClick: B
|
|
258
|
+
},
|
|
259
|
+
t
|
|
260
|
+
),
|
|
261
|
+
u(
|
|
262
|
+
pe,
|
|
263
|
+
{},
|
|
264
|
+
{
|
|
265
|
+
default: () => {
|
|
266
|
+
var v;
|
|
267
|
+
return re(
|
|
268
|
+
u(
|
|
269
|
+
"ul",
|
|
270
|
+
{
|
|
271
|
+
role: "menu",
|
|
272
|
+
class: [i.b(), i.m("inline")],
|
|
273
|
+
style: $.value
|
|
274
|
+
},
|
|
275
|
+
[(v = r.default) == null ? void 0 : v.call(r)]
|
|
276
|
+
),
|
|
277
|
+
[[se, c.value]]
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
]);
|
|
283
|
+
return u(
|
|
284
|
+
"li",
|
|
285
|
+
{
|
|
286
|
+
class: [
|
|
287
|
+
d.b(),
|
|
288
|
+
d.is("active", E.value),
|
|
289
|
+
d.is("opened", c.value),
|
|
290
|
+
d.is("disabled", o.disabled)
|
|
291
|
+
],
|
|
292
|
+
role: "menuitem",
|
|
293
|
+
ariaHaspopup: !0,
|
|
294
|
+
ariaExpanded: c.value,
|
|
295
|
+
onMouseenter: C,
|
|
296
|
+
onMouseleave: () => O(),
|
|
297
|
+
onFocus: C
|
|
298
|
+
},
|
|
299
|
+
[s]
|
|
300
|
+
);
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
export {
|
|
305
|
+
Ue as default,
|
|
306
|
+
xe as subMenuProps
|
|
307
|
+
};
|