vft 0.0.521 → 0.0.523
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/es/components/full-screen/full-screen.vue2.js +19 -17
- package/es/components/logo/index.d.ts +6 -0
- package/es/components/logo/logo.vue2.js +23 -22
- package/es/components/logo/types.d.ts +2 -0
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +39 -39
- package/es/components/side-menu/side-menu.vue2.js +94 -94
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/logo/index.d.ts +6 -0
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/logo/types.d.ts +2 -0
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/md/table.scss +1 -4
- package/theme-style/vft-autocomplete.css +1 -1
- package/theme-style/vft-button-group.css +1 -1
- package/theme-style/vft-button.css +1 -1
- package/theme-style/vft-cascader.css +1 -1
- package/theme-style/vft-checkbox.css +1 -1
- package/theme-style/vft-color-picker.css +1 -1
- package/theme-style/vft-date-picker.css +1 -1
- package/theme-style/vft-dropdown.css +1 -1
- package/theme-style/vft-input.css +1 -1
- package/theme-style/vft-link.css +1 -1
- package/theme-style/vft-md-container.css +1 -1
- package/theme-style/vft-md-vue-playground.css +1 -1
- package/theme-style/vft-multiple-tabs.css +1 -1
- package/theme-style/vft-popper.css +1 -1
- package/theme-style/vft-radio.css +1 -1
- package/theme-style/vft-result.css +1 -1
- package/theme-style/vft-select.css +1 -1
- package/theme-style/vft-tag.css +1 -1
- package/theme-style/vft-time-picker.css +1 -1
- package/theme-style/vft-time-select.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useFullscreen as
|
|
3
|
-
import { delObjAttrNotExist as
|
|
4
|
-
import { VftIconText as
|
|
1
|
+
import { defineComponent as t, ref as p, onMounted as s, openBlock as a, createBlock as m, unref as o, mergeProps as u } from "vue";
|
|
2
|
+
import { useFullscreen as f } from "@vft/use";
|
|
3
|
+
import { delObjAttrNotExist as d } from "@vft/utils";
|
|
4
|
+
import { VftIconText as x } from "../icon-text/index.js";
|
|
5
5
|
import "@vueuse/core";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
|
-
import { primaryColor as
|
|
7
|
+
import { primaryColor as _ } from "../../utils/ns-cover.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "../form/index.js";
|
|
10
|
-
import { useNamespace as
|
|
10
|
+
import { useNamespace as v } from "../../hooks/use-namespace/index.js";
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
const
|
|
14
|
+
const y = t({
|
|
15
15
|
name: "full-screen"
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
16
|
+
}), E = /* @__PURE__ */ t({
|
|
17
|
+
...y,
|
|
18
18
|
props: {
|
|
19
19
|
text: {},
|
|
20
20
|
icon: {},
|
|
@@ -32,18 +32,20 @@ const _ = r({
|
|
|
32
32
|
clampTooltipCfg: {},
|
|
33
33
|
useClamp: { type: Boolean }
|
|
34
34
|
},
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
-
return (
|
|
38
|
-
|
|
35
|
+
setup(n) {
|
|
36
|
+
const l = n, i = v("full-screen"), { toggle: c, isFullscreen: e } = f(), r = p("");
|
|
37
|
+
return s(() => {
|
|
38
|
+
r.value = _().value;
|
|
39
|
+
}), (B, C) => (a(), m(o(x), u({
|
|
40
|
+
class: o(i).b(),
|
|
39
41
|
distance: 2,
|
|
40
|
-
"hover-color":
|
|
41
|
-
onClick: o(
|
|
42
|
+
"hover-color": r.value,
|
|
43
|
+
onClick: o(c),
|
|
42
44
|
icon: o(e) ? "icon-exit-full-screen" : "icon-full-screen",
|
|
43
45
|
text: o(e) ? "退出全屏" : "全屏"
|
|
44
|
-
}, o(
|
|
46
|
+
}, o(d)(l, !0, !0), { pointer: "" }), null, 16, ["class", "hover-color", "onClick", "icon", "text"]));
|
|
45
47
|
}
|
|
46
48
|
});
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
E as default
|
|
49
51
|
};
|
|
@@ -5,6 +5,9 @@ export declare const VftLogo: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
5
5
|
logo: {
|
|
6
6
|
type: import("vue").PropType<string>;
|
|
7
7
|
};
|
|
8
|
+
alt: {
|
|
9
|
+
type: import("vue").PropType<string>;
|
|
10
|
+
};
|
|
8
11
|
jumpPath: {
|
|
9
12
|
type: import("vue").PropType<string>;
|
|
10
13
|
};
|
|
@@ -15,6 +18,9 @@ export declare const VftLogo: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
15
18
|
logo: {
|
|
16
19
|
type: import("vue").PropType<string>;
|
|
17
20
|
};
|
|
21
|
+
alt: {
|
|
22
|
+
type: import("vue").PropType<string>;
|
|
23
|
+
};
|
|
18
24
|
jumpPath: {
|
|
19
25
|
type: import("vue").PropType<string>;
|
|
20
26
|
};
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as r, computed as o, getCurrentInstance as k, openBlock as l, createElementBlock as n, normalizeStyle as p, normalizeClass as i, unref as c, createCommentVNode as a, toDisplayString as C } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as h } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
import { useRouterHelper as
|
|
12
|
-
const y = ["src"],
|
|
11
|
+
import { useRouterHelper as v } from "@vft/router";
|
|
12
|
+
const y = ["src", "alt"], P = r({
|
|
13
13
|
name: "vft-logo"
|
|
14
|
-
}), R = /* @__PURE__ */
|
|
15
|
-
...
|
|
14
|
+
}), R = /* @__PURE__ */ r({
|
|
15
|
+
...P,
|
|
16
16
|
props: {
|
|
17
17
|
title: {},
|
|
18
18
|
logo: {},
|
|
19
|
+
alt: {},
|
|
19
20
|
jumpPath: { default: "/" }
|
|
20
21
|
},
|
|
21
22
|
setup(t) {
|
|
22
|
-
const e =
|
|
23
|
-
function
|
|
24
|
-
t.jumpPath &&
|
|
23
|
+
const m = o(() => t.alt || t.title || "Logo"), e = h("logo"), s = o(() => [e.b()]), u = k().appContext.config.globalProperties.$router, { go: g } = v(u);
|
|
24
|
+
function f() {
|
|
25
|
+
t.jumpPath && g(t.jumpPath);
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
+
const d = o(
|
|
27
28
|
() => t.jumpPath ? {} : e.cssVarBlock({ cursor: "inital" })
|
|
28
29
|
);
|
|
29
|
-
return (
|
|
30
|
+
return (x, B) => t.logo || t.title ? (l(), n("div", {
|
|
30
31
|
key: 0,
|
|
31
|
-
class:
|
|
32
|
-
onClick:
|
|
33
|
-
style: d
|
|
32
|
+
class: i(s.value),
|
|
33
|
+
onClick: f,
|
|
34
|
+
style: p(d.value)
|
|
34
35
|
}, [
|
|
35
|
-
t.logo ? (
|
|
36
|
+
t.logo ? (l(), n("img", {
|
|
36
37
|
key: 0,
|
|
37
|
-
class:
|
|
38
|
+
class: i(c(e).e("img")),
|
|
38
39
|
src: t.logo,
|
|
39
|
-
alt:
|
|
40
|
-
}, null, 10, y)) :
|
|
41
|
-
t.title ? (
|
|
40
|
+
alt: m.value
|
|
41
|
+
}, null, 10, y)) : a("", !0),
|
|
42
|
+
t.title ? (l(), n("div", {
|
|
42
43
|
key: 1,
|
|
43
|
-
class:
|
|
44
|
-
},
|
|
45
|
-
], 6)) :
|
|
44
|
+
class: i(c(e).e("title"))
|
|
45
|
+
}, C(t.title), 3)) : a("", !0)
|
|
46
|
+
], 6)) : a("", !0);
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, getCurrentInstance as q, computed as
|
|
1
|
+
import { defineComponent as B, getCurrentInstance as q, computed as v, ref as h, unref as t, watchEffect as G, onMounted as J, openBlock as T, createElementBlock as P, normalizeStyle as O, normalizeClass as V, createVNode as b, createSlots as Q, withCtx as R, Fragment as X, renderList as Y, createBlock as Z, renderSlot as ee, createElementVNode as te } from "vue";
|
|
2
2
|
import { VftTabs as ae, VftTabPane as ne } from "../tabs/index.js";
|
|
3
3
|
import { VftIcon as w } from "../icon/index.js";
|
|
4
4
|
import { isClient as oe } from "@vueuse/core";
|
|
@@ -11,7 +11,7 @@ import { useNamespace as le } from "../../hooks/use-namespace/index.js";
|
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
import {
|
|
14
|
+
import { getRouterKeyPath as f, useRouterHelper as ie, listenerRouteChange as re } from "@vft/router";
|
|
15
15
|
import { useMultipleTabStore as se, isTabPinned as $, useTabs as ue } from "@vft/store";
|
|
16
16
|
import { useRefs as ce } from "@vft/use";
|
|
17
17
|
import fe from "hotkeys-js";
|
|
@@ -32,24 +32,24 @@ const be = B({
|
|
|
32
32
|
fixExtraScrollWidth: {}
|
|
33
33
|
},
|
|
34
34
|
setup(u) {
|
|
35
|
-
const
|
|
35
|
+
const C = le("multiple-tabs"), r = q().appContext.config.globalProperties.$router, I = ve(r), l = se(), m = v(
|
|
36
36
|
() => l.getTabList.filter((e) => !e.meta?.hideTab && $(e)).length
|
|
37
|
-
), L =
|
|
38
|
-
() => Math.max(u.fixTabCount,
|
|
39
|
-
),
|
|
37
|
+
), L = v(
|
|
38
|
+
() => Math.max(u.fixTabCount, m.value)
|
|
39
|
+
), s = h(f(t(r.currentRoute)) || ""), i = h(0), p = h(), { go: y } = ie(r), d = v(() => l.getTabList.filter((e) => !e.meta?.hideTab));
|
|
40
40
|
G(() => {
|
|
41
|
-
if (
|
|
42
|
-
const e =
|
|
43
|
-
e === -1 ? i.value =
|
|
41
|
+
if (s.value) {
|
|
42
|
+
const e = d.value.findIndex((n) => f(n) === s.value);
|
|
43
|
+
e === -1 ? i.value = d.value?.length - 1 : i.value = e, i.value = i.value < m.value ? m.value - 1 : i.value;
|
|
44
44
|
}
|
|
45
45
|
}), oe && me(() => {
|
|
46
|
-
p.value = t(
|
|
46
|
+
p.value = t(r.currentRoute);
|
|
47
47
|
}), re(({ route: e }) => {
|
|
48
48
|
if (!e || e.meta?.hasTokenToRoot)
|
|
49
49
|
return;
|
|
50
|
-
const { meta: n = {} } = e, { currentActivePath: a, hideTab: c } = n, W = c ? a : null,
|
|
51
|
-
if (
|
|
52
|
-
const k =
|
|
50
|
+
const { meta: n = {} } = e, { currentActivePath: a, hideTab: c } = n, W = c ? a : null, g = f(e);
|
|
51
|
+
if (g && s.value !== g && (s.value = g), W) {
|
|
52
|
+
const k = r.getRoutes().find((j) => j.path === a);
|
|
53
53
|
k && l.addTab(
|
|
54
54
|
k,
|
|
55
55
|
t(p),
|
|
@@ -59,22 +59,22 @@ const be = B({
|
|
|
59
59
|
} else c || l.addTab(t(e), t(p), i.value);
|
|
60
60
|
});
|
|
61
61
|
function N(e) {
|
|
62
|
-
if (
|
|
62
|
+
if (s.value === e.paneName)
|
|
63
63
|
return;
|
|
64
|
-
const n =
|
|
65
|
-
|
|
64
|
+
const n = d.value[e.attrs.index];
|
|
65
|
+
s.value = e.paneName;
|
|
66
66
|
const a = n?.meta?.hideActiveRoute?.fullPath;
|
|
67
|
-
|
|
67
|
+
y(a || n.fullPath || n.path);
|
|
68
68
|
}
|
|
69
69
|
function _(e) {
|
|
70
|
-
l.closeTabByKey(e,
|
|
70
|
+
l.closeTabByKey(e, r);
|
|
71
71
|
}
|
|
72
72
|
const { refs: E, setRefs: F } = ce();
|
|
73
73
|
function A(e) {
|
|
74
74
|
const n = e.pane.attrs.index, a = e.event;
|
|
75
75
|
E.value[n].handleContext(a);
|
|
76
76
|
}
|
|
77
|
-
const z =
|
|
77
|
+
const z = v(() => {
|
|
78
78
|
const e = {
|
|
79
79
|
padding: "4px 0 0",
|
|
80
80
|
"border-bottom": "none",
|
|
@@ -100,41 +100,41 @@ const be = B({
|
|
|
100
100
|
),
|
|
101
101
|
...u.contextMenuStyle
|
|
102
102
|
}, K = () => {
|
|
103
|
-
l.toggleFullScreen(l.getTabList[i.value],
|
|
104
|
-
}, x =
|
|
105
|
-
let
|
|
103
|
+
l.toggleFullScreen(l.getTabList[i.value], r);
|
|
104
|
+
}, x = h(!1);
|
|
105
|
+
let S;
|
|
106
106
|
const U = () => {
|
|
107
|
-
clearInterval(
|
|
107
|
+
clearInterval(S), x.value = !0, l.refreshPage(0, r, l.getTabList[i.value]), S = setTimeout(() => {
|
|
108
108
|
x.value = !1;
|
|
109
109
|
}, 500);
|
|
110
110
|
};
|
|
111
111
|
return J(() => {
|
|
112
112
|
u.canDrag && he(I), fe("command+e, ctrl+e", () => (D(), !1));
|
|
113
|
-
}), (e, n) => (
|
|
114
|
-
class: V(t(
|
|
113
|
+
}), (e, n) => (T(), P("div", {
|
|
114
|
+
class: V(t(C).b()),
|
|
115
115
|
style: O(z.value)
|
|
116
116
|
}, [
|
|
117
|
-
|
|
117
|
+
b(t(ae), {
|
|
118
118
|
"show-bar": !1,
|
|
119
119
|
"fix-tab-count": L.value,
|
|
120
120
|
"fix-extra-scroll-width": u.fixExtraScrollWidth,
|
|
121
|
-
modelValue:
|
|
122
|
-
"onUpdate:modelValue": n[0] || (n[0] = (a) =>
|
|
121
|
+
modelValue: s.value,
|
|
122
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => s.value = a),
|
|
123
123
|
onTabClick: N,
|
|
124
124
|
onTabRemove: _,
|
|
125
125
|
onTabContextMenu: A
|
|
126
126
|
}, Q({
|
|
127
|
-
default:
|
|
128
|
-
(
|
|
129
|
-
key: t(
|
|
127
|
+
default: R(() => [
|
|
128
|
+
(T(!0), P(X, null, Y(d.value, (a, c) => (T(), Z(t(ne), {
|
|
129
|
+
key: t(f)(a) + c,
|
|
130
130
|
closable: !t($)(a),
|
|
131
131
|
index: c,
|
|
132
|
-
name: t(
|
|
132
|
+
name: t(f)(a)
|
|
133
133
|
}, {
|
|
134
|
-
label:
|
|
135
|
-
|
|
134
|
+
label: R(() => [
|
|
135
|
+
b(de, {
|
|
136
136
|
"context-menu-style": H,
|
|
137
|
-
"affix-num":
|
|
137
|
+
"affix-num": m.value,
|
|
138
138
|
ref_for: !0,
|
|
139
139
|
ref: t(F)(c),
|
|
140
140
|
"tab-item": a
|
|
@@ -147,19 +147,19 @@ const be = B({
|
|
|
147
147
|
}, [
|
|
148
148
|
u.showNavRight ? {
|
|
149
149
|
name: "navRight",
|
|
150
|
-
fn:
|
|
150
|
+
fn: R(() => [
|
|
151
151
|
ee(e.$slots, "nav-right", {}, () => [
|
|
152
152
|
te("div", {
|
|
153
|
-
class: V(t(
|
|
153
|
+
class: V(t(C).e("nav-right"))
|
|
154
154
|
}, [
|
|
155
|
-
|
|
155
|
+
b(t(w), {
|
|
156
156
|
rotate: x.value,
|
|
157
157
|
"rotate-speed": 1,
|
|
158
158
|
onClick: U,
|
|
159
159
|
icon: "icon-refresh-right",
|
|
160
160
|
pointer: ""
|
|
161
161
|
}, null, 8, ["rotate"]),
|
|
162
|
-
|
|
162
|
+
b(t(w), {
|
|
163
163
|
onClick: K,
|
|
164
164
|
icon: t(l).isFullScreen ? "icon-collapse" : "icon-expand",
|
|
165
165
|
pointer: ""
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as H, toRefs as
|
|
2
|
-
import { VftIcon as
|
|
3
|
-
import { VftMenu as
|
|
1
|
+
import { defineComponent as H, toRefs as ce, useSlots as pe, getCurrentInstance as fe, unref as me, ref as v, computed as b, watch as he, onMounted as ve, nextTick as ge, createVNode as m, h as y, isVNode as be } from "vue";
|
|
2
|
+
import { VftIcon as ye } from "../icon/index.js";
|
|
3
|
+
import { VftMenu as Me, VftSubMenu as Se, VftMenuItem as j, VftMenuItemGroup as Ce } from "../menu/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
|
-
import { isNullOrUndefined as q, isNumber as E, isUrl as
|
|
6
|
-
import { addUnit as
|
|
5
|
+
import { isNullOrUndefined as q, isNumber as E, isUrl as Oe } from "@vft/utils";
|
|
6
|
+
import { addUnit as T } from "../../utils/helper.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../form/index.js";
|
|
9
|
-
import { listenerRouteChange as
|
|
10
|
-
import { useSortable as
|
|
11
|
-
import { useNamespace as
|
|
9
|
+
import { listenerRouteChange as xe, useRouterHelper as Te } from "@vft/router";
|
|
10
|
+
import { useSortable as Be } from "@vft/use/sortable";
|
|
11
|
+
import { useNamespace as _e } from "../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
|
-
import { useDragLine as
|
|
16
|
-
function
|
|
17
|
-
return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !
|
|
15
|
+
import { useDragLine as we } from "./use-drag-line.js";
|
|
16
|
+
function ke(g) {
|
|
17
|
+
return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !be(g);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const De = H({
|
|
20
20
|
name: "vft-side-menu"
|
|
21
|
-
}),
|
|
22
|
-
...
|
|
21
|
+
}), Fe = /* @__PURE__ */ H({
|
|
22
|
+
...De,
|
|
23
23
|
props: {
|
|
24
24
|
isFixedLeft: {
|
|
25
25
|
type: Boolean,
|
|
@@ -106,17 +106,17 @@ const we = H({
|
|
|
106
106
|
},
|
|
107
107
|
emits: ["update:collapse", "update:width", "dragEnd", "dragWidthEnd", "select", "subMenuClick", "subMenuOpenClick", "menuItemMouseenter", "menuItemMouseleave"],
|
|
108
108
|
setup(g, {
|
|
109
|
-
expose:
|
|
110
|
-
emit:
|
|
109
|
+
expose: L,
|
|
110
|
+
emit: P
|
|
111
111
|
}) {
|
|
112
|
-
const t = g, r =
|
|
113
|
-
defaultActive:
|
|
112
|
+
const t = g, r = P, {
|
|
113
|
+
defaultActive: U,
|
|
114
114
|
collapse: f,
|
|
115
|
-
uniqueOpened:
|
|
116
|
-
defaultOpeneds:
|
|
117
|
-
openMenuCollapse:
|
|
115
|
+
uniqueOpened: $,
|
|
116
|
+
defaultOpeneds: F,
|
|
117
|
+
openMenuCollapse: Y,
|
|
118
118
|
defaultOpenedsLevel: M
|
|
119
|
-
} =
|
|
119
|
+
} = ce(t), s = _e("side-menu"), d = pe(), B = fe(), S = B.appContext.config.globalProperties.$router, C = me(S?.currentRoute), _ = v(C?.path && !(C.meta?.hideSide && !t.useRouterJump) ? C.path : void 0), a = b(() => ({
|
|
120
120
|
path: "path",
|
|
121
121
|
children: "children",
|
|
122
122
|
title: "title",
|
|
@@ -124,7 +124,7 @@ const we = H({
|
|
|
124
124
|
icon: "icon",
|
|
125
125
|
disabled: "disabled",
|
|
126
126
|
...t.attrMapping
|
|
127
|
-
})),
|
|
127
|
+
})), Z = (e, n = 1 / 0) => {
|
|
128
128
|
const l = [], o = (u, c = 0) => {
|
|
129
129
|
c >= n || u.forEach((i) => {
|
|
130
130
|
i[a.value.children]?.length && (l.push(i[a.value.index]), o(i[a.value.children], c + 1));
|
|
@@ -132,51 +132,51 @@ const we = H({
|
|
|
132
132
|
};
|
|
133
133
|
return o(e), l;
|
|
134
134
|
};
|
|
135
|
-
|
|
135
|
+
xe(({
|
|
136
136
|
route: e
|
|
137
137
|
}) => {
|
|
138
|
-
!e || e.meta?.hideSide && !t.useRouterJump || (
|
|
138
|
+
!e || e.meta?.hideSide && !t.useRouterJump || e.path && (_.value = e.path);
|
|
139
139
|
});
|
|
140
|
-
const
|
|
140
|
+
const z = (e) => {
|
|
141
141
|
const n = e.e;
|
|
142
142
|
if (t.autoScrollActiveDom && n) {
|
|
143
143
|
const l = E(t.autoScrollActiveDom) ? t.autoScrollActiveDom : 0, o = n.target;
|
|
144
|
-
|
|
144
|
+
w({
|
|
145
145
|
activeDom: o,
|
|
146
146
|
offset: l
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
r("subMenuOpenClick", e);
|
|
150
|
-
},
|
|
150
|
+
}, G = (e) => {
|
|
151
151
|
r("subMenuClick", e);
|
|
152
|
-
},
|
|
152
|
+
}, w = ({
|
|
153
153
|
activeDom: e = null,
|
|
154
154
|
offset: n = 0,
|
|
155
155
|
delay: l = 300
|
|
156
156
|
} = {}) => {
|
|
157
|
-
|
|
157
|
+
h.value?.menu && setTimeout(() => {
|
|
158
158
|
const o = e || document.querySelector(".vft-menu-item.is-active") || document.querySelector(".vft-sub-menu.is-active");
|
|
159
|
-
o && (
|
|
159
|
+
o && (h.value.menu.scrollTop = h.value.menu.scrollTop + (o.getBoundingClientRect().top - h.value.menu.getBoundingClientRect().top) + n);
|
|
160
160
|
}, l);
|
|
161
|
-
}, G = (e) => {
|
|
162
|
-
r("menuItemMouseenter", e);
|
|
163
161
|
}, K = (e) => {
|
|
162
|
+
r("menuItemMouseenter", e);
|
|
163
|
+
}, Q = (e) => {
|
|
164
164
|
r("menuItemMouseleave", e);
|
|
165
|
-
},
|
|
165
|
+
}, X = (e, n) => !t.enableScroll || !e ? e : f.value && n > t.scrollThreshold ? y(Ce, {
|
|
166
166
|
style: {
|
|
167
|
-
maxHeight:
|
|
167
|
+
maxHeight: T(t.scrollMaxHeight),
|
|
168
168
|
overflowY: "auto"
|
|
169
169
|
}
|
|
170
|
-
}, () => e) : e,
|
|
171
|
-
const l = e[a.value.path], o = e[a.value.title], u = e?.[a.value.children], c = e?.[a.value.index], i = e?.[a.value.icon],
|
|
172
|
-
return u?.length ? y(
|
|
170
|
+
}, () => e) : e, k = (e, n) => {
|
|
171
|
+
const l = e[a.value.path], o = e[a.value.title], u = e?.[a.value.children], c = e?.[a.value.index], i = e?.[a.value.icon], I = !!e?.[a.value.disabled], N = t.disabledJudgeTurnOver ? !I : I, V = c || l || n + o;
|
|
172
|
+
return u?.length ? y(Se, {
|
|
173
173
|
...e,
|
|
174
174
|
popperAppendToBody: !0,
|
|
175
|
-
key:
|
|
176
|
-
index:
|
|
175
|
+
key: V,
|
|
176
|
+
index: V,
|
|
177
177
|
title: o,
|
|
178
178
|
icon: i,
|
|
179
|
-
disabled: t.openDisabled &&
|
|
179
|
+
disabled: t.openDisabled && N,
|
|
180
180
|
popperClass: s.e("popper"),
|
|
181
181
|
toolTipCfg: {
|
|
182
182
|
placement: "right",
|
|
@@ -185,24 +185,24 @@ const we = H({
|
|
|
185
185
|
}
|
|
186
186
|
}, {
|
|
187
187
|
default: () => {
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
return p?.[a.value.children]?.length ?
|
|
188
|
+
const ue = u?.map((p, se) => {
|
|
189
|
+
const x = p[a.value.path], W = p[a.value.index], ie = p[a.value.icon], re = p[a.value.title], J = !!p[a.value.disabled], de = t.disabledJudgeTurnOver ? !J : J;
|
|
190
|
+
return p?.[a.value.children]?.length ? k(p, se) : (
|
|
191
191
|
// @ts-ignore
|
|
192
192
|
y(j, {
|
|
193
193
|
...p,
|
|
194
|
-
key:
|
|
195
|
-
index:
|
|
196
|
-
route:
|
|
197
|
-
icon:
|
|
198
|
-
title:
|
|
199
|
-
disabled: t.openDisabled &&
|
|
194
|
+
key: W || x,
|
|
195
|
+
index: W || x,
|
|
196
|
+
route: x,
|
|
197
|
+
icon: ie,
|
|
198
|
+
title: re,
|
|
199
|
+
disabled: t.openDisabled && de
|
|
200
200
|
}, d.menuItem ? () => d.menuItem?.({
|
|
201
201
|
item: p
|
|
202
202
|
}) : "")
|
|
203
203
|
);
|
|
204
204
|
});
|
|
205
|
-
return
|
|
205
|
+
return X(ue, u?.length || 0);
|
|
206
206
|
}
|
|
207
207
|
}) : y(j, {
|
|
208
208
|
...e,
|
|
@@ -211,27 +211,27 @@ const we = H({
|
|
|
211
211
|
title: o,
|
|
212
212
|
route: l,
|
|
213
213
|
icon: i,
|
|
214
|
-
disabled: t.openDisabled &&
|
|
215
|
-
onMouseenter: () =>
|
|
216
|
-
onMouseleave: () =>
|
|
214
|
+
disabled: t.openDisabled && N,
|
|
215
|
+
onMouseenter: () => K(e),
|
|
216
|
+
onMouseleave: () => Q(e)
|
|
217
217
|
}, d.menuItem ? () => d.menuItem?.({
|
|
218
218
|
item: e,
|
|
219
219
|
index: n
|
|
220
220
|
}) : "");
|
|
221
|
-
},
|
|
221
|
+
}, h = v(), ee = b(() => ({
|
|
222
222
|
...t.collapseWidth === 0 && f.value ? {
|
|
223
223
|
width: 0
|
|
224
224
|
} : {},
|
|
225
225
|
height: `calc(100% - ${t.menuTopBottomHeight}px)`
|
|
226
|
-
}))
|
|
227
|
-
function
|
|
226
|
+
}));
|
|
227
|
+
function te(e, n) {
|
|
228
228
|
if (t.useRouterJump) {
|
|
229
229
|
const {
|
|
230
230
|
go: l
|
|
231
|
-
} =
|
|
231
|
+
} = Te(S), o = e.route;
|
|
232
232
|
let u = e.route;
|
|
233
|
-
e.indexPath.some((i) =>
|
|
234
|
-
const c =
|
|
233
|
+
e.indexPath.some((i) => Oe(i)) && (u = e.indexPath.slice(-2).join("/"));
|
|
234
|
+
const c = S.getRoutes().filter((i) => i.path === u)?.[0]?.meta?.linkTarget;
|
|
235
235
|
l(c ? {
|
|
236
236
|
url: o,
|
|
237
237
|
winOpenOpt: {
|
|
@@ -241,27 +241,27 @@ const we = H({
|
|
|
241
241
|
}
|
|
242
242
|
r("select", e, n);
|
|
243
243
|
}
|
|
244
|
-
const
|
|
244
|
+
const O = v(), D = v(), R = v(), le = b(() => ({
|
|
245
245
|
...t.collapseWidth === 0 && f.value ? {
|
|
246
246
|
borderRight: "none"
|
|
247
247
|
} : {},
|
|
248
|
-
width:
|
|
248
|
+
width: T(t.width),
|
|
249
249
|
height: t.height
|
|
250
250
|
}));
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
he(() => f.value, (e) => {
|
|
252
|
+
oe.value || (e ? r("update:width", t.collapseWidth) : r("update:width", R.value || t.width), R.value = t.width);
|
|
253
253
|
});
|
|
254
254
|
const {
|
|
255
|
-
isDraging:
|
|
256
|
-
} =
|
|
257
|
-
left:
|
|
258
|
-
})),
|
|
259
|
-
return
|
|
260
|
-
|
|
255
|
+
isDraging: oe
|
|
256
|
+
} = we(O, D, B), ne = b(() => ({
|
|
257
|
+
left: T(t.width)
|
|
258
|
+
})), ae = b(() => [s.b(), t.isFixedLeft ? s.m("fixed") : ""]), A = v([]);
|
|
259
|
+
return ve(() => {
|
|
260
|
+
ge(() => {
|
|
261
261
|
if (t.dragOption?.dragClassName) {
|
|
262
262
|
const e = document.querySelectorAll(`.${s.e(t.dragOption?.dragClassName)}`)?.[0], {
|
|
263
263
|
initSortable: n
|
|
264
|
-
} =
|
|
264
|
+
} = Be(e, {
|
|
265
265
|
draggable: ".vft-menu-item",
|
|
266
266
|
onEnd: (l) => {
|
|
267
267
|
const {
|
|
@@ -275,53 +275,53 @@ const we = H({
|
|
|
275
275
|
n();
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
|
-
}),
|
|
279
|
-
sideRef:
|
|
280
|
-
jumpActiveDom:
|
|
281
|
-
menuRef:
|
|
278
|
+
}), L({
|
|
279
|
+
sideRef: O,
|
|
280
|
+
jumpActiveDom: w,
|
|
281
|
+
menuRef: h
|
|
282
282
|
}), () => {
|
|
283
283
|
let e;
|
|
284
|
-
return M.value && (A.value =
|
|
285
|
-
ref:
|
|
286
|
-
class:
|
|
287
|
-
style:
|
|
284
|
+
return M.value && (A.value = Z(t.menus, E(M.value) ? M.value : 1 / 0)), m("div", {
|
|
285
|
+
ref: O,
|
|
286
|
+
class: ae.value,
|
|
287
|
+
style: le.value
|
|
288
288
|
}, [d.top ? m("div", {
|
|
289
289
|
class: s.e("top")
|
|
290
|
-
}, [d.top()]) : null, y(m(
|
|
291
|
-
ref:
|
|
292
|
-
onSelect:
|
|
293
|
-
onOpen:
|
|
294
|
-
onSubMenuClick:
|
|
295
|
-
defaultActive:
|
|
296
|
-
defaultOpeneds:
|
|
290
|
+
}, [d.top()]) : null, y(m(Me, {
|
|
291
|
+
ref: h,
|
|
292
|
+
onSelect: te,
|
|
293
|
+
onOpen: z,
|
|
294
|
+
onSubMenuClick: G,
|
|
295
|
+
defaultActive: U?.value || _.value,
|
|
296
|
+
defaultOpeneds: F?.value || A.value,
|
|
297
297
|
disableSubMenuAction: t.disableSubMenuAction,
|
|
298
298
|
class: [s.e("con"), t.dragOption?.dragClassName ? s.e(t.dragOption?.dragClassName) : ""],
|
|
299
|
-
style:
|
|
300
|
-
collapse:
|
|
301
|
-
uniqueOpened:
|
|
299
|
+
style: ee.value,
|
|
300
|
+
collapse: Y.value ? f.value : !1,
|
|
301
|
+
uniqueOpened: $.value,
|
|
302
302
|
collapseTransition: t.collapseTransition,
|
|
303
303
|
collapseType: t.collapseType
|
|
304
|
-
},
|
|
304
|
+
}, ke(e = t.menus.map((n, l) => k(n, l))) ? e : {
|
|
305
305
|
default: () => [e]
|
|
306
306
|
})), d.bottom ? m("div", {
|
|
307
307
|
class: s.e("bottom")
|
|
308
308
|
}, [d.bottom()]) : t.showCollapse ? m("div", {
|
|
309
309
|
onClick: () => r("update:collapse", !f.value),
|
|
310
310
|
class: [s.e("bottom"), s.e("collapse")]
|
|
311
|
-
}, [m(
|
|
311
|
+
}, [m(ye, {
|
|
312
312
|
style: {
|
|
313
313
|
transform: f.value ? "rotateY(180deg)" : ""
|
|
314
314
|
},
|
|
315
315
|
size: 20,
|
|
316
316
|
icon: "icon-sidebar-collapse"
|
|
317
317
|
}, null)]) : null, d.default?.(), t.dragWidthCfg ? m("div", {
|
|
318
|
-
ref:
|
|
319
|
-
style:
|
|
318
|
+
ref: D,
|
|
319
|
+
style: ne.value,
|
|
320
320
|
class: s.e("drag-bar")
|
|
321
321
|
}, null) : null]);
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
325
|
export {
|
|
326
|
-
|
|
326
|
+
Fe as default
|
|
327
327
|
};
|