ep-craft 0.1.15 → 0.1.17
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/dist/components/tab-pane/index.d.ts +2 -2
- package/dist/components/tab-pane/index.js +6 -4
- package/dist/components/tab-pane/tab-pane.d.ts +31 -0
- package/dist/components/tab-pane/tab-pane.js +58 -0
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/index.js +4 -5
- package/dist/components/tabs/tabs.d.ts +111 -0
- package/dist/components/tabs/tabs.js +133 -0
- package/dist/node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/index.js +2 -2
- package/dist/node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/tabs.js +5 -5
- 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
|
};
|