vft 0.0.427 → 0.0.429
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/index.css +1 -1
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/dialog/use-dialog.js +21 -21
- package/es/components/horizontal-menu/index.d.ts +2 -10
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/md-container/md-container.vue2.js +106 -75
- package/es/components/md-container/use/index.d.ts +0 -1
- package/es/components/md-container/use/index.js +2 -4
- package/es/components/menu/index.d.ts +8 -0
- package/es/components/menu/menu-item.vue.d.ts +2 -2
- package/es/components/menu/menu-item.vue2.js +9 -10
- package/es/components/menu/menu.vue.d.ts +5 -1
- package/es/components/menu/menu.vue2.js +89 -82
- package/es/components/menu/sub-menu.vue.d.ts +3 -3
- package/es/components/menu/sub-menu.vue2.js +20 -24
- package/es/components/side-menu/index.d.ts +21 -0
- package/es/components/side-menu/index.js +3 -4
- package/es/components/side-menu/side-menu.vue.d.ts +12 -0
- package/es/components/side-menu/side-menu.vue2.js +157 -136
- package/es/components/side-menu/types.d.ts +3 -3
- package/es/components/side-menu/types.js +1 -1
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/dialog/use-dialog.cjs +1 -1
- package/lib/components/horizontal-menu/index.d.ts +2 -10
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/use/index.cjs +1 -1
- package/lib/components/md-container/use/index.d.ts +0 -1
- package/lib/components/menu/index.d.ts +8 -0
- package/lib/components/menu/menu-item.vue.d.ts +2 -2
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/menu.vue.d.ts +5 -1
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue.d.ts +3 -3
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/side-menu/index.cjs +1 -1
- package/lib/components/side-menu/index.d.ts +21 -0
- package/lib/components/side-menu/side-menu.vue.d.ts +12 -0
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/side-menu/types.cjs +1 -1
- package/lib/components/side-menu/types.d.ts +3 -3
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/theme-style/index.css +1 -1
- package/theme-style/src/md-container.scss +30 -3
- package/theme-style/vft-md-container.css +1 -1
- package/web-types.json +1 -1
- package/es/components/md-container/use/useActiveHeaderLinks.d.ts +0 -7
- package/es/components/md-container/use/useActiveHeaderLinks.js +0 -52
- package/lib/components/md-container/use/useActiveHeaderLinks.cjs +0 -1
- package/lib/components/md-container/use/useActiveHeaderLinks.d.ts +0 -7
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, useSlots as X, getCurrentInstance as Y, ref as i, computed as Z, watch as y, watchEffect as _, provide as N, reactive as ee, onMounted as te, h as g, nextTick as ne } from "vue";
|
|
2
2
|
import { isNullOrUndefined as R, isMobile as le } from "@vft/utils";
|
|
3
3
|
import { VftIcon as oe } from "../icon/index.js";
|
|
4
4
|
import { useResizeObserver as ue } from "@vueuse/core";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
|
-
import { flattedChildren as
|
|
7
|
+
import { flattedChildren as ae } from "../../utils/vue/vnode.js";
|
|
8
8
|
import "../form/index.js";
|
|
9
9
|
import { useNamespace as w } from "../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import ie from "./menu-collapse-transition.vue.js";
|
|
14
|
+
import se from "./sub-menu.vue2.js";
|
|
15
15
|
import { useMenuCssVar as ce } from "./use-menu-css-var.js";
|
|
16
16
|
import re from "./utils/menu-bar.js";
|
|
17
|
-
const de =
|
|
17
|
+
const de = E({
|
|
18
18
|
name: "vft-menu"
|
|
19
|
-
}),
|
|
19
|
+
}), Ae = /* @__PURE__ */ E({
|
|
20
20
|
...de,
|
|
21
21
|
props: {
|
|
22
22
|
mode: { default: "vertical" },
|
|
@@ -29,64 +29,69 @@ const de = A({
|
|
|
29
29
|
collapseTransition: { type: Boolean, default: !0 },
|
|
30
30
|
ellipsis: { type: Boolean, default: !0 },
|
|
31
31
|
horizontalMenuProps: {},
|
|
32
|
-
persistent: { type: Boolean, default: !0 }
|
|
32
|
+
persistent: { type: Boolean, default: !0 },
|
|
33
|
+
disableSubMenuAction: { type: Boolean, default: !1 }
|
|
33
34
|
},
|
|
34
35
|
emits: ["update:collapse", "sub-menu-click", "select", "close", "open"],
|
|
35
|
-
setup(n, { expose:
|
|
36
|
-
const v =
|
|
36
|
+
setup(n, { expose: W, emit: V }) {
|
|
37
|
+
const v = V, M = w("menu"), $ = X(), h = Y(), I = h.appContext.config.globalProperties.$router, s = i(), z = w("sub-menu"), f = i(-1), a = i(
|
|
37
38
|
n.defaultOpeneds && !n.collapse ? n.defaultOpeneds.slice(0) : []
|
|
38
|
-
),
|
|
39
|
-
const e =
|
|
39
|
+
), u = i(n.defaultActive), r = i({}), p = i({}), q = Z(() => n.mode === "horizontal" || n.mode === "vertical" && n.collapse), D = () => {
|
|
40
|
+
const e = u.value && r.value[u.value];
|
|
40
41
|
if (!e || n.mode === "horizontal" || n.collapse) return;
|
|
41
42
|
e.indexPath.forEach((l) => {
|
|
42
|
-
const o =
|
|
43
|
+
const o = p.value[l];
|
|
43
44
|
o && b(l, o.indexPath);
|
|
44
45
|
});
|
|
45
46
|
}, b = (e, t, l) => {
|
|
46
|
-
|
|
47
|
+
a.value.includes(e) || (n.uniqueOpened && (a.value = a.value.filter(
|
|
47
48
|
(o) => t.includes(o)
|
|
48
|
-
)),
|
|
49
|
+
)), a.value.push(e), v("open", { index: e, indexPath: t, e: l }));
|
|
49
50
|
}, x = (e, t, l) => {
|
|
50
|
-
const o =
|
|
51
|
-
o !== -1 &&
|
|
52
|
-
},
|
|
51
|
+
const o = a.value.indexOf(e);
|
|
52
|
+
o !== -1 && a.value.splice(o, 1), v("close", { index: e, indexPath: t, event: l });
|
|
53
|
+
}, L = ({
|
|
53
54
|
e,
|
|
54
55
|
index: t,
|
|
55
56
|
indexPath: l,
|
|
56
57
|
isFirstLevel: o = !1
|
|
57
58
|
}) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
if (!o) {
|
|
60
|
+
const c = a.value.includes(t);
|
|
61
|
+
u.value = t, n.disableSubMenuAction || (c ? x(t, l, e) : b(t, l, e));
|
|
62
|
+
}
|
|
63
|
+
v("sub-menu-click", { e, index: t, indexPath: l });
|
|
64
|
+
}, F = (e) => {
|
|
65
|
+
(n.mode === "horizontal" || n.collapse) && (a.value = []);
|
|
61
66
|
const { index: t, indexPath: l } = e;
|
|
62
67
|
if (!(R(t) || R(l))) {
|
|
63
|
-
if (n.router &&
|
|
64
|
-
const o = e.route || t, c =
|
|
68
|
+
if (n.router && I) {
|
|
69
|
+
const o = e.route || t, c = I.push(o).then((d) => (d || (u.value = t), d));
|
|
65
70
|
v("select", e, c);
|
|
66
71
|
} else
|
|
67
|
-
|
|
72
|
+
u.value = t, v("select", e);
|
|
68
73
|
le() && setTimeout(() => {
|
|
69
|
-
|
|
74
|
+
a.value = [];
|
|
70
75
|
}, 100);
|
|
71
76
|
}
|
|
72
|
-
},
|
|
73
|
-
const t = r.value, l = t[e] ||
|
|
74
|
-
l ?
|
|
77
|
+
}, C = (e) => {
|
|
78
|
+
const t = r.value, l = t[e] || u.value && t[u.value] || t[n.defaultActive];
|
|
79
|
+
l ? u.value = l.index : u.value = e;
|
|
75
80
|
}, U = () => {
|
|
76
|
-
if (!
|
|
77
|
-
const e = Array.from(
|
|
81
|
+
if (!s.value) return -1;
|
|
82
|
+
const e = Array.from(s.value?.childNodes ?? []).filter(
|
|
78
83
|
(S) => S.nodeName !== "#text" || S.nodeValue
|
|
79
84
|
), t = 64, l = Number.parseInt(
|
|
80
|
-
getComputedStyle(
|
|
85
|
+
getComputedStyle(s.value).paddingLeft,
|
|
81
86
|
10
|
|
82
87
|
), o = Number.parseInt(
|
|
83
|
-
getComputedStyle(
|
|
88
|
+
getComputedStyle(s.value).paddingRight,
|
|
84
89
|
10
|
|
85
|
-
), c =
|
|
86
|
-
let d = 0,
|
|
90
|
+
), c = s.value.clientWidth - l - o;
|
|
91
|
+
let d = 0, m = 0;
|
|
87
92
|
return e.forEach((S, Q) => {
|
|
88
|
-
d += S.offsetWidth || 0, d <= c - t && (
|
|
89
|
-
}),
|
|
93
|
+
d += S.offsetWidth || 0, d <= c - t && (m = Q + 1);
|
|
94
|
+
}), m === e.length ? -1 : m;
|
|
90
95
|
}, j = (e, t = 33.34) => {
|
|
91
96
|
let l;
|
|
92
97
|
return () => {
|
|
@@ -95,85 +100,87 @@ const de = A({
|
|
|
95
100
|
}, t);
|
|
96
101
|
};
|
|
97
102
|
};
|
|
98
|
-
let
|
|
99
|
-
const
|
|
103
|
+
let T = !0;
|
|
104
|
+
const O = () => {
|
|
100
105
|
const e = () => {
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
f.value = -1, ne(() => {
|
|
107
|
+
f.value = U();
|
|
103
108
|
});
|
|
104
109
|
};
|
|
105
|
-
|
|
110
|
+
T ? e() : j(e)(), T = !1;
|
|
106
111
|
};
|
|
107
|
-
|
|
112
|
+
y(
|
|
108
113
|
() => n.defaultActive,
|
|
109
114
|
(e) => {
|
|
110
|
-
r.value[e] || (
|
|
115
|
+
r.value[e] || (u.value = ""), C(e);
|
|
111
116
|
}
|
|
112
|
-
),
|
|
117
|
+
), y(
|
|
113
118
|
() => n.collapse,
|
|
114
119
|
(e) => {
|
|
115
|
-
e && (
|
|
120
|
+
e && (a.value = []);
|
|
116
121
|
}
|
|
117
|
-
),
|
|
118
|
-
let
|
|
122
|
+
), y(r.value, D);
|
|
123
|
+
let k;
|
|
119
124
|
_(() => {
|
|
120
|
-
n.mode === "horizontal" && n.ellipsis ?
|
|
125
|
+
n.mode === "horizontal" && n.ellipsis ? k = ue(s, O).stop : k?.();
|
|
121
126
|
});
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
delete
|
|
127
|
+
const A = (e) => {
|
|
128
|
+
p.value[e.index] = e;
|
|
129
|
+
}, B = (e) => {
|
|
130
|
+
delete p.value[e.index];
|
|
126
131
|
}, G = (e) => {
|
|
127
132
|
r.value[e.index] = e;
|
|
128
133
|
}, H = (e) => {
|
|
129
134
|
delete r.value[e.index];
|
|
130
|
-
},
|
|
135
|
+
}, P = i(!1), J = i(), K = i();
|
|
131
136
|
return N(
|
|
132
137
|
"rootMenu",
|
|
133
138
|
ee({
|
|
134
|
-
props:
|
|
135
|
-
openedMenus:
|
|
139
|
+
props: h.props,
|
|
140
|
+
openedMenus: a,
|
|
136
141
|
items: r,
|
|
137
|
-
subMenus:
|
|
138
|
-
activeIndex:
|
|
139
|
-
isMenuPopup:
|
|
140
|
-
inSubMenu:
|
|
142
|
+
subMenus: p,
|
|
143
|
+
activeIndex: u,
|
|
144
|
+
isMenuPopup: q,
|
|
145
|
+
inSubMenu: P,
|
|
141
146
|
inSubMenuMouseEnterTimer: J,
|
|
142
147
|
inSubMenuMouseleaveTimer: K,
|
|
143
148
|
addMenuItem: G,
|
|
144
149
|
removeMenuItem: H,
|
|
145
|
-
addSubMenu:
|
|
146
|
-
removeSubMenu:
|
|
150
|
+
addSubMenu: A,
|
|
151
|
+
removeSubMenu: B,
|
|
147
152
|
openMenu: b,
|
|
148
153
|
closeMenu: x,
|
|
149
|
-
handleMenuItemClick:
|
|
150
|
-
handleSubMenuClick:
|
|
154
|
+
handleMenuItemClick: F,
|
|
155
|
+
handleSubMenuClick: L
|
|
151
156
|
})
|
|
152
|
-
), N(`subMenu:${
|
|
153
|
-
addSubMenu:
|
|
154
|
-
removeSubMenu:
|
|
155
|
-
mouseInChild:
|
|
157
|
+
), N(`subMenu:${h.uid}`, {
|
|
158
|
+
addSubMenu: A,
|
|
159
|
+
removeSubMenu: B,
|
|
160
|
+
mouseInChild: i(!1),
|
|
156
161
|
// 表示当前是第一级的 sub-menu
|
|
157
162
|
level: 0
|
|
158
163
|
}), te(() => {
|
|
159
|
-
n.mode === "horizontal" && new re(
|
|
160
|
-
}),
|
|
164
|
+
n.mode === "horizontal" && new re(h.vnode.el, M.namespace.value);
|
|
165
|
+
}), W({
|
|
161
166
|
open: (e) => {
|
|
162
|
-
const { indexPath: t } =
|
|
167
|
+
const { indexPath: t } = p.value[e];
|
|
163
168
|
t.forEach((l) => b(l, t));
|
|
164
169
|
},
|
|
165
170
|
close: x,
|
|
166
|
-
handleResize:
|
|
167
|
-
menu:
|
|
168
|
-
inSubMenu:
|
|
171
|
+
handleResize: O,
|
|
172
|
+
menu: s,
|
|
173
|
+
inSubMenu: P,
|
|
174
|
+
updateActiveIndex: C,
|
|
175
|
+
activeIndex: u
|
|
169
176
|
}), () => {
|
|
170
|
-
let e =
|
|
177
|
+
let e = $.default?.() ?? [];
|
|
171
178
|
const t = [];
|
|
172
|
-
if (n.mode === "horizontal" &&
|
|
173
|
-
const c =
|
|
174
|
-
|
|
179
|
+
if (n.mode === "horizontal" && s.value) {
|
|
180
|
+
const c = ae(e), d = f.value === -1 ? c : c.slice(0, f.value), m = f.value === -1 ? [] : c.slice(f.value);
|
|
181
|
+
m?.length && n.ellipsis && (e = d, t.push(
|
|
175
182
|
g(
|
|
176
|
-
|
|
183
|
+
se,
|
|
177
184
|
{
|
|
178
185
|
index: "sub-menu-more",
|
|
179
186
|
class: z.e("hide-arrow"),
|
|
@@ -184,17 +191,17 @@ const de = A({
|
|
|
184
191
|
icon: "icon-menu-line",
|
|
185
192
|
class: z.e("icon-more")
|
|
186
193
|
}),
|
|
187
|
-
default: () =>
|
|
194
|
+
default: () => m
|
|
188
195
|
}
|
|
189
196
|
)
|
|
190
197
|
));
|
|
191
198
|
}
|
|
192
|
-
const l = ce(
|
|
199
|
+
const l = ce(h.props, 0), o = g(
|
|
193
200
|
"ul",
|
|
194
201
|
{
|
|
195
202
|
key: String(n.collapse),
|
|
196
203
|
role: "menubar",
|
|
197
|
-
ref:
|
|
204
|
+
ref: s,
|
|
198
205
|
style: l.value,
|
|
199
206
|
class: {
|
|
200
207
|
[M.b()]: !0,
|
|
@@ -204,10 +211,10 @@ const de = A({
|
|
|
204
211
|
},
|
|
205
212
|
[...e, ...t]
|
|
206
213
|
);
|
|
207
|
-
return n.collapseTransition && n.mode === "vertical" ? g(
|
|
214
|
+
return n.collapseTransition && n.mode === "vertical" ? g(ie, () => o) : o;
|
|
208
215
|
};
|
|
209
216
|
}
|
|
210
217
|
});
|
|
211
218
|
export {
|
|
212
|
-
|
|
219
|
+
Ae as default
|
|
213
220
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ToolTipProps } from 'vft/es/components/tooltip';
|
|
2
|
+
import type { IconProps } from 'vft/es/components/icon';
|
|
3
|
+
import type { ClassType } from '../types';
|
|
4
4
|
export interface SubMenuProps {
|
|
5
5
|
index: string;
|
|
6
6
|
showTimeout?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Z, getCurrentInstance as le, computed as l, inject as D, ref as C, reactive as ue, watch as ae, provide as se, onMounted as re, onBeforeUnmount as ie, useSlots as ce, h as s, Fragment as pe, withDirectives as
|
|
1
|
+
import { defineComponent as Z, getCurrentInstance as le, computed as l, inject as D, ref as C, reactive as ue, watch as ae, provide as se, onMounted as re, onBeforeUnmount as ie, useSlots as ce, h as s, Fragment as pe, withDirectives as me, vShow as de } from "vue";
|
|
2
2
|
import { singleAttrToObj as g, renderTNode as ve, isMobile as fe } from "@vft/utils";
|
|
3
3
|
import { VftTooltip as Me } from "../tooltip/index.js";
|
|
4
4
|
import { VftIcon as L } from "../icon/index.js";
|
|
@@ -34,12 +34,8 @@ const Ce = Z({
|
|
|
34
34
|
popperOffset: {
|
|
35
35
|
default: 6
|
|
36
36
|
},
|
|
37
|
-
expandIcon: {
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
collapseIcon: {
|
|
41
|
-
default: () => ({})
|
|
42
|
-
},
|
|
37
|
+
expandIcon: {},
|
|
38
|
+
collapseIcon: {},
|
|
43
39
|
title: {},
|
|
44
40
|
icon: {},
|
|
45
41
|
showArrow: {
|
|
@@ -57,16 +53,16 @@ const Ce = Z({
|
|
|
57
53
|
expose: q,
|
|
58
54
|
emit: G
|
|
59
55
|
}) {
|
|
60
|
-
const y = w("sub-menu"),
|
|
56
|
+
const y = G, I = w("sub-menu"), m = le(), {
|
|
61
57
|
indexPath: f,
|
|
62
58
|
parentMenu: k
|
|
63
|
-
} = he(
|
|
64
|
-
e || U(
|
|
59
|
+
} = he(m, l(() => o.index)), i = w("menu"), u = w("sub-menu"), e = D("rootMenu");
|
|
60
|
+
e || U(I.b(), "can not inject root menu");
|
|
65
61
|
const r = D(`subMenu:${k.value.uid}`);
|
|
66
|
-
r || U(
|
|
62
|
+
r || U(I.b(), "can not inject sub menu");
|
|
67
63
|
const S = C({});
|
|
68
64
|
let M;
|
|
69
|
-
const z = C(!1), J = C(), E = C(null), A = l(() => p.value === "horizontal" && b.value ? "bottom-start" : "right-start"), b = l(() => r.level === 0), x = l(() => o.teleported === void 0 ? b.value : o.teleported), K = l(() => e.props.collapse ? `${i.namespace.value}-zoom-in-left` : `${i.namespace.value}-zoom-in-top`), Q = l(() => p.value === "horizontal" && b.value ? ["bottom-start", "bottom-end", "top-start", "top-end", "right-start", "left-start"] : ["right-start", "left-start", "bottom-start", "bottom-end", "top-start", "top-end"]), c = l(() => e.openedMenus.includes(o.index)),
|
|
65
|
+
const z = C(!1), J = C(), E = C(null), A = l(() => p.value === "horizontal" && b.value ? "bottom-start" : "right-start"), b = l(() => r.level === 0), x = l(() => o.teleported === void 0 ? b.value : o.teleported), K = l(() => e.props.collapse ? `${i.namespace.value}-zoom-in-left` : `${i.namespace.value}-zoom-in-top`), Q = l(() => p.value === "horizontal" && b.value ? ["bottom-start", "bottom-end", "top-start", "top-end", "right-start", "left-start"] : ["right-start", "left-start", "bottom-start", "bottom-end", "top-start", "top-end"]), c = l(() => e.openedMenus.includes(o.index)), d = l(() => {
|
|
70
66
|
let t = !1;
|
|
71
67
|
return Object.values(S.value).forEach((a) => {
|
|
72
68
|
a.active && (t = !0);
|
|
@@ -74,12 +70,12 @@ const Ce = Z({
|
|
|
74
70
|
}), B = l(() => e.props.backgroundColor || ""), P = l(() => e.props.activeTextColor || ""), F = l(() => e.props.textColor || ""), p = l(() => e.props.mode), W = l(() => e.props.persistent), h = ue({
|
|
75
71
|
index: o.index,
|
|
76
72
|
indexPath: f,
|
|
77
|
-
active:
|
|
73
|
+
active: d
|
|
78
74
|
}), j = Te(e.props, r.level + 1), $ = l(() => p.value !== "horizontal" ? {
|
|
79
75
|
color: F.value
|
|
80
76
|
} : {
|
|
81
|
-
borderBottomColor:
|
|
82
|
-
color:
|
|
77
|
+
borderBottomColor: d.value ? e.props.activeTextColor ? P.value : "" : "transparent",
|
|
78
|
+
color: d.value ? P.value : F.value
|
|
83
79
|
}), X = () => E.value?.popperRef?.popperInstanceRef?.destroy(), Y = (t) => {
|
|
84
80
|
t || X();
|
|
85
81
|
}, O = (t) => {
|
|
@@ -87,7 +83,7 @@ const Ce = Z({
|
|
|
87
83
|
e: t,
|
|
88
84
|
index: o.index,
|
|
89
85
|
indexPath: f.value,
|
|
90
|
-
active:
|
|
86
|
+
active: d.value
|
|
91
87
|
};
|
|
92
88
|
if (e.props.menuTrigger === "hover" && e.props.mode === "horizontal" && !fe() || e.props.collapse && e.props.mode === "vertical" || o.disabled) {
|
|
93
89
|
e.handleSubMenuClick({
|
|
@@ -102,7 +98,7 @@ const Ce = Z({
|
|
|
102
98
|
stop: M
|
|
103
99
|
} = H(() => {
|
|
104
100
|
e.openMenu(o.index, f.value);
|
|
105
|
-
}, a), x.value && k.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter")),
|
|
101
|
+
}, a), x.value && k.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter")), y("mouseenter", t)));
|
|
106
102
|
}, _ = () => {
|
|
107
103
|
e.inSubMenuMouseEnterTimer && clearTimeout(e.inSubMenuMouseEnterTimer), e.inSubMenuMouseleaveTimer && clearTimeout(e.inSubMenuMouseleaveTimer), e.inSubMenuMouseEnterTimer = setTimeout(() => {
|
|
108
104
|
e.inSubMenu = !0;
|
|
@@ -116,7 +112,7 @@ const Ce = Z({
|
|
|
116
112
|
stop: M
|
|
117
113
|
} = H(() => {
|
|
118
114
|
!z.value && e.closeMenu(o.index, f.value);
|
|
119
|
-
}, o.hideTimeout), x.value && a &&
|
|
115
|
+
}, o.hideTimeout), x.value && a && m.parent?.type.name === "vft-sub-menu" && r.handleMouseleave?.(t, !0), y("mouseleave", t));
|
|
120
116
|
};
|
|
121
117
|
ae(() => e.props.collapse, (t) => Y(!!t));
|
|
122
118
|
{
|
|
@@ -125,7 +121,7 @@ const Ce = Z({
|
|
|
125
121
|
}, a = (n) => {
|
|
126
122
|
delete S.value[n.index];
|
|
127
123
|
};
|
|
128
|
-
se(`subMenu:${
|
|
124
|
+
se(`subMenu:${m.uid}`, {
|
|
129
125
|
addSubMenu: t,
|
|
130
126
|
removeSubMenu: a,
|
|
131
127
|
handleMouseleave: T,
|
|
@@ -148,13 +144,13 @@ const Ce = Z({
|
|
|
148
144
|
icon: "icon-arrow-right",
|
|
149
145
|
size: 18,
|
|
150
146
|
...te.value
|
|
151
|
-
}), R = l(() => ve(
|
|
147
|
+
}), R = l(() => ve(m, "title"));
|
|
152
148
|
return () => {
|
|
153
149
|
const t = [N.value?.icon ? s(L, {
|
|
154
150
|
...N.value
|
|
155
151
|
}) : null, s("span", {
|
|
156
152
|
class: [u.e("text"), u.is("arrow", o.showArrow)],
|
|
157
|
-
title:
|
|
153
|
+
title: m.props.title
|
|
158
154
|
}, R.value), o.showArrow ? s(L, {
|
|
159
155
|
class: u.e("icon-arrow"),
|
|
160
156
|
...ne.value,
|
|
@@ -205,15 +201,15 @@ const Ce = Z({
|
|
|
205
201
|
ref: J,
|
|
206
202
|
onClick: O
|
|
207
203
|
}, t) : null, s(be, {}, {
|
|
208
|
-
default: () =>
|
|
204
|
+
default: () => me(s("ul", {
|
|
209
205
|
role: "menu",
|
|
210
206
|
class: [i.b(), i.m("inline")],
|
|
211
207
|
style: j.value
|
|
212
|
-
}, [V.default?.()]), [[
|
|
208
|
+
}, [V.default?.()]), [[de, c.value]])
|
|
213
209
|
})])
|
|
214
210
|
);
|
|
215
211
|
return s("li", {
|
|
216
|
-
class: [u.b(), u.is("active",
|
|
212
|
+
class: [u.b(), u.is("active", d.value), u.e(String(r.level)), u.is("in-popup", r.level !== 0), u.is("opened", c.value), u.is("arrow", !0), u.is("disabled", o.disabled)],
|
|
217
213
|
role: "menuitem",
|
|
218
214
|
ariaHaspopup: !0,
|
|
219
215
|
ariaExpanded: c.value,
|
|
@@ -25,6 +25,10 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
25
25
|
type: import("vue").PropType<boolean>;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
|
+
disableSubMenuAction: {
|
|
29
|
+
type: import("vue").PropType<boolean>;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
28
32
|
isFixedLeft: {
|
|
29
33
|
type: import("vue").PropType<boolean>;
|
|
30
34
|
default: boolean;
|
|
@@ -75,6 +79,10 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
75
79
|
type: import("vue").PropType<boolean>;
|
|
76
80
|
default: boolean;
|
|
77
81
|
};
|
|
82
|
+
defaultOpenedsLevel: {
|
|
83
|
+
type: import("vue").PropType<number | boolean>;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
78
86
|
}>, {
|
|
79
87
|
sideRef: import("vue").Ref<any, any>;
|
|
80
88
|
jumpActiveDom: ({ activeDom, offset, delay }?: {
|
|
@@ -82,6 +90,7 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
82
90
|
offset?: number | undefined;
|
|
83
91
|
delay?: number | undefined;
|
|
84
92
|
}) => void;
|
|
93
|
+
menuRef: import("vue").Ref<any, any>;
|
|
85
94
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
86
95
|
"update:collapse": (val: boolean) => void;
|
|
87
96
|
"update:width": (val: string | number) => void;
|
|
@@ -92,6 +101,7 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
92
101
|
indexPath: string[];
|
|
93
102
|
}) => void;
|
|
94
103
|
subMenuClick: (val: any) => void;
|
|
104
|
+
subMenuOpenClick: (val: any) => void;
|
|
95
105
|
menuItemMouseenter: (val: any) => void;
|
|
96
106
|
menuItemMouseleave: (val: any) => void;
|
|
97
107
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -121,6 +131,10 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
121
131
|
type: import("vue").PropType<boolean>;
|
|
122
132
|
default: boolean;
|
|
123
133
|
};
|
|
134
|
+
disableSubMenuAction: {
|
|
135
|
+
type: import("vue").PropType<boolean>;
|
|
136
|
+
default: boolean;
|
|
137
|
+
};
|
|
124
138
|
isFixedLeft: {
|
|
125
139
|
type: import("vue").PropType<boolean>;
|
|
126
140
|
default: boolean;
|
|
@@ -171,6 +185,10 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
171
185
|
type: import("vue").PropType<boolean>;
|
|
172
186
|
default: boolean;
|
|
173
187
|
};
|
|
188
|
+
defaultOpenedsLevel: {
|
|
189
|
+
type: import("vue").PropType<number | boolean>;
|
|
190
|
+
default: boolean;
|
|
191
|
+
};
|
|
174
192
|
}>> & Readonly<{
|
|
175
193
|
onSelect?: ((val: {
|
|
176
194
|
route: string;
|
|
@@ -181,6 +199,7 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
181
199
|
onDragEnd?: ((oldIndex: import("sortablejs").SortableEvent, newIndex: import("sortablejs").SortableEvent) => any) | undefined;
|
|
182
200
|
onDragWidthEnd?: (() => any) | undefined;
|
|
183
201
|
onSubMenuClick?: ((val: any) => any) | undefined;
|
|
202
|
+
onSubMenuOpenClick?: ((val: any) => any) | undefined;
|
|
184
203
|
onMenuItemMouseenter?: ((val: any) => any) | undefined;
|
|
185
204
|
onMenuItemMouseleave?: ((val: any) => any) | undefined;
|
|
186
205
|
}>, {
|
|
@@ -188,6 +207,7 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
188
207
|
width: string | number;
|
|
189
208
|
collapse: boolean;
|
|
190
209
|
uniqueOpened: boolean;
|
|
210
|
+
disableSubMenuAction: boolean;
|
|
191
211
|
isFixedLeft: boolean;
|
|
192
212
|
collapseWidth: string | number;
|
|
193
213
|
menuTopBottomHeight: number;
|
|
@@ -200,6 +220,7 @@ export declare const VftSideMenu: import("vft/es/utils").SFCWithInstall<import("
|
|
|
200
220
|
autoScrollActiveDom: boolean | number;
|
|
201
221
|
openMenuCollapse: boolean;
|
|
202
222
|
disabledJudgeTurnOver: boolean;
|
|
223
|
+
defaultOpenedsLevel: number | boolean;
|
|
203
224
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
204
225
|
export default VftSideMenu;
|
|
205
226
|
export * from './types';
|
|
@@ -6,9 +6,8 @@ import { withInstall as t } from "../../utils/vue/install.js";
|
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
8
8
|
import o from "./side-menu.vue2.js";
|
|
9
|
-
|
|
10
|
-
const l = t(o);
|
|
9
|
+
const s = t(o);
|
|
11
10
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
s as VftSideMenu,
|
|
12
|
+
s as default
|
|
14
13
|
};
|
|
@@ -44,6 +44,9 @@ export interface MenuConProps {
|
|
|
44
44
|
defaultActive?: string;
|
|
45
45
|
/** 默认展开 */
|
|
46
46
|
defaultOpeneds?: Array<string | number>;
|
|
47
|
+
defaultOpenedsLevel?: number | boolean;
|
|
48
|
+
/** 禁用子菜单的展开收缩行为 */
|
|
49
|
+
disableSubMenuAction?: boolean;
|
|
47
50
|
}
|
|
48
51
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MenuConProps>, {
|
|
49
52
|
isFixedLeft: boolean;
|
|
@@ -59,6 +62,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
59
62
|
height: string;
|
|
60
63
|
menuTopBottomHeight: number;
|
|
61
64
|
useRouterJump: boolean;
|
|
65
|
+
disableSubMenuAction: boolean;
|
|
66
|
+
defaultOpenedsLevel: boolean;
|
|
62
67
|
}>>, {
|
|
63
68
|
sideRef: import("vue").Ref<any, any>;
|
|
64
69
|
jumpActiveDom: ({ activeDom, offset, delay }?: {
|
|
@@ -66,6 +71,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
66
71
|
offset?: number | undefined;
|
|
67
72
|
delay?: number | undefined;
|
|
68
73
|
}) => void;
|
|
74
|
+
menuRef: import("vue").Ref<any, any>;
|
|
69
75
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
70
76
|
"update:collapse": (val: boolean) => void;
|
|
71
77
|
"update:width": (val: string | number) => void;
|
|
@@ -76,6 +82,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
76
82
|
indexPath: string[];
|
|
77
83
|
}) => void;
|
|
78
84
|
subMenuClick: (val: any) => void;
|
|
85
|
+
subMenuOpenClick: (val: any) => void;
|
|
79
86
|
menuItemMouseenter: (val: any) => void;
|
|
80
87
|
menuItemMouseleave: (val: any) => void;
|
|
81
88
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MenuConProps>, {
|
|
@@ -92,6 +99,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
92
99
|
height: string;
|
|
93
100
|
menuTopBottomHeight: number;
|
|
94
101
|
useRouterJump: boolean;
|
|
102
|
+
disableSubMenuAction: boolean;
|
|
103
|
+
defaultOpenedsLevel: boolean;
|
|
95
104
|
}>>> & Readonly<{
|
|
96
105
|
onSelect?: ((val: {
|
|
97
106
|
route: string;
|
|
@@ -102,6 +111,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
102
111
|
onDragEnd?: ((oldIndex: Sortable.SortableEvent, newIndex: Sortable.SortableEvent) => any) | undefined;
|
|
103
112
|
onDragWidthEnd?: (() => any) | undefined;
|
|
104
113
|
onSubMenuClick?: ((val: any) => any) | undefined;
|
|
114
|
+
onSubMenuOpenClick?: ((val: any) => any) | undefined;
|
|
105
115
|
onMenuItemMouseenter?: ((val: any) => any) | undefined;
|
|
106
116
|
onMenuItemMouseleave?: ((val: any) => any) | undefined;
|
|
107
117
|
}>, {
|
|
@@ -109,6 +119,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
109
119
|
width: string | number;
|
|
110
120
|
collapse: boolean;
|
|
111
121
|
uniqueOpened: boolean;
|
|
122
|
+
disableSubMenuAction: boolean;
|
|
112
123
|
isFixedLeft: boolean;
|
|
113
124
|
collapseWidth: string | number;
|
|
114
125
|
menuTopBottomHeight: number;
|
|
@@ -121,6 +132,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
121
132
|
autoScrollActiveDom: boolean | number;
|
|
122
133
|
openMenuCollapse: boolean;
|
|
123
134
|
disabledJudgeTurnOver: boolean;
|
|
135
|
+
defaultOpenedsLevel: number | boolean;
|
|
124
136
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
125
137
|
export default _default;
|
|
126
138
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|